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...
 
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() [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 75 of file CSCStripDigi.h.

75 { 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 60 of file CSCStripDigi.h.

60 { return ADCOverflow; }

References ADCOverflow.

Referenced by print().

◆ getCFEB()

int CSCStripDigi::getCFEB ( ) const

Get the CFEB number. Counts from 0.

Definition at line 25 of file CSCStripDigi.cc.

25 { return (strip - 1) / CSCConstants::NUM_STRIPS_PER_CFEB; }

References CSCConstants::NUM_STRIPS_PER_CFEB, and strip.

Referenced by CSCEventData::add().

◆ getErrorstat()

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

Definition at line 62 of file CSCStripDigi.h.

62 { return Errorstat; }

References Errorstat.

◆ getL1APhase() [1/2]

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

Get L1APhase from OverlappedSample (9th bit)

Definition at line 50 of file CSCStripDigi.h.

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  }

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

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

References getOverlappedSample(), and mps_fire::i.

◆ getOverlappedSample()

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

Definition at line 61 of file CSCStripDigi.h.

61 { 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(), MuonTruth::analyze(), operator<<(), operator==(), and print().

◆ operator==()

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

Definition at line 13 of file CSCStripDigi.cc.

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 }

References getADCCounts(), and getStrip().

◆ pedestal()

float CSCStripDigi::pedestal ( ) const
inline

methods for calibrations

Definition at line 74 of file CSCStripDigi.h.

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

References ADCCounts.

Referenced by amplitude().

◆ print()

void CSCStripDigi::print ( void  ) const

Definition at line 42 of file CSCStripDigi.cc.

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 }

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

◆ setADCCounts()

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

Definition at line 27 of file CSCStripDigi.cc.

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 }

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

Referenced by CSCStripElectronicsSim::doSaturation().

◆ setStrip()

void CSCStripDigi::setStrip ( int  istrip)
inline

Definition at line 65 of file CSCStripDigi.h.

65 { strip = istrip; }

References strip.

Referenced by CSCDigiToRaw::add().

Member Data Documentation

◆ ADCCounts

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

Definition at line 79 of file CSCStripDigi.h.

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

◆ ADCOverflow

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

Definition at line 80 of file CSCStripDigi.h.

Referenced by getADCOverflow().

◆ Errorstat

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

Definition at line 82 of file CSCStripDigi.h.

Referenced by getErrorstat().

◆ OverlappedSample

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

Definition at line 81 of file CSCStripDigi.h.

Referenced by getOverlappedSample().

◆ strip

uint16_t CSCStripDigi::strip
private

Definition at line 78 of file CSCStripDigi.h.

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

CSCStripDigi::getADCOverflow
std::vector< uint16_t > const & getADCOverflow() const
Other getters.
Definition: CSCStripDigi.h:60
mps_fire.i
i
Definition: mps_fire.py:428
CSCStripDigi::getL1APhase
std::vector< int > getL1APhase() const
Get L1APhase from OverlappedSample (9th bit)
Definition: CSCStripDigi.h:50
CSCStripDigi::OverlappedSample
std::vector< uint16_t > OverlappedSample
Definition: CSCStripDigi.h:81
CSCStripDigi::getStrip
int getStrip() const
Definition: CSCStripDigi.h:41
CSCStripDigi::ADCCounts
std::vector< int > ADCCounts
Definition: CSCStripDigi.h:79
CSCStripDigi::getOverlappedSample
std::vector< uint16_t > const & getOverlappedSample() const
Definition: CSCStripDigi.h:61
CSCConstants::NUM_STRIPS_PER_CFEB
Definition: CSCConstants.h:60
CSCStripDigi::ADCOverflow
std::vector< uint16_t > ADCOverflow
Definition: CSCStripDigi.h:80
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
CSCStripDigi::strip
uint16_t strip
Definition: CSCStripDigi.h:78
CSCStripDigi::Errorstat
std::vector< uint16_t > Errorstat
Definition: CSCStripDigi.h:82
createfilelist.int
int
Definition: createfilelist.py:10
CSCStripDigi::getADCCounts
std::vector< int > const & getADCCounts() const
Get ADC readings.
Definition: CSCStripDigi.h:47
CSCStripDigi::pedestal
float pedestal() const
methods for calibrations
Definition: CSCStripDigi.h:74
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443