Skip to content

Commit fbeb062

Browse files
choich08365Changhwan Choialibuild
authored
[PWGJE] Updated GNN b-jet MCP jet selection (#13029)
Co-authored-by: Changhwan Choi <changhwan.choi@cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 26a10b0 commit fbeb062

File tree

2 files changed

+332
-59
lines changed

2 files changed

+332
-59
lines changed

PWGJE/TableProducer/jetTaggerHF.cxx

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ struct JetTaggerHFTask {
119119
Configurable<bool> loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"};
120120

121121
// GNN configuration
122+
Configurable<float> jetpTMin{"jetpTMin", 5., "minimum jet pT"};
123+
Configurable<float> dbMin{"dbMin", -10., "minimum GNN Db"};
124+
Configurable<float> dbMax{"dbMax", 20., "maximum GNN Db"};
122125
Configurable<double> fC{"fC", 0.018, "Parameter f_c for D_b calculation"};
123126
Configurable<int64_t> nJetFeat{"nJetFeat", 4, "Number of jet GNN input features"};
124127
Configurable<int64_t> nTrkFeat{"nTrkFeat", 13, "Number of track GNN input features"};
@@ -273,23 +276,37 @@ struct JetTaggerHFTask {
273276
}
274277
}
275278
if (doprocessAlgorithmGNN) {
276-
if constexpr (isMC) {
277-
switch (origin) {
278-
case 2:
279-
registry.fill(HIST("h_db_b"), scoreML[jet.globalIndex()]);
280-
break;
281-
case 1:
282-
registry.fill(HIST("h_db_c"), scoreML[jet.globalIndex()]);
283-
break;
284-
case 0:
285-
case 3:
286-
registry.fill(HIST("h_db_lf"), scoreML[jet.globalIndex()]);
287-
break;
288-
default:
289-
LOGF(debug, "doprocessAlgorithmGNN, Unexpected origin value: %d (%d)", origin, jet.globalIndex());
279+
float dbRange;
280+
if (jet.pt() >= jetpTMin) {
281+
if (scoreML[jet.globalIndex()] < dbMin) {
282+
dbRange = 0.5; // underflow
283+
} else if (scoreML[jet.globalIndex()] >= dbMax) {
284+
dbRange = 2.5; // overflow
285+
} else {
286+
dbRange = 1.5; // in range
287+
}
288+
registry.fill(HIST("h2_count_db"), 3.5, dbRange); // incl jet
289+
if constexpr (isMC) {
290+
switch (origin) {
291+
case 2:
292+
registry.fill(HIST("h_db_b"), scoreML[jet.globalIndex()]);
293+
registry.fill(HIST("h2_count_db"), 0.5, dbRange); // b-jet
294+
break;
295+
case 1:
296+
registry.fill(HIST("h_db_c"), scoreML[jet.globalIndex()]);
297+
registry.fill(HIST("h2_count_db"), 1.5, dbRange); // c-jet
298+
break;
299+
case 0:
300+
case 3:
301+
registry.fill(HIST("h_db_lf"), scoreML[jet.globalIndex()]);
302+
registry.fill(HIST("h2_count_db"), 2.5, dbRange); // lf-jet
303+
break;
304+
default:
305+
LOGF(debug, "doprocessAlgorithmGNN, Unexpected origin value: %d (%d)", origin, jet.globalIndex());
306+
}
290307
}
308+
registry.fill(HIST("h2_pt_db"), jet.pt(), scoreML[jet.globalIndex()]);
291309
}
292-
registry.fill(HIST("h2_pt_db"), jet.pt(), scoreML[jet.globalIndex()]);
293310
}
294311
taggingTable(decisionNonML[jet.globalIndex()], jetProb, scoreML[jet.globalIndex()]);
295312
}
@@ -508,6 +525,17 @@ struct JetTaggerHFTask {
508525

509526
if (doprocessAlgorithmGNN) {
510527
tensorAlloc = o2::analysis::GNNBjetAllocator(nJetFeat.value, nTrkFeat.value, nClassesMl.value, nTrkOrigin.value, transformFeatureJetMean.value, transformFeatureJetStdev.value, transformFeatureTrkMean.value, transformFeatureTrkStdev.value, nJetConst);
528+
529+
registry.add("h2_count_db", "#it{D}_{b} underflow/overflow;Jet flavour;#it{D}_{b} range", {HistType::kTH2F, {{4, 0., 4.}, {3, 0., 3.}}});
530+
auto h2CountDb = registry.get<TH2>(HIST("h2_count_db"));
531+
h2CountDb->GetXaxis()->SetBinLabel(1, "b-jet");
532+
h2CountDb->GetXaxis()->SetBinLabel(2, "c-jet");
533+
h2CountDb->GetXaxis()->SetBinLabel(3, "lf-jet");
534+
h2CountDb->GetXaxis()->SetBinLabel(4, "incl jet");
535+
h2CountDb->GetYaxis()->SetBinLabel(1, "underflow");
536+
h2CountDb->GetYaxis()->SetBinLabel(2, "in range");
537+
h2CountDb->GetYaxis()->SetBinLabel(3, "overflow");
538+
511539
registry.add("h_db_b", "#it{D}_{b} b-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -10., 35.}}});
512540
registry.add("h_db_c", "#it{D}_{b} c-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -10., 35.}}});
513541
registry.add("h_db_lf", "#it{D}_{b} lf-jet;#it{D}_{b}", {HistType::kTH1F, {{50, -10., 35.}}});

0 commit comments

Comments
 (0)