@@ -73,6 +73,10 @@ struct HfCandidateSelectorXicToPKPi {
7373 Configurable<std::vector<std::string>> onnxFileNames{" onnxFileNames" , std::vector<std::string>{" ModelHandler_onnx_XicToPKPi.onnx" }, " ONNX file names for each pT bin (if not from CCDB full path)" };
7474 Configurable<int64_t > timestampCCDB{" timestampCCDB" , -1 , " timestamp of the ONNX file for ML model used to query in CCDB" };
7575 Configurable<bool > loadModelsFromCCDB{" loadModelsFromCCDB" , false , " Flag to enable or disable the loading of models from CCDB" };
76+ // QA switch
77+ Configurable<bool > activateQA{" activateQA" , true , " Flag to enable QA histogram" };
78+
79+ HistogramRegistry registry{" registry" };
7680
7781 o2::analysis::HfMlResponseXicToPKPi<float > hfMlResponse;
7882 std::vector<float > outputMlXicToPKPi = {};
@@ -96,6 +100,21 @@ struct HfCandidateSelectorXicToPKPi {
96100 selectorKaon = selectorPion;
97101 selectorProton = selectorPion;
98102
103+ if (activateQA) {
104+ constexpr int kNBinsSelections = 1 + aod::SelectionStep::NSelectionSteps;
105+ std::string labels[kNBinsSelections ];
106+ labels[0 ] = " No selection" ;
107+ labels[1 + aod::SelectionStep::RecoSkims] = " Skims selection" ;
108+ labels[1 + aod::SelectionStep::RecoTopol] = " Skims & Topological selections" ;
109+ labels[1 + aod::SelectionStep::RecoPID] = " Skims & Topological & PID selections" ;
110+ labels[1 + aod::SelectionStep::RecoMl] = " ML selection" ;
111+ static const AxisSpec axisSelections = {kNBinsSelections , 0.5 , kNBinsSelections + 0.5 , " " };
112+ registry.add (" hSelections" , " Selections;;#it{p}_{T} (GeV/#it{c})" , {HistType::kTH2F , {axisSelections, {(std::vector<double >)binsPt, " #it{p}_{T} (GeV/#it{c})" }}});
113+ for (int iBin = 0 ; iBin < kNBinsSelections ; ++iBin) {
114+ registry.get <TH2>(HIST (" hSelections" ))->GetXaxis ()->SetBinLabel (iBin + 1 , labels[iBin].data ());
115+ }
116+ }
117+
99118 if (applyMl) {
100119 hfMlResponse.configure (binsPtMl, cutsMl, cutDirMl, nClassesMl);
101120 if (loadModelsFromCCDB) {
@@ -216,18 +235,24 @@ struct HfCandidateSelectorXicToPKPi {
216235 outputMlXicToPKPi.clear ();
217236 outputMlXicToPiKP.clear ();
218237
238+ auto ptCand = candidate.pt ();
239+
219240 if (!TESTBIT (candidate.hfflag (), aod::hf_cand_3prong::DecayType::XicToPKPi)) {
220241 hfSelXicToPKPiCandidate (statusXicToPKPi, statusXicToPiKP);
221242 if (applyMl) {
222243 hfMlXicToPKPiCandidate (outputMlXicToPKPi, outputMlXicToPiKP);
223244 }
245+ if (activateQA) {
246+ registry.fill (HIST (" hSelections" ), 1 , ptCand);
247+ }
224248 continue ;
225249 }
250+ if (activateQA) {
251+ registry.fill (HIST (" hSelections" ), 2 + aod::SelectionStep::RecoSkims, ptCand);
252+ }
226253 SETBIT (statusXicToPKPi, aod::SelectionStep::RecoSkims);
227254 SETBIT (statusXicToPiKP, aod::SelectionStep::RecoSkims);
228255
229- auto ptCand = candidate.pt ();
230-
231256 auto trackPos1 = candidate.prong0_as <TracksSel>(); // positive daughter (negative for the antiparticles)
232257 auto trackNeg = candidate.prong1_as <TracksSel>(); // negative daughter (positive for the antiparticles)
233258 auto trackPos2 = candidate.prong2_as <TracksSel>(); // positive daughter (negative for the antiparticles)
@@ -262,6 +287,10 @@ struct HfCandidateSelectorXicToPKPi {
262287 SETBIT (statusXicToPiKP, aod::SelectionStep::RecoTopol);
263288 }
264289
290+ if (activateQA) {
291+ registry.fill (HIST (" hSelections" ), 2 + aod::SelectionStep::RecoTopol, candidate.pt ());
292+ }
293+
265294 auto pidXicToPKPi = -1 ;
266295 auto pidXicToPiKP = -1 ;
267296
@@ -277,6 +306,7 @@ struct HfCandidateSelectorXicToPKPi {
277306 TrackSelectorPID::Status pidTrackPos2Pion = TrackSelectorPID::Accepted;
278307 TrackSelectorPID::Status pidTrackNegKaon = TrackSelectorPID::Accepted;
279308 if (usePidTpcAndTof) {
309+
280310 pidTrackPos1Proton = selectorProton.statusTpcAndTof (trackPos1);
281311 pidTrackPos2Proton = selectorProton.statusTpcAndTof (trackPos2);
282312 pidTrackPos1Pion = selectorPion.statusTpcAndTof (trackPos1);
@@ -324,6 +354,9 @@ struct HfCandidateSelectorXicToPKPi {
324354 if ((pidXicToPiKP == -1 || pidXicToPiKP == 1 ) && topolXicToPiKP) {
325355 SETBIT (statusXicToPiKP, aod::SelectionStep::RecoPID);
326356 }
357+ if (activateQA) {
358+ registry.fill (HIST (" hSelections" ), 2 + aod::SelectionStep::RecoPID, candidate.pt ());
359+ }
327360
328361 if (applyMl) {
329362 // ML selections
@@ -350,7 +383,10 @@ struct HfCandidateSelectorXicToPKPi {
350383 SETBIT (statusXicToPKPi, aod::SelectionStep::RecoMl);
351384 }
352385 if (isSelectedMlXicToPiKP) {
353- SETBIT (statusXicToPKPi, aod::SelectionStep::RecoMl);
386+ SETBIT (statusXicToPiKP, aod::SelectionStep::RecoMl);
387+ }
388+ if (activateQA) {
389+ registry.fill (HIST (" hSelections" ), 2 + aod::SelectionStep::RecoMl, candidate.pt ());
354390 }
355391 }
356392
0 commit comments