CMS 3D CMS Logo

Public Member Functions | Private Attributes | Static Private Attributes | Friends

DTDigi Class Reference

#include <DTDigi.h>

List of all members.

Public Member Functions

uint32_t countsTDC () const
 Get raw TDC count.
 DTDigi (int wire, int nTDC, int number=0)
 DTDigi (int wire, double tdrift, int number=0)
 DTDigi ()
 Default construction.
int number () const
 Identifies different digis within the same.
bool operator== (const DTDigi &digi) const
 Digis are equal if they are on the same cell and have same TDC count.
void print () const
 Print content of digi.
void setCountsTDC (int nTDC)
 Set with a TDC count.
void setTime (double time)
 Set with a time in ns.
double time () const
 Get time in ns.
int wire () const
 Return wire number.

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.

Date:
2010/03/03 15:53:20
Revision:
1.9
Author:
N. Amapane, G. Cerminara, M. Pelliccioni - INFN Torino

Definition at line 19 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 19 of file DTDigi.cc.

DTDigi::DTDigi ( int  wire,
double  tdrift,
int  number = 0 
) [explicit]

Definition at line 26 of file DTDigi.cc.

                                                  : 
  theWire(wire),
  theCounts(static_cast<int>(tdrift/reso)),
  theNumber(number)
{}
DTDigi::DTDigi ( )

Default construction.

Definition at line 43 of file DTDigi.cc.

               :
  theWire(0),
  theCounts(0), 
  theNumber(0)
{}

Member Function Documentation

uint32_t DTDigi::countsTDC ( ) const

Get raw TDC count.

Definition at line 67 of file DTDigi.cc.

References theCounts.

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

{ return theCounts; }
int DTDigi::number ( ) const

Identifies different digis within the same.

Definition at line 71 of file DTDigi.cc.

References theNumber.

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

{ return theNumber; }
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 52 of file DTDigi.cc.

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

                                             {
  if ( theWire != digi.wire() ||
       //       theNumber != digi.number() || //FIXME required ??
       theCounts != digi.countsTDC() ) return false;
  return true;
}
void DTDigi::print ( void  ) const

Print content of digi.

Definition at line 89 of file DTDigi.cc.

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

Referenced by DTBtiChip::add_digi().

                    {
  cout << "Wire " << wire() 
       << " Digi # " << number()
       << " Drift time (ns) " << time() << endl;
}
void DTDigi::setCountsTDC ( int  nTDC)

Set with a TDC count.

Definition at line 79 of file DTDigi.cc.

References gather_cfg::cout, and theCounts.

                                   {
  if (nTDC<0) cout << "WARNING: DTDigi::setCountsTDC: negative TDC count not supported "
                   << nTDC << endl;
  theCounts = nTDC;
}
void DTDigi::setTime ( double  time)

Set with a time in ns.

Definition at line 75 of file DTDigi.cc.

References reso, and theCounts.

                               {
  theCounts = static_cast<int>(time/reso);
}
double DTDigi::time ( ) const
int DTDigi::wire ( ) const

Return wire number.

Definition at line 69 of file DTDigi.cc.

References theWire.

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

{ return theWire; }

Friends And Related Function Documentation

friend class testDTDigis [friend]

Definition at line 67 of file DTDigi.h.


Member Data Documentation

const double DTDigi::reso = 25./32. [static, private]

Definition at line 70 of file DTDigi.h.

Referenced by setTime(), and time().

uint32_t DTDigi::theCounts [private]

Definition at line 78 of file DTDigi.h.

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

uint16_t DTDigi::theNumber [private]

Definition at line 79 of file DTDigi.h.

Referenced by number().

uint16_t DTDigi::theWire [private]

Definition at line 77 of file DTDigi.h.

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