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 
13 #include <vector>
14 #include <iosfwd>
15 #include <stdint.h>
16 
18 
19 public:
20 
21  // Construct from the strip number and all the other data members.
22  CSCStripDigi (const int & strip, const std::vector<int> & ADCCounts, const std::vector<uint16_t> & ADCOverflow,
23  const std::vector<uint16_t> & Overlap,
24  const std::vector<uint16_t> & Errorstat);
25 
26  // Construct from the strip number and the ADC readings.
27  CSCStripDigi (const int & strip, const std::vector<int> & ADCCounts);
28 
29 
30  // Default construction.
31  CSCStripDigi ();
32 
33  // Digis are equal if they are on the same strip and have same ADC readings
34  bool operator==(const CSCStripDigi& digi) const;
35 
36  // Get the strip number
37  int getStrip() const { return strip;}
38 
40  std::vector<int> getADCCounts() const ;
41 
43  std::vector<int> getL1APhase() const ;
44 
46  std::vector<uint16_t> getADCOverflow() const {return ADCOverflow;}
47  std::vector<uint16_t> getOverlappedSample() const {return OverlappedSample;}
48  std::vector<uint16_t> getErrorstat() const {return Errorstat;}
49 
50  // Set the strip number
51  void setStrip(int istrip) { strip = istrip; }
52 
53  // Set with a vector of ADC readings
54  void setADCCounts (const std::vector<int>& ADCCounts);
55 
56  // Print content of digi
57  void print() const;
58 
60  float pedestal() const {return 0.5*(ADCCounts[0]+ADCCounts[1]);}
61  float amplitude() const {return ADCCounts[4]-pedestal();}
62 
63 private:
64 
65  uint16_t strip;
66  std::vector<int> ADCCounts;
67  std::vector<uint16_t> ADCOverflow;
68  std::vector<uint16_t> OverlappedSample;
69  std::vector<uint16_t> Errorstat;
70 };
71 
72 std::ostream & operator<<(std::ostream & o, const CSCStripDigi& digi);
73 
74 #endif
75 
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:68
std::vector< int > getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.cc:39
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:69
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:66
float pedestal() const
methods for calibrations
Definition: CSCStripDigi.h:60
void setADCCounts(const std::vector< int > &ADCCounts)
Definition: CSCStripDigi.cc:70
int getStrip() const
Definition: CSCStripDigi.h:37
std::vector< int > getL1APhase() const
Get L1APhase from OverlappedSample (9th bit)
Definition: CSCStripDigi.cc:43
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:67
std::vector< uint16_t > getErrorstat() const
Definition: CSCStripDigi.h:48
void setStrip(int istrip)
Definition: CSCStripDigi.h:51
std::vector< uint16_t > getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:46
void print() const
Definition: CSCStripDigi.cc:85
bool operator==(const CSCStripDigi &digi) const
Definition: CSCStripDigi.cc:52
std::vector< uint16_t > getOverlappedSample() const
Definition: CSCStripDigi.h:47
uint16_t strip
Definition: CSCStripDigi.h:65
float amplitude() const
Definition: CSCStripDigi.h:61