Skip to content

Commit 6a20778

Browse files
committed
EventFiltering/PWGEM: fix std
1 parent 33c43b1 commit 6a20778

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

EventFiltering/PWGEM/EMPhotonFilter.cxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct EMPhotonFilter {
131131
return false;
132132
}
133133

134-
if (track.pt() < minpt || abs(track.eta()) > maxeta) {
134+
if (track.pt() < minpt || std::fabs(track.eta()) > maxeta) {
135135
return false;
136136
}
137137

@@ -161,7 +161,7 @@ struct EMPhotonFilter {
161161
dca_3d = 999.f;
162162
} else {
163163
float chi2 = (track.dcaXY() * track.dcaXY() * track.cZZ() + track.dcaZ() * track.dcaZ() * track.cYY() - 2. * track.dcaXY() * track.dcaZ() * track.cZY()) / det;
164-
dca_3d = std::sqrt(std::abs(chi2) / 2.);
164+
dca_3d = std::sqrt(std::fabs(chi2) / 2.);
165165
}
166166
if (dca_3d > dca_3d_sigma_max) {
167167
return false;
@@ -177,23 +177,23 @@ struct EMPhotonFilter {
177177
template <uint8_t system, typename TCollisions, typename TPhotons1, typename TPhotons2, typename TPhotons3, typename TV0Legs, typename TDielectrons, typename TEMPrimaryElectrons>
178178
void runFilter(TCollisions const& collisions, TPhotons1 const& photons1, TPhotons2 const& photons2, TPhotons3 const& /*photons3*/, TV0Legs const&, TDielectrons const& dielectrons, TEMPrimaryElectrons const& /*emprimaryelectrons*/)
179179
{
180-
for (auto& collision : collisions) {
180+
for (const auto& collision : collisions) {
181181
mHistManager.fill(HIST("hEventCounter"), 1.);
182182
bool keepEvent[kNtrg]{false};
183183

184184
if (collision.sel8()) {
185185
mHistManager.fill(HIST("hEventCounter"), 2.);
186186
}
187-
if (abs(collision.posZ()) < 10.f) {
187+
if (std::fabs(collision.posZ()) < 10.f) {
188188
mHistManager.fill(HIST("hEventCounter"), 3.);
189189
}
190190
if (collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
191191
mHistManager.fill(HIST("hEventCounter"), 4.);
192192
}
193-
if (collision.sel8() && abs(collision.posZ()) < 10.f) {
193+
if (collision.sel8() && std::fabs(collision.posZ()) < 10.f) {
194194
mHistManager.fill(HIST("hEventCounter"), 5.);
195195
}
196-
if (collision.sel8() && abs(collision.posZ()) < 10.f && collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
196+
if (collision.sel8() && std::fabs(collision.posZ()) < 10.f && collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
197197
mHistManager.fill(HIST("hEventCounter"), 6.);
198198
}
199199

@@ -206,7 +206,7 @@ struct EMPhotonFilter {
206206
auto photons1_per_coll = photons1.sliceBy(perCollision_pcm, collision.globalIndex());
207207
auto dielectrons_per_coll = dielectrons.sliceBy(perCollision_ee, collision.globalIndex());
208208

209-
for (auto& v0photon : photons1_per_coll) {
209+
for (const auto& v0photon : photons1_per_coll) {
210210
auto pos_sv = v0photon.template posTrack_as<TV0Legs>();
211211
auto ele_sv = v0photon.template negTrack_as<TV0Legs>();
212212
if (!isSelectedSecondary(pos_sv) || !isSelectedSecondary(ele_sv)) {
@@ -218,7 +218,7 @@ struct EMPhotonFilter {
218218
}
219219
} // end of single v0 photon loop
220220

221-
for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
221+
for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
222222
auto pos_sv = g1.template posTrack_as<TV0Legs>();
223223
auto ele_sv = g1.template negTrack_as<TV0Legs>();
224224
if (!isSelectedSecondary(pos_sv) || !isSelectedSecondary(ele_sv)) {
@@ -282,8 +282,8 @@ struct EMPhotonFilter {
282282
if (clu2.trackdist() < 1.) { // select neutral clusters. Disp, Ncell cuts?
283283
continue;
284284
}
285-
double m = pow(clu.e() + clu2.e(), 2) - pow(clu.px() + clu2.px(), 2) -
286-
pow(clu.py() + clu2.py(), 2) - pow(clu.pz() + clu2.pz(), 2);
285+
double m = std::pow(clu.e() + clu2.e(), 2) - std::pow(clu.px() + clu2.px(), 2) -
286+
std::pow(clu.py() + clu2.py(), 2) - std::pow(clu.pz() + clu2.pz(), 2);
287287
if (m > ePair * ePair) {
288288
keepEvent[kPHOS_Pair] |= true;
289289
break;

0 commit comments

Comments
 (0)