1818#include " PWGJE/Core/JetUtilities.h"
1919#include " PWGJE/DataModel/Jet.h"
2020#include " PWGJE/DataModel/JetReducedData.h"
21- #include " PWGJE/DataModel/JetSubstructure.h"
2221
2322#include " Common/Core/RecoDecay.h"
2423
2524#include < Framework/ASoA.h>
2625#include < Framework/AnalysisDataModel.h>
26+ #include < Framework/AnalysisHelpers.h>
2727#include < Framework/AnalysisTask.h>
2828#include < Framework/ConfigContext.h>
2929#include < Framework/Configurable.h>
3737
3838#include < array>
3939#include < cmath>
40+ #include < cstdint>
4041#include < string>
4142#include < vector>
4243
@@ -49,7 +50,6 @@ namespace
4950constexpr int kOriginMcPrompt = 1 ; // MC origin flag: prompt
5051constexpr int kOriginMcNonPrompt = 2 ; // MC origin flag: non-prompt
5152constexpr int8_t kCandSelFlagD0 = 0 ;
52- constexpr int8_t kCandSelFlagD0bar = 1 ;
5353} // namespace
5454
5555namespace o2 ::aod
@@ -198,10 +198,10 @@ enum BinJetCntr {
198198
199199// / MC-efficiency collision-counter bins (jet-matching based efficiency)
200200enum BinMCColCntr {
201- All = 1 ,
202- ZCut = 2 ,
203- Matched = 3 ,
204- MatchedSel8ZCut = 4
201+ AllMCCollisions = 1 ,
202+ SelectedMCCollisions = 2 ,
203+ AssociatedRecoCollisions = 3 ,
204+ SelectedAssociatedRecoCollisions = 4
205205};
206206
207207// / MC-efficiency jet-counter bins (jet-matching based efficiency)
@@ -516,10 +516,10 @@ struct JetHFAngularityTask {
516516
517517 // ---- MC efficiency (jet-to-jet matching based) bin labels ----
518518 auto mcCollisionCounter = registry.get <TH1 >(HIST (" MC_CollisionCounter" ));
519- mcCollisionCounter->GetXaxis ()->SetBinLabel (BinMCColCntr::All , " MC collisions" );
520- mcCollisionCounter->GetXaxis ()->SetBinLabel (BinMCColCntr::ZCut , " MC collisions passing z cut " );
521- mcCollisionCounter->GetXaxis ()->SetBinLabel (BinMCColCntr::Matched , " Matched reconstructed collisions" );
522- mcCollisionCounter->GetXaxis ()->SetBinLabel (BinMCColCntr::MatchedSel8ZCut , " Matched collisions passing selections " );
519+ mcCollisionCounter->GetXaxis ()->SetBinLabel (BinMCColCntr::AllMCCollisions , " All MC collisions" );
520+ mcCollisionCounter->GetXaxis ()->SetBinLabel (BinMCColCntr::SelectedMCCollisions , " Selected MC collisions" );
521+ mcCollisionCounter->GetXaxis ()->SetBinLabel (BinMCColCntr::AssociatedRecoCollisions , " MC-Associated reco collisions" );
522+ mcCollisionCounter->GetXaxis ()->SetBinLabel (BinMCColCntr::SelectedAssociatedRecoCollisions , " Selected MC-Associated reco collisions " );
523523
524524 auto jetCounter = registry.get <TH1 >(HIST (" MC_JetCounter" ));
525525 jetCounter->GetXaxis ()->SetBinLabel (BinMCJetCntr::DetectorLevelJetInMCCollision, " Detector-level D0 jets" );
@@ -610,7 +610,7 @@ struct JetHFAngularityTask {
610610 }
611611
612612 for (auto const & cand : candidates) {
613- double m;
613+ double m= 0 ;
614614 if (candMass > 0 .) {
615615 m = candMass;
616616 } else if constexpr (requires { cand.m (); }) {
@@ -985,8 +985,8 @@ struct JetHFAngularityTask {
985985
986986 void processMCDChargedSubstructureMatched (aod::JetMcCollisions const & mccollisions,
987987 aod::JetCollisionsMCD const & collisions,
988- D0MCDJetsMatched const & mcdjets, // now Filtered: jetCutsPt/jetCutsR applied automatically
989- D0MCPJetsMatched const & mcpjets, // MUST stay bare -- accessor target type
988+ D0MCDJetsMatched const & mcdjets,
989+ D0MCPJetsMatched const & mcpjets,
990990 D0CandidatesMCD const &,
991991 D0CandidatesMCP const &,
992992 aod::JetTracks const &,
@@ -997,29 +997,29 @@ struct JetHFAngularityTask {
997997
998998 for (const auto & mccollision : mccollisions) {
999999
1000- registry.fill (HIST (" MC_CollisionCounter" ), getValFromBin (BinMCColCntr::All ));
1000+ registry.fill (HIST (" MC_CollisionCounter" ), getValFromBin (BinMCColCntr::AllMCCollisions ));
10011001
10021002 if (std::abs (mccollision.posZ ()) > vertexZCut) {
10031003 continue ;
10041004 }
1005- registry.fill (HIST (" MC_CollisionCounter" ), getValFromBin (BinMCColCntr::ZCut ));
1005+ registry.fill (HIST (" MC_CollisionCounter" ), getValFromBin (BinMCColCntr::SelectedMCCollisions ));
10061006
1007- const float mcWeight = mccollision.weight ();
1007+ // const float mcWeight = mccollision.weight();
10081008
10091009 const auto collisionsPerMCCollision = collisions.sliceBy (collisionsPerMCCollisionPreslice, mccollision.globalIndex ());
10101010 for (const auto & collision : collisionsPerMCCollision) {
10111011
1012- registry.fill (HIST (" MC_CollisionCounter" ), getValFromBin (BinMCColCntr::Matched ));
1012+ registry.fill (HIST (" MC_CollisionCounter" ), getValFromBin (BinMCColCntr::AssociatedRecoCollisions ));
10131013
10141014 if (!jetderiveddatautilities::selectCollision (collision, eventSelectionBits) ||
10151015 !(std::abs (collision.posZ ()) < vertexZCut)) {
10161016 continue ;
10171017 }
1018- registry.fill (HIST (" MC_CollisionCounter" ), getValFromBin (BinMCColCntr::MatchedSel8ZCut ));
1018+ registry.fill (HIST (" MC_CollisionCounter" ), getValFromBin (BinMCColCntr::SelectedAssociatedRecoCollisions ));
10191019
10201020 const auto d0mcdJetsPerCollision = mcdjets.sliceBy (d0MCDJetsPerCollisionPreslice, collision.globalIndex ());
10211021 for (const auto & mcdjet : d0mcdJetsPerCollision) {
1022- if (!( mcdjet.pt () > jetPtMin && mcdjet.r () == jetRBin) ) {
1022+ if (mcdjet.pt () <= jetPtMin || mcdjet.r () != jetRBin) {
10231023 continue ;
10241024 }
10251025 registry.fill (HIST (" MC_JetCounter" ), getValFromBin (BinMCJetCntr::DetectorLevelJetInMCCollision));
@@ -1050,8 +1050,8 @@ struct JetHFAngularityTask {
10501050 ++nGeoMatches;
10511051
10521052 const float dR = jetutilities::deltaR (mcdjet, mcpjet);
1053- registry.fill (HIST (" h_jet_matching_dr_mcd_allcand" ), dR, mcWeight );
1054- registry.fill (HIST (" h_jet_pt_response_matrix_allcand" ), mcdjet.pt (), mcpjet.pt (), mcWeight );
1053+ registry.fill (HIST (" h_jet_matching_dr_mcd_allcand" ), dR);
1054+ registry.fill (HIST (" h_jet_pt_response_matrix_allcand" ), mcdjet.pt (), mcpjet.pt ());
10551055
10561056 if (!isGeoMatched) {
10571057 isGeoMatched = true ;
@@ -1065,14 +1065,14 @@ struct JetHFAngularityTask {
10651065 auto mcpjetCandidates = mcpjet.template candidates_as <D0CandidatesMCP>();
10661066 matchedAngularity = computeLambda (mcpjet, mcpjetParticles, mcpjetCandidates, 1 .f , 1 .f ); // λ_1^1
10671067 matchedGirth = computeLambda (mcpjet, mcpjetParticles, mcpjetCandidates, 2 .f , 1 .f ); // λ_2^1
1068- if (mcpjetCandidates.size () > 0 ) {
1068+ if (! mcpjetCandidates.empty () ) {
10691069 auto matchedMcpD0 = mcpjet.template candidates_first_as <D0CandidatesMCP>();
10701070 matchedD0Pt = matchedMcpD0.pt ();
10711071 }
10721072 }
10731073 }
10741074 }
1075- registry.fill (HIST (" h_jet_matching_ngeo_mcd" ), nGeoMatches, mcWeight );
1075+ registry.fill (HIST (" h_jet_matching_ngeo_mcd" ), nGeoMatches);
10761076
10771077 bool isCandMatched = false ;
10781078 int candMatchedGlobalIndex = -1 ;
@@ -1087,29 +1087,29 @@ struct JetHFAngularityTask {
10871087 }
10881088 }
10891089 }
1090- registry.fill (HIST (" h_jet_matching_ncand_mcd" ), nCandMatches, mcWeight );
1090+ registry.fill (HIST (" h_jet_matching_ncand_mcd" ), nCandMatches);
10911091
10921092 // "Clean" match: both criteria fire AND agree on the same target jet.
10931093 const bool isCleanMatched = isGeoMatched && isCandMatched &&
10941094 (geoMatchedGlobalIndex == candMatchedGlobalIndex);
10951095
1096- registry.fill (HIST (" h_jet_matching_geo_status_mcd" ), isGeoMatched ? 1 .5f : 0 .5f , mcWeight );
1097- registry.fill (HIST (" h_jet_matching_cand_status_mcd" ), isCandMatched ? 1 .5f : 0 .5f , mcWeight );
1098- registry.fill (HIST (" h_jet_matching_clean_mcd" ), isCleanMatched ? 1 .5f : 0 .5f , mcWeight );
1096+ registry.fill (HIST (" h_jet_matching_geo_status_mcd" ), isGeoMatched ? 1 .5f : 0 .5f );
1097+ registry.fill (HIST (" h_jet_matching_cand_status_mcd" ), isCandMatched ? 1 .5f : 0 .5f );
1098+ registry.fill (HIST (" h_jet_matching_clean_mcd" ), isCleanMatched ? 1 .5f : 0 .5f );
10991099
11001100 if (isGeoMatched) {
11011101 const bool agree = isCandMatched && (geoMatchedGlobalIndex == candMatchedGlobalIndex);
1102- registry.fill (HIST (" h_jet_matching_geocand_disagree_mcd" ), agree ? 1 .5f : 0 .5f , mcWeight );
1102+ registry.fill (HIST (" h_jet_matching_geocand_disagree_mcd" ), agree ? 1 .5f : 0 .5f );
11031103 }
11041104
11051105 if (isCleanMatched) {
1106- registry.fill (HIST (" h_jet_pt_response_matrix" ), mcdjet.pt (), matchedPt, mcWeight );
1107- registry.fill (HIST (" h_jet_matching_dr_mcd" ), matchedDR, mcWeight );
1106+ registry.fill (HIST (" h_jet_pt_response_matrix" ), mcdjet.pt (), matchedPt);
1107+ registry.fill (HIST (" h_jet_matching_dr_mcd" ), matchedDR);
11081108 }
11091109
1110- const int8_t geoStatus = static_cast <int8_t >(isGeoMatched);
1111- const int8_t candStatus = static_cast <int8_t >(isCandMatched);
1112- const int8_t cleanStatus = static_cast <int8_t >(isCleanMatched);
1110+ const auto geoStatus = static_cast <int8_t >(isGeoMatched);
1111+ const auto candStatus = static_cast <int8_t >(isCandMatched);
1112+ const auto cleanStatus = static_cast <int8_t >(isCleanMatched);
11131113
11141114 const int isCleanMatchedMCD = isCleanMatched ? 1 : 0 ;
11151115
@@ -1132,12 +1132,12 @@ struct JetHFAngularityTask {
11321132 const bool isTrueSignal = (flagMcMatch != 0 ) && !isReflection;
11331133
11341134 if (isReflection) {
1135- registry.fill (HIST (" h_d0_mass_mcd_reflection" ), mcdD0cand.m (), mcWeight );
1135+ registry.fill (HIST (" h_d0_mass_mcd_reflection" ), mcdD0cand.m ());
11361136 registry.fill (HIST (" hSparse_d0_mcd_reflection" ),
11371137 mcdD0cand.m (), mcdD0cand.pt (), mcdjet.pt (), zParallelMCD, originMcd,
11381138 angularity, girth);
11391139 } else if (isTrueSignal) {
1140- registry.fill (HIST (" h_d0_mass_mcd_signal" ), mcdD0cand.m (), mcWeight );
1140+ registry.fill (HIST (" h_d0_mass_mcd_signal" ), mcdD0cand.m ());
11411141 registry.fill (HIST (" hSparse_d0_mcd_calib" ),
11421142 mcdD0cand.m (), mcdD0cand.pt (), mcdjet.pt (), zParallelMCD, originMcd,
11431143 angularity, girth);
@@ -1170,15 +1170,15 @@ struct JetHFAngularityTask {
11701170
11711171 if (isCleanMatched) {
11721172 if (originMcd == kOriginMcPrompt ) {
1173- registry.fill (HIST (" h_jet_pt_response_matrix_pr" ), mcdjet.pt (), matchedPt, mcWeight );
1174- registry.fill (HIST (" h_response_angularity_pr" ), mcdjet.pt (), angularity, matchedPt, matchedAngularity, mcWeight );
1175- registry.fill (HIST (" h_response_girth_pr" ), mcdjet.pt (), girth, matchedPt, matchedGirth, mcWeight );
1176- registry.fill (HIST (" h_response_d0pt_pr" ), mcdjet.pt (), mcdD0cand.pt (), matchedPt, matchedD0Pt, mcWeight );
1173+ registry.fill (HIST (" h_jet_pt_response_matrix_pr" ), mcdjet.pt (), matchedPt);
1174+ registry.fill (HIST (" h_response_angularity_pr" ), mcdjet.pt (), angularity, matchedPt, matchedAngularity);
1175+ registry.fill (HIST (" h_response_girth_pr" ), mcdjet.pt (), girth, matchedPt, matchedGirth);
1176+ registry.fill (HIST (" h_response_d0pt_pr" ), mcdjet.pt (), mcdD0cand.pt (), matchedPt, matchedD0Pt);
11771177 } else if (originMcd == kOriginMcNonPrompt ) {
1178- registry.fill (HIST (" h_jet_pt_response_matrix_np" ), mcdjet.pt (), matchedPt, mcWeight );
1179- registry.fill (HIST (" h_response_angularity_np" ), mcdjet.pt (), angularity, matchedPt, matchedAngularity, mcWeight );
1180- registry.fill (HIST (" h_response_girth_np" ), mcdjet.pt (), girth, matchedPt, matchedGirth, mcWeight );
1181- registry.fill (HIST (" h_response_d0pt_np" ), mcdjet.pt (), mcdD0cand.pt (), matchedPt, matchedD0Pt, mcWeight );
1178+ registry.fill (HIST (" h_jet_pt_response_matrix_np" ), mcdjet.pt (), matchedPt);
1179+ registry.fill (HIST (" h_response_angularity_np" ), mcdjet.pt (), angularity, matchedPt, matchedAngularity);
1180+ registry.fill (HIST (" h_response_girth_np" ), mcdjet.pt (), girth, matchedPt, matchedGirth);
1181+ registry.fill (HIST (" h_response_d0pt_np" ), mcdjet.pt (), mcdD0cand.pt (), matchedPt, matchedD0Pt);
11821182 }
11831183 }
11841184
@@ -1216,7 +1216,7 @@ struct JetHFAngularityTask {
12161216 const auto d0mcpJetsPerMCCollision = mcpjets.sliceBy (d0MCPJetsPerMCCollisionPreslice, mccollision.globalIndex ());
12171217 for (const auto & mcpjet : d0mcpJetsPerMCCollision) {
12181218
1219- if (!( mcpjet.pt () > jetPtMin && mcpjet.r () == jetRBin) ) {
1219+ if (mcpjet.pt () <= jetPtMin || mcpjet.r () != jetRBin) {
12201220 continue ;
12211221 }
12221222
0 commit comments