@@ -48,6 +48,7 @@ struct qaEventTrackLite {
4848 ConfigurableAxis binsImpPar{" binsImpPar" , {200 , -0.15 , 0.15 }, " Impact parameter binning (cm)" };
4949 ConfigurableAxis binsEta{" binsEta" , {200 , -2 ., 2 .}, " Eta binning" };
5050 ConfigurableAxis binsPhi{" binsPhi" , {180 , 0 ., 2 * M_PI }, " Phi binning" };
51+ ConfigurableAxis binsVtxZ{" binsVtxZ" , {100 , -20 ., 20 .}, " Vtx Z binning" };
5152
5253 HistogramRegistry histos;
5354
@@ -114,7 +115,9 @@ struct qaEventTrackLite {
114115 Configurable<float > dcaXYmaxSel3{" dcaXYMaxSel3" , 999 ., " Max dca XY sel3" };
115116
116117 // MC selections
117- Configurable<int > pdgCodeSel{" pdgCodeSel" , 2 , " pdgCode based particle selection, 1 defines pi,K,p,mu,e, 2 all final-state charged particles including light (hyper)nuclei" };
118+ Configurable<int > pdgCodeSel{" pdgCodeSel" , 0 , " pdgCode based particle selection. Provide a PDG code required for particles to have. To be used in combo with pdgCodeSelMode" };
119+ Configurable<int > pdgCodeSelMode{" pdgCodeSelMode" , 2 , " multiple pdgCode based particle selection. `1` accepts pi,K,p,mu,e, `2` accepts all final-state charged particles including light (hyper)nuclei" };
120+
118121 Configurable<bool > checkPdgAtReco{" checkPdgAtReco" , false , " check pdg code also at reco levo for data-like reference" };
119122
120123 // TPC dEdx splines
@@ -187,14 +190,15 @@ struct qaEventTrackLite {
187190 const AxisSpec axis1overPt{bins1overPt, " 1/#it{p}_{T} (GeV/c)^{-1}" };
188191 const AxisSpec axisEta{binsEta, " #it{#eta}" };
189192 const AxisSpec axisPhi{binsPhi, " #it{#phi} (rad)" };
193+ const AxisSpec axisVtxZ{binsVtxZ, " Vertex Z (cm)" };
190194
191195 // TPC dEdx splines
192196 betheBlock.setUpBetheBlockAleph (tpcSplinesPeriod);
193197
194198 // kine histograms
195- histos.add (" Tracks/VertexPositionZ" , " " , kTH1D , {{ 100 , - 20 . f , 20 . f , " Vertex Z (cm) " } });
196- histos.add (" Tracks/VertexPositionZvsEta" , " " , kTH2D , {axisEta, { 100 , - 20 . f , 20 . f , " Vertex Z (cm) " } });
197- histos.add (" Tracks/VertexPositionZvsEtaHasITS" , " " , kTH2D , {axisEta, { 100 , - 20 . f , 20 . f , " Vertex Z (cm) " } });
199+ histos.add (" Tracks/VertexPositionZ" , " " , kTH1D , {axisVtxZ });
200+ histos.add (" Tracks/VertexPositionZvsEta" , " " , kTH2D , {axisEta, axisVtxZ });
201+ histos.add (" Tracks/VertexPositionZvsEtaHasITS" , " " , kTH2D , {axisEta, axisVtxZ });
198202 histos.add (" Tracks/Kine/pt" , " #it{p}_{T}" , kTH1D , {axisPt});
199203 histos.add (" Tracks/Kine/eta" , " #eta" , kTH1D , {axisEta});
200204 histos.add (" Tracks/Kine/phi" , " #phi" , kTH1D , {axisPhi});
@@ -281,11 +285,17 @@ struct qaEventTrackLite {
281285 histos.add (" Particles/Kine/pt" , " Particle #it{p}_{T}" , kTH1D , {axisPt});
282286 histos.add (" Particles/Kine/eta" , " Particle #eta" , kTH1D , {axisEta});
283287 histos.add (" Particles/Kine/phi" , " Particle #phi" , kTH1D , {axisPhi});
284- histos.add (" Particle/selPtEtaPhiMCGenPrimary" , " pt eta phi map MC gen Primary; pt,eta,phi" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
285- histos.add (" Particle/selPtEtaPhiMCRecoNoSelPrimary" , " pt eta phi map MC gen Primary sel0; pt,eta,phi" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
286- histos.add (" Particle/selPtEtaPhiMCRecoSel1Primary" , " pt eta phi map MC gen Primary sel1; pt,eta,phi" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
287- histos.add (" Particle/selPtEtaPhiMCRecoSel2Primary" , " pt eta phi map MC gen Primary sel2; pt,eta,phi" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
288- histos.add (" Particle/selPtEtaPhiMCRecoSel3Primary" , " pt eta phi map MC gen Primary sel3; pt,eta,phi" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
288+ histos.add (" Particle/selPtEtaPhiMCGenPrimary" , " pt eta phi map MC gen Primary" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
289+ histos.add (" Particle/selPtEtaPhiMCRecoNoSelPrimary" , " pt eta phi map MC reco Primary sel0" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
290+ histos.add (" Particle/selPtEtaPhiMCRecoSel1Primary" , " pt eta phi map MC reco Primary sel1" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
291+ histos.add (" Particle/selPtEtaPhiMCRecoSel2Primary" , " pt eta phi map MC reco Primary sel2" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
292+ histos.add (" Particle/selPtEtaPhiMCRecoSel3Primary" , " pt eta phi map MC reco Primary sel3" , kTH3D , {axisPt, {50 , -1.2 , 1.2 , " #eta" }, {30 , 0 ., 2 * M_PI , " #varphi" }});
293+
294+ histos.add (" Particle/selPtEtaVtxzMCGenPrimary" , " pt eta VtxZ map MC gen Primary" , kTH3F , {axisPt, axisEta, axisVtxZ});
295+ histos.add (" Particle/selPtEtaVtxzMCRecoNoSelPrimary" , " pt eta VtxZ map MC reco Primary sel0" , kTH3F , {axisPt, axisEta, axisVtxZ});
296+ histos.add (" Particle/selPtEtaVtxzMCRecoSel1Primary" , " pt eta VtxZ map MC reco Primary sel1" , kTH3F , {axisPt, axisEta, axisVtxZ});
297+ histos.add (" Particle/selPtEtaVtxzMCRecoSel2Primary" , " pt eta VtxZ map MC reco Primary sel2" , kTH3F , {axisPt, axisEta, axisVtxZ});
298+ histos.add (" Particle/selPtEtaVtxzMCRecoSel3Primary" , " pt eta VtxZ map MC reco Primary sel3" , kTH3F , {axisPt, axisEta, axisVtxZ});
289299 histos.add (" Tracks/resoPhivsPtvsEta" , " #varphi(reco)-#varphi(gen);" , kTH3D , {axisPt, axisEta, {180 , -M_PI , M_PI , " #varphi(reco)-#varphi(gen)" }});
290300 histos.add (" Tracks/phiRecovsphiGen" , " #varphi(reco) vs. #varphi(gen);" , kTH2D , {axisPhi, axisPhi});
291301 histos.get <TH2 >(HIST (" Tracks/phiRecovsphiGen" ))->GetXaxis ()->SetTitle (" #varphi(reco)" );
@@ -314,16 +324,17 @@ struct qaEventTrackLite {
314324 // TOF
315325 Filter tofChi = o2::aod::track::tofChi2 > chi2TofMin;
316326 Filter length = o2::aod::track::length > lengthMin;
317-
318327 template <bool isMC, typename trackType>
319328 void fillHistograms (trackType const & track)
320329 {
321-
322- if (TMath::Abs (track. dpgCollision (). posZ ()) > vtxZMax)
330+ const float vtxZ = track. dpgCollision (). posZ ();
331+ if (TMath::Abs (vtxZ) > vtxZMax) {
323332 return ;
333+ }
324334 if constexpr (isMC) {
325- if (track.productionMode () == 0 && isPdgSelected (track.pdgCode ())) {
335+ if (track.isPhysicalPrimary () && isPdgSelected (track.pdgCode ())) {
326336 histos.fill (HIST (" Particle/selPtEtaPhiMCGenPrimary" ), track.ptMC (), track.etaMC (), track.phiMC ());
337+ histos.fill (HIST (" Particle/selPtEtaVtxzMCGenPrimary" ), track.ptMC (), track.etaMC (), vtxZ);
327338 }
328339 }
329340 // temporary additional selections
@@ -336,18 +347,22 @@ struct qaEventTrackLite {
336347 Bool_t isPdgOk = true ;
337348 if constexpr (isMC) {
338349 isPdgOk = isPdgSelected (track.pdgCode ());
339- if (track.productionMode () == 0 && isPdgOk) {
350+ if (track.isPhysicalPrimary () && isPdgOk) {
340351 histos.get <TH1 >(HIST (" Particles/PDGs" ))->Fill (Form (" %i" , track.pdgCode ()), 1 );
341352 histos.fill (HIST (" Particle/selPtEtaPhiMCRecoNoSelPrimary" ), track.ptMC (), track.etaMC (), track.phiMC ());
353+ histos.fill (HIST (" Particle/selPtEtaVtxzMCRecoNoSelPrimary" ), track.ptMC (), track.etaMC (), vtxZ);
342354
343355 if (sel1) {
344356 histos.fill (HIST (" Particle/selPtEtaPhiMCRecoSel1Primary" ), track.ptMC (), track.etaMC (), track.phiMC ());
357+ histos.fill (HIST (" Particle/selPtEtaVtxzMCRecoSel1Primary" ), track.ptMC (), track.etaMC (), vtxZ);
345358 }
346359 if (sel2) {
347360 histos.fill (HIST (" Particle/selPtEtaPhiMCRecoSel2Primary" ), track.ptMC (), track.etaMC (), track.phiMC ());
361+ histos.fill (HIST (" Particle/selPtEtaVtxzMCRecoSel2Primary" ), track.ptMC (), track.etaMC (), vtxZ);
348362 }
349363 if (sel3) {
350364 histos.fill (HIST (" Particle/selPtEtaPhiMCRecoSel3Primary" ), track.ptMC (), track.etaMC (), track.phiMC ());
365+ histos.fill (HIST (" Particle/selPtEtaVtxzMCRecoSel3Primary" ), track.ptMC (), track.etaMC (), vtxZ);
351366 }
352367 }
353368
@@ -471,22 +486,27 @@ struct qaEventTrackLite {
471486 PROCESS_SWITCH (qaEventTrackLite, processDataLite, " process data lite" , true );
472487
473488 // Process MC
474- void processMCLite (o2::soa::Filtered<soa::Join<aod::DPGTracks, aod::DPGRecoParticles>> const & tracks, aod::DPGCollisions const &, aod::DPGNonRecoParticles const & particles)
489+ void processMCLite (o2::soa::Filtered<soa::Join<aod::DPGTracks, aod::DPGRecoParticles>> const & tracks, aod::DPGCollisions const &,
490+ aod::DPGNonRecoParticles const & nonRecoParticles)
475491 {
476492 for (const auto & track : tracks) {
477493 fillHistograms<true >(track);
478494 }
479495
480- for (const auto & particle : particles) {
481- if (TMath::Abs (particle.dpgCollision ().posZ ()) > vtxZMax)
496+ for (const auto & particle : nonRecoParticles) {
497+ const float vtxZ = particle.dpgCollision ().posZ ();
498+ if (TMath::Abs (vtxZ) > vtxZMax) {
482499 continue ;
500+ }
483501
484502 histos.fill (HIST (" Particles/Kine/pt" ), particle.ptMC ());
485503 histos.fill (HIST (" Particles/Kine/eta" ), particle.etaMC ());
486504 histos.fill (HIST (" Particles/Kine/phi" ), particle.phiMC ());
487505
488- if (particle.productionMode () == 0 && isPdgSelected (particle.pdgCode ()))
506+ if (particle.isPhysicalPrimary () && isPdgSelected (particle.pdgCode ())) {
489507 histos.fill (HIST (" Particle/selPtEtaPhiMCGenPrimary" ), particle.ptMC (), particle.etaMC (), particle.phiMC ());
508+ histos.fill (HIST (" Particle/selPtEtaVtxzMCGenPrimary" ), particle.ptMC (), particle.etaMC (), vtxZ);
509+ }
490510 }
491511 }
492512 PROCESS_SWITCH (qaEventTrackLite, processMCLite, " process MC lite" , false );
@@ -578,18 +598,38 @@ struct qaEventTrackLite {
578598 return true ;
579599 }
580600
581- bool isPdgSelected (const Int_t pdgcode)
601+ bool isPdgSelected (const int pdgcode)
582602 { // mimics selection of charged particles or id particles
583- Int_t abspdgcode = TMath::Abs (pdgcode);
584- if (abspdgcode == pdgCodeSel)
603+
604+ if (pdgcode == pdgCodeSel) { // Check that the pdg code is exactly what was asked
585605 return true ;
586- if (pdgCodeSel == 1 || pdgCodeSel == 2 ) {
587- if (abspdgcode == 211 || abspdgcode == 321 || abspdgcode == 2212 || abspdgcode == 11 || abspdgcode == 13 )
588- return true ;
589- if (pdgCodeSel == 2 ) {
590- if (abspdgcode == 3222 || abspdgcode == 3112 || abspdgcode == 3312 || abspdgcode == 3334 || abspdgcode == 1000010020 || abspdgcode == 1000010030 || abspdgcode == 1000020030 || abspdgcode == 1000020040 || abspdgcode == 1010010030 || abspdgcode == 1010020040 )
606+ }
607+ const int abspdgcode = abs (pdgcode);
608+ if (pdgCodeSelMode == 1 || pdgCodeSelMode == 2 ) {
609+ switch (abspdgcode) {
610+ case 11 : // electron
611+ case 13 : // muon
612+ case 211 : // pion
613+ case 321 : // kaon
614+ case 2212 : // proton
591615 return true ;
592616 }
617+
618+ if (pdgCodeSelMode == 2 ) {
619+ switch (abspdgcode) {
620+ case 3222 : // Σ+
621+ case 3112 : // Σ−
622+ case 3312 : // Ξ−
623+ case 3334 : // Ω−
624+ case 1000010020 : // deuteron
625+ case 1000010030 : // triton
626+ case 1000020030 : // helium3
627+ case 1000020040 : // helium4
628+ case 1010010030 : // hyper triton
629+ case 1010020040 : // hyper helium4
630+ return true ;
631+ }
632+ }
593633 }
594634 return false ;
595635 }
0 commit comments