Skip to content

Commit 926cf55

Browse files
fmazzascFrancesco Mazzaschi
andauthored
PWGLF: add TOF information to hyp task (#8186)
Co-authored-by: Francesco Mazzaschi <fmazzasc@alipap1.cern.ch>
1 parent 72bf3a9 commit 926cf55

2 files changed

Lines changed: 64 additions & 46 deletions

File tree

PWGLF/DataModel/LFHypernucleiTables.h

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,49 +34,50 @@ DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); // Multiplicity with
3434
DECLARE_SOA_COLUMN(PsiTPC, psiTPC, float); // Psi with TPC estimator
3535
DECLARE_SOA_COLUMN(MultTPC, multTPC, float); // Multiplicity with TPC estimator
3636

37-
DECLARE_SOA_COLUMN(IsMatter, isMatter, bool); // bool: true for matter
38-
DECLARE_SOA_COLUMN(PtHe3, ptHe3, float); // Pt of the He daughter
39-
DECLARE_SOA_COLUMN(PhiHe3, phiHe3, float); // Phi of the He daughter
40-
DECLARE_SOA_COLUMN(EtaHe3, etaHe3, float); // Eta of the He daughter
41-
DECLARE_SOA_COLUMN(PtPi, ptPi, float); // Pt of the Pi daughter
42-
DECLARE_SOA_COLUMN(PhiPi, phiPi, float); // Phi of the Pi daughter
43-
DECLARE_SOA_COLUMN(EtaPi, etaPi, float); // Eta of the Pi daughter
44-
DECLARE_SOA_COLUMN(XPrimVtx, xPrimVtx, float); // Decay vertex of the candidate (x direction)
45-
DECLARE_SOA_COLUMN(YPrimVtx, yPrimVtx, float); // Decay vertex of the candidate (y direction)
46-
DECLARE_SOA_COLUMN(ZPrimVtx, zPrimVtx, float); // Decay vertex of the candidate (z direction)
47-
DECLARE_SOA_COLUMN(XDecVtx, xDecVtx, float); // Decay vertex of the candidate (x direction)
48-
DECLARE_SOA_COLUMN(YDecVtx, yDecVtx, float); // Decay vertex of the candidate (y direction)
49-
DECLARE_SOA_COLUMN(ZDecVtx, zDecVtx, float); // Decay vertex of the candidate (z direction)
50-
DECLARE_SOA_COLUMN(MassH3L, massH3L, float); // Squared mass w/ hypertriton mass hypo
51-
DECLARE_SOA_COLUMN(MassH4L, massH4L, float); // Squared mass w/ H4L mass hypo
52-
DECLARE_SOA_COLUMN(DcaV0Daug, dcaV0Daug, float); // DCA between daughters
53-
DECLARE_SOA_COLUMN(CosPA, cosPA, double); // Cosine of the pointing angle
54-
DECLARE_SOA_COLUMN(NSigmaHe, nSigmaHe, float); // Number of sigmas of the He daughter
55-
DECLARE_SOA_COLUMN(NTPCclusHe, nTPCclusHe, uint8_t); // Number of TPC clusters of the He daughter
56-
DECLARE_SOA_COLUMN(NTPCclusPi, nTPCclusPi, uint8_t); // Number of TPC clusters of the Pi daughter
57-
DECLARE_SOA_COLUMN(TPCsignalHe, tpcSignalHe, uint16_t); // TPC signal of the He daughter
58-
DECLARE_SOA_COLUMN(TPCsignalPi, tpcSignalPi, uint16_t); // TPC signal of the Pi daughter
59-
DECLARE_SOA_COLUMN(TPCChi2He, tpcChi2He, float); // TPC chi2 of the He daughter
60-
DECLARE_SOA_COLUMN(TrackedClSize, trackedClSize, int); // int: zero for non-tracked candidates
61-
DECLARE_SOA_COLUMN(Flags, flags, uint8_t); // Flags for PID in tracking (bits [0, 3] for negative daughter, [4,7] for positive daughter)
62-
DECLARE_SOA_COLUMN(TPCmomHe, tpcMomHe, float); // TPC momentum of the He daughter
63-
DECLARE_SOA_COLUMN(TPCmomPi, tpcMomPi, float); // TPC momentum of the Pi daughter
64-
DECLARE_SOA_COLUMN(ITSclusterSizesHe, itsClusterSizesHe, uint32_t); // ITS cluster size of the He daughter
65-
DECLARE_SOA_COLUMN(ITSclusterSizesPi, itsClusterSizesPi, uint32_t); // ITS cluster size of the Pi daughter
37+
DECLARE_SOA_COLUMN(IsMatter, isMatter, bool); // bool: true for matter
38+
DECLARE_SOA_COLUMN(PtHe3, ptHe3, float); // Pt of the He daughter
39+
DECLARE_SOA_COLUMN(PhiHe3, phiHe3, float); // Phi of the He daughter
40+
DECLARE_SOA_COLUMN(EtaHe3, etaHe3, float); // Eta of the He daughter
41+
DECLARE_SOA_COLUMN(PtPi, ptPi, float); // Pt of the Pi daughter
42+
DECLARE_SOA_COLUMN(PhiPi, phiPi, float); // Phi of the Pi daughter
43+
DECLARE_SOA_COLUMN(EtaPi, etaPi, float); // Eta of the Pi daughter
44+
DECLARE_SOA_COLUMN(XPrimVtx, xPrimVtx, float); // Decay vertex of the candidate (x direction)
45+
DECLARE_SOA_COLUMN(YPrimVtx, yPrimVtx, float); // Decay vertex of the candidate (y direction)
46+
DECLARE_SOA_COLUMN(ZPrimVtx, zPrimVtx, float); // Decay vertex of the candidate (z direction)
47+
DECLARE_SOA_COLUMN(XDecVtx, xDecVtx, float); // Decay vertex of the candidate (x direction)
48+
DECLARE_SOA_COLUMN(YDecVtx, yDecVtx, float); // Decay vertex of the candidate (y direction)
49+
DECLARE_SOA_COLUMN(ZDecVtx, zDecVtx, float); // Decay vertex of the candidate (z direction)
50+
DECLARE_SOA_COLUMN(MassH3L, massH3L, float); // Squared mass w/ hypertriton mass hypo
51+
DECLARE_SOA_COLUMN(MassH4L, massH4L, float); // Squared mass w/ H4L mass hypo
52+
DECLARE_SOA_COLUMN(DcaV0Daug, dcaV0Daug, float); // DCA between daughters
53+
DECLARE_SOA_COLUMN(CosPA, cosPA, double); // Cosine of the pointing angle
54+
DECLARE_SOA_COLUMN(NSigmaHe, nSigmaHe, float); // Number of sigmas of the He daughter
55+
DECLARE_SOA_COLUMN(NTPCclusHe, nTPCclusHe, uint8_t); // Number of TPC clusters of the He daughter
56+
DECLARE_SOA_COLUMN(NTPCclusPi, nTPCclusPi, uint8_t); // Number of TPC clusters of the Pi daughter
57+
DECLARE_SOA_COLUMN(TPCsignalHe, tpcSignalHe, uint16_t); // TPC signal of the He daughter
58+
DECLARE_SOA_COLUMN(TPCsignalPi, tpcSignalPi, uint16_t); // TPC signal of the Pi daughter
59+
DECLARE_SOA_COLUMN(TPCChi2He, tpcChi2He, float); // TPC chi2 of the He daughter
60+
DECLARE_SOA_COLUMN(TrackedClSize, trackedClSize, int); // int: zero for non-tracked candidates
61+
DECLARE_SOA_COLUMN(Flags, flags, uint8_t); // Flags for PID in tracking (bits [0, 3] for negative daughter, [4,7] for positive daughter)
62+
DECLARE_SOA_COLUMN(TPCmomHe, tpcMomHe, float); // TPC momentum of the He daughter
63+
DECLARE_SOA_COLUMN(TPCmomPi, tpcMomPi, float); // TPC momentum of the Pi daughter
64+
DECLARE_SOA_COLUMN(TOFMass, tofMass, float); // TOF mass of the candidate
65+
DECLARE_SOA_COLUMN(ITSclusterSizesHe, itsClusterSizesHe, uint32_t); // ITS cluster size of the He daughter
66+
DECLARE_SOA_COLUMN(ITSclusterSizesPi, itsClusterSizesPi, uint32_t); // ITS cluster size of the Pi daughter
6667
DECLARE_SOA_COLUMN(ITSclusterSizesHyp, itsClusterSizesHyp, uint32_t); // ITS cluster size of the Pi daughter
67-
DECLARE_SOA_COLUMN(DcaHe, dcaHe, float); // DCA between He daughter and V0
68-
DECLARE_SOA_COLUMN(DcaPi, dcaPi, float); // DCA between pi daughter and V0
69-
DECLARE_SOA_COLUMN(GenPt, genPt, float); // Pt of the hypertriton
70-
DECLARE_SOA_COLUMN(GenPhi, genPhi, float); // Phi of the hypertriton
71-
DECLARE_SOA_COLUMN(GenEta, genEta, float); // Eta of the hypertriton
72-
DECLARE_SOA_COLUMN(GenPtHe3, genPtHe3, float); // Pt of the He daughter (to be used for the recalibration)
73-
DECLARE_SOA_COLUMN(GenXDecVtx, genXDecVtx, float); // Decay vertex of the candidate (x direction)
74-
DECLARE_SOA_COLUMN(GenYDecVtx, genYDecVtx, float); // Decay vertex of the candidate (y direction)
75-
DECLARE_SOA_COLUMN(GenZDecVtx, genZDecVtx, float); // Decay vertex of the candidate (z direction)
76-
DECLARE_SOA_COLUMN(IsReco, isReco, bool); // bool: true for reco
77-
DECLARE_SOA_COLUMN(IsSignal, isSignal, bool); // bool: true for signal
78-
DECLARE_SOA_COLUMN(IsRecoMCCollision, isRecoMCCollision, bool); // bool: true for reco MC collision
79-
DECLARE_SOA_COLUMN(IsSurvEvSel, isSurvEvSel, bool); // bool: true for survived event selection
68+
DECLARE_SOA_COLUMN(DcaHe, dcaHe, float); // DCA between He daughter and V0
69+
DECLARE_SOA_COLUMN(DcaPi, dcaPi, float); // DCA between pi daughter and V0
70+
DECLARE_SOA_COLUMN(GenPt, genPt, float); // Pt of the hypertriton
71+
DECLARE_SOA_COLUMN(GenPhi, genPhi, float); // Phi of the hypertriton
72+
DECLARE_SOA_COLUMN(GenEta, genEta, float); // Eta of the hypertriton
73+
DECLARE_SOA_COLUMN(GenPtHe3, genPtHe3, float); // Pt of the He daughter (to be used for the recalibration)
74+
DECLARE_SOA_COLUMN(GenXDecVtx, genXDecVtx, float); // Decay vertex of the candidate (x direction)
75+
DECLARE_SOA_COLUMN(GenYDecVtx, genYDecVtx, float); // Decay vertex of the candidate (y direction)
76+
DECLARE_SOA_COLUMN(GenZDecVtx, genZDecVtx, float); // Decay vertex of the candidate (z direction)
77+
DECLARE_SOA_COLUMN(IsReco, isReco, bool); // bool: true for reco
78+
DECLARE_SOA_COLUMN(IsSignal, isSignal, bool); // bool: true for signal
79+
DECLARE_SOA_COLUMN(IsRecoMCCollision, isRecoMCCollision, bool); // bool: true for reco MC collision
80+
DECLARE_SOA_COLUMN(IsSurvEvSel, isSurvEvSel, bool); // bool: true for survived event selection
8081
} // namespace hyperrec
8182

