CMS 3D CMS Logo

PixelDigiSimLink.h
Go to the documentation of this file.
1 #ifndef TRACKINGOBJECTS_PIXELDIGISIMLINK_H
2 #define TRACKINGOBJECTS_PIXELDIGISIMLINK_H
3 
5 #include <cstdint>
6 
7 //typedef std::pair<unsigned int ,unsigned int > PixelDigiSimLink;
9 public:
10  enum { LowTof, HighTof };
11 
13  unsigned int ch, unsigned int tkId, unsigned int counter, unsigned int tofBin, EncodedEventId e, float a) {
14  chan = ch;
15  simTkId = tkId;
16  CFpos = tofBin == LowTof ? counter & 0x7FFFFFFF : (counter & 0x7FFFFFFF) | 0x80000000;
17  fract = a;
18  eId = e;
19  };
20  PixelDigiSimLink(unsigned int ch, unsigned int tkId, EncodedEventId e, float a) {
21  chan = ch;
22  simTkId = tkId;
23  CFpos = 0;
24  fract = a;
25  eId = e;
26  };
28  chan = 0;
29  simTkId = 0;
30  CFpos = 0;
31  fract = 0;
32  };
34  unsigned int channel() const { return chan; };
35  unsigned int SimTrackId() const { return simTkId; };
36  unsigned int CFposition() const { return CFpos & 0x7FFFFFFF; }
37  unsigned int TofBin() const { return (CFpos & 0x80000000) == 0 ? LowTof : HighTof; }
38  EncodedEventId eventId() const { return eId; }
39  float fraction() const { return fract; };
40 
41  inline bool operator<(const PixelDigiSimLink& other) const { return fraction() < other.fraction(); }
42 
43 private:
44  unsigned int chan;
45  unsigned int simTkId;
46  uint32_t CFpos; // position of the PSimHit in the CrossingFrame vector
47  // for the subdetector collection; bit 31 set if from the HighTof collection
49  float fract;
50 };
51 #endif
double a
Definition: hdecay.h:119