test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TotemVFATStatus.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of TOTEM offline software.
4 * Authors:
5 * Maciej Wróbel (wroblisko@gmail.com)
6 * Jan Kašpar (jan.kaspar@gmail.com)
7 *
8 ****************************************************************************/
9 
10 #ifndef DataFormats_CTPPSDigi_TotemVFATStatus
11 #define DataFormats_CTPPSDigi_TotemVFATStatus
12 
13 #include <bitset>
14 #include <map>
15 
16 //----------------------------------------------------------------------------------------------------
17 
22 {
23  public:
25  {
26  }
27 
29  inline uint8_t getChipPosition() const { return chipPosition; }
30  inline void setChipPosition(uint8_t _cp) { chipPosition = _cp; }
31 
33  inline bool isMissing() const { return status[0]; }
34  inline void setMissing(bool val = true) { status[0] = val; }
35 
37  inline bool isIDMismatch() const { return status[1]; }
38  inline void setIDMismatch(bool val = true) { status[1] = val; }
39 
41  inline bool isFootprintError() const { return status[2]; }
42  inline void setFootprintError(bool val = true) { status[2] = val; }
43 
45  inline bool isCRCError() const { return status[3]; }
46  inline void setCRCError(bool val = true) { status[3] = val; }
47 
49  inline bool isECProgressError() const { return status[4]; }
50  inline void setECProgressError(bool val = true) { status[4] = val; }
51 
53  inline bool isBCProgressError() const { return status[5]; }
54  inline void setBCProgressError(bool val = true) { status[5] = val; }
55 
57  inline bool isFullyMaskedOut() const { return status[6]; }
58  inline void setFullyMaskedOut() { status[6]=true; }
59 
61  inline bool isPartiallyMaskedOut() const { return status[7]; }
62  inline void setPartiallyMaskedOut() { status[7]=true; }
63 
65  inline bool isNotMasked() const { return !(status[6] || status[7]); }
66  inline void setNotMasked() { status[6]=status[7]=false; }
67 
68  bool isOK() const
69  {
70  return !(status[0] || status[1] || status[2] || status[3] || status[4] || status[5]);
71  }
72 
76 
77  inline uint8_t getNumberOfClusters() const { return numberOfClusters; }
78  inline void setNumberOfClusters(uint8_t v) { numberOfClusters = v; }
79 
80  bool operator < (const TotemVFATStatus &cmp) const
81  {
82  return (status.to_ulong() < cmp.status.to_ulong());
83  }
84 
85  friend std::ostream& operator << (std::ostream& s, const TotemVFATStatus &st);
86 
88  inline uint8_t getEC() const {return eventCounter;}
89  inline void setEC(const uint8_t ec) { eventCounter = ec; }
90 
91  private:
93  uint8_t chipPosition;
94 
96  std::bitset<8> status;
97 
101 
103  uint8_t eventCounter;
104 };
105 
106 #endif
bool isFootprintError() const
Footprint error.
bool isOK() const
uint8_t chipPosition
describes placement of the VFAT within the detector
void setCRCError(bool val=true)
bool isPartiallyMaskedOut() const
Some channels from VFAT ale masked out, but not all.
bool isNotMasked() const
No channels are masked out.
bool isIDMismatch() const
12-bit hw id from the header of the vfat frame is diffrent from the 16-bit one from hw mapping ...
void setNumberOfClusters(uint8_t v)
uint8_t getEC() const
event Counter
uint8_t getChipPosition() const
Chip position.
void setFullyMaskedOut()
bool numberOfClustersSpecified
the number of hit clusters before DAQ trimming
TotemVFATStatus(uint8_t _cp=0)
bool isNumberOfClustersSpecified() const
number of clusters
bool isCRCError() const
CRC error.
uint8_t numberOfClusters
friend std::ostream & operator<<(std::ostream &s, const TotemVFATStatus &st)
void setMissing(bool val=true)
bool isFullyMaskedOut() const
All channels from that VFAT are not taken into account.
void setFootprintError(bool val=true)
void setBCProgressError(bool val=true)
void setNumberOfClustersSpecified(bool v)
std::bitset< 8 > status
the status bits
uint8_t getNumberOfClusters() const
bool isBCProgressError() const
BC number is incorrect.
void setEC(const uint8_t ec)
void setPartiallyMaskedOut()
void setECProgressError(bool val=true)
void setIDMismatch(bool val=true)
bool isMissing() const
VFAT is present in mapping but no data is present int raw event.
volatile std::atomic< bool > shutdown_flag false
void setChipPosition(uint8_t _cp)
bool operator<(const TotemVFATStatus &cmp) const
bool isECProgressError() const
VFATFrame event number doesn&#39;t follow the number derived from DAQ.
uint8_t eventCounter
event counter in the VFAT frame