Skip to content

Commit 2735b91

Browse files
JaeYoonCHOalibuild
andauthored
[PWGHF] Add an axis into THnSpares for ML study in the task (#9814)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 3d90d2f commit 2735b91

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

PWGHF/D2H/Tasks/taskXicToXiPiPi.cxx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ struct HfTaskXicToXiPiPi {
4747
Configurable<bool> checkDecayTypeMc{"checkDecayTypeMc", false, "Flag to enable DecayType histogram"};
4848
// THnSparese for ML selection check
4949
Configurable<bool> enableTHn{"enableTHn", false, "Fill THnSparse for Xic"};
50+
51+
Service<o2::framework::O2DatabasePDG> pdg;
52+
53+
Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= selectionFlagXic);
54+
55+
// Axis
5056
ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {400, 0., 40.}, ""};
5157
ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {300, 1.8, 3.0}, ""};
5258
ConfigurableAxis thnConfigAxisPtProng{"thnConfigAxisPtProng", {300, 0., 30.}, ""};
@@ -55,19 +61,15 @@ struct HfTaskXicToXiPiPi {
5561
ConfigurableAxis thnConfigAxisDecLengthXY{"thnConfigAxisDecLengthXY", {200, 0., 0.5}, ""};
5662
ConfigurableAxis thnConfigAxisCPA{"thnConfigAxisCPA", {110, -1.1, 1.1}, ""};
5763
ConfigurableAxis thnConfigAxisBdtScoreBkg{"thnConfigAxisBdtScoreBkg", {100, 0., 1.}, ""};
58-
ConfigurableAxis thnConfigAxisBdtScoreSignal{"thnConfigAxisBdtScoreSignal", {100, 0., 1.}, ""};
59-
// Axis
64+
ConfigurableAxis thnConfigAxisBdtScorePrompt{"thnConfigAxisBdtScorePrompt", {100, 0., 1.}, ""};
65+
ConfigurableAxis thnConfigAxisBdtScoreNonPrompt{"thnConfigAxisBdtScoreNonPrompt", {100, 0., 1.}, ""};
6066
ConfigurableAxis binsDecLength{"binsDecLength", {200, 0., 0.5}, ""};
6167
ConfigurableAxis binsErrDecLength{"binsErrDecLength", {100, 0., 1.}, ""};
6268
ConfigurableAxis binsDCA{"binsDCA", {100, -0.05, 0.05}, ""};
6369
ConfigurableAxis binsImpParErr{"binsImpParErr", {200, -0.1, 0.1}, ""};
6470
ConfigurableAxis binsSV{"binsSV", {200, -5., 5.}, ""};
6571
ConfigurableAxis binsChi2{"binsChi2", {200, 0., 0.1}, ""};
6672

67-
Service<o2::framework::O2DatabasePDG> pdg;
68-
69-
Filter filterSelectCandidates = (aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= selectionFlagXic);
70-
7173
HistogramRegistry registry{"registry"};
7274

7375
void init(InitContext const&)
@@ -251,11 +253,12 @@ struct HfTaskXicToXiPiPi {
251253
const AxisSpec thnAxisDecLengthXY{thnConfigAxisDecLengthXY, "decay length xy (cm)"};
252254
const AxisSpec thnAxisCPA{thnConfigAxisCPA, "#Xi^{#plus}_{c} candidate cosine of pointing angle"};
253255
const AxisSpec thnAxisBdtScoreBkg{thnConfigAxisBdtScoreBkg, "BDT score of background"};
254-
const AxisSpec thnAxisBdtScoreSignal{thnConfigAxisBdtScoreSignal, "BDT score of prompt Xic"};
256+
const AxisSpec thnAxisBdtScorePrompt{thnConfigAxisBdtScorePrompt, "BDT score of prompt #Xi^{#plus}_{c}"};
257+
const AxisSpec thnAxisBdtScoreNonPrompt{thnConfigAxisBdtScoreNonPrompt, "BDT score of non-prompt #Xi^{#plus}_{c}"};
255258

256259
if (doprocessWithKFParticleAndML || doprocessWithDCAFitterAndML || doprocessMcWithKFParticleAndML || doprocessMcWithDCAFitterAndML) {
257260
// with ML information
258-
registry.add("hXicToXiPiPiVarsWithML", "THnSparse for Xic with ML", HistType::kTHnSparseF, {thnAxisPt, thnAxisMass, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisBdtScoreBkg, thnAxisBdtScoreSignal});
261+
registry.add("hXicToXiPiPiVarsWithML", "THnSparse for Xic with ML", HistType::kTHnSparseF, {thnAxisPt, thnAxisMass, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisBdtScoreBkg, thnAxisBdtScorePrompt, thnAxisBdtScoreNonPrompt});
259262
} else {
260263
// without ML information
261264
registry.add("hXicToXiPiPiVars", "THnSparse for Xic", HistType::kTHnSparseF, {thnAxisPt, thnAxisMass, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA});
@@ -274,13 +277,15 @@ struct HfTaskXicToXiPiPi {
274277

275278
if constexpr (useMl) {
276279
// with ML information
277-
double outputBkg = -99.;
278-
double outputPrompt = -99.;
280+
double outputBkg = -99.; // bkg score
281+
double outputPrompt = -99.; // prompt score
282+
double outputFD = -99.; // non-prompt score
279283
if (candidate.mlProbXicToXiPiPi().size() > 0) {
280284
outputBkg = candidate.mlProbXicToXiPiPi()[0];
281285
outputPrompt = candidate.mlProbXicToXiPiPi()[1];
286+
outputFD = candidate.mlProbXicToXiPiPi()[2];
282287
}
283-
registry.get<THnSparse>(HIST("hXicToXiPiPiVarsWithML"))->Fill(candidate.pt(), candidate.invMassXicPlus(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), outputBkg, outputPrompt);
288+
registry.get<THnSparse>(HIST("hXicToXiPiPiVarsWithML"))->Fill(candidate.pt(), candidate.invMassXicPlus(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa(), outputBkg, outputPrompt, outputFD);
284289
} else {
285290
// without ML information
286291
registry.get<THnSparse>(HIST("hXicToXiPiPiVars"))->Fill(candidate.pt(), candidate.invMassXicPlus(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.cpa());

0 commit comments

Comments
 (0)