@@ -348,30 +348,36 @@ struct FlowGfwNonflow {
348348 AxisSpec dcaXYAXis = {200 , -1 , 1 , " DCA_{xy} (cm)" };
349349
350350 if (cfgFillQA) {
351- registry.add (" trackQA/before/phi_eta_vtxZ" , " " , {HistType::kTH3D , {phiAxis, etaAxis, vtxAxis}});
352- registry.add (" trackQA/before/pt_dcaXY_dcaZ" , " " , {HistType::kTH3D , {ptAxis, dcaXYAXis, dcaZAXis}});
353- registry.add (" trackQA/before/pt_phi" , " " , {HistType::kTH2D , {ptAxis, phiModAxis}});
354- registry.add (" trackQA/before/chi2prTPCcls" , " #chi^{2}/cluster for the TPC track segment" , {HistType::kTH1D , {{100 , 0 ., 5 .}}});
355- registry.add (" trackQA/before/chi2prITScls" , " #chi^{2}/cluster for the ITS track" , {HistType::kTH1D , {{100 , 0 ., 50 .}}});
356- registry.add (" trackQA/before/nTPCClusters" , " Number of found TPC clusters" , {HistType::kTH1D , {{100 , 40 , 180 }}});
357- registry.add (" trackQA/before/nITSClusters" , " Number of found ITS clusters" , {HistType::kTH1D , {{100 , 0 , 20 }}});
358- registry.add (" trackQA/before/nTPCCrossedRows" , " Number of crossed TPC Rows" , {HistType::kTH1D , {{100 , 40 , 180 }}});
359- registry.addClone (" trackQA/before/" , " trackQA/after/" );
360- registry.add (" trackQA/after/pt_ref" , " ; #it{p}_{T}; Counts" , {HistType::kTH1D , {{100 , gfwMemberCache.ptreflow , gfwMemberCache.ptrefup }}});
361- registry.add (" trackQA/after/pt_poi" , " ; #it{p}_{T}; Counts" , {HistType::kTH1D , {{100 , gfwMemberCache.ptpoilow , gfwMemberCache.ptpoiup }}});
362- registry.add (" trackQA/after/Nch_corrected" , " ; N_{ch}; Counts" , {HistType::kTH1D , {nchAxis}});
363- registry.add (" trackQA/after/Nch_uncorrected" , " ; N_{ch}; Counts" , {HistType::kTH1D , {nchAxis}});
364- registry.add (" trackQA/after/etaNch" , " ; #eta; Counts" , {HistType::kTH1D , {etaAxis}});
365- registry.add (" trackQA/after/etaPtPt" , " ; #eta; Counts" , {HistType::kTH1D , {etaAxis}});
366-
367- registry.add (" eventQA/before/globalTracks_centT0C" , " ; FT0C centrality (%); N_{global}" , {HistType::kTH2D , {centAxis, nchAxis}});
368- registry.add (" eventQA/before/PVTracks_centT0C" , " ; FT0C centrality (%); N_{PV}" , {HistType::kTH2D , {centAxis, multpvAxis}});
369- registry.add (" eventQA/before/globalTracks_PVTracks" , " ; N_{PV}; N_{global}" , {HistType::kTH2D , {multpvAxis, nchAxis}});
370- registry.add (" eventQA/before/globalTracks_multT0A" , " ; multT0A; N_{global}" , {HistType::kTH2D , {t0aAxis, nchAxis}});
371- registry.add (" eventQA/before/globalTracks_multV0A" , " ; multV0A; N_{global}" , {HistType::kTH2D , {v0aAxis, nchAxis}});
372- registry.add (" eventQA/before/multV0A_multT0A" , " ; multV0A; multT0A" , {HistType::kTH2D , {t0aAxis, v0aAxis}});
373- registry.add (" eventQA/before/multT0C_centT0C" , " ; multT0C; FT0C centrality (%)" , {HistType::kTH2D , {centAxis, t0cAxis}});
374- registry.add (" eventQA/before/occ_mult_cent" , " ; occupancy; N_{ch}; centrality (%)" , {HistType::kTH3D , {occAxis, nchAxis, centAxis}});
351+ if (doprocessMCGen) {
352+ registry.add (" MCGen/before/phi_eta_vtxZ_gen" , " ; #varphi; #eta; V_{z}" , {HistType::kTH3D , {phiAxis, etaAxis, vtxAxis}});
353+ registry.add (" MCGen/before/pt_gen" , " ; #it{p}_{T}" , {HistType::kTH1D , {ptAxis}});
354+ registry.addClone (" MCGen/before/" , " MCGen/after/" );
355+ } else {
356+ registry.add (" trackQA/before/phi_eta_vtxZ" , " ; #varphi; #eta; V_{z}" , {HistType::kTH3D , {phiAxis, etaAxis, vtxAxis}});
357+ registry.add (" trackQA/before/pt_dcaXY_dcaZ" , " ; #it{p}_{T}; DCA_#it{xy}; DCA_#it{z}" , {HistType::kTH3D , {ptAxis, dcaXYAXis, dcaZAXis}});
358+ registry.add (" trackQA/before/pt_phi" , " ; #it{p}_{T}; fmod(#varphi,#pi/9)" , {HistType::kTH2D , {ptAxis, phiModAxis}});
359+ registry.add (" trackQA/before/chi2prTPCcls" , " #chi^{2}/cluster for the TPC track segment" , {HistType::kTH1D , {{100 , 0 ., 5 .}}});
360+ registry.add (" trackQA/before/chi2prITScls" , " #chi^{2}/cluster for the ITS track" , {HistType::kTH1D , {{100 , 0 ., 50 .}}});
361+ registry.add (" trackQA/before/nTPCClusters" , " Number of found TPC clusters" , {HistType::kTH1D , {{100 , 40 , 180 }}});
362+ registry.add (" trackQA/before/nITSClusters" , " Number of found ITS clusters" , {HistType::kTH1D , {{100 , 0 , 20 }}});
363+ registry.add (" trackQA/before/nTPCCrossedRows" , " Number of crossed TPC Rows" , {HistType::kTH1D , {{100 , 40 , 180 }}});
364+ registry.addClone (" trackQA/before/" , " trackQA/after/" );
365+ registry.add (" trackQA/after/pt_ref" , " ; #it{p}_{T}; Counts" , {HistType::kTH1D , {{100 , gfwMemberCache.ptreflow , gfwMemberCache.ptrefup }}});
366+ registry.add (" trackQA/after/pt_poi" , " ; #it{p}_{T}; Counts" , {HistType::kTH1D , {{100 , gfwMemberCache.ptpoilow , gfwMemberCache.ptpoiup }}});
367+ registry.add (" trackQA/after/Nch_corrected" , " ; N_{ch}; Counts" , {HistType::kTH1D , {nchAxis}});
368+ registry.add (" trackQA/after/Nch_uncorrected" , " ; N_{ch}; Counts" , {HistType::kTH1D , {nchAxis}});
369+ registry.add (" trackQA/after/etaNch" , " ; #eta; Counts" , {HistType::kTH1D , {etaAxis}});
370+ registry.add (" trackQA/after/etaPtPt" , " ; #eta; Counts" , {HistType::kTH1D , {etaAxis}});
371+
372+ registry.add (" eventQA/before/globalTracks_centT0C" , " ; FT0C centrality (%); N_{global}" , {HistType::kTH2D , {centAxis, nchAxis}});
373+ registry.add (" eventQA/before/PVTracks_centT0C" , " ; FT0C centrality (%); N_{PV}" , {HistType::kTH2D , {centAxis, multpvAxis}});
374+ registry.add (" eventQA/before/globalTracks_PVTracks" , " ; N_{PV}; N_{global}" , {HistType::kTH2D , {multpvAxis, nchAxis}});
375+ registry.add (" eventQA/before/globalTracks_multT0A" , " ; multT0A; N_{global}" , {HistType::kTH2D , {t0aAxis, nchAxis}});
376+ registry.add (" eventQA/before/globalTracks_multV0A" , " ; multV0A; N_{global}" , {HistType::kTH2D , {v0aAxis, nchAxis}});
377+ registry.add (" eventQA/before/multV0A_multT0A" , " ; multT0A; multV0A" , {HistType::kTH2D , {t0aAxis, v0aAxis}});
378+ registry.add (" eventQA/before/multT0C_centT0C" , " ; FT0C centrality (%); multT0C" , {HistType::kTH2D , {centAxis, t0cAxis}});
379+ registry.add (" eventQA/before/occ_mult_cent" , " ; occupancy; N_{ch}; centrality (%)" , {HistType::kTH3D , {occAxis, nchAxis, centAxis}});
380+ }
375381 }
376382 registry.add (" eventQA/before/centrality" , " ; centrality (%); Counts" , {HistType::kTH1D , {centAxis}});
377383 registry.add (" eventQA/before/multiplicity" , " ; N_{ch}; Counts" , {HistType::kTH1D , {nchAxis}});
@@ -649,19 +655,44 @@ struct FlowGfwNonflow {
649655 template <typename TTrack>
650656 double getEfficiency (const TTrack& track, const float & centrality)
651657 { // -1 ref, 0 ch, 1 pi, 2 ka, 3 pr, 4 k0, 5 lambda
652- double eff = 1 .;
658+
653659 if (!correctionsConfig.mEfficiency ) {
654- return eff ;
660+ return 1 ;
655661 }
662+
663+ int bin = 0 ;
664+
656665 if (cfgCorrections.cfgUse2DEfficiency ) {
657- eff = dynamic_cast <TH2D *>(correctionsConfig.mEfficiency )->GetBinContent (dynamic_cast <TH2D *>(correctionsConfig.mEfficiency )->FindBin (track.pt (), centrality));
666+ auto * effHist = dynamic_cast <TH2D *>(correctionsConfig.mEfficiency );
667+ if (!effHist) {
668+ LOGF (error, " Efficiency object at %s is not a TH2D" , cfgCorrections.cfgEfficiencyPath .value .c_str ());
669+ return -1 .;
670+ }
671+ bin = effHist->FindBin (track.pt (), centrality);
672+ if (!bin) {
673+ return -1 .;
674+ }
675+ const double eff = effHist->GetBinContent (bin);
676+ if (!std::isfinite (eff) || eff <= 0 .) {
677+ return -1 .;
678+ }
679+ return 1 . / eff;
658680 } else {
659- eff = dynamic_cast <TH1D *>(correctionsConfig.mEfficiency )->GetBinContent (dynamic_cast <TH1D *>(correctionsConfig.mEfficiency )->FindBin (track.pt ()));
660- }
661- if (eff == 0 ) {
662- return -1 .;
681+ auto * effHist = dynamic_cast <TH1D *>(correctionsConfig.mEfficiency );
682+ if (!effHist) {
683+ LOGF (error, " Efficiency object at %s is not a TH1D" , cfgCorrections.cfgEfficiencyPath .value .c_str ());
684+ return -1 .;
685+ }
686+ bin = effHist->FindBin (track.pt ());
687+ if (!bin) {
688+ return -1 .;
689+ }
690+ const double eff = effHist->GetBinContent (bin);
691+ if (!std::isfinite (eff) || eff <= 0 .) {
692+ return -1 .;
693+ }
694+ return 1 . / eff;
663695 }
664- return 1 . / eff;
665696 }
666697
667698 template <typename TCollision>
@@ -844,7 +875,7 @@ struct FlowGfwNonflow {
844875 auto val = fGFW ->Calculate (corrconfigs.at (l_ind), 0 , false ).real () / dnx;
845876 if (std::abs (val) < 1 ) {
846877 fFC ->FillProfile (corrconfigs.at (l_ind).Head .c_str (), centmult, val, cfgUseMultiplicityFlowWeights ? dnx : 1.0 , rndm);
847- fFCpt ->fillVnPtProfiles (centmult, val, dnx, rndm, gfwMemberCache.configs .GetpTCorrMasks ()[l_ind]);
878+ fFCpt ->fillVnPtProfiles (static_cast < int >(l_ind), centmult, val, dnx, rndm, gfwMemberCache.configs .GetpTCorrMasks ()[l_ind]);
848879 }
849880 continue ;
850881 }
0 commit comments