CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TTTrack_TrackWord Class Reference

#include <TTTrack_TrackWord.h>

Inheritance diagram for TTTrack_TrackWord:
TTTrack< T >

Public Member Functions

unsigned int get_BendChi2Bits ()
 
unsigned int get_chi2XYBits ()
 
unsigned int get_chi2ZBits ()
 
unsigned int get_d0Bits ()
 
unsigned int get_hitPattern ()
 
float get_iBendChi2 ()
 
float get_ichi2XY ()
 
float get_ichi2Z ()
 
float get_id0 ()
 
float get_iphi ()
 
float get_iRinv ()
 
unsigned int get_ispare ()
 
float get_itanl ()
 
float get_iz0 ()
 
unsigned int get_phiBits ()
 
unsigned int get_RinvBits ()
 
unsigned int get_tanlBits ()
 
unsigned int get_z0Bits ()
 
TTTrack_TrackWordoperator= (const TTTrack_TrackWord &word)
 
void setTrackWord (const GlobalVector &Momentum, const GlobalPoint &POCA, double Rinv, double Chi2XY, double Chi2Z, double BendChi2, unsigned int HitPattern, unsigned int iSpare)
 
void setTrackWord (unsigned int Rinv, unsigned int phi0, unsigned int tanl, unsigned int z0, unsigned int d0, unsigned int Chi2XY, unsigned int Chi2Z, unsigned int BendChi2, unsigned int HitPattern, unsigned int iSpare)
 
 TTTrack_TrackWord ()
 
 TTTrack_TrackWord (const GlobalVector &Momentum, const GlobalPoint &POCA, double Rinv, double Chi2, double Chi2Z, double BendChi2, unsigned int HitPattern, unsigned int iSpare)
 
 TTTrack_TrackWord (const TTTrack_TrackWord &word)
 
 TTTrack_TrackWord (unsigned int Rinv, unsigned int phi0, unsigned int tanl, unsigned int z0, unsigned int d0, unsigned int Chi2XY, unsigned int Chi2Z, unsigned int BendChi2, unsigned int HitPattern, unsigned int iSpare)
 
unsigned int unpack_hitPattern ()
 
float unpack_iBendChi2 ()
 
float unpack_ichi2XY ()
 
float unpack_ichi2Z ()
 
float unpack_id0 ()
 
float unpack_iphi ()
 
float unpack_iRinv ()
 
unsigned int unpack_ispare ()
 
float unpack_itanl ()
 
float unpack_iz0 ()
 

Private Member Functions

unsigned int digitize_Signed (float var, unsigned int maxBit, unsigned int minBit, float lsb)
 
void initialize ()
 
float unpack_Signed (unsigned int bits, unsigned int nBits, float lsb)
 

Private Attributes

float Bchi2Bins [8]
 
float chi2Bins [16]
 
float chi2ZBins [16]
 
unsigned int iBendChi2
 
unsigned int ichi2XY
 
unsigned int ichi2Z
 
unsigned int id0
 
unsigned int iHitPattern
 
unsigned int iphi
 
unsigned int iRinv
 
unsigned int ispare
 
unsigned int itanl
 
unsigned int iz0
 
const unsigned int maskBendChi2 = 0x0001C000
 
const unsigned int maskChi2XY = 0x0000000F
 
const unsigned int maskChi2Z = 0x00003C00
 
const unsigned int maskD0 = 0x000FFF80
 
const unsigned int maskHitPat = 0x0000007F
 
const unsigned int maskPhi = 0xFFF00000
 
const unsigned int maskRinv = 0xFFFE0000
 
const unsigned int maskSpare = 0x000003FF
 
const unsigned int maskTanL = 0xFFFF0000
 
const unsigned int maskZ0 = 0x0000FFF0
 
const float maxCurv = 0.00855
 
const float maxD0 = 15.4
 
const float maxPhi = 1.026
 
const float maxTanl = 8.0
 
const float maxZ0 = 30.
 
unsigned int NBchi2
 
const unsigned int NBChi2Bits = 3
 
unsigned int Nchi2
 
const unsigned int NChi2Bits = 4
 
const unsigned int NCurvBits = 14
 
const unsigned int ND0Bits = 12
 
const unsigned int NHitsBits = 7
 
const unsigned int NPhiBits = 11
 
const unsigned int NSpareBits = 14
 
const unsigned int NTanlBits = 15
 
const unsigned int nWordBits = 32
 
const unsigned int NZ0Bits = 11
 
unsigned int TrackWord1
 
unsigned int TrackWord2
 
unsigned int TrackWord3
 
float valLSBCurv
 
float valLSBD0
 
float valLSBPhi
 
float valLSBTanl
 
float valLSBZ0
 

Detailed Description

Definition at line 19 of file TTTrack_TrackWord.h.

Constructor & Destructor Documentation

◆ TTTrack_TrackWord() [1/4]

TTTrack_TrackWord::TTTrack_TrackWord ( )
inline

Definition at line 23 of file TTTrack_TrackWord.h.

23 {}

◆ TTTrack_TrackWord() [2/4]

TTTrack_TrackWord::TTTrack_TrackWord ( const GlobalVector Momentum,
const GlobalPoint POCA,
double  Rinv,
double  Chi2,
double  Chi2Z,
double  BendChi2,
unsigned int  HitPattern,
unsigned int  iSpare 
)

Definition at line 18 of file TTTrack_TrackWord.cc.

25  {
26  setTrackWord(Momentum, POCA, theRinv, theChi2XY, theChi2Z, theBendChi2, theHitPattern, iSpare);
27 }

References setTrackWord().

◆ TTTrack_TrackWord() [3/4]

TTTrack_TrackWord::TTTrack_TrackWord ( unsigned int  Rinv,
unsigned int  phi0,
unsigned int  tanl,
unsigned int  z0,
unsigned int  d0,
unsigned int  Chi2XY,
unsigned int  Chi2Z,
unsigned int  BendChi2,
unsigned int  HitPattern,
unsigned int  iSpare 
)

