CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCStripDigi.h
Go to the documentation of this file.
1 #ifndef CSCStripDigi_CSCStripDigi_h
2 #define CSCStripDigi_CSCStripDigi_h
3 
15 #include <vector>
16 #include <iosfwd>
17 #include <stdint.h>
18 
20 
21 public:
22 
23  // Construct from the strip number and all the other data members.
24  CSCStripDigi (const int & strip, const std::vector<int> & ADCCounts, const std::vector<uint16_t> & ADCOverflow,
25  const std::vector<uint16_t> & Overlap,
26  const std::vector<uint16_t> & Errorstat);
27 
28  // Construct from the strip number and the ADC readings.
29  CSCStripDigi (const int & strip, const std::vector<int> & ADCCounts);
30 
31 
32  // Default construction.
33  CSCStripDigi ();
34 
35  // Digis are equal if they are on the same strip and have same ADC readings
36  bool operator==(const CSCStripDigi& digi) const;
37 
38  // Get the strip number
39  int getStrip() const { return strip;}
40 
42  std::vector<int> getADCCounts() const ;
43 
45  std::vector<int> getL1APhase() const ;
46 
48  std::vector<uint16_t> getADCOverflow() const {return ADCOverflow;}
49  std::vector<uint16_t> getOverlappedSample() const {return OverlappedSample;}
50  std::vector<uint16_t> getErrorstat() const {return Errorstat;}
51 
52  // Set the strip number
53  void setStrip(int istrip) { strip = istrip; }
54 
55  // Set with a vector of ADC readings
56  void setADCCounts (std::vector<int> ADCCounts);
57 
58  // Print content of digi
59  void print() const;
60 
62  float pedestal() const {return 0.5*(ADCCounts[0]+ADCCounts[1]);}
63  float amplitude() const {return ADCCounts[4]-pedestal();}
64 
65 private:
66 
67  uint16_t strip;
68  std::vector<int> ADCCounts;
69  std::vector<uint16_t> ADCOverflow;
70  std::vector<uint16_t> OverlappedSample;
71  std::vector<uint16_t> Errorstat;
72 };
73 
74 std::ostream & operator<<(std::ostream & o, const CSCStripDigi& digi);
75 
76 #endif
77 
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:70
std::vector< int > getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.cc:41
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:71
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:68
float pedestal() const
methods for calibrations
Definition: CSCStripDigi.h:62
int getStrip() const
Definition: CSCStripDigi.h:39
std::vector< int > getL1APhase() const
Get L1APhase from OverlappedSample (9th bit)
Definition: CSCStripDigi.cc:45
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:69
void setADCCounts(std::vector< int > ADCCounts)
Definition: CSCStripDigi.cc:72
std::vector< uint16_t > getErrorstat() const
Definition: CSCStripDigi.h:50
void setStrip(int istrip)
Definition: CSCStripDigi.h:53
std::vector< uint16_t > getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:48
void print() const
Definition: CSCStripDigi.cc:87
bool operator==(const CSCStripDigi &digi) const
Definition: CSCStripDigi.cc:54
std::vector< uint16_t > getOverlappedSample() const
Definition: CSCStripDigi.h:49
uint16_t strip
Definition: CSCStripDigi.h:67
float amplitude() const
Definition: CSCStripDigi.h:63