Skip to content

Commit a3e0dc5

Browse files
authored
[PWGLF] Update nucleitpcpbpb.cxx (#12782)
1 parent 7a7f485 commit a3e0dc5

File tree

1 file changed

+84
-44
lines changed

1 file changed

+84
-44
lines changed

PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

Lines changed: 84 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,25 @@ constexpr double kBetheBlochDefault[nParticles][nBetheParams]{
6767
{5.393020, 7.859534, 0.004048, 2.323197, 1.609307, 0.09}, // triton
6868
{-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}, // helion
6969
{-126.557359, -0.858569, 1.111643, 1.210323, 2.656374, 0.09}}; // alpha
70-
const int nTrkSettings = 14;
71-
static const std::vector<std::string> trackPIDsettingsNames{"useBBparams", "minITSnCls", "minITSnClscos", "minTPCnCls", "maxTPCchi2", "minTPCchi2", "maxITSchi2", "maxTPCnSigma", "maxDcaXY", "maxDcaZ", "minITSclsSize", "maxITSclsSize", "minTPCnClsCrossedRows", "minReqClusterITSib"};
70+
const int nTrkSettings = 13;
71+
static const std::vector<std::string> trackPIDsettingsNames{"useBBparams", "minITSnCls", "minITSnClscos", "minTPCnCls", "maxTPCchi2", "minTPCchi2", "maxITSchi2", "maxTPCnSigma", "maxDcaXY", "maxDcaZ", "minITSclsSize", "minTPCnClsCrossedRows", "minReqClusterITSib"};
7272
constexpr double kTrackPIDSettings[nParticles][nTrkSettings]{
73-
{0, 0, 4, 60, 4.0, 0.5, 100, 2.5, 2., 2., 0., 1000, 70, 1},
74-
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 1000, 70, 1},
75-
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 1000, 70, 1},
76-
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 1000, 70, 1},
77-
{1, 0, 4, 75, 4.0, 0.5, 100, 5.0, 2., 2., 0., 1000, 70, 1},
78-
{1, 0, 4, 70, 4.0, 0.5, 100, 5.0, 2., 2., 0., 1000, 70, 1}};
73+
{0, 0, 4, 60, 4.0, 0.5, 100, 2.5, 2., 2., 0., 70, 1},
74+
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
75+
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
76+
{1, 0, 4, 70, 4.0, 0.5, 100, 3.0, 2., 2., 0., 70, 1},
77+
{1, 0, 4, 75, 4.0, 0.5, 100, 5.0, 2., 2., 0., 70, 1},
78+
{1, 0, 4, 70, 4.0, 0.5, 100, 5.0, 2., 2., 0., 70, 1}};
7979

80-
const int nTrkSettings2 = 4;
81-
static const std::vector<std::string> trackPIDsettingsNames2{"useITSnsigma", "minITSnsigma", "maxITSnsigma", "fillsparsh"};
80+
const int nTrkSettings2 = 6;
81+
static const std::vector<std::string> trackPIDsettingsNames2{"useITSnsigma", "minITSnsigma", "maxITSnsigma", "fillsparsh", "useTPCnsigmaTOF", "maxTPCnsigmaTOF"};
8282
constexpr double kTrackPIDSettings2[nParticles][nTrkSettings2]{
83-
{1, -5, 4, 0},
84-
{1, -5, 4, 0},
85-
{1, -5, 4, 0},
86-
{1, -5, 4, 1},
87-
{1, -5, 4, 1},
88-
{1, -5, 4, 1}};
83+
{1, -5, 4, 0, 1, 2},
84+
{1, -5, 4, 0, 1, 2},
85+
{1, -5, 4, 0, 1, 2},
86+
{1, -5, 4, 1, 1, 2},
87+
{1, -5, 4, 1, 1, 2},
88+
{1, -5, 4, 1, 1, 2}};
8989

