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 
21 class TotemVFATStatus {
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 
92  uint8_t numberOfClusters_;
93 
95  uint8_t eventCounter;
96 };
97 
98 #endif
TotemVFATStatus::isECProgressError
bool isECProgressError() const
VFATFrame event number doesn't follow the number derived from DAQ.
Definition: TotemVFATStatus.h:52
funct::false
false
Definition: Factorize.h:29
TotemVFATStatus::operator<<
friend std::ostream & operator<<(std::ostream &s, const TotemVFATStatus &st)
Definition: TotemVFATStatus.cc:13
TotemVFATStatus::setCRCError
void setCRCError(bool val=true)
Definition: TotemVFATStatus.h:49
TotemVFATStatus::setMissing
void setMissing(bool val=true)
Definition: TotemVFATStatus.h:37
TotemVFATStatus::isMissing
bool isMissing() const
VFAT is present in mapping but no data is present int raw event.
Definition: TotemVFATStatus.h:36
hgcal_conditions::parameters
Definition: HGCConditions.h:86
findQualityFiles.v
v
Definition: findQualityFiles.py:179
TotemVFATStatus::setFootprintError
void setFootprintError(bool val=true)
Definition: TotemVFATStatus.h:45
TotemVFATStatus::ec
uint8_t ec() const
event Counter
Definition: TotemVFATStatus.h:85
TotemVFATStatus::setIDMismatch
void setIDMismatch(bool val=true)
Definition: TotemVFATStatus.h:41
TotemVFATStatus::chipPosition
uint8_t chipPosition() const
Chip position.
Definition: TotemVFATStatus.h:32
TotemVFATStatus::setEC
void setEC(const uint8_t ec)
Definition: TotemVFATStatus.h:86
TotemVFATStatus::setBCProgressError
void setBCProgressError(bool val=true)
Definition: TotemVFATStatus.h:57
TotemVFATStatus::setFullyMaskedOut
void setFullyMaskedOut()
Definition: TotemVFATStatus.h:61
TotemVFATStatus::setPartiallyMaskedOut
void setPartiallyMaskedOut()
Definition: TotemVFATStatus.h:65
alignCSCRings.s
s
Definition: alignCSCRings.py:92
TotemVFATStatus::setNumberOfClustersSpecified
void setNumberOfClustersSpecified(bool v)
Definition: TotemVFATStatus.h:75
TotemVFATStatus::setNumberOfClusters
void setNumberOfClusters(uint8_t v)
Definition: TotemVFATStatus.h:78
TotemVFATStatus::TotemVFATStatus
TotemVFATStatus(uint8_t cp=0)
Definition: TotemVFATStatus.h:28
TotemVFATStatus::numberOfClustersSpecified
bool numberOfClustersSpecified
the number of hit clusters before DAQ trimming
Definition: TotemVFATStatus.h:96
TotemVFATStatus::isIDMismatch
bool isIDMismatch() const
12-bit hw id from the header of the vfat frame is diffrent from the 16-bit one from hw mapping
Definition: TotemVFATStatus.h:40
TotemVFATStatus::numberOfClusters_
uint8_t numberOfClusters_
Definition: TotemVFATStatus.h:97
TotemVFATStatus::eventCounter
uint8_t eventCounter
event counter in the VFAT frame
Definition: TotemVFATStatus.h:100
TotemVFATStatus::isFootprintError
bool isFootprintError() const
Footprint error.
Definition: TotemVFATStatus.h:44
TotemVFATStatus::isNotMasked
bool isNotMasked() const
No channels are masked out.
Definition: TotemVFATStatus.h:68
TotemVFATStatus::setNotMasked
void setNotMasked()
Definition: TotemVFATStatus.h:69
TotemVFATStatus::status
std::bitset< 8 > status
the status bits
Definition: TotemVFATStatus.h:93
TotemVFATStatus::isBCProgressError
bool isBCProgressError() const
BC number is incorrect.
Definition: TotemVFATStatus.h:56
TotemVFATStatus
Definition: TotemVFATStatus.h:20
TotemVFATStatus::isFullyMaskedOut
bool isFullyMaskedOut() const
All channels from that VFAT are not taken into account.
Definition: TotemVFATStatus.h:60
heppy_batch.val
val
Definition: heppy_batch.py:351
fileCollector.cmp
cmp
Definition: fileCollector.py:125
TotemVFATStatus::numberOfClusters
uint8_t numberOfClusters() const
Definition: TotemVFATStatus.h:77
TotemVFATStatus::operator<
bool operator<(const TotemVFATStatus &cmp) const
Definition: TotemVFATStatus.h:80
TotemVFATStatus::isOK
bool isOK() const
Definition: TotemVFATStatus.h:71
TotemVFATStatus::isPartiallyMaskedOut
bool isPartiallyMaskedOut() const
Some channels from VFAT ale masked out, but not all.
Definition: TotemVFATStatus.h:64
TotemVFATStatus::setECProgressError
void setECProgressError(bool val=true)
Definition: TotemVFATStatus.h:53
TotemVFATStatus::setChipPosition
void setChipPosition(uint8_t cp)
Definition: TotemVFATStatus.h:33
TotemVFATStatus::isCRCError
bool isCRCError() const
CRC error.
Definition: TotemVFATStatus.h:48
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192
TotemVFATStatus::chipPosition_
uint8_t chipPosition_
describes placement of the VFAT within the detector
Definition: TotemVFATStatus.h:90
TotemVFATStatus::isNumberOfClustersSpecified
bool isNumberOfClustersSpecified() const
number of clusters
Definition: TotemVFATStatus.h:74