CMS 3D CMS Logo

TTTrack_TrackWord.h
Go to the documentation of this file.
1 //
3 // class to store the 96-bit track word produced by the L1 Track Trigger. Intended to be inherited by L1 TTTrack.
4 // packing scheme given below.
5 //
6 // author: Mike Hildreth
7 // date: April 9, 2019
8 //
10 
11 #ifndef L1_TRACK_TRIGGER_TRACK_WORD_H
12 #define L1_TRACK_TRIGGER_TRACK_WORD_H
13 
14 #include <iostream>
15 #include <string>
18 
20 public:
21  // Constructors:
22 
24  TTTrack_TrackWord(const GlobalVector& Momentum,
25  const GlobalPoint& POCA,
26  double theRinv,
27  double theChi2,
28  double theBendChi2,
29  unsigned int theHitPattern,
30  unsigned int iSpare);
31 
32  TTTrack_TrackWord(unsigned int theRinv,
33  unsigned int phi0,
34  unsigned int tanl,
35  unsigned int z0,
36  unsigned int d0,
37  unsigned int theChi2,
38  unsigned int theBendChi2,
39  unsigned int theHitPattern,
40  unsigned int iSpare);
41 
42  void setTrackWord(const GlobalVector& Momentum,
43  const GlobalPoint& POCA,
44  double theRinv,
45  double theChi2,
46  double theBendChi2,
47  unsigned int theHitPattern,
48  unsigned int iSpare);
49 
50  void setTrackWord(unsigned int theRinv,
51  unsigned int phi0,
52  unsigned int tanl,
53  unsigned int z0,
54  unsigned int d0,
55  unsigned int theChi2,
56  unsigned int theBendChi2,
57  unsigned int theHitPattern,
58  unsigned int iSpare);
59 
60  // getters for unpacked and converted values.
61  // These functions return real numbers converted from the digitized quantities using the LSB defined for each.
62 
63  float get_iRinv();
64  float get_iphi();
65  float get_ieta();
66  float get_iz0();
67  float get_id0();
68  float get_ichi2();
69  float get_iBendChi2();
70 
71  // separate functions for unpacking 96-bit track word
72 
73  float unpack_iRinv();
74  float unpack_iphi();
75  float unpack_ieta();
76  float unpack_iz0();
77  float unpack_id0();
78  float unpack_ichi2();
79  float unpack_iBendChi2();
80  unsigned int unpack_ispare();
81  unsigned int unpack_hitPattern();
82 
83  // getters for packed bits.
84  // These functions return, literally, the packed bits in integer format for each quantity.
85  // Signed quantities have the sign enconded in the left-most bit.
86 
87  unsigned int get_hitPattern();
88  unsigned int get_ispare(); // will need a converter(s) when spare bits are defined
89 
90  unsigned int get_RinvBits();
91  unsigned int get_phiBits();
92  unsigned int get_etaBits();
93  unsigned int get_z0Bits();
94  unsigned int get_d0Bits();
95  unsigned int get_chi2Bits();
96  unsigned int get_BendChi2Bits();
97 
98  // copy constructor
99 
101  initialize();
102 
103  iRinv = word.iRinv;
104  iphi = word.iphi;
105  ieta = word.ieta;
106  iz0 = word.iz0;
107  id0 = word.id0;
108  ichi2 = word.ichi2;
109  iBendChi2 = word.iBendChi2;
110  ispare = word.ispare;
111  iHitPattern = word.iHitPattern;
112 
113  // three 32-bit packed words
114  TrackWord1 = word.TrackWord1;
115  TrackWord2 = word.TrackWord2;
116  TrackWord3 = word.TrackWord3;
117  }
118 
120  initialize();
121  iRinv = word.iRinv;
122  iphi = word.iphi;
123  ieta = word.ieta;
124  iz0 = word.iz0;
125  id0 = word.id0;
126  ichi2 = word.ichi2;
127  iBendChi2 = word.iBendChi2;
128  ispare = word.ispare;
129  iHitPattern = word.iHitPattern;
130 
131  // three 32-bit packed words
132  TrackWord1 = word.TrackWord1;
133  TrackWord2 = word.TrackWord2;
134  TrackWord3 = word.TrackWord3;
135 
136  return *this;
137  }
138 
139 private:
140  void initialize();
141 
142  unsigned int digitize_Signed(float var, unsigned int maxBit, unsigned int minBit, float lsb);
143 
144  float unpack_Signed(unsigned int bits, unsigned int nBits, float lsb);
145 
146  // individual data members (not packed into 96 bits)
147  unsigned int iRinv;
148  unsigned int iphi;
149  unsigned int ieta;
150  unsigned int iz0;
151  unsigned int id0;
152  unsigned int ichi2;
153  unsigned int iBendChi2;
154  unsigned int ispare;
155  unsigned int iHitPattern;
156 
157  // three 32-bit packed words
158 
159  unsigned int TrackWord1;
160  unsigned int TrackWord2;
161  unsigned int TrackWord3;
162 
163  // values of least significant bit for digitization
164 
165  float valLSBCurv;
166  float valLSBPhi;
167  float valLSBEta;
168  float valLSBZ0;
169  float valLSBD0;
170 
171  float chi2Bins[16];
172  float Bchi2Bins[8];
173 
174  unsigned int Nchi2;
175  unsigned int NBchi2;
176 
177  /* bits for packing:
178  signed quantities (one bit for sign):
179 
180  q/R = 14+1
181  phi = 11+1 (relative to sector center)
182  eta = 15+1
183  z0 = 11+1
184  d0 = 12+1
185 
186  unsigned:
187  chi2 = 4
188  BendChi2 = 3
189  hitmask = 7
190  Spare = 14
191 
192  */
193 
194  // signed quantities: total bits are these values plus one
195  const unsigned int NCurvBits = 14;
196  const unsigned int NPhiBits = 11;
197  const unsigned int NEtaBits = 15;
198  const unsigned int NZ0Bits = 11;
199  const unsigned int ND0Bits = 12;
200 
201  // unsigned:
202  const unsigned int NChi2Bits = 4;
203  const unsigned int NBChi2Bits = 3;
204  const unsigned int NHitsBits = 7;
205  const unsigned int NSpareBits = 14;
206 
207  // establish binning
208  const float maxCurv = 0.5; // 2 GeV pT
209  const float maxPhi = 0.35; // relative to the center of the sector
210  const float maxEta = 2.5;
211  const float maxZ0 = 20.;
212  const float maxD0 = 15.;
213 
214 }; // end of class def
215 
216 #endif
const unsigned int NZ0Bits
const unsigned int NBChi2Bits
unsigned int get_ispare()
const unsigned int NPhiBits
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
const unsigned int NChi2Bits
const unsigned int NSpareBits
unsigned int get_BendChi2Bits()
unsigned int unpack_hitPattern()
unsigned int iBendChi2
uint64_t word
unsigned int get_d0Bits()
const unsigned int NEtaBits
void setTrackWord(const GlobalVector &Momentum, const GlobalPoint &POCA, double theRinv, double theChi2, double theBendChi2, unsigned int theHitPattern, unsigned int iSpare)
unsigned int get_RinvBits()
TTTrack_TrackWord(const TTTrack_TrackWord &word)
unsigned int get_etaBits()
unsigned int unpack_ispare()
const unsigned int NCurvBits
unsigned int get_hitPattern()
unsigned int TrackWord2
float unpack_Signed(unsigned int bits, unsigned int nBits, float lsb)
unsigned int iHitPattern
unsigned int digitize_Signed(float var, unsigned int maxBit, unsigned int minBit, float lsb)
unsigned int TrackWord1
unsigned int get_chi2Bits()
TTTrack_TrackWord & operator=(const TTTrack_TrackWord &word)
const unsigned int NHitsBits
const unsigned int ND0Bits
unsigned int TrackWord3
unsigned int get_phiBits()
unsigned int get_z0Bits()