CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes | Friends
DTDigi Class Reference

#include <DTDigi.h>

Public Member Functions

int32_t countsTDC () const
 Get raw TDC count. More...
 
 DTDigi ()
 Default construction. More...
 
 DTDigi (int wire, double tdrift, int number=0, int base=32)
 
 DTDigi (int wire, int nTDC, int number=0, int base=32)
 
int number () const
 Identifies different digis within the same cell. More...
 
bool operator== (const DTDigi &digi) const
 Digis are equal if they are on the same cell and have same TDC count. More...
 
void print () const
 Print content of digi. More...
 
int tdcBase () const
 Get the TDC base (counts per BX) More...
 
double tdcUnit () const
 Get the TDC unit value in ns. More...
 
double time () const
 Get time in ns. More...
 
int wire () const
 Return wire number. More...
 

Private Attributes

int32_t theCounts
 
uint8_t theNumber
 
uint8_t theTDCBase
 
uint16_t theWire
 

Static Private Attributes

static const double reso
 

Friends

class testDTDigis
 

Detailed Description

Digi for Drift Tubes. It can be initialized/set with a time in ns or a TDC count in the specified base (ie number of counts/BX).

Author
N. Amapane, G. Cerminara, M. Pelliccioni - INFN Torino

Definition at line 17 of file DTDigi.h.

Constructor & Destructor Documentation

◆ DTDigi() [1/3]

DTDigi::DTDigi ( int  wire,
int  nTDC,
int  number = 0,
int  base = 32 
)
explicit

Construct from the wire#, the TDC counts and the digi number. number should identify uniquely multiple digis in the same cell.

Definition at line 12 of file DTDigi.cc.

14  if (number > 255 || number < 0 || !(base == 30 || base == 32)) {
15  throw cms::Exception("BadConfig") << "DTDigi ctor: invalid parameters: number: " << number << " base: " << base;
16  }
17 }

References newFWLiteAna::base, Exception, and number().

◆ DTDigi() [2/3]

DTDigi::DTDigi ( int  wire,
double  tdrift,
int  number = 0,
int  base = 32 
)
explicit

Definition at line 19 of file DTDigi.cc.

20  : theCounts(static_cast<int>(tdrift / 25. * base)), theWire(wire), theNumber(number), theTDCBase(base) {
21  if (number > 255 || number < 0 || !(base == 30 || base == 32)) {
22  throw cms::Exception("BadConfig") << "DTDigi ctor: invalid parameters: number: " << number << " base: " << base;
23  }
24 }

References newFWLiteAna::base, Exception, and number().

◆ DTDigi() [3/3]

DTDigi::DTDigi ( )

Default construction.

Definition at line 26 of file DTDigi.cc.

26 : theCounts(0), theWire(0), theNumber(0), theTDCBase(32) {}

Member Function Documentation

◆ countsTDC()

int32_t DTDigi::countsTDC ( ) const

Get raw TDC count.

Definition at line 39 of file DTDigi.cc.

39 { return theCounts; }

References theCounts.

Referenced by DTBtiChip::add_digi(), DTBtiHit::DTBtiHit(), and operator==().

◆ number()

int DTDigi::number ( ) const

Identifies different digis within the same cell.

Definition at line 43 of file DTDigi.cc.

43 { return theNumber; }

References theNumber.

Referenced by DTDigi(), operator<<(), print(), and DTDigitizer::storeDigis().

◆ operator==()

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

Digis are equal if they are on the same cell and have same TDC count.

Definition at line 29 of file DTDigi.cc.

29  {
30  if (theWire != digi.wire() ||
31  // theNumber != digi.number() || //FIXME required ??
32  theCounts != digi.countsTDC())
33  return false;
34  return true;
35 }

References countsTDC(), theCounts, theWire, and wire().

◆ print()

void DTDigi::print ( void  ) const

Print content of digi.

Definition at line 49 of file DTDigi.cc.

49  {
50  cout << "Wire " << wire() << " Digi # " << number() << " Drift time (ns) " << time() << endl;
51 }

References gather_cfg::cout, number(), time(), and wire().

Referenced by DTBtiChip::add_digi().

◆ tdcBase()

int DTDigi::tdcBase ( ) const

Get the TDC base (counts per BX)

Definition at line 47 of file DTDigi.cc.

47 { return theTDCBase; }

References theTDCBase.

◆ tdcUnit()

double DTDigi::tdcUnit ( ) const

Get the TDC unit value in ns.

Definition at line 45 of file DTDigi.cc.

45 { return 25. / theTDCBase; }

References theTDCBase.

◆ time()

double DTDigi::time ( ) const

Get time in ns.

Definition at line 37 of file DTDigi.cc.

37 { return theCounts * 25. / theTDCBase; }

References theCounts, and theTDCBase.

Referenced by DTLinearDriftAlgo::compute(), DTLinearDriftFromDBAlgo::compute(), DTNoDriftAlgo::compute(), operator<<(), print(), and DTDigitizer::storeDigis().

◆ wire()

int DTDigi::wire ( ) const

Return wire number.

Definition at line 41 of file DTDigi.cc.

41 { return theWire; }

References theWire.

Referenced by DTLinearDriftAlgo::compute(), DTLinearDriftFromDBAlgo::compute(), DTNoDriftAlgo::compute(), operator<<(), operator==(), and print().

Friends And Related Function Documentation

◆ testDTDigis

friend class testDTDigis
friend

Definition at line 64 of file DTDigi.h.

Member Data Documentation

◆ reso

const double DTDigi::reso
staticprivate

Definition at line 67 of file DTDigi.h.

◆ theCounts

int32_t DTDigi::theCounts
private

Definition at line 69 of file DTDigi.h.

Referenced by countsTDC(), operator==(), and time().

◆ theNumber

uint8_t DTDigi::theNumber
private

Definition at line 71 of file DTDigi.h.

Referenced by number().

◆ theTDCBase

uint8_t DTDigi::theTDCBase
private

Definition at line 72 of file DTDigi.h.

Referenced by tdcBase(), tdcUnit(), and time().

◆ theWire

uint16_t DTDigi::theWire
private

Definition at line 70 of file DTDigi.h.

Referenced by operator==(), and wire().

DTDigi::number
int number() const
Identifies different digis within the same cell.
Definition: DTDigi.cc:43
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTDigi::theTDCBase
uint8_t theTDCBase
Definition: DTDigi.h:72
DTDigi::time
double time() const
Get time in ns.
Definition: DTDigi.cc:37
DTDigi::wire
int wire() const
Return wire number.
Definition: DTDigi.cc:41
DTDigi::theCounts
int32_t theCounts
Definition: DTDigi.h:69
DTDigi::countsTDC
int32_t countsTDC() const
Get raw TDC count.
Definition: DTDigi.cc:39
DTDigi::theWire
uint16_t theWire
Definition: DTDigi.h:70
Exception
Definition: hltDiff.cc:246
newFWLiteAna.base
base
Definition: newFWLiteAna.py:92
DTDigi::theNumber
uint8_t theNumber
Definition: DTDigi.h:71