LDMX Software
HgcrocTrigDigi.h
1#ifndef RECON_EVENT_HGCROCTRIGDIGI_H_
2#define RECON_EVENT_HGCROCTRIGDIGI_H_
3
4// ldmx-sw
5#include <stdint.h> //uint{32,8}_t
6
7// ROOT
8#include "TObject.h" //For ClassDef
9
10namespace ldmx {
11
12// Forward declaration needed by typedef
13class HgcrocTrigDigi;
14
18typedef std::vector<HgcrocTrigDigi> HgcrocTrigDigiCollection;
19
25 public:
32 HgcrocTrigDigi() = default;
33
43 HgcrocTrigDigi(uint32_t tid, uint8_t tp = 0);
44
52 virtual ~HgcrocTrigDigi() = default;
53
61 bool operator<(const HgcrocTrigDigi &digi) { return tid_ < digi.tid_; }
62
67 uint32_t getId() const { return tid_; }
68
73 void setPrimitive(uint8_t tp) { tp_ = tp; }
74
79 uint8_t getPrimitive() const { return tp_; }
80
85 uint32_t linearPrimitive() const { return compressed2Linear(getPrimitive()); }
86
93 static uint8_t linear2Compressed(uint32_t lin);
94
101 static uint32_t compressed2Linear(uint8_t comp);
102
106 void Print() const;
107
119 friend std::ostream &operator<<(std::ostream &o, const HgcrocTrigDigi &d);
120
131 friend std::ostream &operator<<(std::ostream &o,
132 const HgcrocTrigDigiCollection &c);
133
134 private:
136 uint32_t tid_{0};
138 uint8_t tp_{0};
141};
142} // namespace ldmx
143
144#endif // RECON_EVENT_HGCROCTRIGDIGI_H_
Contains the trigger output for a single trigger hgcroc channel.
uint32_t linearPrimitive() const
Get the linearized value of the trigger primitive.
void setPrimitive(uint8_t tp)
Set the trigger primitive (7 bits) for the given link on a channel @params[in] tp the value of the tr...
uint32_t tid_
the raw ID for this trigger channel
virtual ~HgcrocTrigDigi()=default
Destructor.
ClassDef(HgcrocTrigDigi, 1)
ROOT Dictionary class definition macro.
bool operator<(const HgcrocTrigDigi &digi)
Sort the collection to trig digis by the raw ID.
HgcrocTrigDigi()=default
Default Constructor.
friend std::ostream & operator<<(std::ostream &o, const HgcrocTrigDigi &d)
Stream the input digi.
friend std::ostream & operator<<(std::ostream &o, const HgcrocTrigDigiCollection &c)
Stream the input digi collection.
static uint32_t compressed2Linear(uint8_t comp)
Static conversion from compressed -> linear 18b.
void Print() const
Print a description of this object.
uint8_t tp_
the compressed 7bit trigger primitive value for this channel
uint8_t getPrimitive() const
Get the trigger primitive (7 bits) for the given link on a channel.
static uint8_t linear2Compressed(uint32_t lin)
Static conversion from 18b linear -> compressed.
HgcrocTrigDigi(uint32_t tid, uint8_t tp=0)
Preferred Constructor.
uint32_t getId() const
Get the id of the digi.