CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTDigiSimLink.h
Go to the documentation of this file.
1 #ifndef DigiSimLinks_DTDigiSimLink_h
2 #define DigiSimLinks_DTDigiSimLink_h
3 
4 #include "boost/cstdint.hpp"
6 
7 class DTDigiSimLink {
8 
9  public:
10  typedef uint32_t ChannelType;
11 
12  // Construct from the wire number and the digi number (this identifies
13  // uniquely multiple digis on the same wire), the TDC counts, the SimTrack Id and the EncodedEvent Id.
14  explicit DTDigiSimLink(int wireNr, int digiNr, int nTDC, unsigned int trackId, EncodedEventId evId);
15 
16  // Construct from the wire number and the digi number (this identifies
17  // uniquely multiple digis on the same wire), the time (ns), the SimTrack Id and the EncodedEvent Id.
18  // time is converted in TDC counts (1 TDC = 25./32. ns)
19  explicit DTDigiSimLink(int wireNr, int digiNr, double tdrift, unsigned int trackId, EncodedEventId evId);
20 
21  // Default constructor.
22  DTDigiSimLink();
23 
24  // The channel identifier and the digi number packed together
25  ChannelType channel() const;
26 
27  // Return wire number
28  int wire() const;
29 
30  // Identifies different digis within the same cell
31  int number() const;
32 
33  // Get raw TDC count
34  uint32_t countsTDC() const;
35 
36  // Get time in ns
37  double time() const;
38 
39  // Return the SimTrack Id
40  unsigned int SimTrackId() const;
41 
42  // Return the Encoded Event Id
43  EncodedEventId eventId() const;
44 
45  // Used to repack the channel number to an int
46  struct ChannelPacking {
47  uint16_t wi;
48  uint16_t num;
49  };
50 
51 private:
52  // The value of one TDC count in ns
53  static const double reso;
54 
55  private:
56  uint16_t theWire; // wire number
57  uint16_t theDigiNumber; // digi number on the wire
58  uint32_t theCounts; // TDC count, up to 20 bits actually used
59  uint32_t theSimTrackId; // identifier of the SimTrack that produced the digi
61 };
62 
63 #include<iostream>
64 inline std::ostream & operator<<(std::ostream & o, const DTDigiSimLink& digisimlink) {
65  return o << "wire:"<<digisimlink.wire()
66  << " digi:" << digisimlink.number()
67  << " time:" << digisimlink.time()
68  << " SimTrack:" << digisimlink.SimTrackId()
69  << " eventId:" << digisimlink.eventId().rawId();
70 }
71 
72 #endif
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
uint32_t rawId() const
get the raw id