@@ -94,6 +94,8 @@ struct HfTaskD0 {
9494 Configurable<bool > storeCentrality{" storeCentrality" , false , " Flag to store centrality information" };
9595 Configurable<bool > storeOccupancyAndIR{" storeOccupancyAndIR" , false , " Flag to store occupancy information and interaction rate" };
9696 Configurable<bool > storeTrackQuality{" storeTrackQuality" , false , " Flag to store track quality information" };
97+ Configurable<bool > storeZdcEnergy{" storeZdcEnergy" , false , " Flag to store ZDC energy info" };
98+ Configurable<bool > storeZdcTime{" storeZdcTime" , true , " Flag to store ZDC time info" };
9799 // ML inference
98100 Configurable<bool > applyMl{" applyMl" , false , " Flag to apply ML selections" };
99101 Configurable<std::string> ccdbUrl{" ccdbUrl" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
@@ -250,7 +252,10 @@ struct HfTaskD0 {
250252 LOGP (fatal, " DCAFitterN and KFParticle can not be enabled at a time." );
251253 }
252254 if ((storeCentrality || storeOccupancyAndIR) && !(doprocessDataWithDCAFitterNCent || doprocessMcWithDCAFitterNCent || doprocessDataWithDCAFitterNMlCent || doprocessMcWithDCAFitterNMlCent || doprocessDataWithDCAFitterNWithUpc || doprocessDataWithDCAFitterNMlWithUpc)) {
253- LOGP (fatal, " Can't enable the storeCentrality and storeOccupancu without cent process or UPC process" );
255+ LOGP (fatal, " Can't enable the storeCentrality and storeOccupancy without cent process or UPC process" );
256+ }
257+ if ((storeZdcEnergy || storeZdcTime) && !(doprocessDataWithDCAFitterNWithUpc || doprocessDataWithDCAFitterNMlWithUpc)) {
258+ LOGP (fatal, " Can't enable the storeZdcEnergy and storeZdcTime without UPC process" );
254259 }
255260 auto vbins = (std::vector<double >)binsPt;
256261 registry.add (" hMass" , " 2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries" , {HistType::kTH2F , {{500 , 0 ., 5 .}, {vbins, " #it{p}_{T} (GeV/#it{c})" }}});
@@ -311,8 +316,8 @@ struct HfTaskD0 {
311316 const AxisSpec thnAxisFV0A{thnConfigAxisFV0A, " FV0-A amplitude" };
312317 const AxisSpec thnAxisFDDA{thnConfigAxisFDD, " FDD-A amplitude" };
313318 const AxisSpec thnAxisFDDC{thnConfigAxisFDD, " FDD-C amplitude" };
314- const AxisSpec thnAxisZNA {thnConfigAxisZN, " ZNA energy" };
315- const AxisSpec thnAxisZNC {thnConfigAxisZN, " ZNC energy" };
319+ const AxisSpec thnAxisEnergyZNA {thnConfigAxisZN, " ZNA energy" };
320+ const AxisSpec thnAxisEnergyZNC {thnConfigAxisZN, " ZNC energy" };
316321 const AxisSpec thnAxisTimeZNA{thnConfigAxisTimeZN, " ZNA Time" };
317322 const AxisSpec thnAxisTimeZNC{thnConfigAxisTimeZN, " ZNC Time" };
318323
@@ -371,11 +376,15 @@ struct HfTaskD0 {
371376 axes.push_back (thnAxisFV0A);
372377 axes.push_back (thnAxisFDDA);
373378 axes.push_back (thnAxisFDDC);
374- // axes.push_back(thnAxisZNA);
375- // axes.push_back(thnAxisZNC);
376379 axes.push_back (thnAxisNumPvContr);
377- axes.push_back (thnAxisTimeZNA);
378- axes.push_back (thnAxisTimeZNC);
380+ if (storeZdcEnergy) {
381+ axes.push_back (thnAxisEnergyZNA);
382+ axes.push_back (thnAxisEnergyZNC);
383+ }
384+ if (storeZdcTime) {
385+ axes.push_back (thnAxisTimeZNA);
386+ axes.push_back (thnAxisTimeZNC);
387+ }
379388 }
380389
381390 if (applyMl) {
@@ -616,7 +625,8 @@ struct HfTaskD0 {
616625 aod::FT0s const & ft0s,
617626 aod::FV0As const & fv0as,
618627 aod::FDDs const & fdds,
619- TracksWPid const & tracks)
628+ TracksWPid const &
629+ )
620630 {
621631 for (const auto & collision : collisions) {
622632 float centrality{-1 .f };
@@ -644,20 +654,18 @@ struct HfTaskD0 {
644654 const bool hasZdc = bcForUPC.has_zdc ();
645655 float zdcEnergyZNA = -1 .f ;
646656 float zdcEnergyZNC = -1 .f ;
647- float zdcTimeZNA = -1 .f ;
648- float zdcTimeZNC = -1 .f ;
657+ float zdcTimeZNA = -999 .f ;
658+ float zdcTimeZNC = -999 .f ;
649659
650660 if (hasZdc) {
651661 const auto & zdc = bcForUPC.zdc ();
652662 zdcEnergyZNA = zdc.energyCommonZNA ();
653663 zdcEnergyZNC = zdc.energyCommonZNC ();
654664 zdcTimeZNA = zdc.timeZNA ();
655665 zdcTimeZNC = zdc.timeZNC ();
656-
657666 registry.fill (HIST (" Data/zdc/energyZNA_vs_energyZNC" ), zdcEnergyZNA, zdcEnergyZNC);
658667 registry.fill (HIST (" Data/zdc/timeZNA_vs_timeZNC" ), zdcTimeZNA, zdcTimeZNC);
659668 }
660-
661669 registry.fill (HIST (" Data/fitInfo/ampFT0A_vs_ampFT0C" ), fitInfo.ampFT0A , fitInfo.ampFT0C );
662670 registry.fill (HIST (" Data/hUpcGapAfterSelection" ), gap);
663671
@@ -684,13 +692,8 @@ struct HfTaskD0 {
684692 auto track0 = candidate.template prong0_as <TracksWPid>();
685693 auto track1 = candidate.template prong1_as <TracksWPid>();
686694
687- // 4. Fill your track eta histogram [3, 4]
688- // hTrackEta->Fill(track0.eta());
689- // hTrackEta->Fill(track1.eta());
690-
691695 registry.fill (HIST (" Data/hGapVsEtaTrack0" ), gap, track0.eta ());
692696 registry.fill (HIST (" Data/hGapVsEtaTrack1" ), gap, track1.eta ());
693- // registry.fill(HIST("Data/timeZNA_vs_timeZNC"), gap, track1.eta());
694697 registry.fill (HIST (" Data/hGapVsRap" ), gap, HfHelper::yD0 (candidate));
695698
696699 if (gap == 0 && candidate.isSelD0 () >= selectionFlagD0) { // A side // D0 --> K-Pi+
@@ -743,11 +746,13 @@ struct HfTaskD0 {
743746 // Fill THnSparse with structure matching histogram axes: [mass, pt, (mlScores if FillMl), rapidity, d0Type, (cent if storeCentrality), (occ, ir if storeOccupancyAndIR), gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC]
744747 auto fillTHnData = [&](float mass, int d0Type) {
745748 // Pre-calculate vector size to avoid reallocations
746- constexpr int NAxesBase = 13 ; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC, nPVcontr
749+ constexpr int NAxesBase = 11 ; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC, nPVcontr
747750 constexpr int NAxesMl = FillMl ? 3 : 0 ; // 3 ML scores if FillMl
748751 int const nAxesCent = storeCentrality ? 1 : 0 ; // centrality if storeCentrality
749752 int const nAxesOccIR = storeOccupancyAndIR ? 2 : 0 ; // occupancy and IR if storeOccupancyAndIR
750- int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR;
753+ int const nAxesZdcEnergy = storeZdcEnergy ? 2 : 0 ; // ZDC energy if storeZdcEnergy
754+ int const nAxesZdcTime = storeZdcTime ? 2 : 0 ; // ZDC time if storeZdctime
755+ int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR + nAxesZdcEnergy + nAxesZdcTime;
751756
752757 std::vector<double > valuesToFill;
753758 valuesToFill.reserve (nAxesTotal);
@@ -778,11 +783,15 @@ struct HfTaskD0 {
778783 valuesToFill.push_back (static_cast <double >(fitInfo.ampFV0A ));
779784 valuesToFill.push_back (static_cast <double >(fitInfo.ampFDDA ));
780785 valuesToFill.push_back (static_cast <double >(fitInfo.ampFDDC ));
781- // valuesToFill.push_back(static_cast<double>(zdcEnergyZNA));
782- // valuesToFill.push_back(static_cast<double>(zdcEnergyZNC));
783786 valuesToFill.push_back (static_cast <double >(numPvContributors));
787+ if (storeZdcEnergy) {
788+ valuesToFill.push_back (static_cast <double >(zdcEnergyZNA));
789+ valuesToFill.push_back (static_cast <double >(zdcEnergyZNC));
790+ }
791+ if (storeZdcTime) {
784792 valuesToFill.push_back (static_cast <double >(zdcTimeZNA));
785793 valuesToFill.push_back (static_cast <double >(zdcTimeZNC));
794+ }
786795 if constexpr (FillMl) {
787796 registry.get <THnSparse>(HIST (" hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type" ))->Fill (valuesToFill.data ());
788797 } else {
@@ -1000,7 +1009,7 @@ struct HfTaskD0 {
10001009 registry.fill (HIST (" hMassSigD0" ), massD0, ptCandidate, rapidityCandidate);
10011010 if constexpr (ApplyMl) {
10021011 if (storeCentrality && storeOccupancyAndIR) {
1003- registry.fill (HIST (" hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type" ), candidate.mlProbD0 ()[0 ], candidate.mlProbD0 ()[1 ], candidate.mlProbD0 ()[2 ], massD0, ptCandidate, rapidityCandidate, SigD0, candidate.ptBhadMotherPart (), candidate.originMcRec (), numPvContributors, cent, occ, ir);
1012+ registry.fill (HIST (" hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type" ), candidate.mlProbD0 ()[0 ], candidate.mlProbD0 ()[1 ], candidate.mlProbD0 ()[2 ], massD0, ptCandidate, rapidityCandidate, SigD0, candidate.ptBhadMotherPart (), candidate.originMcRec (), numPvContributors, cent, occ, ir);
10041013 } else if (storeCentrality && !storeOccupancyAndIR) {
10051014 registry.fill (HIST (" hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type" ), candidate.mlProbD0 ()[0 ], candidate.mlProbD0 ()[1 ], candidate.mlProbD0 ()[2 ], massD0, ptCandidate, rapidityCandidate, SigD0, candidate.ptBhadMotherPart (), candidate.originMcRec (), numPvContributors, cent);
10061015 } else if (!storeCentrality && storeOccupancyAndIR) {
@@ -1273,7 +1282,7 @@ struct HfTaskD0 {
12731282 aod::FDDs const & fdds,
12741283 TracksWPid const & tracks,
12751284 aod::Zdcs const & /* zdcs*/
1276- )
1285+ )
12771286 {
12781287 runAnalysisPerCollisionDataWithUpc<false >(collisions, selectedD0Candidates, bcs, ft0s, fv0as, fdds, tracks);
12791288 }
0 commit comments