File indexing completed on 2023-03-17 11:24:00
0001 #ifndef DigiSimLinks_DTDigiSimLink_h
0002 #define DigiSimLinks_DTDigiSimLink_h
0003
0004 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
0005
0006 class DTDigiSimLink {
0007 public:
0008 typedef uint32_t ChannelType;
0009
0010
0011
0012
0013 explicit DTDigiSimLink(int wireNr, int digiNr, int nTDC, unsigned int trackId, EncodedEventId evId, int base = 32);
0014
0015
0016
0017
0018 explicit DTDigiSimLink(
0019 int wireNr, int digiNr, double tdrift, unsigned int trackId, EncodedEventId evId, int base = 32);
0020
0021
0022 DTDigiSimLink();
0023
0024
0025 ChannelType channel() const;
0026
0027
0028 int wire() const;
0029
0030
0031 int number() const;
0032
0033
0034 uint32_t countsTDC() const;
0035
0036
0037 double time() const;
0038
0039
0040 unsigned int SimTrackId() const;
0041
0042
0043 EncodedEventId eventId() const;
0044
0045
0046 struct ChannelPacking {
0047 uint16_t wi;
0048 uint16_t num;
0049 };
0050
0051 private:
0052
0053 static const double reso;
0054
0055 private:
0056 uint16_t theWire;
0057 uint8_t theDigiNumber;
0058 uint8_t theTDCBase;
0059 int32_t theCounts;
0060 uint32_t theSimTrackId;
0061 EncodedEventId theEventId;
0062 };
0063
0064 #include <iostream>
0065 #include <cstdint>
0066 inline std::ostream& operator<<(std::ostream& o, const DTDigiSimLink& digisimlink) {
0067 return o << "wire:" << digisimlink.wire() << " digi:" << digisimlink.number() << " time:" << digisimlink.time()
0068 << " SimTrack:" << digisimlink.SimTrackId() << " eventId:" << digisimlink.eventId().rawId();
0069 }
0070
0071 #endif