test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StripDigiSimLink.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_TrackerDigiSimLink_StripDigiSimLink_h
2 #define SimDataFormats_TrackerDigiSimLink_StripDigiSimLink_h
3 
4 #include "boost/cstdint.hpp"
6 
8  public:
9  enum {LowTof, HighTof};
10 
11  StripDigiSimLink(unsigned int ch, unsigned int tkId, unsigned int counter, unsigned int tofBin, EncodedEventId e, float a ):
12  chan(ch),simTkId(tkId), CFpos(tofBin == LowTof ? counter & 0x7FFFFFFF : (counter & 0x7FFFFFFF) | 0x80000000), eId(e), fract(a) {;}
13 
14  StripDigiSimLink(unsigned int ch, unsigned int tkId, unsigned int counter, EncodedEventId e, float a ):
15  chan(ch),simTkId(tkId), CFpos(counter & 0x7FFFFFFF), eId(e), fract(a) {;}
16 
17  StripDigiSimLink(unsigned int ch, unsigned int tkId, EncodedEventId e, float a ):
18  chan(ch),simTkId(tkId), CFpos(0), eId(e), fract(a) {;}
19 
20  StripDigiSimLink():chan(0),simTkId(0),CFpos(0),eId(0), fract(0) {;}
21 
23 
24  unsigned int channel() const {return chan;}
25  unsigned int SimTrackId() const {return simTkId;}
26  unsigned int CFposition() const {return CFpos & 0x7FFFFFFF;}
27  unsigned int TofBin() const {return (CFpos & 0x80000000) == 0 ? LowTof : HighTof;}
28  EncodedEventId eventId() const {return eId;}
29  float fraction() const {return fract;}
30 
31  inline bool operator< ( const StripDigiSimLink& other ) const { return channel() < other.channel(); }
32 
33  private:
34  unsigned int chan;
35  unsigned int simTkId;
36  uint32_t CFpos; // position of the PSimHit in the CrossingFrame vector
37  // for the subdetector collection; bit 31 set if from the HighTof collection
39  float fract;
40 };
41 #endif
42 
43 
44 
double a
Definition: hdecay.h:121
static std::atomic< unsigned int > counter