@@ -202,15 +202,15 @@ struct JetHadronRecoil {
202202 }
203203
204204 if (doprocessJetsMCPMCDMatched || doprocessJetsMCPMCDMatchedWithRhoSubtraction || doprocessJetsMCPMCDMatchedWeighted || doprocessJetsMCPMCDMatchedWeightedWithRhoSubtraction || doprocessRecoilJetsMCPMCDMatched || doprocessRecoilJetsMCPMCDMatchedWeighted || doprocessRecoilJetsMCPMCDMatchedWeightedWithRhoSubtraction) {
205- registry.add (" hPtMatched" , " p_{T} matching;p_{T,det};p_{T,part}" , {HistType::kTH2F , {{ 500 , - 100 , 400 }, { 400 , 0 , 400 } }}, doSumw);
206- registry.add (" hPhiMatched" , " #phi matching;#phi_{det};#phi_{part}" , {HistType::kTH2F , {{ 100 , 0.0 , o2::constants::math::TwoPI}, { 100 , 0.0 , o2::constants::math::TwoPI} }}, doSumw);
207- registry.add (" hPhiMatched2d" , " #phi matching 2d;#phi;p_{T}" , {HistType::kTH2F , {{ 100 , 0.0 , o2::constants::math::TwoPI}, { 400 , 0 , 400 } }}, doSumw);
205+ registry.add (" hPtMatched" , " p_{T} matching;p_{T,det};p_{T,part}" , {HistType::kTH2F , {ptAxisDet, ptAxisPart }}, doSumw);
206+ registry.add (" hPhiMatched" , " #phi matching;#phi_{det};#phi_{part}" , {HistType::kTH2F , {phiAxisDet, phiAxisPart }}, doSumw);
207+ registry.add (" hPhiMatched2d" , " #phi matching 2d;#phi;p_{T}" , {HistType::kTH2F , {phiAxisPart, ptAxisPart }}, doSumw);
208208 registry.add (" hDeltaRMatched" , " #DeltaR matching;#DeltaR_{det};#DeltaR_{part}" , {HistType::kTH2F , {dRAxisDet, dRAxisPart}}, doSumw);
209209 registry.add (" hPtMatched1d" , " p_{T} matching 1d;p_{T,part}" , {HistType::kTH1F , {{400 , 0 , 400 }}}, doSumw);
210210 registry.add (" hDeltaRMatched1d" , " #DeltaR matching 1d;#DeltaR_{part}" , {HistType::kTH1F , {dRAxisPart}}, doSumw);
211- registry.add (" hPtResolution" , " p_{T} resolution;p_{T,part};Relative Resolution" , {HistType::kTH2F , {{ 400 , 0 , 400 }, { 1000 , -5.0 , 5.0 }}}, doSumw);
212- registry.add (" hPhiResolution" , " #phi resolution;#p_{T,part};Resolution" , {HistType::kTH2F , {{ 400 , 0 , 400 }, { 1000 , -7.0 , 7.0 }}}, doSumw);
213- registry.add (" hDeltaRResolution" , " #DeltaR Resolution;p_{T,part};Resolution" , {HistType::kTH2F , {{ 400 , 0 , 400 }, { 1000 , -0.15 , 0.15 }}}, doSumw);
211+ registry.add (" hPtResolution" , " p_{T} resolution;p_{T,part};Relative Resolution" , {HistType::kTH2F , {ptAxisPart, { 100 , -5.0 , 5.0 }}}, doSumw);
212+ registry.add (" hPhiResolution" , " #phi resolution;#p_{T,part};Resolution" , {HistType::kTH2F , {ptAxisPart, { 100 , -7.0 , 7.0 }}}, doSumw);
213+ registry.add (" hDeltaRResolution" , " #DeltaR Resolution;p_{T,part};Resolution" , {HistType::kTH2F , {ptAxisPart, { 100 , -0.15 , 0.15 }}}, doSumw);
214214 registry.add (" hFullMatching" , " Full 6D matching;p_{T,det};p_{T,part};#phi_{det};#phi_{part};#DeltaR_{det};#DeltaR_{part}" , {HistType::kTHnSparseD , {ptAxisDet, ptAxisPart, phiAxisDet, phiAxisPart, dRAxisDet, dRAxisPart}}, doSumw);
215215 }
216216 }
@@ -614,31 +614,31 @@ struct JetHadronRecoil {
614614 }
615615
616616 template <typename T, typename U, typename X, typename Y>
617- void fillMatchedHistograms (T const & jetsBase , U const &, X const & tracks, Y const & particles, float weight = 1.0 , float rho = 0.0 , float pTHat = 999.0 )
617+ void fillMatchedHistograms (T const &, U const & jetsTag , X const & tracks, Y const & particles, float weight = 1.0 , float rho = 0.0 , float pTHat = 999.0 )
618618 {
619- for (const auto & jetBase : jetsBase ) {
619+ for (const auto & jetTag : jetsTag ) {
620620
621- if (jetBase .pt () > pTHatMaxMCD * pTHat) {
621+ if (jetTag .pt () > pTHatMaxMCP * pTHat) {
622622 if (outlierRejectEvent) {
623623 return ;
624624 } else {
625625 continue ;
626626 }
627627 }
628628
629- double dR = getWTAaxisDifference (jetBase, tracks );
629+ double dR = getWTAaxisDifference (jetTag, particles );
630630
631- if (jetBase .has_matchedJetGeo ()) {
632- for (const auto & jetTag : jetBase .template matchedJetGeo_as <std::decay_t <U >>()) {
633- if (jetTag .pt () > pTHatMaxMCP * pTHat) {
631+ if (jetTag .has_matchedJetGeo () && jetTag. has_matchedJetPt ()) {
632+ for (const auto & jetBase : jetTag .template matchedJetGeo_as <std::decay_t <T >>()) {
633+ if (jetBase .pt () > pTHatMaxMCD * pTHat) {
634634 if (outlierRejectEvent) {
635635 return ;
636636 } else {
637637 continue ;
638638 }
639639 }
640640
641- double dRp = getWTAaxisDifference (jetTag, particles );
641+ double dRp = getWTAaxisDifference (jetBase, tracks );
642642
643643 registry.fill (HIST (" hPtMatched" ), jetBase.pt () - (rho * jetBase.area ()), jetTag.pt (), weight);
644644 registry.fill (HIST (" hPhiMatched" ), jetBase.phi (), jetTag.phi (), weight);
@@ -923,98 +923,130 @@ struct JetHadronRecoil {
923923 }
924924 PROCESS_SWITCH (JetHadronRecoil, processMCPWeighted, " process MC particle level with event weights" , false );
925925
926- void processJetsMCPMCDMatched (soa::Filtered<soa::Join<aod::JetCollisionsMCD, aod::JMcCollisionLbs>>::iterator const & collision,
926+ void processJetsMCPMCDMatched (aod::JetMcCollisions::iterator const & mccollision,
927+ soa::SmallGroups<aod::JetCollisionsMCD> const & collisions,
927928 soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents, aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets>> const & mcdjets,
928- aod::JetTracks const & tracks,
929- aod::JetParticles const & particles,
930- aod::JetMcCollisions const &,
929+ soa::Filtered<aod::JetParticles> const & particles,
930+ soa::Filtered<aod::JetTracksMCD> const & tracks,
931931 soa::Filtered<soa::Join<aod::ChargedMCParticleLevelJets, aod::ChargedMCParticleLevelJetConstituents, aod::ChargedMCParticleLevelJetsMatchedToChargedMCDetectorLevelJets>> const & mcpjets)
932932 {
933- if (! jetderiveddatautilities::selectCollision (collision, eventSelectionBits) ) {
933+ if (std::abs (mccollision. posZ ()) > vertexZCut ) {
934934 return ;
935935 }
936- if (! jetderiveddatautilities::selectTrigger (collision, triggerMaskBits) ) {
936+ if (skipMBGapEvents && mccollision. subGeneratorId () == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap ) {
937937 return ;
938938 }
939- if (!collision. has_mcCollision () ) {
939+ if (mccollision. ptHard () < pTHatMinEvent ) {
940940 return ;
941941 }
942- if (collision. mcCollision (). ptHard () < pTHatMinEvent ) {
942+ if (collisions. size () < 1 ) {
943943 return ;
944944 }
945- registry.fill (HIST (" hZvtxSelected" ), collision.posZ ());
945+ for (auto const & collision : collisions) {
946+ if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits)) {
947+ return ;
948+ }
949+ if (!jetderiveddatautilities::selectTrigger (collision, triggerMaskBits)) {
950+ return ;
951+ }
952+ }
953+ registry.fill (HIST (" hZvtxSelected" ), mccollision.posZ ());
946954 fillMatchedHistograms (mcdjets, mcpjets, tracks, particles);
947955 }
948956 PROCESS_SWITCH (JetHadronRecoil, processJetsMCPMCDMatched, " process MC matched (inc jets)" , false );
949957
950- void processJetsMCPMCDMatchedWithRhoSubtraction (soa::Filtered<soa::Join<aod::JetCollisionsMCD, aod::JMcCollisionLbs, aod::BkgChargedRhos>>::iterator const & collision,
958+ void processJetsMCPMCDMatchedWithRhoSubtraction (soa::Join<aod::JetMcCollisions, aod::BkgChargedRhos>::iterator const & mccollision,
959+ soa::SmallGroups<aod::JetCollisionsMCD> const & collisions,
951960 soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents, aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets>> const & mcdjets,
952- aod::JetTracks const & tracks,
953- aod::JetParticles const & particles,
954- aod::JetMcCollisions const &,
961+ soa::Filtered<aod::JetTracksMCD> const & tracks,
962+ soa::Filtered<aod::JetParticles> const & particles,
955963 soa::Filtered<soa::Join<aod::ChargedMCParticleLevelJets, aod::ChargedMCParticleLevelJetConstituents, aod::ChargedMCParticleLevelJetsMatchedToChargedMCDetectorLevelJets>> const & mcpjets)
956964 {
957- if (! jetderiveddatautilities::selectCollision (collision, eventSelectionBits) ) {
965+ if (std::abs (mccollision. posZ ()) > vertexZCut ) {
958966 return ;
959967 }
960- if (! jetderiveddatautilities::selectTrigger (collision, triggerMaskBits) ) {
968+ if (skipMBGapEvents && mccollision. subGeneratorId () == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap ) {
961969 return ;
962970 }
963- if (!collision. has_mcCollision () ) {
971+ if (mccollision. ptHard () < pTHatMinEvent ) {
964972 return ;
965973 }
966- if (collision. mcCollision (). ptHard () < pTHatMinEvent ) {
974+ if (collisions. size () < 1 ) {
967975 return ;
968976 }
969- registry.fill (HIST (" hZvtxSelected" ), collision.posZ ());
977+ for (auto const & collision : collisions) {
978+ if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits)) {
979+ return ;
980+ }
981+ if (!jetderiveddatautilities::selectTrigger (collision, triggerMaskBits)) {
982+ return ;
983+ }
984+ }
985+ registry.fill (HIST (" hZvtxSelected" ), mccollision.posZ ());
970986 fillMatchedHistograms (mcdjets, mcpjets, tracks, particles, 1.0 , 0.0 , collision.mcCollision ().ptHard ());
971987 }
972988 PROCESS_SWITCH (JetHadronRecoil, processJetsMCPMCDMatchedWithRhoSubtraction, " process MC matched (inc jets) with rho subtraction" , false );
973989
974- void processJetsMCPMCDMatchedWeighted (soa::Filtered<soa::Join<aod::JetCollisionsMCD, aod::JMcCollisionLbs>>::iterator const & collision,
990+ void processJetsMCPMCDMatchedWeighted (aod::JetMcCollisions::iterator const & mccollision,
991+ soa::SmallGroups<aod::JetCollisionsMCD> const & collisions,
975992 soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents, aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets>> const & mcdjets,
976- aod::JetTracks const & tracks,
977- aod::JetParticles const & particles,
978- aod::JetMcCollisions const &,
993+ soa::Filtered<aod::JetTracksMCD> const & tracks,
994+ soa::Filtered<aod::JetParticles> const & particles,
979995 soa::Filtered<soa::Join<aod::ChargedMCParticleLevelJets, aod::ChargedMCParticleLevelJetConstituents, aod::ChargedMCParticleLevelJetsMatchedToChargedMCDetectorLevelJets>> const & mcpjets)
980996 {
981- if (! jetderiveddatautilities::selectCollision (collision, eventSelectionBits) ) {
997+ if (std::abs (mccollision. posZ ()) > vertexZCut ) {
982998 return ;
983999 }
984- if (! jetderiveddatautilities::selectTrigger (collision, triggerMaskBits) ) {
1000+ if (skipMBGapEvents && mccollision. subGeneratorId () == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap ) {
9851001 return ;
9861002 }
987- if (!collision. has_mcCollision () ) {
1003+ if (mccollision. ptHard () < pTHatMinEvent ) {
9881004 return ;
9891005 }
990- if (collision. mcCollision (). ptHard () < pTHatMinEvent ) {
1006+ if (collisions. size () < 1 ) {
9911007 return ;
9921008 }
993- registry.fill (HIST (" hZvtxSelected" ), collision.posZ ());
1009+ for (auto const & collision : collisions) {
1010+ if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits)) {
1011+ return ;
1012+ }
1013+ if (!jetderiveddatautilities::selectTrigger (collision, triggerMaskBits)) {
1014+ return ;
1015+ }
1016+ }
1017+ registry.fill (HIST (" hZvtxSelected" ), mccollision.posZ (), mccollision.weight ());
9941018 fillMatchedHistograms (mcdjets, mcpjets, tracks, particles, collision.mcCollision ().weight (), 0.0 , collision.mcCollision ().ptHard ());
9951019 }
9961020 PROCESS_SWITCH (JetHadronRecoil, processJetsMCPMCDMatchedWeighted, " process MC matched with event weights (inc jets)" , false );
9971021
998- void processJetsMCPMCDMatchedWeightedWithRhoSubtraction (soa::Filtered<soa::Join<aod::JetCollisionsMCD, aod::JMcCollisionLbs, aod::BkgChargedRhos>>::iterator const & collision,
1022+ void processJetsMCPMCDMatchedWeightedWithRhoSubtraction (soa::Join<aod::JetMcCollisions, aod::BkgChargedRhos>::iterator const & mccollision,
1023+ soa::SmallGroups<aod::JetCollisionsMCD> const & collisions,
9991024 soa::Filtered<soa::Join<aod::ChargedMCDetectorLevelJets, aod::ChargedMCDetectorLevelJetConstituents, aod::ChargedMCDetectorLevelJetsMatchedToChargedMCParticleLevelJets>> const & mcdjets,
1000- aod::JetTracks const & tracks,
1001- aod::JetParticles const & particles,
1002- aod::JetMcCollisions const &,
1025+ soa::Filtered<aod::JetTracksMCD> const & tracks,
1026+ soa::Filtered<aod::JetParticles> const & particles,
10031027 soa::Filtered<soa::Join<aod::ChargedMCParticleLevelJets, aod::ChargedMCParticleLevelJetConstituents, aod::ChargedMCParticleLevelJetsMatchedToChargedMCDetectorLevelJets>> const & mcpjets)
10041028 {
1005- if (! jetderiveddatautilities::selectCollision (collision, eventSelectionBits) ) {
1029+ if (std::abs (mccollision. posZ ()) > vertexZCut ) {
10061030 return ;
10071031 }
1008- if (! jetderiveddatautilities::selectTrigger (collision, triggerMaskBits) ) {
1032+ if (skipMBGapEvents && mccollision. subGeneratorId () == jetderiveddatautilities::JCollisionSubGeneratorId::mbGap ) {
10091033 return ;
10101034 }
1011- if (!collision. has_mcCollision () ) {
1035+ if (mccollision. ptHard () < pTHatMinEvent ) {
10121036 return ;
10131037 }
1014- if (collision. mcCollision (). ptHard () < pTHatMinEvent ) {
1038+ if (collisions. size () < 1 ) {
10151039 return ;
10161040 }
1017- registry.fill (HIST (" hZvtxSelected" ), collision.posZ ());
1041+ for (auto const & collision : collisions) {
1042+ if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits)) {
1043+ return ;
1044+ }
1045+ if (!jetderiveddatautilities::selectTrigger (collision, triggerMaskBits)) {
1046+ return ;
1047+ }
1048+ }
1049+ registry.fill (HIST (" hZvtxSelected" ), mccollision.posZ (), mccollision.weight ());
10181050 fillMatchedHistograms (mcdjets, mcpjets, tracks, particles, collision.mcCollision ().weight (), collision.rho (), collision.mcCollision ().ptHard ());
10191051 }
10201052 PROCESS_SWITCH (JetHadronRecoil, processJetsMCPMCDMatchedWeightedWithRhoSubtraction, " process MC matched with event weights (inc jets) and rho subtraction" , false );
0 commit comments