8283
DECLARE_SOA_TABLE(DataHypCands, "AOD", "HYPCANDS",
@@ -91,6 +92,7 @@ DECLARE_SOA_TABLE(DataHypCands, "AOD", "HYPCANDS",
9192
hyperrec::DcaV0Daug, hyperrec::DcaHe, hyperrec::DcaPi,
9293
hyperrec::NSigmaHe, hyperrec::NTPCclusHe, hyperrec::NTPCclusPi,
9394
hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, hyperrec::TPCChi2He,
95+
hyperrec::TOFMass,
9496
hyperrec::ITSclusterSizesHe, hyperrec::ITSclusterSizesPi,
9597
hyperrec::Flags, hyperrec::TrackedClSize);
9698

@@ -109,6 +111,7 @@ DECLARE_SOA_TABLE(DataHypCandsFlow, "AOD", "HYPCANDSFLOW",
109111
hyperrec::DcaV0Daug, hyperrec::DcaHe, hyperrec::DcaPi,
110112
hyperrec::NSigmaHe, hyperrec::NTPCclusHe, hyperrec::NTPCclusPi,
111113
hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, hyperrec::TPCChi2He,
114+
hyperrec::TOFMass,
112115
hyperrec::ITSclusterSizesHe, hyperrec::ITSclusterSizesPi,
113116
hyperrec::Flags, hyperrec::TrackedClSize);
114117

@@ -124,6 +127,7 @@ DECLARE_SOA_TABLE(MCHypCands, "AOD", "MCHYPCANDS",
124127
hyperrec::DcaV0Daug, hyperrec::DcaHe, hyperrec::DcaPi,
125128
hyperrec::NSigmaHe, hyperrec::NTPCclusHe, hyperrec::NTPCclusPi,
126129
hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, hyperrec::TPCChi2He,
130+
hyperrec::TOFMass,
127131
hyperrec::ITSclusterSizesHe, hyperrec::ITSclusterSizesPi,
128132
hyperrec::Flags, hyperrec::TrackedClSize,
129133
hyperrec::GenPt,

PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "EventFiltering/ZorroSummary.h"
3535

3636
#include "Common/Core/PID/TPCPIDResponse.h"
37+
#include "Common/Core/PID/PIDTOF.h"
38+
#include "Common/TableProducer/PID/pidTOFBase.h"
3739
#include "DataFormatsTPC/BetheBlochAleph.h"
3840
#include "DCAFitter/DCAFitterN.h"
3941
#include "PWGLF/Utils/svPoolCreator.h"
@@ -44,7 +46,7 @@ using namespace o2::framework;
4446
using namespace o2::framework::expressions;
4547
using std::array;
4648
using CollBracket = o2::math_utils::Bracket<int>;
47-
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU>;
49+
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TOFSignal, aod::TOFEvTime>;
4850
using CollisionsFull = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0As, aod::CentFT0Cs, aod::CentFT0Ms>;
4951
using CollisionsFullMC = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::CentFT0As, aod::CentFT0Cs, aod::CentFT0Ms>;
5052

@@ -54,7 +56,7 @@ namespace
5456
{
5557
constexpr double betheBlochDefault[1][6]{{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}};
5658
static const std::vector<std::string> betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"};
57-
static const std::vector<std::string> particleNames{"He3"};
59+
static const std::vector<std::string> particleName{"He3"};
5860
std::shared_ptr<TH1> hEvents;
5961
std::shared_ptr<TH1> hZvtx;
6062
std::shared_ptr<TH1> hCentFT0A;
@@ -103,6 +105,7 @@ struct hyperCandidate {
103105
uint16_t tpcSignalHe3 = 0u;
104106
uint16_t tpcSignalPi = 0u;
105107
float tpcChi2He3 = 0.f;
108+
float massTOFHe3 = 0.f;
106109
uint8_t nTPCClustersHe3 = 0u;
107110
uint8_t nTPCClustersPi = 0u;
108111
uint32_t clusterSizeITSHe3 = 0u;
@@ -152,6 +155,8 @@ struct hyperRecoTask {
152155
o2::vertexing::DCAFitterN<2> fitter;
153156
svPoolCreator svCreator{heDauPdg, 211};
154157

158+
o2::pid::tof::Beta<TracksFull::iterator> responseBeta;
159+
155160
// daughter masses
156161
float he3Mass = o2::constants::physics::MassHelium3;
157162
float he4Mass = o2::constants::physics::MassAlpha;
@@ -160,7 +165,7 @@ struct hyperRecoTask {
160165
Configurable<bool> useCustomVertexer{"useCustomVertexer", false, "Use custom vertexer"};
161166
Configurable<bool> skipAmbiTracks{"skipAmbiTracks", false, "Skip ambiguous tracks"};
162167
Configurable<float> customVertexerTimeMargin{"customVertexerTimeMargin", 800, "Time margin for custom vertexer (ns)"};
163-
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {betheBlochDefault[0], 1, 6, particleNames, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for He3"};
168+
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {betheBlochDefault[0], 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for He3"};
164169
Configurable<bool> cfgCompensatePIDinTracking{"cfgCompensatePIDinTracking", true, "If true, divide tpcInnerParam by the electric charge"};
165170
Configurable<int> cfgMaterialCorrection{"cfgMaterialCorrection", static_cast<int>(o2::base::Propagator::MatCorrType::USEMatCorrNONE), "Type of material correction"};
166171

@@ -500,6 +505,12 @@ struct hyperRecoTask {
500505
hypCand.piTrackID = piTrack.globalIndex();
501506
hypCand.collisionID = collision.globalIndex();
502507

508+
if (heTrack.hasTOF()) {
509+
float beta = responseBeta.GetBeta(heTrack);
510+
beta = std::min(1.f - 1.e-6f, std::max(1.e-4f, beta)); /// sometimes beta > 1 or < 0, to be checked
511+
hypCand.massTOFHe3 = hypCand.momHe3TPC * 2.f * std::sqrt(1.f / (beta * beta) - 1.f);
512+
}
513+
503514
hDeDx3HeSel->Fill(heTrack.sign() * hypCand.momHe3TPC, heTrack.tpcSignal());
504515
hNsigma3HeSel->Fill(heTrack.sign() * hypCand.momHe3TPC, hypCand.nSigmaHe3);
505516
hyperCandidates.push_back(hypCand);
@@ -653,6 +664,7 @@ struct hyperRecoTask {
653664
hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY,
654665
hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi,
655666
hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3,
667+
hypCand.massTOFHe3,
656668
hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedHypClSize);
657669
}
658670
}
@@ -683,6 +695,7 @@ struct hyperRecoTask {
683695
hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY,
684696
hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi,
685697
hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3,
698+
hypCand.massTOFHe3,
686699
hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedHypClSize);
687700
}
688701
}
@@ -717,6 +730,7 @@ struct hyperRecoTask {
717730
hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY,
718731
hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi,
719732
hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3,
733+
hypCand.massTOFHe3,
720734
hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedHypClSize,
721735
chargeFactor * hypCand.genPt(), hypCand.genPhi(), hypCand.genEta(), hypCand.genPtHe3(),
722736
hypCand.gDecVtx[0], hypCand.gDecVtx[1], hypCand.gDecVtx[2],
@@ -789,7 +803,7 @@ struct hyperRecoTask {
789803
-1, -1, -1,
790804
-1, -1, -1,
791805
-1, -1, -1,
792-
-1, -1, -1, -1, -1,
806+
-1, -1, -1, -1, -1, -1,
793807
-1, -1, -1, false,
794808
chargeFactor * hypCand.genPt(), hypCand.genPhi(), hypCand.genEta(), hypCand.genPtHe3(),
795809
hypCand.gDecVtx[0], hypCand.gDecVtx[1], hypCand.gDecVtx[2],

0 commit comments

Comments
 (0)