88// In applying this license CERN does not waive the privileges and immunities
99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
11- // authors Janik Ditzel <jditzel@cern.ch> and Michael Hartung <mhartung@cern.ch>
11+
12+ // / \file LFHypernucleiKfTables.h
13+ // / \brief Slim hypernuclei kf tables
14+ // / \author Janik Ditzel <jditzel@cern.ch> and Michael Hartung <mhartung@cern.ch>
1215
1316#ifndef PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_
1417#define PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_
1518
19+ #include < cmath>
1620#include " Framework/ASoA.h"
1721#include " Framework/AnalysisDataModel.h"
1822#include " Common/DataModel/Centrality.h"
1923#include " Common/Core/RecoDecay.h"
2024
2125namespace o2 ::aod
2226{
23- namespace hykfmcColl
27+ namespace hykfmccoll
2428{
2529DECLARE_SOA_COLUMN (PassedEvSel, passedEvSel, bool ); // !
2630}
2731DECLARE_SOA_TABLE (HypKfMcColls, " AOD" , " HYPKFMCCOLL" ,
2832 o2::soa::Index<>,
29- hykfmcColl ::PassedEvSel,
33+ hykfmccoll ::PassedEvSel,
3034 mccollision::PosX,
3135 mccollision::PosY,
3236 mccollision::PosZ);
@@ -40,9 +44,10 @@ DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //!
4044DECLARE_SOA_COLUMN (Svx, svx, float ); // !
4145DECLARE_SOA_COLUMN (Svy, svy, float ); // !
4246DECLARE_SOA_COLUMN (Svz, svz, float ); // !
47+ DECLARE_SOA_COLUMN (Occupancy, occupancy, int ); // !
4348DECLARE_SOA_DYNAMIC_COLUMN (Pt, pt, [](float px, float py) { return RecoDecay::pt (std::array{px, py}); });
44- DECLARE_SOA_DYNAMIC_COLUMN (Y, y, [](float E, float pz) { return 0.5 * TMath::Log ((E + pz) / (E - pz)); });
45- DECLARE_SOA_DYNAMIC_COLUMN (Mass, mass, [](float E, float px, float py, float pz) { return TMath::Sqrt (E * E - px * px - py * py - pz * pz); });
49+ DECLARE_SOA_DYNAMIC_COLUMN (Y, y, [](float E, float pz) { return 0.5 * std::log ((E + pz) / (E - pz)); });
50+ DECLARE_SOA_DYNAMIC_COLUMN (Mass, mass, [](float E, float px, float py, float pz) { return std::sqrt (E * E - px * px - py * py - pz * pz); });
4651DECLARE_SOA_DYNAMIC_COLUMN (IsMatter, isMatter, [](int pdgCode) { return pdgCode > 0 ; });
4752} // namespace hykfmc
4853
@@ -67,56 +72,57 @@ using HypKfMcPart = HypKfMcParts::iterator;
6772
6873DECLARE_SOA_TABLE (HypKfColls, " AOD" , " HYPKFCOLL" ,
6974 o2::soa::Index<>,
70- hykfmcColl ::PassedEvSel,
75+ hykfmccoll ::PassedEvSel,
7176 hykfmc::HypKfMcCollId,
7277 collision::PosX,
7378 collision::PosY,
7479 collision::PosZ,
7580 cent::CentFT0A,
7681 cent::CentFT0C,
77- cent::CentFT0M);
82+ cent::CentFT0M,
83+ hykfmc::Occupancy);
7884using HypKfColl = HypKfColls::iterator;
7985
8086namespace hykftrk
8187{
8288DECLARE_SOA_INDEX_COLUMN (HypKfColl, hypKfColl);
8389DECLARE_SOA_COLUMN (Rigidity, rigidity, float ); // !
84- DECLARE_SOA_COLUMN (TPCnCluster , tpcNcluster, float ); // !
85- DECLARE_SOA_COLUMN (TPCnSigma , tpcNsigma, float ); // !
86- DECLARE_SOA_COLUMN (TPCnSigmaNhp , tpcNsigmaNhp, float ); // !
87- DECLARE_SOA_COLUMN (TPCnSigmaNlp , tpcNsigmaNlp, float ); // !
88- DECLARE_SOA_COLUMN (TOFMass , tofMass, float ); // !
90+ DECLARE_SOA_COLUMN (TpcNcluster , tpcNcluster, float ); // !
91+ DECLARE_SOA_COLUMN (TpcNsigma , tpcNsigma, float ); // !
92+ DECLARE_SOA_COLUMN (TpcNsigmaNhp , tpcNsigmaNhp, float ); // !
93+ DECLARE_SOA_COLUMN (TpcNsigmaNlp , tpcNsigmaNlp, float ); // !
94+ DECLARE_SOA_COLUMN (TofMass , tofMass, float ); // !
8995DECLARE_SOA_COLUMN (IsPVContributor, isPVContributor, bool ); // !
9096DECLARE_SOA_COLUMN (SubMass, subMass, float ); // !
91- DECLARE_SOA_DYNAMIC_COLUMN (Px, px, [](float pt, float phi) { return (double )pt * TMath::Cos (phi); });
92- DECLARE_SOA_DYNAMIC_COLUMN (Py, py, [](float pt, float phi) { return (double )pt * TMath::Sin (phi); });
93- DECLARE_SOA_DYNAMIC_COLUMN (Pz, pz, [](float pt, float eta) { return (double )pt * TMath::SinH (eta); });
94- DECLARE_SOA_DYNAMIC_COLUMN (P, p, [](float pt, float eta) { return pt * TMath::CosH (eta); }); //
95- DECLARE_SOA_DYNAMIC_COLUMN (Y, y, [](float pt, float eta, float mass) { return std::log ((RecoDecay::sqrtSumOfSquares (mass, pt * TMath::CosH (eta)) + pt * TMath::SinH (eta)) / RecoDecay::sqrtSumOfSquares (mass, pt)); });
96- DECLARE_SOA_DYNAMIC_COLUMN (Lambda, lambda, [](float eta) { return 1 . / TMath::CosH (eta); });
97- DECLARE_SOA_DYNAMIC_COLUMN (ITSnCluster , itsNcluster, [](uint32_t itsClusterSizes) {
97+ DECLARE_SOA_DYNAMIC_COLUMN (Px, px, [](float pt, float phi) { return (double )pt * std::cos (phi); });
98+ DECLARE_SOA_DYNAMIC_COLUMN (Py, py, [](float pt, float phi) { return (double )pt * std::sin (phi); });
99+ DECLARE_SOA_DYNAMIC_COLUMN (Pz, pz, [](float pt, float eta) { return (double )pt * std::sinh (eta); });
100+ DECLARE_SOA_DYNAMIC_COLUMN (P, p, [](float pt, float eta) { return pt * std::cosh (eta); }); //
101+ DECLARE_SOA_DYNAMIC_COLUMN (Y, y, [](float pt, float eta, float mass) { return std::log ((RecoDecay::sqrtSumOfSquares (mass, pt * std::cosh (eta)) + pt * std::sinh (eta)) / RecoDecay::sqrtSumOfSquares (mass, pt)); });
102+ DECLARE_SOA_DYNAMIC_COLUMN (Lambda, lambda, [](float eta) { return 1 . / std::cosh (eta); });
103+ DECLARE_SOA_DYNAMIC_COLUMN (ItsNcluster , itsNcluster, [](uint32_t itsClusterSizes) {
98104 uint8_t n = 0 ;
99105 for (uint8_t i = 0 ; i < 7 ; i++) {
100106 if (itsClusterSizes >> (4 * i) & 15 )
101107 n++;
102108 }
103109 return n;
104110});
105- DECLARE_SOA_DYNAMIC_COLUMN (ITSfirstLayer , itsFirstLayer, [](uint32_t itsClusterSizes) {
111+ DECLARE_SOA_DYNAMIC_COLUMN (ItsFirstLayer , itsFirstLayer, [](uint32_t itsClusterSizes) {
106112 for (int i = 0 ; i < 8 ; i++) {
107113 if (itsClusterSizes >> (4 * i) & 15 )
108114 return i;
109115 }
110116 return -999 ;
111117});
112- DECLARE_SOA_DYNAMIC_COLUMN (ITSmeanClsSize , itsMeanClsSize, [](uint32_t itsClusterSizes) {
118+ DECLARE_SOA_DYNAMIC_COLUMN (ItsMeanClsSize , itsMeanClsSize, [](uint32_t itsClusterSizes) {
113119 int sum = 0 , n = 0 ;
114120 for (int i = 0 ; i < 8 ; i++) {
115121 sum += (itsClusterSizes >> (4 * i) & 15 );
116122 if (itsClusterSizes >> (4 * i) & 15 )
117123 n++;
118124 }
119- return static_cast <float >(sum) / n;
125+ return n > 0 ? static_cast <float >(sum) / n : 0 . f ;
120126});
121127} // namespace hykftrk
122128
@@ -128,25 +134,25 @@ DECLARE_SOA_TABLE(HypKfTracks, "AOD", "HYPKFTRACK",
128134 track::Phi,
129135 track::DcaXY,
130136 track::DcaZ,
131- hykftrk::TPCnCluster ,
137+ hykftrk::TpcNcluster ,
132138 track::TPCChi2NCl,
133139 track::ITSClusterSizes,
134140 track::ITSChi2NCl,
135141 hykftrk::Rigidity,
136142 track::TPCSignal,
137- hykftrk::TPCnSigma ,
138- hykftrk::TPCnSigmaNhp ,
139- hykftrk::TPCnSigmaNlp ,
140- hykftrk::TOFMass ,
143+ hykftrk::TpcNsigma ,
144+ hykftrk::TpcNsigmaNhp ,
145+ hykftrk::TpcNsigmaNlp ,
146+ hykftrk::TofMass ,
141147 hykftrk::IsPVContributor,
142148 hykftrk::Px<track::Pt, track::Phi>,
143149 hykftrk::Py<track::Pt, track::Phi>,
144150 hykftrk::Pz<track::Pt, track::Eta>,
145151 hykftrk::P<track::Pt, track::Eta>,
146152 hykftrk::Lambda<track::Eta>,
147- hykftrk::ITSnCluster <track::ITSClusterSizes>,
148- hykftrk::ITSfirstLayer <track::ITSClusterSizes>,
149- hykftrk::ITSmeanClsSize <track::ITSClusterSizes>);
153+ hykftrk::ItsNcluster <track::ITSClusterSizes>,
154+ hykftrk::ItsFirstLayer <track::ITSClusterSizes>,
155+ hykftrk::ItsMeanClsSize <track::ITSClusterSizes>);
150156using HypKfTrack = HypKfTracks::iterator;
151157
152158DECLARE_SOA_TABLE (HypKfSubDs, " AOD" , " HYPKFSUBD" ,
@@ -168,10 +174,10 @@ namespace hykfhyp
168174{
169175DECLARE_SOA_INDEX_COLUMN (HypKfColl, hypKfColl);
170176DECLARE_SOA_INDEX_COLUMN (HypKfMcPart, hypKfMcPart);
171- DECLARE_SOA_ARRAY_INDEX_COLUMN (HypKfDaughtAdd, addons );
172- DECLARE_SOA_ARRAY_INDEX_COLUMN (HypKfTrack, daughterTracks );
177+ DECLARE_SOA_ARRAY_INDEX_COLUMN (HypKfDaughtAdd, hypKfDaughtAdd );
178+ DECLARE_SOA_ARRAY_INDEX_COLUMN (HypKfTrack, hypKfTrack );
173179DECLARE_SOA_SELF_INDEX_COLUMN_FULL (HypDaughter, hypDaughter, int , " HypKfHypNucs" );
174- DECLARE_SOA_ARRAY_INDEX_COLUMN (HypKfSubD, subDaughters );
180+ DECLARE_SOA_ARRAY_INDEX_COLUMN (HypKfSubD, hypKfSubD );
175181DECLARE_SOA_COLUMN (Primary, primary, bool ); // !
176182DECLARE_SOA_COLUMN (Mass, mass, float ); // !
177183DECLARE_SOA_COLUMN (Px, px, float ); // !
0 commit comments