CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/SimDataFormats/DigiSimLinks/src/DTDigiSimLink.cc

Go to the documentation of this file.
00001 #include <SimDataFormats/DigiSimLinks/interface/DTDigiSimLink.h>
00002 
00003 using namespace std;
00004 const double DTDigiSimLink::reso =  25./32.; //ns
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   DTDigiSimLink::ChannelType* p_result = reinterpret_cast<DTDigiSimLink::ChannelType*>(&result);
00035   return *p_result;
00036 }
00037 
00038 int DTDigiSimLink::wire() const {return theWire;}
00039 
00040 int DTDigiSimLink::number() const {return theDigiNumber;}
00041 
00042 uint32_t DTDigiSimLink::countsTDC() const { return theCounts; }
00043 
00044 double DTDigiSimLink::time() const { return theCounts*reso; }
00045 
00046 unsigned int DTDigiSimLink::SimTrackId() const {return theSimTrackId;}
00047 
00048 EncodedEventId DTDigiSimLink::eventId() const {return theEventId;}