Definition at line 29 of file TTTrack_TrackWord.cc.

39  : iRinv(theRinv),
40  iphi(phi0),
41  itanl(tanl),
42  iz0(z0),
43  id0(d0),
44  ichi2XY(theChi2XY), //revert to other packing? Or will be unpacked wrong
45  ichi2Z(theChi2Z), //revert to other packing? Or will be unpacked wrong
46  iBendChi2(theBendChi2), // revert to ogher packing? Or will be unpacked wrong
47  ispare(iSpare),
48  iHitPattern(theHitPattern) {
49  initialize();
50 }

References initialize().

◆ TTTrack_TrackWord() [4/4]

TTTrack_TrackWord::TTTrack_TrackWord ( const TTTrack_TrackWord word)
inline

Definition at line 107 of file TTTrack_TrackWord.h.

107  {
108  initialize();
109 
110  iRinv = word.iRinv;
111  iphi = word.iphi;
112  itanl = word.itanl;
113  iz0 = word.iz0;
114  id0 = word.id0;
115  ichi2XY = word.ichi2XY;
116  ichi2Z = word.ichi2Z;
117  iBendChi2 = word.iBendChi2;
118  ispare = word.ispare;
119  iHitPattern = word.iHitPattern;
120 
121  // three 32-bit packed words
122  TrackWord1 = word.TrackWord1;
123  TrackWord2 = word.TrackWord2;
124  TrackWord3 = word.TrackWord3;
125  }

References iBendChi2, ichi2XY, ichi2Z, id0, iHitPattern, initialize(), iphi, iRinv, ispare, itanl, iz0, TrackWord1, TrackWord2, and TrackWord3.

Member Function Documentation

◆ digitize_Signed()

unsigned int TTTrack_TrackWord::digitize_Signed ( float  var,
unsigned int  maxBit,
unsigned int  minBit,
float  lsb 
)
private

Definition at line 335 of file TTTrack_TrackWord.cc.

335  {
336  unsigned int nBits = (maxBit - minBit + 1);
337  unsigned int myVar = std::floor(fabs(var) / lsb);
338  unsigned int maxVal = (1 << (nBits - 1)) - 1;
339  if (myVar > maxVal)
340  myVar = maxVal;
341  if (var < 0)
342  myVar = (1 << nBits) - myVar; // two's complement encoding
343  unsigned int seg = myVar;
344  return seg;
345 }

References hgcalVFEProducer_cfi::lsb, and trigObjTnPSource_cfi::var.

Referenced by setTrackWord().

◆ get_BendChi2Bits()

unsigned int TTTrack_TrackWord::get_BendChi2Bits ( )

Definition at line 312 of file TTTrack_TrackWord.cc.

312  {
313  unsigned int bits = (TrackWord3 & maskBendChi2) >> (nWordBits - (NCurvBits + NBChi2Bits + 1)); //14
314  return bits;
315 }

References maskBendChi2, NBChi2Bits, NCurvBits, nWordBits, and TrackWord3.

◆ get_chi2XYBits()

unsigned int TTTrack_TrackWord::get_chi2XYBits ( )

Definition at line 246 of file TTTrack_TrackWord.cc.

246  {
247  //unsigned int bits = (TrackWord1 & 0x0000000F);
248  return ichi2XY;
249 }

References ichi2XY.

◆ get_chi2ZBits()

unsigned int TTTrack_TrackWord::get_chi2ZBits ( )

◆ get_d0Bits()

unsigned int TTTrack_TrackWord::get_d0Bits ( )

Definition at line 278 of file TTTrack_TrackWord.cc.

278  {
279  // unsigned int bits = (TrackWord2 & 0x000FFF80) >> 7;
280  return id0;
281 }

References id0.

◆ get_hitPattern()

unsigned int TTTrack_TrackWord::get_hitPattern ( )

Definition at line 288 of file TTTrack_TrackWord.cc.

288 { return iHitPattern; }

References iHitPattern.

◆ get_iBendChi2()

float TTTrack_TrackWord::get_iBendChi2 ( )

Definition at line 307 of file TTTrack_TrackWord.cc.

307  {
308  float unpBChi2 = Bchi2Bins[iBendChi2];
309  return unpBChi2;
310 }

References Bchi2Bins, and iBendChi2.

◆ get_ichi2XY()

float TTTrack_TrackWord::get_ichi2XY ( )

Definition at line 241 of file TTTrack_TrackWord.cc.

241  {
242  float unpChi2 = chi2Bins[ichi2XY];
243  return unpChi2;
244 }

References chi2Bins, and ichi2XY.

◆ get_ichi2Z()

float TTTrack_TrackWord::get_ichi2Z ( )

Definition at line 323 of file TTTrack_TrackWord.cc.

323  {
324  float unpChi2Z = chi2ZBins[ichi2Z];
325  return unpChi2Z;
326 }

References chi2ZBins, and ichi2Z.

◆ get_id0()

float TTTrack_TrackWord::get_id0 ( )

Definition at line 273 of file TTTrack_TrackWord.cc.

273  {
274  float unpD0 = unpack_Signed(id0, ND0Bits, valLSBD0);
275  return unpD0;
276 }

References id0, ND0Bits, unpack_Signed(), and valLSBD0.

◆ get_iphi()

float TTTrack_TrackWord::get_iphi ( )

Definition at line 257 of file TTTrack_TrackWord.cc.

257  {
258  float unpPhi = unpack_Signed(iphi, NPhiBits, valLSBPhi);
259  return unpPhi;
260 }

References iphi, NPhiBits, unpack_Signed(), and valLSBPhi.

◆ get_iRinv()

float TTTrack_TrackWord::get_iRinv ( )

Definition at line 296 of file TTTrack_TrackWord.cc.

