Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions EventFiltering/PWGEM/EMPhotonFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

Check failure on line 11 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
// \brief software trigger for EM photon
// \author daiki.sekihata@cern.ch

Expand Down Expand Up @@ -131,7 +131,7 @@
return false;
}

if (track.pt() < minpt || abs(track.eta()) > maxeta) {
if (track.pt() < minpt || std::fabs(track.eta()) > maxeta) {
return false;
}

Expand Down Expand Up @@ -161,7 +161,7 @@
dca_3d = 999.f;
} else {
float chi2 = (track.dcaXY() * track.dcaXY() * track.cZZ() + track.dcaZ() * track.dcaZ() * track.cYY() - 2. * track.dcaXY() * track.dcaZ() * track.cZY()) / det;
dca_3d = std::sqrt(std::abs(chi2) / 2.);
dca_3d = std::sqrt(std::fabs(chi2) / 2.);
}
if (dca_3d > dca_3d_sigma_max) {
return false;
Expand All @@ -177,23 +177,23 @@
template <uint8_t system, typename TCollisions, typename TPhotons1, typename TPhotons2, typename TPhotons3, typename TV0Legs, typename TDielectrons, typename TEMPrimaryElectrons>
void runFilter(TCollisions const& collisions, TPhotons1 const& photons1, TPhotons2 const& photons2, TPhotons3 const& /*photons3*/, TV0Legs const&, TDielectrons const& dielectrons, TEMPrimaryElectrons const& /*emprimaryelectrons*/)
{
for (auto& collision : collisions) {
for (const auto& collision : collisions) {
mHistManager.fill(HIST("hEventCounter"), 1.);
bool keepEvent[kNtrg]{false};

if (collision.sel8()) {
mHistManager.fill(HIST("hEventCounter"), 2.);
}
if (abs(collision.posZ()) < 10.f) {
if (std::fabs(collision.posZ()) < 10.f) {

Check failure on line 187 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
mHistManager.fill(HIST("hEventCounter"), 3.);
}
if (collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
mHistManager.fill(HIST("hEventCounter"), 4.);
}
if (collision.sel8() && abs(collision.posZ()) < 10.f) {
if (collision.sel8() && std::fabs(collision.posZ()) < 10.f) {

Check failure on line 193 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
mHistManager.fill(HIST("hEventCounter"), 5.);
}
if (collision.sel8() && abs(collision.posZ()) < 10.f && collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
if (collision.sel8() && std::fabs(collision.posZ()) < 10.f && collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {

Check failure on line 196 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
mHistManager.fill(HIST("hEventCounter"), 6.);
}

Expand All @@ -206,7 +206,7 @@
auto photons1_per_coll = photons1.sliceBy(perCollision_pcm, collision.globalIndex());
auto dielectrons_per_coll = dielectrons.sliceBy(perCollision_ee, collision.globalIndex());

for (auto& v0photon : photons1_per_coll) {
for (const auto& v0photon : photons1_per_coll) {
auto pos_sv = v0photon.template posTrack_as<TV0Legs>();
auto ele_sv = v0photon.template negTrack_as<TV0Legs>();
if (!isSelectedSecondary(pos_sv) || !isSelectedSecondary(ele_sv)) {
Expand All @@ -218,7 +218,7 @@
}
} // end of single v0 photon loop

for (auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_coll, dielectrons_per_coll))) {
auto pos_sv = g1.template posTrack_as<TV0Legs>();
auto ele_sv = g1.template negTrack_as<TV0Legs>();
if (!isSelectedSecondary(pos_sv) || !isSelectedSecondary(ele_sv)) {
Expand Down Expand Up @@ -265,11 +265,11 @@
// photons
keepEvent[kPHOS_Photon] |= (clu.e() > ePhot);
// charged clusters above threshold
keepEvent[kPHOS_El] |= (clu.trackdist() < 2. && clu.e() > eEl); // 2: Distance to CPV cluster in sigmas

Check failure on line 268 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// antineutrons
if ((clu.ncell() > 2 && clu.m02() > 0.2 && clu.e() > 0.7 && clu.trackdist() > 2.) &&

Check failure on line 270 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
((clu.e() < 2. && clu.m02() > 4.5 - clu.m20()) ||

Check failure on line 271 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
(clu.e() > 2. && clu.m02() > 4. - clu.m20()))) {

Check failure on line 272 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
nPHOSnbar++;
}

Expand All @@ -282,8 +282,8 @@
if (clu2.trackdist() < 1.) { // select neutral clusters. Disp, Ncell cuts?
continue;
}
double m = pow(clu.e() + clu2.e(), 2) - pow(clu.px() + clu2.px(), 2) -
pow(clu.py() + clu2.py(), 2) - pow(clu.pz() + clu2.pz(), 2);
double m = std::pow(clu.e() + clu2.e(), 2) - std::pow(clu.px() + clu2.px(), 2) -
std::pow(clu.py() + clu2.py(), 2) - std::pow(clu.pz() + clu2.pz(), 2);
if (m > ePair * ePair) {
keepEvent[kPHOS_Pair] |= true;
break;
Expand Down Expand Up @@ -337,7 +337,7 @@
runFilter<system>(collisions, v0photons, nullptr, nullptr, v0legs, dielectrons, emprimaryelectrons);
}

Filter phosCluFilter = (o2::aod::calocluster::e > 0.3f);

Check failure on line 340 in EventFiltering/PWGEM/EMPhotonFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
using CluCandidates = Filtered<o2::aod::CaloClusters>;
void process_PHOS(MyCollisions const& collisions, CluCandidates const& clusters)
{
Expand Down
Loading