CMS 3D CMS Logo

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 #include <cstdint>
16 
17 //----------------------------------------------------------------------------------------------------
18 
23 public:
24  TotemVFATStatus(uint8_t cp = 0)
26 
28  inline uint8_t chipPosition() const { return chipPosition_; }
29  inline void setChipPosition(uint8_t cp) { chipPosition_ = cp; }
30 
32  inline bool isMissing() const { return status[0]; }
33  inline void setMissing(bool val = true) { status[0] = val; }
34 
36  inline bool isIDMismatch() const { return status[1]; }
37  inline void setIDMismatch(bool val = true) { status[1] = val; }
38 
40  inline bool isFootprintError() const { return status[2]; }
41  inline void setFootprintError(bool val = true) { status[2] = val; }
42 
44  inline bool isCRCError() const { return status[3]; }
45  inline void setCRCError(bool val = true) { status[3] = val; }
46 
48  inline bool isECProgressError() const { return status[4]; }
49  inline void setECProgressError(bool val = true) { status[4] = val; }
50 
52  inline bool isBCProgressError() const { return status[5]; }
53  inline void setBCProgressError(bool val = true) { status[5] = val; }
54 
56  inline bool isFullyMaskedOut() const { return status[6]; }
57  inline void setFullyMaskedOut() { status[6] = true; }
58 
60  inline bool isPartiallyMaskedOut() const { return status[7]; }
61  inline void setPartiallyMaskedOut() { status[7] = true; }
62 
64  inline bool isNotMasked() const { return !(status[6] || status[7]); }
65  inline void setNotMasked() { status[6] = status[7] = false; }
66 
67  bool isOK() const { return !(status[0] || status[1] || status[2] || status[3] || status[4] || status[5]); }
68 
72 
73  inline uint8_t numberOfClusters() const { return numberOfClusters_; }
74  inline void setNumberOfClusters(uint8_t v) { numberOfClusters_ = v; }
75 
76  bool operator<(const TotemVFATStatus& cmp) const { return (status.to_ulong() < cmp.status.to_ulong()); }
77 
78  friend std::ostream& operator<<(std::ostream& s, const TotemVFATStatus& st);
79 
81  inline uint8_t ec() const { return eventCounter; }
82  inline void setEC(const uint8_t ec) { eventCounter = ec; }
83 
84 private:
86  uint8_t chipPosition_;
87 
89  std::bitset<8> status;
90 
94 
96  uint8_t eventCounter;
97 };
98 
99 #endif
uint8_t ec() const
event Counter
bool operator<(const TotemVFATStatus &cmp) const
void setCRCError(bool val=true)
bool isNumberOfClustersSpecified() const
number of clusters
bool isOK() const
void setNumberOfClusters(uint8_t v)
uint8_t chipPosition() const
Chip position.
uint8_t numberOfClusters_
TotemVFATStatus(uint8_t cp=0)
void setFullyMaskedOut()
bool isMissing() const
VFAT is present in mapping but no data is present int raw event.
bool numberOfClustersSpecified
the number of hit clusters before DAQ trimming
bool isIDMismatch() const
12-bit hw id from the header of the vfat frame is diffrent from the 16-bit one from hw mapping ...
bool isPartiallyMaskedOut() const
Some channels from VFAT ale masked out, but not all.
uint8_t numberOfClusters() const
void setChipPosition(uint8_t cp)
uint8_t chipPosition_
describes placement of the VFAT within the detector
friend std::ostream & operator<<(std::ostream &s, const TotemVFATStatus &st)
void setMissing(bool val=true)
bool isCRCError() const
CRC error.
void setFootprintError(bool val=true)
void setBCProgressError(bool val=true)
bool isECProgressError() const
VFATFrame event number doesn&#39;t follow the number derived from DAQ.
void setNumberOfClustersSpecified(bool v)
std::bitset< 8 > status
the status bits
bool isFullyMaskedOut() const
All channels from that VFAT are not taken into account.
bool isNotMasked() const
No channels are masked out.
void setEC(const uint8_t ec)
void setPartiallyMaskedOut()
void setECProgressError(bool val=true)
void setIDMismatch(bool val=true)
bool isBCProgressError() const
BC number is incorrect.
bool isFootprintError() const
Footprint error.
uint8_t eventCounter
event counter in the VFAT frame
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)