99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111
12- // / \file pidStudies .cxx
12+ // / \file taskPidStudies .cxx
1313// / \brief task for studies of PID performance
1414// /
1515// / \author Fabrizio Chinu <fabrizio.chinu@cern.ch>, Università and INFN Torino
@@ -49,8 +49,12 @@ DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Candidate mass
4949DECLARE_SOA_COLUMN (Pt, pt, float ); // ! Transverse momentum of the candidate (GeV/c)
5050DECLARE_SOA_COLUMN (PtPos, ptPos, float ); // ! Transverse momentum of positive track (GeV/c)
5151DECLARE_SOA_COLUMN (PtNeg, ptNeg, float ); // ! Transverse momentum of negative track (GeV/c)
52+ DECLARE_SOA_COLUMN (TpcInnerParPos, tpcInnerParPos, float ); // ! Momentum of positive track at inner wall of TPC (GeV/c)
53+ DECLARE_SOA_COLUMN (TpcInnerParNeg, tpcInnerParNeg, float ); // ! Momentum of negative track at inner wall of TPC (GeV/c)
5254DECLARE_SOA_COLUMN (Radius, radius, float ); // ! Radius
5355DECLARE_SOA_COLUMN (Cpa, cpa, float ); // ! Cosine of pointing angle
56+ DECLARE_SOA_COLUMN (DcaV0Daughters, dcaV0Daughters, float ); // ! DCA between V0 daughters
57+ DECLARE_SOA_COLUMN (DcaV0ToPv, dcaV0ToPv, float ); // ! DCA V0 to PV
5458DECLARE_SOA_COLUMN (NSigmaTpcPosPi, nSigmaTpcPosPi, float ); // ! nSigmaTPC of positive track with pion hypothesis
5559DECLARE_SOA_COLUMN (NSigmaTpcNegPi, nSigmaTpcNegPi, float ); // ! nSigmaTPC of negative track with pion hypothesis
5660DECLARE_SOA_COLUMN (NSigmaTpcPosPr, nSigmaTpcPosPr, float ); // ! nSigmaTPC of positive track with proton hypothesis
@@ -66,10 +70,10 @@ DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt
6670DECLARE_SOA_COLUMN (MassOmega, massOmega, float ); // ! Candidate mass
6771DECLARE_SOA_COLUMN (MassXi, massXi, float ); // ! Candidate mass
6872DECLARE_SOA_COLUMN (BachPt, bachPt, float ); // ! Transverse momentum of the bachelor (GeV/c)
73+ DECLARE_SOA_COLUMN (TpcInnerParBach, tpcInnerParBach, float ); // ! Transverse momentum of the bachelor (GeV/c)
74+ DECLARE_SOA_COLUMN (MLambda, mLambda , float ); // ! Daughter lambda mass (GeV/c^2)
6975DECLARE_SOA_COLUMN (V0cosPA, v0cosPA, float ); // ! V0 CPA
70- DECLARE_SOA_COLUMN (CascCosPA, casccosPA, float ); // ! Cascade CPA
71- DECLARE_SOA_COLUMN (DCAV0daughters, dcaV0daughters, float ); // ! DCA of V0 daughters
72- DECLARE_SOA_COLUMN (DCAv0topv, dcav0topv, float ); // ! V0 DCA to PV
76+ DECLARE_SOA_COLUMN (CascCosPa, cascCosPa, float ); // ! Cascade CPA
7377DECLARE_SOA_COLUMN (NSigmaTpcBachKa, nSigmaTpcBachKa, float ); // ! nSigmaTPC of bachelor with kaon hypothesis
7478DECLARE_SOA_COLUMN (NSigmaTofBachKa, nSigmaTofBachKa, float ); // ! nSigmaTOF of bachelor with kaon hypothesis
7579
@@ -88,8 +92,12 @@ DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information
8892 pid_studies::Pt,
8993 pid_studies::PtPos,
9094 pid_studies::PtNeg,
95+ pid_studies::TpcInnerParPos,
96+ pid_studies::TpcInnerParNeg,
9197 pid_studies::Radius,
9298 pid_studies::Cpa,
99+ pid_studies::DcaV0Daughters,
100+ pid_studies::DcaV0ToPv,
93101 pid_studies::NSigmaTpcPosPi,
94102 pid_studies::NSigmaTpcNegPi,
95103 pid_studies::NSigmaTpcPosPr,
@@ -110,11 +118,13 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat
110118 pid_studies::MassOmega,
111119 pid_studies::Pt,
112120 pid_studies::BachPt,
121+ pid_studies::TpcInnerParBach,
122+ pid_studies::MLambda,
113123 pid_studies::V0cosPA,
114124 pid_studies::MassXi,
115- pid_studies::CascCosPA ,
116- pid_studies::DCAV0daughters ,
117- pid_studies::DCAv0topv ,
125+ pid_studies::CascCosPa ,
126+ pid_studies::DcaV0Daughters ,
127+ pid_studies::DcaV0ToPv ,
118128 pid_studies::NSigmaTpcBachKa,
119129 pid_studies::NSigmaTofBachKa,
120130 pid_studies::OccupancyFt0c,
@@ -124,7 +134,7 @@ DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID informat
124134 pid_studies::CandFlag);
125135} // namespace o2::aod
126136
127- struct HfPidStudies {
137+ struct HfTaskPidStudies {
128138 Produces<o2::aod::PidV0s> pidV0;
129139 Produces<o2::aod::PidCascades> pidCascade;
130140
@@ -134,6 +144,8 @@ struct HfPidStudies {
134144 Configurable<float > massLambdaMax{" massLambdaMax" , 1.3 , " Maximum mass for lambda" };
135145 Configurable<float > massOmegaMin{" massOmegaMin" , 1.5 , " Minimum mass for omega" };
136146 Configurable<float > massOmegaMax{" massOmegaMax" , 1.8 , " Maximum mass for omega" };
147+ Configurable<float > qtArmenterosMinForK0{" qtArmenterosMinForK0" , 0.12 , " Minimum Armenteros' qt for K0" };
148+ Configurable<float > qtArmenterosMaxForLambda{" qtArmenterosMaxForLambda" , 0.12 , " Minimum Armenteros' qt for (anti)Lambda" };
137149 Configurable<float > downSampleBkgFactor{" downSampleBkgFactor" , 1 ., " Fraction of candidates to keep" };
138150 Configurable<float > ptMaxForDownSample{" ptMaxForDownSample" , 10 ., " Maximum pt for the application of the downsampling factor" };
139151
@@ -144,6 +156,13 @@ struct HfPidStudies {
144156 using V0sMcRec = soa::Join<aod::V0Datas, aod::V0CoreMCLabels>;
145157 using CascsMcRec = soa::Join<aod::CascDatas, aod::CascCoreMCLabels>;
146158
159+ void init (InitContext&)
160+ {
161+ if ((doprocessV0Mc && doprocessV0Data) || (doprocessCascMc && doprocessCascData)) {
162+ LOGP (fatal, " Both data and MC process functions were enabled! Please check your configuration!" );
163+ }
164+ }
165+
147166 template <bool isV0, typename Cand>
148167 void fillTree (Cand const & candidate, const int flag)
149168 {
@@ -163,8 +182,12 @@ struct HfPidStudies {
163182 candidate.pt (),
164183 posTrack.pt (),
165184 negTrack.pt (),
185+ posTrack.tpcInnerParam (),
186+ negTrack.tpcInnerParam (),
166187 candidate.v0radius (),
167188 candidate.v0cosPA (),
189+ candidate.dcaV0daughters (),
190+ candidate.dcav0topv (),
168191 posTrack.tofNSigmaPi (),
169192 negTrack.tofNSigmaPi (),
170193 posTrack.tofNSigmaPr (),
@@ -186,6 +209,8 @@ struct HfPidStudies {
186209 candidate.mOmega (),
187210 candidate.pt (),
188211 candidate.bachelorpt (),
212+ bachTrack.tpcInnerParam (),
213+ candidate.mLambda (),
189214 candidate.v0cosPA (coll.posX (), coll.posY (), coll.posZ ()),
190215 candidate.mXi (),
191216 candidate.casccosPA (coll.posX (), coll.posY (), coll.posZ ()),
@@ -242,53 +267,101 @@ struct HfPidStudies {
242267 return aod::pid_studies::Particle::NotMatched;
243268 }
244269
245- void processMc (V0sMcRec const & V0s,
246- aod::V0MCCores const &,
247- CascsMcRec const & cascades,
248- aod::CascMCCores const &,
249- CollSels const &,
250- PidTracks const &)
270+ template <typename V0Cand>
271+ bool isSelectedV0AsK0s (const V0Cand& v0)
272+ {
273+ if (v0.mK0Short () < massK0Min || v0.mK0Short () > massK0Max) {
274+ return false ;
275+ }
276+ if (v0.qtarm () < qtArmenterosMinForK0) {
277+ return false ;
278+ }
279+ return true ;
280+ }
281+
282+ template <typename V0Cand>
283+ bool isSelectedV0AsLambda (const V0Cand& v0)
284+ {
285+ if ((v0.mLambda () < massLambdaMin || v0.mLambda () > massLambdaMax) &&
286+ (v0.mAntiLambda () < massLambdaMin || v0.mAntiLambda () > massLambdaMax)) {
287+ return false ;
288+ }
289+ if (v0.qtarm () > qtArmenterosMaxForLambda) {
290+ return false ;
291+ }
292+ return true ;
293+ }
294+
295+ template <typename CascCand>
296+ bool isSelectedCascAsOmega (const CascCand& casc)
297+ {
298+ if (casc.mOmega () < massOmegaMin || casc.mOmega () > massOmegaMax) {
299+ return false ;
300+ }
301+ if (casc.mLambda () < massLambdaMin || casc.mLambda () > massLambdaMax) {
302+ return false ;
303+ }
304+ return true ;
305+ }
306+
307+ void processV0Mc (V0sMcRec const & V0s,
308+ aod::V0MCCores const &,
309+ CollSels const &,
310+ PidTracks const &)
251311 {
252312 for (const auto & v0 : V0s) {
253- if ((v0.mK0Short () > massK0Min && v0.mK0Short () < massK0Max) ||
254- (v0.mLambda () > massLambdaMin && v0.mLambda () < massLambdaMax) ||
255- (v0.mAntiLambda () > massLambdaMin && v0.mAntiLambda () < massLambdaMax)) {
313+ if (isSelectedV0AsK0s (v0) || isSelectedV0AsLambda (v0)) {
256314 int matched = isMatched (v0);
257315 if (matched != aod::pid_studies::Particle::NotMatched) {
258316 fillTree<true >(v0, matched);
259317 }
260318 }
261319 }
320+ }
321+ PROCESS_SWITCH (HfTaskPidStudies, processV0Mc, " Process MC" , true );
322+
323+ void processV0Data (aod::V0Datas const & V0s,
324+ CollSels const &,
325+ PidTracks const &)
326+ {
327+ for (const auto & v0 : V0s) {
328+ if (isSelectedV0AsK0s (v0) || isSelectedV0AsLambda (v0)) {
329+ fillTree<true >(v0, aod::pid_studies::Particle::NotMatched);
330+ }
331+ }
332+ }
333+ PROCESS_SWITCH (HfTaskPidStudies, processV0Data, " Process data" , false );
334+
335+ void processCascMc (CascsMcRec const & cascades,
336+ aod::CascMCCores const &,
337+ CollSels const &,
338+ PidTracks const &)
339+ {
262340 for (const auto & casc : cascades) {
263- if (casc. mOmega () > massOmegaMin && casc. mOmega () < massOmegaMax && casc. mLambda () > massLambdaMin && casc. mLambda () < massLambdaMax ) {
341+ if (isSelectedCascAsOmega ( casc) ) {
264342 int matched = isMatched (casc);
265343 if (matched != aod::pid_studies::Particle::NotMatched) {
266344 fillTree<false >(casc, matched);
267345 }
268346 }
269347 }
270348 }
271- PROCESS_SWITCH (HfPidStudies, processMc , " Process MC" , true );
349+ PROCESS_SWITCH (HfTaskPidStudies, processCascMc , " Process MC" , true );
272350
273- void processData (aod::V0Datas const & V0s, aod::CascDatas const & cascades, CollSels const &, PidTracks const &)
351+ void processCascData (aod::CascDatas const & cascades,
352+ CollSels const &,
353+ PidTracks const &)
274354 {
275- for (const auto & v0 : V0s) {
276- if ((v0.mK0Short () > massK0Min && v0.mK0Short () < massK0Max) ||
277- (v0.mLambda () > massLambdaMin && v0.mLambda () < massLambdaMax) ||
278- (v0.mAntiLambda () > massLambdaMin && v0.mAntiLambda () < massLambdaMax)) {
279- fillTree<true >(v0, aod::pid_studies::Particle::NotMatched);
280- }
281- }
282355 for (const auto & casc : cascades) {
283- if (casc. mOmega () > massOmegaMin && casc. mOmega () < massOmegaMax && casc. mLambda () > massLambdaMin && casc. mLambda () < massLambdaMax ) {
356+ if (isSelectedCascAsOmega ( casc) ) {
284357 fillTree<false >(casc, aod::pid_studies::Particle::NotMatched);
285358 }
286359 }
287360 }
288- PROCESS_SWITCH (HfPidStudies, processData , " Process data" , false );
361+ PROCESS_SWITCH (HfTaskPidStudies, processCascData , " Process data" , false );
289362};
290363
291364WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
292365{
293- return WorkflowSpec{adaptAnalysisTask<HfPidStudies >(cfgc)};
366+ return WorkflowSpec{adaptAnalysisTask<HfTaskPidStudies >(cfgc)};
294367}
0 commit comments