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.

Date:
2013/04/22 22:39:23
Revision:
1.23
Author
M. Schmitt, Northwestern

Definition at line 19 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 13 of file CSCStripDigi.cc.

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

Definition at line 22 of file CSCStripDigi.cc.

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

Definition at line 32 of file CSCStripDigi.cc.

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

Member Function Documentation

float CSCStripDigi::amplitude ( ) const
inline

Definition at line 63 of file CSCStripDigi.h.

References pedestal().

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

Other getters.

Definition at line 48 of file CSCStripDigi.h.

References ADCOverflow.

Referenced by print().

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

Definition at line 50 of file CSCStripDigi.h.

References Errorstat.

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

Get L1APhase from OverlappedSample (9th bit)

Get L1A Phase.

Definition at line 45 of file CSCStripDigi.cc.

References getOverlappedSample(), and i.

Referenced by print().

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

Definition at line 49 of file CSCStripDigi.h.

References OverlappedSample.

Referenced by getL1APhase(), and print().

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

Definition at line 39 of file CSCStripDigi.h.

References strip.

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

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

Definition at line 54 of file CSCStripDigi.cc.

References getADCCounts(), and getStrip().

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

methods for calibrations

Definition at line 62 of file CSCStripDigi.h.

Referenced by amplitude().

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

Definition at line 87 of file CSCStripDigi.cc.

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

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

Definition at line 72 of file CSCStripDigi.cc.

References ADCCounts, and i.

Referenced by CSCStripElectronicsSim::doSaturation().

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

Definition at line 53 of file CSCStripDigi.h.

Referenced by CSCDigiToRaw::add().

53 { strip = istrip; }
uint16_t strip
Definition: CSCStripDigi.h:67

Member Data Documentation

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

Definition at line 68 of file CSCStripDigi.h.

Referenced by getADCCounts(), and setADCCounts().

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

Definition at line 69 of file CSCStripDigi.h.

Referenced by getADCOverflow().

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

Definition at line 71 of file CSCStripDigi.h.

Referenced by getErrorstat().

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

Definition at line 70 of file CSCStripDigi.h.

Referenced by getOverlappedSample().

uint16_t CSCStripDigi::strip
private

Definition at line 67 of file CSCStripDigi.h.

Referenced by getStrip().