Skip to content

Commit ff0ccc6

Browse files
committed
modify Nch reco vs true histogram
1 parent e6694f5 commit ff0ccc6

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

PWGCF/Flow/Tasks/flowMc.cxx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ struct FlowMc {
165165
bool correctionsLoaded = false;
166166

167167
std::vector<TF1*> funcEff;
168-
TH1D* hFindPtBin;
169-
TF1* funcV2;
170-
TF1* funcV3;
171-
TF1* funcV4;
168+
TH1D* hFindPtBin = nullptr;
169+
TF1* funcV2 = nullptr;
170+
TF1* funcV3 = nullptr;
171+
TF1* funcV4 = nullptr;
172172
enum GoodITSLayersFlag {
173173
kITSLayersAll,
174174
kITSLayer0123,
@@ -185,7 +185,7 @@ struct FlowMc {
185185
OutputObj<FlowContainer> fFCReco{FlowContainer("FlowContainerReco")};
186186
GFW* fGFWTrue = new GFW();
187187
GFW* fGFWReco = new GFW();
188-
TAxis* fPtAxis;
188+
TAxis* fPtAxis = nullptr;
189189
std::vector<GFW::CorrConfig> corrconfigsTruth;
190190
std::vector<GFW::CorrConfig> corrconfigsReco;
191191
TRandom3* fRndm = new TRandom3(0);
@@ -195,7 +195,7 @@ struct FlowMc {
195195
double mMinSeconds{-1.};
196196
std::unordered_map<int, TH2*> gHadronicRate;
197197
ctpRateFetcher mRateFetcher;
198-
TH2* gCurrentHadronicRate;
198+
TH2* gCurrentHadronicRate = nullptr;
199199
RCTFlagsChecker rctChecker{"CBT"};
200200

201201
void init(InitContext&)
@@ -218,7 +218,7 @@ struct FlowMc {
218218
// pT histograms
219219
histos.add<TH1>("hImpactParameter", "hImpactParameter", HistType::kTH1D, {axisB});
220220
histos.add<TH2>("hNchVsImpactParameter", "hNchVsImpactParameter", HistType::kTH2D, {axisB, axisNch});
221-
histos.add<TH2>("hNchRecoVsNchGen", "hNchRecoVsNchGen", HistType::kTH2D, {axisNch, axisNch});
221+
histos.add<TH2>("hNchRecoVsNchGen", "hNchRecoVsNchGen; Recoconstucted Nch; Genenerated Nch", HistType::kTH2D, {axisNch, axisNch});
222222
histos.add<TH1>("hEventPlaneAngle", "hEventPlaneAngle", HistType::kTH1D, {axisPhi});
223223
histos.add<TH2>("hPtVsPhiGenerated", "hPtVsPhiGenerated", HistType::kTH2D, {axisPhi, axisPt});
224224
histos.add<TH2>("hPtVsPhiGlobal", "hPtVsPhiGlobal", HistType::kTH2D, {axisPhi, axisPt});
@@ -411,7 +411,7 @@ struct FlowMc {
411411

412412
void fillFC(GFW* fGFW, bool isMCTruth, const GFW::CorrConfig& corrconf, const double& cent, const double& rndm)
413413
{
414-
double dnx, val;
414+
double dnx, val = 0;
415415
dnx = fGFW->Calculate(corrconf, 0, kTRUE).real();
416416
if (!corrconf.pTDif) {
417417
if (dnx == 0)
@@ -437,7 +437,6 @@ struct FlowMc {
437437
fFCReco->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm);
438438
}
439439
}
440-
return;
441440
}
442441

443442
void loadCentVsIPTruth(uint64_t timestamp)
@@ -635,7 +634,10 @@ struct FlowMc {
635634
}
636635
}
637636
}
638-
histos.fill(HIST("hNchRecoVsNchGen"), nChGlobal, nChGen);
637+
if (nChGlobal > 0 && nChGen > 0) {
638+
// fill only when Nch is not zero
639+
histos.fill(HIST("hNchRecoVsNchGen"), nChGlobal, nChGen);
640+
}
639641
if (cfgTrackDensityCorrUse && cfgFlowCumulantEnabled) {
640642
psi2Est = std::atan2(q2y, q2x) / 2.;
641643
psi3Est = std::atan2(q3y, q3x) / 3.;

0 commit comments

Comments
 (0)