Skip to content
Closed
Show file tree
Hide file tree
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
43 changes: 37 additions & 6 deletions EventFiltering/PWGLF/nucleiFilter.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.
// O2 includes

Check warning on line 11 in EventFiltering/PWGLF/nucleiFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check warning on line 11 in EventFiltering/PWGLF/nucleiFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include <cmath>
#include <string>
Expand Down Expand Up @@ -56,7 +56,7 @@
static const std::vector<std::string> matterOrNot{"Matter", "Antimatter"};
static const std::vector<std::string> nucleiNames{"H2", "H3", "Helium"};
static const std::vector<std::string> hypernucleiNames{"H3L"}; // 3-body decay case
static const std::vector<std::string> columnsNames{o2::aod::filtering::H2::columnLabel(), o2::aod::filtering::He::columnLabel(), o2::aod::filtering::HeV0::columnLabel(), o2::aod::filtering::H3L3Body::columnLabel(), o2::aod::filtering::Tracked3Body::columnLabel(), o2::aod::filtering::ITSmildIonisation::columnLabel(), o2::aod::filtering::ITSextremeIonisation::columnLabel()};
static const std::vector<std::string> columnsNames{o2::aod::filtering::H2::columnLabel(), o2::aod::filtering::He::columnLabel(), o2::aod::filtering::HeV0::columnLabel(), o2::aod::filtering::TritonFemto::columnLabel(), o2::aod::filtering::H3L3Body::columnLabel(), o2::aod::filtering::Tracked3Body::columnLabel(), o2::aod::filtering::ITSmildIonisation::columnLabel(), o2::aod::filtering::ITSextremeIonisation::columnLabel()};
static const std::vector<std::string> cutsNames{
"TPCnSigmaMin", "TPCnSigmaMax", "TOFnSigmaMin", "TOFnSigmaMax", "TOFpidStartPt"};
constexpr double betheBlochDefault[nNuclei][6]{
Expand Down Expand Up @@ -210,7 +210,7 @@
}

// In case override, don't proceed, please - no CCDB access required
if (trgH3L3Body.d_bz_input > -990) {

Check warning on line 213 in EventFiltering/PWGLF/nucleiFilter.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.
d_bz = trgH3L3Body.d_bz_input;
fitter3body.setBz(d_bz);
o2::parameters::GRPMagField grpmag;
Expand Down Expand Up @@ -245,7 +245,7 @@
// Set magnetic field value once known
fitter3body.setBz(d_bz);

if (trgH3L3Body.useMatCorrType == 2) {

Check warning on line 248 in EventFiltering/PWGLF/nucleiFilter.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.
// setMatLUT only after magfield has been initalized
// (setMatLUT has implicit and problematic init field call if not)
o2::base::Propagator::Instance()->setMatLUT(lut);
Expand Down Expand Up @@ -316,6 +316,7 @@
kH2 = 0,
kHe,
kHeV0,
kTritonFemto,
kH3L3Body,
kTracked3Body,
kITSmildIonisation,
Expand All @@ -333,7 +334,7 @@
hProcessedEvents->Fill(0);
//
if (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) {
tags(keepEvent[kH2], keepEvent[kHe], keepEvent[kHeV0], keepEvent[kH3L3Body], keepEvent[kTracked3Body], keepEvent[kITSmildIonisation], keepEvent[kITSextremeIonisation]);
tags(keepEvent[kH2], keepEvent[kHe], keepEvent[kHeV0], keepEvent[kTritonFemto], keepEvent[kH3L3Body], keepEvent[kTracked3Body], keepEvent[kITSmildIonisation], keepEvent[kITSextremeIonisation]);
return;
}

Expand All @@ -344,12 +345,13 @@
{charges[2] * cfgMomentumScalingBetheBloch->get(2u, 0u) / masses[2], charges[2] * cfgMomentumScalingBetheBloch->get(2u, 1u) / masses[2]}};

constexpr int nucleusIndex[nNuclei]{kH2, -1, kHe}; /// remap for nuclei triggers
std::vector<int> he3indices;
std::vector<int> h3indices, he3indices;
std::vector<ROOT::Math::PtEtaPhiMVector> h3vectors;
for (auto& track : tracks) { // start loop over tracks

Check warning on line 350 in EventFiltering/PWGLF/nucleiFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (track.itsNCls() >= cfgCutNclusExtremeIonisationITS) {
double avgClsSize{0.};
double cosL{std::sqrt(1. / (1. + track.tgl() * track.tgl()))};
for (int iC{0}; iC < 7; ++iC) {

Check warning on line 354 in EventFiltering/PWGLF/nucleiFilter.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.
avgClsSize += track.itsClsSizeInLayer(iC);
}
avgClsSize = avgClsSize * cosL / track.itsNCls();
Expand All @@ -362,7 +364,7 @@
continue;
}

if (std::abs(track.tpcNSigmaDe()) < 5) {

Check warning on line 367 in EventFiltering/PWGLF/nucleiFilter.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.
qaHists.fill(HIST("fDeuTOFNsigma"), track.p() * track.sign(), track.tofNSigmaDe());
}

Expand Down Expand Up @@ -398,15 +400,44 @@
if (track.p() > cfgCutsPID->get(iN, 4u) && (nSigmaTOF[iN] < cfgCutsPID->get(iN, 2u) || nSigmaTOF[iN] > cfgCutsPID->get(iN, 3u))) {
continue;
}
if (iN == 1 && passesDCAselection) {
h3indices.push_back(track.globalIndex());
h3vectors.emplace_back(track.pt(), track.eta(), track.phi(), masses[iN]);
}
if (iN == 2) {

Check warning on line 407 in EventFiltering/PWGLF/nucleiFilter.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.
he3indices.push_back(track.globalIndex());
}
if (nucleusIndex[iN] < 0) {
continue;
}
keepEvent[nucleusIndex[iN]] = passesDCAselection;
if (keepEvent[nucleusIndex[iN]]) {
h2TPCsignal[iN]->Fill(track.sign() * track.tpcInnerParam() * fixTPCrigidity, track.tpcSignal());
}
if (iN == 2) {
he3indices.push_back(track.globalIndex());
}

for (const auto& track : tracks) {
if (track.itsNCls() < cfgCutNclusITS ||
track.tpcNClsFound() < cfgCutNclusTPC ||
std::abs(track.dcaXY()) > cfgCutDCAxy ||
std::abs(track.dcaZ()) > cfgCutDCAz ||
std::abs(track.eta()) > 0.9) {

Check warning on line 424 in EventFiltering/PWGLF/nucleiFilter.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.
continue;
}
const ROOT::Math::PtEtaPhiMVector trackVector(track.pt(), track.eta(), track.phi(), constants::physics::MassPiMinus);
for (size_t iH3{0}; iH3 < h3vectors.size(); ++iH3) {
if (h3indices[iH3] == track.globalIndex()) {
continue;
}
const auto& h3vector = h3vectors[iH3];
auto pivector = trackVector;
auto cm = h3vector + trackVector;
const ROOT::Math::Boost boost(cm.BoostToCM());
boost(pivector);
if (pivector.p() < cfgCutKstar) {
keepEvent[kTritonFemto] = true;
break;
}
}
}

Expand Down Expand Up @@ -502,7 +533,7 @@

std::array<float, 3> pos = {0.};
const auto& vtxXYZ = fitter3body.getPCACandidate();
for (int i = 0; i < 3; i++) {

Check warning on line 536 in EventFiltering/PWGLF/nucleiFilter.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.
pos[i] = vtxXYZ[i];
}

Expand Down Expand Up @@ -582,7 +613,7 @@
}
}

