00001
00008 #include <DataFormats/CSCDigi/interface/CSCStripDigi.h>
00009
00010 using namespace std;
00011
00012
00013 CSCStripDigi::CSCStripDigi (const int & istrip, const vector<int> & vADCCounts, const vector<uint16_t> & vADCOverflow,
00014 const vector<uint16_t> & vOverlap, const vector<uint16_t> & vErrorstat ):
00015 strip(istrip),
00016 ADCCounts(vADCCounts),
00017 ADCOverflow(vADCOverflow),
00018 OverlappedSample(vOverlap),
00019 Errorstat(vErrorstat)
00020 {
00021 }
00022
00023 CSCStripDigi::CSCStripDigi (const int & istrip, const vector<int> & vADCCounts):
00024 strip(istrip),
00025 ADCCounts(vADCCounts),
00026 ADCOverflow(8,0),
00027 OverlappedSample(8,0),
00028 Errorstat(8,0)
00029 {
00030 }
00031
00032
00033 CSCStripDigi::CSCStripDigi ():
00034 strip(0),
00035 ADCCounts(8,0),
00036 ADCOverflow(8,0),
00037 OverlappedSample(8,0),
00038 Errorstat(8,0)
00039 {
00040 }
00041
00042 std::vector<int> CSCStripDigi::getADCCounts() const { return ADCCounts; }
00043
00044
00045 bool
00046 CSCStripDigi::operator == (const CSCStripDigi& digi) const {
00047 if ( getStrip() != digi.getStrip() ) return false;
00048 if ( getADCCounts().size() != digi.getADCCounts().size() ) return false;
00049 if ( getADCCounts() != digi.getADCCounts() ) return false;
00050 return true;
00051 }
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 void CSCStripDigi::setADCCounts(vector<int>vADCCounts) {
00065 bool badVal = false;
00066 for (int i=0; i<(int)vADCCounts.size(); i++) {
00067 if (vADCCounts[i] < 1) badVal = true;
00068 }
00069 if ( !badVal ) {
00070 ADCCounts = vADCCounts;
00071 } else {
00072 vector<int> ZeroCounts(8,0);
00073 ADCCounts = ZeroCounts;
00074 }
00075 }
00076
00077
00078 void
00079 CSCStripDigi::print() const {
00080 cout << "CSC Strip: " << getStrip() << " ADC Counts: ";
00081 for (int i=0; i<(int)getADCCounts().size(); i++) {cout << getADCCounts()[i] << " ";}
00082 cout << "\n";
00083 }
00084
00085
00086
00087