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_TotemDigi_TotemVFATStatus
11 #define DataFormats_TotemDigi_TotemVFATStatus
12 
13 #include <bitset>
14 #include <map>
15 
16 //----------------------------------------------------------------------------------------------------
17 
22 {
23  public:
24  TotemVFATStatus(uint8_t _cp = 0) : chipPosition(_cp), status(0) {}
25 
27  inline bool isMissing() const { return status[0]; }
28 
30  inline bool isIDMismatch() const { return status[1]; }
31 
33  inline bool isFootprintError() const { return status[2]; }
34 
36  inline bool isCRCError() const { return status[3]; }
37 
39  inline bool isECProgressError() const { return status[4]; }
40 
42  inline bool isBCProgressError() const { return status[5]; }
43 
45  inline bool isFullyMaskedOut() const { return status[6]; }
46 
48  inline bool isPartiallyMaskedOut() const { return status[7]; }
49 
51  inline bool isNotMasked() const { return !(status[6] || status[7]); }
52 
53  inline void setChipPosition(uint8_t _cp) { chipPosition = _cp; }
54 
55  inline void setMissing() { status[0]=true; }
56  inline void setIDMismatch() { status[1]=true; }
57  inline void setFootprintError() { status[2]=true; }
58  inline void setCRCError() { status[3]=true; }
59  inline void setECProgressError() { status[4]=true; }
60  inline void setBCProgressError() { status[5] = true; }
61  inline void setFullyMaskedOut() { status[6]=true; }
62  inline void setPartiallyMaskedOut() { status[7]=true; }
63  inline void setNotMasked() { status[6]=status[7]=false; }
64 
65  bool isOK() const
66  {
67  return !(status[0] || status[1] || status[2] || status[3] || status[4] || status[5]);
68  }
69 
70  bool operator < (const TotemVFATStatus &cmp) const
71  {
72  return (status.to_ulong() < cmp.status.to_ulong());
73  }
74 
75  friend std::ostream& operator << (std::ostream& s, const TotemVFATStatus &st);
76 
77  private:
79  uint8_t chipPosition;
80 
82  std::bitset<8> status;
83 };
84 
85 #endif
bool isFootprintError() const
Footprint error.
bool isOK() const
uint8_t chipPosition
describes placement of the VFAT within the detector
bool isPartiallyMaskedOut() const
Some channels from VFAT ale masked out, but not all.
bool isNotMasked() const
None 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 setECProgressError()
void setFullyMaskedOut()
TotemVFATStatus(uint8_t _cp=0)
bool isCRCError() const
CRC error.
friend std::ostream & operator<<(std::ostream &s, const TotemVFATStatus &st)
bool isFullyMaskedOut() const
All channels from that VFAT are not taken into account.
std::bitset< 8 > status
the status bits
void setBCProgressError()
bool isBCProgressError() const
BC number is incorrect.
void setPartiallyMaskedOut()
void setFootprintError()
bool isMissing() const
VFAT is present in mapping but no data is present int raw event.
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.