3333#include < TMCProcess.h>
3434#include < TPDGCode.h>
3535
36+ #include < algorithm>
37+ #include < array>
3638#include < cmath>
3739#include < cstddef>
3840#include < cstdint>
@@ -77,6 +79,8 @@ struct CheckMcV0 {
7779 AxisSpec axisPositronPt{cfgAxisGammaPt, " #it{p}_{T}^{e^{+},true} (GeV/#it{c})" };
7880 AxisSpec axisPairPt{cfgAxisGammaPt, " |#vec{p}_{T}^{e^{-}} + #vec{p}_{T}^{e^{+}}| (GeV/#it{c})" };
7981 AxisSpec axisLegPtSum{cfgAxisGammaPt, " #it{p}_{T}^{e^{-}} + #it{p}_{T}^{e^{+}} (GeV/#it{c})" };
82+ ConfigurableAxis cfgAxisMinLegPt{" cfgAxisMinLegPt" , {VARIABLE_WIDTH , 0 .001f , 0 .005f , 0 .01f , 0 .02f , 0 .03f , 0 .04f , 0 .05f , 0 .06f , 0 .07f , 0 .08f , 0 .09f , 0 .1f , 0 .15f , 0 .2f , 0 .25f , 0 .3f , 0 .35f , 0 .4f , 0 .45f , 0 .5f , 0 .6f , 0 .7f , 0 .8f , 0 .9f , 1 .f , 1 .1f , 1 .2f , 1 .3f , 1 .4f , 1 .5f , 1 .6f , 1 .7f , 1 .8f , 1 .9f , 2 .f , 2 .2f , 2 .5f , 3 .f , 4 .f , 5 .f , 6 .f , 8 .f , 10 .f , 15 .f , 20 .f }, " minimum truth daughter pT axis" };
83+ AxisSpec axisMinLegPt{cfgAxisMinLegPt, " min(#it{p}_{T}^{e^{-}}, #it{p}_{T}^{e^{+}}) (GeV/#it{c})" };
8084 ConfigurableAxis cfgAxisMomentumFraction{" cfgAxisMomentumFraction" , {100 , 0 .f , 1 .f }, " positron momentum fraction axis" };
8185 AxisSpec axisMomentumFraction{cfgAxisMomentumFraction, " #it{p}_{T}^{e^{+}}/(#it{p}_{T}^{e^{-}} + #it{p}_{T}^{e^{+}})" };
8286 ConfigurableAxis cfgAxisConversionRadius{" cfgAxisConversionRadius" , {400 , 0 .f , 100 .f }, " truth conversion radius axis" };
@@ -141,6 +145,8 @@ struct CheckMcV0 {
141145 const std::vector<AxisSpec> legEfficiencyAxes{axisConversionRadius, axisLegPt, axisOccupancyTracks, axisCentrality, axisNCol};
142146 const std::vector<AxisSpec> partnerEfficiencyAxes{axisConversionRadius, axisElectronPt, axisPositronPt, axisOccupancyTracks, axisCentrality, axisNCol};
143147 const std::vector<AxisSpec> conversionEfficiencyAxes{axisConversionRadius, axisGammaPt, axisOccupancyTracks, axisCentrality, axisNCol};
148+ const std::vector<AxisSpec> conversionDaughterKinematicsAxes{axisConversionRadius, axisGammaPt, axisMinLegPt, axisMomentumFraction, axisOccupancyTracks};
149+ const std::vector<AxisSpec> eligiblePairTypeAxes{axisConversionRadius, axisGammaPt, axisOccupancyTracks, axisTrackType};
144150 const std::vector<AxisSpec> rawV0MultiplicityAxes{axisConversionRadius, axisGammaPt, axisOccupancyTracks, axisMultiplicity};
145151 const std::vector<AxisSpec> rawV0TypeAxes{axisConversionRadius, axisGammaPt, axisOccupancyTracks, axisV0Type};
146152 const std::vector<AxisSpec> rawV0TrackTypeAxes{axisConversionRadius, axisGammaPt, axisOccupancyTracks, axisTrackType};
@@ -177,6 +183,12 @@ struct CheckMcV0 {
177183 registry.add (" Conversion/hRawV0FoundSameCollisionUsingEligiblePair" , " fiducial true conversions with a clean raw V0 in the reference collision using a denominator-eligible track pair" , HistType::kTHnSparseF , conversionEfficiencyAxes);
178184 registry.add (" Conversion/hV0Found" , " fiducial true conversions reconstructed as a raw V0 in the reference collision" , HistType::kTHnSparseF , conversionEfficiencyAxes);
179185
186+ registry.add (" ConversionDaughterKinematics/hBothLegsFound" , " fiducial true conversions with both legs reconstructed" , HistType::kTHnSparseF , conversionDaughterKinematicsAxes);
187+ registry.add (" ConversionDaughterKinematics/hRawV0FoundAnywhere" , " fiducial true conversions with a clean truth-matched raw V0 in any collision" , HistType::kTHnSparseF , conversionDaughterKinematicsAxes);
188+
189+ registry.add (" EligiblePairType/hBothLegsFound" , " denominator-eligible reconstructed track-pair types" , HistType::kTHnSparseF , eligiblePairTypeAxes);
190+ registry.add (" EligiblePairType/hRawV0FoundUsingEligiblePair" , " denominator-eligible track-pair types used by a clean raw V0" , HistType::kTHnSparseF , eligiblePairTypeAxes);
191+
180192 registry.add (" RawV0/hCandidateMultiplicity" , " number of clean raw V0 rows per reconstructable truth conversion" , HistType::kTHnSparseF , rawV0MultiplicityAxes);
181193 registry.add (" RawV0/hDistinctCollisionMultiplicity" , " number of distinct raw V0 collision assignments per reconstructable truth conversion" , HistType::kTHnSparseF , rawV0MultiplicityAxes);
182194 registry.add (" RawV0/hDistinctTrackPairMultiplicity" , " number of distinct raw V0 daughter track pairs per reconstructable truth conversion" , HistType::kTHnSparseF , rawV0MultiplicityAxes);
@@ -369,7 +381,7 @@ struct CheckMcV0 {
369381 PROCESS_SWITCH (CheckMcV0, processTrueConversion, " process true photon conversions" , true );
370382
371383 Preslice<FullMcParticles> perMcCollision = aod::mcparticle::mcCollisionId;
372- void processMCV0 (CollisionsMC const & collisions, aod::BCs const & /* bcs*/ , aod::V0s const & rawV0s, FullMcParticles const & mcParticles, aod::McCollisions const & /* mcCollisions*/ , TracksMC const & /* tracks*/ )
384+ void processMCV0 (CollisionsMC const & collisions, aod::BCs const & /* bcs*/ , aod::V0s const & rawV0s, FullMcParticles const & mcParticles, aod::McCollisions const & /* mcCollisions*/ , TracksMC const & tracks)
373385 {
374386 // Index raw production V0 rows by their truth photon. Efficiency numerators
375387 // below are filled once per truth-photon/reference-collision entry, while
@@ -474,6 +486,7 @@ struct CheckMcV0 {
474486 const auto & positron = mcParticles.iteratorAt (positronId);
475487 const auto & electron = mcParticles.iteratorAt (electronId);
476488 const float legPtSum = electron.pt () + positron.pt ();
489+ const float minLegPt = std::min (electron.pt (), positron.pt ());
477490 const float pairPt = std::hypot (electron.px () + positron.px (), electron.py () + positron.py ());
478491 const float positronFraction = legPtSum > 0 .f ? positron.pt () / legPtSum : 0 .f ;
479492 registry.fill (HIST (" Kinematics/hGammaPtPairPt" ), mcPhoton.pt (), pairPt);
@@ -513,6 +526,22 @@ struct CheckMcV0 {
513526 }
514527
515528 registry.fill (HIST (" Conversion/hBothLegsFound" ), conversionRadius, mcPhoton.pt (), occupancy, centrality, nCol);
529+ registry.fill (HIST (" ConversionDaughterKinematics/hBothLegsFound" ), conversionRadius, mcPhoton.pt (), minLegPt, positronFraction, occupancy);
530+
531+ std::array<bool , kOther + 1 > hasEligiblePairType{};
532+ for (const auto positronTrackId : positronTracks.eligibleTrackIds ) {
533+ const auto & positronTrack = tracks.iteratorAt (positronTrackId);
534+ for (const auto electronTrackId : electronTracks.eligibleTrackIds ) {
535+ const auto & electronTrack = tracks.iteratorAt (electronTrackId);
536+ hasEligiblePairType[getRawV0TrackType (positronTrack, electronTrack)] = true ;
537+ }
538+ }
539+ for (int trackType = 0 ; trackType <= kOther ; ++trackType) {
540+ if (hasEligiblePairType[trackType]) {
541+ registry.fill (HIST (" EligiblePairType/hBothLegsFound" ), conversionRadius, mcPhoton.pt (), occupancy, trackType);
542+ }
543+ }
544+
516545 const auto rawV0MatchesIt = rawV0MatchesByPhoton.find (mcPhoton.globalIndex ());
517546 const bool hasLabelMatchAnywhere = rawV0MatchesIt != rawV0MatchesByPhoton.end () && !rawV0MatchesIt->second .empty ();
518547 if (hasLabelMatchAnywhere) {
@@ -525,6 +554,7 @@ struct CheckMcV0 {
525554 bool hasCleanMatchUsingEligiblePair{false };
526555 bool hasCleanMatchSameCollisionUsingEligiblePair{false };
527556 int nCleanMatches{0 };
557+ std::array<bool , kOther + 1 > hasRawV0UsingEligiblePairType{};
528558 std::unordered_set<int64_t > distinctCollisionIds;
529559 std::set<std::pair<int64_t , int64_t >> distinctTrackPairs;
530560 const std::unordered_set<int64_t > eligiblePositronTrackIds{positronTracks.eligibleTrackIds .begin (), positronTracks.eligibleTrackIds .end ()};
@@ -555,6 +585,7 @@ struct CheckMcV0 {
555585 const bool usesEligiblePair = eligiblePositronTrackIds.contains (rawV0Match.posTrackId ) && eligibleElectronTrackIds.contains (rawV0Match.negTrackId );
556586 if (usesEligiblePair) {
557587 hasCleanMatchUsingEligiblePair = true ;
588+ hasRawV0UsingEligiblePairType[rawV0Match.trackType ] = true ;
558589 }
559590 if (rawV0Match.mcCollisionId == collision.mcCollisionId ()) {
560591 hasCleanMatchSameMcCollision = true ;
@@ -574,6 +605,7 @@ struct CheckMcV0 {
574605
575606 if (hasCleanMatchAnywhere) {
576607 registry.fill (HIST (" Conversion/hRawV0FoundAnywhere" ), conversionRadius, mcPhoton.pt (), occupancy, centrality, nCol);
608+ registry.fill (HIST (" ConversionDaughterKinematics/hRawV0FoundAnywhere" ), conversionRadius, mcPhoton.pt (), minLegPt, positronFraction, occupancy);
577609 }
578610 if (hasCleanMatchSameMcCollision) {
579611 registry.fill (HIST (" Conversion/hRawV0FoundSameMcCollision" ), conversionRadius, mcPhoton.pt (), occupancy, centrality, nCol);
@@ -588,6 +620,11 @@ struct CheckMcV0 {
588620 registry.fill (HIST (" Conversion/hRawV0FoundSameCollision" ), conversionRadius, mcPhoton.pt (), occupancy, centrality, nCol);
589621 registry.fill (HIST (" Conversion/hV0Found" ), conversionRadius, mcPhoton.pt (), occupancy, centrality, nCol);
590622 }
623+ for (int trackType = 0 ; trackType <= kOther ; ++trackType) {
624+ if (hasRawV0UsingEligiblePairType[trackType]) {
625+ registry.fill (HIST (" EligiblePairType/hRawV0FoundUsingEligiblePair" ), conversionRadius, mcPhoton.pt (), occupancy, trackType);
626+ }
627+ }
591628 }
592629 }
593630 }
0 commit comments