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