CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 &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...
 
int getCFEB () const
 Get the CFEB number. Counts from 0. 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:81
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:82
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:79
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:80
uint16_t strip
Definition: CSCStripDigi.h:78
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:81
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:82
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:79
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:80
uint16_t strip
Definition: CSCStripDigi.h:78
CSCStripDigi::CSCStripDigi ( )
inline

Definition at line 35 of file CSCStripDigi.h.

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

Member Function Documentation

float CSCStripDigi::amplitude ( ) const
inline

Definition at line 75 of file CSCStripDigi.h.

References ADCCounts, and pedestal().

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

Other getters.

Definition at line 60 of file CSCStripDigi.h.

References ADCOverflow.

Referenced by print().

60 { return ADCOverflow; }
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:80
int CSCStripDigi::getCFEB ( ) const

Get the CFEB number. Counts from 0.

Definition at line 25 of file CSCStripDigi.cc.

References CSCConstants::NUM_STRIPS_PER_CFEB, and strip.

Referenced by CSCDigiToRaw::add(), and CSCEventData::add().

std::vector<uint16_t> const& CSCStripDigi::getErrorstat ( ) const
inline

Definition at line 62 of file CSCStripDigi.h.

References Errorstat.

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

Get L1APhase from OverlappedSample (9th bit)

Definition at line 50 of file CSCStripDigi.h.

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

Referenced by print().

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

Definition at line 57 of file CSCStripDigi.h.

References getOverlappedSample().

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

Definition at line 61 of file CSCStripDigi.h.

References OverlappedSample.

Referenced by getL1APhase(), and print().

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

Definition at line 41 of file CSCStripDigi.h.

References strip.

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

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

Definition at line 13 of file CSCStripDigi.cc.

References getADCCounts(), and getStrip().

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

methods for calibrations

Definition at line 74 of file CSCStripDigi.h.

References ADCCounts.

Referenced by amplitude().

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

Definition at line 42 of file CSCStripDigi.cc.

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

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

Definition at line 27 of file CSCStripDigi.cc.

References ADCCounts, and mps_fire::i.

Referenced by CSCStripElectronicsSim::doSaturation().

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

Definition at line 65 of file CSCStripDigi.h.

References strip.

Referenced by CSCDigiToRaw::add().

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

Member Data Documentation

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

Definition at line 79 of file CSCStripDigi.h.

Referenced by amplitude(), getADCCounts(), pedestal(), and setADCCounts().

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

Definition at line 80 of file CSCStripDigi.h.

Referenced by getADCOverflow().

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

Definition at line 82 of file CSCStripDigi.h.

Referenced by getErrorstat().

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

Definition at line 81 of file CSCStripDigi.h.

Referenced by getOverlappedSample().

uint16_t CSCStripDigi::strip
private

Definition at line 78 of file CSCStripDigi.h.

Referenced by getCFEB(), getStrip(), and setStrip().