CMS 3D CMS Logo

CSCStripDigi.cc
Go to the documentation of this file.
1 
8 #include <iostream>
9 #include <cstdint>
10 
11 // Comparison
12 bool CSCStripDigi::operator==(const CSCStripDigi& digi) const {
13  if (getStrip() != digi.getStrip())
14  return false;
15  if (getADCCounts().size() != digi.getADCCounts().size())
16  return false;
17  if (getADCCounts() != digi.getADCCounts())
18  return false;
19  return true;
20 }
21 
22 void CSCStripDigi::setADCCounts(const std::vector<int>& vADCCounts) {
23  bool badVal = false;
24  for (int i = 0; i < (int)vADCCounts.size(); i++) {
25  if (vADCCounts[i] < 1)
26  badVal = true;
27  }
28  if (!badVal) {
29  ADCCounts = vADCCounts;
30  } else {
31  std::vector<int> ZeroCounts(8, 0);
32  ADCCounts = ZeroCounts;
33  }
34 }
35 
36 // Debug
37 void CSCStripDigi::print() const {
38  std::ostringstream ost;
39  ost << "CSCStripDigi | strip " << getStrip() << " | ADCCounts ";
40  for (int i = 0; i < (int)getADCCounts().size(); i++) {
41  ost << getADCCounts()[i] << " ";
42  }
43  ost << " | Overflow ";
44  for (int i = 0; i < (int)getADCOverflow().size(); i++) {
45  ost << getADCOverflow()[i] << " ";
46  }
47  ost << " | Overlapped ";
48  for (int i = 0; i < (int)getOverlappedSample().size(); i++) {
49  ost << getOverlappedSample()[i] << " ";
50  }
51  ost << " | L1APhase ";
52  for (int i = 0; i < (int)getL1APhase().size(); i++) {
53  ost << getL1APhase()[i] << " ";
54  }
55  edm::LogVerbatim("CSCDigi") << ost.str();
56 }
57 
58 std::ostream& operator<<(std::ostream& o, const CSCStripDigi& digi) {
59  o << " " << digi.getStrip();
60  for (size_t i = 0; i < digi.getADCCounts().size(); ++i) {
61  o << " " << (digi.getADCCounts())[i];
62  }
63  return o;
64 }
CSCStripDigi::getADCOverflow
std::vector< uint16_t > const & getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:57
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:47
MessageLogger.h
CSCStripDigi.h
CSCStripDigi::getStrip
int getStrip() const
Definition: CSCStripDigi.h:41
CSCStripDigi::ADCCounts
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:76
CSCStripDigi::getOverlappedSample
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:58
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
CSCStripDigi::setADCCounts
void setADCCounts(const std::vector< int > &ADCCounts)
Definition: CSCStripDigi.cc:22
operator<<
std::ostream & operator<<(std::ostream &o, const CSCStripDigi &digi)
Definition: CSCStripDigi.cc:58
CSCStripDigi::operator==
bool operator==(const CSCStripDigi &digi) const
Definition: CSCStripDigi.cc:12
createfilelist.int
int
Definition: createfilelist.py:10
CSCStripDigi::getADCCounts
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:44
CSCStripDigi::print
void print() const
Definition: CSCStripDigi.cc:37
CSCStripDigi
Definition: CSCStripDigi.h:17
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128