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
49 changes: 30 additions & 19 deletions PWGLF/Tasks/Nuspex/nucleitpcpbpb.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 PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -57,7 +57,7 @@
static const std::vector<int> particleCharge{1, 1, 1, 1, 2, 2};
const int nBetheParams = 6;
static const std::vector<std::string> betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"};
constexpr double betheBlochDefault[nParticles][nBetheParams]{

Check failure on line 60 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".
{13.611469, 3.598765, -0.021138, 2.039562, 0.651040, 0.09}, // pion
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // proton
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // deuteron
Expand All @@ -66,7 +66,7 @@
{-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}}; // alpha
const int nTrkSettings = 18;
static const std::vector<std::string> trackPIDsettingsNames{"useBBparams", "minITSnCls", "minITSnClscos", "minTPCnCls", "maxTPCchi2", "minTPCchi2", "maxITSchi2", "minRigidity", "maxRigidity", "maxTPCnSigma", "TOFrequiredabove", "minTOFmass", "maxTOFmass", "maxDcaXY", "maxDcaZ", "minITSclsSize", "maxITSclsSize", "minTPCnClsCrossedRows"};
constexpr double trackPIDsettings[nParticles][nTrkSettings]{

Check failure on line 69 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".
{0, 0, 4, 60, 4.0, 0.5, 100, 0.15, 1.2, 2.5, -1, 0, 100, 2., 2., 0., 1000, 70},
{1, 0, 4, 70, 4.0, 0.5, 100, 0.20, 4.0, 3.0, -1, 0, 100, 2., 2., 0., 1000, 70},
{1, 0, 4, 70, 4.0, 0.5, 100, 0.50, 5.0, 3.0, -1, 0, 100, 2., 2., 0., 1000, 70},
Expand Down Expand Up @@ -157,6 +157,8 @@
int mRunNumber, occupancy;
float dBz, momn;
TRandom3 rand;
float He3 = 4;

Check failure on line 160 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
float He4 = 5;

Check failure on line 161 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
//----------------------------------------------------------------------------------------------------------------
void init(InitContext const&)
{
Expand Down Expand Up @@ -257,20 +259,20 @@
continue;
if ((getRigidity(track) < cfgTrackPIDsettings->get(i, "minRigidity") || getRigidity(track) > cfgTrackPIDsettings->get(i, "maxRigidity")) && cfgRigidityCutRequire)
continue;
float pt_momn;
float ptMomn;
setTrackParCov(track, mTrackParCov);
mTrackParCov.setPID(track.pidForTracking());
pt_momn = (i == 4 || i == 5) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
bool insideDCAxy = (std::abs(track.dcaXY()) <= (cfgTrackPIDsettings->get(i, "maxDcaXY") * (0.0105f + 0.0350f / std::pow(pt_momn, 1.1f))));
if ((!(insideDCAxy) || std::abs(track.dcaZ()) > DCAzSigma(pt_momn, cfgTrackPIDsettings->get(i, "maxDcaZ"))) && cfgDCAwithptRequire)
ptMomn = (i == He3 || i == He4) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
bool insideDCAxy = (std::abs(track.dcaXY()) <= (cfgTrackPIDsettings->get(i, "maxDcaXY") * (0.0105f + 0.0350f / std::pow(ptMomn, 1.1f)))); // o2-linter: disable=magic-number (To be checked)
if ((!(insideDCAxy) || std::abs(track.dcaZ()) > DCAzSigma(ptMomn, cfgTrackPIDsettings->get(i, "maxDcaZ"))) && cfgDCAwithptRequire)
continue;
if (track.sign() > 0) {
histos.fill(HIST("histDcaZVsPtData_particle"), pt_momn, track.dcaZ());
histos.fill(HIST("histDcaXYVsPtData_particle"), pt_momn, track.dcaXY());
histos.fill(HIST("histDcaZVsPtData_particle"), ptMomn, track.dcaZ());
histos.fill(HIST("histDcaXYVsPtData_particle"), ptMomn, track.dcaXY());
}
if (track.sign() < 0) {
histos.fill(HIST("histDcaZVsPtData_antiparticle"), pt_momn, track.dcaZ());
histos.fill(HIST("histDcaXYVsPtData_antiparticle"), pt_momn, track.dcaXY());
histos.fill(HIST("histDcaZVsPtData_antiparticle"), ptMomn, track.dcaZ());
histos.fill(HIST("histDcaXYVsPtData_antiparticle"), ptMomn, track.dcaXY());
}
float tpcNsigma = getTPCnSigma(track, primaryParticles.at(i));
if ((std::abs(tpcNsigma) > cfgTrackPIDsettings->get(i, "maxTPCnSigma")) && cfgmaxTPCnSigmaRequire)
Expand All @@ -284,7 +286,7 @@
if (!track.hasTOF() && cfgTrackPIDsettings->get(i, "TOFrequiredabove") < 1)
continue;
float beta{o2::pid::tof::Beta::GetBeta(track)};
float charge{1.f + static_cast<float>(i == 4 || i == 5)};
float charge{1.f + static_cast<float>(i == He3 || i == He4)};
float tofMasses = getRigidity(track) * charge * std::sqrt(1.f / (beta * beta) - 1.f);
if ((getRigidity(track) > cfgTrackPIDsettings->get(i, "TOFrequiredabove") && (tofMasses < cfgTrackPIDsettings->get(i, "minTOFmass") || tofMasses > cfgTrackPIDsettings->get(i, "maxTOFmass"))) && cfgmassRequire)
continue;
Expand Down Expand Up @@ -399,15 +401,15 @@
if (cfgFillnsigma) {
int i = species;
const float tpcNsigma = getTPCnSigma(track, primaryParticles.at(i));
float pt_momn;
float ptMomn;
setTrackParCov(track, mTrackParCov);
mTrackParCov.setPID(track.pidForTracking());
pt_momn = (i == 4 || i == 5) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
ptMomn = (i == He3 || i == He4) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
if (track.sign() > 0) {
hNsigmaPt[2 * species]->Fill(pt_momn, tpcNsigma);
hNsigmaPt[2 * species]->Fill(ptMomn, tpcNsigma);
}
if (track.sign() < 0) {
hNsigmaPt[2 * species]->Fill(pt_momn, tpcNsigma);
hNsigmaPt[2 * species]->Fill(ptMomn, tpcNsigma);
}
}
}
Expand All @@ -422,20 +424,20 @@
float beta{o2::pid::tof::Beta::GetBeta(track)};
if (beta <= 0.f || beta >= 1.f)
return;
float charge = (species == 4 || species == 5) ? 2.f : 1.f;
float charge = (species == He3 || species == He4) ? 2.f : 1.f;
float p = getRigidity(track); // assuming this is the momentum from inner TPC
float massTOF = p * charge * std::sqrt(1.f / (beta * beta) - 1.f);
// get PDG mass
float pdgMass = particleMasses[species];
float massDiff = massTOF - pdgMass;
float pt_momn;
float ptMomn;
setTrackParCov(track, mTrackParCov);
mTrackParCov.setPID(track.pidForTracking());
pt_momn = (species == 4 || species == 5) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
ptMomn = (species == He3 || species == He4) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
if (track.sign() > 0) {
hmass[2 * species]->Fill(pt_momn, massDiff * massDiff);
hmass[2 * species]->Fill(ptMomn, massDiff * massDiff);
} else if (track.sign() < 0) {
hmass[2 * species + 1]->Fill(pt_momn, massDiff * massDiff);
hmass[2 * species + 1]->Fill(ptMomn, massDiff * massDiff);
}
}

