CMS 3D CMS Logo

CSCShowerDigi.h
Go to the documentation of this file.
1 #ifndef DataFormats_CSCDigi_CSCShowerDigi_h
2 #define DataFormats_CSCDigi_CSCShowerDigi_h
3 
4 #include <cstdint>
5 #include <iosfwd>
6 #include <limits>
7 #include <vector>
8 
9 class CSCShowerDigi {
10 public:
11  // Run-3 definitions as provided in DN-20-033
12  enum Run3Shower { kInvalid = 0, kLoose = 1, kNominal = 2, kTight = 3 };
13  enum BitMask { kInTimeMask = 0x2, kOutTimeMask = 0x2 };
14  enum BitShift { kInTimeShift = 0, kOutTimeShift = 2 };
15 
17  CSCShowerDigi(const uint16_t inTimeBits, const uint16_t outTimeBits, const uint16_t cscID);
19  CSCShowerDigi();
20 
22  void clear() { bits_ = 0; }
23 
25  bool isValid() const;
26 
27  bool isLooseInTime() const;
28  bool isNominalInTime() const;
29  bool isTightInTime() const;
30  bool isLooseOutTime() const;
31  bool isNominalOutTime() const;
32  bool isTightOutTime() const;
33 
34  uint16_t bits() const { return bits_; }
35  uint16_t bitsInTime() const;
36  uint16_t bitsOutTime() const;
37 
38  uint16_t getCSCID() const { return cscID_; }
39 
41  void setCSCID(const uint16_t c) { cscID_ = c; }
42 
43 private:
44  void setDataWord(const uint16_t newWord, uint16_t& word, const unsigned shift, const unsigned mask);
45  uint16_t getDataWord(const uint16_t word, const unsigned shift, const unsigned mask) const;
46 
47  uint16_t bits_;
48  // 4-bit CSC chamber identifier
49  uint16_t cscID_;
50 };
51 
52 std::ostream& operator<<(std::ostream& o, const CSCShowerDigi& digi);
53 #endif
CSCShowerDigi::isLooseOutTime
bool isLooseOutTime() const
Definition: CSCShowerDigi.cc:29
CSCShowerDigi::BitShift
BitShift
Definition: CSCShowerDigi.h:14
CSCShowerDigi::getDataWord
uint16_t getDataWord(const uint16_t word, const unsigned shift, const unsigned mask) const
Definition: CSCShowerDigi.cc:47
CSCShowerDigi::kInTimeMask
Definition: CSCShowerDigi.h:13
CSCShowerDigi::kTight
Definition: CSCShowerDigi.h:12
CSCShowerDigi
Definition: CSCShowerDigi.h:9
CSCShowerDigi::isLooseInTime
bool isLooseInTime() const
Definition: CSCShowerDigi.cc:23
CSCShowerDigi::isTightOutTime
bool isTightOutTime() const
Definition: CSCShowerDigi.cc:33
CSCShowerDigi::setDataWord
void setDataWord(const uint16_t newWord, uint16_t &word, const unsigned shift, const unsigned mask)
Definition: CSCShowerDigi.cc:39
CSCShowerDigi::BitMask
BitMask
Definition: CSCShowerDigi.h:13
CSCShowerDigi::kNominal
Definition: CSCShowerDigi.h:12
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
operator<<
std::ostream & operator<<(std::ostream &o, const CSCShowerDigi &digi)
Definition: CSCShowerDigi.cc:51
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
CSCShowerDigi::isNominalOutTime
bool isNominalOutTime() const
Definition: CSCShowerDigi.cc:31
CSCShowerDigi::bits
uint16_t bits() const
Definition: CSCShowerDigi.h:34
CSCShowerDigi::kLoose
Definition: CSCShowerDigi.h:12
CSCShowerDigi::bits_
uint16_t bits_
Definition: CSCShowerDigi.h:47
CSCShowerDigi::kOutTimeShift
Definition: CSCShowerDigi.h:14
CSCShowerDigi::kInTimeShift
Definition: CSCShowerDigi.h:14
CSCShowerDigi::bitsInTime
uint16_t bitsInTime() const
Definition: CSCShowerDigi.cc:35
CSCShowerDigi::CSCShowerDigi
CSCShowerDigi()
default
Definition: CSCShowerDigi.cc:16
CSCShowerDigi::Run3Shower
Run3Shower
Definition: CSCShowerDigi.h:12
CSCShowerDigi::isValid
bool isValid() const
data
Definition: CSCShowerDigi.cc:18
CSCShowerDigi::kInvalid
Definition: CSCShowerDigi.h:12
CSCShowerDigi::clear
void clear()
clear this Shower
Definition: CSCShowerDigi.h:22
CSCShowerDigi::setCSCID
void setCSCID(const uint16_t c)
set cscID
Definition: CSCShowerDigi.h:41
CSCShowerDigi::kOutTimeMask
Definition: CSCShowerDigi.h:13
CSCShowerDigi::isTightInTime
bool isTightInTime() const
Definition: CSCShowerDigi.cc:27
CSCShowerDigi::isNominalInTime
bool isNominalInTime() const
Definition: CSCShowerDigi.cc:25
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
CSCShowerDigi::bitsOutTime
uint16_t bitsOutTime() const
Definition: CSCShowerDigi.cc:37
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
CSCShowerDigi::cscID_
uint16_t cscID_
Definition: CSCShowerDigi.h:49
CSCShowerDigi::getCSCID
uint16_t getCSCID() const
Definition: CSCShowerDigi.h:38