CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCStripDigi.cc
Go to the documentation of this file.
1 
9 #include <iostream>
10 #include <cstdint>
11 
12 // Comparison
13 bool CSCStripDigi::operator==(const CSCStripDigi& digi) const {
14  if (getStrip() != digi.getStrip())
15  return false;
16  if (getADCCounts().size() != digi.getADCCounts().size())
17  return false;
18  if (getADCCounts() != digi.getADCCounts())
19  return false;
20  return true;
21 }
22 
24 // originally defined in EventFilter/CSCRawToDigi/src/CSCComparatorData.cc
26 
27 void CSCStripDigi::setADCCounts(const std::vector<int>& vADCCounts) {
28  bool badVal = false;
29  for (int i = 0; i < (int)vADCCounts.size(); i++) {
30  if (vADCCounts[i] < 1)
31  badVal = true;
32  }
33  if (!badVal) {
34  ADCCounts = vADCCounts;
35  } else {
36  std::vector<int> ZeroCounts(8, 0);
37  ADCCounts = ZeroCounts;
38  }
39 }
40 
41 // Debug
42 void CSCStripDigi::print() const {
43  std::ostringstream ost;
44  ost << "CSCStripDigi | strip " << getStrip() << " | ADCCounts ";
45  for (int i = 0; i < (int)getADCCounts().size(); i++) {
46  ost << getADCCounts()[i] << " ";
47  }
48  ost << " | Overflow ";
49  for (int i = 0; i < (int)getADCOverflow().size(); i++) {
50  ost << getADCOverflow()[i] << " ";
51  }
52  ost << " | Overlapped ";
53  for (int i = 0; i < (int)getOverlappedSample().size(); i++) {
54  ost << getOverlappedSample()[i] << " ";
55  }
56  ost << " | L1APhase ";
57  for (int i = 0; i < (int)getL1APhase().size(); i++) {
58  ost << getL1APhase()[i] << " ";
59  }
60  edm::LogVerbatim("CSCDigi") << ost.str();
61 }
62 
63 std::ostream& operator<<(std::ostream& o, const CSCStripDigi& digi) {
64  o << " " << digi.getStrip();
65  for (size_t i = 0; i < digi.getADCCounts().size(); ++i) {
66  o << " " << (digi.getADCCounts())[i];
67  }
68  return o;
69 }
std::vector< int > getL1APhase() const
Get L1APhase from OverlappedSample (9th bit)
Definition: CSCStripDigi.h:50
Log< level::Info, true > LogVerbatim
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:61
int getCFEB() const
Get the CFEB number. Counts from 0.
Definition: CSCStripDigi.cc:25
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:47
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:79
void setADCCounts(const std::vector< int > &ADCCounts)
Definition: CSCStripDigi.cc:27
int getStrip() const
Definition: CSCStripDigi.h:41
std::vector< uint16_t > const & getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:60
void print() const
Definition: CSCStripDigi.cc:42
bool operator==(const CSCStripDigi &digi) const
Definition: CSCStripDigi.cc:13
uint16_t strip
Definition: CSCStripDigi.h:78