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
105 changes: 92 additions & 13 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 @@ -55,6 +55,7 @@
{
static const int nParticles = 6;
static const std::vector<std::string> particleNames{"pion", "proton", "deuteron", "triton", "helion", "alpha"};
static const std::vector<std::string> correctedparticleNames{"helion", "antihelion", "alpha", "antialpha"};
static const std::vector<int> particlePdgCodes{211, 2212, o2::constants::physics::kDeuteron, o2::constants::physics::kTriton, o2::constants::physics::kHelium3, o2::constants::physics::kAlpha};
static const std::vector<double> particleMasses{o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron, o2::constants::physics::MassTriton, o2::constants::physics::MassHelium3, o2::constants::physics::MassAlpha};
static const std::vector<int> particleCharge{1, 1, 1, 1, 2, 2};
Expand Down Expand Up @@ -88,6 +89,15 @@
{1, -5, 4, 1, 1, 2},
{1, -5, 4, 1, 1, 2}};

static const int nfittingparticle = 4;
const int nfittingparameters = 4;
static const std::vector<std::string> trackcorrectionNames{"correctionneed", "a", "b", "c"};
constexpr double ktrackcorrection[nfittingparticle][nfittingparameters]{

Check failure on line 95 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".
{1, 0.464215, 0.195771, 0.0183111}, // He3
{1, 0.464215, 0.195771, 0.0183111}, // anti-He3
{1, 0.00765, 0.503791, -1.10517}, // He4
{1, 0.00765, 0.503791, -1.10517}}; // anti-He4

struct PrimParticles {
TString name;
int pdgCode, charge;
Expand Down Expand Up @@ -145,13 +155,14 @@
Configurable<bool> cfgminGetMeanItsClsSizeRequire{"cfgminGetMeanItsClsSizeRequire", true, "Require minGetMeanItsClsSize Cut"};
Configurable<bool> cfgmaxGetMeanItsClsSizeRequire{"cfgmaxGetMeanItsClsSizeRequire", true, "Require maxGetMeanItsClsSize Cut"};
Configurable<bool> cfgRequirebetaplot{"cfgRequirebetaplot", true, "Require beta plot"};
Configurable<bool> cfgMasscut{"cfgMasscut", true, "Require mass cut on He4 particles"};
Configurable<bool> cfgdcaxynopt{"cfgdcaxynopt", true, "DCA xy cut without pT dependent"};
Configurable<bool> cfgdcaznopt{"cfgdcaznopt", false, "DCA xy cut without pT dependent"};
Configurable<bool> cfgmass2{"cfgmass2", true, "Fill mass square difference"};

Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault[0], nParticles, nBetheParams, particleNames, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for light nuclei"};
Configurable<LabeledArray<double>> cfgTrackPIDsettings{"cfgTrackPIDsettings", {kTrackPIDSettings[0], nParticles, nTrkSettings, particleNames, trackPIDsettingsNames}, "track selection and PID criteria"};
Configurable<LabeledArray<double>> cfgTrackPIDsettings2{"cfgTrackPIDsettings2", {kTrackPIDSettings2[0], nParticles, nTrkSettings2, particleNames, trackPIDsettingsNames2}, "track selection and PID criteria"};
Configurable<LabeledArray<double>> cfgktrackcorrection{"cfgktrackcorrection", {ktrackcorrection[0], nfittingparticle, nfittingparameters, correctedparticleNames, trackcorrectionNames}, "fitting paramters"};
Configurable<bool> cfgFillhspectra{"cfgFillhspectra", true, "fill data sparsh"};
Configurable<bool> cfgFillmass{"cfgFillmass", false, "Fill mass histograms"};
Configurable<bool> cfgFillmassnsigma{"cfgFillmassnsigma", true, "Fill mass vs nsigma histograms"};
Expand All @@ -162,6 +173,10 @@
Configurable<float> cfgZvertex{"cfgZvertex", 10, "Min Z Vertex"};
Configurable<bool> cfgZvertexRequireMC{"cfgZvertexRequireMC", true, "Pos Z cut in MC"};
Configurable<bool> cfgsel8Require{"cfgsel8Require", true, "sel8 cut require"};
Configurable<float> cfgminmassrejection{"cfgminmassrejection", 6.5, "Min side of He3 particle rejection"};
Configurable<float> cfgmaxmassrejection{"cfgmaxmassrejection", 9.138, "Max side of He3 particle rejection"};
Configurable<bool> cfghe3massrejreq{"cfghe3massrejreq", true, "Require mass cut on He4 particles"};

o2::track::TrackParametrizationWithError<float> mTrackParCov;
// Binning configuration
ConfigurableAxis axisMagField{"axisMagField", {10, -10., 10.}, "magnetic field"};
Expand Down Expand Up @@ -225,6 +240,8 @@
histos.add<THnSparse>("hSpectra", " ", HistType::kTHnSparseF, {speciesBitAxis, ptAxis, nsigmaAxis, {5, -2.5, 2.5}, axisCent, axisDCA, axisDCA});
}
histos.add("histeta", "histeta", kTH1F, {axiseta});
histos.add("dcaZ", "dcaZ", kTH2F, {ptAxis, axisDCA});
histos.add("dcaXY", "dcaXY", kTH2F, {ptAxis, axisDCA});
histos.add("Tofsignal", "Tofsignal", kTH2F, {axisRigidity, {4000, 0.2, 1.2, "#beta"}});
histos.add("Tpcsignal", "Tpcsignal", kTH2F, {axisRigidity, axisdEdx});

