CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCStripDigi.cc
Go to the documentation of this file.
1 
8 #include <iostream>
9 #include <cstdint>
10 
11 
12 // Comparison
13 bool
15  if ( getStrip() != digi.getStrip() ) return false;
16  if ( getADCCounts().size() != digi.getADCCounts().size() ) return false;
17  if ( getADCCounts() != digi.getADCCounts() ) return false;
18  return true;
19 }
20 
21 
22 
23 void CSCStripDigi::setADCCounts(const std::vector<int>&vADCCounts) {
24  bool badVal = false;
25  for (int i=0; i<(int)vADCCounts.size(); i++) {
26  if (vADCCounts[i] < 1) 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
39  std::ostringstream ost;
40  ost << "CSCStripDigi | strip " << getStrip() << " | ADCCounts ";
41  for (int i=0; i<(int)getADCCounts().size(); i++) {ost << getADCCounts()[i] << " ";}
42  ost << " | Overflow ";
43  for (int i=0; i<(int)getADCOverflow().size(); i++) {ost << getADCOverflow()[i] << " ";}
44  ost << " | Overlapped ";
45  for (int i=0; i<(int)getOverlappedSample().size(); i++) {ost << getOverlappedSample()[i] << " ";}
46  ost << " | L1APhase ";
47  for(int i=0; i<(int)getL1APhase().size(); i++){ost << getL1APhase()[i] << " ";}
48  edm::LogVerbatim("CSCDigi") << ost.str();
49 }
50 
51 std::ostream & operator<<(std::ostream & o, const CSCStripDigi& digi) {
52  o << " " << digi.getStrip();
53  for (size_t i = 0; i<digi.getADCCounts().size(); ++i ){
54  o <<" " <<(digi.getADCCounts())[i]; }
55  return o;
56 
57 }
58 
59 
60 
std::vector< int > getL1APhase() const
Get L1APhase from OverlappedSample (9th bit)
Definition: CSCStripDigi.h:58
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:71
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:54
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:90
void setADCCounts(const std::vector< int > &ADCCounts)
Definition: CSCStripDigi.cc:23
int getStrip() const
Definition: CSCStripDigi.h:51
std::vector< uint16_t > const & getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:70
void print() const
Definition: CSCStripDigi.cc:38
bool operator==(const CSCStripDigi &digi) const
Definition: CSCStripDigi.cc:14