CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CSCStripDigi Class Reference

#include <CSCStripDigi.h>

Public Member Functions

float amplitude () const
 
 CSCStripDigi (const int &strip, const std::vector< int > &ADCCounts, const std::vector< uint16_t > &ADCOverflow, const std::vector< uint16_t > &Overlap, const std::vector< uint16_t > &Errorstat)
 
 CSCStripDigi (const int &strip, const std::vector< int > &ADCCounts)
 
 CSCStripDigi ()
 
std::vector< int > getADCCounts () const
 Get ADC readings. More...
 
std::vector< uint16_t > getADCOverflow () const
 Other getters. More...
 
std::vector< uint16_t > getErrorstat () const
 
std::vector< int > getL1APhase () const
 Get L1APhase from OverlappedSample (9th bit) More...
 
std::vector< uint16_t > getOverlappedSample () const
 
int getStrip () const
 
bool operator== (const CSCStripDigi &digi) const
 
float pedestal () const
 methods for calibrations More...
 
void print () const
 
void setADCCounts (const std::vector< int > &ADCCounts)
 
void setStrip (int istrip)
 

Private Attributes

std::vector< int > ADCCounts
 
std::vector< uint16_t > ADCOverflow
 
std::vector< uint16_t > Errorstat
 
std::vector< uint16_t > OverlappedSample
 
uint16_t strip
 

Detailed Description

Digi for CSC Cathode Strips.

Author
M. Schmitt, Northwestern

Definition at line 17 of file CSCStripDigi.h.

Constructor & Destructor Documentation

CSCStripDigi::CSCStripDigi ( const int &  strip,
const std::vector< int > &  ADCCounts,
const std::vector< uint16_t > &  ADCOverflow,
const std::vector< uint16_t > &  Overlap,
const std::vector< uint16_t > &  Errorstat 
)

Definition at line 11 of file CSCStripDigi.cc.

11  :
12  strip(istrip),
13  ADCCounts(vADCCounts),
14  ADCOverflow(vADCOverflow),
15  OverlappedSample(vOverlap),
16  Errorstat(vErrorstat)
17 {
18 }
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:68
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:69
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:66
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:67
uint16_t strip
Definition: CSCStripDigi.h:65
CSCStripDigi::CSCStripDigi ( const int &  strip,
const std::vector< int > &  ADCCounts 
)

Definition at line 20 of file CSCStripDigi.cc.

20  :
21  strip(istrip),
22  ADCCounts(vADCCounts),
23  ADCOverflow(8,0),
24  OverlappedSample(8,0),
25  Errorstat(8,0)
26 {
27 }
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:68
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:69
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:66
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:67
uint16_t strip
Definition: CSCStripDigi.h:65
CSCStripDigi::CSCStripDigi ( )

Definition at line 30 of file CSCStripDigi.cc.

30  :
31  strip(0),
32  ADCCounts(8,0),
33  ADCOverflow(8,0),
34  OverlappedSample(8,0),
35  Errorstat(8,0)
36 {
37 }
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:68
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:69
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:66
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:67
uint16_t strip
Definition: CSCStripDigi.h:65

Member Function Documentation

float CSCStripDigi::amplitude ( ) const
inline

Definition at line 61 of file CSCStripDigi.h.

References pedestal().

61 {return ADCCounts[4]-pedestal();}
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:66
float pedestal() const
methods for calibrations
Definition: CSCStripDigi.h:60
std::vector< int > CSCStripDigi::getADCCounts ( ) const
std::vector<uint16_t> CSCStripDigi::getADCOverflow ( ) const
inline

Other getters.

Definition at line 46 of file CSCStripDigi.h.

References ADCOverflow.

Referenced by print().

46 {return ADCOverflow;}
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:67
std::vector<uint16_t> CSCStripDigi::getErrorstat ( ) const
inline

Definition at line 48 of file CSCStripDigi.h.

References Errorstat.

48 {return Errorstat;}
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:69
std::vector< int > CSCStripDigi::getL1APhase ( ) const

Get L1APhase from OverlappedSample (9th bit)

Get L1A Phase.

Definition at line 43 of file CSCStripDigi.cc.

References getOverlappedSample(), and i.

Referenced by print().

43  {
44  std::vector<int> L1APhaseResult;
45  for (int i=0; i<(int)getOverlappedSample().size(); i++) {
46  L1APhaseResult.push_back((getOverlappedSample()[i]>>8) & 0x1);}
47  return L1APhaseResult;
48 }
int i
Definition: DBlmapReader.cc:9
std::vector< uint16_t > getOverlappedSample() const
Definition: CSCStripDigi.h:47
std::vector<uint16_t> CSCStripDigi::getOverlappedSample ( ) const
inline