9090
struct PrimParticles {
9191
TString name;
@@ -104,6 +104,7 @@ struct PrimParticles {
104104
}; // struct PrimParticles
105105
//----------------------------------------------------------------------------------------------------------------
106106
std::vector<std::shared_ptr<TH2>> hmass;
107+
std::vector<std::shared_ptr<TH2>> hmassnsigma;
107108
} // namespace
108109
//----------------------------------------------------------------------------------------------------------------
109110
struct NucleitpcPbPb {
@@ -142,26 +143,24 @@ struct NucleitpcPbPb {
142143
Configurable<bool> cfgminGetMeanItsClsSizeRequire{"cfgminGetMeanItsClsSizeRequire", true, "Require minGetMeanItsClsSize Cut"};
143144
Configurable<bool> cfgmaxGetMeanItsClsSizeRequire{"cfgmaxGetMeanItsClsSizeRequire", true, "Require maxGetMeanItsClsSize Cut"};
144145
Configurable<bool> cfgDCAwithptRequire{"cfgDCAwithptRequire", true, "Require DCA cuts with pt dependance"};
145-
Configurable<bool> cfgDCAnopt{"cfgDCAnopt", true, "Require DCA cuts without pt dependance"};
146146
Configurable<bool> cfgRequirebetaplot{"cfgRequirebetaplot", true, "Require beta plot"};
147147

148148
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault[0], nParticles, nBetheParams, particleNames, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for light nuclei"};
149149
Configurable<LabeledArray<double>> cfgTrackPIDsettings{"cfgTrackPIDsettings", {kTrackPIDSettings[0], nParticles, nTrkSettings, particleNames, trackPIDsettingsNames}, "track selection and PID criteria"};
150150
Configurable<LabeledArray<double>> cfgTrackPIDsettings2{"cfgTrackPIDsettings2", {kTrackPIDSettings2[0], nParticles, nTrkSettings2, particleNames, trackPIDsettingsNames2}, "track selection and PID criteria"};
151151
Configurable<bool> cfgFillhspectra{"cfgFillhspectra", true, "fill data sparsh"};
152152
Configurable<bool> cfgFillmass{"cfgFillmass", false, "Fill mass histograms"};
153+
Configurable<bool> cfgFillmassnsigma{"cfgFillmassnsigma", true, "Fill mass vs nsigma histograms"};
153154
Configurable<float> centcut{"centcut", 80.0f, "centrality cut"};
154155
Configurable<float> cfgCutRapidity{"cfgCutRapidity", 0.5f, "Rapidity range"};
155156
Configurable<float> cfgZvertex{"cfgZvertex", 10, "Min Z Vertex"};
156157
Configurable<bool> cfgZvertexRequire{"cfgZvertexRequire", true, "Pos Z cut require"};
157158
Configurable<bool> cfgZvertexRequireMC{"cfgZvertexRequireMC", true, "Pos Z cut require for generated particles"};
158159
Configurable<bool> cfgsel8Require{"cfgsel8Require", true, "sel8 cut require"};
159-
Configurable<float> cfgtpcNClsFound{"cfgtpcNClsFound", 100.0f, "min. no. of tpcNClsFound"};
160-
Configurable<float> cfgitsNCls{"cfgitsNCls", 2.0f, "min. no. of itsNCls"};
161160
o2::track::TrackParametrizationWithError<float> mTrackParCov;
162161
// Binning configuration
163162
ConfigurableAxis axisMagField{"axisMagField", {10, -10., 10.}, "magnetic field"};
164-
ConfigurableAxis axisNev{"axisNev", {3, 0., 3.}, "Number of events"};
163+
ConfigurableAxis axisNev{"axisNev", {5, 0., 5.}, "Number of events"};
165164
ConfigurableAxis axisRigidity{"axisRigidity", {4000, -10., 10.}, "#it{p}^{TPC}/#it{z}"};
166165
ConfigurableAxis axisdEdx{"axisdEdx", {4000, 0, 4000}, "d#it{E}/d#it{x}"};
167166
ConfigurableAxis axisCent{"axisCent", {100, 0, 100}, "centrality"};
@@ -171,13 +170,9 @@ struct NucleitpcPbPb {
171170
ConfigurableAxis axiseta{"axiseta", {100, -1, 1}, "eta"};
172171
ConfigurableAxis axisrapidity{"axisrapidity", {100, -2, 2}, "rapidity"};
173172
ConfigurableAxis axismass{"axismass", {100, -10, 10}, "mass^{2}"};
174-
ConfigurableAxis nsigmaAxis{"nsigmaAxis", {160, -20, 20}, "n#sigma_{#pi^{+}}"};
173+
ConfigurableAxis nsigmaAxis{"nsigmaAxis", {160, -10, 10}, "n#sigma_{#pi^{+}}"};
175174
ConfigurableAxis speciesBitAxis{"speciesBitAxis", {8, -0.5, 7.5}, "particle type 0: pion, 1: proton, 2: deuteron, 3: triton, 4:He3, 5:He4"};
176175
ConfigurableAxis axisDCA{"axisDCA", {400, -10., 10.}, "DCA axis"};
177-
ConfigurableAxis axisTPCcls{"axisTPCcls", {400, 0., 200.}, "TPCcls axis"};
178-
ConfigurableAxis axisITScls{"axisITScls", {400, 0., 200.}, "ITScls axis"};
179-
ConfigurableAxis axisITSchi2{"axisITSchi2", {400, 0., 100.}, "ITSchi2 axis"};
180-
ConfigurableAxis axisTPCchi2{"axisTPCchi2", {400, 0., 100.}, "TPCchi2 axis"};
181176

182177
// CCDB
183178
Service<o2::ccdb::BasicCCDBManager> ccdb;
@@ -224,6 +219,7 @@ struct NucleitpcPbPb {
224219
histos.add("Tpcsignal", "Tpcsignal", kTH2F, {axisRigidity, axisdEdx});
225220

226221
hmass.resize(2 * nParticles + 2);
222+
hmassnsigma.resize(2 * nParticles + 2);
227223

228224
for (int i = 0; i < nParticles; i++) {
229225
TString histName = primaryParticles[i].name;
@@ -232,8 +228,15 @@ struct NucleitpcPbPb {
232228
hmass[2 * i + 1] = histos.add<TH2>(Form("histmass_ptanti/histmass_%s", histName.Data()), ";p_T{TPC} (GeV/#it{c}); mass^{2}", HistType::kTH2F, {ptAxis, axismass});
233229
}
234230
}
231+
for (int i = 0; i < nParticles; i++) {
232+
TString histName = primaryParticles[i].name;
233+
if (cfgFillmassnsigma) {
234+
hmassnsigma[2 * i] = histos.add<TH2>(Form("histmass_nsigma/histmass_%s", histName.Data()), ";nsigma; mass^{2}", HistType::kTH2F, {nsigmaAxis, axismass});
235+
hmassnsigma[2 * i + 1] = histos.add<TH2>(Form("histmass_nsigmaanti/histmass_%s", histName.Data()), ";p_T{TPC} (GeV/#it{c}); mass^{2}", HistType::kTH2F, {nsigmaAxis, axismass});
236+
}
237+
}
235238

236-
histos.add<THnSparse>("hSpectra", " ", HistType::kTHnSparseF, {speciesBitAxis, ptAxis, nsigmaAxis, {5, -2.5, 2.5}, axisCent, axisRigidity, axisdEdx, axisDCA, axisDCA, nsigmaAxis});
239+
histos.add<THnSparse>("hSpectra", " ", HistType::kTHnSparseF, {speciesBitAxis, ptAxis, nsigmaAxis, {5, -2.5, 2.5}, axisCent, axisDCA, axisDCA, axisrapidity, axiseta});
237240

238241
if (doprocessMC) {
239242
histomc.add("histVtxZgen", "histVtxZgen", kTH1F, {axisVtxZ});
@@ -253,8 +256,11 @@ struct NucleitpcPbPb {
253256
histomc.add("histPtRecoHe4", "histPtgenHe4", kTH1F, {ptAxis});
254257
histomc.add("histPtRecoAntiHe4", "histPtgenAntiHe4", kTH1F, {ptAxis});
255258
histomc.add("histDeltaPtVsPtGen", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10}, {1000, -0.5, 0.5, "p_{T}(reco) - p_{T}(gen);p_{T}(reco)"}});
259+
histomc.add("histDeltaPtVsPtGenanti", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10}, {1000, -0.5, 0.5, "p_{T}(reco) - p_{T}(gen);p_{T}(reco)"}});
256260
histomc.add("histPIDtrack", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10, "p_{T}(reco)"}, {9, -0.5, 8.5, "p_{T}(reco) - p_{T}(gen)"}});
261+
histomc.add("histPIDtrackanti", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10, "p_{T}(reco)"}, {9, -0.5, 8.5, "p_{T}(reco) - p_{T}(gen)"}});
257262
histomc.add("histDeltaPtVsPtGenHe4", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10}, {1000, -0.5, 0.5, "p_{T}(reco) - p_{T}(gen);p_{T}(reco)"}});
263+
histomc.add("histDeltaPtVsPtGenHe4anti", " delta pt vs pt rec", HistType::kTH2F, {{1000, 0, 10}, {1000, -0.5, 0.5, "p_{T}(reco) - p_{T}(gen);p_{T}(reco)"}});
258264
}
259265
}
260266
//----------------------------------------------------------------------------------------------------------------
@@ -309,7 +315,7 @@ struct NucleitpcPbPb {
309315
}
310316
if (track.sign() < 0) {
311317
sign = -1;
312-
} // <- This redeclares a new local variable!
318+
}
313319
if (std::abs(getRapidity(track, i)) > cfgCutRapidity && cfgRapidityRequire)
314320
continue;
315321
if (track.tpcNClsFound() < cfgTrackPIDsettings->get(i, "minTPCnCls") && cfgTPCNClsfoundRequire)
@@ -331,8 +337,6 @@ struct NucleitpcPbPb {
331337
continue;
332338
if (getMeanItsClsSize(track) < cfgTrackPIDsettings->get(i, "minITSclsSize") && cfgminGetMeanItsClsSizeRequire)
333339
continue;
334-
if (getMeanItsClsSize(track) > cfgTrackPIDsettings->get(i, "maxITSclsSize") && cfgmaxGetMeanItsClsSizeRequire)
335-
continue;
336340

337341
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)
338342
if ((!(insideDCAxy) || std::abs(track.dcaZ()) > dcazSigma(ptMomn, cfgTrackPIDsettings->get(i, "maxDcaZ"))) && cfgDCAwithptRequire)
@@ -342,23 +346,24 @@ struct NucleitpcPbPb {
342346
if ((std::abs(tpcNsigma) > cfgTrackPIDsettings->get(i, "maxTPCnSigma")) && cfgmaxTPCnSigmaRequire)
343347
continue;
344348
float itsSigma = getITSnSigma(track, primaryParticles.at(i));
345-
346349
if (itsSigma < cfgTrackPIDsettings2->get(i, "minITSnsigma") && cfgTrackPIDsettings2->get(i, "useITSnsigma") < 1)
347350
continue;
348351
if (itsSigma > cfgTrackPIDsettings2->get(i, "maxITSnsigma") && cfgTrackPIDsettings2->get(i, "useITSnsigma") < 1)
349352
continue;
353+
histos.fill(HIST("Tpcsignal"), getRigidity(track) * track.sign(), track.tpcSignal());
350354

351-
fillhmass(track, i);
352355
if (cfgFillhspectra && cfgTrackPIDsettings2->get(i, "fillsparsh") == 1) {
353-
histos.fill(HIST("hSpectra"), i, ptMomn, tpcNsigma, sign, collision.centFT0C(), getRigidity(track) * track.sign(), track.tpcSignal(), track.dcaZ(), track.dcaXY(), itsSigma);
356+
histos.fill(HIST("hSpectra"), i, ptMomn, tpcNsigma, sign, collision.centFT0C(), track.dcaZ(), track.dcaXY(), getRapidity(track, i), track.eta());
354357
}
358+
fillhmassnsigma(track, i, tpcNsigma);
359+
if ((std::abs(tpcNsigma) > cfgTrackPIDsettings2->get(i, "maxTPCnsigmaTOF")) && cfgTrackPIDsettings2->get(i, "useTPCnsigmaTOF") < 1)
360+
continue;
361+
fillhmass(track, i);
362+
355363
if (cfgRequirebetaplot) {
356364
histos.fill(HIST("Tofsignal"), getRigidity(track) * track.sign(), o2::pid::tof::Beta::GetBeta(track));
357365
}
358366
}
359-
if (track.tpcNClsFound() > cfgtpcNClsFound || track.itsNCls() > cfgitsNCls) {
360-
histos.fill(HIST("Tpcsignal"), getRigidity(track) * track.sign(), track.tpcSignal());
361-
}
362367
histos.fill(HIST("histeta"), track.eta());
363368
} // track loop
364369
///////////////////////////////////////////////
@@ -420,7 +425,6 @@ struct NucleitpcPbPb {
420425
if (std::abs(collision.posZ()) > cfgZvertex && cfgZvertexRequire)
421426
continue;
422427
collPassedEvSel = collision.sel8();
423-
occupancy = collision.trackOccupancyInTimeRange();
424428
if (!collPassedEvSel && cfgsel8Require)
425429
continue;
426430
histomc.fill(HIST("histNevReco"), 1.5);
@@ -429,6 +433,7 @@ struct NucleitpcPbPb {
429433
histomc.fill(HIST("histCentFT0MReco"), collision.centFT0M());
430434
if (collision.centFT0C() > centcut)
431435
continue;
436+
histomc.fill(HIST("histNevReco"), 2.5);
432437
if (removeITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))
433438
continue;
434439
if (removeNoSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup))
@@ -478,7 +483,7 @@ struct NucleitpcPbPb {
478483
}
479484
if (track.sign() < 0) {
480485
sign = -1;
481-
} // <- This redeclares a new local variable!
486+
}
482487
if (std::abs(getRapidity(track, i)) > cfgCutRapidity && cfgRapidityRequire)
483488
continue;
484489
if (track.tpcNClsFound() < cfgTrackPIDsettings->get(i, "minTPCnCls") && cfgTPCNClsfoundRequire)
@@ -500,8 +505,6 @@ struct NucleitpcPbPb {
500505
continue;
501506
if (getMeanItsClsSize(track) < cfgTrackPIDsettings->get(i, "minITSclsSize") && cfgminGetMeanItsClsSizeRequire)
502507
continue;
503-
if (getMeanItsClsSize(track) > cfgTrackPIDsettings->get(i, "maxITSclsSize") && cfgmaxGetMeanItsClsSizeRequire)
504-
continue;
505508

506509
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)
507510
if ((!(insideDCAxy) || std::abs(track.dcaZ()) > dcazSigma(ptMomn, cfgTrackPIDsettings->get(i, "maxDcaZ"))) && cfgDCAwithptRequire)
@@ -511,16 +514,20 @@ struct NucleitpcPbPb {
511514
if ((std::abs(tpcNsigma) > cfgTrackPIDsettings->get(i, "maxTPCnSigma")) && cfgmaxTPCnSigmaRequire)
512515
continue;
513516
float itsSigma = getITSnSigma(track, primaryParticles.at(i));
514-
515517
if (itsSigma < cfgTrackPIDsettings2->get(i, "minITSnsigma") && cfgTrackPIDsettings2->get(i, "useITSnsigma") < 1)
516518
continue;
517519
if (itsSigma > cfgTrackPIDsettings2->get(i, "maxITSnsigma") && cfgTrackPIDsettings2->get(i, "useITSnsigma") < 1)
518520
continue;
521+
histos.fill(HIST("Tpcsignal"), getRigidity(track) * track.sign(), track.tpcSignal());
519522

520-
fillhmass(track, i);
521523
if (cfgFillhspectra && cfgTrackPIDsettings2->get(i, "fillsparsh") == 1) {
522-
histos.fill(HIST("hSpectra"), i, ptMomn, tpcNsigma, sign, collision.centFT0C(), getRigidity(track) * track.sign(), track.tpcSignal(), track.dcaZ(), track.dcaXY(), itsSigma);
524+
histos.fill(HIST("hSpectra"), i, ptMomn, tpcNsigma, sign, collision.centFT0C(), track.dcaZ(), track.dcaXY(), getRapidity(track, i), track.eta());
523525
}
526+
fillhmassnsigma(track, i, tpcNsigma);
527+
if ((std::abs(tpcNsigma) > cfgTrackPIDsettings2->get(i, "maxTPCnsigmaTOF")) && cfgTrackPIDsettings2->get(i, "useTPCnsigmaTOF") < 1)
528+
continue;
529+
fillhmass(track, i);
530+
524531
if (cfgRequirebetaplot) {
525532
histos.fill(HIST("Tofsignal"), getRigidity(track) * track.sign(), o2::pid::tof::Beta::GetBeta(track));
526533
}
@@ -545,12 +552,21 @@ struct NucleitpcPbPb {
545552
float deltaPt = ptReco - ptGen;
546553

547554
if (pdg == -particlePdgCodes.at(4)) {
555+
histomc.fill(HIST("histDeltaPtVsPtGenanti"), ptReco, deltaPt);
556+
histomc.fill(HIST("histPIDtrackanti"), ptReco, track.pidForTracking());
557+
}
558+
if (pdg == particlePdgCodes.at(4)) {
548559
histomc.fill(HIST("histDeltaPtVsPtGen"), ptReco, deltaPt);
549560
histomc.fill(HIST("histPIDtrack"), ptReco, track.pidForTracking());
550561
}
562+
551563
if (pdg == -particlePdgCodes.at(5)) {
564+
histomc.fill(HIST("histDeltaPtVsPtGenHe4anti"), ptReco, deltaPt);
565+
}
566+
if (pdg == particlePdgCodes.at(5)) {
552567
histomc.fill(HIST("histDeltaPtVsPtGenHe4"), ptReco, deltaPt);
553568
}
569+
554570
if (pdg == particlePdgCodes.at(4)) {
555571
histomc.fill(HIST("histPtRecoHe3"), ptReco);
556572
} else if (pdg == -particlePdgCodes.at(4)) {
@@ -628,14 +644,15 @@ struct NucleitpcPbPb {
628644
if (!track.hasTOF() || !cfgFillmass)
629645
return;
630646
float beta{o2::pid::tof::Beta::GetBeta(track)};
631-
if (beta <= 0.f || beta >= 1.f)
647+
const float eps = 1e-6f;
648+
if (beta < eps || beta > 1.0f - eps)
632649
return;
633650
float charge = (species == he3 || species == he4) ? 2.f : 1.f;
634651
float p = getRigidity(track); // assuming this is the momentum from inner TPC
635652
float massTOF = p * charge * std::sqrt(1.f / (beta * beta) - 1.f);
636653
// get PDG mass
637654
float pdgMass = particleMasses[species];
638-
float massDiff = massTOF - pdgMass;
655+
float massDiff = massTOF * massTOF - pdgMass * pdgMass;
639656
float ptMomn;
640657
setTrackParCov(track, mTrackParCov);
641658
mTrackParCov.setPID(track.pidForTracking());
@@ -648,6 +665,29 @@ struct NucleitpcPbPb {
648665
}
649666
//----------------------------------------------------------------------------------------------------------------
650667
template <class T>
668+
void fillhmassnsigma(T const& track, int species, float sigma)
669+
{
670+
if (!track.hasTOF() || !cfgFillmassnsigma)
671+
return;
672+
float beta{o2::pid::tof::Beta::GetBeta(track)};
673+
const float eps = 1e-6f;
674+
if (beta < eps || beta > 1.0f - eps)
675+
return;
676+
float charge = (species == he3 || species == he4) ? 2.f : 1.f;
677+
float p = getRigidity(track); // assuming this is the momentum from inner TPC
678+
float massTOF = p * charge * std::sqrt(1.f / (beta * beta) - 1.f);
679+
// get PDG mass
680+
float pdgMass = particleMasses[species];
681+
float massDiff = massTOF * massTOF - pdgMass * pdgMass;
682+
683+
if (track.sign() > 0) {
684+
hmassnsigma[2 * species]->Fill(sigma, massDiff);
685+
} else if (track.sign() < 0) {
686+
hmassnsigma[2 * species + 1]->Fill(sigma, massDiff);
687+
}
688+
}
689+
//----------------------------------------------------------------------------------------------------------------
690+
template <class T>
651691
float getTPCnSigma(T const& track, PrimParticles& particle)
652692
{
653693
const float rigidity = getRigidity(track);

0 commit comments

Comments
 (0)