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
129 changes: 71 additions & 58 deletions EventFiltering/PWGLF/nucleiFilter.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in EventFiltering/PWGLF/nucleiFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -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 failure on line 11 in EventFiltering/PWGLF/nucleiFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure 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 failure 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 @@ -223,7 +223,7 @@
}

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

Check failure on line 226 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.
mBz = trgH3L3Body.bFieldInput;
o2::parameters::GRPMagField grpmag;
if (std::fabs(mBz) > 1e-5) {
Expand Down Expand Up @@ -258,7 +258,7 @@
fitter2body.setBz(mBz);
fitter3body.setBz(mBz);

if (trgH3L3Body.useMatCorrType == 2) {

Check failure on line 261 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 @@ -372,7 +372,7 @@
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 failure on line 375 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 @@ -385,7 +385,7 @@
continue;
}

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

Check failure on line 388 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 @@ -431,73 +431,86 @@
h2TPCsignal[iN]->Fill(track.sign() * track.tpcInnerParam() * fixTPCrigidity, track.tpcSignal());
}
}
//
// fill QA histograms
//
qaHists.fill(HIST("fTPCsignal"), track.sign() * track.tpcInnerParam() * fixTPCrigidity, track.tpcSignal());

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()) > cfgCutEta) {
} // end loop over tracks

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()) > cfgCutEta) {
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 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;
}
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;
}
}
}

for (const auto& v0 : v0s) {
const auto& posTrack = v0.posTrack_as<TrackCandidates>();
const auto& negTrack = v0.negTrack_as<TrackCandidates>();
if ((posTrack.itsNCls() < cfgCutNclusITS || posTrack.tpcNClsFound() < cfgCutNclusTPC) &&
(negTrack.itsNCls() < cfgCutNclusITS || negTrack.tpcNClsFound() < cfgCutNclusTPC)) {
continue;
}
float nSigmas[2]{
cfgBetheBlochParams->get(2, 5u) > 0.f ? getNsigma(posTrack, 2, 0) : posTrack.tpcNSigmaHe(),
cfgBetheBlochParams->get(2, 5u) > 0.f ? getNsigma(negTrack, 2, 1) : negTrack.tpcNSigmaHe()};
if ((nSigmas[0] < cfgCutsPID->get(2, 0u) || nSigmas[0] > cfgCutsPID->get(2, 1u)) &&
(nSigmas[1] < cfgCutsPID->get(2, 0u) || nSigmas[1] > cfgCutsPID->get(2, 1u))) {
continue;
}
int n2bodyVtx = fitter2body.process(getTrackParCov(posTrack), getTrackParCov(negTrack));
if (n2bodyVtx == 0) {
continue;
}
auto vtxXYZ = fitter2body.getPCACandidate();
o2::gpu::gpustd::array<float, 3> mom = {0.};
vtxXYZ[0] -= collision.posX();
vtxXYZ[1] -= collision.posY();
vtxXYZ[2] -= collision.posZ();
auto momTrackParCov = fitter2body.createParentTrackPar();
momTrackParCov.getPxPyPzGlo(mom);
double cosPA = (vtxXYZ[0] * mom[0] + vtxXYZ[1] * mom[1] + vtxXYZ[2] * mom[2]) /
std::sqrt((vtxXYZ[0] * vtxXYZ[0] + vtxXYZ[1] * vtxXYZ[1] + vtxXYZ[2] * vtxXYZ[2]) *
(mom[0] * mom[0] + mom[1] * mom[1] + mom[2] * mom[2]));
if (cosPA < cfgCutCosPAheV0) {
continue;
}
keepEvent[kHeV0] = true;
break;
for (const auto& v0 : v0s) {
const auto& posTrack = v0.posTrack_as<TrackCandidates>();
const auto& negTrack = v0.negTrack_as<TrackCandidates>();
if ((posTrack.itsNCls() < cfgCutNclusITS || posTrack.tpcNClsFound() < cfgCutNclusTPC) &&
(negTrack.itsNCls() < cfgCutNclusITS || negTrack.tpcNClsFound() < cfgCutNclusTPC)) {
continue;
}
float nSigmas[2]{
cfgBetheBlochParams->get(2, 5u) > 0.f ? getNsigma(posTrack, 2, 0) : posTrack.tpcNSigmaHe(),
cfgBetheBlochParams->get(2, 5u) > 0.f ? getNsigma(negTrack, 2, 1) : negTrack.tpcNSigmaHe()};

//
// fill QA histograms
//
qaHists.fill(HIST("fTPCsignal"), track.sign() * track.tpcInnerParam() * fixTPCrigidity, track.tpcSignal());
bool isHe3 = nSigmas[0] > cfgCutsPID->get(2, 0u) && nSigmas[0] < cfgCutsPID->get(2, 1u);
bool isAntiHe3 = nSigmas[1] > cfgCutsPID->get(2, 0u) && nSigmas[1] < cfgCutsPID->get(2, 1u);
if (!isHe3 && !isAntiHe3) {
continue;
}
auto& he3Track = isHe3 ? posTrack : negTrack;
auto& piTrack = isHe3 ? negTrack : posTrack;

} // end loop over tracks
int n2bodyVtx = fitter2body.process(getTrackParCov(he3Track), getTrackParCov(piTrack));
if (n2bodyVtx == 0) {
continue;
}
auto vtxXYZ = fitter2body.getPCACandidate();
vtxXYZ[0] -= collision.posX();
vtxXYZ[1] -= collision.posY();
vtxXYZ[2] -= collision.posZ();

o2::gpu::gpustd::array<float, 3> momHe3 = {0.};
o2::gpu::gpustd::array<float, 3> momPi = {0.};
o2::gpu::gpustd::array<float, 3> momTot = {0.};
auto& hePropTrack = fitter2body.getTrack(0);
auto& piPropTrack = fitter2body.getTrack(1);
hePropTrack.getPxPyPzGlo(momHe3);
piPropTrack.getPxPyPzGlo(momPi);
for (int i = 0; i < 3; ++i) {

Check failure on line 501 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.
momHe3[i] *= 2;
momTot[i] = momHe3[i] + momPi[i];
}
double cosPA = (vtxXYZ[0] * momTot[0] + vtxXYZ[1] * momTot[1] + vtxXYZ[2] * momTot[2]) /
std::sqrt((vtxXYZ[0] * vtxXYZ[0] + vtxXYZ[1] * vtxXYZ[1] + vtxXYZ[2] * vtxXYZ[2]) *
(momTot[0] * momTot[0] + momTot[1] * momTot[1] + momTot[2] * momTot[2]));
if (cosPA < cfgCutCosPAheV0) {
continue;
}
keepEvent[kHeV0] = true;
break;
}

// fH3L3Body trigger
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
Expand Down Expand Up @@ -572,7 +585,7 @@

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

Check failure on line 588 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
Loading