296  {
297  float unpCurv = unpack_Signed(iRinv, NCurvBits, valLSBCurv);
298  return unpCurv;
299 }

References iRinv, NCurvBits, unpack_Signed(), and valLSBCurv.

◆ get_ispare()

unsigned int TTTrack_TrackWord::get_ispare ( )

Definition at line 333 of file TTTrack_TrackWord.cc.

333 { return ispare; }

References ispare.

◆ get_itanl()

float TTTrack_TrackWord::get_itanl ( )

Definition at line 209 of file TTTrack_TrackWord.cc.

209  {
210  float unpTanl = unpack_Signed(itanl, NTanlBits, valLSBTanl);
211  return unpTanl;
212 }

References itanl, NTanlBits, unpack_Signed(), and valLSBTanl.

◆ get_iz0()

float TTTrack_TrackWord::get_iz0 ( )

Definition at line 225 of file TTTrack_TrackWord.cc.

225  {
226  float unpZ0 = unpack_Signed(iz0, NZ0Bits, valLSBZ0);
227  return unpZ0;
228 }

References iz0, NZ0Bits, unpack_Signed(), and valLSBZ0.

◆ get_phiBits()

unsigned int TTTrack_TrackWord::get_phiBits ( )

Definition at line 262 of file TTTrack_TrackWord.cc.

262  {
263  //unsigned int bits = (TrackWord2 & 0xFFF00000) >> 20;
264  return iphi;
265 }

References iphi.

◆ get_RinvBits()

unsigned int TTTrack_TrackWord::get_RinvBits ( )

◆ get_tanlBits()

unsigned int TTTrack_TrackWord::get_tanlBits ( )

Definition at line 214 of file TTTrack_TrackWord.cc.

214  {
215  //unsigned int bits = (TrackWord1 & 0xFFFF0000) >> 16;
216  return itanl;
217 }

References itanl.

◆ get_z0Bits()

unsigned int TTTrack_TrackWord::get_z0Bits ( )

Definition at line 230 of file TTTrack_TrackWord.cc.

230  {
231  //unsigned int bits = (TrackWord1 & 0x0000FFF0) >> 4;
232  return iz0;
233 }

References iz0.

◆ initialize()

void TTTrack_TrackWord::initialize ( )
private

Definition at line 359 of file TTTrack_TrackWord.cc.

359  {
360  /* bits for packing, constants defined in TTTrack_TrackWord.h :
361 
362  signed quantities (one bit for sign):
363 
364  q/R = 14+1
365  phi = 11+1 (relative to sector center)
366  tanl = 15+1
367  z0 = 11+1
368  d0 = 12+1
369 
370  unsigned:
371 
372  chi2 = 4
373  BendChi2 = 3
374  hitPattern = 7
375  Spare = 10
376  chi2Z = 4
377 
378  */
379 
380  // define bits, 1<<N = 2^N
381 
382  unsigned int CurvBins = (1 << NCurvBits);
383  unsigned int phiBins = (1 << NPhiBits);
384  unsigned int tanlBins = (1 << NTanlBits);
385  unsigned int z0Bins = (1 << NZ0Bits);
386  unsigned int d0Bins = (1 << ND0Bits);
387 
388  Nchi2 = (1 << NChi2Bits);
389  NBchi2 = (1 << NBChi2Bits);
390 
391  valLSBCurv = maxCurv / float(CurvBins);
392  valLSBPhi = maxPhi / float(phiBins);
393  valLSBTanl = maxTanl / float(tanlBins);
394  valLSBZ0 = maxZ0 / float(z0Bins);
395  valLSBD0 = maxD0 / float(d0Bins);
396 
397  chi2Bins[0] = 0.25;
398  chi2Bins[1] = 0.5;
399  chi2Bins[2] = 1.0;
400  chi2Bins[3] = 2.;
401  chi2Bins[4] = 3.;
402  chi2Bins[5] = 5.;
403  chi2Bins[6] = 7.;
404  chi2Bins[7] = 10.;
405  chi2Bins[8] = 20.;
406  chi2Bins[9] = 40.;
407  chi2Bins[10] = 100.;
408  chi2Bins[11] = 200.;
409  chi2Bins[12] = 500.;
410  chi2Bins[13] = 1000.;
411  chi2Bins[14] = 3000.;
412 
413  chi2ZBins[0] = 0.25;
414  chi2ZBins[1] = 0.5;
415  chi2ZBins[2] = 1.0;
416  chi2ZBins[3] = 2.;
417  chi2ZBins[4] = 3.;
418  chi2ZBins[5] = 5.;
419  chi2ZBins[6] = 7.;
420  chi2ZBins[7] = 10.;
421  chi2ZBins[8] = 20.;
422  chi2ZBins[9] = 40.;
423  chi2ZBins[10] = 100.;
424  chi2ZBins[11] = 200.;
425  chi2ZBins[12] = 500.;
426  chi2ZBins[13] = 1000.;
427  chi2ZBins[14] = 3000.;
428 
429  Bchi2Bins[0] = 0.5;
430  Bchi2Bins[1] = 1.25;
431  Bchi2Bins[2] = 2.0;
432  Bchi2Bins[3] = 3.0;
433  Bchi2Bins[4] = 5.0;
434  Bchi2Bins[5] = 10.;
435  Bchi2Bins[6] = 50.;
436 };

References Bchi2Bins, chi2Bins, chi2ZBins, dqmMemoryStats::float, maxCurv, maxD0, maxPhi, maxTanl, maxZ0, NBchi2, NBChi2Bits, Nchi2, NChi2Bits, NCurvBits, ND0Bits, NPhiBits, NTanlBits, NZ0Bits, valLSBCurv, valLSBD0, valLSBPhi, valLSBTanl, and valLSBZ0.

Referenced by operator=(), setTrackWord(), and TTTrack_TrackWord().

◆ operator=()

