Skip to content

Commit 87a7b82

Browse files
committed
PWGCF: Add isfinite checks and refactor mean pT/ET fills
1 parent 4ae5e28 commit 87a7b82

File tree

1 file changed

+33
-21
lines changed

1 file changed

+33
-21
lines changed

PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,23 +1532,30 @@ struct RadialFlowDecorr {
15321532

15331533
for (int ieta = 0; ieta < KNEta; ++ieta) {
15341534
for (int ipt = 0; ipt < KNpT; ++ipt) {
1535-
if (std::isfinite(sumWiTruth[ieta][ipt]))
1536-
histos.fill(HIST("pmeanTruNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiptiTruth[ieta][ipt] / sumWiTruth[ieta][ipt]);
1537-
if (std::isfinite(sumWiReco[ieta][ipt]))
1538-
histos.fill(HIST("pmeanRecoNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiptiReco[ieta][ipt] / sumWiReco[ieta][ipt]);
1539-
if (std::isfinite(sumWiRecoEffCorr[ieta][ipt]))
1540-
histos.fill(HIST("pmeanRecoEffcorrNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiptiRecoEffCorr[ieta][ipt] / sumWiRecoEffCorr[ieta][ipt]);
1541-
1542-
if (std::isfinite(sumWiTruthEt[ieta][ipt])) {
1543-
histos.fill(HIST("pmeanEtTruNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiptiTruthEt[ieta][ipt] / sumWiTruthEt[ieta][ipt]);
1535+
double mptTru = sumWiptiTruth[ieta][ipt] / sumWiTruth[ieta][ipt];
1536+
double mptReco = sumWiptiReco[ieta][ipt] / sumWiReco[ieta][ipt];
1537+
double mptRecoEffCorr = sumWiptiRecoEffCorr[ieta][ipt] / sumWiRecoEffCorr[ieta][ipt];
1538+
if (std::isfinite(mptTru))
1539+
histos.fill(HIST("pmeanTruNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, mptTru);
1540+
if (std::isfinite(mptReco))
1541+
histos.fill(HIST("pmeanRecoNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, mptReco);
1542+
if (std::isfinite(mptRecoEffCorr))
1543+
histos.fill(HIST("pmeanRecoEffcorrNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, mptRecoEffCorr);
1544+
1545+
double metTru = sumWiptiTruthEt[ieta][ipt] / sumWiTruthEt[ieta][ipt];
1546+
double metReco = sumWiptiRecoEt[ieta][ipt] / sumWiRecoEt[ieta][ipt];
1547+
double metRecoEffCorr = sumWiptiRecoEffCorrEt[ieta][ipt] / sumWiRecoEffCorrEt[ieta][ipt];
1548+
1549+
if (std::isfinite(metTru)) {
1550+
histos.fill(HIST("pmeanEtTruNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, metTru);
15441551
histos.fill(HIST("pmeanMultTruNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiTruthEt[ieta][ipt]);
15451552
}
1546-
if (std::isfinite(sumWiRecoEt[ieta][ipt])) {
1547-
histos.fill(HIST("pmeanEtRecoNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiptiRecoEt[ieta][ipt] / sumWiRecoEt[ieta][ipt]);
1553+
if (std::isfinite(metReco)) {
1554+
histos.fill(HIST("pmeanEtRecoNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, metReco);
15481555
histos.fill(HIST("pmeanMultRecoNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiRecoEt[ieta][ipt]);
15491556
}
1550-
if (std::isfinite(sumWiRecoEffCorrEt[ieta][ipt])) {
1551-
histos.fill(HIST("pmeanEtRecoEffcorrNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiptiRecoEffCorrEt[ieta][ipt] / sumWiRecoEffCorrEt[ieta][ipt]);
1557+
if (std::isfinite(metRecoEffCorr)) {
1558+
histos.fill(HIST("pmeanEtRecoEffcorrNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, metRecoEffCorr);
15521559
histos.fill(HIST("pmeanMultRecoEffcorrNchEtabinPtbin"), col.multNTracksPV(), ieta, ipt, sumWiRecoEffCorrEt[ieta][ipt]);
15531560
}
15541561
}
@@ -1997,10 +2004,12 @@ struct RadialFlowDecorr {
19972004
histos.fill(HIST("MCGen/Prof_ipt0_C2Sub2D_Cent_etaA_etaC"), cent, ietaA, ietaC, c2Sub_Tru);
19982005
if (std::isfinite(c2SubEt_Tru))
19992006
histos.fill(HIST("MCGen/Prof_ipt0_C2EtSub2D_Cent_etaA_etaC"), cent, ietaA, ietaC, c2SubEt_Tru);
2007+
20002008
if (std::isfinite(c2Sub_Reco))
20012009
histos.fill(HIST("MCReco/Prof_ipt0_C2Sub2D_Cent_etaA_etaC"), cent, ietaA, ietaC, c2Sub_Reco);
20022010
if (std::isfinite(c2SubEt_Reco))
20032011
histos.fill(HIST("MCReco/Prof_ipt0_C2EtSub2D_Cent_etaA_etaC"), cent, ietaA, ietaC, c2SubEt_Reco);
2012+
20042013
if (std::isfinite(c2Sub_RecoEffCor))
20052014
histos.fill(HIST("MCRecoEffCorr/Prof_ipt0_C2Sub2D_Cent_etaA_etaC"), cent, ietaA, ietaC, c2Sub_RecoEffCor);
20062015
if (std::isfinite(c2SubEt_RecoEffCor))
@@ -2225,15 +2234,17 @@ struct RadialFlowDecorr {
22252234

22262235
for (int ieta = 0; ieta < KNEta; ++ieta) {
22272236
for (int ipt = 0; ipt < KNpT; ++ipt) {
2228-
if (sumWi[ieta][ipt] > 1.0f) {
2229-
histos.fill(HIST("pmean_nch_etabin_ptbin"), coll.multNTracksPV(), ieta, ipt, sumWipti[ieta][ipt] / sumWi[ieta][ipt]);
2237+
double mpt = sumWipti[ieta][ipt] / sumWi[ieta][ipt];
2238+
double met = sumWiEtVal[ieta][ipt] / sumWiEt[ieta][ipt];
2239+
if (sumWi[ieta][ipt] >= 1.0f && std::isfinite(mpt)) {
2240+
histos.fill(HIST("pmean_nch_etabin_ptbin"), coll.multNTracksPV(), ieta, ipt, mpt);
22302241
histos.fill(HIST("pmeanMult_nch_etabin_ptbin"), coll.multNTracksPV(), ieta, ipt, sumWi[ieta][ipt]);
2231-
histos.fill(HIST("pmean_cent_etabin_ptbin"), cent, ieta, ipt, sumWipti[ieta][ipt] / sumWi[ieta][ipt]);
2242+
histos.fill(HIST("pmean_cent_etabin_ptbin"), cent, ieta, ipt, mpt);
22322243
histos.fill(HIST("pmeanMult_cent_etabin_ptbin"), cent, ieta, ipt, sumWi[ieta][ipt]);
22332244
}
2234-
if (sumWiEt[ieta][ipt] > 1.0f)
2235-
histos.fill(HIST("pmeanEt_nch_etabin_ptbin"), coll.multNTracksPV(), ieta, ipt, sumWiEtVal[ieta][ipt] / sumWiEt[ieta][ipt]);
2236-
histos.fill(HIST("pmeanEt_cent_etabin_ptbin"), cent, ieta, ipt, sumWiEtVal[ieta][ipt] / sumWiEt[ieta][ipt]);
2245+
if (sumWiEt[ieta][ipt] >= 1.0f && std::isfinite(met))
2246+
histos.fill(HIST("pmeanEt_nch_etabin_ptbin"), coll.multNTracksPV(), ieta, ipt, met);
2247+
histos.fill(HIST("pmeanEt_cent_etabin_ptbin"), cent, ieta, ipt, met);
22372248
}
22382249
}
22392250
}
@@ -2362,11 +2373,12 @@ struct RadialFlowDecorr {
23622373

23632374
for (int ieta = 0; ieta < KNEta; ++ieta) {
23642375
for (int ipt = 0; ipt < KNpT; ++ipt) {
2365-
if (sumwk[ieta][ipt][1] > 1.f) {
2376+
2377+
if (std::isfinite(mean[ieta][ipt])) {
23662378
histos.fill(HIST("Prof_Cent_MeanpT_etabin_ptbin"), cent, ieta, ipt, mean[ieta][ipt]);
23672379
histos.fill(HIST("Prof_Mult_MeanpT_etabin_ptbin"), coll.multNTracksPV(), ieta, ipt, mean[ieta][ipt]);
23682380
}
2369-
if (sumwkEt[ieta][ipt][1] > 1.f) {
2381+
if (std::isfinite(meanEt[ieta][ipt])) {
23702382
histos.fill(HIST("Prof_Cent_MeanEt_etabin_ptbin"), cent, ieta, ipt, meanEt[ieta][ipt]);
23712383
histos.fill(HIST("Prof_Mult_MeanEt_etabin_ptbin"), coll.multNTracksPV(), ieta, ipt, meanEt[ieta][ipt]);
23722384
}

0 commit comments

Comments
 (0)