Skip to content

Commit d93ff2c

Browse files
committed
[PWGCF] Fixing track count condition
1 parent 851162d commit d93ff2c

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

PWGCF/EbyEFluctuations/Tasks/radialFlowDecorr.cxx

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ struct RadialFlowDecorr {
187187
Configurable<float> cfgCutPtUpper{"cfgCutPtUpper", 10.0f, "Higher pT cut for inclusive hadron analysis"};
188188
Configurable<float> cfgCutPtUpperPID{"cfgCutPtUpperPID", 6.0f, "Higher pT cut for identified particle analysis"};
189189
Configurable<float> cfgCutEta{"cfgCutEta", 0.8f, "absolute Eta cut"};
190+
Configurable<int> cfgMinTracksPerEtaBin{"cfgMinTracksPerEtaBin", 0, "Min weighted-track sum required in every narrow eta bin for inclusive species (0 = disabled)"};
190191
Configurable<int> cfgNsubsample{"cfgNsubsample", 10, "Number of subsamples"};
191192
Configurable<int> cfgCentralityChoice{"cfgCentralityChoice", 1, "Which centrality estimator? 1-->FT0C, 2-->FT0M, 3-->FDDM, 4-->FV0A"};
192193
Configurable<bool> cfgEvSelNoSameBunchPileup{"cfgEvSelNoSameBunchPileup", true, "Pileup removal"};
@@ -201,7 +202,7 @@ struct RadialFlowDecorr {
201202
Configurable<float> cfgLinPupParam2{"cfgLinPupParam2", 3.0f, "(Lower) Linear Pileup Cut Const"};
202203
Configurable<float> cfgLinPupParam3{"cfgLinPupParam3", 3.0f, "(Lower) Linear Pileup Slope"};
203204

204-
Configurable<int> cfgNchPbMax{"cfgNchPbMax", 4000, "Max Nch range for PbPb collisions"};
205+
Configurable<int> cfgNchPbMax{"cfgNchPbMax", 5000, "Max Nch range for PbPb collisions"};
205206
Configurable<int> cfgNchOMax{"cfgNchOMax", 800, "Max Nch range for OO collisions"};
206207

207208
Configurable<int> cfgSys{"cfgSys", 1, "Efficiency to be used for which system? 1-->PbPb, 2-->NeNe, 3-->OO, 4-->pp"};
@@ -552,6 +553,32 @@ struct RadialFlowDecorr {
552553
return true;
553554
}
554555

556+
template <std::size_t NspT, std::size_t NetaT, std::size_t NkT>
557+
bool hasMinTracksInAllEtaBins(const double (&sw)[NspT][NetaT][NkT])
558+
{
559+
const int minTracks = cfgMinTracksPerEtaBin;
560+
if (minTracks <= 0)
561+
return true;
562+
for (std::size_t ieta = 1; ieta < NetaT; ++ieta) {
563+
if (sw[kInclusiveIdx][ieta][1] < static_cast<double>(minTracks))
564+
return false;
565+
}
566+
return true;
567+
}
568+
569+
template <std::size_t NspT, std::size_t NetaT>
570+
bool hasMinTracksInAllEtaBins(const double (&sw)[NspT][NetaT])
571+
{
572+
const int minTracks = cfgMinTracksPerEtaBin;
573+
if (minTracks <= 0)
574+
return true;
575+
for (std::size_t ieta = 1; ieta < NetaT; ++ieta) {
576+
if (sw[kInclusiveIdx][ieta] < static_cast<double>(minTracks))
577+
return false;
578+
}
579+
return true;
580+
}
581+
555582
template <typename T>
556583
bool isTrackSelected(const T& trk)
557584
{
@@ -1996,6 +2023,9 @@ struct RadialFlowDecorr {
19962023
}
19972024
}
19982025

2026+
if (!hasMinTracksInAllEtaBins(sumWiTruth) || !hasMinTracksInAllEtaBins(sumWiReco))
2027+
return;
2028+
19992029
for (int isp = 0; isp < KNsp; ++isp) {
20002030
histos.fill(HIST("MCReco/Prof_Cent_Nsp_Nchrec"), cent, isp, sumWiReco[isp][0]);
20012031
histos.fill(HIST("MCReco/Prof_Mult_Nsp_Nchrec"), multPV, isp, sumWiReco[isp][0]);
@@ -2352,6 +2382,9 @@ struct RadialFlowDecorr {
23522382
}
23532383
} // trkslice
23542384

2385+
if (!hasMinTracksInAllEtaBins(sumWkTru) || !hasMinTracksInAllEtaBins(sumWkReco))
2386+
return;
2387+
23552388
for (int ieta = 0; ieta < KNEta; ++ieta) {
23562389
const int ibx = state.pmeanTruNchEtabinSpbinStep2->GetXaxis()->FindBin(mcCollision.multNTracksPV());
23572390
const int iby = ieta + 1;
@@ -3200,6 +3233,9 @@ struct RadialFlowDecorr {
32003233
}
32013234
}
32023235

3236+
if (!hasMinTracksInAllEtaBins(sumWi))
3237+
return;
3238+
32033239
for (int isp = 0; isp < KNsp; ++isp) {
32043240
if (sumWi[isp][0] < 1.0f)
32053241
continue;
@@ -3373,6 +3409,9 @@ struct RadialFlowDecorr {
33733409
}
33743410
}
33753411

3412+
if (!hasMinTracksInAllEtaBins(sumwk))
3413+
return;
3414+
33763415
double amplFT0A = 0, amplFT0C = 0;
33773416
if (coll.has_foundFT0()) {
33783417
const auto& ft0 = coll.foundFT0();

0 commit comments

Comments
 (0)