TTTrack_TrackWord& TTTrack_TrackWord::operator= ( const TTTrack_TrackWord word)
inline

Definition at line 127 of file TTTrack_TrackWord.h.

127  {
128  initialize();
129  iRinv = word.iRinv;
130  iphi = word.iphi;
131  itanl = word.itanl;
132  iz0 = word.iz0;
133  id0 = word.id0;
134  ichi2XY = word.ichi2XY;
135  ichi2Z = word.ichi2Z;
136  iBendChi2 = word.iBendChi2;
137  ispare = word.ispare;
138  iHitPattern = word.iHitPattern;
139 
140  // three 32-bit packed words
141  TrackWord1 = word.TrackWord1;
142  TrackWord2 = word.TrackWord2;
143  TrackWord3 = word.TrackWord3;
144 
145  return *this;
146  }

References iBendChi2, ichi2XY, ichi2Z, id0, iHitPattern, initialize(), iphi, iRinv, ispare, itanl, iz0, TrackWord1, TrackWord2, and TrackWord3.

◆ setTrackWord() [1/2]

void TTTrack_TrackWord::setTrackWord ( const GlobalVector Momentum,
const GlobalPoint POCA,
double  Rinv,
double  Chi2XY,
double  Chi2Z,
double  BendChi2,
unsigned int  HitPattern,
unsigned int  iSpare 
)

Definition at line 79 of file TTTrack_TrackWord.cc.

86  {
87  initialize();
88 
89  // first, derive quantities to be packed
90 
91  float rPhi = Momentum.phi(); // this needs to be phi relative to center of sector ****
92  float rTanl = Momentum.z() / Momentum.perp();
93  float rZ0 = POCA.z();
94  float rD0 = POCA.perp();
95 
96  // bin, convert to integers, and pack
97 
98  unsigned int seg1, seg2, seg3;
99  seg1 = 0;
100  seg2 = 0;
101  seg3 = 0;
102 
103  //tanl
104 
106 
107  //z0
108  iz0 = digitize_Signed(rZ0, NZ0Bits, 0, valLSBZ0);
109 
110  //chi2 has non-linear bins
111 
112  ichi2XY = 0;
113 
114  for (unsigned int ibin = 0; ibin < Nchi2; ++ibin) {
115  ichi2XY = ibin;
116  if (theChi2XY < chi2Bins[ibin])
117  break;
118  }
119 
120  //chi2Z has non-linear bins
121 
122  ichi2Z = 0;
123 
124  for (unsigned int ibin = 0; ibin < Nchi2; ++ibin) {
125  ichi2Z = ibin;
126  if (theChi2Z < chi2ZBins[ibin])
127  break;
128  }
129 
130  //phi
131  iphi = digitize_Signed(rPhi, NPhiBits, 0, valLSBPhi);
132 
133  //d0
134  id0 = digitize_Signed(rD0, ND0Bits, 0, valLSBD0);
135 
136  //Rinv
137  iRinv = digitize_Signed(theRinv, NCurvBits, 0, valLSBCurv);
138 
139  //bend chi2 - non-linear bins
140  iBendChi2 = 0;
141 
142  for (unsigned int ibin = 0; ibin < NBchi2; ++ibin) {
143  iBendChi2 = ibin;
144  if (theBendChi2 < Bchi2Bins[ibin])
145  break;
146  }
147 
148  ispare = iSpare;
149 
150  // spare bits
151  if (ispare > 0x3FFF)
152  ispare = 0x3FFF;
153 
154  iHitPattern = theHitPattern;
155 
156  //set bits
157  /*
158  Current packing scheme. Any changes here ripple everywhere!
159 
160  uint word1 = 16 (tanl) + 12 (z0) + 4 (chi2) = 32 bits
161  uint word2 = 12 (phi) + 13 (d0) + 7 (hitPattern) = 32 bits
162  uint word3 = 15 (pT) + 3 (bend chi2) + 14 (spare/TMVA) = 32 bits
163  */
164 
165  //now pack bits; leave hardcoded for now as am example of how this could work
166 
167  seg1 = (itanl << (nWordBits - (NTanlBits + 1))); // extra bit or bits is for sign //16
168  seg2 = (iz0 << (nWordBits - (NTanlBits + NZ0Bits + 2))); //4
169  seg3 = ichi2XY;
170 
171  //set bits
172 
173  TrackWord1 = seg1 + seg2 + seg3;
174  seg1 = 0;
175  seg2 = 0;
176  seg3 = 0;
177 
178  //second 32-bit word
179  seg1 = (iphi << (nWordBits - (NPhiBits + 1))); //20
180  seg2 = (id0 << (nWordBits - (NPhiBits + ND0Bits + 2))); //7
181 
182  //HitMask
183  seg3 = theHitPattern;
184 
185  //set bits
186 
187  TrackWord2 = seg1 + seg2 + seg3;
188  seg1 = 0;
189  seg2 = 0;
190  seg3 = 0;
191 
192  //third 32-bit word
193 
194  seg1 = (iRinv << (nWordBits - (NCurvBits + 1))); //17
195  seg2 = (iBendChi2 << (nWordBits - (NCurvBits + NBChi2Bits + 1))); //14
196  seg3 = (ichi2Z << (nWordBits - (NCurvBits + NBChi2Bits + NChi2Bits + 1))); //10
197  unsigned int seg4 = ispare;
198 
199  TrackWord3 = seg1 + seg2 + seg3 + seg4;
200 }

References Bchi2Bins, chi2Bins, chi2ZBins, digitize_Signed(), iBendChi2, ichi2XY, ichi2Z, id0, iHitPattern, initialize(), iphi, iRinv, ispare, itanl, iz0, NBchi2, NBChi2Bits, Nchi2, NChi2Bits, NCurvBits, ND0Bits, NPhiBits, NTanlBits, nWordBits, NZ0Bits, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), TrackWord1, TrackWord2, TrackWord3, valLSBCurv, valLSBD0, valLSBPhi, valLSBTanl, valLSBZ0, and PV3DBase< T, PVType, FrameType >::z().

