Skip to content

Commit 872fde6

Browse files
authored
[PWGLF] adds flag to apply particle weights (#11134)
1 parent 9f7d89f commit 872fde6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ struct UccZdc {
9595
ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100.}, "T0C binning"};
9696

9797
// Configurables Event Selection
98+
Configurable<bool> applyWeights{"applyWeights", false, "apply particle weights?"};
9899
Configurable<bool> isNoCollInTimeRangeStrict{"isNoCollInTimeRangeStrict", true, "isNoCollInTimeRangeStrict?"};
99100
Configurable<bool> isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "isNoCollInTimeRangeStandard?"};
100101
Configurable<bool> isNoCollInRofStrict{"isNoCollInRofStrict", true, "isNoCollInRofStrict?"};
@@ -676,7 +677,11 @@ struct UccZdc {
676677
double weight{efficiency->GetBinContent(efficiency->FindBin(pt))};
677678
if (weight > 0.) {
678679
pTs.emplace_back(pt);
679-
wIs.emplace_back(weight);
680+
if (applyWeights) {
681+
wIs.emplace_back(weight);
682+
} else {
683+
wIs.emplace_back(1.);
684+
}
680685
}
681686
}
682687
}
@@ -787,7 +792,11 @@ struct UccZdc {
787792
double weight{efficiency->GetBinContent(efficiency->FindBin(pt))};
788793
if (weight > 0.) {
789794
pTs.emplace_back(pt);
790-
wIs.emplace_back(weight);
795+
if (applyWeights) {
796+
wIs.emplace_back(weight);
797+
} else {
798+
wIs.emplace_back(1.);
799+
}
791800
}
792801
}
793802
}

0 commit comments

Comments
 (0)