Skip to content

Commit d847609

Browse files
authored
[PWGLF] Add deuteron TOF PID and TPC signal to hypertriton 3-body KF candidate output table (AliceO2Group#8315)
1 parent 8fec228 commit d847609

3 files changed

Lines changed: 70 additions & 31 deletions

File tree

PWGLF/DataModel/Vtx3BodyTables.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ DECLARE_SOA_COLUMN(Track2Sign, track2sign, float); //! sig
386386
DECLARE_SOA_COLUMN(TPCNSigmaProton, tpcnsigmaproton, float); //! nsigma of TPC PID of the proton daughter
387387
DECLARE_SOA_COLUMN(TPCNSigmaPion, tpcnsigmapion, float); //! nsigma of TPC PID of the pion daughter
388388
DECLARE_SOA_COLUMN(TPCNSigmaDeuteron, tpcnsigmadeuteron, float); //! nsigma of TPC PID of the bachelor daughter
389+
DECLARE_SOA_COLUMN(TPCdEdxProton, tpcdedxproton, float); //! TPC dEdx of the proton daughter
390+
DECLARE_SOA_COLUMN(TPCdEdxPion, tpcdedxpion, float); //! TPC dEdx of the pion daughter
391+
DECLARE_SOA_COLUMN(TPCdEdxDeuteron, tpcdedxdeuteron, float); //! TPC dEdx of the bachelor daughter
392+
DECLARE_SOA_COLUMN(TOFNSigmaDeuteron, tofnsigmadeuteron, float); //! nsigma of TOF PID of the bachelor daughter
389393

390394
// Monte Carlo
391395
DECLARE_SOA_COLUMN(GenP, genp, float); //! generated momentum
@@ -441,6 +445,8 @@ DECLARE_SOA_TABLE(KFVtx3BodyDatas, "AOD", "KFVTX3BODYDATA",
441445
kfvtx3body::DCATrackPosToPV, kfvtx3body::DCATrackNegToPV, kfvtx3body::DCATrackBachToPV,
442446
kfvtx3body::Track0Sign, kfvtx3body::Track1Sign, kfvtx3body::Track2Sign, // track sing: proton, pion, deuteron
443447
kfvtx3body::TPCNSigmaProton, kfvtx3body::TPCNSigmaPion, kfvtx3body::TPCNSigmaDeuteron,
448+
kfvtx3body::TPCdEdxProton, kfvtx3body::TPCdEdxPion, kfvtx3body::TPCdEdxDeuteron,
449+
kfvtx3body::TOFNSigmaDeuteron,
444450

445451
// dynamic columns
446452
vtx3body::VtxRadius<vtx3body::X, vtx3body::Y>,
@@ -505,6 +511,8 @@ DECLARE_SOA_TABLE(KFVtx3BodyDatasLite, "AOD", "KF3BODYLITE",
505511
kfvtx3body::DCATrackPosToPV, kfvtx3body::DCATrackNegToPV, kfvtx3body::DCATrackBachToPV,
506512
kfvtx3body::Track0Sign, kfvtx3body::Track1Sign, kfvtx3body::Track2Sign, // track sing: proton, pion, deuteron
507513
kfvtx3body::TPCNSigmaProton, kfvtx3body::TPCNSigmaPion, kfvtx3body::TPCNSigmaDeuteron,
514+
kfvtx3body::TPCdEdxProton, kfvtx3body::TPCdEdxPion, kfvtx3body::TPCdEdxDeuteron,
515+
kfvtx3body::TOFNSigmaDeuteron,
508516

509517
// dynamic columns
510518
vtx3body::VtxRadius<vtx3body::X, vtx3body::Y>,
@@ -560,6 +568,8 @@ DECLARE_SOA_TABLE(McKFVtx3BodyDatas, "AOD", "MCKF3BODYDATAS",
560568
kfvtx3body::DCATrackPosToPV, kfvtx3body::DCATrackNegToPV, kfvtx3body::DCATrackBachToPV,
561569
kfvtx3body::Track0Sign, kfvtx3body::Track1Sign, kfvtx3body::Track2Sign, // track sing: proton, pion, deuteron
562570
kfvtx3body::TPCNSigmaProton, kfvtx3body::TPCNSigmaPion, kfvtx3body::TPCNSigmaDeuteron,
571+
kfvtx3body::TPCdEdxProton, kfvtx3body::TPCdEdxPion, kfvtx3body::TPCdEdxDeuteron,
572+
kfvtx3body::TOFNSigmaDeuteron,
563573

564574
// MC information
565575
kfvtx3body::GenP,

PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,38 @@ struct decay3bodyBuilder {
618618

619619
//------------------------------------------------------------------
620620
// 3body candidate builder with KFParticle
621-
template <class TTrackTo, typename TCollision>
621+
template <class TTrackTo, class TCollisionTo, typename TCollision>
622622
void buildVtx3BodyDataTableKFParticle(TCollision const& collision, aod::Decay3Bodys const& decay3bodys, int bachelorcharge = 1)
623623
{
624624
LOG(debug) << "buildVtx3BodyDataTableKFParticle called.";
625+
626+
// initialise KF primary vertex
627+
KFPVertex kfpVertex = createKFPVertexFromCollision(collision);
628+
KFParticle kfpv(kfpVertex);
629+
LOG(debug) << "Created KF PV.";
630+
631+
// fill event QA histograms
632+
if (kfparticleConfigurations.doVertexQA) {
633+
registry.fill(HIST("QA/Event/hVtxXKF"), kfpv.GetX());
634+
registry.fill(HIST("QA/Event/hVtxYKF"), kfpv.GetY());
635+
registry.fill(HIST("QA/Event/hVtxZKF"), kfpv.GetZ());
636+
registry.fill(HIST("QA/Event/hVtxCovXXKF"), kfpv.GetCovariance(0));
637+
registry.fill(HIST("QA/Event/hVtxCovYYKF"), kfpv.GetCovariance(2));
638+
registry.fill(HIST("QA/Event/hVtxCovZZKF"), kfpv.GetCovariance(5));
639+
registry.fill(HIST("QA/Event/hVtxCovXYKF"), kfpv.GetCovariance(1));
640+
registry.fill(HIST("QA/Event/hVtxCovXZKF"), kfpv.GetCovariance(3));
641+
registry.fill(HIST("QA/Event/hVtxCovYZKF"), kfpv.GetCovariance(4));
642+
registry.fill(HIST("QA/Event/hVtxX"), collision.posX());
643+
registry.fill(HIST("QA/Event/hVtxY"), collision.posY());
644+
registry.fill(HIST("QA/Event/hVtxZ"), collision.posZ());
645+
registry.fill(HIST("QA/Event/hVtxCovXX"), collision.covXX());
646+
registry.fill(HIST("QA/Event/hVtxCovYY"), collision.covYY());
647+
registry.fill(HIST("QA/Event/hVtxCovZZ"), collision.covZZ());
648+
registry.fill(HIST("QA/Event/hVtxCovXY"), collision.covXY());
649+
registry.fill(HIST("QA/Event/hVtxCovXZ"), collision.covXZ());
650+
registry.fill(HIST("QA/Event/hVtxCovYZ"), collision.covYZ());
651+
}
652+
625653
for (auto& vtx3body : decay3bodys) {
626654
LOG(debug) << "Entered decay3bodys loop.";
627655

@@ -635,13 +663,9 @@ struct decay3bodyBuilder {
635663
auto trackParCovBach = getTrackParCov(trackBach);
636664
LOG(debug) << "Got all daughter tracks.";
637665

638-
KFPVertex kfpVertex = createKFPVertexFromCollision(collision);
639-
KFParticle kfpv(kfpVertex);
640-
LOG(debug) << "Created KF PV.";
641-
642666
bool isMatter = trackBach.sign() > 0 ? true : false;
643667

644-
// ---------- fill trackQA and vertexQA histograms
668+
// ---------- fill track QA histograms ----------
645669
if (kfparticleConfigurations.doTrackQA) {
646670
registry.fill(HIST("QA/Tracks/hTrackPosTPCNcls"), trackPos.tpcNClsFound());
647671
registry.fill(HIST("QA/Tracks/hTrackNegTPCNcls"), trackNeg.tpcNClsFound());
@@ -665,27 +689,6 @@ struct decay3bodyBuilder {
665689
registry.fill(HIST("QA/Tracks/hTrackBachPt"), trackBach.pt());
666690
}
667691

668-
if (kfparticleConfigurations.doVertexQA) {
669-
registry.fill(HIST("QA/Event/hVtxXKF"), kfpv.GetX());
670-
registry.fill(HIST("QA/Event/hVtxYKF"), kfpv.GetY());
671-
registry.fill(HIST("QA/Event/hVtxZKF"), kfpv.GetZ());
672-
registry.fill(HIST("QA/Event/hVtxCovXXKF"), kfpv.GetCovariance(0));
673-
registry.fill(HIST("QA/Event/hVtxCovYYKF"), kfpv.GetCovariance(2));
674-
registry.fill(HIST("QA/Event/hVtxCovZZKF"), kfpv.GetCovariance(5));
675-
registry.fill(HIST("QA/Event/hVtxCovXYKF"), kfpv.GetCovariance(1));
676-
registry.fill(HIST("QA/Event/hVtxCovXZKF"), kfpv.GetCovariance(3));
677-
registry.fill(HIST("QA/Event/hVtxCovYZKF"), kfpv.GetCovariance(4));
678-
registry.fill(HIST("QA/Event/hVtxX"), collision.posX());
679-
registry.fill(HIST("QA/Event/hVtxY"), collision.posY());
680-
registry.fill(HIST("QA/Event/hVtxZ"), collision.posZ());
681-
registry.fill(HIST("QA/Event/hVtxCovXX"), collision.covXX());
682-
registry.fill(HIST("QA/Event/hVtxCovYY"), collision.covYY());
683-
registry.fill(HIST("QA/Event/hVtxCovZZ"), collision.covZZ());
684-
registry.fill(HIST("QA/Event/hVtxCovXY"), collision.covXY());
685-
registry.fill(HIST("QA/Event/hVtxCovXZ"), collision.covXZ());
686-
registry.fill(HIST("QA/Event/hVtxCovYZ"), collision.covYZ());
687-
}
688-
689692
// -------- STEP 1: track selection --------
690693
// collision ID --> not correct? tracks can have different collisions, but belong to one 3prong vertex!
691694
// if (trackPos.collisionId() != trackNeg.collisionId() || trackPos.collisionId() != trackBach.collisionId() || trackNeg.collisionId() != trackBach.collisionId()) {
@@ -731,23 +734,37 @@ struct decay3bodyBuilder {
731734
// TPC PID
732735
float tpcNsigmaProton;
733736
float tpcNsigmaPion;
737+
float dEdxProton;
738+
float dEdxPion;
734739
float tpcNsigmaDeuteron = trackBach.tpcNSigmaDe();
740+
float dEdxDeuteron = trackBach.tpcSignal();
735741
if (isMatter) { // hypertriton (proton, pi-, deuteron)
736742
tpcNsigmaProton = trackPos.tpcNSigmaPr();
737743
tpcNsigmaPion = trackNeg.tpcNSigmaPi();
744+
dEdxProton = trackPos.tpcSignal();
745+
dEdxPion = trackNeg.tpcSignal();
738746
if (!selectTPCPID(trackPos, trackNeg, trackBach)) {
739747
continue;
740748
}
741749
} else if (!isMatter) { // anti-hypertriton (anti-proton, pi+, deuteron)
742750
tpcNsigmaProton = trackNeg.tpcNSigmaPr();
743751
tpcNsigmaPion = trackPos.tpcNSigmaPi();
752+
dEdxProton = trackNeg.tpcSignal();
753+
dEdxPion = trackPos.tpcSignal();
744754
if (!selectTPCPID(trackNeg, trackPos, trackBach)) {
745755
continue;
746756
}
747757
}
748758
registry.fill(HIST("hVtx3BodyCounterKFParticle"), kKfVtxTPCPID);
749759
LOG(debug) << "Basic track selections done.";
750760

761+
// TOF PID of deuteron (set motherhyp correctly)
762+
double tofNSigmaDeuteron = -999;
763+
if (trackBach.has_collision() && trackBach.hasTOF()) {
764+
auto originalcol = trackBach.template collision_as<TCollisionTo>();
765+
tofNSigmaDeuteron = bachelorTOFPID.GetTOFNSigma(trackBach, originalcol, collision);
766+
}
767+
751768
// track DCAxy and DCAz to PV associated with decay3body
752769
o2::dataformats::VertexBase mPV;
753770
o2::dataformats::DCA mDcaInfoCovPos;
@@ -1000,7 +1017,11 @@ struct decay3bodyBuilder {
10001017
// daughter PID
10011018
tpcNsigmaProton,
10021019
tpcNsigmaPion,
1003-
tpcNsigmaDeuteron);
1020+
tpcNsigmaDeuteron,
1021+
dEdxProton,
1022+
dEdxPion,
1023+
dEdxDeuteron,
1024+
tofNSigmaDeuteron);
10041025

10051026
if (kfparticleConfigurations.fillCandidateLiteTable) {
10061027
kfvtx3bodydatalite(
@@ -1050,7 +1071,11 @@ struct decay3bodyBuilder {
10501071
// daughter PID
10511072
tpcNsigmaProton,
10521073
tpcNsigmaPion,
1053-
tpcNsigmaDeuteron);
1074+
tpcNsigmaDeuteron,
1075+
dEdxProton,
1076+
dEdxPion,
1077+
dEdxDeuteron,
1078+
tofNSigmaDeuteron);
10541079
}
10551080
LOG(debug) << "Table filled.";
10561081

@@ -1074,7 +1099,7 @@ struct decay3bodyBuilder {
10741099
}
10751100
PROCESS_SWITCH(decay3bodyBuilder, processRun3, "Produce DCA fitter decay3body tables", true);
10761101

1077-
void processRun3withKFParticle(MyCollisions const& collisions, FullTracksExtPIDIU const&, aod::Decay3Bodys const& decay3bodys, aod::BCsWithTimestamps const&)
1102+
void processRun3withKFParticle(ColwithEvTimes const& collisions, TrackExtPIDIUwithEvTimes const&, aod::Decay3Bodys const& decay3bodys, aod::BCsWithTimestamps const&)
10781103
{
10791104
for (const auto& collision : collisions) {
10801105
// event selection
@@ -1097,7 +1122,7 @@ struct decay3bodyBuilder {
10971122
// LOG(debug) << "Collision index: " << collIdx;
10981123
auto Decay3BodyTable_thisCollision = decay3bodys.sliceBy(perCollision, collIdx);
10991124
// LOG(debug) << "Decay3Body tables sliced per collision. Calling buildVtx3BodyDataTableKFParticle function...";
1100-
buildVtx3BodyDataTableKFParticle<FullTracksExtPIDIU>(collision, Decay3BodyTable_thisCollision, bachelorcharge);
1125+
buildVtx3BodyDataTableKFParticle<TrackExtPIDIUwithEvTimes, ColwithEvTimes>(collision, Decay3BodyTable_thisCollision, bachelorcharge);
11011126
LOG(debug) << "End of processKFParticle.";
11021127
}
11031128
}

PWGLF/TableProducer/Nuspex/threebodyKFTask.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ struct threebodyKFTask {
256256
vtx3bodydata.dcatrackpostopv(), vtx3bodydata.dcatracknegtopv(), vtx3bodydata.dcatrackbachtopv(),
257257
vtx3bodydata.track0sign(), vtx3bodydata.track1sign(), vtx3bodydata.track2sign(), // proton, pion, deuteron
258258
vtx3bodydata.tpcnsigmaproton(), vtx3bodydata.tpcnsigmapion(), vtx3bodydata.tpcnsigmadeuteron(),
259+
vtx3bodydata.tpcdedxproton(), vtx3bodydata.tpcdedxpion(), vtx3bodydata.tpcdedxdeuteron(),
260+
vtx3bodydata.tofnsigmadeuteron(),
259261
// MC info (-1 if not matched to MC particle)
260262
genP,
261263
genPt,
@@ -379,6 +381,8 @@ struct threebodyKFTask {
379381
-1, -1, -1,
380382
-1, -1, -1,
381383
-1, -1, -1,
384+
-1, -1, -1,
385+
-1,
382386
// gen information
383387
mcparticle.p(),
384388
mcparticle.pt(),

0 commit comments

Comments
 (0)