Referenced by TTTrack_TrackWord().

◆ setTrackWord() [2/2]

void TTTrack_TrackWord::setTrackWord ( unsigned int  Rinv,
unsigned int  phi0,
unsigned int  tanl,
unsigned int  z0,
unsigned int  d0,
unsigned int  Chi2XY,
unsigned int  Chi2Z,
unsigned int  BendChi2,
unsigned int  HitPattern,
unsigned int  iSpare 
)

Definition at line 54 of file TTTrack_TrackWord.cc.

63  {
64  iRinv = theRinv;
65  iphi = phi0;
66  itanl = tanl;
67  iz0 = z0;
68  id0 = d0;
69  ichi2XY = theChi2XY; //revert to other packing? Or will be unpacked wrong
70  ichi2Z = theChi2Z; //revert to other packing? Or will be unpacked wrong
71  iBendChi2 = theBendChi2; // revert to ogher packing? Or will be unpacked wrong
72  ispare = iSpare;
73  iHitPattern = theHitPattern;
74 
75  initialize();
76 }

References d0, iBendChi2, ichi2XY, ichi2Z, id0, iHitPattern, initialize(), iphi, iRinv, ispare, itanl, iz0, and HLTMuonOfflineAnalyzer_cfi::z0.

◆ unpack_hitPattern()

unsigned int TTTrack_TrackWord::unpack_hitPattern ( )

Definition at line 283 of file TTTrack_TrackWord.cc.

283  {
284  unsigned int bits = (TrackWord2 & maskHitPat);
285  return bits;
286 }

References maskHitPat, and TrackWord2.

◆ unpack_iBendChi2()

float TTTrack_TrackWord::unpack_iBendChi2 ( )

Definition at line 301 of file TTTrack_TrackWord.cc.

301  {
302  unsigned int bits = (TrackWord3 & maskBendChi2) >> (nWordBits - (NCurvBits + NBChi2Bits + 1)); //14
303  float unpBChi2 = Bchi2Bins[bits];
304  return unpBChi2;
305 }

References Bchi2Bins, maskBendChi2, NBChi2Bits, NCurvBits, nWordBits, and TrackWord3.

◆ unpack_ichi2XY()

float TTTrack_TrackWord::unpack_ichi2XY ( )

Definition at line 235 of file TTTrack_TrackWord.cc.

235  {
236  unsigned int bits = (TrackWord1 & maskChi2XY);
237  float unpChi2 = chi2Bins[bits];
238  return unpChi2;
239 }

References chi2Bins, maskChi2XY, and TrackWord1.

◆ unpack_ichi2Z()

float TTTrack_TrackWord::unpack_ichi2Z ( )

Definition at line 317 of file TTTrack_TrackWord.cc.

317  {
318  unsigned int bits = (TrackWord3 & maskChi2Z) >> (nWordBits - (NCurvBits + NBChi2Bits + NChi2Bits + 1)); //10
319  float unpChi2Z = chi2ZBins[bits];
320  return unpChi2Z;
321 }

References chi2ZBins, maskChi2Z, NBChi2Bits, NChi2Bits, NCurvBits, nWordBits, and TrackWord3.

◆ unpack_id0()

float TTTrack_TrackWord::unpack_id0 ( )

Definition at line 267 of file TTTrack_TrackWord.cc.

267  {
268  unsigned int bits = (TrackWord2 & maskD0) >> (nWordBits - (NPhiBits + ND0Bits + 2)); //7
269  float unpD0 = unpack_Signed(bits, ND0Bits, valLSBD0);
270  return unpD0;
271 }

References maskD0, ND0Bits, NPhiBits, nWordBits, TrackWord2, unpack_Signed(), and valLSBD0.

◆ unpack_iphi()

float TTTrack_TrackWord::unpack_iphi ( )

Definition at line 251 of file TTTrack_TrackWord.cc.

251  {
252  unsigned int bits = (TrackWord2 & maskPhi) >> (nWordBits - (NPhiBits + 1)); //20
253  float unpPhi = unpack_Signed(bits, NPhiBits, valLSBPhi);
254  return unpPhi;
255 }

References maskPhi, NPhiBits, nWordBits, TrackWord2, unpack_Signed(), and valLSBPhi.

◆ unpack_iRinv()

float TTTrack_TrackWord::unpack_iRinv ( )

Definition at line 290 of file TTTrack_TrackWord.cc.

290  {
291  unsigned int bits = (TrackWord3 & maskRinv) >> (nWordBits - (NCurvBits + 1)); //17
292  float unpCurv = unpack_Signed(bits, NCurvBits, valLSBCurv);
293  return unpCurv;
294 }

References maskRinv, NCurvBits, nWordBits, TrackWord3, unpack_Signed(), and valLSBCurv.

◆ unpack_ispare()

unsigned int TTTrack_TrackWord::unpack_ispare ( )

Definition at line 328 of file TTTrack_TrackWord.cc.

328  {
329  unsigned int bits = (TrackWord3 & maskSpare);
330  return bits;
331 }

References maskSpare, and TrackWord3.

◆ unpack_itanl()

float TTTrack_TrackWord::unpack_itanl ( )

Definition at line 203 of file TTTrack_TrackWord.cc.

203  {
204  unsigned int bits = (TrackWord1 & maskTanL) >> (nWordBits - (NTanlBits + 1)); //16
205  float unpTanl = unpack_Signed(bits, NTanlBits, valLSBTanl);
206  return unpTanl;
207 }

References maskTanL, NTanlBits, nWordBits, TrackWord1, unpack_Signed(), and valLSBTanl.

◆ unpack_iz0()

float TTTrack_TrackWord::unpack_iz0 ( )

Definition at line 219 of file TTTrack_TrackWord.cc.

