CMS 3D CMS Logo

DTDigi Class Reference

Digi for Drift Tubes. More...

#include <DataFormats/DTDigi/interface/DTDigi.h>

List of all members.

Public Types

typedef uint32_t ChannelType

Public Member Functions

ChannelType channel () const
 The channel identifier and the digi number packed together.
uint32_t countsTDC () const
 Get raw TDC count.
 DTDigi ()
 Default construction.
 DTDigi (ChannelType channel, int nTDC)
 Construct from channel and counts.
 DTDigi (int wire, double tdrift, int number=0)
 Construct from the wire#, the time (ns) and the digi number.
 DTDigi (int wire, int nTDC, int number=0)
 Construct from the wire#, the TDC counts and the digi number.
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
 R-Phi or R-Zed SuperLayer.

Private Attributes

uint32_t theCounts
uint16_t theNumber
uint16_t theWire

Static Private Attributes

static const double reso = 25./32.

Friends

class testDTDigis

Classes

struct  ChannelPacking


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
2006/04/05 15:03:07
Revision
1.7

Author:
N. Amapane - INFN Torino

Definition at line 19 of file DTDigi.h.


Member Typedef Documentation

typedef uint32_t DTDigi::ChannelType

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

00020                                               : 
00021   theWire(wire),
00022   theCounts(nTDC),
00023   theNumber(number)
00024 {}

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

Construct from the wire#, the time (ns) and the digi number.

time is converted in TDC counts (1 TDC = 25./32. ns) number should identify uniquely multiple digis in the same cell.

Definition at line 27 of file DTDigi.cc.

00027                                                   : 
00028   theWire(wire),
00029   theCounts(static_cast<int>(tdrift/reso)),
00030   theNumber(number)
00031 {}

DTDigi::DTDigi ( ChannelType  channel,
int  nTDC 
) [explicit]

Construct from channel and counts.

Definition at line 34 of file DTDigi.cc.

References DTDigi::ChannelPacking::number, theNumber, theWire, and DTDigi::ChannelPacking::wire.

00034                                             :
00035   theWire(0),
00036   theCounts(nTDC),
00037   theNumber(0)
00038 {
00039   ChannelPacking* ch = reinterpret_cast<ChannelPacking*>(&channel);
00040   theWire = ch->wire;
00041   theNumber = ch->number;
00042 }

DTDigi::DTDigi (  ) 

Default construction.

Definition at line 45 of file DTDigi.cc.

00045                :
00046   theWire(0),
00047   theCounts(0), 
00048   theNumber(0)
00049 {}


Member Function Documentation

DTDigi::ChannelType DTDigi::channel (  )  const

The channel identifier and the digi number packed together.

Definition at line 63 of file DTDigi.cc.

References DTDigi::ChannelPacking::number, HLT_VtxMuL3::result, theNumber, theWire, and DTDigi::ChannelPacking::wire.

00063                       {
00064   ChannelPacking result;
00065   result.wire = theWire;
00066   result.number= theNumber;
00067   return *(reinterpret_cast<DTDigi::ChannelType*>(&result));
00068 }

uint32_t DTDigi::countsTDC (  )  const

Get raw TDC count.

Definition at line 79 of file DTDigi.cc.

References theCounts.

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

00079 { return theCounts; }

int DTDigi::number (  )  const

Identifies different digis within the same.

Definition at line 83 of file DTDigi.cc.

References theNumber.

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

00083 { 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 54 of file DTDigi.cc.

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

00054                                              {
00055   if ( theWire != digi.wire() ||
00056        //       theNumber != digi.number() || //FIXME required ??
00057        theCounts != digi.countsTDC() ) return false;
00058   return true;
00059 }

void DTDigi::print ( void   )  const

Print content of digi.

Definition at line 101 of file DTDigi.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), number(), time(), and wire().

Referenced by DTBtiChip::add_digi().

00101                     {
00102   cout << "Wire " << wire() 
00103        << " Digi # " << number()
00104        << " Drift time (ns) " << time() << endl;
00105 }

void DTDigi::setCountsTDC ( int  nTDC  ) 

Set with a TDC count.

Definition at line 91 of file DTDigi.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and theCounts.

00091                                    {
00092   if (nTDC<0) cout << "WARNING: DTDigi::setCountsTDC: negative TDC count not supported "
00093                    << nTDC << endl;
00094   theCounts = nTDC;
00095 }

void DTDigi::setTime ( double  time  ) 

Set with a time in ns.

Definition at line 87 of file DTDigi.cc.

References reso, and theCounts.

00087                                {
00088   theCounts = static_cast<int>(time/reso);
00089 }

double DTDigi::time (  )  const

Get time in ns.

Definition at line 77 of file DTDigi.cc.

References reso, and theCounts.

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

00077 { return theCounts*reso; }

int DTDigi::wire (  )  const

R-Phi or R-Zed SuperLayer.

Return wire number

Definition at line 81 of file DTDigi.cc.

References theWire.

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

00081 { return theWire; }


Friends And Related Function Documentation

friend class testDTDigis [friend]

Definition at line 70 of file DTDigi.h.


Member Data Documentation

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

Definition at line 73 of file DTDigi.h.

Referenced by setTime(), and time().

uint32_t DTDigi::theCounts [private]

Definition at line 84 of file DTDigi.h.

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

uint16_t DTDigi::theNumber [private]

Definition at line 85 of file DTDigi.h.

Referenced by channel(), DTDigi(), and number().

uint16_t DTDigi::theWire [private]

Definition at line 83 of file DTDigi.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:50 2009 for CMSSW by  doxygen 1.5.4