Skip to content

Commit d9c99d4

Browse files
committed
add nSigmaIts to V0 trees
1 parent 939bc93 commit d9c99d4

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

DPG/Tasks/TPC/tpcSkimsTableCreator.cxx

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ struct TreeWriterTpcV0 {
120120
double maxPt4dwnsmplTsalis{UndefValueDouble};
121121
double tpcNSigma{UndefValueDouble};
122122
double tofNSigma{UndefValueDouble};
123+
double itsNSigma{UndefValueDouble};
123124
double tpcExpSignal{UndefValueDouble};
124125
o2::track::PID::ID id{0};
125126
double dwnSmplFactor{UndefValueDouble};
@@ -165,13 +166,13 @@ struct TreeWriterTpcV0 {
165166
{
166167
switch (daughterId) {
167168
case DaughterElectron:
168-
return V0Daughter{downsamplingTsalisElectrons, MassElectron, maxPt4dwnsmplTsalisElectrons, track.tpcNSigmaEl(), getStrangenessTofNSigma(v0Casc, motherId, daughterId, isPositive), track.tpcExpSignalEl(tpcSignalGeneric<IsCorrectedDeDx>(track)), PidElectron, dwnSmplFactorEl, NSigmaTofElectorn + 1.f, false};
169+
return V0Daughter{downsamplingTsalisElectrons, MassElectron, maxPt4dwnsmplTsalisElectrons, track.tpcNSigmaEl(), getStrangenessTofNSigma(v0Casc, motherId, daughterId, isPositive), track.itsNSigmaEl(), track.tpcExpSignalEl(tpcSignalGeneric<IsCorrectedDeDx>(track)), PidElectron, dwnSmplFactorEl, NSigmaTofElectorn + 1.f, false};
169170
case DaughterPion:
170-
return V0Daughter{downsamplingTsalisPions, MassPiPlus, maxPt4dwnsmplTsalisPions, track.tpcNSigmaPi(), getStrangenessTofNSigma(v0Casc, motherId, daughterId, isPositive), track.tpcExpSignalPi(tpcSignalGeneric<IsCorrectedDeDx>(track)), PidPion, dwnSmplFactorPi, nSigmaTofDauTrackPi, rejectNoTofDauTrackPi};
171+
return V0Daughter{downsamplingTsalisPions, MassPiPlus, maxPt4dwnsmplTsalisPions, track.tpcNSigmaPi(), getStrangenessTofNSigma(v0Casc, motherId, daughterId, isPositive), track.itsNSigmaPi(), track.tpcExpSignalPi(tpcSignalGeneric<IsCorrectedDeDx>(track)), PidPion, dwnSmplFactorPi, nSigmaTofDauTrackPi, rejectNoTofDauTrackPi};
171172
case DaughterProton:
172-
return V0Daughter{downsamplingTsalisProtons, MassProton, maxPt4dwnsmplTsalisProtons, track.tpcNSigmaPr(), getStrangenessTofNSigma(v0Casc, motherId, daughterId, isPositive), track.tpcExpSignalPr(tpcSignalGeneric<IsCorrectedDeDx>(track)), PidProton, dwnSmplFactorPr, nSigmaTofDauTrackPr, rejectNoTofDauTrackPr};
173+
return V0Daughter{downsamplingTsalisProtons, MassProton, maxPt4dwnsmplTsalisProtons, track.tpcNSigmaPr(), getStrangenessTofNSigma(v0Casc, motherId, daughterId, isPositive), track.itsNSigmaPr(), track.tpcExpSignalPr(tpcSignalGeneric<IsCorrectedDeDx>(track)), PidProton, dwnSmplFactorPr, nSigmaTofDauTrackPr, rejectNoTofDauTrackPr};
173174
case DaughterKaon:
174-
return V0Daughter{downsamplingTsalisKaons, MassKPlus, maxPt4dwnsmplTsalisKaons, track.tpcNSigmaKa(), getStrangenessTofNSigma(v0Casc, motherId, daughterId, isPositive), track.tpcExpSignalKa(tpcSignalGeneric<IsCorrectedDeDx>(track)), PidKaon, dwnSmplFactorKa, nSigmaTofDauTrackKa, rejectNoTofDauTrackKa};
175+
return V0Daughter{downsamplingTsalisKaons, MassKPlus, maxPt4dwnsmplTsalisKaons, track.tpcNSigmaKa(), getStrangenessTofNSigma(v0Casc, motherId, daughterId, isPositive), track.itsNSigmaKa(), track.tpcExpSignalKa(tpcSignalGeneric<IsCorrectedDeDx>(track)), PidKaon, dwnSmplFactorKa, nSigmaTofDauTrackKa, rejectNoTofDauTrackKa};
175176
default: {
176177
LOGP(fatal, "createV0Daughter: unknown daughterId");
177178
return V0Daughter();
@@ -232,7 +233,7 @@ struct TreeWriterTpcV0 {
232233
}
233234

234235
template <bool DoUseCorrectedDeDx, int ModeId, typename T, typename C, typename V0Casc>
235-
void fillSkimmedV0Table(V0Casc const& v0casc, T const& track, aod::TracksQA const& trackQA, const bool existTrkQA, C const& collision, const float nSigmaTPC, const float nSigmaTOF, const float dEdxExp, const o2::track::PID::ID id, const int runnumber, const double dwnSmplFactor, const float hadronicRate, const int bcGlobalIndex, const int bcTimeFrameId, const int bcBcInTimeFrame)
236+
void fillSkimmedV0Table(V0Casc const& v0casc, T const& track, aod::TracksQA const& trackQA, const bool existTrkQA, C const& collision, const float nSigmaTPC, const float nSigmaTOF, const float nSigmaITS, const float dEdxExp, const o2::track::PID::ID id, const int runnumber, const double dwnSmplFactor, const float hadronicRate, const int bcGlobalIndex, const int bcTimeFrameId, const int bcBcInTimeFrame)
236237
{
237238
const double ncl = track.tpcNClsFound();
238239
const double nclPID = track.tpcNClsFindableMinusPID();
@@ -275,6 +276,7 @@ struct TreeWriterTpcV0 {
275276
id,
276277
nSigmaTPC,
277278
nSigmaTOF,
279+
nSigmaITS,
278280
runnumber,
279281
trackOcc,
280282
ft0Occ,
@@ -302,6 +304,7 @@ struct TreeWriterTpcV0 {
302304
id,
303305
nSigmaTPC,
304306
nSigmaTOF,
307+
nSigmaITS,
305308
runnumber,
306309
trackOcc,
307310
ft0Occ,
@@ -330,6 +333,7 @@ struct TreeWriterTpcV0 {
330333
id,
331334
nSigmaTPC,
332335
nSigmaTOF,
336+
nSigmaITS,
333337
runnumber,
334338
trackOcc,
335339
ft0Occ,
@@ -389,16 +393,18 @@ struct TreeWriterTpcV0 {
389393
constexpr bool IsWithTrackQa = ModeId != ModeStandard;
390394

391395
std::vector<int64_t> labelTrack2TrackQA;
392-
if (IsWithTrackQa) {
393-
// this action should not be under constexpr, otherwise the processStandard() function crashes when it is subscribed for myTracks but they're not used
394-
labelTrack2TrackQA.resize(myTracks.size(), -1);
395-
}
396396
if constexpr (IsWithTrackQa) {
397+
labelTrack2TrackQA.resize(myTracks.size(), -1);
397398
for (const auto& trackQA : tracksQA) {
398399
const int64_t trackId = trackQA.trackId();
399400
labelTrack2TrackQA.at(trackId) = trackQA.globalIndex();
400401
}
401402
}
403+
404+
const auto& tracksWithITSPid = soa::Attach<TrksType,
405+
aod::pidits::ITSNSigmaEl, aod::pidits::ITSNSigmaPi,
406+
aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr>(myTracks);
407+
402408
for (const auto& collision : collisions) {
403409
if (!isEventSelected(collision, applyEvSel)) {
404410
continue;
@@ -430,7 +436,7 @@ struct TreeWriterTpcV0 {
430436
const bool passNSigmaTofCut = std::fabs(daughter.tofNSigma) < daughter.nSigmaTofDauTrack || std::fabs(daughter.tofNSigma - NSigmaTofUnmatched) < NSigmaTofUnmatchedEqualityTolerance;
431437
const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs(daughter.tofNSigma - NSigmaTofUnmatched) > NSigmaTofUnmatchedEqualityTolerance;
432438
if (passTrackSelection && passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
433-
fillSkimmedV0Table<IsCorrectedDeDx, ModeId>(mother, dauTrack, trackQAInstance, existTrkQA, collision, daughter.tpcNSigma, daughter.tofNSigma, daughter.tpcExpSignal, daughter.id, runnumber, daughter.dwnSmplFactor, hadronicRate, bcGlobalIndex, bcTimeFrameId, bcBcInTimeFrame);
439+
fillSkimmedV0Table<IsCorrectedDeDx, ModeId>(mother, dauTrack, trackQAInstance, existTrkQA, collision, daughter.tpcNSigma, daughter.tofNSigma, daughter.itsNSigma, daughter.tpcExpSignal, daughter.id, runnumber, daughter.dwnSmplFactor, hadronicRate, bcGlobalIndex, bcTimeFrameId, bcBcInTimeFrame);
434440
}
435441
};
436442

@@ -457,12 +463,17 @@ struct TreeWriterTpcV0 {
457463
const auto& posTrack = v0.posTrack_as<TrksType>();
458464
const auto& negTrack = v0.negTrack_as<TrksType>();
459465

466+
const auto posTrackId = posTrack.globalIndex();
467+
const auto& posTrackWithITSPid = tracksWithITSPid.rawIteratorAt(posTrackId);
468+
const auto negTrackId = negTrack.globalIndex();
469+
const auto& negTrackWithITSPid = tracksWithITSPid.rawIteratorAt(negTrackId);
470+
460471
const auto& [posTrackQA, existPosTrkQA] = getTrackQA(posTrack);
461472
const auto& [negTrackQA, existNegTrkQA] = getTrackQA(negTrack);
462473

463474
const V0Mother v0Mother = createV0Mother(v0Id);
464-
const V0Daughter posDaughter = createV0Daughter<IsCorrectedDeDx>(v0, posTrack, v0Id, v0Mother.posDaughterId, true);
465-
const V0Daughter negDaughter = createV0Daughter<IsCorrectedDeDx>(v0, negTrack, v0Id, v0Mother.negDaughterId, false);
475+
const V0Daughter posDaughter = createV0Daughter<IsCorrectedDeDx>(v0, posTrackWithITSPid, v0Id, v0Mother.posDaughterId, true);
476+
const V0Daughter negDaughter = createV0Daughter<IsCorrectedDeDx>(v0, negTrackWithITSPid, v0Id, v0Mother.negDaughterId, false);
466477

467478
fillDaughterTrack(v0, posTrack, posDaughter, posTrackQA, existPosTrkQA);
468479
fillDaughterTrack(v0, negTrack, negDaughter, negTrackQA, existNegTrkQA);
@@ -475,7 +486,9 @@ struct TreeWriterTpcV0 {
475486
continue;
476487
}
477488
const auto& bachTrack = casc.bachelor_as<TrksType>();
478-
const V0Daughter bachDaughter = createV0Daughter<IsCorrectedDeDx>(casc, bachTrack, cascId, DaughterKaon);
489+
const auto bachTrackId = bachTrack.globalIndex();
490+
const auto& bachTrackWithITSPid = tracksWithITSPid.rawIteratorAt(bachTrackId);
491+
const V0Daughter bachDaughter = createV0Daughter<IsCorrectedDeDx>(casc, bachTrackWithITSPid, cascId, DaughterKaon);
479492
const auto& [bachTrackQA, existBachTrkQA] = getTrackQA(bachTrack);
480493
// Omega and antiomega
481494
fillDaughterTrack(casc, bachTrack, bachDaughter, bachTrackQA, existBachTrkQA);
@@ -694,11 +707,11 @@ struct TreeWriterTpcTof {
694707
id,
695708
nSigmaTPC,
696709
nSigmaTOF,
710+
nSigmaITS,
697711
runnumber,
698712
trackOcc,
699713
ft0Occ,
700-
hadronicRate,
701-
nSigmaITS);
714+
hadronicRate);
702715
} else if constexpr (ModeId == ModeWithdEdxTrkQA) {
703716
rowTPCTOFTreeWithdEdxTrkQA(usedEdx,
704717
1. / dEdxExp,
@@ -716,11 +729,11 @@ struct TreeWriterTpcTof {
716729
id,
717730
nSigmaTPC,
718731
nSigmaTOF,
732+
nSigmaITS,
719733
runnumber,
720734
trackOcc,
721735
ft0Occ,
722736
hadronicRate,
723-
nSigmaITS,
724737
existTrkQA ? trackQA.tpcdEdxNorm() : UndefValueFloat);
725738
} else if constexpr (ModeId == ModeWithTrkQA) {
726739
rowTPCTOFTreeWithTrkQA(usedEdx,
@@ -739,11 +752,11 @@ struct TreeWriterTpcTof {
739752
id,
740753
nSigmaTPC,
741754
nSigmaTOF,
755+
nSigmaITS,
742756
runnumber,
743757
trackOcc,
744758
ft0Occ,
745759
hadronicRate,
746-
nSigmaITS,
747760
bcGlobalIndex,
748761
bcTimeFrameId,
749762
bcBcInTimeFrame,
@@ -780,9 +793,8 @@ struct TreeWriterTpcTof {
780793
continue;
781794
}
782795
const auto& tracksWithITSPid = soa::Attach<TrksType,
783-
aod::pidits::ITSNSigmaEl, aod::pidits::ITSNSigmaMu, aod::pidits::ITSNSigmaPi,
784-
aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr, aod::pidits::ITSNSigmaDe,
785-
aod::pidits::ITSNSigmaTr, aod::pidits::ITSNSigmaHe, aod::pidits::ITSNSigmaAl>(tracks);
796+
aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr,
797+
aod::pidits::ITSNSigmaDe, aod::pidits::ITSNSigmaTr>(tracks);
786798

787799
const auto& bc = collision.bc_as<BCType>();
788800
const int runnumber = bc.runNumber();

DPG/Tasks/TPC/tpcSkimsTableCreator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ DECLARE_SOA_COLUMN(BcBcInTimeFrame, bcBcInTimeFrame, int);
7272
tpcskims::PidIndex, \
7373
tpcskims::NSigTPC, \
7474
tpcskims::NSigTOF, \
75+
tpcskims::NSigITS, \
7576
tpcskims::RunNumber, \
7677
tpcskims::TrackOcc, \
7778
tpcskims::Ft0Occ, \
@@ -87,8 +88,7 @@ DECLARE_SOA_COLUMN(BcBcInTimeFrame, bcBcInTimeFrame, int);
8788
tpcskims::GammaPsiPair
8889

8990
#define TPCSKIMS_COLUMNS_TOF \
90-
TPCSKIMS_COLUMNS_BASE, \
91-
tpcskims::NSigITS
91+
TPCSKIMS_COLUMNS_BASE
9292

9393
#define TPCSKIMS_COLUMNS_TRACK_QA \
9494
tpcskims::BcGlobalIndex, \

0 commit comments

Comments
 (0)