00001 #include <SimDataFormats/DigiSimLinks/interface/DTDigiSimLink.h>
00002
00003 using namespace std;
00004 const double DTDigiSimLink::reso = 25./32.;
00005
00006 DTDigiSimLink::DTDigiSimLink(int wireNr, int digiNr, int nTDC, unsigned int trackId, EncodedEventId evId):
00007 theWire(wireNr),
00008 theDigiNumber(digiNr),
00009 theCounts(nTDC),
00010 theSimTrackId(trackId),
00011 theEventId(evId)
00012 {}
00013
00014 DTDigiSimLink::DTDigiSimLink(int wireNr, int digiNr, double tdrift, unsigned int trackId, EncodedEventId evId):
00015 theWire(wireNr),
00016 theDigiNumber(digiNr),
00017 theCounts(static_cast<int>(tdrift/reso)),
00018 theSimTrackId(trackId),
00019 theEventId(evId)
00020 {}
00021
00022 DTDigiSimLink::DTDigiSimLink():
00023 theWire(0),
00024 theDigiNumber(0),
00025 theCounts(0),
00026 theSimTrackId(0),
00027 theEventId(0)
00028 {}
00029
00030 DTDigiSimLink::ChannelType DTDigiSimLink::channel() const {
00031 ChannelPacking result;
00032 result.wi = theWire;
00033 result.num = theDigiNumber;
00034 return *(reinterpret_cast<DTDigiSimLink::ChannelType*>(&result));
00035 }
00036
00037 int DTDigiSimLink::wire() const {return theWire;}
00038
00039 int DTDigiSimLink::number() const {return theDigiNumber;}
00040
00041 uint32_t DTDigiSimLink::countsTDC() const { return theCounts; }
00042
00043 double DTDigiSimLink::time() const { return theCounts*reso; }
00044
00045 unsigned int DTDigiSimLink::SimTrackId() const {return theSimTrackId;}
00046
00047 EncodedEventId DTDigiSimLink::eventId() const {return theEventId;}