@@ -66,7 +66,6 @@ using namespace o2::framework::expressions;
6666
6767using multiCharmTracksPID = soa::Join<aod::MCharmCores, aod::MCharmPID>;
6868using multiCharmTracksFull = soa::Join<aod::MCharmCores, aod::MCharmPID, aod::MCharmExtra>;
69- #define getHist (type, name ) std::get<std::shared_ptr<type>>(histPointers[name])
7069
7170struct alice3multicharm {
7271 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
@@ -90,7 +89,6 @@ struct alice3multicharm {
9089 Configurable<bool > loadModelsFromCCDB{" loadModelsFromCCDB" , false , " Flag to enable or disable the loading of models from CCDB" };
9190 Configurable<bool > enableOptimizations{" enableOptimizations" , false , " Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)" };
9291 Configurable<bool > enableML{" enableML" , false , " Enables bdt model" };
93- Configurable<std::vector<float >> requiredScores{" requiredScores" , {0.5 , 0.75 , 0.85 , 0.9 , 0.95 , 0.99 }, " Vector of different scores to try" };
9492 } bdt;
9593
9694 ConfigurableAxis axisEta{" axisEta" , {80 , -4 .0f , +4 .0f }, " #eta" };
@@ -132,6 +130,8 @@ struct alice3multicharm {
132130 Configurable<float > xiccMinRadius{" xiccMinRadius" , -1 , " Minimum R2D for Xicc decay (cm)" };
133131 Configurable<float > xiccMinProperLength{" xiccMinProperLength" , -1 , " Minimum proper length for Xicc decay (cm)" };
134132 Configurable<float > xiccMaxProperLength{" xiccMaxProperLength" , 1e+4 , " Minimum proper length for Xicc decay (cm)" };
133+ Configurable<int > otfConfig{" otfConfig" , 0 , " OTF configuration flag" };
134+ Filter configFilter = (aod::otfmulticharm::lutConfigId == otfConfig);
135135
136136 void init (InitContext&)
137137 {
@@ -234,6 +234,7 @@ struct alice3multicharm {
234234 histos.add (" hXiccPt" , " hXiccPt" , kTH1D , {axisPt});
235235 histos.add (" hXicPt" , " hXicPt" , kTH1D , {axisPt});
236236 histos.add (" h3dXicc" , " h3dXicc; Xicc pT (GeV/#it(c)); Xicc #eta; Xicc mass (GeV/#it(c)^{2})" , kTH3D , {axisPt, axisEta, axisXiccMass});
237+ histos.add (" hConfigId" , " hConfigId" , kTH1D , {{11 , -0.5 , 10.5 }});
237238
238239 if (bdt.enableML ) {
239240 ccdb->setURL (bdt.ccdbUrl .value );
@@ -255,51 +256,33 @@ struct alice3multicharm {
255256 histos.add (" hBDTScoreVsXiccMass" , " hBDTScoreVsXiccMass" , kTH2D , {axisXiccMass, axisBDTScore});
256257 histos.add (" hBDTScoreVsXiccPt" , " hBDTScoreVsXiccPt" , kTH2D , {axisPt, axisBDTScore});
257258 histos.add (" h3dBDTScore" , " h3dBDTScore" , kTH3D , {axisPt, axisXiccMass, axisBDTScore});
258- for (const auto & score : bdt.requiredScores .value ) {
259- histPath = std::format (" MLQA/RequiredBDTScore_{}/" , static_cast <int >(score * 10000 ));
260- histPointers.insert ({histPath + " hDCAXicDaughters" , histos.add ((histPath + " hDCAXicDaughters" ).c_str (), " hDCAXicDaughters" , {kTH1D , {{axisDcaDaughters}}})});
261- histPointers.insert ({histPath + " hDCAXiccDaughters" , histos.add ((histPath + " hDCAXiccDaughters" ).c_str (), " hDCAXiccDaughters" , {kTH1D , {{axisDcaDaughters}}})});
262- histPointers.insert ({histPath + " hDCAxyXi" , histos.add ((histPath + " hDCAxyXi" ).c_str (), " hDCAxyXi" , {kTH1D , {{axisDCA}}})});
263- histPointers.insert ({histPath + " hDCAzXi" , histos.add ((histPath + " hDCAzXi" ).c_str (), " hDCAzXi" , {kTH1D , {{axisDCA}}})});
264- histPointers.insert ({histPath + " hDCAxyXic" , histos.add ((histPath + " hDCAxyXic" ).c_str (), " hDCAxyXic" , {kTH1D , {{axisDCA}}})});
265- histPointers.insert ({histPath + " hDCAzXic" , histos.add ((histPath + " hDCAzXic" ).c_str (), " hDCAzXic" , {kTH1D , {{axisDCA}}})});
266- histPointers.insert ({histPath + " hDCAxyXicc" , histos.add ((histPath + " hDCAxyXicc" ).c_str (), " hDCAxyXicc" , {kTH1D , {{axisDCA}}})});
267- histPointers.insert ({histPath + " hDCAzXicc" , histos.add ((histPath + " hDCAzXicc" ).c_str (), " hDCAzXicc" , {kTH1D , {{axisDCA}}})});
268- histPointers.insert ({histPath + " hDecayRadiusXic" , histos.add ((histPath + " hDecayRadiusXic" ).c_str (), " hDecayRadiusXic" , {kTH1D , {{axisRadius}}})});
269- histPointers.insert ({histPath + " hDecayRadiusXicc" , histos.add ((histPath + " hDecayRadiusXicc" ).c_str (), " hDecayRadiusXicc" , {kTH1D , {{axisRadius}}})});
270- histPointers.insert ({histPath + " hDecayDistanceFromPVXic" , histos.add ((histPath + " hDecayDistanceFromPVXic" ).c_str (), " hDecayDistanceFromPVXic" , {kTH1D , {{axisDecayLength}}})});
271- histPointers.insert ({histPath + " hProperLengthXic" , histos.add ((histPath + " hProperLengthXic" ).c_str (), " hProperLengthXic" , {kTH1D , {{axisDecayLength}}})});
272- histPointers.insert ({histPath + " hProperLengthXicc" , histos.add ((histPath + " hProperLengthXicc" ).c_str (), " hProperLengthXicc" , {kTH1D , {{axisDecayLength}}})});
273- histPointers.insert ({histPath + " hPi1cDCAxy" , histos.add ((histPath + " hPi1cDCAxy" ).c_str (), " hPi1cDCAxy" , {kTH1D , {{axisDCA}}})});
274- histPointers.insert ({histPath + " hPi1cDCAz" , histos.add ((histPath + " hPi1cDCAz" ).c_str (), " hPi1cDCAxy" , {kTH1D , {{axisDCA}}})});
275- histPointers.insert ({histPath + " hPi2cDCAxy" , histos.add ((histPath + " hPi2cDCAxy" ).c_str (), " hPi2cDCAxy" , {kTH1D , {{axisDCA}}})});
276- histPointers.insert ({histPath + " hPi2cDCAz" , histos.add ((histPath + " hPi2cDCAz" ).c_str (), " hPi2cDCAz" , {kTH1D , {{axisDCA}}})});
277- histPointers.insert ({histPath + " hPiccDCAxy" , histos.add ((histPath + " hPiccDCAxy" ).c_str (), " hPiccDCAxy" , {kTH1D , {{axisDCA}}})});
278- histPointers.insert ({histPath + " hPiccDCAz" , histos.add ((histPath + " hPiccDCAz" ).c_str (), " hPiccDCAz" , {kTH1D , {{axisDCA}}})});
279- histPointers.insert ({histPath + " hPi1cPt" , histos.add ((histPath + " hPi1cPt" ).c_str (), " hPi1cPt" , {kTH1D , {{axisPt}}})});
280- histPointers.insert ({histPath + " hPi2cPt" , histos.add ((histPath + " hPi2cPt" ).c_str (), " hPi2cPt" , {kTH1D , {{axisPt}}})});
281- histPointers.insert ({histPath + " hPiccPt" , histos.add ((histPath + " hPiccPt" ).c_str (), " hPiccPt" , {kTH1D , {{axisPt}}})});
282- histPointers.insert ({histPath + " h3dXicc" , histos.add ((histPath + " h3dXicc" ).c_str (), " h3dXicc" , {kTH3D , {{axisPt, axisEta, axisXiccMass}}})});
283- histPointers.insert ({histPath + " hXiccMass" , histos.add ((histPath + " hXiccMass" ).c_str (), " hXiccMass" , {kTH1D , {{axisXiccMass}}})});
284- histPointers.insert ({histPath + " hXicMass" , histos.add ((histPath + " hXicMass" ).c_str (), " hXicMass" , {kTH1D , {{axisXicMass}}})});
285- histPointers.insert ({histPath + " hXiccPt" , histos.add ((histPath + " hXiccPt" ).c_str (), " hXiccPt" , {kTH1D , {{axisPt}}})});
286- histPointers.insert ({histPath + " hXicPt" , histos.add ((histPath + " hXicPt" ).c_str (), " hXicPt" , {kTH1D , {{axisPt}}})});
287- }
288- }
289- }
290-
291- void initConf (int icfg)
292- {
293- const bool confExists = std::find (savedConfigs.begin (), savedConfigs.end (), icfg) != savedConfigs.end ();
294- if (confExists) {
295- return ;
259+ histos.add (" hDCAXicDaughters" , " hDCAXicDaughters" , kTH2D , {{axisBDTScore, axisDcaDaughters}});
260+ histos.add (" hDCAXiccDaughters" , " hDCAXiccDaughters" , kTH2D , {{axisBDTScore, axisDcaDaughters}});
261+ histos.add (" hDCAxyXi" , " hDCAxyXi" , kTH2D , {{axisBDTScore, axisDCA}});
262+ histos.add (" hDCAzXi" , " hDCAzXi" , kTH2D , {{axisBDTScore, axisDCA}});
263+ histos.add (" hDCAxyXic" , " hDCAxyXic" , kTH2D , {{axisBDTScore, axisDCA}});
264+ histos.add (" hDCAzXic" , " hDCAzXic" , kTH2D , {{axisBDTScore, axisDCA}});
265+ histos.add (" hDCAxyXicc" , " hDCAxyXicc" , kTH2D , {{axisBDTScore, axisDCA}});
266+ histos.add (" hDCAzXicc" , " hDCAzXicc" , kTH2D , {{axisBDTScore, axisDCA}});
267+ histos.add (" hDecayRadiusXic" , " hDecayRadiusXic" , kTH2D , {{axisBDTScore, axisRadius}});
268+ histos.add (" hDecayRadiusXicc" , " hDecayRadiusXicc" , kTH2D , {{axisBDTScore, axisRadius}});
269+ histos.add (" hDecayDistanceFromPVXic" , " hDecayDistanceFromPVXic" , kTH2D , {{axisBDTScore, axisDecayLength}});
270+ histos.add (" hProperLengthXic" , " hProperLengthXic" , kTH2D , {{axisBDTScore, axisDecayLength}});
271+ histos.add (" hProperLengthXicc" , " hProperLengthXicc" , kTH2D , {{axisBDTScore, axisDecayLength}});
272+ histos.add (" hPi1cDCAxy" , " hPi1cDCAxy" , kTH2D , {{axisBDTScore, axisDCA}});
273+ histos.add (" hPi1cDCAz" , " hPi1cDCAz" , kTH2D , {{axisBDTScore, axisDCA}});
274+ histos.add (" hPi2cDCAxy" , " hPi2cDCAxy" , kTH2D , {{axisBDTScore, axisDCA}});
275+ histos.add (" hPi2cDCAz" , " hPi2cDCAz" , kTH2D , {{axisBDTScore, axisDCA}});
276+ histos.add (" hPiccDCAxy" , " hPiccDCAxy" , kTH2D , {{axisBDTScore, axisDCA}});
277+ histos.add (" hPiccDCAz" , " hPiccDCAz" , kTH2D , {{axisBDTScore, axisDCA}});
278+ histos.add (" hPi1cPt" , " hPi1cPt" , kTH2D , {{axisBDTScore, axisPt}});
279+ histos.add (" hPi2cPt" , " hPi2cPt" , kTH2D , {{axisBDTScore, axisPt}});
280+ histos.add (" hPiccPt" , " hPiccPt" , kTH2D , {{axisBDTScore, axisPt}});
281+ histos.add (" hXiccMass" , " hXiccMass" , kTH2D , {{axisBDTScore, axisXiccMass}});
282+ histos.add (" hXicMass" , " hXicMass" , kTH2D , {{axisBDTScore, axisXicMass}});
283+ histos.add (" hXiccPt" , " hXiccPt" , kTH2D , {{axisBDTScore, axisPt}});
284+ histos.add (" hXicPt" , " hXicPt" , kTH2D , {{axisBDTScore, axisPt}});
296285 }
297- savedConfigs.push_back (icfg);
298-
299- // do more plots
300- histPath = " Configuration_" + std::to_string (icfg) + " /" ;
301- histPointers.insert ({histPath + " hXiccMass" , histos.add ((histPath + " hXiccMass" ).c_str (), " hXiccMass" , {kTH1D , {{axisXiccMass}}})});
302- histPointers.insert ({histPath + " h3dXicc" , histos.add ((histPath + " h3dXicc" ).c_str (), " h3dXicc" , {kTH3D , {{axisPt, axisEta, axisXiccMass}}})});
303286 }
304287
305288 int getBin (const std::map<int , int >& pdgToBin, int pdg)
@@ -313,8 +296,7 @@ struct alice3multicharm {
313296 {
314297 for (const auto & xiccCand : xiccCands) {
315298 int icfg = xiccCand.lutConfigId ();
316- initConf (icfg);
317-
299+ histos.fill (HIST (" hConfigId" ), icfg);
318300 if (bdt.enableML ) {
319301 std::vector<float > inputFeatures{
320302 xiccCand.xicDauDCA (),
@@ -344,39 +326,33 @@ struct alice3multicharm {
344326 histos.fill (HIST (" hBDTScoreVsXiccMass" ), xiccCand.xiccMass (), bdtScore);
345327 histos.fill (HIST (" hBDTScoreVsXiccPt" ), xiccCand.xiccPt (), bdtScore);
346328 histos.fill (HIST (" h3dBDTScore" ), xiccCand.xiccPt (), xiccCand.xiccMass (), bdtScore);
347-
348- for (const auto & requiredScore : bdt.requiredScores .value ) {
349- if (bdtScore > requiredScore) {
350- histPath = std::format (" MLQA/RequiredBDTScore_{}/" , static_cast <int >(requiredScore * 10000 ));
351- getHist (TH1, histPath + " hDCAXicDaughters" )->Fill (xiccCand.xicDauDCA () * 1e+4 );
352- getHist (TH1, histPath + " hDCAXiccDaughters" )->Fill (xiccCand.xiccDauDCA () * 1e+4 );
353- getHist (TH1, histPath + " hDCAxyXi" )->Fill (std::fabs (xiccCand.xiDCAxy () * 1e+4 ));
354- getHist (TH1, histPath + " hDCAzXi" )->Fill (std::fabs (xiccCand.xiDCAz () * 1e+4 ));
355- getHist (TH1, histPath + " hDCAxyXic" )->Fill (std::fabs (xiccCand.xicDCAxy () * 1e+4 ));
356- getHist (TH1, histPath + " hDCAzXic" )->Fill (std::fabs (xiccCand.xicDCAz () * 1e+4 ));
357- getHist (TH1, histPath + " hDCAxyXicc" )->Fill (std::fabs (xiccCand.xiccDCAxy () * 1e+4 ));
358- getHist (TH1, histPath + " hDCAzXicc" )->Fill (std::fabs (xiccCand.xiccDCAz () * 1e+4 ));
359- getHist (TH1, histPath + " hDecayRadiusXic" )->Fill (xiccCand.xicDecayRadius2D () * 1e+4 );
360- getHist (TH1, histPath + " hDecayRadiusXicc" )->Fill (xiccCand.xiccDecayRadius2D () * 1e+4 );
361- getHist (TH1, histPath + " hDecayDistanceFromPVXic" )->Fill (xiccCand.xicDistanceFromPV () * 1e+4 );
362- getHist (TH1, histPath + " hProperLengthXic" )->Fill (xiccCand.xicProperLength () * 1e+4 );
363- getHist (TH1, histPath + " hProperLengthXicc" )->Fill (xiccCand.xiccProperLength () * 1e+4 );
364- getHist (TH1, histPath + " hPi1cDCAxy" )->Fill (xiccCand.pi1cDCAxy () * 1e+4 );
365- getHist (TH1, histPath + " hPi1cDCAz" )->Fill (xiccCand.pi1cDCAz () * 1e+4 );
366- getHist (TH1, histPath + " hPi2cDCAxy" )->Fill (xiccCand.pi2cDCAxy () * 1e+4 );
367- getHist (TH1, histPath + " hPi2cDCAz" )->Fill (xiccCand.pi2cDCAz () * 1e+4 );
368- getHist (TH1, histPath + " hPiccDCAxy" )->Fill (xiccCand.piccDCAxy () * 1e+4 );
369- getHist (TH1, histPath + " hPiccDCAz" )->Fill (xiccCand.piccDCAz () * 1e+4 );
370- getHist (TH1, histPath + " hPi1cPt" )->Fill (xiccCand.pi1cPt ());
371- getHist (TH1, histPath + " hPi2cPt" )->Fill (xiccCand.pi2cPt ());
372- getHist (TH1, histPath + " hPiccPt" )->Fill (xiccCand.piccPt ());
373- getHist (TH1, histPath + " hXiccMass" )->Fill (xiccCand.xiccMass ());
374- getHist (TH1, histPath + " hXicMass" )->Fill (xiccCand.xicMass ());
375- getHist (TH1, histPath + " hXicPt" )->Fill (xiccCand.xicPt ());
376- getHist (TH1, histPath + " hXiccPt" )->Fill (xiccCand.xiccPt ());
377- getHist (TH3, histPath + " h3dXicc" )->Fill (xiccCand.xiccPt (), xiccCand.xiccEta (), xiccCand.xiccMass ());
378- }
379- }
329+ histos.fill (HIST (" hDCAXicDaughters" ), xiccCand.xiccPt (), bdtScore);
330+ histos.fill (HIST (" hDCAXiccDaughters" ), xiccCand.xiccPt (), bdtScore);
331+ histos.fill (HIST (" hDCAxyXi" ), xiccCand.xiccPt (), bdtScore);
332+ histos.fill (HIST (" hDCAzXi" ), xiccCand.xiccPt (), bdtScore);
333+ histos.fill (HIST (" hDCAxyXic" ), xiccCand.xiccPt (), bdtScore);
334+ histos.fill (HIST (" hDCAzXic" ), xiccCand.xiccPt (), bdtScore);
335+ histos.fill (HIST (" hDCAxyXicc" ), xiccCand.xiccPt (), bdtScore);
336+ histos.fill (HIST (" hDCAzXicc" ), xiccCand.xiccPt (), bdtScore);
337+ histos.fill (HIST (" hDecayRadiusXic" ), xiccCand.xiccPt (), bdtScore);
338+ histos.fill (HIST (" hDecayRadiusXicc" ), xiccCand.xiccPt (), bdtScore);
339+ histos.fill (HIST (" hDecayDistanceFromPVXic" ), xiccCand.xiccPt (), bdtScore);
340+ histos.fill (HIST (" hProperLengthXic" ), xiccCand.xiccPt (), bdtScore);
341+ histos.fill (HIST (" hProperLengthXicc" ), xiccCand.xiccPt (), bdtScore);
342+ histos.fill (HIST (" hPi1cDCAxy" ), xiccCand.xiccPt (), bdtScore);
343+ histos.fill (HIST (" hPi1cDCAz" ), xiccCand.xiccPt (), bdtScore);
344+ histos.fill (HIST (" hPi2cDCAxy" ), xiccCand.xiccPt (), bdtScore);
345+ histos.fill (HIST (" hPi2cDCAz" ), xiccCand.xiccPt (), bdtScore);
346+ histos.fill (HIST (" hPiccDCAxy" ), xiccCand.xiccPt (), bdtScore);
347+ histos.fill (HIST (" hPiccDCAz" ), xiccCand.xiccPt (), bdtScore);
348+ histos.fill (HIST (" hPi1cPt" ), xiccCand.xiccPt (), bdtScore);
349+ histos.fill (HIST (" hPi2cPt" ), xiccCand.xiccPt (), bdtScore);
350+ histos.fill (HIST (" hPiccPt" ), xiccCand.xiccPt (), bdtScore);
351+ histos.fill (HIST (" hXiccMass" ), xiccCand.xiccPt (), bdtScore);
352+ histos.fill (HIST (" hXicMass" ), xiccCand.xiccPt (), bdtScore);
353+ histos.fill (HIST (" hXicPt" ), xiccCand.xiccPt (), bdtScore);
354+ histos.fill (HIST (" hXiccPt" ), xiccCand.xiccPt (), bdtScore);
355+ histos.fill (HIST (" h3dXicc" ), xiccCand.xiccPt (), bdtScore);
380356 }
381357
382358 histos.fill (HIST (" hMCharmBuilding" ), 0 );
@@ -506,10 +482,6 @@ struct alice3multicharm {
506482 histos.fill (HIST (" hMCharmBuilding" ), 21 );
507483 }
508484
509- histPath = " Configuration_" + std::to_string (icfg) + " /" ;
510- getHist (TH1, histPath + " hXiccMass" )->Fill (xiccCand.xiccMass ());
511- getHist (TH3, histPath + " h3dXicc" )->Fill (xiccCand.xiccPt (), xiccCand.xiccEta (), xiccCand.xiccMass ());
512-
513485 histos.fill (HIST (" SelectionQA/hDCAXicDaughters" ), xiccCand.xicDauDCA () * 1e+4 );
514486 histos.fill (HIST (" SelectionQA/hDCAXiccDaughters" ), xiccCand.xiccDauDCA () * 1e+4 );
515487 histos.fill (HIST (" SelectionQA/hDCAxyXi" ), std::fabs (xiccCand.xiDCAxy () * 1e+4 ));
@@ -578,17 +550,17 @@ struct alice3multicharm {
578550 }
579551 }
580552
581- void processXicc (aod::MCharmCores const & multiCharmTracks)
553+ void processXicc (soa::Filtered< aod::MCharmCores> const & multiCharmTracks)
582554 {
583555 genericProcessXicc (multiCharmTracks);
584556 }
585557
586- void processXiccPID (multiCharmTracksPID const & multiCharmTracks)
558+ void processXiccPID (soa::Filtered< multiCharmTracksPID> const & multiCharmTracks)
587559 {
588560 genericProcessXicc (multiCharmTracks);
589561 }
590562
591- void processXiccExtra (multiCharmTracksFull const & multiCharmTracks)
563+ void processXiccExtra (soa::Filtered< multiCharmTracksFull> const & multiCharmTracks)
592564 {
593565 genericProcessXicc (multiCharmTracks);
594566 }
0 commit comments