Skip to content

Commit 000404a

Browse files
choich08365Changhwan Choialibuild
authored
[PWGJE] GNN b-jet histograms to investigate minor peak structure in Db, DCA c… (#15328)
Co-authored-by: Changhwan Choi <changhwan.choi@cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 30dd34d commit 000404a

File tree

3 files changed

+136
-18
lines changed

3 files changed

+136
-18
lines changed

PWGJE/Core/JetTaggingUtilities.h

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,9 +1095,9 @@ void analyzeJetTrackInfo4MLnoSV(AnalysisJet const& analysisJet, AnyTracks const&
10951095
std::sort(tracksParams.begin(), tracksParams.end(), compare);
10961096
}
10971097

1098-
// Looping over the track info and putting them in the input vector (for GNN b-jet tagging)
1098+
// Looping over the track info and putting them in the input vector, with extra input features (for GNN b-jet tagging)
10991099
template <typename AnalysisJet, typename AnyTracks, typename AnyOriginalTracks>
1100-
void analyzeJetTrackInfo4GNN(AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, AnyOriginalTracks const& /*origTracks*/, std::vector<std::vector<float>>& tracksParams, float trackPtMin = 0.5, float trackDcaXYMax = 10.0, float trackDcaZMax = 10.0, int64_t nMaxConstit = 40)
1100+
void analyzeJetTrackInfo4GNNwExtra(AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, AnyOriginalTracks const& /*origTracks*/, std::vector<std::vector<float>>& tracksParams, float trackPtMin = 0.5, float trackDcaXYMax = 10.0, float trackDcaZMax = 10.0, int64_t nMaxConstit = 40)
11011101
{
11021102
for (const auto& constituent : analysisJet.template tracks_as<AnyTracks>()) {
11031103

@@ -1124,6 +1124,33 @@ void analyzeJetTrackInfo4GNN(AnalysisJet const& analysisJet, AnyTracks const& /*
11241124
}
11251125
}
11261126

1127+
// Looping over the track info and putting them in the input vector (for GNN b-jet tagging)
1128+
template <typename AnalysisJet, typename AnyTracks>
1129+
void analyzeJetTrackInfo4GNN(AnalysisJet const& analysisJet, AnyTracks const& /*allTracks*/, std::vector<std::vector<float>>& tracksParams, float trackPtMin = 0.5, float trackDcaXYMax = 10.0, float trackDcaZMax = 10.0, int64_t nMaxConstit = 40)
1130+
{
1131+
for (const auto& constituent : analysisJet.template tracks_as<AnyTracks>()) {
1132+
1133+
if (constituent.pt() < trackPtMin || !trackAcceptanceWithDca(constituent, trackDcaXYMax, trackDcaZMax)) {
1134+
continue;
1135+
}
1136+
1137+
int sign = getGeoSign(analysisJet, constituent);
1138+
1139+
if (static_cast<int64_t>(tracksParams.size()) < nMaxConstit) {
1140+
tracksParams.emplace_back(std::vector<float>{constituent.pt(), constituent.phi(), constituent.eta(), static_cast<float>(constituent.sign()), std::abs(constituent.dcaXY()) * sign, constituent.sigmadcaXY(), std::abs(constituent.dcaZ()) * sign, constituent.sigmadcaZ()});
1141+
} else {
1142+
// If there are more than nMaxConstit constituents in the jet, select only nMaxConstit constituents with the highest DCA_XY significance.
1143+
size_t minIdx = 0;
1144+
for (size_t i = 0; i < tracksParams.size(); ++i) {
1145+
if (tracksParams[i][4] / tracksParams[i][5] < tracksParams[minIdx][4] / tracksParams[minIdx][5])
1146+
minIdx = i;
1147+
}
1148+
if (std::abs(constituent.dcaXY()) * sign / constituent.sigmadcaXY() > tracksParams[minIdx][4] / tracksParams[minIdx][5])
1149+
tracksParams[minIdx] = std::vector<float>{constituent.pt(), constituent.phi(), constituent.eta(), static_cast<float>(constituent.sign()), std::abs(constituent.dcaXY()) * sign, constituent.sigmadcaXY(), std::abs(constituent.dcaZ()) * sign, constituent.sigmadcaZ()};
1150+
}
1151+
}
1152+
}
1153+
11271154
// Discriminant value for GNN b-jet tagging
11281155
template <typename T>
11291156
T getDb(const std::vector<T>& logits, double fC = 0.018)

PWGJE/TableProducer/jetTaggerHF.cxx

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ struct JetTaggerHFTask {
277277
}
278278
}
279279
}
280-
if (doprocessAlgorithmGNN) {
280+
if (doprocessAlgorithmGNN || doprocessAlgorithmGNNwExtra) {
281281
if (jet.pt() >= jetpTMin) {
282282
float dbRange;
283283
if (scoreML[jet.globalIndex()] < dbMin) {
@@ -513,7 +513,7 @@ struct JetTaggerHFTask {
513513
}
514514
}
515515

516-
if (doprocessAlgorithmML || doprocessAlgorithmGNN) {
516+
if (doprocessAlgorithmML || doprocessAlgorithmGNN || doprocessAlgorithmGNNwExtra) {
517517
bMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl);
518518
if (loadModelsFromCCDB) {
519519
ccdbApi.init(ccdbUrl);
@@ -525,7 +525,7 @@ struct JetTaggerHFTask {
525525
bMlResponse.init();
526526
}
527527

528-
if (doprocessAlgorithmGNN) {
528+
if (doprocessAlgorithmGNN || doprocessAlgorithmGNNwExtra) {
529529
tensorAlloc = o2::analysis::GNNBjetAllocator(nJetFeat.value, nTrkFeat.value, nClassesMl.value, nTrkOrigin.value, transformFeatureJetMean.value, transformFeatureJetStdev.value, transformFeatureTrkMean.value, transformFeatureTrkStdev.value, nJetConst, tfFuncTypeGNN.value);
530530

531531
registry.add("h2_count_db", "#it{D}_{b} underflow/overflow;Jet flavour;#it{D}_{b} range", {HistType::kTH2F, {{4, 0., 4.}, {3, 0., 3.}}});
@@ -538,10 +538,10 @@ struct JetTaggerHFTask {
538538
h2CountDb->GetYaxis()->SetBinLabel(2, "in range");
539539
h2CountDb->GetYaxis()->SetBinLabel(3, "overflow");
540540

541-
registry.add("h_db_b", "#it{D}_{b} b-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -10., 35.}}});
542-
registry.add("h_db_c", "#it{D}_{b} c-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -10., 35.}}});
543-
registry.add("h_db_lf", "#it{D}_{b} lf-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -10., 35.}}});
544-
registry.add("h2_pt_db", "#it{p}_{T} vs. #it{D}_{b};#it{p}_{T}^{ch jet} (GeV/#it{c}^{2});#it{D}_{b}", {HistType::kTH2F, {{100, 0., 200.}, {50, -10., 35.}}});
541+
registry.add("h_db_b", "#it{D}_{b} b-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -20., 30.}}});
542+
registry.add("h_db_c", "#it{D}_{b} c-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -20., 30.}}});
543+
registry.add("h_db_lf", "#it{D}_{b} lf-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -20., 30.}}});
544+
registry.add("h2_pt_db", "#it{p}_{T} vs. #it{D}_{b};#it{p}_{T}^{ch jet} (GeV/#it{c}^{2});#it{D}_{b}", {HistType::kTH2F, {{100, 0., 200.}, {50, -20., 30.}}});
545545
}
546546
}
547547

@@ -612,11 +612,40 @@ struct JetTaggerHFTask {
612612
}
613613

614614
template <typename AnyJets, typename AnyTracks, typename AnyOriginalTracks>
615-
void analyzeJetAlgorithmGNN(AnyJets const& jets, AnyTracks const& tracks, AnyOriginalTracks const& origTracks)
615+
void analyzeJetAlgorithmGNNwExtra(AnyJets const& jets, AnyTracks const& tracks, AnyOriginalTracks const& origTracks)
616616
{
617617
for (const auto& jet : jets) {
618618
std::vector<std::vector<float>> trkFeat;
619-
jettaggingutilities::analyzeJetTrackInfo4GNN(jet, tracks, origTracks, trkFeat, trackPtMin, trackDcaXYMax, trackDcaZMax, nJetConst);
619+
jettaggingutilities::analyzeJetTrackInfo4GNNwExtra(jet, tracks, origTracks, trkFeat, trackPtMin, trackDcaXYMax, trackDcaZMax, nJetConst);
620+
621+
std::vector<float> jetFeat{jet.pt(), jet.phi(), jet.eta(), jet.mass()};
622+
623+
if (trkFeat.size() > 0) {
624+
std::vector<float> feat;
625+
std::vector<Ort::Value> gnnInput;
626+
tensorAlloc.getGNNInput(jetFeat, trkFeat, feat, gnnInput);
627+
628+
auto modelOutput = bMlResponse.getModelOutput(gnnInput, 0);
629+
float db = jettaggingutilities::getDb(modelOutput, fC);
630+
if (!std::isnan(db)) {
631+
scoreML[jet.globalIndex()] = db;
632+
} else {
633+
scoreML[jet.globalIndex()] = 999.;
634+
LOGF(debug, "doprocessAlgorithmGNNwExtra, Db is NaN (%d)", jet.globalIndex());
635+
}
636+
} else {
637+
scoreML[jet.globalIndex()] = -999.;
638+
LOGF(debug, "doprocessAlgorithmGNNwExtra, trkFeat.size() <= 0 (%d)", jet.globalIndex());
639+
}
640+
}
641+
}
642+
643+
template <typename AnyJets, typename AnyTracks>
644+
void analyzeJetAlgorithmGNN(AnyJets const& jets, AnyTracks const& tracks)
645+
{
646+
for (const auto& jet : jets) {
647+
std::vector<std::vector<float>> trkFeat;
648+
jettaggingutilities::analyzeJetTrackInfo4GNN(jet, tracks, trkFeat, trackPtMin, trackDcaXYMax, trackDcaZMax, nJetConst);
620649

621650
std::vector<float> jetFeat{jet.pt(), jet.phi(), jet.eta(), jet.mass()};
622651

@@ -684,9 +713,15 @@ struct JetTaggerHFTask {
684713
}
685714
PROCESS_SWITCH(JetTaggerHFTask, processAlgorithmMLnoSV, "Fill ML evaluation score for charged jets but without using SVs", false);
686715

687-
void processAlgorithmGNN(JetTable const& jets, JetTracksExt const& jtracks, OriginalTracks const& origTracks)
716+
void processAlgorithmGNNwExtra(JetTable const& jets, JetTracksExt const& jtracks, OriginalTracks const& origTracks)
717+
{
718+
analyzeJetAlgorithmGNNwExtra(jets, jtracks, origTracks);
719+
}
720+
PROCESS_SWITCH(JetTaggerHFTask, processAlgorithmGNNwExtra, "Fill GNN evaluation score (D_b) for charged jets with extra input features", false);
721+
722+
void processAlgorithmGNN(JetTable const& jets, JetTracksExt const& jtracks)
688723
{
689-
analyzeJetAlgorithmGNN(jets, jtracks, origTracks);
724+
analyzeJetAlgorithmGNN(jets, jtracks);
690725
}
691726
PROCESS_SWITCH(JetTaggerHFTask, processAlgorithmGNN, "Fill GNN evaluation score (D_b) for charged jets", false);
692727

PWGJE/Tasks/bjetTaggingGnn.cxx

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
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

Comments
 (0)