219  {
220  unsigned int bits = (TrackWord1 & maskZ0) >> (nWordBits - (NTanlBits + NZ0Bits + 2)); //4
221  float unpZ0 = unpack_Signed(bits, NZ0Bits, valLSBZ0);
222  return unpZ0;
223 }

References maskZ0, NTanlBits, nWordBits, NZ0Bits, TrackWord1, unpack_Signed(), and valLSBZ0.

◆ unpack_Signed()

float TTTrack_TrackWord::unpack_Signed ( unsigned int  bits,
unsigned int  nBits,
float  lsb 
)
private

Definition at line 347 of file TTTrack_TrackWord.cc.

347  {
348  int isign = 1;
349  unsigned int maxVal = (1 << nBits) - 1;
350  if (bits & (1 << nBits)) { //check sign
351  isign = -1;
352  bits = (1 << (nBits + 1)) - bits; // if negative, flip everything for two's complement encoding
353  }
354  float unpacked = (float(bits & maxVal) + 0.5) * lsb;
355  unpacked = isign * unpacked;
356  return unpacked;
357 }

References dqmMemoryStats::float, and hgcalVFEProducer_cfi::lsb.

Referenced by get_id0(), get_iphi(), get_iRinv(), get_itanl(), get_iz0(), unpack_id0(), unpack_iphi(), unpack_iRinv(), unpack_itanl(), and unpack_iz0().

Member Data Documentation

◆ Bchi2Bins

float TTTrack_TrackWord::Bchi2Bins[8]
private

Definition at line 183 of file TTTrack_TrackWord.h.

Referenced by get_iBendChi2(), initialize(), setTrackWord(), and unpack_iBendChi2().

◆ chi2Bins

float TTTrack_TrackWord::chi2Bins[16]
private

Definition at line 181 of file TTTrack_TrackWord.h.

Referenced by get_ichi2XY(), initialize(), setTrackWord(), and unpack_ichi2XY().

◆ chi2ZBins

float TTTrack_TrackWord::chi2ZBins[16]
private

Definition at line 182 of file TTTrack_TrackWord.h.

Referenced by get_ichi2Z(), initialize(), setTrackWord(), and unpack_ichi2Z().

◆ iBendChi2

unsigned int TTTrack_TrackWord::iBendChi2
private

Definition at line 163 of file TTTrack_TrackWord.h.

Referenced by get_iBendChi2(), operator=(), setTrackWord(), and TTTrack_TrackWord().

◆ ichi2XY

unsigned int TTTrack_TrackWord::ichi2XY
private

◆ ichi2Z

unsigned int TTTrack_TrackWord::ichi2Z
private

Definition at line 162 of file TTTrack_TrackWord.h.

Referenced by get_ichi2Z(), operator=(), setTrackWord(), and TTTrack_TrackWord().

◆ id0

unsigned int TTTrack_TrackWord::id0
private

Definition at line 160 of file TTTrack_TrackWord.h.

Referenced by get_d0Bits(), get_id0(), operator=(), setTrackWord(), and TTTrack_TrackWord().

◆ iHitPattern

unsigned int TTTrack_TrackWord::iHitPattern
private

Definition at line 165 of file TTTrack_TrackWord.h.

Referenced by get_hitPattern(), operator=(), setTrackWord(), and TTTrack_TrackWord().

◆ iphi

unsigned int TTTrack_TrackWord::iphi
private

◆ iRinv

unsigned int TTTrack_TrackWord::iRinv
private

Definition at line 156 of file TTTrack_TrackWord.h.

Referenced by get_iRinv(), operator=(), setTrackWord(), and TTTrack_TrackWord().

◆ ispare

unsigned int TTTrack_TrackWord::ispare
private

Definition at line 164 of file TTTrack_TrackWord.h.

Referenced by get_ispare(), operator=(), setTrackWord(), and TTTrack_TrackWord().

◆ itanl

unsigned int TTTrack_TrackWord::itanl
private

◆ iz0

unsigned int TTTrack_TrackWord::iz0
private

Definition at line 159 of file TTTrack_TrackWord.h.

Referenced by get_iz0(), get_z0Bits(), operator=(), setTrackWord(), and TTTrack_TrackWord().

◆ maskBendChi2

const unsigned int TTTrack_TrackWord::maskBendChi2 = 0x0001C000
private

Definition at line 236 of file TTTrack_TrackWord.h.

Referenced by get_BendChi2Bits(), and unpack_iBendChi2().

◆ maskChi2XY

const unsigned int TTTrack_TrackWord::maskChi2XY = 0x0000000F
private

Definition at line 234 of file TTTrack_TrackWord.h.

Referenced by unpack_ichi2XY().

◆ maskChi2Z

const unsigned int TTTrack_TrackWord::maskChi2Z = 0x00003C00
private

Definition at line 235 of file TTTrack_TrackWord.h.

Referenced by unpack_ichi2Z().

◆ maskD0

const unsigned int TTTrack_TrackWord::maskD0 = 0x000FFF80
private

Definition at line 232 of file TTTrack_TrackWord.h.

Referenced by unpack_id0().

◆ maskHitPat

const unsigned int TTTrack_TrackWord::maskHitPat = 0x0000007F
private

Definition at line 237 of file TTTrack_TrackWord.h.

Referenced by unpack_hitPattern().

◆ maskPhi

const unsigned int TTTrack_TrackWord::maskPhi = 0xFFF00000
private

Definition at line 230 of file TTTrack_TrackWord.h.

Referenced by unpack_iphi().

◆ maskRinv

const unsigned int TTTrack_TrackWord::maskRinv = 0xFFFE0000
private

Definition at line 229 of file TTTrack_TrackWord.h.

Referenced by unpack_iRinv().

◆ maskSpare

const unsigned int TTTrack_TrackWord::maskSpare = 0x000003FF
private

Definition at line 238 of file TTTrack_TrackWord.h.

