@@ -301,20 +301,26 @@ struct HfTaskLc {
301301 bool const isDataStd = doprocessDataStd || doprocessDataStdWithFT0C || doprocessDataStdWithFT0M || doprocessDataStdWithUpc;
302302 bool const isMcStd = doprocessMcStd || doprocessMcStdWithFT0C || doprocessMcStdWithFT0M;
303303
304- std::vector<AxisSpec> axesStd, axesWithBdt, axesGen;
304+ std::vector<AxisSpec> axesStd, axesWithBdt, axesGen, axesUpc, axesUpcWithBdt ;
305305
306- if (isDataStd) {
306+ if (isDataStd && !isUpc ) {
307307 axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets};
308308 }
309+ if (isDataStd && isUpc) {
310+ axesUpc = {thnAxisMass, thnAxisPt, thnAxisRapidity, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisGapType, thnAxisFT0A, thnAxisFT0C, thnAxisFV0A, thnAxisFDDA, thnAxisFDDC, thnAxisZNA, thnAxisZNC};
311+ }
309312 if (isMcStd) {
310313 axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisPtB, thnAxisCanType};
311314 }
312315 if (isMcStd || isMcWithMl) {
313316 axesGen = {thnAxisPt, thnAxisCentrality, thnAxisY, thnAxisTracklets, thnAxisPtB, thnAxisCanType};
314317 }
315- if (isDataWithMl) {
318+ if (isDataWithMl && !isUpc ) {
316319 axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets};
317320 }
321+ if (isDataWithMl && isUpc) {
322+ axesUpcWithBdt = {thnAxisMass, thnAxisPt, thnAxisRapidity, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisGapType, thnAxisFT0A, thnAxisFT0C, thnAxisFV0A, thnAxisFDDA, thnAxisFDDC, thnAxisZNA, thnAxisZNC};
323+ }
318324 if (isMcWithMl) {
319325 axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisPtB, thnAxisCanType};
320326 }
@@ -334,20 +340,12 @@ struct HfTaskLc {
334340 }
335341 }
336342 if (isUpc) {
337- for (const auto & axes : std::array<std::vector<AxisSpec>*, 3 >{&axesWithBdt, &axesStd, &axesGen}) {
338- if (!axes->empty ()) {
339- axes->push_back (thnAxisGapType);
340- axes->push_back (thnAxisFT0A);
341- axes->push_back (thnAxisFT0C);
342- axes->push_back (thnAxisFV0A);
343- axes->push_back (thnAxisFDDA);
344- axes->push_back (thnAxisFDDC);
345- axes->push_back (thnAxisZNA);
346- axes->push_back (thnAxisZNC);
347- }
343+ if (isDataStd) {
344+ registry.add (" hnLcUpcVars" , " THn for Lambdac candidates for Data in UPC" , HistType::kTHnSparseF , axesUpc);
345+ } else if (isDataWithMl) {
346+ registry.add (" hnLcUpcVarsWithBdt" , " THn for Lambdac candidates with BDT scores for data in UPC" , HistType::kTHnSparseF , axesUpcWithBdt);
348347 }
349- }
350- if (isDataWithMl) {
348+ } else if (isDataWithMl) {
351349 registry.add (" hnLcVarsWithBdt" , " THn for Lambdac candidates with BDT scores for data with ML" , HistType::kTHnSparseF , axesWithBdt);
352350 } else if (isMcWithMl) {
353351 registry.add (" hnLcVarsWithBdt" , " THn for Lambdac candidates with BDT scores for mc with ML" , HistType::kTHnSparseF , axesWithBdt);
@@ -790,62 +788,12 @@ struct HfTaskLc {
790788 const auto ptProng1 = candidate.ptProng1 ();
791789 const auto ptProng2 = candidate.ptProng2 ();
792790 const auto decayLength = candidate.decayLength ();
793- const auto decayLengthXY = candidate.decayLengthXY ();
794791 const auto chi2PCA = candidate.chi2PCA ();
795792 const auto cpa = candidate.cpa ();
796- const auto cpaXY = candidate.cpaXY ();
797-
798- if (candidate.isSelLcToPKPi () >= selectionFlagLc) {
799- registry.fill (HIST (" Data/hMass" ), HfHelper::invMassLcToPKPi (candidate));
800- registry.fill (HIST (" Data/hMassVsPtVsNPvContributors" ), HfHelper::invMassLcToPKPi (candidate), pt, numPvContributors);
801- registry.fill (HIST (" Data/hMassVsPt" ), HfHelper::invMassLcToPKPi (candidate), pt);
802- }
803- if (candidate.isSelLcToPiKP () >= selectionFlagLc) {
804- registry.fill (HIST (" Data/hMass" ), HfHelper::invMassLcToPiKP (candidate));
805- registry.fill (HIST (" Data/hMassVsPtVsNPvContributors" ), HfHelper::invMassLcToPiKP (candidate), pt, numPvContributors);
806- registry.fill (HIST (" Data/hMassVsPt" ), HfHelper::invMassLcToPiKP (candidate), pt);
807- }
808- registry.fill (HIST (" Data/hPt" ), pt);
809- registry.fill (HIST (" Data/hPtProng0" ), ptProng0);
810- registry.fill (HIST (" Data/hPtProng1" ), ptProng1);
811- registry.fill (HIST (" Data/hPtProng2" ), ptProng2);
812- registry.fill (HIST (" Data/hd0Prong0" ), candidate.impactParameter0 ());
813- registry.fill (HIST (" Data/hd0Prong1" ), candidate.impactParameter1 ());
814- registry.fill (HIST (" Data/hd0Prong2" ), candidate.impactParameter2 ());
815- registry.fill (HIST (" Data/hd0VsPtProng0" ), candidate.impactParameter0 (), pt);
816- registry.fill (HIST (" Data/hd0VsPtProng1" ), candidate.impactParameter1 (), pt);
817- registry.fill (HIST (" Data/hd0VsPtProng2" ), candidate.impactParameter2 (), pt);
818- registry.fill (HIST (" Data/hDecLength" ), decayLength);
819- registry.fill (HIST (" Data/hDecLengthVsPt" ), decayLength, pt);
820- registry.fill (HIST (" Data/hDecLengthxy" ), decayLengthXY);
821- registry.fill (HIST (" Data/hDecLengthxyVsPt" ), decayLengthXY, pt);
822- registry.fill (HIST (" Data/hCt" ), HfHelper::ctLc (candidate));
823- registry.fill (HIST (" Data/hCtVsPt" ), HfHelper::ctLc (candidate), pt);
824- registry.fill (HIST (" Data/hCPA" ), cpa);
825- registry.fill (HIST (" Data/hCPAVsPt" ), cpa, pt);
826- registry.fill (HIST (" Data/hCPAxy" ), cpaXY);
827- registry.fill (HIST (" Data/hCPAxyVsPt" ), cpaXY, pt);
828- registry.fill (HIST (" Data/hDca2" ), chi2PCA);
829- registry.fill (HIST (" Data/hDca2VsPt" ), chi2PCA, pt);
830- registry.fill (HIST (" Data/hEta" ), candidate.eta ());
831- registry.fill (HIST (" Data/hEtaVsPt" ), candidate.eta (), pt);
832- registry.fill (HIST (" Data/hPhi" ), candidate.phi ());
833- registry.fill (HIST (" Data/hPhiVsPt" ), candidate.phi (), pt);
834- registry.fill (HIST (" hSelectionStatus" ), candidate.isSelLcToPKPi (), pt);
835- registry.fill (HIST (" hSelectionStatus" ), candidate.isSelLcToPiKP (), pt);
836- registry.fill (HIST (" Data/hImpParErrProng0VsPt" ), candidate.errorImpactParameter0 (), pt);
837- registry.fill (HIST (" Data/hImpParErrProng1VsPt" ), candidate.errorImpactParameter1 (), pt);
838- registry.fill (HIST (" Data/hImpParErrProng2VsPt" ), candidate.errorImpactParameter2 (), pt);
839- registry.fill (HIST (" Data/hDecLenErrVsPt" ), candidate.errorDecayLength (), pt);
793+ const auto rapidity = std::abs (HfHelper::yLc (candidate));
840794
841795 if (fillTHn) {
842- float const cent = evaluateCentralityColl (collision);
843- float occ{-1 .};
844- if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
845- occ = o2::hf_occupancy::getOccupancyColl (collision, occEstimator);
846- }
847796 double outputBkg (-1 ), outputPrompt (-1 ), outputFD (-1 );
848- const float properLifetime = HfHelper::ctLc (candidate) * CtToProperLifetimePs;
849797
850798 auto fillTHnData = [&](bool isPKPi) {
851799 const auto massLc = isPKPi ? HfHelper::invMassLcToPKPi (candidate) : HfHelper::invMassLcToPiKP (candidate);
@@ -858,41 +806,11 @@ struct HfTaskLc {
858806 outputFD = mlProb[MlClassNonPrompt]; // / non-prompt score
859807 }
860808 // / Fill the ML outputScores and variables of candidate
861- std::vector<double > valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast <double >(numPvContributors)};
862- if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
863- valuesToFill.push_back (occ);
864- }
865- if (storeProperLifetime) {
866- valuesToFill.push_back (properLifetime);
867- }
868-
869- valuesToFill.push_back (static_cast <double >(gap));
870- valuesToFill.push_back (static_cast <double >(fitInfo.ampFT0A ));
871- valuesToFill.push_back (static_cast <double >(fitInfo.ampFT0C ));
872- valuesToFill.push_back (static_cast <double >(fitInfo.ampFV0A ));
873- valuesToFill.push_back (static_cast <double >(fitInfo.ampFDDA ));
874- valuesToFill.push_back (static_cast <double >(fitInfo.ampFDDC ));
875- valuesToFill.push_back (static_cast <double >(zdcEnergyZNA));
876- valuesToFill.push_back (static_cast <double >(zdcEnergyZNC));
877-
878- registry.get <THnSparse>(HIST (" hnLcVarsWithBdt" ))->Fill (valuesToFill.data ());
809+ std::vector<double > valuesToFill{massLc, pt, rapidity, outputBkg, outputPrompt, outputFD, static_cast <double >(numPvContributors), static_cast <double >(gap), static_cast <double >(fitInfo.ampFT0A ), static_cast <double >(fitInfo.ampFT0C ), static_cast <double >(fitInfo.ampFV0A ), static_cast <double >(fitInfo.ampFDDA ), static_cast <double >(fitInfo.ampFDDC ), static_cast <double >(zdcEnergyZNA), static_cast <double >(zdcEnergyZNC)};
810+ registry.get <THnSparse>(HIST (" hnLcUpcVarsWithBdt" ))->Fill (valuesToFill.data ());
879811 } else {
880- std::vector<double > valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast <double >(numPvContributors)};
881- if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
882- valuesToFill.push_back (occ);
883- }
884- if (storeProperLifetime) {
885- valuesToFill.push_back (properLifetime);
886- }
887- valuesToFill.push_back (static_cast <double >(gap));
888- valuesToFill.push_back (static_cast <double >(fitInfo.ampFT0A ));
889- valuesToFill.push_back (static_cast <double >(fitInfo.ampFT0C ));
890- valuesToFill.push_back (static_cast <double >(fitInfo.ampFV0A ));
891- valuesToFill.push_back (static_cast <double >(fitInfo.ampFDDA ));
892- valuesToFill.push_back (static_cast <double >(fitInfo.ampFDDC ));
893- valuesToFill.push_back (static_cast <double >(zdcEnergyZNA));
894- valuesToFill.push_back (static_cast <double >(zdcEnergyZNC));
895- registry.get <THnSparse>(HIST (" hnLcVars" ))->Fill (valuesToFill.data ());
812+ std::vector<double > valuesToFill{massLc, pt, rapidity, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast <double >(numPvContributors), static_cast <double >(gap), static_cast <double >(fitInfo.ampFT0A ), static_cast <double >(fitInfo.ampFT0C ), static_cast <double >(fitInfo.ampFV0A ), static_cast <double >(fitInfo.ampFDDA ), static_cast <double >(fitInfo.ampFDDC ), static_cast <double >(zdcEnergyZNA), static_cast <double >(zdcEnergyZNC)};
813+ registry.get <THnSparse>(HIST (" hnLcUpcVars" ))->Fill (valuesToFill.data ());
896814 }
897815 };
898816
0 commit comments