Definition at line 47 of file CSCStripDigi.h.

References OverlappedSample.

Referenced by getL1APhase(), and print().

47 {return OverlappedSample;}
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:68
int CSCStripDigi::getStrip ( ) const
inline

Definition at line 37 of file CSCStripDigi.h.

References strip.

Referenced by CSCCFEBData::add(), CSCDigiToRaw::add(), CSCEventData::add(), MuonTruth::analyze(), operator<<(), operator==(), and print().

37 { return strip;}
uint16_t strip
Definition: CSCStripDigi.h:65
bool CSCStripDigi::operator== ( const CSCStripDigi digi) const

Definition at line 52 of file CSCStripDigi.cc.

References getADCCounts(), and getStrip().

52  {
53  if ( getStrip() != digi.getStrip() ) return false;
54  if ( getADCCounts().size() != digi.getADCCounts().size() ) return false;
55  if ( getADCCounts() != digi.getADCCounts() ) return false;
56  return true;
57 }
std::vector< int > getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.cc:39
int getStrip() const
Definition: CSCStripDigi.h:37
float CSCStripDigi::pedestal ( ) const
inline

methods for calibrations

Definition at line 60 of file CSCStripDigi.h.

Referenced by amplitude().

60 {return 0.5*(ADCCounts[0]+ADCCounts[1]);}
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:66
void CSCStripDigi::print ( void  ) const

Definition at line 85 of file CSCStripDigi.cc.

References gather_cfg::cout, getADCCounts(), getADCOverflow(), getL1APhase(), getOverlappedSample(), getStrip(), and i.

85  {
86  std::cout << "CSC Strip: " << getStrip() << " ADC Counts: ";
87  for (int i=0; i<(int)getADCCounts().size(); i++) {std::cout << getADCCounts()[i] << " ";}
88  std::cout << "\n";
89  std::cout << " " << " ADCOverflow: ";
90  for (int i=0; i<(int)getADCOverflow().size(); i++) {std::cout << getADCOverflow()[i] << " ";}
91  std::cout << "\n";
92  std::cout << " " << " OverflappedSample: ";
93  for (int i=0; i<(int)getOverlappedSample().size(); i++) {
94  //if(getOverlappedSample()[i]!=1)
95  std::cout << getOverlappedSample()[i] << " ";}
96  std::cout << "\n";
97  std::cout << " " << " L1APhases: ";
98  for(int i=0; i<(int)getL1APhase().size(); i++){
99  std::cout << getL1APhase()[i] << " ";
100  }
101  std::cout << "\n";
102 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.cc:39
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 > getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:46
std::vector< uint16_t > getOverlappedSample() const
Definition: CSCStripDigi.h:47
tuple cout
Definition: gather_cfg.py:121
void CSCStripDigi::setADCCounts ( const std::vector< int > &  ADCCounts)

Definition at line 70 of file CSCStripDigi.cc.

References ADCCounts, and i.

Referenced by CSCStripElectronicsSim::doSaturation().

70  {
71  bool badVal = false;
72  for (int i=0; i<(int)vADCCounts.size(); i++) {
73  if (vADCCounts[i] < 1) badVal = true;
74  }
75  if ( !badVal ) {
76  ADCCounts = vADCCounts;
77  } else {
78  std::vector<int> ZeroCounts(8,0);
79  ADCCounts = ZeroCounts;
80  }
81 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:66
void CSCStripDigi::setStrip ( int  istrip)
inline

Definition at line 51 of file CSCStripDigi.h.

Referenced by CSCDigiToRaw::add().

51 { strip = istrip; }
uint16_t strip
Definition: CSCStripDigi.h:65

Member Data Documentation

std::vector<int> CSCStripDigi::ADCCounts
private

Definition at line 66 of file CSCStripDigi.h.

Referenced by getADCCounts(), and setADCCounts().

std::vector<uint16_t> CSCStripDigi::ADCOverflow
private

Definition at line 67 of file CSCStripDigi.h.

Referenced by getADCOverflow().

std::vector<uint16_t> CSCStripDigi::Errorstat
private

Definition at line 69 of file CSCStripDigi.h.

Referenced by getErrorstat().

std::vector<uint16_t> CSCStripDigi::OverlappedSample
private

Definition at line 68 of file CSCStripDigi.h.

Referenced by getOverlappedSample().

uint16_t CSCStripDigi::strip
private

Definition at line 65 of file CSCStripDigi.h.

Referenced by getStrip().