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 
16 //----------------------------------------------------------------------------------------------------
17 
22 public:
23  TotemVFATStatus(uint8_t cp = 0)
25 
27  inline uint8_t chipPosition() const { return chipPosition_; }
28  inline void setChipPosition(uint8_t cp) { chipPosition_ = cp; }
29 
31  inline bool isMissing() const { return status[0]; }
32  inline void setMissing(bool val = true) { status[0] = val; }
33 
35  inline bool isIDMismatch() const { return status[1]; }
36  inline void setIDMismatch(bool val = true) { status[1] = val; }
37 
39  inline bool isFootprintError() const { return status[2]; }
40  inline void setFootprintError(bool val = true) { status[2] = val; }
41 
43  inline bool isCRCError() const { return status[3]; }
44  inline void setCRCError(bool val = true) { status[3] = val; }
45 
47  inline bool isECProgressError() const { return status[4]; }
48  inline void setECProgressError(bool val = true) { status[4] = val; }
49 
51  inline bool isBCProgressError() const { return status[5]; }
52  inline void setBCProgressError(bool val = true) { status[5] = val; }
53 
55  inline bool isFullyMaskedOut() const { return status[6]; }
56  inline void setFullyMaskedOut() { status[6] = true; }
57 
59  inline bool isPartiallyMaskedOut() const { return status[7]; }
60  inline void setPartiallyMaskedOut() { status[7] = true; }
61 
63  inline bool isNotMasked() const { return !(status[6] || status[7]); }
64  inline void setNotMasked() { status[6] = status[7] = false; }
65 
66  bool isOK() const { return !(status[0] || status[1] || status[2] || status[3] || status[4] || status[5]); }
67 
71 
72  inline uint8_t numberOfClusters() const { return numberOfClusters_; }
73  inline void setNumberOfClusters(uint8_t v) { numberOfClusters_ = v; }
74 
75  bool operator<(const TotemVFATStatus& cmp) const { return (status.to_ulong() < cmp.status.to_ulong()); }
76 
77  friend std::ostream& operator<<(std::ostream& s, const TotemVFATStatus& st);
78 
80  inline uint8_t ec() const { return eventCounter; }
81  inline void setEC(const uint8_t ec) { eventCounter = ec; }
82 
83 private:
85  uint8_t chipPosition_;
86 
88  std::bitset<8> status;
89 
93 
95  uint8_t eventCounter;
96 };
97 
98 #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)