Belle II Software  release-05-01-25
SVDDAQDiagnostic.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jacek Stypula *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef SVDDAQDIAGNOSTICS_H
12 #define SVDDAQDIAGNOSTICS_H
13 
14 #include <cstdint>
15 #include <framework/datastore/RelationsObject.h>
16 
17 namespace Belle2 {
25  class SVDDAQDiagnostic : public RelationsObject {
26  public:
27  enum {
29  TriggerTypeBits = 4,
35  CMC1Bits = 8,
37  CMC2Bits = 4,
64 
65 
68  };
69 
70 
80  SVDDAQDiagnostic(uint8_t triggerNumber, uint8_t triggerType, uint8_t pipelineAddress, uint8_t cmc1, uint8_t cmc2, uint8_t apvError,
81  uint8_t ftbError, bool fadcMatch, bool apvMatch, bool badHeader, bool missedHeader, bool missedTrailer, uint8_t fadcNo = uint8_t(0),
82  uint8_t apvNo = uint8_t(0))
83 
84  {
85  m_triggerNumber = triggerNumber;
86  m_triggerType = triggerType;
87  m_pipelineAddress = pipelineAddress;
88  m_cmc1 = cmc1;
89  m_cmc2 = cmc2;
90  m_apvError = apvError;
91  m_ftbError = ftbError;
92  m_fadcMatch = fadcMatch;
93  m_apvMatch = apvMatch;
94  m_badHeader = badHeader;
95  m_missedHeader = missedHeader;
96  m_missedTrailer = missedTrailer;
97 
98  m_ftbFlags = 0;
100  m_apvErrorOR = 0;
101  m_fadcNo = fadcNo;
102  m_apvNo = apvNo;
103  m_upsetApv = 0;
104  m_badMapping = 0;
105  m_badTrailer = 0;
106  }
107 
109  SVDDAQDiagnostic(): SVDDAQDiagnostic(0, 0, 0, 0, 0, 0, 0, 0, 0, false, 0, 0) {}
110 
112  uint16_t getTriggerNumber() const { return static_cast<uint16_t>(m_triggerNumber); }
114  uint16_t getTriggerType() const { return static_cast<uint16_t>(m_triggerType); }
116  uint16_t getPipelineAddress() const { return static_cast<uint16_t>(m_pipelineAddress); }
118  uint16_t getCMC1() const { return static_cast<uint16_t>(m_cmc1); }
120  uint16_t getCMC2() const { return static_cast<uint16_t>(m_cmc2); }
122  uint16_t getAPVError() const { return static_cast<uint16_t>(m_apvError); }
124  uint16_t getFTBError() const { return static_cast<uint16_t>(m_ftbError); }
126  uint16_t getFTBFlags() const { return m_ftbFlags; }
128  uint16_t getEmuPipelineAddress() const { return static_cast<uint16_t>(m_emuPipelineAddress); }
130  uint16_t getAPVErrorOR() const { return static_cast<uint16_t>(m_apvErrorOR); }
132  bool getAPVMatch() const {return m_apvMatch; }
134  bool getFADCMatch() const {return m_fadcMatch; }
136  bool getUpsetAPV() const {return m_upsetApv; }
138  bool getBadMapping() const {return m_badMapping; }
140  bool getBadTrailer() const {return m_badTrailer; }
142  bool getBadHeader() const {return m_badHeader; }
144  bool getMissedHeader() const {return m_missedHeader; }
146  bool getMissedTrailer() const {return m_missedTrailer; }
147 
149  unsigned short getFADCNumber() const { return m_fadcNo; }
151  unsigned short getAPVNumber() const { return m_apvNo; }
152 
153 
154 
157  void setFTBFlags(uint16_t ftbFlags) { m_ftbFlags = ftbFlags; }
160  void setEmuPipelineAddress(uint8_t emuPipelineAddress) { m_emuPipelineAddress = emuPipelineAddress; }
163  void setApvErrorOR(uint8_t apvErrorOR) { m_apvErrorOR = apvErrorOR; }
166  void setAPVMatch(bool APVMatch) { m_apvMatch = APVMatch; }
169  void setUpsetAPV(bool UpsetAPV) { m_upsetApv = UpsetAPV; }
172  void setBadMapping(bool BadMapping) { m_badMapping = BadMapping; }
175  void setBadTrailer(bool BadTrailer) { m_badTrailer = BadTrailer; }
178  void setMissedTrailer(bool MissedTrailer) { m_missedTrailer = MissedTrailer; }
181  void setMissedHeader(bool MissedHeader) { m_missedHeader = MissedHeader; }
182 
183 
184  private:
188  uint8_t m_triggerType;
190  uint8_t m_pipelineAddress;
192  uint8_t m_cmc1;
194  uint8_t m_cmc2;
196  uint8_t m_apvError;
198  uint8_t m_ftbError;
200  uint16_t m_ftbFlags;
204  uint8_t m_apvErrorOR;
221 
223  uint8_t m_fadcNo;
225  uint8_t m_apvNo;
226 
228 
229  }; // class SVDDAQDiagnostic
231 } // namespace Belle2
232 
233 #endif //SVDDAQDIAGNOSTICS_H
Belle2::SVDDAQDiagnostic::PipelineAddressBits
@ PipelineAddressBits
Number of bits available to represent a pipeline address.
Definition: SVDDAQDiagnostic.h:41
Belle2::SVDDAQDiagnostic::APVErrorORBits
@ APVErrorORBits
Number of bits available to represent an APV error OR code.
Definition: SVDDAQDiagnostic.h:55
Belle2::SVDDAQDiagnostic::getAPVMatch
bool getAPVMatch() const
Get the APVmatch code.
Definition: SVDDAQDiagnostic.h:140
Belle2::SVDDAQDiagnostic::m_ftbFlags
uint16_t m_ftbFlags
FTB Flags Field.
Definition: SVDDAQDiagnostic.h:208
Belle2::SVDDAQDiagnostic::getBadMapping
bool getBadMapping() const
Get the Bad Mapping code.
Definition: SVDDAQDiagnostic.h:146
Belle2::SVDDAQDiagnostic::getFADCMatch
bool getFADCMatch() const
Get the FADCmatch code.
Definition: SVDDAQDiagnostic.h:142
Belle2::SVDDAQDiagnostic::setBadMapping
void setBadMapping(bool BadMapping)
functions for setting values for
Definition: SVDDAQDiagnostic.h:180
Belle2::SVDDAQDiagnostic::UpsetAPVBits
@ UpsetAPVBits
Number of bits available to represent an upset APV code.
Definition: SVDDAQDiagnostic.h:61
Belle2::SVDDAQDiagnostic::getCMC2
uint16_t getCMC2() const
Get the Common Mode Correction performed after masking particle signals.
Definition: SVDDAQDiagnostic.h:128
Belle2::SVDDAQDiagnostic::getMissedTrailer
bool getMissedTrailer() const
Get the missed Trailer.
Definition: SVDDAQDiagnostic.h:154
Belle2::SVDDAQDiagnostic::m_apvError
uint8_t m_apvError
APV error code.
Definition: SVDDAQDiagnostic.h:204
Belle2::SVDDAQDiagnostic::FADCMatchBits
@ FADCMatchBits
Number of bits available to represent an FADC match code.
Definition: SVDDAQDiagnostic.h:57
Belle2::SVDDAQDiagnostic::setAPVMatch
void setAPVMatch(bool APVMatch)
functions for setting values of
Definition: SVDDAQDiagnostic.h:174
Belle2::SVDDAQDiagnostic::setApvErrorOR
void setApvErrorOR(uint8_t apvErrorOR)
functions for setting values unpacked from FADC trailer
Definition: SVDDAQDiagnostic.h:171
Belle2::SVDDAQDiagnostic::MissedHeaderBits
@ MissedHeaderBits
Number of Bits available to represent missed header.
Definition: SVDDAQDiagnostic.h:69
Belle2::SVDDAQDiagnostic::m_missedTrailer
bool m_missedTrailer
missed Trailer
Definition: SVDDAQDiagnostic.h:228
Belle2::SVDDAQDiagnostic::MissedTrailerBits
@ MissedTrailerBits
Number of Bits available to represent missed trailer.
Definition: SVDDAQDiagnostic.h:71
Belle2::SVDDAQDiagnostic::BadHeaderBits
@ BadHeaderBits
Number of Bits available to represent bad header.
Definition: SVDDAQDiagnostic.h:65
Belle2::RelationsInterface::ClassDef
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
Belle2::SVDDAQDiagnostic::getUpsetAPV
bool getUpsetAPV() const
Get the UpsetAPV code.
Definition: SVDDAQDiagnostic.h:144
Belle2::SVDDAQDiagnostic::TriggerTypeBits
@ TriggerTypeBits
Number of bits available to represent a trigger type.
Definition: SVDDAQDiagnostic.h:37
Belle2::SVDDAQDiagnostic::m_badMapping
bool m_badMapping
Bad mapping.
Definition: SVDDAQDiagnostic.h:220
Belle2::SVDDAQDiagnostic::getFTBFlags
uint16_t getFTBFlags() const
Get the FTB Flags field.
Definition: SVDDAQDiagnostic.h:134
Belle2::SVDDAQDiagnostic::setFTBFlags
void setFTBFlags(uint16_t ftbFlags)
functions for setting values unpacked from FADC trailer
Definition: SVDDAQDiagnostic.h:165
Belle2::SVDDAQDiagnostic::setBadTrailer
void setBadTrailer(bool BadTrailer)
functions for setting values for
Definition: SVDDAQDiagnostic.h:183
Belle2::SVDDAQDiagnostic::setMissedTrailer
void setMissedTrailer(bool MissedTrailer)
functions for setting values for
Definition: SVDDAQDiagnostic.h:186
Belle2::SVDDAQDiagnostic::m_apvErrorOR
uint8_t m_apvErrorOR
APV error code in FADC trailer.
Definition: SVDDAQDiagnostic.h:212
Belle2::SVDDAQDiagnostic::getEmuPipelineAddress
uint16_t getEmuPipelineAddress() const
Get the emulated pipeline address.
Definition: SVDDAQDiagnostic.h:136
Belle2::SVDDAQDiagnostic::setUpsetAPV
void setUpsetAPV(bool UpsetAPV)
functions for setting values for
Definition: SVDDAQDiagnostic.h:177
Belle2::SVDDAQDiagnostic::APVMatchBits
@ APVMatchBits
Number of bits available to represent an APV match code.
Definition: SVDDAQDiagnostic.h:59
Belle2::SVDDAQDiagnostic::m_badTrailer
bool m_badTrailer
Bad fadc Trailer.
Definition: SVDDAQDiagnostic.h:224
Belle2::SVDDAQDiagnostic::m_fadcNo
uint8_t m_fadcNo
FADC #.
Definition: SVDDAQDiagnostic.h:231
Belle2::SVDDAQDiagnostic::m_pipelineAddress
uint8_t m_pipelineAddress
Pipeline address.
Definition: SVDDAQDiagnostic.h:198
Belle2::SVDDAQDiagnostic::m_cmc1
uint8_t m_cmc1
CMC1.
Definition: SVDDAQDiagnostic.h:200
Belle2::SVDDAQDiagnostic::CMC1Bits
@ CMC1Bits
Number of bits available to represent Common Mode Correction w/o masking out particle signals.
Definition: SVDDAQDiagnostic.h:43
Belle2::SVDDAQDiagnostic::getBadTrailer
bool getBadTrailer() const
Get the Bad Trailer code.
Definition: SVDDAQDiagnostic.h:148
Belle2::SVDDAQDiagnostic::CMC2Bits
@ CMC2Bits
Number of bits available to represent Common Mode Correction performed after masking particle signals...
Definition: SVDDAQDiagnostic.h:45
Belle2::SVDDAQDiagnostic::APVErrorBits
@ APVErrorBits
Number of bits available to represent an APV error code.
Definition: SVDDAQDiagnostic.h:47
Belle2::SVDDAQDiagnostic::m_cmc2
uint8_t m_cmc2
CMC2.
Definition: SVDDAQDiagnostic.h:202
Belle2::SVDDAQDiagnostic::m_badHeader
bool m_badHeader
Bad fadc Header.
Definition: SVDDAQDiagnostic.h:222
Belle2::SVDDAQDiagnostic::getPipelineAddress
uint16_t getPipelineAddress() const
Get the pipeline address.
Definition: SVDDAQDiagnostic.h:124
Belle2::SVDDAQDiagnostic::getTriggerType
uint16_t getTriggerType() const
Get the trigger type.
Definition: SVDDAQDiagnostic.h:122
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDDAQDiagnostic::BadTrailerBits
@ BadTrailerBits
Number of Bits available to represent bad trailer code.
Definition: SVDDAQDiagnostic.h:67
Belle2::SVDDAQDiagnostic::m_apvMatch
bool m_apvMatch
if # of APV headers match # of APVs for given FADC
Definition: SVDDAQDiagnostic.h:216
Belle2::SVDDAQDiagnostic::m_triggerNumber
uint8_t m_triggerNumber
Trigger number.
Definition: SVDDAQDiagnostic.h:194
Belle2::SVDDAQDiagnostic::FTBFlagsBits
@ FTBFlagsBits
Number of bits available to represent a FTB Flags Field.
Definition: SVDDAQDiagnostic.h:51
Belle2::SVDDAQDiagnostic::setMissedHeader
void setMissedHeader(bool MissedHeader)
functions for setting values for
Definition: SVDDAQDiagnostic.h:189
Belle2::SVDDAQDiagnostic::BadMappingBits
@ BadMappingBits
Number of bits available to represent bad mapping.
Definition: SVDDAQDiagnostic.h:63
Belle2::SVDDAQDiagnostic::getAPVError
uint16_t getAPVError() const
Get the APV error code.
Definition: SVDDAQDiagnostic.h:130
Belle2::SVDDAQDiagnostic::EMUPipelineAddressBits
@ EMUPipelineAddressBits
Number of bits available to represent an Emulated pipeline adress.
Definition: SVDDAQDiagnostic.h:53
Belle2::SVDDAQDiagnostic::getFTBError
uint16_t getFTBError() const
Get the FTB errors field.
Definition: SVDDAQDiagnostic.h:132
Belle2::SVDDAQDiagnostic::setEmuPipelineAddress
void setEmuPipelineAddress(uint8_t emuPipelineAddress)
functions for setting values unpacked from FADC trailer
Definition: SVDDAQDiagnostic.h:168
Belle2::SVDDAQDiagnostic::getBadHeader
bool getBadHeader() const
Get the Bad Header code.
Definition: SVDDAQDiagnostic.h:150
Belle2::SVDDAQDiagnostic::m_emuPipelineAddress
uint8_t m_emuPipelineAddress
emulated pipeline Address
Definition: SVDDAQDiagnostic.h:210
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::SVDDAQDiagnostic::getMissedHeader
bool getMissedHeader() const
Get the missed Header.
Definition: SVDDAQDiagnostic.h:152
Belle2::SVDDAQDiagnostic::m_upsetApv
bool m_upsetApv
Upset APV.
Definition: SVDDAQDiagnostic.h:218
Belle2::SVDDAQDiagnostic::getAPVNumber
unsigned short getAPVNumber() const
Get APV number.
Definition: SVDDAQDiagnostic.h:159
Belle2::SVDDAQDiagnostic::getFADCNumber
unsigned short getFADCNumber() const
Get FADC number.
Definition: SVDDAQDiagnostic.h:157
Belle2::SVDDAQDiagnostic::getTriggerNumber
uint16_t getTriggerNumber() const
Get the trigger number.
Definition: SVDDAQDiagnostic.h:120
Belle2::SVDDAQDiagnostic::getAPVErrorOR
uint16_t getAPVErrorOR() const
Get the APV error OR code.
Definition: SVDDAQDiagnostic.h:138
Belle2::SVDDAQDiagnostic::TriggerNumberBits
@ TriggerNumberBits
Number of bits available to represent a trigger number.
Definition: SVDDAQDiagnostic.h:39
Belle2::SVDDAQDiagnostic::m_apvNo
uint8_t m_apvNo
APV #.
Definition: SVDDAQDiagnostic.h:233
Belle2::SVDDAQDiagnostic
Class to store SVD DAQ diagnostic information.
Definition: SVDDAQDiagnostic.h:33
Belle2::SVDDAQDiagnostic::SVDDAQDiagnostic
SVDDAQDiagnostic()
Default constructor.
Definition: SVDDAQDiagnostic.h:117
Belle2::SVDDAQDiagnostic::Bits
@ Bits
Total bit size of the SVDDAQDiagnostic.
Definition: SVDDAQDiagnostic.h:75
Belle2::SVDDAQDiagnostic::m_ftbError
uint8_t m_ftbError
FTB error code.
Definition: SVDDAQDiagnostic.h:206
Belle2::SVDDAQDiagnostic::getCMC1
uint16_t getCMC1() const
Get the Common Mode Correction w/o masking out particle signals.
Definition: SVDDAQDiagnostic.h:126
Belle2::SVDDAQDiagnostic::m_triggerType
uint8_t m_triggerType
Trigger type.
Definition: SVDDAQDiagnostic.h:196
Belle2::SVDDAQDiagnostic::m_missedHeader
bool m_missedHeader
missed Header
Definition: SVDDAQDiagnostic.h:226
Belle2::SVDDAQDiagnostic::m_fadcMatch
bool m_fadcMatch
if # of FADC boards match # of RawData objects
Definition: SVDDAQDiagnostic.h:214
Belle2::SVDDAQDiagnostic::FTBErrorBits
@ FTBErrorBits
Number of bits available to represent a FTB error code.
Definition: SVDDAQDiagnostic.h:49