CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes | Friends
DTDigi Class Reference

#include <DTDigi.h>

Public Member Functions

uint32_t countsTDC () const
 Get raw TDC count. More...
 
 DTDigi (int wire, int nTDC, int number=0)
 
 DTDigi (int wire, double tdrift, int number=0)
 
 DTDigi ()
 Default construction. More...
 
int number () const
 Identifies different digis within the same. 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...
 
void setCountsTDC (int nTDC)
 Set with a TDC count. More...
 
void setTime (double time)
 Set with a time in ns. More...
 
double time () const
 Get time in ns. More...
 
int wire () const
 Return wire number. More...
 

Private Attributes

uint32_t theCounts
 
uint16_t theNumber
 
uint16_t theWire
 

Static Private Attributes

static const double reso = 25./32.
 

Friends

class testDTDigis
 

Detailed Description

Digi for Drift Tubes. It can be initialized/set with a time in ns or a TDC count in 25/32 ns units.

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

Definition at line 17 of file DTDigi.h.

Constructor & Destructor Documentation

DTDigi::DTDigi ( int  wire,
int  nTDC,
int  number = 0 
)
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 17 of file DTDigi.cc.

17  :
18  theWire(wire),
19  theCounts(nTDC),
21 {}
uint32_t theCounts
Definition: DTDigi.h:76
uint16_t theNumber
Definition: DTDigi.h:77
int wire() const
Return wire number.
Definition: DTDigi.cc:67
uint16_t theWire
Definition: DTDigi.h:75
int number() const
Identifies different digis within the same.
Definition: DTDigi.cc:69
DTDigi::DTDigi ( int  wire,
double  tdrift,
int  number = 0 
)
explicit

Definition at line 24 of file DTDigi.cc.

24  :
25  theWire(wire),
26  theCounts(static_cast<int>(tdrift/reso)),
28 {}
uint32_t theCounts
Definition: DTDigi.h:76
uint16_t theNumber
Definition: DTDigi.h:77
int wire() const
Return wire number.
Definition: DTDigi.cc:67
uint16_t theWire
Definition: DTDigi.h:75
static const double reso
Definition: DTDigi.h:68
int number() const
Identifies different digis within the same.
Definition: DTDigi.cc:69
DTDigi::DTDigi ( )

Default construction.

Definition at line 41 of file DTDigi.cc.

41  :
42  theWire(0),
43  theCounts(0),
44  theNumber(0)
45 {}
uint32_t theCounts
Definition: DTDigi.h:76
uint16_t theNumber
Definition: DTDigi.h:77
uint16_t theWire
Definition: DTDigi.h:75

Member Function Documentation

uint32_t DTDigi::countsTDC ( ) const

Get raw TDC count.

Definition at line 65 of file DTDigi.cc.

References theCounts.

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

65 { return theCounts; }
uint32_t theCounts
Definition: DTDigi.h:76
int DTDigi::number ( ) const

Identifies different digis within the same.

Definition at line 69 of file DTDigi.cc.

References theNumber.

Referenced by operator<<(), and print().

69 { return theNumber; }
uint16_t theNumber
Definition: DTDigi.h:77
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 50 of file DTDigi.cc.

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

50  {
51  if ( theWire != digi.wire() ||
52  // theNumber != digi.number() || //FIXME required ??
53  theCounts != digi.countsTDC() ) return false;
54  return true;
55 }
uint32_t theCounts
Definition: DTDigi.h:76
int wire() const
Return wire number.
Definition: DTDigi.cc:67
uint16_t theWire
Definition: DTDigi.h:75
uint32_t countsTDC() const
Get raw TDC count.
Definition: DTDigi.cc:65
void DTDigi::print ( void  ) const

Print content of digi.

Definition at line 87 of file DTDigi.cc.

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

87  {
88  cout << "Wire " << wire()
89  << " Digi # " << number()
90  << " Drift time (ns) " << time() << endl;
91 }
int wire() const
Return wire number.
Definition: DTDigi.cc:67
double time() const
Get time in ns.
Definition: DTDigi.cc:63
int number() const
Identifies different digis within the same.
Definition: DTDigi.cc:69
tuple cout
Definition: gather_cfg.py:145
void DTDigi::setCountsTDC ( int  nTDC)

Set with a TDC count.

Definition at line 77 of file DTDigi.cc.

References gather_cfg::cout, and theCounts.

77  {
78  if (nTDC<0) cout << "WARNING: DTDigi::setCountsTDC: negative TDC count not supported "
79  << nTDC << endl;
80  theCounts = nTDC;
81 }
uint32_t theCounts
Definition: DTDigi.h:76
tuple cout
Definition: gather_cfg.py:145
void DTDigi::setTime ( double  time)

Set with a time in ns.

Definition at line 73 of file DTDigi.cc.

References reso, and theCounts.

73  {
74  theCounts = static_cast<int>(time/reso);
75 }
uint32_t theCounts
Definition: DTDigi.h:76
double time() const
Get time in ns.
Definition: DTDigi.cc:63
static const double reso
Definition: DTDigi.h:68
double DTDigi::time ( ) const

Get time in ns.

Definition at line 63 of file DTDigi.cc.

References reso, and theCounts.

Referenced by operator<<(), and print().

63 { return theCounts*reso; }
uint32_t theCounts
Definition: DTDigi.h:76
static const double reso
Definition: DTDigi.h:68
int DTDigi::wire ( ) const

Return wire number.

Definition at line 67 of file DTDigi.cc.

References theWire.

Referenced by operator<<(), operator==(), and print().

67 { return theWire; }
uint16_t theWire
Definition: DTDigi.h:75

Friends And Related Function Documentation

friend class testDTDigis
friend

Definition at line 65 of file DTDigi.h.

Member Data Documentation

const double DTDigi::reso = 25./32.
staticprivate

Definition at line 68 of file DTDigi.h.

Referenced by setTime(), and time().

uint32_t DTDigi::theCounts
private

Definition at line 76 of file DTDigi.h.

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

uint16_t DTDigi::theNumber
private

Definition at line 77 of file DTDigi.h.

Referenced by number().

uint16_t DTDigi::theWire
private

Definition at line 75 of file DTDigi.h.

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