Skip to content
Closed
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
62 changes: 45 additions & 17 deletions EventFiltering/PWGLF/nucleiFilter.cxx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// 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 warning 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 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 @@ -102,6 +102,7 @@
Configurable<float> cfgCutDCAxy{"cfgCutDCAxy", 3, "Max DCAxy"};
Configurable<float> cfgCutDCAz{"cfgCutDCAz", 10, "Max DCAz"};
Configurable<float> cfgCutKstar{"cfgCutKstar", 1.f, "Kstar cut for triton femto trigger"};
Configurable<double> cfgCutCosPAheV0{"cfgCutCosPAheV0", 0.99, "CosPA cut for HeV0"};

Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {betheBlochDefault[0], nNuclei, 6, nucleiNames, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for light nuclei"};
Configurable<LabeledArray<double>> cfgMomentumScalingBetheBloch{"cfgMomentumScalingBetheBloch", {bbMomScalingDefault[0], nNuclei, 2, nucleiNames, matterOrNot}, "TPC Bethe-Bloch momentum scaling for light nuclei"};
Expand All @@ -112,16 +113,17 @@

// variable/tool for hypertriton 3body decay
int mRunNumber;
float d_bz;
float mBz;
Service<o2::ccdb::BasicCCDBManager> ccdb;
using TrackCandidates = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TrackSelection, aod::TracksDCA, aod::EvTimeTOFFT0ForTrack, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullDe, aod::pidTPCFullTr, aod::pidTPCFullHe, aod::pidTPCFullAl, aod::pidTOFFullDe, aod::pidTOFFullTr, aod::pidTOFFullHe, aod::pidTOFFullAl>; // FIXME: positio has been changed
o2::aod::pidtofgeneric::TofPidNewCollision<TrackCandidates::iterator> bachelorTOFPID;
o2::base::MatLayerCylSet* lut = nullptr;
o2::vertexing::DCAFitterN<2> fitter2body;
o2::vertexing::DCAFitterN<3> fitter3body;
o2::pid::tof::TOFResoParamsV2 mRespParamsV2;
// configurable for hypertriton 3body decay
struct : ConfigurableGroup {
Configurable<double> d_bz_input{"trgH3L3Body.d_bz", -999, "bz field, -999 is automatic"};
Configurable<double> bFieldInput{"trgH3L3Body.mBz", -999, "bz field, -999 is automatic"};
Configurable<float> minCosPA3body{"trgH3L3Body.minCosPA3body", 0.9995, "minCosPA3body"};
Configurable<float> dcavtxdau{"trgH3L3Body.dcavtxdau", 0.02, "meen DCA among Daughters"};
Configurable<float> dcapiontopv{"trgH3L3Body.dcapiontopv", 0.05, "DCA Pion To PV"};
Expand Down Expand Up @@ -200,6 +202,14 @@
fitter3body.setMaxChi2(1e9);
fitter3body.setUseAbsDCA(true);

fitter2body.setPropagateToPCA(true);
fitter2body.setMaxR(200.);
fitter2body.setMinParamChange(1e-3);
fitter2body.setMinRelChi2Change(0.9);
fitter2body.setMaxDZIni(1e9);
fitter2body.setMaxChi2(1e9);
fitter2body.setUseAbsDCA(true);

ccdb->setURL(trgH3L3Body.ccdburl);
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
Expand All @@ -213,42 +223,42 @@
}

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

Check warning 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(d_bz) > 1e-5) {
grpmag.setL3Current(30000.f / (d_bz / 5.0f));
if (std::fabs(mBz) > 1e-5) {
grpmag.setL3Current(30000.f / (mBz / 5.0f));
}
o2::base::Propagator::initFieldFromGRP(&grpmag);
mRunNumber = bc.runNumber();
return;
}

auto run3grp_timestamp = bc.timestamp();

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp<o2::parameters::GRPObject>(trgH3L3Body.grpPath, run3grp_timestamp);
o2::parameters::GRPMagField* grpmag = 0x0;
if (grpo) {
o2::base::Propagator::initFieldFromGRP(grpo);
// Fetch magnetic field from ccdb for current collision
d_bz = grpo->getNominalL3Field();
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG";
mBz = grpo->getNominalL3Field();
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG";
} else {
grpmag = ccdb->getForTimeStamp<o2::parameters::GRPMagField>(trgH3L3Body.grpmagPath, run3grp_timestamp);
if (!grpmag) {
LOG(fatal) << "Got nullptr from CCDB for path " << trgH3L3Body.grpmagPath << " of object GRPMagField and " << trgH3L3Body.grpPath << " of object GRPObject for timestamp " << run3grp_timestamp;
}
o2::base::Propagator::initFieldFromGRP(grpmag);
// Fetch magnetic field from ccdb for current collision
// d_bz = std::lround(5.f * grpmag->getL3Current() / 30000.f);
d_bz = o2::base::Propagator::Instance()->getNominalBz();
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << d_bz << " kZG";
// mBz = std::lround(5.f * grpmag->getL3Current() / 30000.f);
mBz = o2::base::Propagator::Instance()->getNominalBz();
LOG(info) << "Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG";
}
mRunNumber = bc.runNumber();
// Set magnetic field value once known
fitter3body.setBz(d_bz);
fitter2body.setBz(mBz);
fitter3body.setBz(mBz);

if (trgH3L3Body.useMatCorrType == 2) {

Check warning 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 @@ -362,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 warning 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 @@ -375,7 +385,7 @@
continue;
}

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

Check warning 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 @@ -457,11 +467,29 @@
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))) {
keepEvent[kHeV0] = true;
break;
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;
}

//
Expand Down Expand Up @@ -544,7 +572,7 @@

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

Check warning on line 575 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