@@ -1670,23 +1670,11 @@ struct FlowGenericFramework {
16701670 return ;
16711671 }
16721672
1673- double mpt = 0 ;
1674- double dnx = 0 ;
1675- if (cfgKinematics.cfgEtaPtPt ->first * cfgKinematics.cfgEtaPtPt ->second >= 0 ) {
1676- if (fFCpt ->corrDen [1 ] == 0 .) {
1677- return ;
1678- }
1679- dnx = fFCpt ->corrDen [1 ];
1680- mpt = fFCpt ->corrNum [1 ] / dnx;
1681- } else {
1682- if (fFCpt ->corrDenSub [0 ][1 ] == 0 . || fFCpt ->corrDenSub [1 ][1 ] == 0 .) {
1683- return ;
1684- }
1685- double mptSub1 = fFCpt ->corrNumSub [0 ][1 ] / fFCpt ->corrDenSub [0 ][1 ];
1686- double mptSub2 = fFCpt ->corrNumSub [1 ][1 ] / fFCpt ->corrDenSub [1 ][1 ];
1687- dnx = 0.5 * (fFCpt ->corrDenSub [0 ][1 ] + fFCpt ->corrDenSub [1 ][1 ]);
1688- mpt = 0.5 * (mptSub1 + mptSub2);
1673+ if (fFCpt ->corrDen [1 ] == 0 .) {
1674+ return ;
16891675 }
1676+ double dnx = fFCpt ->corrDen [1 ];
1677+ double mpt = fFCpt ->corrNum [1 ] / dnx;
16901678 if (std::isnan (mpt)) {
16911679 return ;
16921680 }
@@ -1698,7 +1686,7 @@ struct FlowGenericFramework {
16981686 if (cfgEventWeight.cfgUseMultiplicityFractionWeights ) {
16991687 profileWeight *= dnsV0[l_ind];
17001688 }
1701- (dt == Gen) ? fFCgen ->FillProfile (Form (" %s_pt_%i" , corrconfigsV0.at (l_ind).Head .c_str (), i), centmult, mpt * nptV0[l_ind]->GetBinContent (i) / dnsV0[l_ind], cfgEventWeight.cfgUseMultiplicityFlowWeights ? profileWeight : 1.0 , rndm) : fFC ->FillProfile (Form (" %s_pt_%i" , corrconfigsV0.at (l_ind).Head .c_str (), i), centmult, mpt * nptV0[l_ind]->GetBinContent (i) / dnsV0[l_ind], cfgEventWeight.cfgUseMultiplicityFlowWeights ? profileWeight : 1.0 , rndm);
1689+ (dt == Gen) ? fFCgen ->FillProfile (Form (" %s_pt_%i" , corrconfigsV0.at (l_ind).Head .c_str (), i), centmult, mpt * nptV0[l_ind]->GetBinContent (i) / dnsV0[l_ind], cfgEventWeight.cfgUsePtCorrWeights ? profileWeight : 1.0 , rndm) : fFC ->FillProfile (Form (" %s_pt_%i" , corrconfigsV0.at (l_ind).Head .c_str (), i), centmult, mpt * nptV0[l_ind]->GetBinContent (i) / dnsV0[l_ind], cfgEventWeight.cfgUsePtCorrWeights ? profileWeight : 1.0 , rndm);
17021690 }
17031691 }
17041692 }
@@ -1838,12 +1826,16 @@ struct FlowGenericFramework {
18381826
18391827 for (uint l_ind = 4 ; l_ind < corrconfigsV0.size (); ++l_ind) {
18401828 for (int i = 1 ; i <= fPtAxis ->GetNbins (); i++) {
1841- if (dns[l_ind - 4 ] > 0 ) {
1842- if (cfgEventWeight.cfgUseMultiplicityFractionWeights ) {
1843- dnx *= dns[l_ind - 4 ];
1844- }
1829+ if (dns[l_ind - 4 ] <= 0 ) {
1830+ continue ;
1831+ }
1832+ double profileWeight = dnx;
1833+ if (cfgEventWeight.cfgUseMultiplicityFractionWeights ) {
1834+ profileWeight *= dns[l_ind - 4 ];
18451835 }
1846- (dt == Gen) ? fFCgen ->FillProfile (Form (" %s_pt_%i" , corrconfigsV0.at (l_ind).Head .c_str (), i), centmult, mpt * histosResoNpt[FractionV0][l_ind - 4 ]->GetBinContent (i) / dns[l_ind - 4 ], 1.0 , rndm) : fFC ->FillProfile (Form (" %s_pt_%i" , corrconfigsV0.at (l_ind).Head .c_str (), i), centmult, mpt * histosResoNpt[FractionV0][l_ind - 4 ]->GetBinContent (i) / dns[l_ind - 4 ], 1.0 , rndm);
1836+ const double value = mpt * histosResoNpt[FractionV0][l_ind - 4 ]->GetBinContent (i) / dns[l_ind - 4 ];
1837+ const double weight = cfgEventWeight.cfgUsePtCorrWeights ? profileWeight : 1.0 ;
1838+ (dt == Gen) ? fFCgen ->FillProfile (Form (" %s_pt_%i" , corrconfigsV0.at (l_ind).Head .c_str (), i), centmult, value, weight, rndm) : fFC ->FillProfile (Form (" %s_pt_%i" , corrconfigsV0.at (l_ind).Head .c_str (), i), centmult, value, weight, rndm);
18471839 }
18481840 }
18491841 }
0 commit comments