CbmRoot
StsXyterFinalHit.h
Go to the documentation of this file.
1 /************************************************************
2  *
3  ************************************************************/
4 
5 #ifndef STSXYTERFINALHIT_H
6 #define STSXYTERFINALHIT_H
7 
8 // C/C++ headers
9 #include <iostream>
10 #include <stdint.h>
11 
12 namespace stsxyter {
13 
14  class FinalHit {
15  private:
16  protected:
17  uint64_t fulLongTs; // (Software-)Extended TS, in clock cycles
18  uint16_t fusRawAdc; // Raw ADC value
19  uint16_t fusAsicIdx; // ASIC Index
20  uint16_t fusChanIdx; // channel Index
21  uint16_t fusDpbIdx; // Optional DPB Index
22  uint16_t fusCrobIdx; // Optional CROB Index
23 
24  public:
25  FinalHit(const FinalHit& src)
27  , fusRawAdc(src.fusRawAdc)
28  , fusAsicIdx(src.fusAsicIdx)
30  , fusDpbIdx(src.fusDpbIdx)
31  , fusCrobIdx(src.fusCrobIdx) {}
32 
33  FinalHit(uint64_t ulLongTsIn,
34  uint16_t usRawAdcIn,
35  uint16_t usAsicIdxIn,
36  uint16_t usChanIdxIn,
37  uint16_t usDpbIdx = 0,
38  uint16_t usCrobIdx = 0)
39  : fulLongTs(ulLongTsIn)
40  , fusRawAdc(usRawAdcIn)
41  , fusAsicIdx(usAsicIdxIn)
42  , fusChanIdx(usChanIdxIn)
43  , fusDpbIdx(usDpbIdx)
44  , fusCrobIdx(usCrobIdx) {}
45 
46  FinalHit() : FinalHit(0, 0, 0, 0) {}
47 
48  ~FinalHit() {};
49 
50  void assign(const FinalHit& src) {
51  fulLongTs = src.fulLongTs;
53  fusAsicIdx = src.fusAsicIdx;
55  fusDpbIdx = src.fusDpbIdx;
56  fusCrobIdx = src.fusCrobIdx;
57  }
58 
59  FinalHit& operator=(const FinalHit& src) {
60  assign(src);
61  return *this;
62  }
63  bool operator<(const FinalHit& other) const {
64  return fulLongTs < other.fulLongTs;
65  }
66 
67  inline void reset() {
68  fulLongTs = 0;
69  fusRawAdc = 0;
70  fusAsicIdx = 0;
72  fusDpbIdx = 0;
73  fusCrobIdx = 0;
74  }
75 
76  inline uint64_t GetTs() const { return fulLongTs; }
77  inline uint16_t GetAdc() const { return fusRawAdc; }
78  inline uint16_t GetAsic() const { return fusAsicIdx; }
79  inline uint16_t GetChan() const { return fusChanIdx; }
80  inline uint16_t GetDpb() const { return fusDpbIdx; }
81  inline uint16_t GetCrob() const { return fusCrobIdx; }
82  };
83 } // namespace stsxyter
84 #endif // STSXYTERFINALHIT_H
stsxyter::FinalHit::GetAdc
uint16_t GetAdc() const
Definition: StsXyterFinalHit.h:81
stsxyter::FinalHit::operator=
FinalHit & operator=(const FinalHit &src)
Definition: StsXyterFinalHit.h:63
stsxyter::FinalHit::GetCrob
uint16_t GetCrob() const
Definition: StsXyterFinalHit.h:85
stsxyter::FinalHit::FinalHit
FinalHit()
Definition: StsXyterFinalHit.h:50
stsxyter::FinalHit::reset
void reset()
Definition: StsXyterFinalHit.h:71
stsxyter::FinalHit::fusChanIdx
uint16_t fusChanIdx
Definition: StsXyterFinalHit.h:24
stsxyter::FinalHit::fusAsicIdx
uint16_t fusAsicIdx
Definition: StsXyterFinalHit.h:23
stsxyter::FinalHit
Definition: StsXyterFinalHit.h:16
stsxyter::FinalHit::GetChan
uint16_t GetChan() const
Definition: StsXyterFinalHit.h:83
stsxyter::FinalHit::~FinalHit
~FinalHit()
Definition: StsXyterFinalHit.h:52
stsxyter::FinalHit::fusDpbIdx
uint16_t fusDpbIdx
Definition: StsXyterFinalHit.h:25
stsxyter::FinalHit::GetAsic
uint16_t GetAsic() const
Definition: StsXyterFinalHit.h:82
stsxyter::FinalHit::fusCrobIdx
uint16_t fusCrobIdx
Definition: StsXyterFinalHit.h:26
stsxyter::FinalHit::fulLongTs
uint64_t fulLongTs
Definition: StsXyterFinalHit.h:21
stsxyter::FinalHit::fusRawAdc
uint16_t fusRawAdc
Definition: StsXyterFinalHit.h:22
stsxyter::FinalHit::operator<
bool operator<(const FinalHit &other) const
Definition: StsXyterFinalHit.h:67
stsxyter::FinalHit::assign
void assign(const FinalHit &src)
Definition: StsXyterFinalHit.h:54
stsxyter::FinalHit::GetTs
uint64_t GetTs() const
Definition: StsXyterFinalHit.h:80
stsxyter::FinalHit::GetDpb
uint16_t GetDpb() const
Definition: StsXyterFinalHit.h:84
stsxyter
Definition: StsXyterFinalHit.h:12