CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCStripDigi Class Reference

#include <CSCStripDigi.h>

Public Member Functions

float amplitude () const
 
 CSCStripDigi (const int &istrip, const std::vector< int > &vADCCounts, const std::vector< uint16_t > &vADCOverflow, const std::vector< uint16_t > &vOverlap, const std::vector< uint16_t > &vErrorstat)
 
 CSCStripDigi (const int &istrip, const std::vector< int > &vADCCounts)
 
 CSCStripDigi ()
 
std::vector< int > const & getADCCounts () const
 Get ADC readings. More...
 
std::vector< uint16_t > const & getADCOverflow () const
 Other getters. More...
 
std::vector< uint16_t > const & getErrorstat () const
 
std::vector< int > getL1APhase () const
 Get L1APhase from OverlappedSample (9th bit) More...
 
int getL1APhase (int i) const
 
std::vector< uint16_t > const & 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 &  istrip,
const std::vector< int > &  vADCCounts,
const std::vector< uint16_t > &  vADCOverflow,
const std::vector< uint16_t > &  vOverlap,
const std::vector< uint16_t > &  vErrorstat 
)
inline

Definition at line 22 of file CSCStripDigi.h.

23  :
24  strip(istrip),
25  ADCCounts(vADCCounts),
26  ADCOverflow(vADCOverflow),
27  OverlappedSample(vOverlap),
28  Errorstat(vErrorstat) {}
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:92
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:93
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:90
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:91
uint16_t strip
Definition: CSCStripDigi.h:89
CSCStripDigi::CSCStripDigi ( const int &  istrip,
const std::vector< int > &  vADCCounts 
)
inline

Definition at line 31 of file CSCStripDigi.h.

31  :
32  strip(istrip),
33  ADCCounts(vADCCounts),
34  ADCOverflow(8,0),
35  OverlappedSample(8,0),
36  Errorstat(8,0){}
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:92
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:93
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:90
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:91
uint16_t strip
Definition: CSCStripDigi.h:89
CSCStripDigi::CSCStripDigi ( )
inline

Definition at line 39 of file CSCStripDigi.h.

References operator==().

39  :
40  strip(0),
41  ADCCounts(8,0),
42  ADCOverflow(8,0),
43  OverlappedSample(8,0),
44  Errorstat(8,0){}
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:92
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:93
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:90
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:91
uint16_t strip
Definition: CSCStripDigi.h:89

Member Function Documentation

float CSCStripDigi::amplitude ( ) const
inline

Definition at line 85 of file CSCStripDigi.h.

References pedestal().

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

Other getters.

Definition at line 70 of file CSCStripDigi.h.

References ADCOverflow.

Referenced by print().

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

Definition at line 72 of file CSCStripDigi.h.

References Errorstat.

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

Get L1APhase from OverlappedSample (9th bit)

Definition at line 58 of file CSCStripDigi.h.

References getOverlappedSample(), mps_fire::i, createfilelist::int, and findQualityFiles::size.

Referenced by print().

58  {
59  std::vector<int> L1APhaseResult(getOverlappedSample().size());
60  for (int i=0; i<(int)getOverlappedSample().size(); i++)
61  L1APhaseResult[i] = (getOverlappedSample()[i]>>8) & 0x1;
62  return L1APhaseResult;
63  }
size
Write out results.
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:71
int CSCStripDigi::getL1APhase ( int  i) const
inline

Definition at line 65 of file CSCStripDigi.h.

References getOverlappedSample().

65  {
66  return (getOverlappedSample()[i]>>8) & 0x1;
67  }
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:71
std::vector<uint16_t> const& CSCStripDigi::getOverlappedSample ( ) const
inline

Definition at line 71 of file CSCStripDigi.h.

References OverlappedSample.

Referenced by getL1APhase(), and print().

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

Definition at line 51 of file CSCStripDigi.h.

References strip.

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

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

Definition at line 14 of file CSCStripDigi.cc.

References getADCCounts(), and getStrip().

Referenced by CSCStripDigi().

14  {
15  if ( getStrip() != digi.getStrip() ) return false;
16  if ( getADCCounts().size() != digi.getADCCounts().size() ) return false;
17  if ( getADCCounts() != digi.getADCCounts() ) return false;
18  return true;
19 }
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:54
int getStrip() const
Definition: CSCStripDigi.h:51
float CSCStripDigi::pedestal ( ) const
inline

methods for calibrations

Definition at line 84 of file CSCStripDigi.h.

Referenced by amplitude().

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

Definition at line 38 of file CSCStripDigi.cc.

References getADCCounts(), getADCOverflow(), getL1APhase(), getOverlappedSample(), getStrip(), mps_fire::i, and createfilelist::int.

Referenced by setStrip().

38  {
39  std::ostringstream ost;
40  ost << "CSCStripDigi | strip " << getStrip() << " | ADCCounts ";
41  for (int i=0; i<(int)getADCCounts().size(); i++) {ost << getADCCounts()[i] << " ";}
42  ost << " | Overflow ";
43  for (int i=0; i<(int)getADCOverflow().size(); i++) {ost << getADCOverflow()[i] << " ";}
44  ost << " | Overlapped ";
45  for (int i=0; i<(int)getOverlappedSample().size(); i++) {ost << getOverlappedSample()[i] << " ";}
46  ost << " | L1APhase ";
47  for(int i=0; i<(int)getL1APhase().size(); i++){ost << getL1APhase()[i] << " ";}
48  edm::LogVerbatim("CSCDigi") << ost.str();
49 }
std::vector< int > getL1APhase() const
Get L1APhase from OverlappedSample (9th bit)
Definition: CSCStripDigi.h:58
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:71
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:54
int getStrip() const
Definition: CSCStripDigi.h:51
std::vector< uint16_t > const & getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:70
void CSCStripDigi::setADCCounts ( const std::vector< int > &  ADCCounts)

Definition at line 23 of file CSCStripDigi.cc.

References ADCCounts, mps_fire::i, and createfilelist::int.

Referenced by CSCStripElectronicsSim::doSaturation(), and setStrip().

23  {
24  bool badVal = false;
25  for (int i=0; i<(int)vADCCounts.size(); i++) {
26  if (vADCCounts[i] < 1) badVal = true;
27  }
28  if ( !badVal ) {
29  ADCCounts = vADCCounts;
30  } else {
31  std::vector<int> ZeroCounts(8,0);
32  ADCCounts = ZeroCounts;
33  }
34 }
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:90
void CSCStripDigi::setStrip ( int  istrip)
inline

Definition at line 75 of file CSCStripDigi.h.

References ADCCounts, print(), setADCCounts(), and strip.

Referenced by CSCDigiToRaw::add().

75 { strip = istrip; }
uint16_t strip
Definition: CSCStripDigi.h:89

Member Data Documentation

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

Definition at line 90 of file CSCStripDigi.h.

Referenced by getADCCounts(), setADCCounts(), and setStrip().

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

Definition at line 91 of file CSCStripDigi.h.

Referenced by getADCOverflow().

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

Definition at line 93 of file CSCStripDigi.h.

Referenced by getErrorstat().

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

Definition at line 92 of file CSCStripDigi.h.

Referenced by getOverlappedSample().

uint16_t CSCStripDigi::strip
private

Definition at line 89 of file CSCStripDigi.h.

Referenced by getStrip(), and setStrip().