CMS 3D CMS Logo

DTDigiSimLink.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 const double DTDigiSimLink::reso = 25. / 32.; //ns
5 
6 DTDigiSimLink::DTDigiSimLink(int wireNr, int digiNr, int nTDC, unsigned int trackId, EncodedEventId evId)
7  : theWire(wireNr), theDigiNumber(digiNr), theCounts(nTDC), theSimTrackId(trackId), theEventId(evId) {}
8 
9 DTDigiSimLink::DTDigiSimLink(int wireNr, int digiNr, double tdrift, unsigned int trackId, EncodedEventId evId)
10  : theWire(wireNr),
11  theDigiNumber(digiNr),
12  theCounts(static_cast<int>(tdrift / reso)),
13  theSimTrackId(trackId),
14  theEventId(evId) {}
15 
17 
20  result.wi = theWire;
21  result.num = theDigiNumber;
22  DTDigiSimLink::ChannelType* p_result = reinterpret_cast<DTDigiSimLink::ChannelType*>(&result);
23  return *p_result;
24 }
25 
26 int DTDigiSimLink::wire() const { return theWire; }
27 
28 int DTDigiSimLink::number() const { return theDigiNumber; }
29 
30 uint32_t DTDigiSimLink::countsTDC() const { return theCounts; }
31 
32 double DTDigiSimLink::time() const { return theCounts * reso; }
33 
34 unsigned int DTDigiSimLink::SimTrackId() const { return theSimTrackId; }
35