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 ()
 
 CSCStripDigi (const int &istrip, const std::vector< int > &vADCCounts)
 
 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)
 
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() [1/3]

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) {}

◆ CSCStripDigi() [2/3]

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) {}

◆ CSCStripDigi() [3/3]

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) {}

Member Function Documentation

◆ amplitude()

float CSCStripDigi::amplitude ( ) const
inline

Definition at line 72 of file CSCStripDigi.h.

72 { return ADCCounts[4] - pedestal(); }

References ADCCounts, and pedestal().

◆ getADCCounts()

std::vector<int> const& CSCStripDigi::getADCCounts ( ) const
inline

◆ getADCOverflow()

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

Other getters.

Definition at line 57 of file CSCStripDigi.h.

57 { return ADCOverflow; }

References ADCOverflow.

Referenced by print().

◆ getErrorstat()

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

Definition at line 59 of file CSCStripDigi.h.

59 { return Errorstat; }

References Errorstat.

◆ getL1APhase() [1/2]

std::vector<int> CSCStripDigi::getL1APhase ( ) const
inline

Get L1APhase from OverlappedSample (9th bit)

Definition at line 47 of file CSCStripDigi.h.

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  }

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

Referenced by print().

◆ getL1APhase() [2/2]

int CSCStripDigi::getL1APhase ( int  i) const
inline

Definition at line 54 of file CSCStripDigi.h.

54 { return (getOverlappedSample()[i] >> 8) & 0x1; }

References getOverlappedSample(), and mps_fire::i.

◆ getOverlappedSample()

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

Definition at line 58 of file CSCStripDigi.h.

58 { return OverlappedSample; }

References OverlappedSample.

Referenced by getL1APhase(), and print().

◆ getStrip()

int CSCStripDigi::getStrip ( ) const
inline

Definition at line 41 of file CSCStripDigi.h.

41 { return strip; }

References strip.

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

◆ operator==()

bool CSCStripDigi::operator== ( const CSCStripDigi digi) const

Definition at line 12 of file CSCStripDigi.cc.

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 }

References getADCCounts(), and getStrip().

◆ pedestal()

float CSCStripDigi::pedestal ( ) const
inline

methods for calibrations

Definition at line 71 of file CSCStripDigi.h.

71 { return 0.5f * (ADCCounts[0] + ADCCounts[1]); }

References ADCCounts.

Referenced by amplitude().

◆ print()

void CSCStripDigi::print ( void  ) const

Definition at line 37 of file CSCStripDigi.cc.

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 }

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

◆ setADCCounts()

void CSCStripDigi::setADCCounts ( const std::vector< int > &  ADCCounts)

Definition at line 22 of file CSCStripDigi.cc.

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 }

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

Referenced by CSCStripElectronicsSim::doSaturation().

◆ setStrip()

void CSCStripDigi::setStrip ( int  istrip)
inline

Definition at line 62 of file CSCStripDigi.h.

62 { strip = istrip; }

References strip.

Referenced by CSCDigiToRaw::add().

Member Data Documentation

◆ ADCCounts

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

Definition at line 76 of file CSCStripDigi.h.

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

◆ ADCOverflow

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

Definition at line 77 of file CSCStripDigi.h.

Referenced by getADCOverflow().

◆ Errorstat

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

Definition at line 79 of file CSCStripDigi.h.

Referenced by getErrorstat().

◆ OverlappedSample

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

Definition at line 78 of file CSCStripDigi.h.

Referenced by getOverlappedSample().

◆ strip

uint16_t CSCStripDigi::strip
private

Definition at line 75 of file CSCStripDigi.h.

Referenced by getStrip(), and setStrip().

CSCStripDigi::getADCOverflow
std::vector< uint16_t > const & getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:57
mps_fire.i
i
Definition: mps_fire.py:355
CSCStripDigi::getL1APhase
std::vector< int > getL1APhase() const
Get L1APhase from OverlappedSample (9th bit)
Definition: CSCStripDigi.h:47
CSCStripDigi::OverlappedSample
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:78
CSCStripDigi::getStrip
int getStrip() const
Definition: CSCStripDigi.h:41
CSCStripDigi::ADCCounts
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:76
CSCStripDigi::getOverlappedSample
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:58
CSCStripDigi::ADCOverflow
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:77
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
CSCStripDigi::strip
uint16_t strip
Definition: CSCStripDigi.h:75
CSCStripDigi::Errorstat
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:79
createfilelist.int
int
Definition: createfilelist.py:10
edm::LogVerbatim
Definition: MessageLogger.h:297
CSCStripDigi::getADCCounts
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:44
CSCStripDigi::pedestal
float pedestal() const
methods for calibrations
Definition: CSCStripDigi.h:71
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443