Skip to content

Commit 0c9e90a

Browse files
committed
fix bug in separate processing
1 parent 60c7814 commit 0c9e90a

1 file changed

Lines changed: 21 additions & 18 deletions

File tree

PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ struct FlowGenericFramework {
651651
const int ptbins = static_cast<int>(gfwMemberCache.ptbinning.size() - 1);
652652
fPtAxis = new TAxis(ptbins, gfwMemberCache.ptbinning.data());
653653

654-
if (doprocessMCGen || doprocessOnTheFly) {
654+
if (doprocessMCGen || doprocessOnTheFly || doprocessMC) {
655655
if (cfgFill.cfgFillQA) {
656656
registryQA.add("MCGen/before/pt_gen", "", {HistType::kTH1D, {ptAxis}});
657657
registryQA.add("MCGen/before/phi_eta_vtxZ_gen", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}});
@@ -669,7 +669,7 @@ struct FlowGenericFramework {
669669
registry.add("Efficiency/lambdaFeeddownRecoXi", "; #it{p}_{T}^{#Lambda, reco}; #it{p}_{T}^{#Xi, gen}; Centrality (%)", {HistType::kTHnSparseF, {{ptAxis, axisFeeddownXiPt, centAxis, lambdaFeeddownSpeciesAxis}}});
670670
registry.add("Efficiency/lambdaFeeddownGeneratedXi", "; #it{p}_{T}^{#Xi, gen}; Centrality (%)", {HistType::kTHnSparseF, {{axisFeeddownXiPt, centAxis, lambdaFeeddownSpeciesAxis}}});
671671
}
672-
if (doprocessMCReco || doprocessData || doprocessRun2 || doprocessEfficiency) {
672+
if (doprocessMCReco || doprocessData || doprocessRun2 || doprocessEfficiency || doprocessMC) {
673673
if (cfgFill.cfgFillQA) {
674674
registryQA.add("trackQA/before/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}});
675675
registryQA.add("trackQA/before/pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAXis, dcaZAXis}});
@@ -1682,11 +1682,11 @@ struct FlowGenericFramework {
16821682
return;
16831683
}
16841684

1685-
if (fFCpt->corrDen[1] == 0.) {
1685+
if (flowPtContainer->corrDen[1] == 0.) {
16861686
return;
16871687
}
1688-
double dnx = fFCpt->corrDen[1];
1689-
double mpt = fFCpt->corrNum[1] / dnx;
1688+
double dnx = flowPtContainer->corrDen[1];
1689+
double mpt = flowPtContainer->corrNum[1] / dnx;
16901690
if (std::isnan(mpt)) {
16911691
return;
16921692
}
@@ -1708,6 +1708,7 @@ struct FlowGenericFramework {
17081708
void fillResonanceOutput(FractionSetup setup, const float& centmult, const double& rndm)
17091709
{
17101710
auto& flowContainer = (dt == Gen) ? fFCgen : fFC;
1711+
auto& flowPtContainer = (dt == Gen) ? fFCptGen : fFCpt;
17111712

17121713
if (setup == FractionV02) {
17131714
if (histosNpt[FractionV02][ChargedID]->Integral() <= 0) {
@@ -1812,25 +1813,25 @@ struct FlowGenericFramework {
18121813

18131814
std::vector<double> dns = {dnK0SB1, dnK0Sig, dnK0SB2, dnLambdaSB1, dnLambdaSig, dnLambdaSB2};
18141815

1815-
if (fFCpt->corrDenSub[0][1] == 0. || fFCpt->corrDenSub[1][1] == 0.) {
1816+
if (flowPtContainer->corrDenSub[0][1] == 0. || flowPtContainer->corrDenSub[1][1] == 0.) {
18161817
return;
18171818
}
18181819

18191820
double mpt = 0;
18201821
double dnx = 0;
18211822
if (cfgKinematics.cfgEtaPtPt->first * cfgKinematics.cfgEtaPtPt->second >= 0) {
1822-
if (fFCpt->corrDen[1] == 0.) {
1823+
if (flowPtContainer->corrDen[1] == 0.) {
18231824
return;
18241825
}
1825-
dnx = fFCpt->corrDen[1];
1826-
mpt = fFCpt->corrNum[1] / dnx;
1826+
dnx = flowPtContainer->corrDen[1];
1827+
mpt = flowPtContainer->corrNum[1] / dnx;
18271828
} else {
1828-
if (fFCpt->corrDenSub[0][1] == 0. || fFCpt->corrDenSub[1][1] == 0.) {
1829+
if (flowPtContainer->corrDenSub[0][1] == 0. || flowPtContainer->corrDenSub[1][1] == 0.) {
18291830
return;
18301831
}
1831-
double mptSub1 = fFCpt->corrNumSub[0][1] / fFCpt->corrDenSub[0][1];
1832-
double mptSub2 = fFCpt->corrNumSub[1][1] / fFCpt->corrDenSub[1][1];
1833-
dnx = 0.5 * (fFCpt->corrDenSub[0][1] + fFCpt->corrDenSub[1][1]);
1832+
double mptSub1 = flowPtContainer->corrNumSub[0][1] / flowPtContainer->corrDenSub[0][1];
1833+
double mptSub2 = flowPtContainer->corrNumSub[1][1] / flowPtContainer->corrDenSub[1][1];
1834+
dnx = 0.5 * (flowPtContainer->corrDenSub[0][1] + flowPtContainer->corrDenSub[1][1]);
18341835
mpt = 0.5 * (mptSub1 + mptSub2);
18351836
}
18361837

@@ -1877,7 +1878,8 @@ struct FlowGenericFramework {
18771878
th1sList[run][Cent]->Fill(centrality);
18781879
}
18791880
fGFW->Clear();
1880-
fFCpt->clearVector();
1881+
auto& flowPtContainer = (dt == Gen) ? fFCptGen : fFCpt;
1882+
flowPtContainer->clearVector();
18811883

18821884
float lRandom = fRndm->Rndm();
18831885
// be cautious, this only works for Pb-Pb
@@ -2514,6 +2516,7 @@ struct FlowGenericFramework {
25142516
template <DataType dt, typename TTrack>
25152517
inline void fillPtSums(const TTrack& track, const float& centrality, const double& vtxz)
25162518
{
2519+
auto& flowPtContainer = (dt == Gen) ? fFCptGen : fFCpt;
25172520
double wacc = (dt == Gen) ? 1. : getAcceptance(track, vtxz, 0);
25182521
double weff = (dt == Gen) ? 1. : getEfficiency(track, centrality);
25192522
if (weff < 0) {
@@ -2522,22 +2525,22 @@ struct FlowGenericFramework {
25222525

25232526
// Fill the nominal sums
25242527
if (track.eta() > cfgKinematics.cfgEtaPtPt->first && track.eta() < cfgKinematics.cfgEtaPtPt->second) {
2525-
fFCpt->fill(weff, track.pt());
2528+
flowPtContainer->fill(weff, track.pt());
25262529
}
25272530

25282531
// Fill the subevent sums
25292532
std::size_t index = 0;
25302533
for (const auto& [etamin, etamax] : gfwMemberCache.etagapsPtPt) {
25312534
if (etamin < track.eta() && track.eta() < etamax) {
2532-
fFCpt->fillSub(weff, track.pt(), index);
2535+
flowPtContainer->fillSub(weff, track.pt(), index);
25332536
}
25342537
++index;
25352538
}
25362539
if (!cfgUseGapMethod) {
25372540
std::complex<double> q2p = {weff * wacc * std::cos(2 * track.phi()), weff * wacc * std::sin(2 * track.phi())};
25382541
std::complex<double> q2n = {weff * wacc * std::cos(-2 * track.phi()), weff * wacc * std::sin(-2 * track.phi())};
2539-
fFCpt->fillArray(q2p, q2n, weff * track.pt(), weff);
2540-
fFCpt->fillArray(weff * wacc, weff * wacc, weff, weff);
2542+
flowPtContainer->fillArray(q2p, q2n, weff * track.pt(), weff);
2543+
flowPtContainer->fillArray(weff * wacc, weff * wacc, weff, weff);
25412544
}
25422545
}
25432546

0 commit comments

Comments
 (0)