1515// / \author Changhwan Choi <changhwan.choi@cern.ch>, Pusan National University
1616
1717#include " PWGJE/Core/JetDerivedDataUtilities.h"
18+ #include " PWGJE/Core/JetFindingUtilities.h"
1819#include " PWGJE/Core/JetTaggingUtilities.h"
1920#include " PWGJE/DataModel/Jet.h"
2021#include " PWGJE/DataModel/JetReducedData.h"
2122#include " PWGJE/DataModel/JetTagging.h"
2223
2324#include " Common/CCDB/TriggerAliases.h"
25+ #include " Common/Core/RecoDecay.h"
2426#include " Common/Core/Zorro.h"
2527#include " Common/Core/ZorroSummary.h"
2628#include " Common/DataModel/EventSelection.h"
@@ -126,6 +128,7 @@ struct BjetTaggingGnn {
126128 Configurable<float > pTHatExponent{" pTHatExponent" , 6.0 , " exponent of the event weight for the calculation of pTHat" };
127129
128130 // track level configurables
131+ Configurable<std::string> trackSelections{" trackSelections" , " QualityTracks" , " set track selections" };
129132 Configurable<float > trackPtMin{" trackPtMin" , 0.15 , " minimum track pT" };
130133 Configurable<float > trackPtMax{" trackPtMax" , 1000.0 , " maximum track pT" };
131134 Configurable<float > trackEtaMin{" trackEtaMin" , -0.9 , " minimum track eta" };
@@ -175,6 +178,8 @@ struct BjetTaggingGnn {
175178 std::vector<int > eventSelectionBitsSelMC;
176179 std::vector<int > eventSelectionBitsSel8;
177180
181+ int trackSelectionBits;
182+
178183 std::vector<double > jetRadiiValues;
179184
180185 void init (InitContext const &)
@@ -186,6 +191,8 @@ struct BjetTaggingGnn {
186191 eventSelectionBitsSel8 = jetderiveddatautilities::initialiseEventSelectionBits (" sel8" );
187192 eventSelectionBitsSelMC = jetderiveddatautilities::initialiseEventSelectionBits (" selMC" );
188193
194+ trackSelectionBits = jetderiveddatautilities::initialiseTrackSelection (static_cast <std::string>(trackSelections));
195+
189196 if (doprocessDataJetsTrig) {
190197 zorroSummary.setObject (zorro.getZorroSummary ());
191198 }
@@ -236,7 +243,7 @@ struct BjetTaggingGnn {
236243
237244 const AxisSpec axisTrackpT{200 , 0 ., 200 ., " #it{p}_{T} (GeV/#it{c})" };
238245 const AxisSpec axisTrackpTFine{1000 , 0 ., 10 ., " #it{p}_{T} (GeV/#it{c})" };
239- const AxisSpec axisJetpT{200 , 0 ., 200 ., " #it{p}_{T} (GeV/#it{c})" };
246+ const AxisSpec axisJetpT{250 , 0 ., 250 ., " #it{p}_{T} (GeV/#it{c})" };
240247 const AxisSpec axisJetEta{200 , -0.8 , 0.8 , " #it{#eta}_{jet}" };
241248 const AxisSpec axisDb{200 , dbMin, dbMax, " #it{D}_{b}" };
242249 const AxisSpec axisDbFine{dbNbins, dbMin, dbMax, " #it{D}_{b}" };
@@ -250,6 +257,7 @@ struct BjetTaggingGnn {
250257 registry.add (" h_jetMass" , " " , {HistType::kTH1F , {axisJetMass}});
251258 registry.add (" h_Db" , " " , {HistType::kTH1F , {axisDbFine}});
252259 registry.add (" h2_jetpT_Db" , " " , {HistType::kTH2F , {axisJetpT, axisDb}});
260+ registry.add (" h2_nTracks_Db" , " " , {HistType::kTH2F , {axisNTracks, axisDb}});
253261
254262 registry.add (" h_gnnfeat_trackpT" , " " , {HistType::kTH1F , {{200 , 0 ., 100 ., " #it{p}_{T} (GeV/#it{c})" }}});
255263 registry.add (" h_gnnfeat_trackPhi" , " " , {HistType::kTH1F , {{200 , 0 ., 2 . * M_PI, " #it{#phi}" }}});
@@ -278,6 +286,18 @@ struct BjetTaggingGnn {
278286 registry.add (" h_partpT_matched_fine" , " " , {HistType::kTH1F , {axisTrackpTFine}}, callSumw2);
279287 registry.add (" h_partpT" , " " , {HistType::kTH1F , {axisTrackpT}}, callSumw2);
280288 registry.add (" h_partpT_fine" , " " , {HistType::kTH1F , {axisTrackpTFine}}, callSumw2);
289+ registry.add (" h_dcaXY_coll_matched" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{xy}| (cm)" }}}, callSumw2);
290+ registry.add (" h_dcaXY_coll_matched_b" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{xy}| (cm)" }}}, callSumw2);
291+ registry.add (" h_dcaXY_coll_matched_c" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{xy}| (cm)" }}}, callSumw2);
292+ registry.add (" h_dcaXY_coll_matched_lf" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{xy}| (cm)" }}}, callSumw2);
293+ registry.add (" h_dcaXY_coll_mismatched" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{xy}| (cm)" }}}, callSumw2);
294+ registry.add (" h_dcaXY_npp" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{xy}| (cm)" }}}, callSumw2);
295+ registry.add (" h_dcaZ_coll_matched" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{z}| (cm)" }}}, callSumw2);
296+ registry.add (" h_dcaZ_coll_matched_b" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{z}| (cm)" }}}, callSumw2);
297+ registry.add (" h_dcaZ_coll_matched_c" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{z}| (cm)" }}}, callSumw2);
298+ registry.add (" h_dcaZ_coll_matched_lf" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{z}| (cm)" }}}, callSumw2);
299+ registry.add (" h_dcaZ_coll_mismatched" , " " , {HistType::kTH1F , {{200 , 0 ., 4 ., " |DCA_#it{z}| (cm)" }}}, callSumw2);
300+ registry.add (" h_dcaZ_npp" , " " , {HistType::kTH1F , {{200 , 0 ., 5 ., " |DCA_#it{z}| (cm)" }}}, callSumw2);
281301 }
282302
283303 if (doprocessDataJetsSel || doprocessMCDJetsSel) {
@@ -302,6 +322,9 @@ struct BjetTaggingGnn {
302322 registry.add (" h2_jetpT_Db_b" , " b-jet" , {HistType::kTH2F , {axisJetpT, axisDb}});
303323 registry.add (" h2_jetpT_Db_c" , " c-jet" , {HistType::kTH2F , {axisJetpT, axisDb}});
304324 registry.add (" h2_jetpT_Db_lf" , " lf-jet" , {HistType::kTH2F , {axisJetpT, axisDb}});
325+ registry.add (" h2_nTracks_Db_b" , " b-jet" , {HistType::kTH2F , {axisNTracks, axisDb}});
326+ registry.add (" h2_nTracks_Db_c" , " c-jet" , {HistType::kTH2F , {axisNTracks, axisDb}});
327+ registry.add (" h2_nTracks_Db_lf" , " lf-jet" , {HistType::kTH2F , {axisNTracks, axisDb}});
305328 registry.add (" h2_Response_DetjetpT_PartjetpT" , " " , {HistType::kTH2F , {axisJetpT, axisJetpT}}, callSumw2);
306329 registry.add (" h2_Response_DetjetpT_PartjetpT_b" , " b-jet" , {HistType::kTH2F , {axisJetpT, axisJetpT}}, callSumw2);
307330 registry.add (" h2_Response_DetjetpT_PartjetpT_c" , " c-jet" , {HistType::kTH2F , {axisJetpT, axisJetpT}}, callSumw2);
@@ -513,6 +536,7 @@ struct BjetTaggingGnn {
513536 registry.fill (HIST (" h_jetMass" ), analysisJet.mass ());
514537 registry.fill (HIST (" h_Db" ), analysisJet.scoreML ());
515538 registry.fill (HIST (" h2_jetpT_Db" ), analysisJet.pt (), analysisJet.scoreML ());
539+ registry.fill (HIST (" h2_nTracks_Db" ), nTracks, analysisJet.scoreML ());
516540
517541 if (doDataDriven) {
518542 if (doDataDrivenExtra) {
@@ -567,19 +591,23 @@ struct BjetTaggingGnn {
567591 registry.fill (HIST (" h_jetMass" ), analysisJet.mass (), weightEvt);
568592 registry.fill (HIST (" h_Db" ), analysisJet.scoreML (), weightEvt);
569593 registry.fill (HIST (" h2_jetpT_Db" ), analysisJet.pt (), analysisJet.scoreML (), weightEvt);
594+ registry.fill (HIST (" h2_nTracks_Db" ), nTracks, analysisJet.scoreML (), weightEvt);
570595
571596 if (jetFlavor == JetTaggingSpecies::beauty) {
572597 registry.fill (HIST (" h_jetpT_b" ), analysisJet.pt (), weightEvt);
573598 registry.fill (HIST (" h_Db_b" ), analysisJet.scoreML (), weightEvt);
574599 registry.fill (HIST (" h2_jetpT_Db_b" ), analysisJet.pt (), analysisJet.scoreML (), weightEvt);
600+ registry.fill (HIST (" h2_nTracks_Db_b" ), nTracks, analysisJet.scoreML (), weightEvt);
575601 } else if (jetFlavor == JetTaggingSpecies::charm) {
576602 registry.fill (HIST (" h_jetpT_c" ), analysisJet.pt (), weightEvt);
577603 registry.fill (HIST (" h_Db_c" ), analysisJet.scoreML (), weightEvt);
578604 registry.fill (HIST (" h2_jetpT_Db_c" ), analysisJet.pt (), analysisJet.scoreML (), weightEvt);
605+ registry.fill (HIST (" h2_nTracks_Db_c" ), nTracks, analysisJet.scoreML (), weightEvt);
579606 } else {
580607 registry.fill (HIST (" h_jetpT_lf" ), analysisJet.pt (), weightEvt);
581608 registry.fill (HIST (" h_Db_lf" ), analysisJet.scoreML (), weightEvt);
582609 registry.fill (HIST (" h2_jetpT_Db_lf" ), analysisJet.pt (), analysisJet.scoreML (), weightEvt);
610+ registry.fill (HIST (" h2_nTracks_Db_lf" ), nTracks, analysisJet.scoreML (), weightEvt);
583611 if (jetFlavor == JetTaggingSpecies::none) {
584612 registry.fill (HIST (" h2_jetpT_Db_lf_none" ), analysisJet.pt (), analysisJet.scoreML (), weightEvt);
585613 } else {
@@ -1061,7 +1089,7 @@ struct BjetTaggingGnn {
10611089 bool matchedMcColl = collision.has_mcCollision () && std::fabs (collision.template mcCollision_as <FilteredCollisionsMCP>().posZ ()) < vertexZCut;
10621090
10631091 for (const auto & track : tracks) {
1064- if (track.eta () <= trackEtaMin || track.eta () >= trackEtaMax) {
1092+ if (! jetderiveddatautilities::selectTrack (track, trackSelectionBits) || track.eta () <= trackEtaMin || track.eta () >= trackEtaMax) {
10651093 continue ;
10661094 }
10671095 registry.fill (HIST (" h_trackpT" ), track.pt (), weightEvt);
@@ -1072,9 +1100,37 @@ struct BjetTaggingGnn {
10721100 continue ;
10731101 }
10741102 auto particle = track.template mcParticle_as <aod::JetParticles>();
1075- if (particle.isPhysicalPrimary () && particle.eta () > trackEtaMin && particle.eta () < trackEtaMax) {
1076- registry.fill (HIST (" h2_trackpT_partpT" ), track.pt (), particle.pt (), weightEvt);
1077- registry.fill (HIST (" h_partpT_matched_fine" ), particle.pt (), weightEvt);
1103+ if (particle.isPhysicalPrimary ()) {
1104+ if (particle.eta () > trackEtaMin && particle.eta () < trackEtaMax) {
1105+ registry.fill (HIST (" h2_trackpT_partpT" ), track.pt (), particle.pt (), weightEvt);
1106+ registry.fill (HIST (" h_partpT_matched_fine" ), particle.pt (), weightEvt);
1107+ // Track association accuracy as a function of DCA
1108+ if (track.pt () >= trackPtMin) {
1109+ if (particle.mcCollisionId () == collision.mcCollisionId ()) {
1110+ registry.fill (HIST (" h_dcaXY_coll_matched" ), std::fabs (track.dcaXY ()), weightEvt); // Matched to particle from the same MC collision
1111+ registry.fill (HIST (" h_dcaZ_coll_matched" ), std::fabs (track.dcaZ ()), weightEvt);
1112+ int origin = RecoDecay::getParticleOrigin (allParticles, particle, false );
1113+ if (origin == RecoDecay::OriginType::NonPrompt) {
1114+ registry.fill (HIST (" h_dcaXY_coll_matched_b" ), std::fabs (track.dcaXY ()), weightEvt);
1115+ registry.fill (HIST (" h_dcaZ_coll_matched_b" ), std::fabs (track.dcaZ ()), weightEvt);
1116+ } else if (origin == RecoDecay::OriginType::Prompt) {
1117+ registry.fill (HIST (" h_dcaXY_coll_matched_c" ), std::fabs (track.dcaXY ()), weightEvt);
1118+ registry.fill (HIST (" h_dcaZ_coll_matched_c" ), std::fabs (track.dcaZ ()), weightEvt);
1119+ } else {
1120+ registry.fill (HIST (" h_dcaXY_coll_matched_lf" ), std::fabs (track.dcaXY ()), weightEvt);
1121+ registry.fill (HIST (" h_dcaZ_coll_matched_lf" ), std::fabs (track.dcaZ ()), weightEvt);
1122+ }
1123+ } else {
1124+ registry.fill (HIST (" h_dcaXY_coll_mismatched" ), std::fabs (track.dcaXY ()), weightEvt); // Matched to particle from a different MC collision
1125+ registry.fill (HIST (" h_dcaZ_coll_mismatched" ), std::fabs (track.dcaZ ()), weightEvt);
1126+ }
1127+ }
1128+ }
1129+ } else {
1130+ if (particle.eta () > trackEtaMin && particle.eta () < trackEtaMax && track.pt () >= trackPtMin) {
1131+ registry.fill (HIST (" h_dcaXY_npp" ), std::fabs (track.dcaXY ()), weightEvt);
1132+ registry.fill (HIST (" h_dcaZ_npp" ), std::fabs (track.dcaZ ()), weightEvt);
1133+ }
10781134 }
10791135 }
10801136
0 commit comments