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 uint8_t getChipPosition() const { return chipPosition; }
54  inline void setChipPosition(uint8_t _cp) { chipPosition = _cp; }
55 
56  inline void setMissing(bool val = true) { status[0] = val; }
57  inline void setIDMismatch(bool val = true) { status[1] = val; }
58  inline void setFootprintError(bool val = true) { status[2] = val; }
59  inline void setCRCError(bool val = true) { status[3] = val; }
60  inline void setECProgressError(bool val = true) { status[4] = val; }
61  inline void setBCProgressError(bool val = true) { status[5] = val; }
62 
63  inline void setFullyMaskedOut() { status[6]=true; }
64  inline void setPartiallyMaskedOut() { status[7]=true; }
65  inline void setNotMasked() { status[6]=status[7]=false; }
66 
67  bool isOK() const
68  {
69  return !(status[0] || status[1] || status[2] || status[3] || status[4] || status[5]);
70  }
71 
72  bool operator < (const TotemVFATStatus &cmp) const
73  {
74  return (status.to_ulong() < cmp.status.to_ulong());
75  }
76 
77  friend std::ostream& operator << (std::ostream& s, const TotemVFATStatus &st);
78 
79  private:
81  uint8_t chipPosition;
82 
84  std::bitset<8> status;
85 };
86 
87 #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...
uint8_t getChipPosition() const
void setFullyMaskedOut()
TotemVFATStatus(uint8_t _cp=0)
bool isCRCError() const
CRC error.
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)
std::bitset< 8 > status
the status bits
bool isBCProgressError() const
BC number is incorrect.
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.
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.