tags(keepEvent[kH2], keepEvent[kHe], keepEvent[kHeV0], keepEvent[kH3L3Body], keepEvent[kTracked3Body], keepEvent[kITSmildIonisation], keepEvent[kITSextremeIonisation]);
tags(keepEvent[kH2], keepEvent[kHe], keepEvent[kHeV0], keepEvent[kTritonFemto], keepEvent[kH3L3Body], keepEvent[kTracked3Body], keepEvent[kITSmildIonisation], keepEvent[kITSextremeIonisation]);
}
};

Expand Down
3 changes: 2 additions & 1 deletion EventFiltering/filterTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace filtering
DECLARE_SOA_COLUMN(H2, hasH2, bool); //! deuteron trigger for the helium normalisation (to be downscaled)
DECLARE_SOA_COLUMN(He, hasHe, bool); //! helium
DECLARE_SOA_COLUMN(HeV0, hasHeV0, bool); //! V0 containing a V0
DECLARE_SOA_COLUMN(TritonFemto, hasTritonFemto, bool); //! Triton hadron femtoscopy
DECLARE_SOA_COLUMN(H3L3Body, hasH3L3Body, bool); //! hypertriton 3body
DECLARE_SOA_COLUMN(ITSextremeIonisation, hasITSextremeIonisation, bool); //! ITS extreme ionisation
DECLARE_SOA_COLUMN(ITSmildIonisation, hasITSmildIonisation, bool); //! ITS mild ionisation (normalisation of the extreme ionisation), to be downscaled
Expand Down Expand Up @@ -216,7 +217,7 @@ DECLARE_SOA_COLUMN(BCend, hasBCend, uint64_t); //! CEFP bcrange

// nuclei
DECLARE_SOA_TABLE(NucleiFilters, "AOD", "NucleiFilters", //!
filtering::H2, filtering::He, filtering::HeV0, filtering::H3L3Body, filtering::Tracked3Body, filtering::ITSmildIonisation,
filtering::H2, filtering::He, filtering::HeV0, filtering::TritonFemto, filtering::H3L3Body, filtering::Tracked3Body, filtering::ITSmildIonisation,
filtering::ITSextremeIonisation);
using NucleiFilter = NucleiFilters::iterator;

Expand Down
Loading