Skip to content

Commit e391675

Browse files
committed
Select MC charged particles v2
1 parent 212630c commit e391675

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct UccZdc {
6969

7070
static constexpr float kCollEnergy{2.68};
7171
static constexpr float kZero{0.};
72-
static constexpr float minCharge{3.f};
72+
static constexpr float kMinCharge{3.f};
7373

7474
// Configurables Event Selection
7575
Configurable<bool> isNoCollInTimeRangeStrict{"isNoCollInTimeRangeStrict", true, "use isNoCollInTimeRangeStrict?"};
@@ -711,6 +711,7 @@ struct UccZdc {
711711

712712
std::vector<float> pTs;
713713
std::vector<float> vecFD;
714+
std::vector<float> vecEff;
714715
std::vector<float> vecOneOverEff;
715716

716717
// Calculates the Nch multiplicity
@@ -748,7 +749,7 @@ struct UccZdc {
748749
// Fill vectors for [pT] measurement
749750
pTs.clear();
750751
vecFD.clear();
751-
vecOneOverEff.clear();
752+
vecEff.clear();
752753
for (const auto& track : tracks) {
753754
// Track Selection
754755
if (!track.isGlobalTrack()) {
@@ -772,7 +773,7 @@ struct UccZdc {
772773
}
773774
if ((effValue > 0.) && (fdValue > 0.)) {
774775
pTs.emplace_back(pt);
775-
vecOneOverEff.emplace_back(1. / effValue);
776+
vecEff.emplace_back(effValue);
776777
vecFD.emplace_back(fdValue);
777778
}
778779
// To calculate event-averaged <pt>
@@ -781,7 +782,7 @@ struct UccZdc {
781782

782783
double p1, p2, p3, p4, w1, w2, w3, w4;
783784
p1 = p2 = p3 = p4 = w1 = w2 = w3 = w4 = 0.0;
784-
getPTpowers(pTs, vecOneOverEff, vecFD, p1, w1, p2, w2, p3, w3, p4, w4);
785+
getPTpowers(pTs, vecEff, vecFD, p1, w1, p2, w2, p3, w3, p4, w4);
785786

786787
// EbE one-particle pT correlation
787788
double oneParCorr{p1 / w1};
@@ -932,7 +933,7 @@ struct UccZdc {
932933
}
933934

934935
// Is it a charged particle?
935-
if (std::abs(charge) < minCharge) {
936+
if (std::abs(charge) < kMinCharge) {
936937
continue;
937938
}
938939
// Is it a primary particle?
@@ -1006,7 +1007,7 @@ struct UccZdc {
10061007
}
10071008

10081009
// Is it a charged particle?
1009-
if (std::abs(charge) < minCharge) {
1010+
if (std::abs(charge) < kMinCharge) {
10101011
continue;
10111012
}
10121013
// Is it a primary particle?
@@ -1094,7 +1095,7 @@ struct UccZdc {
10941095
}
10951096

10961097
// Is it a charged particle?
1097-
if (std::abs(charge) < minCharge) {
1098+
if (std::abs(charge) < kMinCharge) {
10981099
continue;
10991100
}
11001101
// All charged particles
@@ -1139,7 +1140,7 @@ struct UccZdc {
11391140
}
11401141

11411142
// Is it a charged particle?
1142-
if (std::abs(charge) < minCharge) {
1143+
if (std::abs(charge) < kMinCharge) {
11431144
continue;
11441145
}
11451146
// Is it a primary particle?
@@ -1176,7 +1177,7 @@ struct UccZdc {
11761177
const double pTi{pTs.at(i)};
11771178
const double eFFi{vecEff.at(i)};
11781179
const double fDi{vecFD.at(i)};
1179-
const double wEighti{pow(eFFi, -1.) * fDi};
1180+
const double wEighti{std::pow(eFFi, -1.) * fDi};
11801181
pOne += wEighti * pTi;
11811182
wOne += wEighti;
11821183
pTwo += std::pow(wEighti * pTi, 2.);

0 commit comments

Comments
 (0)