CbmRoot
Loading...
Searching...
No Matches
CbmTrdRawMessageSpadic.h
Go to the documentation of this file.
1/* Copyright (C) 2020-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dennis Spicker, Florian Uhlig [committer] */
4
11#ifndef CbmTrdRawMessageSpadic_H
12#define CbmTrdRawMessageSpadic_H
13
14#include <boost/serialization/access.hpp>
15#include <boost/serialization/vector.hpp>
16
17#include <cstdint>
18#include <vector> // for vector
19
20namespace Spadic
21{
26 enum class MsMessageType : uint8_t
27 {
28 kSOM = 0x20,
29 kEOM = 0x30,
30 kEPO = 0x40,
31 kRDA = 0x80,
32 kINF = 0x10,
33 kNUL = 0x00,
34 kUNK = 0x01
35 };
36
38 enum class eTriggerType : uint8_t
39 {
40 kGlobal = 0,
41 kSelf = 1,
42 kNeigh = 2,
43 kSandN = 3
44 };
45
52 enum class MsInfoType : uint8_t
53 {
54 kBOM = 0,
55 kMSB,
56 kBUF,
57 kUNU,
58 kMIS,
63 };
64} // namespace Spadic
65
66
73private:
75
76 std::uint8_t fChannelID;
77 std::uint8_t fElinkID;
78 std::uint8_t fCrobId;
79 std::uint16_t fCriId;
80 std::uint8_t fHitType;
81 std::uint8_t fNrSamples;
83 std::uint64_t fFullTime;
84 std::vector<std::int16_t> fSamples;
86public:
89
91 CbmTrdRawMessageSpadic(std::uint8_t channelId, std::uint8_t elinkId, std::uint8_t crobId, std::uint16_t criId,
92 std::uint8_t hitType, std::uint8_t nrSamples, bool multiHi, std::uint64_t fullTime,
93 std::vector<std::int16_t> samples);
94
97
100
102 // CbmTrdRawMessageSpadic operator=(const CbmTrdRawMessageSpadic&);
104
105 // ----------------- Getters -----------------------------
106 static const char* GetBranchName() { return "CbmTrdRawMessageSpadic"; }
107
108 std::uint8_t GetChannelId() const { return fChannelID; }
109 std::uint8_t GetElinkId() const { return fElinkID; }
110 std::uint8_t GetCrobId() const { return fCrobId; }
111 std::uint16_t GetCriId() const { return fCriId; }
112 std::uint8_t GetHitType() const { return fHitType; }
113 std::uint8_t GetNrSamples() const { return fNrSamples; }
114 bool GetMultiHit() const { return fMultiHit; }
115 std::uint64_t GetFullTime() const { return fFullTime; }
116 const std::vector<std::int16_t>* GetSamples() const { return &fSamples; }
117
119 double GetTime() const { return (fFullTime * 62.5); }
120
123
125 void SetTime(double setvalue) { fFullTime = static_cast<std::uint64_t>(setvalue / 62.5); }
126
128 int16_t GetMaxAdc();
129
130 // ----------------- Setters -----------------------------
131
137 void SetSample(std::int16_t value, std::uint8_t pos);
138
140 template<class Archive>
141 void serialize(Archive& ar, const unsigned int /*version*/)
142 {
143 ar& fElinkID;
144 ar& fChannelID;
145 ar& fCrobId;
146 ar& fCriId;
147 ar& fHitType;
148 ar& fNrSamples;
149 ar& fMultiHit;
150 ar& fFullTime;
151 ar& fSamples;
152 }
153};
154
155#endif
Base class for storing raw information which comes from the Spadic v2.2 trough flib or from a tsa fil...
std::uint64_t GetFullTime() const
void SetTime(double setvalue)
static const char * GetBranchName()
const std::vector< std::int16_t > * GetSamples() const
void IncNrSamples()
increase the number of samples stored in this raw message by one
std::uint8_t GetChannelId() const
void SetSample(std::int16_t value, std::uint8_t pos)
std::uint8_t GetNrSamples() const
std::uint8_t GetCrobId() const
std::vector< std::int16_t > fSamples
std::uint8_t GetHitType() const
std::uint8_t GetElinkId() const
std::uint16_t GetCriId() const
void serialize(Archive &ar, const unsigned int)
Boost serialization function.
friend class boost::serialization::access
CbmTrdRawMessageSpadic & operator=(const CbmTrdRawMessageSpadic &)=default
@ kUNU
Unused request. 100. .... .... .... cccc.
@ kChannelBufM
Channel buffer full and multihit from kEPO msg.
@ kChannelBuf
Channel buffer full from kEPO msg.
@ kNInfMsgs
Number of different info messages.
@ kBOM
Buffer overflow count. 11nn nnnn nnnn nnnn cccc.
@ kMIS
Missing request. 101. .... .... .... ....
@ kOrdFifoBuf
Multi-hit but ordering buffer full from kEPO msg.
@ kBUF
Buffer full. 011b b... .... .... cccc.
@ kMSB
Message build error. 010. .... .... .... cccc.
@ kNeigh
Neighbor trigger.
@ kGlobal
global trigger.
@ kSelf
Self trigger.
@ kSandN
Self and neighbor trigger at the same time.
@ kNUL
Microslice End.
@ kSOM
Start of Message.
@ kEPO
Epoch Marker or TS_MSB depending on the hitmessage version.
@ kEOM
End of Message.
@ kUNK
Unkown Word.
@ kINF
Info Message.