CMS 3D CMS Logo

CSCShowerDigi.cc
Go to the documentation of this file.
3 #include <iomanip>
4 #include <iostream>
5 
6 using namespace std;
7 
9 CSCShowerDigi::CSCShowerDigi(const uint16_t bitsInTime,
10  const uint16_t bitsOutOfTime,
11  const uint16_t cscID,
12  const uint16_t bx,
13  const uint16_t showerType,
14  const uint16_t wireNHits,
15  const uint16_t compNHits)
16  : bitsInTime_(bitsInTime),
17  bitsOutOfTime_(bitsOutOfTime),
18  cscID_(cscID),
19  bx_(bx),
20  showerType_(showerType),
21  wireNHits_(wireNHits),
22  comparatorNHits_(compNHits) {}
23 
26  : bitsInTime_(0), bitsOutOfTime_(0), cscID_(0), bx_(0), showerType_(0), wireNHits_(0), comparatorNHits_(0) {}
27 
29  bitsInTime_ = 0;
30  bitsOutOfTime_ = 0;
31  cscID_ = 0;
32  bx_ = 0;
33  showerType_ = 0;
34  wireNHits_ = 0;
35  comparatorNHits_ = 0;
36 }
37 
38 bool CSCShowerDigi::isValid() const {
39  // any loose shower is valid
40  // isLooseOutofTime() is removed as out-of-time shower is not used for Run3
41  return isLooseInTime() and isValidShowerType();
42 }
43 
44 bool CSCShowerDigi::isLooseInTime() const { return bitsInTime() >= kLoose; }
45 
46 bool CSCShowerDigi::isNominalInTime() const { return bitsInTime() >= kNominal; }
47 
48 bool CSCShowerDigi::isTightInTime() const { return bitsInTime() >= kTight; }
49 
51 
53 
55 
57 
58 std::ostream& operator<<(std::ostream& o, const CSCShowerDigi& digi) {
59  unsigned int showerType = digi.getShowerType();
60  std::string compHitsStr(", comparatorHits ");
61  compHitsStr += std::to_string(digi.getComparatorNHits());
62  std::string wireHitsStr(", wireHits ");
63  wireHitsStr += std::to_string(digi.getWireNHits());
64  std::string showerStr;
65  switch (showerType) {
66  case 0:
67  showerStr = "Invalid ShowerType";
68  break;
69  case 1:
70  showerStr = "AnodeShower";
71  break;
72  case 2:
73  showerStr = "CathodeShower";
74  break;
75  case 3:
76  showerStr = "MatchedShower";
77  break;
78  case 4:
79  showerStr = "EMTFShower";
80  break;
81  case 5:
82  showerStr = "GMTShower";
83  break;
84  default:
85  showerStr = "UnknownShowerType";
86  }
87 
88  return o << showerStr << ": bx " << digi.getBX() << ", in-time bits " << digi.bitsInTime() << ", out-of-time bits "
89  << digi.bitsOutOfTime() << ((showerType == 1 or showerType == 3) ? wireHitsStr : "")
90  << ((showerType == 2 or showerType == 3) ? compHitsStr : "") << ";";
91 }
bool isLooseOutOfTime() const
uint16_t wireNHits_
Definition: CSCShowerDigi.h:68
std::ostream & operator<<(std::ostream &o, const CSCShowerDigi &digi)
uint16_t comparatorNHits_
Definition: CSCShowerDigi.h:69
bool isValid() const
data
uint16_t getComparatorNHits() const
Definition: CSCShowerDigi.h:55
uint16_t bitsOutOfTime_
Definition: CSCShowerDigi.h:63
uint16_t showerType_
Definition: CSCShowerDigi.h:67
uint16_t bitsOutOfTime() const
Definition: CSCShowerDigi.h:49
bool isValidShowerType() const
static std::string to_string(const XMLCh *ch)
bool isLooseInTime() const
uint16_t bx_
Definition: CSCShowerDigi.h:66
bool isTightInTime() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
uint16_t getBX() const
Definition: CSCShowerDigi.h:51
uint16_t getShowerType() const
Definition: CSCShowerDigi.h:53
bool isNominalInTime() const
bool isTightOutOfTime() const
uint16_t cscID_
Definition: CSCShowerDigi.h:65
uint16_t bitsInTime() const
Definition: CSCShowerDigi.h:48
bool isNominalOutOfTime() const
uint16_t getWireNHits() const
Definition: CSCShowerDigi.h:54
uint16_t bitsInTime_
Definition: CSCShowerDigi.h:62
void clear()
clear this Shower
CSCShowerDigi()
default