CMS 3D CMS Logo

DTDigiSimLink.cc
Go to the documentation of this file.
2 
3 using namespace std;
4 
5 DTDigiSimLink::DTDigiSimLink(int wireNr, int digiNr, int nTDC, unsigned int trackId, EncodedEventId evId, int base)
6  : theWire(wireNr),
7  theDigiNumber(digiNr),
8  theTDCBase(base),
9  theCounts(nTDC),
10  theSimTrackId(trackId),
11  theEventId(evId) {}
12 
13 DTDigiSimLink::DTDigiSimLink(int wireNr, int digiNr, double tdrift, unsigned int trackId, EncodedEventId evId, int base)
14  : theWire(wireNr),
15  theDigiNumber(digiNr),
16  theTDCBase(base),
17  theCounts(static_cast<int>(tdrift * base / 25.)),
18  theSimTrackId(trackId),
19  theEventId(evId) {}
20 
22  : theWire(0), theDigiNumber(0), theTDCBase(32), theCounts(0), theSimTrackId(0), theEventId(0) {}
23 
25 #pragma GCC diagnostic push
26 #pragma GCC diagnostic ignored "-Wuninitialized"
28  result.wi = theWire;
29  result.num = theDigiNumber;
30  DTDigiSimLink::ChannelType* p_result = reinterpret_cast<DTDigiSimLink::ChannelType*>(&result);
31  return *p_result;
32 #pragma GCC diagnostic pop
33 }
34 
35 int DTDigiSimLink::wire() const { return theWire; }
36 
37 int DTDigiSimLink::number() const { return theDigiNumber; }
38 
39 uint32_t DTDigiSimLink::countsTDC() const { return theCounts; }
40 
41 double DTDigiSimLink::time() const { return theCounts * 25. / theTDCBase; }
42 
43 unsigned int DTDigiSimLink::SimTrackId() const { return theSimTrackId; }
44