Skip to content

Commit 3044659

Browse files
authored
[PWGCF,PWGHF] Add ITS PID to femtodream (#9317)
1 parent d4cefc0 commit 3044659

File tree

11 files changed

+270
-83
lines changed

11 files changed

+270
-83
lines changed

PWGCF/DataModel/FemtoDerived.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ DECLARE_SOA_COLUMN(TOFNSigmaPr, tofNSigmaPr, float); //! Nsigma separation with
175175
DECLARE_SOA_COLUMN(TOFNSigmaDe, tofNSigmaDe, float); //! Nsigma separation with the TOF detector for deuteron
176176
DECLARE_SOA_COLUMN(TOFNSigmaTr, tofNSigmaTr, float); //! Nsigma separation with the TOF detector for triton
177177
DECLARE_SOA_COLUMN(TOFNSigmaHe, tofNSigmaHe, float); //! Nsigma separation with the TOF detector for helium3
178+
DECLARE_SOA_COLUMN(ITSSignal, itsSignal, float);
179+
DECLARE_SOA_COLUMN(ITSNSigmaEl, itsNSigmaEl, float); //! Nsigma separation with the Its detector for electron
180+
DECLARE_SOA_COLUMN(ITSNSigmaPi, itsNSigmaPi, float); //! Nsigma separation with the Its detector for pion
181+
DECLARE_SOA_COLUMN(ITSNSigmaKa, itsNSigmaKa, float); //! Nsigma separation with the Its detector for kaon
182+
DECLARE_SOA_COLUMN(ITSNSigmaPr, itsNSigmaPr, float); //! Nsigma separation with the Its detector for proton
183+
DECLARE_SOA_COLUMN(ITSNSigmaDe, itsNSigmaDe, float); //! Nsigma separation with the Its detector for deuteron
184+
DECLARE_SOA_COLUMN(ITSNSigmaTr, itsNSigmaTr, float); //! Nsigma separation with the Its detector for triton
185+
DECLARE_SOA_COLUMN(ITSNSigmaHe, itsNSigmaHe, float); //! Nsigma separation with the Its detector for helium3
178186
DECLARE_SOA_COLUMN(DaughDCA, daughDCA, float); //! DCA between daughters
179187
DECLARE_SOA_COLUMN(TransRadius, transRadius, float); //! Transverse radius of the decay vertex
180188
DECLARE_SOA_COLUMN(DecayVtxX, decayVtxX, float); //! X position of the decay vertex
@@ -359,6 +367,14 @@ DECLARE_SOA_TABLE_STAGED(FDExtParticles, "FDEXTPARTICLE",
359367
femtodreamparticle::TOFNSigmaDe,
360368
femtodreamparticle::TOFNSigmaTr,
361369
femtodreamparticle::TOFNSigmaHe,
370+
femtodreamparticle::ITSSignal,
371+
femtodreamparticle::ITSNSigmaEl,
372+
femtodreamparticle::ITSNSigmaPi,
373+
femtodreamparticle::ITSNSigmaKa,
374+
femtodreamparticle::ITSNSigmaPr,
375+
femtodreamparticle::ITSNSigmaDe,
376+
femtodreamparticle::ITSNSigmaTr,
377+
femtodreamparticle::ITSNSigmaHe,
362378
femtodreamparticle::DaughDCA,
363379
femtodreamparticle::TransRadius,
364380
femtodreamparticle::DecayVtxX,
@@ -457,3 +473,4 @@ using MixingHash = MixingHashes::iterator;
457473
} // namespace o2::aod
458474

459475
#endif // PWGCF_DATAMODEL_FEMTODERIVED_H_
476+
//

PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class FemtoDreamParticleHisto
7272

7373
// comment
7474
template <o2::aod::femtodreamMCparticle::MCType mc, typename T>
75-
void init_debug(std::string folderName, T& multAxis, T& multPercentileAxis, T& pTAxis, T& etaAxis, T& phiAxis, T& tempFitVarAxis, T& dcazAxis, T& NsigmaTPCAxis, T& NsigmaTOFAxis, T& NsigmaTPCTOFAxis, T& /*TPCclustersAxis*/, bool correlatedPlots)
75+
void init_debug(std::string folderName, T& multAxis, T& multPercentileAxis, T& pTAxis, T& etaAxis, T& phiAxis, T& tempFitVarAxis, T& dcazAxis, T& NsigmaTPCAxis, T& NsigmaTOFAxis, T& NsigmaTPCTOFAxis, T& NsigmaITSAxis, bool correlatedPlots)
7676
{
7777

7878
std::string folderSuffix = static_cast<std::string>(o2::aod::femtodreamMCparticle::MCTypeName[mc]).c_str();
@@ -117,6 +117,14 @@ class FemtoDreamParticleHisto
117117
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_d").c_str(), "n#sigma_{comb}^{d}", kTH2F, {pTAxis, NsigmaTPCTOFAxis});
118118
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_tr").c_str(), "n#sigma_{comb}^{tr}", kTH2F, {pTAxis, NsigmaTPCTOFAxis});
119119
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_he3").c_str(), "n#sigma_{comb}^{he3}", kTH2F, {pTAxis, NsigmaTPCTOFAxis});
120+
mHistogramRegistry->add((folderName + folderSuffix + "/ITSSignal").c_str(), "<cluster size>x<cos#lambda>", kTH2F, {pTAxis, NsigmaITSAxis});
121+
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_el").c_str(), "n#sigma_{ITS}^{e}", kTH2F, {pTAxis, NsigmaITSAxis});
122+
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_pi").c_str(), "n#sigma_{ITS}^{#pi}", kTH2F, {pTAxis, NsigmaITSAxis});
123+
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_K").c_str(), "n#sigma_{ITS}^{K}", kTH2F, {pTAxis, NsigmaITSAxis});
124+
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_p").c_str(), "n#sigma_{ITS}^{p}", kTH2F, {pTAxis, NsigmaITSAxis});
125+
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_d").c_str(), "n#sigma_{ITS}^{d}", kTH2F, {pTAxis, NsigmaITSAxis});
126+
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_tr").c_str(), "n#sigma_{ITS}^{tr}", kTH2F, {pTAxis, NsigmaITSAxis});
127+
mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaITS_he3").c_str(), "n#sigma_{ITS}^{he3}", kTH2F, {pTAxis, NsigmaITSAxis});
120128
if (correlatedPlots) {
121129
mHistogramRegistry->add((folderName + folderSuffix + "/HighDcorrelator").c_str(), "", kTHnSparseF, {multAxis, multPercentileAxis, pTAxis, etaAxis, phiAxis, tempFitVarAxis, dcazAxis, NsigmaTPCAxis, NsigmaTOFAxis});
122130
}
@@ -217,7 +225,7 @@ class FemtoDreamParticleHisto
217225
/// \param tempFitVarBins binning of the tempFitVar (DCA_xy in case of tracks, CPA in case of V0s, etc.)
218226
/// \param isMC add Monte Carlo truth histograms to the output file
219227
template <typename T>
220-
void init(HistogramRegistry* registry, T& MultBins, T& PercentileBins, T& pTBins, T& etaBins, T& phiBins, T& tempFitVarBins, T& NsigmaTPCBins, T& NsigmaTOFBins, T& NsigmaTPCTOFBins, T& TPCclustersBins, T& InvMassBins, bool isMC, int pdgCode, bool isDebug = false, bool correlatedPlots = false)
228+
void init(HistogramRegistry* registry, T& MultBins, T& PercentileBins, T& pTBins, T& etaBins, T& phiBins, T& tempFitVarBins, T& NsigmaTPCBins, T& NsigmaTOFBins, T& NsigmaTPCTOFBins, T& NsigmaITSBins, T& InvMassBins, bool isMC, int pdgCode, bool isDebug = false, bool correlatedPlots = false)
221229
{
222230
mPDG = pdgCode;
223231
if (registry) {
@@ -247,15 +255,15 @@ class FemtoDreamParticleHisto
247255
framework::AxisSpec NsigmaTPCAxis = {NsigmaTPCBins, "n#sigma_{TPC}"};
248256
framework::AxisSpec NsigmaTOFAxis = {NsigmaTOFBins, "n#sigma_{TOF}"};
249257
framework::AxisSpec NsigmaTPCTOFAxis = {NsigmaTPCTOFBins, "n#sigma_{TPC+TOF}"};
250-
framework::AxisSpec TPCclustersAxis = {TPCclustersBins, "TPC found clusters"};
258+
framework::AxisSpec NsigmaITSAxis = {NsigmaITSBins, "n#sigma_{ITS}"};
251259
framework::AxisSpec InvMassAxis = {InvMassBins, "M_{inv} (GeV/#it{c}^{2})"};
252260

253261
std::string folderName = (static_cast<std::string>(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]).c_str() + static_cast<std::string>(mFolderSuffix[mFolderSuffixType])).c_str();
254262

255263
// Fill here the actual histogramms by calling init_base and init_MC
256264
init_base<o2::aod::femtodreamMCparticle::MCType::kRecon>(folderName, tempFitVarAxisTitle, pTAxis, tempFitVarAxis, InvMassAxis, multAxis);
257265
if (isDebug) {
258-
init_debug<o2::aod::femtodreamMCparticle::MCType::kRecon>(folderName, multAxis, multPercentileAxis, pTAxis, etaAxis, phiAxis, tempFitVarAxis, dcazAxis, NsigmaTPCAxis, NsigmaTOFAxis, NsigmaTPCTOFAxis, TPCclustersAxis, correlatedPlots);
266+
init_debug<o2::aod::femtodreamMCparticle::MCType::kRecon>(folderName, multAxis, multPercentileAxis, pTAxis, etaAxis, phiAxis, tempFitVarAxis, dcazAxis, NsigmaTPCAxis, NsigmaTOFAxis, NsigmaTPCTOFAxis, NsigmaITSAxis, correlatedPlots);
259267
}
260268
if (isMC) {
261269
init_base<o2::aod::femtodreamMCparticle::MCType::kTruth>(folderName, tempFitVarAxisTitle, pTAxis, tempFitVarAxis, InvMassAxis, multAxis);
@@ -350,6 +358,14 @@ class FemtoDreamParticleHisto
350358
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_d"), momentum, std::sqrt(part.tpcNSigmaDe() * part.tpcNSigmaDe() + part.tofNSigmaDe() * part.tofNSigmaDe()));
351359
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_tr"), momentum, std::sqrt(part.tpcNSigmaTr() * part.tpcNSigmaTr() + part.tofNSigmaTr() * part.tofNSigmaTr()));
352360
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_he3"), momentum, std::sqrt(part.tpcNSigmaHe() * part.tpcNSigmaHe() + part.tofNSigmaHe() * part.tofNSigmaHe()));
361+
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/ITSSignal"), momentum, part.itsSignal());
362+
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaITS_el"), momentum, part.itsNSigmaEl());
363+
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaITS_pi"), momentum, part.itsNSigmaPi());
364+
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaITS_K"), momentum, part.itsNSigmaKa());
365+
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaITS_p"), momentum, part.itsNSigmaPr());
366+
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaITS_d"), momentum, part.itsNSigmaDe());
367+
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaITS_tr"), momentum, part.itsNSigmaTr());
368+
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaITS_he3"), momentum, part.itsNSigmaHe());
353369

354370
if (correlatedPlots) {
355371

PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
#include "PWGCF/DataModel/FemtoDerived.h"
2626
#include "Common/DataModel/TrackSelectionTables.h"
27+
#include "Common/DataModel/PIDResponse.h"
28+
#include "Common/DataModel/PIDResponseITS.h"
2729
#include "Common/Core/TrackSelection.h"
2830
#include "Common/Core/TrackSelectionDefaults.h"
2931
#include "PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h"
@@ -129,6 +131,14 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection<float, femtoDr
129131
template <typename T>
130132
auto getNsigmaTOF(T const& track, o2::track::PID pid);
131133

134+
/// Computes the n_sigma for a track and a particle-type hypothesis in the ITS
135+
/// \tparam T Data type of the track
136+
/// \param track Track for which PID is evaluated
137+
/// \param pid Particle species for which PID is evaluated
138+
/// \return Value of n_{sigma, ITS}
139+
template <typename T>
140+
auto getNsigmaITS(T const& track, o2::track::PID pid);
141+
132142
/// Checks whether the most open combination of all selection criteria is fulfilled
133143
/// \tparam T Data type of the track
134144
/// \param track Track
@@ -146,7 +156,7 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection<float, femtoDr
146156
/// \param Eta eta of the track
147157
/// \param Dca dca of the track with respect to primary vertex
148158
/// \return The bit-wise container for the selections, separately with all selection criteria, and the PID
149-
template <typename cutContainerType, typename T, typename R>
159+
template <bool useItsPid = false, typename cutContainerType, typename T, typename R>
150160
std::array<cutContainerType, 2> getCutContainer(T const& track, R Pt, R Eta, R Dcaxy);
151161

152162
/// Some basic QA histograms
@@ -291,7 +301,7 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection<float, femtoDr
291301
"Maximal DCA_z (cm)",
292302
"Minimal DCA (cm)",
293303
"Maximal PID (nSigma)"}; ///< Helper information for the different selections
294-
}; // namespace femtoDream
304+
}; // namespace femtoDream
295305

296306
template <o2::aod::femtodreamparticle::ParticleType part, o2::aod::femtodreamparticle::TrackType tracktype, typename cutContainerType>
297307
void FemtoDreamTrackSelection::init(HistogramRegistry* QAregistry, HistogramRegistry* Registry)
@@ -384,6 +394,28 @@ auto FemtoDreamTrackSelection::getNsigmaTOF(T const& track, o2::track::PID pid)
384394
return o2::aod::pidutils::tofNSigma(pid, track);
385395
}
386396

397+
template <typename T>
398+
auto FemtoDreamTrackSelection::getNsigmaITS(T const& track, o2::track::PID pid)
399+
{
400+
if (pid == o2::track::PID::Electron) {
401+
return track.itsNSigmaEl();
402+
} else if (pid == o2::track::PID::Pion) {
403+
return track.itsNSigmaPi();
404+
} else if (pid == o2::track::PID::Kaon) {
405+
return track.itsNSigmaKa();
406+
} else if (pid == o2::track::PID::Proton) {
407+
return track.itsNSigmaPr();
408+
} else if (pid == o2::track::PID::Deuteron) {
409+
return track.itsNSigmaDe();
410+
} else if (pid == o2::track::PID::Triton) {
411+
return track.itsNSigmaTr();
412+
} else if (pid == o2::track::PID::Helium3) {
413+
return track.itsNSigmaHe();
414+
}
415+
// if nothing matched, return default value
416+
return -999.f;
417+
}
418+
387419
template <typename T>
388420
bool FemtoDreamTrackSelection::isSelectedMinimal(T const& track)
389421
{
@@ -460,7 +492,7 @@ bool FemtoDreamTrackSelection::isSelectedMinimal(T const& track)
460492
return true;
461493
}
462494

463-
template <typename cutContainerType, typename T, typename R>
495+
template <bool useItsPid, typename cutContainerType, typename T, typename R>
464496
std::array<cutContainerType, 2> FemtoDreamTrackSelection::getCutContainer(T const& track, R Pt, R Eta, R Dca)
465497
{
466498
cutContainerType output = 0;
@@ -479,23 +511,30 @@ std::array<cutContainerType, 2> FemtoDreamTrackSelection::getCutContainer(T cons
479511
const auto dcaZ = track.dcaZ();
480512
const auto dca = Dca;
481513

482-
std::vector<float> pidTPC, pidTOF;
514+
std::vector<float> pidTPC, pidTOF, pidITS;
483515
for (auto it : mPIDspecies) {
484516
pidTPC.push_back(getNsigmaTPC(track, it));
485517
pidTOF.push_back(getNsigmaTOF(track, it));
518+
if constexpr (useItsPid) {
519+
pidITS.push_back(getNsigmaITS(track, it));
520+
}
486521
}
487522

488523
float observable = 0.;
489524
for (auto& sel : mSelections) {
490525
const auto selVariable = sel.getSelectionVariable();
491526
if (selVariable == femtoDreamTrackSelection::kPIDnSigmaMax) {
492-
/// PID needs to be handled a bit differently since we may need more than one species
527+
/// PID needsgetNsigmaITSto be handled a bit differently since we may need more than one species
493528
for (size_t i = 0; i < mPIDspecies.size(); ++i) {
494529
auto pidTPCVal = pidTPC.at(i) - nSigmaPIDOffsetTPC;
495530
auto pidTOFVal = pidTOF.at(i) - nSigmaPIDOffsetTOF;
496531
auto pidComb = std::sqrt(pidTPCVal * pidTPCVal + pidTOFVal * pidTOFVal);
497532
sel.checkSelectionSetBitPID(pidTPCVal, outputPID);
498533
sel.checkSelectionSetBitPID(pidComb, outputPID);
534+
if constexpr (useItsPid) {
535+
auto pidITSVal = pidITS.at(i);
536+
sel.checkSelectionSetBitPID(pidITSVal, outputPID);
537+
}
499538
}
500539
} else {
501540
/// for the rest it's all the same

PWGCF/FemtoDream/Core/femtoDreamUtils.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,22 @@ inline bool containsNameValuePair(const std::vector<T>& myVector, const std::str
118118
return false; // No match found
119119
}
120120

121+
template <typename T>
122+
float itsSignal(T const& track)
123+
{
124+
uint32_t clsizeflag = track.itsClusterSizes();
125+
auto clSizeLayer0 = (clsizeflag >> (0 * 4)) & 0xf;
126+
auto clSizeLayer1 = (clsizeflag >> (1 * 4)) & 0xf;
127+
auto clSizeLayer2 = (clsizeflag >> (2 * 4)) & 0xf;
128+
auto clSizeLayer3 = (clsizeflag >> (3 * 4)) & 0xf;
129+
auto clSizeLayer4 = (clsizeflag >> (4 * 4)) & 0xf;
130+
auto clSizeLayer5 = (clsizeflag >> (5 * 4)) & 0xf;
131+
auto clSizeLayer6 = (clsizeflag >> (6 * 4)) & 0xf;
132+
int numLayers = 7;
133+
int sumClusterSizes = clSizeLayer1 + clSizeLayer2 + clSizeLayer3 + clSizeLayer4 + clSizeLayer5 + clSizeLayer6 + clSizeLayer0;
134+
float cosLamnda = 1. / std::cosh(track.eta());
135+
return (static_cast<float>(sumClusterSizes) / numLayers) * cosLamnda;
136+
};
137+
121138
} // namespace o2::analysis::femtoDream
122139
#endif // PWGCF_FEMTODREAM_CORE_FEMTODREAMUTILS_H_

PWGCF/FemtoDream/Core/femtoDreamV0Selection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,8 @@ template <typename cutContainerType, typename C, typename V, typename T>
550550
std::array<cutContainerType, 5>
551551
FemtoDreamV0Selection::getCutContainer(C const& /*col*/, V const& v0, T const& posTrack, T const& negTrack)
552552
{
553-
auto outputPosTrack = PosDaughTrack.getCutContainer<cutContainerType>(posTrack, v0.positivept(), v0.positiveeta(), v0.dcapostopv());
554-
auto outputNegTrack = NegDaughTrack.getCutContainer<cutContainerType>(negTrack, v0.negativept(), v0.negativeeta(), v0.dcanegtopv());
553+
auto outputPosTrack = PosDaughTrack.getCutContainer<false, cutContainerType>(posTrack, v0.positivept(), v0.positiveeta(), v0.dcapostopv());
554+
auto outputNegTrack = NegDaughTrack.getCutContainer<false, cutContainerType>(negTrack, v0.negativept(), v0.negativeeta(), v0.dcanegtopv());
555555
cutContainerType output = 0;
556556
size_t counter = 0;
557557

0 commit comments

Comments
 (0)