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 
7 #include <iostream>
8 #include <cstdint>
9 
10 
11 // Comparison
12 bool
14  if ( getStrip() != digi.getStrip() ) return false;
15  if ( getADCCounts().size() != digi.getADCCounts().size() ) return false;
16  if ( getADCCounts() != digi.getADCCounts() ) return false;
17  return true;
18 }
19 
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) badVal = true;
26  }
27  if ( !badVal ) {
28  ADCCounts = vADCCounts;
29  } else {
30  std::vector<int> ZeroCounts(8,0);
31  ADCCounts = ZeroCounts;
32  }
33 }
34 
35 // Debug
36 void
38  std::cout << "CSC Strip: " << getStrip() << " ADC Counts: ";
39  for (int i=0; i<(int)getADCCounts().size(); i++) {std::cout << getADCCounts()[i] << " ";}
40  std::cout << "\n";
41  std::cout << " " << " ADCOverflow: ";
42  for (int i=0; i<(int)getADCOverflow().size(); i++) {std::cout << getADCOverflow()[i] << " ";}
43  std::cout << "\n";
44  std::cout << " " << " OverflappedSample: ";
45  for (int i=0; i<(int)getOverlappedSample().size(); i++) {
46  //if(getOverlappedSample()[i]!=1)
47  std::cout << getOverlappedSample()[i] << " ";}
48  std::cout << "\n";
49  std::cout << " " << " L1APhases: ";
50  for(int i=0; i<(int)getL1APhase().size(); i++){
51  std::cout << getL1APhase()[i] << " ";
52  }
53  std::cout << "\n";
54 }
55 
56 std::ostream & operator<<(std::ostream & o, const CSCStripDigi& digi) {
57  o << " " << digi.getStrip();
58  for (size_t i = 0; i<digi.getADCCounts().size(); ++i ){
59  o <<" " <<(digi.getADCCounts())[i]; }
60  return o;
61 
62 }
63 
64 
65 
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:22
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:37
bool operator==(const CSCStripDigi &digi) const
Definition: CSCStripDigi.cc:13
tuple cout
Definition: gather_cfg.py:121