Expand Down Expand Up @@ -343,6 +360,33 @@
mTrackParCov.setPID(track.pidForTracking());
ptMomn = (i == he3 || i == he4) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();

double a = 0, b = 0, c = 0;

int param = -1;
if (i == he3) {
param = (track.sign() > 0) ? 0 : 1;
} else if (i == he4) {
param = (track.sign() > 0) ? 2 : 3;
}

if (param >= 0) {
a = cfgktrackcorrection->get(param, "a");
b = cfgktrackcorrection->get(param, "b");
c = cfgktrackcorrection->get(param, "c");
}

if (i == he4 && cfgmccorrectionhe4Require) {
ptMomn = ptMomn + a + b * std::exp(c * ptMomn);
}

if (i == he3 && cfgmccorrectionhe4Require) {
int pidGuess = track.pidForTracking();
int antitriton = 6;
if (pidGuess == antitriton) {
ptMomn = ptMomn - a + b * ptMomn - c * ptMomn * ptMomn;
}
}

int sign = (track.sign() > 0) ? 1 : ((track.sign() < 0) ? -1 : 0);

if (std::abs(getRapidity(track, i)) > cfgCutRapidity && cfgRapidityRequire)
Expand Down Expand Up @@ -391,6 +435,9 @@

histos.fill(HIST("Tpcsignal"), getRigidity(track) * track.sign(), track.tpcSignal());

histos.fill(HIST("dcaXY"), ptMomn, track.dcaXY());
histos.fill(HIST("dcaZ"), ptMomn, track.dcaZ());

