CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCStripDigi Class Reference

#include <CSCStripDigi.h>

List of all members.

Public Member Functions

float amplitude () const
 CSCStripDigi (const int &strip, const std::vector< int > &ADCCounts)
 CSCStripDigi (const int &strip, const std::vector< int > &ADCCounts, const std::vector< uint16_t > &ADCOverflow, const std::vector< uint16_t > &Overlap, const std::vector< uint16_t > &Errorstat)
 CSCStripDigi ()
std::vector< int > getADCCounts () const
 Get ADC readings.
std::vector< uint16_t > getADCOverflow () const
 Other getters.
std::vector< uint16_t > getErrorstat () const
std::vector< int > getL1APhase () const
 Get L1APhase from OverlappedSample (9th bit)
std::vector< uint16_t > getOverlappedSample () const
int getStrip () const
bool operator== (const CSCStripDigi &digi) const
float pedestal () const
 methods for calibrations
void print () const
void setADCCounts (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.

Date:
2010/05/13 19:01:18
Revision:
1.22
Author:
M. Schmitt, Northwestern

Definition at line 19 of file CSCStripDigi.h.


Constructor & Destructor Documentation

CSCStripDigi::CSCStripDigi ( const int &  strip,
const std::vector< int > &  ADCCounts,
const std::vector< uint16_t > &  ADCOverflow,
const std::vector< uint16_t > &  Overlap,
const std::vector< uint16_t > &  Errorstat 
)

Definition at line 13 of file CSCStripDigi.cc.

                                                                                                                                                                                                         :
  strip(istrip),
  ADCCounts(vADCCounts),
  ADCOverflow(vADCOverflow),
  OverlappedSample(vOverlap),
  Errorstat(vErrorstat)
{
}
CSCStripDigi::CSCStripDigi ( const int &  strip,
const std::vector< int > &  ADCCounts 
)

Definition at line 22 of file CSCStripDigi.cc.

                                                                                :
  strip(istrip),
  ADCCounts(vADCCounts),
  ADCOverflow(8,0),
  OverlappedSample(8,0),
  Errorstat(8,0)
{
}
CSCStripDigi::CSCStripDigi ( )

Definition at line 32 of file CSCStripDigi.cc.

                           :
  strip(0),
  ADCCounts(8,0),
  ADCOverflow(8,0),
  OverlappedSample(8,0),
  Errorstat(8,0)
{
}

Member Function Documentation

float CSCStripDigi::amplitude ( ) const [inline]

Definition at line 63 of file CSCStripDigi.h.

References pedestal().

{return ADCCounts[4]-pedestal();}
std::vector< int > CSCStripDigi::getADCCounts ( ) const
std::vector<uint16_t> CSCStripDigi::getADCOverflow ( ) const [inline]

Other getters.

Definition at line 48 of file CSCStripDigi.h.

References ADCOverflow.

Referenced by print().

{return ADCOverflow;}
std::vector<uint16_t> CSCStripDigi::getErrorstat ( ) const [inline]

Definition at line 50 of file CSCStripDigi.h.

References Errorstat.

{return Errorstat;}
std::vector< int > CSCStripDigi::getL1APhase ( ) const

Get L1APhase from OverlappedSample (9th bit)

Get L1A Phase.

Definition at line 45 of file CSCStripDigi.cc.

References getOverlappedSample(), and i.

Referenced by print().

                                               {
     std::vector<int> L1APhaseResult;  
     for (int i=0; i<(int)getOverlappedSample().size(); i++) {
          L1APhaseResult.push_back((getOverlappedSample()[i]>>8) & 0x1);}
     return  L1APhaseResult;      
}
std::vector<uint16_t> CSCStripDigi::getOverlappedSample ( ) const [inline]

Definition at line 49 of file CSCStripDigi.h.

References OverlappedSample.

Referenced by getL1APhase(), and print().

{return OverlappedSample;}
int CSCStripDigi::getStrip ( ) const [inline]
bool CSCStripDigi::operator== ( const CSCStripDigi digi) const

Definition at line 54 of file CSCStripDigi.cc.

References getADCCounts(), and getStrip().

                                                         {
  if ( getStrip() != digi.getStrip() ) return false;
  if ( getADCCounts().size() != digi.getADCCounts().size() ) return false;
  if ( getADCCounts() != digi.getADCCounts() ) return false;
  return true;
}
float CSCStripDigi::pedestal ( ) const [inline]

methods for calibrations

Definition at line 62 of file CSCStripDigi.h.

Referenced by amplitude().

{return 0.5*(ADCCounts[0]+ADCCounts[1]);}
void CSCStripDigi::print ( void  ) const

Definition at line 87 of file CSCStripDigi.cc.

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

                          {
  std::cout << "CSC Strip: " << getStrip() << "  ADC Counts: ";
  for (int i=0; i<(int)getADCCounts().size(); i++) {std::cout << getADCCounts()[i] << " ";}
  std::cout << "\n";
  std::cout << "            " << "  ADCOverflow: ";
  for (int i=0; i<(int)getADCOverflow().size(); i++) {std::cout << getADCOverflow()[i] << " ";}
  std::cout << "\n";
  std::cout << "            " << "  OverflappedSample: ";
  for (int i=0; i<(int)getOverlappedSample().size(); i++) {
  //if(getOverlappedSample()[i]!=1)
  std::cout << getOverlappedSample()[i] << " ";}
  std::cout << "\n";
  std::cout << "            " << "  L1APhases: ";
  for(int i=0; i<(int)getL1APhase().size(); i++){
     std::cout << getL1APhase()[i] << " ";
  }
  std::cout << "\n";
}
void CSCStripDigi::setADCCounts ( std::vector< int >  ADCCounts)

Definition at line 72 of file CSCStripDigi.cc.

References ADCCounts, and i.

Referenced by CSCStripElectronicsSim::doSaturation().

                                                        {
  bool badVal = false;
  for (int i=0; i<(int)vADCCounts.size(); i++) {
    if (vADCCounts[i] < 1) badVal = true;
  }
  if ( !badVal ) {
    ADCCounts = vADCCounts;
  } else {
    std::vector<int> ZeroCounts(8,0);
    ADCCounts = ZeroCounts;
  }
}
void CSCStripDigi::setStrip ( int  istrip) [inline]

Definition at line 53 of file CSCStripDigi.h.

Referenced by CSCDigiToRaw::add().

{ strip = istrip; }

Member Data Documentation

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

Definition at line 68 of file CSCStripDigi.h.

Referenced by getADCCounts(), and setADCCounts().

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

Definition at line 69 of file CSCStripDigi.h.

Referenced by getADCOverflow().

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

Definition at line 71 of file CSCStripDigi.h.

Referenced by getErrorstat().

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

Definition at line 70 of file CSCStripDigi.h.

Referenced by getOverlappedSample().

uint16_t CSCStripDigi::strip [private]

Definition at line 67 of file CSCStripDigi.h.

Referenced by getStrip().