00001 #ifndef CSCStripDigi_CSCStripDigi_h 00002 #define CSCStripDigi_CSCStripDigi_h 00003 00015 #include <vector> 00016 00017 class CSCStripDigi{ 00018 00019 public: 00020 00021 // Construct from the strip number and all the other data members. 00022 CSCStripDigi (const int & strip, const std::vector<int> & ADCCounts, const std::vector<uint16_t> & ADCOverflow, 00023 const std::vector<uint16_t> & Overlap, 00024 const std::vector<uint16_t> & Errorstat); 00025 00026 // Construct from the strip number and the ADC readings. 00027 CSCStripDigi (const int & strip, const std::vector<int> & ADCCounts); 00028 00029 00030 // Default construction. 00031 CSCStripDigi (); 00032 00033 // Digis are equal if they are on the same strip and have same ADC readings 00034 bool operator==(const CSCStripDigi& digi) const; 00035 00036 // Get the strip number 00037 int getStrip() const { return strip;} 00038 00039 // Get ADC readings 00040 std::vector<int> getADCCounts() const ; 00041 00043 std::vector<uint16_t> getADCOverflow() const {return ADCOverflow;} 00044 std::vector<uint16_t> getOverlappedSample() const {return OverlappedSample;} 00045 std::vector<uint16_t> getErrorstat() const {return Errorstat;} 00046 00047 // Set the strip number 00048 void setStrip(int istrip) { strip = istrip; } 00049 00050 // Set with a vector of ADC readings 00051 void setADCCounts (std::vector<int> ADCCounts); 00052 00053 // Print content of digi 00054 void print() const; 00055 00057 float pedestal() const {return 0.5*(ADCCounts[0]+ADCCounts[1]);} 00058 float amplitude() const {return ADCCounts[4]-pedestal();} 00059 00060 private: 00061 00062 uint16_t strip; 00063 std::vector<int> ADCCounts; 00064 std::vector<uint16_t> ADCOverflow; 00065 std::vector<uint16_t> OverlappedSample; 00066 std::vector<uint16_t> Errorstat; 00067 }; 00068 00069 #include<iostream> 00070 // once upon a time was needed by COBRA 00071 inline std::ostream & operator<<(std::ostream & o, const CSCStripDigi& digi) { 00072 o << " " << digi.getStrip(); 00073 for (size_t i = 0; i<digi.getADCCounts().size(); ++i ){ 00074 o <<" " <<(digi.getADCCounts())[i]; } 00075 return o; 00076 00077 } 00078 00079 #endif 00080