@@ -81,6 +81,8 @@ struct HfTaskXic {
8181 ConfigurableAxis thnConfigAxisBdtScoreBkg{" thnConfigAxisBdtScoreBkg" , {100 , 0 ., 1 .}, " " };
8282 ConfigurableAxis thnConfigAxisBdtScoreSignal{" thnConfigAxisBdtScoreSignal" , {100 , 0 ., 1 .}, " " };
8383 ConfigurableAxis thnConfigAxisYMC{" thnConfigAxisYMC" , {100 , -2 ., 2 .}, " " };
84+ ConfigurableAxis thnConfigAxisMseXic{" thnConfigAxisMseXic" , {502 , -0.0002 , 1 }, " " }; // MSE axis
85+ ConfigurableAxis thnConfigAxisAeOutputXic{" thnConfigAxisAeOutputXic" , {20 , 0.8 , 1 }," " }; // an AE output axis
8486 //
8587
8688 float etaMaxAcceptance = 0.8 ;
@@ -248,9 +250,12 @@ struct HfTaskXic {
248250 const AxisSpec thnAxisBdtScoreXicNonPrompt{thnConfigAxisBdtScoreSignal, " BDT non-prompt score (Xic)" };
249251 const AxisSpec thnAxisMcOrigin{3 , -0.5 , 2.5 , " MC origin" };
250252 const AxisSpec thnAxisMCAllProngAccepted{2 , -0.5 , 1.5 , " All MC prongs accepted" };
253+ const AxisSpec thnAxisMseXic{thnConfigAxisMseXic, " MSE (Xic)" };
254+ const AxisSpec thnAxisAeOutputXic{thnConfigAxisAeOutputXic, " AE Output (Xic)" };
251255
252256 if (doprocessDataWithMl || doprocessMcWithMl) { // with ML
253257 registry.add (" hnXicVarsWithBdt" , " THn for Xic candidates with BDT scores" , HistType::kTHnSparseF , {thnAxisMass, thnAxisPt, thnAxisBdtScoreXicBkg, thnAxisBdtScoreXicPrompt, thnAxisBdtScoreXicNonPrompt, thnAxisMcOrigin});
258+ registry.add (" hnXicVarsWithMse" , " THn for Xic candidates with MSE using AD" , HistType::kTHnSparseF , {thnAxisMass, thnAxisPt, thnAxisDecLength, thnAxisCPA, thnAxisAeOutputXic, thnAxisMcOrigin, thnAxisMseXic});
254259 } else {
255260 registry.add (" hnXicVars" , " THn for Xic candidates" , HistType::kTHnSparseF , {thnAxisMass, thnAxisPt, thnAxisChi2PCA, thnAxisDecLength, thnAxisDecLengthXY, thnAxisCPA, thnAxisMcOrigin});
256261 }
@@ -366,7 +371,7 @@ struct HfTaskXic {
366371 // THnSparse
367372 if (enableTHn) {
368373 double massXic (-1 );
369- double outputBkg (-1 ), outputPrompt (-1 ), outputFD (-1 );
374+ double outputBkg (-1 ), outputPrompt (-1 ), outputFD (-1 ), outputMSE (- 1 ), outputAE (- 1 ) ;
370375 const int ternaryCl = 3 ;
371376 if (candidate.isSelXicToPKPi () >= selectionFlagXic) {
372377 massXic = hfHelper.invMassXicToPKPi (candidate);
@@ -375,9 +380,14 @@ struct HfTaskXic {
375380 outputBkg = candidate.mlProbXicToPKPi ()[0 ]; // / bkg score
376381 outputPrompt = candidate.mlProbXicToPKPi ()[1 ]; // / prompt score
377382 outputFD = candidate.mlProbXicToPKPi ()[2 ]; // / non-prompt score
378- }
379- // / Fill the ML outputScores and variables of candidate Xic
380- registry.get <THnSparse>(HIST (" hnXicVarsWithBdt" ))->Fill (massXic, ptCandidate, outputBkg, outputPrompt, outputFD, false );
383+ // / Fill the ML outputScores and variables of candidate Xic
384+ registry.get <THnSparse>(HIST (" hnXicVarsWithBdt" ))->Fill (massXic, ptCandidate, outputBkg, outputPrompt, outputFD, false );
385+ } else {
386+ outputAE = candidate.aeOutputXicToPKPi ()[0 ]; // / AE output of feature 0
387+ outputMSE = candidate.mseXicToPKPi ()[0 ]; // / MSE
388+ LOG (debug)<<" Global mse in taskXic for PKPi Data " <<outputMSE;
389+ registry.get <THnSparse>(HIST (" hnXicVarsWithMse" ))->Fill (massXic, ptCandidate, candidate.decayLength (), candidate.cpa (), outputAE, 0 , 0.0 , 0.0 , false , outputMSE);
390+ }
381391 } else {
382392 registry.get <THnSparse>(HIST (" hnXicVars" ))->Fill (massXic, ptCandidate, candidate.chi2PCA (), candidate.decayLength (), candidate.decayLengthXY (), candidate.cpa (), false );
383393 }
@@ -389,9 +399,14 @@ struct HfTaskXic {
389399 outputBkg = candidate.mlProbXicToPiKP ()[0 ]; // / bkg score
390400 outputPrompt = candidate.mlProbXicToPiKP ()[1 ]; // / prompt score
391401 outputFD = candidate.mlProbXicToPiKP ()[2 ]; // / non-prompt score
392- }
393- // / Fill the ML outputScores and variables of candidate
394- registry.get <THnSparse>(HIST (" hnXicVarsWithBdt" ))->Fill (massXic, ptCandidate, outputBkg, outputPrompt, outputFD, false );
402+ // / Fill the ML outputScores and variables of candidate
403+ registry.get <THnSparse>(HIST (" hnXicVarsWithBdt" ))->Fill (massXic, ptCandidate, outputBkg, outputPrompt, outputFD, false );
404+ } else {
405+ outputAE = candidate.aeOutputXicToPiKP ()[0 ]; // / AE output of feature 0
406+ outputMSE = candidate.mseXicToPiKP ()[0 ]; // / MSE
407+ LOG (debug)<<" Global mse in taskXic for PiKP Data " <<outputMSE;
408+ registry.get <THnSparse>(HIST (" hnXicVarsWithMse" ))->Fill (massXic, ptCandidate, candidate.decayLength (), candidate.cpa (), outputAE, false , outputMSE);
409+ }
395410 } else {
396411 registry.get <THnSparse>(HIST (" hnXicVars" ))->Fill (massXic, ptCandidate, candidate.chi2PCA (), candidate.decayLength (), candidate.decayLengthXY (), candidate.cpa (), false );
397412 }
@@ -409,7 +424,7 @@ struct HfTaskXic {
409424 PROCESS_SWITCH (HfTaskXic, processDataStd, " Process Data with the standard method" , true );
410425
411426 void processDataWithMl (aod::Collision const & collision,
412- soa::Filtered<soa::Join<aod::HfCand3ProngWPidPiKaPr, aod::HfSelXicToPKPi, aod::HfMlXicToPKPi>> const & candidatesMl, aod::TracksWDca const & tracks)
427+ soa::Filtered<soa::Join<aod::HfCand3ProngWPidPiKaPr, aod::HfSelXicToPKPi, aod::HfMlXicToPKPi, aod::HfMseXicToPKPi, aod::HfAeOutXicToPKPi >> const & candidatesMl, aod::TracksWDca const & tracks)
413428 {
414429 analysisData<true >(collision, candidatesMl, tracks);
415430 }
@@ -503,17 +518,21 @@ struct HfTaskXic {
503518 }
504519
505520 if (enableTHn) {
506- double outputBkg (-1 ), outputPrompt (-1 ), outputFD (-1 );
521+ double outputBkg (-1 ), outputPrompt (-1 ), outputFD (-1 ), outputMSE (- 1 ), outputAE (- 1 ) ;
507522 const int ternaryCl = 3 ;
508523 if ((candidate.isSelXicToPKPi () >= selectionFlagXic) && pdgCodeProng0 == kProton ) {
509524 if constexpr (useMl) {
510525 if (candidate.mlProbXicToPKPi ().size () == ternaryCl) {
511526 outputBkg = candidate.mlProbXicToPKPi ()[0 ]; // / bkg score
512527 outputPrompt = candidate.mlProbXicToPKPi ()[1 ]; // / prompt score
513528 outputFD = candidate.mlProbXicToPKPi ()[2 ]; // / non-prompt score
514- }
515- // / Fill the ML outputScores and variables of candidate (todo: add multiplicity)
516- registry.get <THnSparse>(HIST (" hnXicVarsWithBdt" ))->Fill (massXicToPKPi, ptCandidate, outputBkg, outputPrompt, outputFD, origin);
529+ // / Fill the ML outputScores and variables of candidate (todo: add multiplicity)
530+ registry.get <THnSparse>(HIST (" hnXicVarsWithBdt" ))->Fill (massXicToPKPi, ptCandidate, outputBkg, outputPrompt, outputFD, origin);
531+ } else {
532+ outputAE = candidate.aeOutputXicToPKPi ()[0 ]; // / AE output of feature 0
533+ outputMSE = candidate.mseXicToPKPi ()[0 ]; // / MSE
534+ registry.get <THnSparse>(HIST (" hnXicVarsWithMse" ))->Fill (massXicToPKPi, ptCandidate, candidate.decayLength (), candidate.cpa (), outputAE, origin, outputMSE);
535+ }
517536 } else {
518537 registry.get <THnSparse>(HIST (" hnXicVars" ))->Fill (massXicToPKPi, ptCandidate, candidate.chi2PCA (), candidate.decayLength (), candidate.decayLengthXY (), candidate.cpa (), origin);
519538 }
@@ -524,10 +543,14 @@ struct HfTaskXic {
524543 outputBkg = candidate.mlProbXicToPiKP ()[0 ]; // / bkg score
525544 outputPrompt = candidate.mlProbXicToPiKP ()[1 ]; // / prompt score
526545 outputFD = candidate.mlProbXicToPiKP ()[2 ]; // / non-prompt score
527- }
528- // / Fill the ML outputScores and variables of candidate (todo: add multiplicity)
529- // add here the pT_Mother, y_Mother, level (reco, Gen, Gen + Acc)
530- registry.get <THnSparse>(HIST (" hnXicVarsWithBdt" ))->Fill (massXicToPiKP, ptCandidate, outputBkg, outputPrompt, outputFD, origin);
546+ // / Fill the ML outputScores and variables of candidate (todo: add multiplicity)
547+ // add here the pT_Mother, y_Mother, level (reco, Gen, Gen + Acc)
548+ registry.get <THnSparse>(HIST (" hnXicVarsWithBdt" ))->Fill (massXicToPiKP, ptCandidate, outputBkg, outputPrompt, outputFD, origin);
549+ } else {
550+ outputAE = candidate.aeOutputXicToPiKP ()[0 ]; // / AE output of feature 0
551+ outputMSE = candidate.mseXicToPiKP ()[0 ]; // / MSE
552+ registry.get <THnSparse>(HIST (" hnXicVarsWithMse" ))->Fill (massXicToPiKP, ptCandidate, candidate.decayLength (), candidate.cpa (), outputAE, origin, outputMSE);
553+ }
531554 } else {
532555 registry.get <THnSparse>(HIST (" hnXicVars" ))->Fill (massXicToPiKP, ptCandidate, candidate.chi2PCA (), candidate.decayLength (), candidate.decayLengthXY (), candidate.cpa (), origin);
533556 }
@@ -603,7 +626,7 @@ struct HfTaskXic {
603626 }
604627 PROCESS_SWITCH (HfTaskXic, processMcStd, " Process MC with the standard method" , false );
605628
606- void processMcWithMl (soa::Filtered<soa::Join<aod::HfCand3ProngWPidPiKaPr, aod::HfSelXicToPKPi, aod::HfMlXicToPKPi, aod::HfCand3ProngMcRec>> const & selectedCandidatesMlMc,
629+ void processMcWithMl (soa::Filtered<soa::Join<aod::HfCand3ProngWPidPiKaPr, aod::HfSelXicToPKPi, aod::HfMlXicToPKPi, aod::HfMseXicToPKPi, aod::HfAeOutXicToPKPi, aod:: HfCand3ProngMcRec>> const & selectedCandidatesMlMc,
607630 soa::Join<aod::McParticles, aod::HfCand3ProngMcGen> const & mcParticles,
608631 aod::TracksWMc const & tracksWithMc)
609632 {
0 commit comments