Referenced by unpack_ispare().

◆ maskTanL

const unsigned int TTTrack_TrackWord::maskTanL = 0xFFFF0000
private

Definition at line 231 of file TTTrack_TrackWord.h.

Referenced by unpack_itanl().

◆ maskZ0

const unsigned int TTTrack_TrackWord::maskZ0 = 0x0000FFF0
private

Definition at line 233 of file TTTrack_TrackWord.h.

Referenced by unpack_iz0().

◆ maxCurv

const float TTTrack_TrackWord::maxCurv = 0.00855
private

Definition at line 220 of file TTTrack_TrackWord.h.

Referenced by initialize().

◆ maxD0

const float TTTrack_TrackWord::maxD0 = 15.4
private

Definition at line 224 of file TTTrack_TrackWord.h.

Referenced by initialize().

◆ maxPhi

const float TTTrack_TrackWord::maxPhi = 1.026
private

Definition at line 221 of file TTTrack_TrackWord.h.

Referenced by initialize().

◆ maxTanl

const float TTTrack_TrackWord::maxTanl = 8.0
private

Definition at line 222 of file TTTrack_TrackWord.h.

Referenced by initialize().

◆ maxZ0

const float TTTrack_TrackWord::maxZ0 = 30.
private

Definition at line 223 of file TTTrack_TrackWord.h.

Referenced by initialize().

◆ NBchi2

unsigned int TTTrack_TrackWord::NBchi2
private

Definition at line 186 of file TTTrack_TrackWord.h.

Referenced by initialize(), and setTrackWord().

◆ NBChi2Bits

const unsigned int TTTrack_TrackWord::NBChi2Bits = 3
private

◆ Nchi2

unsigned int TTTrack_TrackWord::Nchi2
private

Definition at line 185 of file TTTrack_TrackWord.h.

Referenced by initialize(), and setTrackWord().

◆ NChi2Bits

const unsigned int TTTrack_TrackWord::NChi2Bits = 4
private

Definition at line 214 of file TTTrack_TrackWord.h.

Referenced by initialize(), setTrackWord(), and unpack_ichi2Z().

◆ NCurvBits

const unsigned int TTTrack_TrackWord::NCurvBits = 14
private

◆ ND0Bits

const unsigned int TTTrack_TrackWord::ND0Bits = 12
private

Definition at line 211 of file TTTrack_TrackWord.h.

Referenced by get_id0(), initialize(), setTrackWord(), and unpack_id0().

◆ NHitsBits

const unsigned int TTTrack_TrackWord::NHitsBits = 7
private

Definition at line 216 of file TTTrack_TrackWord.h.

◆ NPhiBits

const unsigned int TTTrack_TrackWord::NPhiBits = 11
private

Definition at line 208 of file TTTrack_TrackWord.h.

Referenced by get_iphi(), initialize(), setTrackWord(), unpack_id0(), and unpack_iphi().

◆ NSpareBits

const unsigned int TTTrack_TrackWord::NSpareBits = 14
private

Definition at line 217 of file TTTrack_TrackWord.h.

◆ NTanlBits

const unsigned int TTTrack_TrackWord::NTanlBits = 15
private

Definition at line 209 of file TTTrack_TrackWord.h.

Referenced by get_itanl(), initialize(), setTrackWord(), unpack_itanl(), and unpack_iz0().

◆ nWordBits

const unsigned int TTTrack_TrackWord::nWordBits = 32
private

◆ NZ0Bits

const unsigned int TTTrack_TrackWord::NZ0Bits = 11
private

Definition at line 210 of file TTTrack_TrackWord.h.

Referenced by get_iz0(), initialize(), setTrackWord(), and unpack_iz0().

◆ TrackWord1

unsigned int TTTrack_TrackWord::TrackWord1
private

◆ TrackWord2

unsigned int TTTrack_TrackWord::TrackWord2
private

◆ TrackWord3

unsigned int TTTrack_TrackWord::TrackWord3
private

◆ valLSBCurv

float TTTrack_TrackWord::valLSBCurv
private

Definition at line 175 of file TTTrack_TrackWord.h.

Referenced by get_iRinv(), initialize(), setTrackWord(), and unpack_iRinv().

◆ valLSBD0

float TTTrack_TrackWord::valLSBD0
private

Definition at line 179 of file TTTrack_TrackWord.h.

Referenced by get_id0(), initialize(), setTrackWord(), and unpack_id0().

◆ valLSBPhi

float TTTrack_TrackWord::valLSBPhi
private

Definition at line 176 of file TTTrack_TrackWord.h.

Referenced by get_iphi(), initialize(), setTrackWord(), and unpack_iphi().

◆ valLSBTanl

float TTTrack_TrackWord::valLSBTanl
private

Definition at line 177 of file TTTrack_TrackWord.h.

Referenced by get_itanl(), initialize(), setTrackWord(), and unpack_itanl().

◆ valLSBZ0

float TTTrack_TrackWord::valLSBZ0
private

Definition at line 178 of file TTTrack_TrackWord.h.

Referenced by get_iz0(), initialize(), setTrackWord(), and unpack_iz0().

