2121#include " ReconstructionDataFormats/PrimaryVertex.h"
2222#include < array>
2323#include < vector>
24+ #include < bit>
25+ #include < format>
2426
2527namespace o2 ::trackstudy
2628{
27- struct MCTrackInfo {
2829
29- inline float getMCTimeMUS () const { return bcInTF * o2::constants::lhc::LHCBunchSpacingMUS; }
30- inline bool hasITSHitOnLr (int i) const { return (pattITSCl & ((0x1 << i) & 0x7f )) != 0 ; }
30+ struct ITSTrackInfo {
31+ inline bool hasITSHitOnLr (int i) const { return (pattClITS & ((0x1 << i) & 0x7f )) != 0 ; }
3132 int getNITSClusCont () const ;
3233 int getNITSClusForAB () const ;
3334 int getLowestITSLayer () const ;
3435 int getHighestITSLayer () const ;
36+ int getNITSClusTrackable () const noexcept { return std::popcount (pattClITS); }
37+
38+ std::string getPattString () const { return std::format (" {:07b}" , pattClITS); }
39+
40+ uint8_t nClITS = 0 ;
41+ uint8_t pattClITS = 0 ;
42+
43+ ClassDefNV (ITSTrackInfo, 1 );
44+ };
45+
46+ struct MCTrackInfo : public ITSTrackInfo {
47+ inline float getMCTimeMUS () const { return bcInTF * o2::constants::lhc::LHCBunchSpacingMUS; }
3548
3649 o2::track::TrackPar track{};
3750 o2::MCCompLabel label{};
@@ -41,21 +54,20 @@ struct MCTrackInfo {
4154 int pdg = 0 ;
4255 int pdgParent = 0 ;
4356 int parentEntry = -1 ;
44- int16_t nTPCCl = 0 ;
45- int16_t nTPCClShared = 0 ;
57+ uint16_t nTPCCl = 0 ;
58+ uint16_t nTPCClShared = 0 ;
4659 int8_t parentDecID = -1 ;
47- uint8_t minTPCRow = -1 ;
48- uint8_t maxTPCRow = 0 ;
60+ int8_t minTPCRow = -1 ;
61+ int8_t maxTPCRow = 0 ;
4962 uint8_t nUsedPadRows = 0 ;
5063 uint8_t maxTPCRowInner = 0 ; // highest row in the sector containing the lowest one
51- uint8_t minTPCRowSect = -1 ;
52- uint8_t maxTPCRowSect = -1 ;
53- int8_t nITSCl = 0 ;
54- int8_t pattITSCl = 0 ;
55- ClassDefNV (MCTrackInfo, 4 );
64+ int8_t minTPCRowSect = -1 ;
65+ int8_t maxTPCRowSect = -1 ;
66+ uint8_t nITSClInv = 0 ;
67+ ClassDefNV (MCTrackInfo, 5 );
5668};
5769
58- struct RecTrack {
70+ struct RecTrack : public ITSTrackInfo {
5971 enum FakeFlag {
6072 FakeITS = 0x1 << 0 ,
6173 FakeTPC = 0x1 << 1 ,
@@ -71,19 +83,23 @@ struct RecTrack {
7183 o2::MCEventLabel pvLabel{};
7284 short pvID = -1 ;
7385 uint8_t flags = 0 ;
74- uint8_t nClITS = 0 ;
7586 uint8_t nClTPC = 0 ;
76- uint8_t pattITS = 0 ;
7787 int8_t lowestPadRow = -1 ;
88+ o2::dataformats::PrimaryVertex pv;
89+ o2::track::TrackParCov pvtrack{};
7890
91+ bool isFake () const { return flags != 0 ; }
7992 bool isFakeGLO () const { return flags & FakeGLO; }
8093 bool isFakeITS () const { return flags & FakeITS; }
8194 bool isFakeTPC () const { return flags & FakeTPC; }
8295 bool isFakeTRD () const { return flags & FakeTRD; }
8396 bool isFakeTOF () const { return flags & FakeTOF; }
8497 bool isFakeITSTPC () const { return flags & FakeITSTPC; }
98+ bool isFakeITSTPCTRD () const { return flags & FakeITSTPCTRD; }
99+
100+ float getTrack2Beam () const { return (pvID >= 0 ) ? pvtrack.getX () * pvtrack.getTgl () - pvtrack.getZ () + pv.getZ () : -9999 .f ; };
85101
86- ClassDefNV (RecTrack, 1 );
102+ ClassDefNV (RecTrack, 3 );
87103};
88104
89105struct TrackPairInfo {
0 commit comments