CbmRoot
CbmTrdRawMessageSpadic.h
Go to the documentation of this file.
1 
7 #ifndef CbmTrdRawMessageSpadic_H
8 #define CbmTrdRawMessageSpadic_H
9 
10 #include <Rtypes.h> // for ClassDef
11 #include <RtypesCore.h> // for Double_t
12 
13 #include <cstdint> // for int16_t, uint8_t, uint16_t, uint64_t
14 #include <vector> // for vector
15 
16 #include <boost/serialization/access.hpp>
17 #include <boost/serialization/base_object.hpp>
18 #include <boost/serialization/vector.hpp>
19 
20 namespace Spadic {
25  enum class MsMessageType : uint8_t {
26  kEPO =
27  0x40,
28  kSOM =
29  0x20,
30  kRDA =
31  0x80,
32  kINF =
33  0x10,
34  kNUL =
35  0x00,
36  kUNK = 0x01
37  };
38 
40  enum class TriggerType : uint8_t {
41  kGlobal = 0,
42  kSelf = 1,
43  kNeigh = 2,
44  kSandN = 3
45  };
46 
53  enum class MsInfoType : uint8_t {
54  kBOM,
55  kMSB,
56  kBUF,
57  kUNU,
58  kMIS
59  };
60 } // namespace Spadic
61 
62 
69 private:
71 
72  std::uint8_t fChannelID;
73  std::uint8_t fElinkID;
74  std::uint8_t fCrobId;
75  std::uint16_t fCriId;
76  std::uint8_t fHitType;
77  std::uint8_t fNrSamples;
78  bool fMultiHit;
79  std::uint64_t fFullTime;
80  std::vector<std::int16_t>
83 public:
86 
88  CbmTrdRawMessageSpadic(std::uint8_t channelId,
89  std::uint8_t elinkId,
90  std::uint8_t crobId,
91  std::uint16_t criId,
92  std::uint8_t hitType,
93  std::uint8_t nrSamples,
94  bool multiHi,
95  std::uint64_t fullTime,
96  std::vector<std::int16_t> samples);
97 
100 
102  virtual ~CbmTrdRawMessageSpadic();
103 
105  // CbmTrdRawMessageSpadic operator=(const CbmTrdRawMessageSpadic&);
107 
108  // ----------------- Getters -----------------------------
109 
110  std::uint8_t GetChannelId() const { return fChannelID; }
111  std::uint8_t GetElinkId() const { return fElinkID; }
112  std::uint8_t GetCrobId() const { return fCrobId; }
113  std::uint16_t GetCriId() const { return fCriId; }
114  std::uint8_t GetHitType() const { return fHitType; }
115  std::uint8_t GetNrSamples() const { return fNrSamples; }
116  bool GetMultiHit() const { return fMultiHit; }
117  std::uint64_t GetFullTime() const { return fFullTime; }
118  const std::vector<std::int16_t> GetSamples() const { return fSamples; }
119 
121  Double_t GetTime() const { return fFullTime * 62.5; }
122 
124  int16_t GetMaxAdc();
125 
126  // ----------------- Setters -----------------------------
127 
133  void SetSample(std::int16_t value, std::uint8_t pos);
134 
136  template<class Archive>
137  void serialize(Archive& ar, const unsigned int /*version*/) {
138  ar& fElinkID;
139  ar& fChannelID;
140  ar& fCrobId;
141  ar& fCriId;
142  ar& fHitType;
143  ar& fNrSamples;
144  ar& fMultiHit;
145  ar& fFullTime;
146  ar& fSamples;
147  }
148 
149  // Root Class Def Macro
151 };
152 
153 #endif
CbmTrdRawMessageSpadic::GetTime
Double_t GetTime() const
Definition: CbmTrdRawMessageSpadic.h:121
CbmTrdRawMessageSpadic::GetMultiHit
bool GetMultiHit() const
Definition: CbmTrdRawMessageSpadic.h:116
Spadic::MsInfoType::kUNU
@ kUNU
Unused request. 100. .... .... .... cccc.
CbmTrdRawMessageSpadic::GetFullTime
std::uint64_t GetFullTime() const
Definition: CbmTrdRawMessageSpadic.h:117
Spadic
Definition: CbmTrdRawMessageSpadic.h:20
CbmTrdRawMessageSpadic::fCriId
std::uint16_t fCriId
Definition: CbmTrdRawMessageSpadic.h:75
Spadic::TriggerType
TriggerType
Definition: CbmTrdRawMessageSpadic.h:40
CbmTrdRawMessageSpadic::fNrSamples
std::uint8_t fNrSamples
Definition: CbmTrdRawMessageSpadic.h:77
Spadic::MsMessageType::kNUL
@ kNUL
Microslice End. 0x0000000000000000 Last Word in a Microslice is 64 zeros.
CbmTrdRawMessageSpadic::SetSample
void SetSample(std::int16_t value, std::uint8_t pos)
Definition: CbmTrdRawMessageSpadic.cxx:70
CbmTrdRawMessageSpadic::serialize
void serialize(Archive &ar, const unsigned int)
Boost serialization function.
Definition: CbmTrdRawMessageSpadic.h:137
CbmTrdRawMessageSpadic::fSamples
std::vector< std::int16_t > fSamples
Definition: CbmTrdRawMessageSpadic.h:81
CbmTrdRawMessageSpadic
Base class for storing raw information which comes from the Spadic v2.2 trough flib or from a tsa fil...
Definition: CbmTrdRawMessageSpadic.h:68
CbmTrdRawMessageSpadic::GetMaxAdc
int16_t GetMaxAdc()
Definition: CbmTrdRawMessageSpadic.cxx:64
Spadic::MsMessageType::kUNK
@ kUNK
Unkown Word.
CbmTrdRawMessageSpadic::GetSamples
const std::vector< std::int16_t > GetSamples() const
Definition: CbmTrdRawMessageSpadic.h:118
CbmTrdRawMessageSpadic::ClassDef
ClassDef(CbmTrdRawMessageSpadic, 2)
CbmTrdRawMessageSpadic::fFullTime
std::uint64_t fFullTime
Definition: CbmTrdRawMessageSpadic.h:79
CbmTrdRawMessageSpadic::fCrobId
std::uint8_t fCrobId
Definition: CbmTrdRawMessageSpadic.h:74
Spadic::MsMessageType::kRDA
@ kRDA
Raw Data. Preceded by SOM. MSB: 1... .... always 64bits, bits after last transmitted sample are fille...
Spadic::MsMessageType::kSOM
@ kSOM
Start of Message. MSB: 001. .... timestamp (bits 50-35) in clockcycles. Currently (Feb 2020) only 11 ...
CbmTrdRawMessageSpadic::operator=
CbmTrdRawMessageSpadic & operator=(const CbmTrdRawMessageSpadic &)=default
CbmTrdRawMessageSpadic::CbmTrdRawMessageSpadic
CbmTrdRawMessageSpadic()
Definition: CbmTrdRawMessageSpadic.cxx:9
CbmTrdRawMessageSpadic::GetElinkId
std::uint8_t GetElinkId() const
Definition: CbmTrdRawMessageSpadic.h:111
Spadic::TriggerType::kGlobal
@ kGlobal
global trigger.
Spadic::MsMessageType::kINF
@ kINF
Info Message. MSB: 0001 .... The 20 LSBs of the 64bit word contain the 20 LSBs of a raw spadic InfoTy...
CbmTrdRawMessageSpadic::fHitType
std::uint8_t fHitType
Definition: CbmTrdRawMessageSpadic.h:76
CbmTrdRawMessageSpadic::fMultiHit
bool fMultiHit
Definition: CbmTrdRawMessageSpadic.h:78
Spadic::TriggerType::kNeigh
@ kNeigh
Neighbor trigger.
CbmTrdRawMessageSpadic::GetCrobId
std::uint8_t GetCrobId() const
Definition: CbmTrdRawMessageSpadic.h:112
Spadic::MsMessageType
MsMessageType
Definition: CbmTrdRawMessageSpadic.h:25
CbmTrdRawMessageSpadic::fElinkID
std::uint8_t fElinkID
Definition: CbmTrdRawMessageSpadic.h:73
Spadic::MsInfoType
MsInfoType
Definition: CbmTrdRawMessageSpadic.h:53
CbmTrdRawMessageSpadic::access
friend class boost::serialization::access
Definition: CbmTrdRawMessageSpadic.h:70
Spadic::MsInfoType::kBOM
@ kBOM
Buffer overflow count. 11nn nnnn nnnn nnnn cccc.
CbmTrdRawMessageSpadic::GetNrSamples
std::uint8_t GetNrSamples() const
Definition: CbmTrdRawMessageSpadic.h:115
Spadic::MsInfoType::kMSB
@ kMSB
Message build error. 010. .... .... .... cccc.
CbmTrdRawMessageSpadic::GetCriId
std::uint16_t GetCriId() const
Definition: CbmTrdRawMessageSpadic.h:113
Spadic::TriggerType::kSelf
@ kSelf
Self trigger.
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmTrdRawMessageSpadic::~CbmTrdRawMessageSpadic
virtual ~CbmTrdRawMessageSpadic()
Definition: CbmTrdRawMessageSpadic.cxx:62
CbmTrdRawMessageSpadic::GetHitType
std::uint8_t GetHitType() const
Definition: CbmTrdRawMessageSpadic.h:114
Spadic::MsMessageType::kEPO
@ kEPO
Epoch Marker. MSB: 01.. .... uTS-MSB (bits 61-32) in clockcycles.
Spadic::TriggerType::kSandN
@ kSandN
Self and neighbor trigger at the same time.
Spadic::MsInfoType::kMIS
@ kMIS
Missing request. 101. .... .... .... ....
CbmTrdRawMessageSpadic::GetChannelId
std::uint8_t GetChannelId() const
Definition: CbmTrdRawMessageSpadic.h:110
Spadic::MsInfoType::kBUF
@ kBUF
Buffer full. 011b b... .... .... cccc.
CbmTrdRawMessageSpadic::fChannelID
std::uint8_t fChannelID
Definition: CbmTrdRawMessageSpadic.h:72