Expand Down Expand Up @@ -471,9 +473,18 @@
if (!track.hasITS())
return -999;
o2::aod::ITSResponse itsResponse;
if (particle.name == "pion")
return itsResponse.nSigmaITS<o2::track::PID::Pion>(track);
if (particle.name == "proton")
return itsResponse.nSigmaITS<o2::track::PID::Proton>(track);
if (particle.name == "deuteron")
return itsResponse.nSigmaITS<o2::track::PID::Deuteron>(track);
if (particle.name == "triton")
return itsResponse.nSigmaITS<o2::track::PID::Triton>(track);
if (particle.name == "helion")
return itsResponse.nSigmaITS<o2::track::PID::Helium3>(track);

if (particle.name == "alpha")
return itsResponse.nSigmaITS<o2::track::PID::Alpha>(track);
return -999; // fallback if no match
}

Expand All @@ -499,7 +510,7 @@
bool hePID = track.pidForTracking() == o2::track::PID::Helium3 || track.pidForTracking() == o2::track::PID::Alpha;
return hePID ? track.tpcInnerParam() / 2 : track.tpcInnerParam();
}
float DCAzSigma(double pt, float dcasigma)

Check failure on line 513 in PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
float invPt = 1.f / pt;
return (5.00000e-04 + 8.73690e-03 * invPt + 9.62329e-04 * invPt * invPt) * dcasigma; // o2-linter: disable=magic-number (To be checked)
Expand Down
Loading