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 (int wire, int nTDC, int number=0, int base=32)
 
 DTDigi (int wire, double tdrift, int number=0, int base=32)
 
 DTDigi ()
 Default construction. More...
 
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.

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

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 }
int32_t theCounts
Definition: DTDigi.h:69
int wire() const
Return wire number.
Definition: DTDigi.cc:41
uint16_t theWire
Definition: DTDigi.h:70
int number() const
Identifies different digis within the same cell.
Definition: DTDigi.cc:43
uint8_t theTDCBase
Definition: DTDigi.h:72
uint8_t theNumber
Definition: DTDigi.h:71

◆ DTDigi() [2/3]

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

Definition at line 19 of file DTDigi.cc.

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

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 }
int32_t theCounts
Definition: DTDigi.h:69
int wire() const
Return wire number.
Definition: DTDigi.cc:41
uint16_t theWire
Definition: DTDigi.h:70
int number() const
Identifies different digis within the same cell.
Definition: DTDigi.cc:43
uint8_t theTDCBase
Definition: DTDigi.h:72
uint8_t theNumber
Definition: DTDigi.h:71

◆ DTDigi() [3/3]

DTDigi::DTDigi ( )

Default construction.

Definition at line 26 of file DTDigi.cc.

26 : theCounts(0), theWire(0), theNumber(0), theTDCBase(32) {}
int32_t theCounts
Definition: DTDigi.h:69
uint16_t theWire
Definition: DTDigi.h:70
uint8_t theTDCBase
Definition: DTDigi.h:72
uint8_t theNumber
Definition: DTDigi.h:71

Member Function Documentation

◆ countsTDC()

int32_t DTDigi::countsTDC ( ) const

Get raw TDC count.

Definition at line 39 of file DTDigi.cc.

References theCounts.

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

39 { return theCounts; }
int32_t theCounts
Definition: DTDigi.h:69

◆ number()

int DTDigi::number ( ) const

Identifies different digis within the same cell.

Definition at line 43 of file DTDigi.cc.

References theNumber.

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

43 { return theNumber; }
uint8_t theNumber
Definition: DTDigi.h:71

◆ 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.

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

29  {
30  if (theWire != digi.wire() ||
31  // theNumber != digi.number() || //FIXME required ??
32  theCounts != digi.countsTDC())
33  return false;
34  return true;
35 }
int32_t theCounts
Definition: DTDigi.h:69
int wire() const
Return wire number.
Definition: DTDigi.cc:41
int32_t countsTDC() const
Get raw TDC count.
Definition: DTDigi.cc:39
uint16_t theWire
Definition: DTDigi.h:70

◆ print()

void DTDigi::print ( void  ) const

Print content of digi.

Definition at line 49 of file DTDigi.cc.

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

Referenced by DTBtiChip::add_digi().

49  {
50  cout << "Wire " << wire() << " Digi # " << number() << " Drift time (ns) " << time() << endl;
51 }
int wire() const
Return wire number.
Definition: DTDigi.cc:41
double time() const
Get time in ns.
Definition: DTDigi.cc:37
int number() const
Identifies different digis within the same cell.
Definition: DTDigi.cc:43

◆ tdcBase()

int DTDigi::tdcBase ( ) const

Get the TDC base (counts per BX)

Definition at line 47 of file DTDigi.cc.

References theTDCBase.

47 { return theTDCBase; }
uint8_t theTDCBase
Definition: DTDigi.h:72

◆ tdcUnit()

double DTDigi::tdcUnit ( ) const

Get the TDC unit value in ns.

Definition at line 45 of file DTDigi.cc.

References theTDCBase.

45 { return 25. / theTDCBase; }
uint8_t theTDCBase
Definition: DTDigi.h:72

◆ time()

double DTDigi::time ( ) const

Get time in ns.

Definition at line 37 of file DTDigi.cc.

References theCounts, and theTDCBase.

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

37 { return theCounts * 25. / theTDCBase; }
int32_t theCounts
Definition: DTDigi.h:69
uint8_t theTDCBase
Definition: DTDigi.h:72

◆ wire()

int DTDigi::wire ( ) const

Return wire number.

Definition at line 41 of file DTDigi.cc.

References theWire.

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

41 { return theWire; }
uint16_t theWire
Definition: DTDigi.h:70

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().