if (cfgFillhspectra && cfgTrackPIDsettings2->get(i, "fillsparsh") == 1) {

if (i != he4) {
Expand All @@ -411,7 +458,7 @@
float massTOF = p * charge * std::sqrt(1.f / (beta * beta) - 1.f);

// Apply mass cut for he4 (mass^2 around 3.73^2 = 13.9)
if (cfgMasscut && (massTOF * massTOF > 6.5 && massTOF * massTOF < 9.138)) {
if (cfghe3massrejreq && (massTOF * massTOF > cfgminmassrejection && massTOF * massTOF < cfgmaxmassrejection)) {
continue; // Skip if mass cut fails
}

Expand Down Expand Up @@ -685,9 +732,6 @@
if (std::abs(pdg) != std::abs(particlePdgCodes.at(i)))
continue;

if (std::abs(getRapidity(track, i)) > cfgCutRapidity && cfgRapidityRequire)
continue;

float ptReco;
setTrackParCov(track, mTrackParCov);
mTrackParCov.setPID(track.pidForTracking());
Expand All @@ -696,18 +740,36 @@

int particleAnti = (pdg > 0) ? 0 : 1;

if (pdg == -particlePdgCodes.at(5) && cfgmccorrectionhe4Require) {
ptReco = ptReco + 0.00765 + 0.503791 * std::exp(-1.10517 * ptReco);
double a = 0, b = 0, c = 0;

int param = -1;
if (i == he3) {
param = (-particlePdgCodes.at(4) > 0) ? 0 : 1;
} else if (i == he4) {
param = (-particlePdgCodes.at(4) > 0) ? 2 : 3;
}

if (param >= 0) {
a = cfgktrackcorrection->get(param, "a");
b = cfgktrackcorrection->get(param, "b");
c = cfgktrackcorrection->get(param, "c");
}

if (pdg == -particlePdgCodes.at(4) && cfgmccorrectionhe4Require) {
if (std::abs(pdg) == particlePdgCodes.at(5) && cfgmccorrectionhe4Require) {
ptReco = ptReco + a + b * std::exp(c * ptReco);
}

if (std::abs(pdg) == particlePdgCodes.at(4) && cfgmccorrectionhe4Require) {
int pidGuess = track.pidForTracking();
int antitriton = 6;
if (pidGuess == antitriton) {
ptReco = ptReco - 0.464215 + 0.195771 * ptReco - 0.0183111 * ptReco * ptReco;
ptReco = ptReco - a + b * ptReco - c * ptReco * ptReco;
}
}

if (std::abs(getRapidity(track, i)) > cfgCutRapidity && cfgRapidityRequire)
continue;

if (track.tpcNClsFound() < cfgTrackPIDsettings->get(i, "minTPCnCls") && cfgTPCNClsfoundRequire)
continue;
if (((track.tpcNClsCrossedRows() < cfgTrackPIDsettings->get(i, "minTPCnClsCrossedRows")) || track.tpcNClsCrossedRows() < cfgtpcNClsFindable * track.tpcNClsFindable()) && cfgTPCNClsCrossedRowsRequire)
Expand Down Expand Up @@ -752,6 +814,11 @@
ptReco, ptTOF);
}

float tpcNsigma = getTPCnSigma(track, primaryParticles.at(i));
fillhmassnsigma(track, i, tpcNsigma);
histos.fill(HIST("dcaXY"), ptReco, track.dcaXY());
histos.fill(HIST("dcaZ"), ptReco, track.dcaZ());

histos.fill(HIST("Tpcsignal"), getRigidity(track) * track.sign(), track.tpcSignal());

// Fill the requested histograms
Expand Down Expand Up @@ -854,12 +921,24 @@
float pdgMass = particleMasses[species];
float massDiff = 0.0;
if (species != he4) {
massDiff = massTOF - pdgMass;
if (cfgmass2) {
// Compare squared masses
massDiff = massTOF * massTOF - pdgMass * pdgMass;
} else {
// Compare linear masses
massDiff = massTOF - pdgMass;
}
}
if (species == he4) {
if (cfgMasscut && (massTOF * massTOF > 6.5 && massTOF * massTOF < 9.138))
if (cfghe3massrejreq && (massTOF * massTOF > cfgminmassrejection && massTOF * massTOF < cfgmaxmassrejection))
return;
massDiff = massTOF - pdgMass;
if (cfgmass2) {
// Compare squared masses
massDiff = massTOF * massTOF - pdgMass * pdgMass;
} else {
// Compare linear masses
massDiff = massTOF - pdgMass;
}
}

float ptMomn;
Expand Down Expand Up @@ -893,7 +972,7 @@
masssquare = massTOF * massTOF;
}
if (species == he4) {
if (cfgMasscut && (massTOF * massTOF > 6.5 && massTOF * massTOF < 9.138))
if (cfghe3massrejreq && (massTOF * massTOF > cfgminmassrejection && massTOF * massTOF < cfgmaxmassrejection))
return;
masssquare = massTOF * massTOF;
}
Expand Down
Loading