@@ -96,7 +96,10 @@ std::shared_ptr<TH2> hDCAMothToPV;
9696std::shared_ptr<TH2 > hDCADaugToPV;
9797std::shared_ptr<TH2 > hMothDecRad2;
9898std::shared_ptr<TH2 > hGenCandidates;
99- std::shared_ptr<TH2 > hRecCandidates;
99+ std::shared_ptr<TH2 > hGenDecayRadius;
100+ std::shared_ptr<TH2 > hRecCandidatesRecoPt;
101+ std::shared_ptr<TH2 > hRecCandidatesGenPt;
102+ std::shared_ptr<TH2 > hRecCandidatesDeltaPt;
100103std::array<std::shared_ptr<TH2 >, NMatchedDecays> hGenPtKinkAngle;
101104std::array<std::shared_ptr<TH2 >, NMatchedDecays> hRecPtKinkAngle;
102105} // namespace
@@ -362,21 +365,27 @@ struct kinkBuilder {
362365
363366 if (doprocessMc || doprocessMcWCent) {
364367 if (skipBkgCands) {
365- hRecCandidates = qaRegistry.add <TH2 >(" hRecCandidates" , " hRecCandidates;Counts;" , {HistType::kTH2F , {{NMatchedDecays, -0.5 , static_cast <float >(NMatchedDecays) - 0.5 }, absPtAxis}});
366- hRecCandidates->GetXaxis ()->SetBinLabel (1 , " #Sigma^{-} #rightarrow n#pi^{-}" );
367- hRecCandidates->GetXaxis ()->SetBinLabel (2 , " #Sigma^{+} #rightarrow n#pi^{+}" );
368- hRecCandidates->GetXaxis ()->SetBinLabel (3 , " #Sigma^{+} #rightarrow p#pi^{0}" );
368+ hRecCandidatesRecoPt = qaRegistry.add <TH2 >(" hRecCandidatesRecoPt" , " hRecCandidates;Counts;Reco #it{p}_{T} (GeV/#it{c})" , {HistType::kTH2F , {{NMatchedDecays, -0.5 , static_cast <float >(NMatchedDecays) - 0.5 }, absPtAxis}});
369+ hRecCandidatesRecoPt->GetXaxis ()->SetBinLabel (1 , " #Sigma^{-} #rightarrow n#pi^{-}" );
370+ hRecCandidatesRecoPt->GetXaxis ()->SetBinLabel (2 , " #Sigma^{+} #rightarrow n#pi^{+}" );
371+ hRecCandidatesRecoPt->GetXaxis ()->SetBinLabel (3 , " #Sigma^{+} #rightarrow p#pi^{0}" );
372+ hRecCandidatesGenPt = qaRegistry.add <TH2 >(" hRecCandidatesGenPt" , " hRecCandidatesGenPt;Counts;Gen #it{p}_{T} (GeV/#it{c})" , {HistType::kTH2F , {{NMatchedDecays, -0.5 , static_cast <float >(NMatchedDecays) - 0.5 }, absPtAxis}});
373+ hRecCandidatesGenPt->GetXaxis ()->SetBinLabel (1 , " #Sigma^{-} #rightarrow n#pi^{-}" );
374+ hRecCandidatesGenPt->GetXaxis ()->SetBinLabel (2 , " #Sigma^{+} #rightarrow n#pi^{+}" );
375+ hRecCandidatesGenPt->GetXaxis ()->SetBinLabel (3 , " #Sigma^{+} #rightarrow p#pi^{0}" );
376+ hRecCandidatesDeltaPt = qaRegistry.add <TH2 >(" hRecCandidatesDeltaPt" , " hRecCandidatesDeltaPt;Counts;#Delta p_{T} (GeV/c)" , {HistType::kTH2F , {{400 , -0.5 , 0.5 }, absPtAxis}});
369377 }
370- hGenCandidates = qaRegistry.add <TH2 >(" hGenCandidates" , " hGenCandidates;Counts;" , {HistType::kTH2F , {{NMatchedDecays, -0.5 , static_cast <float >(NMatchedDecays) - 0.5 }, absPtAxis}});
378+ hGenDecayRadius = qaRegistry.add <TH2 >(" hGenDecayRadius" , " hGenDecayRadius;Radius (cm); #it{p}_{T} (GeV/#it{c})" , {HistType::kTH2F , {{300 , 0 , 30 }, absPtAxis}});
379+ hGenCandidates = qaRegistry.add <TH2 >(" hGenCandidates" , " hGenCandidates;Counts;Gen #it{p}_{T} (GeV/#it{c})" , {HistType::kTH2F , {{NMatchedDecays, -0.5 , static_cast <float >(NMatchedDecays) - 0.5 }, absPtAxis}});
371380 hGenCandidates->GetXaxis ()->SetBinLabel (1 , " #Sigma^{-} #rightarrow n#pi^{-}" );
372381 hGenCandidates->GetXaxis ()->SetBinLabel (2 , " #Sigma^{+} #rightarrow n#pi^{+}" );
373382 hGenCandidates->GetXaxis ()->SetBinLabel (3 , " #Sigma^{+} #rightarrow p#pi^{0}" );
374- hRecPtKinkAngle[SigmaMinusToPiMinusNeutron] = qaRegistry.add <TH2 >(" hRecPtKinkAngleSigmaMinusToPiMinusNeutron " , " Rec Pt vs KinkAngle #Sigma^{-} #rightarrow #pi^{-}n;Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
375- hRecPtKinkAngle[SigmaPlusToPiPlusNeutron] = qaRegistry.add <TH2 >(" hRecPtKinkAngleSigmaPlusToPiPlusNeutron " , " Rec Pt vs KinkAngle #Sigma^{+} #rightarrow #pi^{+}n;Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
376- hRecPtKinkAngle[SigmaPlusToProtonPi0] = qaRegistry.add <TH2 >(" hRecPtKinkAngleSigmaPlusToProtonPi0 " , " Rec Pt vs KinkAngle #Sigma^{+} #rightarrow p#pi^{0};Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
377- hGenPtKinkAngle[SigmaMinusToPiMinusNeutron] = qaRegistry.add <TH2 >(" hGenPtKinkAngleSigmaMinusToPiMinusNeutron " , " Gen Pt vs KinkAngle #Sigma^{-} #rightarrow #pi^{-}n;Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
378- hGenPtKinkAngle[SigmaPlusToPiPlusNeutron] = qaRegistry.add <TH2 >(" hGenPtKinkAngleSigmaPlusToPiPlusNeutron " , " Gen Pt vs KinkAngle #Sigma^{+} #rightarrow #pi^{+}n;Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
379- hGenPtKinkAngle[SigmaPlusToProtonPi0] = qaRegistry.add <TH2 >(" hGenPtKinkAngleSigmaPlusToProtonPi0 " , " Gen Pt vs KinkAngle #Sigma^{+} #rightarrow p#pi^{0};Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
383+ hRecPtKinkAngle[SigmaMinusToPiMinusNeutron] = qaRegistry.add <TH2 >(" hRecPtKinkAngleSigmaMinusToPi " , " Rec Pt vs KinkAngle #Sigma^{-} #rightarrow #pi^{-}n;Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
384+ hRecPtKinkAngle[SigmaPlusToPiPlusNeutron] = qaRegistry.add <TH2 >(" hRecPtKinkAngleSigmaPlusToPi " , " Rec Pt vs KinkAngle #Sigma^{+} #rightarrow #pi^{+}n;Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
385+ hRecPtKinkAngle[SigmaPlusToProtonPi0] = qaRegistry.add <TH2 >(" hRecPtKinkAngleSigmaPlusToPr " , " Rec Pt vs KinkAngle #Sigma^{+} #rightarrow p#pi^{0};Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
386+ hGenPtKinkAngle[SigmaMinusToPiMinusNeutron] = qaRegistry.add <TH2 >(" hGenPtKinkAngleSigmaMinusToPi " , " Gen Pt vs KinkAngle #Sigma^{-} #rightarrow #pi^{-}n;Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
387+ hGenPtKinkAngle[SigmaPlusToPiPlusNeutron] = qaRegistry.add <TH2 >(" hGenPtKinkAngleSigmaPlusToPi " , " Gen Pt vs KinkAngle #Sigma^{+} #rightarrow #pi^{+}n;Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
388+ hGenPtKinkAngle[SigmaPlusToProtonPi0] = qaRegistry.add <TH2 >(" hGenPtKinkAngleSigmaPlusToPr " , " Gen Pt vs KinkAngle #Sigma^{+} #rightarrow p#pi^{0};Counts;" , {HistType::kTH2F , {absPtAxis, kinkAngleAxis}});
380389 }
381390 }
382391
@@ -402,12 +411,14 @@ struct kinkBuilder {
402411 return false ;
403412 hSelMotherQA->Fill (4 .f , isPositive);
404413
405- h2ItsClsMothBeforeSel->Fill (candidate.itsNCls (), candidate.itsNClsInnerBarrel ());
406- if (candidate.itsNCls () >= nItsTotalLayers - 1 )
414+ int itsTotCls = static_cast <int >(candidate.itsNCls ());
415+ int itsIBCls = static_cast <int >(candidate.itsNClsInnerBarrel ());
416+ h2ItsClsMothBeforeSel->Fill (itsTotCls, itsIBCls);
417+ if (itsTotCls >= nItsTotalLayers - 1 )
407418 return false ;
408419 hSelMotherQA->Fill (5 .f , isPositive);
409420
410- if (candidate. itsNClsInnerBarrel () != nItsInnerBarrelLayers)
421+ if (itsIBCls != nItsInnerBarrelLayers)
411422 return false ;
412423 hSelMotherQA->Fill (6 .f , isPositive);
413424
@@ -440,8 +451,10 @@ struct kinkBuilder {
440451 return false ;
441452 hSelDaugQA->Fill (3 .f , isPositive);
442453
443- h2ItsClsDaugBeforeSel->Fill (candidate.itsNCls (), candidate.itsNClsInnerBarrel ());
444- if (candidate.itsNClsInnerBarrel () != 0 )
454+ int itsTotCls = static_cast <int >(candidate.itsNCls ());
455+ int itsIBCls = static_cast <int >(candidate.itsNClsInnerBarrel ());
456+ h2ItsClsDaugBeforeSel->Fill (itsTotCls, itsIBCls);
457+ if (itsIBCls != 0 )
445458 return false ;
446459 hSelDaugQA->Fill (4 .f , isPositive);
447460
@@ -649,7 +662,7 @@ struct kinkBuilder {
649662 LOG (info) << " Task initialized for run " << mRunNumber << " with magnetic field " << mBz << " kZG" ;
650663 }
651664
652- template <typename TColls, typename TTracks, typename TAmbiTracks>
665+ template <bool KeepOnlyKinks, typename TColls, typename TTracks, typename TAmbiTracks>
653666 void buildSvPool (const TColls& collisions, const TTracks& tracks, const TAmbiTracks& ambiguousTracks, const aod::BCs& bcs)
654667 {
655668 svCreator.clearPools ();
@@ -660,8 +673,36 @@ struct kinkBuilder {
660673 continue ;
661674 }
662675
663- bool isDaug = selectDaugTrack (track);
664- bool isMoth = selectMothTrack (track);
676+ bool canBeMoth = true ;
677+ bool canBeDaug = true ;
678+
679+ if constexpr (KeepOnlyKinks) {
680+ if (!track.has_mcParticle ()) {
681+ LOG (debug) << " Track has no MC particle" ;
682+ continue ;
683+ }
684+ auto genPart = track.template mcParticle_as <aod::McParticles>();
685+
686+ canBeMoth = std::find (
687+ mothMatchPdgCodes.begin (),
688+ mothMatchPdgCodes.end (),
689+ std::abs (genPart.pdgCode ())) != mothMatchPdgCodes.end ();
690+
691+ canBeDaug = false ;
692+ for (const auto & mother : genPart.template mothers_as <aod::McParticles>()) {
693+ if (std::find (
694+ mothMatchPdgCodes.begin (),
695+ mothMatchPdgCodes.end (),
696+ std::abs (mother.pdgCode ())) != mothMatchPdgCodes.end ()) {
697+ canBeDaug = true ;
698+ break ;
699+ }
700+ }
701+ }
702+
703+ bool isMoth = canBeMoth && selectMothTrack (track);
704+ bool isDaug = canBeDaug && selectDaugTrack (track);
705+
665706 if (!isDaug && !isMoth) {
666707 continue ;
667708 }
@@ -675,7 +716,7 @@ struct kinkBuilder {
675716 {
676717 kinkCandidates.clear ();
677718
678- buildSvPool (collisions, tracks, ambiTracks, bcs);
719+ buildSvPool< false > (collisions, tracks, ambiTracks, bcs);
679720 auto & kinkPool = svCreator.getSVCandPool (collisions, !unlikeSignBkg);
680721 bool isAccepted = false ;
681722 for (const auto & svCand : kinkPool) {
@@ -762,7 +803,12 @@ struct kinkBuilder {
762803 {
763804 kinkCandidates.clear ();
764805
765- buildSvPool (mcRecoCollisions, tracksMc, ambiTracksMc, bcs);
806+ if (skipBkgCands) {
807+ buildSvPool<true >(mcRecoCollisions, tracksMc, ambiTracksMc, bcs);
808+ } else {
809+ buildSvPool<false >(mcRecoCollisions, tracksMc, ambiTracksMc, bcs);
810+ }
811+
766812 auto & kinkPool = svCreator.getSVCandPool (mcRecoCollisions, !unlikeSignBkg);
767813 for (const auto & svCand : kinkPool) {
768814 // Perform matching of the kink candidate
@@ -787,7 +833,9 @@ struct kinkBuilder {
787833 if (decayChannel < 0 ) {
788834 continue ; // Skip candidates that do not match the decay channels of interest
789835 }
790- hRecCandidates->Fill (decayChannel, trackMoth.pt ()); // Decay channel match bin
836+ hRecCandidatesRecoPt->Fill (decayChannel, trackMoth.pt ()); // Decay channel match bin
837+ hRecCandidatesGenPt->Fill (decayChannel, genMothPart.pt ()); // Decay channel match bin
838+ hRecCandidatesDeltaPt->Fill ((trackMoth.pt () - genMothPart.pt ()) / genMothPart.pt (), genMothPart.pt ()); // Decay channel match bin
791839 }
792840 bool isAccepted = false ;
793841 buildKinkCand (svCand, tracksMc, isAccepted, mcRecoCollisions);
@@ -831,6 +879,7 @@ struct kinkBuilder {
831879 auto daughI = mcParticles.rawIteratorAt (arrDaughIdxs[iProng]);
832880 if (std::abs (daughI.pdgCode ()) == PDG_t::kPiPlus || std::abs (daughI.pdgCode ()) == PDG_t::kProton ) {
833881 hGenPtKinkAngle[decayChannel]->Fill (mcPart.pt (), std::abs (mcPart.phi () - daughI.phi ()) * radToDeg);
882+ hGenDecayRadius->Fill (std::hypot (daughI.vx (), daughI.vy ()), mcPart.pt ());
834883 }
835884 }
836885 }
0 commit comments