@@ -142,6 +142,7 @@ struct HfCorrelatorDsHadrons {
142142 Configurable<int > selectionFlagDs{" selectionFlagDs" , 7 , " Selection Flag for Ds" };
143143 Configurable<int > numberEventsMixed{" numberEventsMixed" , 5 , " Number of events mixed in ME process" };
144144 Configurable<bool > applyEfficiency{" applyEfficiency" , true , " Flag for applying D-meson efficiency weights" };
145+ Configurable<bool > fillSystematics{" fillSystematics" , false , " Flag for filling THnSparse for systematics" };
145146 Configurable<float > yCandMax{" yCandMax" , 0.8 , " max. cand. rapidity" };
146147 Configurable<float > yCandGenMax{" yCandGenMax" , 0.5 , " max. gen. cand. rapidity" };
147148 Configurable<float > etaTrackMax{" etaTrackMax" , 0.8 , " max. eta of tracks" };
@@ -152,18 +153,20 @@ struct HfCorrelatorDsHadrons {
152153 Configurable<float > ptDaughterMin{" ptDaughterMin" , 0.1 , " min. daughter pT" };
153154 Configurable<float > ptTrackMin{" ptTrackMin" , 0.3 , " min. track pT" };
154155 Configurable<float > ptTrackMax{" ptTrackMax" , 50 ., " max. track pT" };
156+ Configurable<std::vector<int >> classMl{" classMl" , {0 , 1 , 2 }, " Indexes of ML scores to be stored. Three indexes max." };
155157 Configurable<std::vector<double >> binsPtD{" binsPtD" , std::vector<double >{o2::analysis::hf_cuts_ds_to_k_k_pi::vecBinsPt}, " pT bin limits for candidate mass plots" };
156158 Configurable<std::vector<double >> binsPtHadron{" binsPtHadron" , std::vector<double >{0.3 , 2 ., 4 ., 8 ., 12 ., 50 .}, " pT bin limits for assoc particle" };
157159 Configurable<std::vector<double >> binsPtEfficiencyD{" binsPtEfficiencyD" , std::vector<double >{o2::analysis::hf_cuts_ds_to_k_k_pi::vecBinsPt}, " pT bin limits for efficiency" };
158160 Configurable<std::vector<double >> efficiencyD{" efficiencyD" , {1 ., 1 ., 1 ., 1 ., 1 ., 1 .}, " efficiency values for Ds meson" };
159161 ConfigurableAxis zPoolBins{" zPoolBins" , {VARIABLE_WIDTH , -10.0 , -2.5 , 2.5 , 10.0 }, " z vertex position pools" };
160162 ConfigurableAxis multPoolBins{" multPoolBins" , {VARIABLE_WIDTH , 0 ., 900 ., 1800 ., 6000 .}, " event multiplicity pools (FT0M)" };
161163 ConfigurableAxis binsMassD{" binsMassD" , {200 , 1.7 , 2.25 }, " inv. mass (K^{#pm}K^{-}#pi^{+}) (GeV/#it{c}^{2})" };
162- ConfigurableAxis binsEta{" binsEta" , {100 , -2 ., 2 .}, " #it{#eta}" };
163- ConfigurableAxis binsPhi{" binsPhi" , {128 , -PIHalf, 3 . * PIHalf}, " #it{#varphi}" };
164+ ConfigurableAxis binsEta{" binsEta" , {50 , -2 ., 2 .}, " #it{#eta}" };
165+ ConfigurableAxis binsPhi{" binsPhi" , {64 , -PIHalf, 3 . * PIHalf}, " #it{#varphi}" };
164166 ConfigurableAxis binsMultiplicity{" binsMultiplicity" , {200 , 0 ., 800 .}, " Multiplicity" };
165167 ConfigurableAxis binsMultFT0M{" binsMultFT0M" , {600 , 0 ., 6000 .}, " Multiplicity as FT0M signal amplitude" };
166168 ConfigurableAxis binsPosZ{" binsPosZ" , {100 , -10 ., 10 .}, " primary vertex z coordinate" };
169+ ConfigurableAxis binsBdtScore{" binsBdtScore" , {100 , 0 ., 1 .}, " Bdt output scores" };
167170 ConfigurableAxis binsPoolBin{" binsPoolBin" , {9 , 0 ., 9 .}, " PoolBin" };
168171
169172 HfHelper hfHelper;
@@ -187,7 +190,7 @@ struct HfCorrelatorDsHadrons {
187190
188191 using SelCollisionsWithDs = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::DmesonSelection>>; // collisionFilter applied
189192 using SelCollisionsWithDsMc = soa::Filtered<soa::Join<aod::McCollisions, aod::DmesonSelection>>; // collisionFilter applied
190- using CandDsData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi>>; // flagDsFilter applied
193+ using CandDsData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi, aod::HfMlDsToKKPi >>; // flagDsFilter applied
191194 using CandDsMcReco = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi, aod::HfCand3ProngMcRec>>; // flagDsFilter applied
192195 using CandDsMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>; // flagDsFilter applied
193196 using MyTracksData = soa::Filtered<soa::Join<aod::TracksWDca, aod::TrackSelection>>; // trackFilter applied
@@ -209,6 +212,7 @@ struct HfCorrelatorDsHadrons {
209212 AxisSpec axisMultiplicity = {binsMultiplicity, " Multiplicity" };
210213 AxisSpec axisMultFT0M = {binsMultFT0M, " MultiplicityFT0M" };
211214 AxisSpec axisPosZ = {binsPosZ, " PosZ" };
215+ AxisSpec axisBdtScore = {binsBdtScore, " Bdt score" };
212216 AxisSpec axisPoolBin = {binsPoolBin, " PoolBin" };
213217 AxisSpec axisStatus = {15 , 0.5 , 15.5 , " Selection status" };
214218
@@ -231,6 +235,7 @@ struct HfCorrelatorDsHadrons {
231235 registry.add (" hCollisionPoolBin" , " Ds candidates collision pool bin" , {HistType::kTH1F , {axisPoolBin}});
232236 registry.add (" hDsPoolBin" , " Ds candidates pool bin" , {HistType::kTH1F , {axisPoolBin}});
233237 registry.add (" hTracksPoolBin" , " Particles associated pool bin" , {HistType::kTH1F , {axisPoolBin}});
238+ registry.add (" hCorrelSystematics" , " Ds-h correlations systematic error evaluation" , {HistType::kTHnSparseD , {{axisPhi}, {axisEta}, {axisPtD}, {axisPtHadron}, {axisMassD}, {axisBdtScore}, {axisBdtScore}}});
234239 // Histograms for MC Reco analysis
235240 registry.add (" hPtCandMcRecSig" , " Ds,Hadron candidates - MC Reco" , {HistType::kTH1F , {axisPtD}});
236241 registry.add (" hPtCandMcRecSigPrompt" , " Ds,Hadron candidates Prompt - MC Reco" , {HistType::kTH1F , {axisPtD}});
@@ -382,6 +387,7 @@ struct HfCorrelatorDsHadrons {
382387 if (candidate.isSelDsToKKPi () >= selectionFlagDs && candidate.isSelDsToPiKK () >= selectionFlagDs) {
383388 registry.fill (HIST (" hCountSelectionStatusDsToKKPiAndToPiKK" ), 0 .);
384389 }
390+ std::vector<float > outputMl = {-1 ., -1 ., -1 .};
385391
386392 // Ds-Hadron correlation dedicated section
387393 for (const auto & track : tracks) {
@@ -392,6 +398,7 @@ struct HfCorrelatorDsHadrons {
392398 if (!track.isGlobalTrackWoDCA ()) {
393399 continue ;
394400 }
401+
395402 registry.fill (HIST (" hEtaVsPtPartAssoc" ), track.eta (), candidate.pt ());
396403 registry.fill (HIST (" hPhiVsPtPartAssoc" ), RecoDecay::constrainAngle (track.phi (), -PIHalf), candidate.pt ());
397404 if (candidate.isSelDsToKKPi () >= selectionFlagDs) {
@@ -402,6 +409,12 @@ struct HfCorrelatorDsHadrons {
402409 poolBin);
403410 entryDsHadronRecoInfo (hfHelper.invMassDsToKKPi (candidate), false );
404411 entryDsHadronGenInfo (false , false );
412+ if (fillSystematics) {
413+ for (unsigned int iclass = 0 ; iclass < classMl->size (); iclass++) {
414+ outputMl[iclass] = candidate.mlProbDsToKKPi ()[classMl->at (iclass)];
415+ }
416+ registry.fill (HIST (" hCorrelSystematics" ), getDeltaPhi (track.phi (), candidate.phi ()), track.eta () - candidate.eta (), candidate.pt (), track.pt (), hfHelper.invMassDsToKKPi (candidate), outputMl[0 ], outputMl[2 ]);
417+ }
405418 } else if (candidate.isSelDsToPiKK () >= selectionFlagDs) {
406419 entryDsHadronPair (getDeltaPhi (track.phi (), candidate.phi ()),
407420 track.eta () - candidate.eta (),
@@ -410,6 +423,12 @@ struct HfCorrelatorDsHadrons {
410423 poolBin);
411424 entryDsHadronRecoInfo (hfHelper.invMassDsToPiKK (candidate), false );
412425 entryDsHadronGenInfo (false , false );
426+ if (fillSystematics) {
427+ for (unsigned int iclass = 0 ; iclass < classMl->size (); iclass++) {
428+ outputMl[iclass] = candidate.mlProbDsToPiKK ()[classMl->at (iclass)];
429+ }
430+ registry.fill (HIST (" hCorrelSystematics" ), getDeltaPhi (track.phi (), candidate.phi ()), track.eta () - candidate.eta (), candidate.pt (), track.pt (), hfHelper.invMassDsToPiKK (candidate), outputMl[0 ], outputMl[2 ]);
431+ }
413432 }
414433 } // end track loop
415434 } // end candidate loop
0 commit comments