#include <DataFormats/DTDigi/interface/DTDigi.h>
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 |
It can be initialized/set with a time in ns or a TDC count in 25/32 ns units.
Definition at line 19 of file DTDigi.h.
typedef uint32_t DTDigi::ChannelType |
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 | ( | ) |
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; }
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 }
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 }
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 | ) |
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().
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; }
const double DTDigi::reso = 25./32. [static, private] |
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] |
uint16_t DTDigi::theWire [private] |