CMS 3D CMS Logo

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 }
CSCStripDigi::getADCOverflow
std::vector< uint16_t > const & getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:60
mps_fire.i
i
Definition: mps_fire.py:428
CSCStripDigi::getL1APhase
std::vector< int > getL1APhase() const
Get L1APhase from OverlappedSample (9th bit)
Definition: CSCStripDigi.h:50
MessageLogger.h
CSCStripDigi.h
CSCStripDigi::getStrip
int getStrip() const
Definition: CSCStripDigi.h:41
CSCStripDigi::ADCCounts
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:79
CSCStripDigi::getOverlappedSample
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:61
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
CSCConstants::NUM_STRIPS_PER_CFEB
Definition: CSCConstants.h:60
CSCStripDigi::setADCCounts
void setADCCounts(const std::vector< int > &ADCCounts)
Definition: CSCStripDigi.cc:27
CSCStripDigi::strip
uint16_t strip
Definition: CSCStripDigi.h:78
CSCConstants.h
operator<<
std::ostream & operator<<(std::ostream &o, const CSCStripDigi &digi)
Definition: CSCStripDigi.cc:63
CSCStripDigi::operator==
bool operator==(const CSCStripDigi &digi) const
Definition: CSCStripDigi.cc:13
createfilelist.int
int
Definition: createfilelist.py:10
CSCStripDigi::getADCCounts
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:47
CSCStripDigi::print
void print() const
Definition: CSCStripDigi.cc:42
CSCStripDigi::getCFEB
int getCFEB() const
Get the CFEB number. Counts from 0.
Definition: CSCStripDigi.cc:25
CSCStripDigi
Definition: CSCStripDigi.h:17
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128