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 20 of file CSCStripDigi.h.

25  : strip(istrip),
26  ADCCounts(vADCCounts),
27  ADCOverflow(vADCOverflow),
28  OverlappedSample(vOverlap),
29  Errorstat(vErrorstat) {}
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:78
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:79
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:76
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:77
uint16_t strip
Definition: CSCStripDigi.h:75
CSCStripDigi::CSCStripDigi ( const int &  istrip,
const std::vector< int > &  vADCCounts 
)
inline

Definition at line 32 of file CSCStripDigi.h.

33  : strip(istrip), ADCCounts(vADCCounts), ADCOverflow(8, 0), OverlappedSample(8, 0), Errorstat(8, 0) {}
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:78
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:79
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:76
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:77
uint16_t strip
Definition: CSCStripDigi.h:75
CSCStripDigi::CSCStripDigi ( )
inline

Definition at line 35 of file CSCStripDigi.h.

References operator==().

35 : strip(0), ADCCounts(8, 0), ADCOverflow(8, 0), OverlappedSample(8, 0), Errorstat(8, 0) {}
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:78
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:79
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:76
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:77
uint16_t strip
Definition: CSCStripDigi.h:75

Member Function Documentation

float CSCStripDigi::amplitude ( ) const
inline

Definition at line 72 of file CSCStripDigi.h.

References pedestal().

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

Other getters.

Definition at line 57 of file CSCStripDigi.h.

References ADCOverflow.

Referenced by print().

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

Definition at line 59 of file CSCStripDigi.h.

References Errorstat.

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

Get L1APhase from OverlappedSample (9th bit)

Definition at line 47 of file CSCStripDigi.h.

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

Referenced by print().

47  {
48  std::vector<int> L1APhaseResult(getOverlappedSample().size());
49  for (int i = 0; i < (int)getOverlappedSample().size(); i++)
50  L1APhaseResult[i] = (getOverlappedSample()[i] >> 8) & 0x1;
51  return L1APhaseResult;
52  }
size
Write out results.
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:58
int CSCStripDigi::getL1APhase ( int  i) const
inline

Definition at line 54 of file CSCStripDigi.h.

References getOverlappedSample().

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

Definition at line 58 of file CSCStripDigi.h.

References OverlappedSample.

Referenced by getL1APhase(), and print().

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

Definition at line 41 of file CSCStripDigi.h.

References strip.

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

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

Definition at line 12 of file CSCStripDigi.cc.

References getADCCounts(), and getStrip().

Referenced by CSCStripDigi().

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

methods for calibrations

Definition at line 71 of file CSCStripDigi.h.

Referenced by amplitude().

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

Definition at line 37 of file CSCStripDigi.cc.

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

Referenced by setStrip().

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

Definition at line 22 of file CSCStripDigi.cc.

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

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

22  {
23  bool badVal = false;
24  for (int i = 0; i < (int)vADCCounts.size(); i++) {
25  if (vADCCounts[i] < 1)
26  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:76
void CSCStripDigi::setStrip ( int  istrip)
inline

Definition at line 62 of file CSCStripDigi.h.

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

Referenced by CSCDigiToRaw::add().

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

Member Data Documentation

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

Definition at line 76 of file CSCStripDigi.h.

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

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

Definition at line 77 of file CSCStripDigi.h.

Referenced by getADCOverflow().

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

Definition at line 79 of file CSCStripDigi.h.

Referenced by getErrorstat().

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

Definition at line 78 of file CSCStripDigi.h.

Referenced by getOverlappedSample().

uint16_t CSCStripDigi::strip
private

Definition at line 75 of file CSCStripDigi.h.

Referenced by getStrip(), and setStrip().