TTTrack_TrackWord::TrackWord3
unsigned int TrackWord3
Definition: TTTrack_TrackWord.h:171
TTTrack_TrackWord::TrackWord1
unsigned int TrackWord1
Definition: TTTrack_TrackWord.h:169
TTTrack_TrackWord::TrackWord2
unsigned int TrackWord2
Definition: TTTrack_TrackWord.h:170
TTTrack_TrackWord::NCurvBits
const unsigned int NCurvBits
Definition: TTTrack_TrackWord.h:207
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
TTTrack_TrackWord::NBchi2
unsigned int NBchi2
Definition: TTTrack_TrackWord.h:186
TTTrack_TrackWord::valLSBPhi
float valLSBPhi
Definition: TTTrack_TrackWord.h:176
TTTrack_TrackWord::unpack_Signed
float unpack_Signed(unsigned int bits, unsigned int nBits, float lsb)
Definition: TTTrack_TrackWord.cc:347
TTTrack_TrackWord::valLSBCurv
float valLSBCurv
Definition: TTTrack_TrackWord.h:175
TTTrack_TrackWord::valLSBTanl
float valLSBTanl
Definition: TTTrack_TrackWord.h:177
TTTrack_TrackWord::maskBendChi2
const unsigned int maskBendChi2
Definition: TTTrack_TrackWord.h:236
TTTrack_TrackWord::initialize
void initialize()
Definition: TTTrack_TrackWord.cc:359
TTTrack_TrackWord::valLSBD0
float valLSBD0
Definition: TTTrack_TrackWord.h:179
TTTrack_TrackWord::setTrackWord
void setTrackWord(const GlobalVector &Momentum, const GlobalPoint &POCA, double Rinv, double Chi2XY, double Chi2Z, double BendChi2, unsigned int HitPattern, unsigned int iSpare)
Definition: TTTrack_TrackWord.cc:79
TTTrack_TrackWord::maxD0
const float maxD0
Definition: TTTrack_TrackWord.h:224
hgcalVFEProducer_cfi.lsb
lsb
Definition: hgcalVFEProducer_cfi.py:80
TTTrack_TrackWord::ichi2Z
unsigned int ichi2Z
Definition: TTTrack_TrackWord.h:162
TTTrack_TrackWord::maxTanl
const float maxTanl
Definition: TTTrack_TrackWord.h:222
TTTrack_TrackWord::valLSBZ0
float valLSBZ0
Definition: TTTrack_TrackWord.h:178
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
TTTrack_TrackWord::maskChi2Z
const unsigned int maskChi2Z
Definition: TTTrack_TrackWord.h:235
TTTrack_TrackWord::maxCurv
const float maxCurv
Definition: TTTrack_TrackWord.h:220
TTTrack_TrackWord::id0
unsigned int id0
Definition: TTTrack_TrackWord.h:160
TTTrack_TrackWord::NTanlBits
const unsigned int NTanlBits
Definition: TTTrack_TrackWord.h:209
TTTrack_TrackWord::nWordBits
const unsigned int nWordBits
Definition: TTTrack_TrackWord.h:240
TTTrack_TrackWord::NChi2Bits
const unsigned int NChi2Bits
Definition: TTTrack_TrackWord.h:214
TTTrack_TrackWord::iBendChi2
unsigned int iBendChi2
Definition: TTTrack_TrackWord.h:163
TTTrack_TrackWord::chi2Bins
float chi2Bins[16]
Definition: TTTrack_TrackWord.h:181
TTTrack_TrackWord::NZ0Bits
const unsigned int NZ0Bits
Definition: TTTrack_TrackWord.h:210
TTTrack_TrackWord::iz0
unsigned int iz0
Definition: TTTrack_TrackWord.h:159
TTTrack_TrackWord::maskZ0
const unsigned int maskZ0
Definition: TTTrack_TrackWord.h:233
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
TTTrack_TrackWord::maxPhi
const float maxPhi
Definition: TTTrack_TrackWord.h:221
TTTrack_TrackWord::NPhiBits
const unsigned int NPhiBits
Definition: TTTrack_TrackWord.h:208
TTTrack_TrackWord::maskSpare
const unsigned int maskSpare
Definition: TTTrack_TrackWord.h:238
TTTrack_TrackWord::Bchi2Bins
float Bchi2Bins[8]
Definition: TTTrack_TrackWord.h:183
TTTrack_TrackWord::maskTanL
const unsigned int maskTanL
Definition: TTTrack_TrackWord.h:231
TTTrack_TrackWord::NBChi2Bits
const unsigned int NBChi2Bits
Definition: TTTrack_TrackWord.h:215
TTTrack_TrackWord::iHitPattern
unsigned int iHitPattern
Definition: TTTrack_TrackWord.h:165
TTTrack_TrackWord::maskPhi
const unsigned int maskPhi
Definition: TTTrack_TrackWord.h:230
TTTrack_TrackWord::digitize_Signed
unsigned int digitize_Signed(float var, unsigned int maxBit, unsigned int minBit, float lsb)
Definition: TTTrack_TrackWord.cc:335
TTTrack_TrackWord::iphi
unsigned int iphi
Definition: TTTrack_TrackWord.h:157
TTTrack_TrackWord::maxZ0
const float maxZ0
Definition: TTTrack_TrackWord.h:223
TTTrack_TrackWord::Nchi2
unsigned int Nchi2
Definition: TTTrack_TrackWord.h:185
TTTrack_TrackWord::maskRinv
const unsigned int maskRinv
Definition: TTTrack_TrackWord.h:229
TTTrack_TrackWord::ispare
unsigned int ispare
Definition: TTTrack_TrackWord.h:164
TTTrack_TrackWord::maskChi2XY
const unsigned int maskChi2XY
Definition: TTTrack_TrackWord.h:234
TTTrack_TrackWord::iRinv
unsigned int iRinv
Definition: TTTrack_TrackWord.h:156
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
TTTrack_TrackWord::chi2ZBins
float chi2ZBins[16]
Definition: TTTrack_TrackWord.h:182
TTTrack_TrackWord::maskD0
const unsigned int maskD0
Definition: TTTrack_TrackWord.h:232
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
TTTrack_TrackWord::maskHitPat
const unsigned int maskHitPat
Definition: TTTrack_TrackWord.h:237
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TTTrack_TrackWord::itanl
unsigned int itanl
Definition: TTTrack_TrackWord.h:158
TTTrack_TrackWord::ND0Bits
const unsigned int ND0Bits
Definition: TTTrack_TrackWord.h:211
TTTrack_TrackWord::ichi2XY
unsigned int ichi2XY
Definition: TTTrack_TrackWord.h:161