Skip to content

Commit 0dab1b0

Browse files
authored
Update nucleitpcpbpb.cxx
1 parent 85b7c1a commit 0dab1b0

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ struct NucleitpcPbPb {
162162
{
163163
mRunNumber = 0;
164164
dBz = 0;
165+
int He3 = 4;
166+
int He4 = 5;
165167
rand.SetSeed(0);
166168
ccdb->setURL(ccdbUrl);
167169
ccdb->setCaching(true);
@@ -257,20 +259,20 @@ struct NucleitpcPbPb {
257259
continue;
258260
if ((getRigidity(track) < cfgTrackPIDsettings->get(i, "minRigidity") || getRigidity(track) > cfgTrackPIDsettings->get(i, "maxRigidity")) && cfgRigidityCutRequire)
259261
continue;
260-
float pt_momn;
262+
float ptMomn;
261263
setTrackParCov(track, mTrackParCov);
262264
mTrackParCov.setPID(track.pidForTracking());
263-
pt_momn = (i == 4 || i == 5) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
264-
bool insideDCAxy = (std::abs(track.dcaXY()) <= (cfgTrackPIDsettings->get(i, "maxDcaXY") * (0.0105f + 0.0350f / std::pow(pt_momn, 1.1f))));
265-
if ((!(insideDCAxy) || std::abs(track.dcaZ()) > DCAzSigma(pt_momn, cfgTrackPIDsettings->get(i, "maxDcaZ"))) && cfgDCAwithptRequire)
265+
ptMomn = (i == He3 || i == He4) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
266+
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)
267+
if ((!(insideDCAxy) || std::abs(track.dcaZ()) > DCAzSigma(ptMomn, cfgTrackPIDsettings->get(i, "maxDcaZ"))) && cfgDCAwithptRequire)
266268
continue;
267269
if (track.sign() > 0) {
268-
histos.fill(HIST("histDcaZVsPtData_particle"), pt_momn, track.dcaZ());
269-
histos.fill(HIST("histDcaXYVsPtData_particle"), pt_momn, track.dcaXY());
270+
histos.fill(HIST("histDcaZVsPtData_particle"), ptMomn, track.dcaZ());
271+
histos.fill(HIST("histDcaXYVsPtData_particle"), ptMomn, track.dcaXY());
270272
}
271273
if (track.sign() < 0) {
272-
histos.fill(HIST("histDcaZVsPtData_antiparticle"), pt_momn, track.dcaZ());
273-
histos.fill(HIST("histDcaXYVsPtData_antiparticle"), pt_momn, track.dcaXY());
274+
histos.fill(HIST("histDcaZVsPtData_antiparticle"), ptMomn, track.dcaZ());
275+
histos.fill(HIST("histDcaXYVsPtData_antiparticle"), ptMomn, track.dcaXY());
274276
}
275277
float tpcNsigma = getTPCnSigma(track, primaryParticles.at(i));
276278
if ((std::abs(tpcNsigma) > cfgTrackPIDsettings->get(i, "maxTPCnSigma")) && cfgmaxTPCnSigmaRequire)
@@ -284,7 +286,7 @@ struct NucleitpcPbPb {
284286
if (!track.hasTOF() && cfgTrackPIDsettings->get(i, "TOFrequiredabove") < 1)
285287
continue;
286288
float beta{o2::pid::tof::Beta::GetBeta(track)};
287-
float charge{1.f + static_cast<float>(i == 4 || i == 5)};
289+
float charge{1.f + static_cast<float>(i == He3 || i == He4)};
288290
float tofMasses = getRigidity(track) * charge * std::sqrt(1.f / (beta * beta) - 1.f);
289291
if ((getRigidity(track) > cfgTrackPIDsettings->get(i, "TOFrequiredabove") && (tofMasses < cfgTrackPIDsettings->get(i, "minTOFmass") || tofMasses > cfgTrackPIDsettings->get(i, "maxTOFmass"))) && cfgmassRequire)
290292
continue;
@@ -399,15 +401,15 @@ struct NucleitpcPbPb {
399401
if (cfgFillnsigma) {
400402
int i = species;
401403
const float tpcNsigma = getTPCnSigma(track, primaryParticles.at(i));
402-
float pt_momn;
404+
float ptMomn;
403405
setTrackParCov(track, mTrackParCov);
404406
mTrackParCov.setPID(track.pidForTracking());
405-
pt_momn = (i == 4 || i == 5) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
407+
ptMomn = (i == He3 || i == He4) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
406408
if (track.sign() > 0) {
407-
hNsigmaPt[2 * species]->Fill(pt_momn, tpcNsigma);
409+
hNsigmaPt[2 * species]->Fill(ptMomn, tpcNsigma);
408410
}
409411
if (track.sign() < 0) {
410-
hNsigmaPt[2 * species]->Fill(pt_momn, tpcNsigma);
412+
hNsigmaPt[2 * species]->Fill(ptMomn, tpcNsigma);
411413
}
412414
}
413415
}
@@ -422,20 +424,20 @@ struct NucleitpcPbPb {
422424
float beta{o2::pid::tof::Beta::GetBeta(track)};
423425
if (beta <= 0.f || beta >= 1.f)
424426
return;
425-
float charge = (species == 4 || species == 5) ? 2.f : 1.f;
427+
float charge = (species == He3 || species == He4) ? 2.f : 1.f;
426428
float p = getRigidity(track); // assuming this is the momentum from inner TPC
427429
float massTOF = p * charge * std::sqrt(1.f / (beta * beta) - 1.f);
428430
// get PDG mass
429431
float pdgMass = particleMasses[species];
430432
float massDiff = massTOF - pdgMass;
431-
float pt_momn;
433+
float ptMomn;
432434
setTrackParCov(track, mTrackParCov);
433435
mTrackParCov.setPID(track.pidForTracking());
434-
pt_momn = (species == 4 || species == 5) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
436+
ptMomn = (species == He3 || species == He4) ? 2 * mTrackParCov.getPt() : mTrackParCov.getPt();
435437
if (track.sign() > 0) {
436-
hmass[2 * species]->Fill(pt_momn, massDiff * massDiff);
438+
hmass[2 * species]->Fill(ptMomn, massDiff * massDiff);
437439
} else if (track.sign() < 0) {
438-
hmass[2 * species + 1]->Fill(pt_momn, massDiff * massDiff);
440+
hmass[2 * species + 1]->Fill(ptMomn, massDiff * massDiff);
439441
}
440442
}
441443

@@ -471,9 +473,18 @@ struct NucleitpcPbPb {
471473
if (!track.hasITS())
472474
return -999;
473475
o2::aod::ITSResponse itsResponse;
476+
if (particle.name == "pion")
477+
return itsResponse.nSigmaITS<o2::track::PID::Pion>(track);
478+
if (particle.name == "proton")
479+
return itsResponse.nSigmaITS<o2::track::PID::Proton>(track);
480+
if (particle.name == "deuteron")
481+
return itsResponse.nSigmaITS<o2::track::PID::Deuteron>(track);
482+
if (particle.name == "triton")
483+
return itsResponse.nSigmaITS<o2::track::PID::Triton>(track);
474484
if (particle.name == "helion")
475485
return itsResponse.nSigmaITS<o2::track::PID::Helium3>(track);
476-
486+
if (particle.name == "alpha")
487+
return itsResponse.nSigmaITS<o2::track::PID::Alpha>(track);
477488
return -999; // fallback if no match
478489
}
479490

0 commit comments

Comments
 (0)