CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Typedefs | Functions | Variables
l1ttrackjet Namespace Reference

Classes

struct  EtaPhiBin
 
struct  MaxZBin
 
struct  TrackJetEmulationEtaPhiBin
 
struct  TrackJetEmulationMaxZBin
 

Typedefs

typedef ap_uint< TTTrack_TrackWord::TrackBitWidths::kD0Size > d0_intern
 
typedef ap_fixed< TTTrack_TrackWord::TrackBitWidths::kTanlSize, ETA_INTPART_BITS, AP_TRN, AP_SAT > glbeta_intern
 
typedef ap_int< TTTrack_TrackWord::TrackBitWidths::kPhiSize+kExtraGlobalPhiBitglbphi_intern
 
typedef ap_ufixed< TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, PT_INTPART_BITS, AP_TRN, AP_SAT > pt_intern
 
typedef ap_int< TTTrack_TrackWord::TrackBitWidths::kZ0Size > z0_intern
 

Functions

const double BitToDouble (unsigned int bits, unsigned int maxBits, double step)
 
const unsigned int DoubleToBit (double value, unsigned int maxBits, double step)
 
glbphi_intern DPhi (glbphi_intern phi1, glbphi_intern phi2)
 
float DPhi (float phi1, float phi2)
 
unsigned int eta_bin_firmwareStyle (int eta_word)
 
template<typename T , typename Pt >
void Fill_L2Cluster (T &bin, Pt pt, int ntrk, int ndtrk, std::vector< unsigned int > trkidx)
 
template<typename T , typename Pt , typename Eta , typename Phi >
std::vector< TL1_clustering (T *phislice, int etaBins_, Eta etaStep_)
 
template<typename T , typename Pt , typename Eta , typename Phi >
std::vector< TL2_clustering (std::vector< std::vector< T > > &L1clusters, int phiBins_, Phi phiStep_, Eta etaStep_)
 
unsigned int phi_bin_firmwareStyle (int phi_sector_raw, int phi_word)
 
bool TrackQualitySelection (int trk_nstub, double trk_chi2, double trk_bendchi2, double nStubs4PromptBend_, double nStubs5PromptBend_, double nStubs4PromptChi2_, double nStubs5PromptChi2_, double nStubs4DisplacedBend_, double nStubs5DisplacedBend_, double nStubs4DisplacedChi2_, double nStubs5DisplacedChi2_, bool displaced_)
 

Variables

const unsigned int ETA_INTPART_BITS {3}
 
static constexpr int kEtaFineBinEdge1 = 0b0011001100110
 
static constexpr int kEtaFineBinEdge2 = 0b0110011001100
 
static constexpr int kEtaFineBinEdge3 = 0b1001100110010
 
static constexpr int kEtaFineBinEdge4 = 0b1100110011000
 
static constexpr int kEtaWordLength = 15
 
const unsigned int kExtraGlobalPhiBit {4}
 
static constexpr int kNumPhiBins = 27
 
static constexpr int kPhiBinHalfWidth = 0b000100101111
 
static constexpr int kPhiBinZeroOffset = 12
 
static constexpr int kPhiWordLength = 12
 
static constexpr int kThirteenBitMask = 0b1111111111111
 
static constexpr int kTwelveBitMask = 0b011111111111
 
const unsigned int PT_INTPART_BITS {9}
 

Typedef Documentation

◆ d0_intern

typedef ap_uint<TTTrack_TrackWord::TrackBitWidths::kD0Size> l1ttrackjet::d0_intern

Definition at line 40 of file L1TrackJetClustering.h.

◆ glbeta_intern

typedef ap_fixed<TTTrack_TrackWord::TrackBitWidths::kTanlSize, ETA_INTPART_BITS, AP_TRN, AP_SAT> l1ttrackjet::glbeta_intern

Definition at line 37 of file L1TrackJetClustering.h.

◆ glbphi_intern

typedef ap_int<TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit> l1ttrackjet::glbphi_intern

Definition at line 38 of file L1TrackJetClustering.h.

◆ pt_intern

typedef ap_ufixed<TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, PT_INTPART_BITS, AP_TRN, AP_SAT> l1ttrackjet::pt_intern

Definition at line 36 of file L1TrackJetClustering.h.

◆ z0_intern

typedef ap_int<TTTrack_TrackWord::TrackBitWidths::kZ0Size> l1ttrackjet::z0_intern

Definition at line 39 of file L1TrackJetClustering.h.

Function Documentation

◆ BitToDouble()

const double l1ttrackjet::BitToDouble ( unsigned int  bits,
unsigned int  maxBits,
double  step 
)
inline

Definition at line 51 of file L1TrackJetClustering.h.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits.

Referenced by L1TrackTripletEmulatorProducer::FloatPhiFromBits(), L1TrackTripletEmulatorProducer::FloatZ0FromBits(), and L1TrackJetEmulatorProducer::produce().

51  {
52  int isign = 1;
53  unsigned int digitized_maximum = (1 << maxBits) - 1;
54  if (bits & (1 << (maxBits - 1))) { // check the sign
55  isign = -1;
56  bits = (1 << (maxBits + 1)) - bits;
57  }
58  return (double(bits & digitized_maximum) + 0.5) * step * isign;
59  }
step
Definition: StallMonitor.cc:83

◆ DoubleToBit()

const unsigned int l1ttrackjet::DoubleToBit ( double  value,
unsigned int  maxBits,
double  step 
)
inline

Definition at line 42 of file L1TrackJetClustering.h.

References funct::abs().

Referenced by DPhi(), L1TrackTripletEmulatorProducer::FloatPhiFromBits(), L1TrackJetEmulatorProducer::L1TrackJetEmulatorProducer(), L1TrackTripletEmulatorProducer::produce(), and L1TrackJetEmulatorProducer::produce().

42  {
43  unsigned int digitized_value = std::floor(std::abs(value) / step);
44  unsigned int digitized_maximum = (1 << (maxBits - 1)) - 1; // The remove 1 bit from nBits to account for the sign
45  if (digitized_value > digitized_maximum)
46  digitized_value = digitized_maximum;
47  if (value < 0)
48  digitized_value = (1 << maxBits) - digitized_value; // two's complement encoding
49  return digitized_value;
50  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: value.py:1
step
Definition: StallMonitor.cc:83

◆ DPhi() [1/2]

glbphi_intern l1ttrackjet::DPhi ( glbphi_intern  phi1,
glbphi_intern  phi2 
)
inline

Definition at line 305 of file L1TrackJetClustering.h.

References DoubleToBit(), kExtraGlobalPhiBit, M_PI, TTTrack_TrackWord::stepPhi0, and x.

Referenced by L2_clustering().

305  {
306  glbphi_intern x = phi1 - phi2;
307  if (x >= DoubleToBit(
308  M_PI, TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit, TTTrack_TrackWord::stepPhi0))
309  x -= DoubleToBit(
310  2 * M_PI, TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit, TTTrack_TrackWord::stepPhi0);
311  if (x < DoubleToBit(-1 * M_PI,
312  TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit,
314  x += DoubleToBit(
315  2 * M_PI, TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit, TTTrack_TrackWord::stepPhi0);
316  return x;
317  }
const unsigned int kExtraGlobalPhiBit
const unsigned int DoubleToBit(double value, unsigned int maxBits, double step)
#define M_PI
ap_int< TTTrack_TrackWord::TrackBitWidths::kPhiSize+kExtraGlobalPhiBit > glbphi_intern
static constexpr double stepPhi0
float x

◆ DPhi() [2/2]

float l1ttrackjet::DPhi ( float  phi1,
float  phi2 
)
inline

Definition at line 319 of file L1TrackJetClustering.h.

References M_PI, and x.

319  {
320  float x = phi1 - phi2;
321  if (x >= M_PI)
322  x -= 2 * M_PI;
323  if (x < -1 * M_PI)
324  x += 2 * M_PI;
325  return x;
326  }
#define M_PI
float x

◆ eta_bin_firmwareStyle()

unsigned int l1ttrackjet::eta_bin_firmwareStyle ( int  eta_word)
inline

Definition at line 133 of file L1TrackJetClustering.h.

References dqmiolumiharvest::j, kEtaFineBinEdge1, kEtaFineBinEdge2, kEtaFineBinEdge3, kEtaFineBinEdge4, kEtaWordLength, and kThirteenBitMask.

Referenced by L1TrackJetEmulatorProducer::produce().

133  {
134  //Function that reads in 15-bit eta word (in two's complement) and returns the index of eta bin in which it belongs
135  //Logic follows exactly according to the firmware
136  //We will first determine if eta is pos/neg from the first bit. Each half of the grid is then split into four coarse bins. Bits 2&3 determine which coarse bin to assign
137  //The coarse bins are split into 5 fine bins, final 13 bits determine which of these coarse bins this track needs to assign
138  int eta_coarse = 0;
139  int eta_fine = 0;
140 
141  if (eta_word & (1 << kEtaWordLength)) { //If eta is negative (first/leftmost bit is 1)
142  //Second and third bits contain information about which of four coarse bins
143  eta_coarse = 5 * ((eta_word & (3 << (kEtaWordLength - 2))) >> (kEtaWordLength - 2));
144  } else { //else eta is positive (first/leftmost bit is 0)
145  eta_coarse = 5 * (4 + ((eta_word & (3 << (kEtaWordLength - 2))) >> (kEtaWordLength - 2)));
146  }
147 
148  //Now get the fine bin index. The numbers correspond to the decimal representation of fine bin edges in binary
149  int j = eta_word & kThirteenBitMask;
150  if (j < kEtaFineBinEdge1)
151  eta_fine = 0;
152  else if (j < kEtaFineBinEdge2)
153  eta_fine = 1;
154  else if (j < kEtaFineBinEdge3)
155  eta_fine = 2;
156  else if (j < kEtaFineBinEdge4)
157  eta_fine = 3;
158  else
159  eta_fine = 4;
160 
161  //Final eta bin is coarse bin index + fine bin index, subtract 8 to make eta_bin at eta=-2.4 have index=0
162  int eta_ = (eta_coarse + eta_fine) - 8;
163  return eta_;
164  }
static constexpr int kEtaFineBinEdge4
static constexpr int kEtaFineBinEdge3
static constexpr int kThirteenBitMask
static constexpr int kEtaFineBinEdge2
static constexpr int kEtaFineBinEdge1
static constexpr int kEtaWordLength

◆ Fill_L2Cluster()

template<typename T , typename Pt >
void l1ttrackjet::Fill_L2Cluster ( T bin,
Pt  pt,
int  ntrk,
int  ndtrk,
std::vector< unsigned int >  trkidx 
)
inline

Definition at line 297 of file L1TrackJetClustering.h.

References newFWLiteAna::bin, and DiDispStaMuonMonitor_cfi::pt.

297  {
298  bin.pTtot += pt;
299  bin.ntracks += ntrk;
300  bin.nxtracks += ndtrk;
301  for (unsigned int itrk = 0; itrk < trkidx.size(); itrk++)
302  bin.trackidx.push_back(trkidx[itrk]);
303  }

◆ L1_clustering()

template<typename T , typename Pt , typename Eta , typename Phi >
std::vector<T> l1ttrackjet::L1_clustering ( T phislice,
int  etaBins_,
Eta  etaStep_ 
)
inline

Definition at line 205 of file L1TrackJetClustering.h.

References bsc_activity_cfg::clusters, PVValHelper::eta, visualization-live-secondInstance_cfg::m, and DeadROCCounter::nclust.

205  {
206  std::vector<T> clusters;
207  // Find eta bin with maxpT, make center of cluster, add neighbors if not already used
208  int nclust = 0;
209 
210  // get tracks in eta bins in increasing eta order
211  for (int etabin = 0; etabin < etaBins_; ++etabin) {
212  Pt my_pt = 0;
213  Pt previousbin_pt = 0;
214  Pt nextbin_pt = 0;
215  Pt nextbin2_pt = 0;
216 
217  // skip (already) used tracks
218  if (phislice[etabin].used)
219  continue;
220 
221  my_pt = phislice[etabin].pTtot;
222  if (my_pt == 0)
223  continue;
224 
225  //get previous bin pT
226  if (etabin > 0 && !phislice[etabin - 1].used)
227  previousbin_pt = phislice[etabin - 1].pTtot;
228 
229  // get next bins pt
230  if (etabin < etaBins_ - 1 && !phislice[etabin + 1].used) {
231  nextbin_pt = phislice[etabin + 1].pTtot;
232  if (etabin < etaBins_ - 2 && !phislice[etabin + 2].used) {
233  nextbin2_pt = phislice[etabin + 2].pTtot;
234  }
235  }
236  // check if pT of current cluster is higher than neighbors
237  if (my_pt < previousbin_pt || my_pt <= nextbin_pt) {
238  // if unused pT in the left neighbor, spit it out as a cluster
239  if (previousbin_pt > 0) {
240  clusters.push_back(phislice[etabin - 1]);
241  phislice[etabin - 1].used = true;
242  nclust++;
243  }
244  continue; //if it is not the local max pT skip
245  }
246  // here reach only unused local max clusters
247  clusters.push_back(phislice[etabin]);
248  phislice[etabin].used = true; //if current bin a cluster
249  if (previousbin_pt > 0) {
250  clusters[nclust].pTtot += previousbin_pt;
251  clusters[nclust].ntracks += phislice[etabin - 1].ntracks;
252  clusters[nclust].nxtracks += phislice[etabin - 1].nxtracks;
253  for (unsigned int itrk = 0; itrk < phislice[etabin - 1].trackidx.size(); itrk++)
254  clusters[nclust].trackidx.push_back(phislice[etabin - 1].trackidx[itrk]);
255  }
256 
257  if (my_pt >= nextbin2_pt && nextbin_pt > 0) {
258  clusters[nclust].pTtot += nextbin_pt;
259  clusters[nclust].ntracks += phislice[etabin + 1].ntracks;
260  clusters[nclust].nxtracks += phislice[etabin + 1].nxtracks;
261  for (unsigned int itrk = 0; itrk < phislice[etabin + 1].trackidx.size(); itrk++)
262  clusters[nclust].trackidx.push_back(phislice[etabin + 1].trackidx[itrk]);
263  phislice[etabin + 1].used = true;
264  }
265 
266  nclust++;
267 
268  } // for each etabin
269 
270  // Merge close-by clusters
271  for (int m = 0; m < nclust - 1; ++m) {
272  if (((clusters[m + 1].eta - clusters[m].eta) < (3 * etaStep_) / 2) &&
273  (-(3 * etaStep_) / 2 < (clusters[m + 1].eta - clusters[m].eta))) {
274  if (clusters[m + 1].pTtot > clusters[m].pTtot) {
275  clusters[m].eta = clusters[m + 1].eta;
276  }
277  clusters[m].pTtot += clusters[m + 1].pTtot;
278  clusters[m].ntracks += clusters[m + 1].ntracks; // total ntrk
279  clusters[m].nxtracks += clusters[m + 1].nxtracks; // total ndisp
280  for (unsigned int itrk = 0; itrk < clusters[m + 1].trackidx.size(); itrk++)
281  clusters[m].trackidx.push_back(clusters[m + 1].trackidx[itrk]);
282 
283  // if remove the merged cluster - all the others must be closer to 0
284  for (int m1 = m + 1; m1 < nclust - 1; ++m1)
285  clusters[m1] = clusters[m1 + 1];
286 
287  clusters.erase(clusters.begin() + nclust);
288  nclust--;
289  } // end if for cluster merging
290  } // end for (m) loop
291 
292  return clusters;
293  }

◆ L2_clustering()

template<typename T , typename Pt , typename Eta , typename Phi >
std::vector<T> l1ttrackjet::L2_clustering ( std::vector< std::vector< T > > &  L1clusters,
int  phiBins_,
Phi  phiStep_,
Eta  etaStep_ 
)
inline

Definition at line 330 of file L1TrackJetClustering.h.

References a, b, bsc_activity_cfg::clusters, DPhi(), relativeConstraints::empty, PVValHelper::eta, visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, DeadROCCounter::nclust, and jetUpdater_cfi::sort.

333  {
334  std::vector<T> clusters;
335  for (int phibin = 0; phibin < phiBins_; ++phibin) { //Find eta-phibin with highest pT
336  if (L1clusters[phibin].empty())
337  continue;
338 
339  // sort L1 clusters max -> min
340  sort(L1clusters[phibin].begin(), L1clusters[phibin].end(), [](T &a, T &b) { return a.pTtot > b.pTtot; });
341 
342  for (unsigned int imax = 0; imax < L1clusters[phibin].size(); ++imax) {
343  if (L1clusters[phibin][imax].used)
344  continue;
345  Pt pt_current = L1clusters[phibin][imax].pTtot; //current cluster (pt0)
346  Pt pt_next = 0; // next phi bin (pt1)
347  Pt pt_next2 = 0; // next to next phi bin2 (pt2)
348  int trk1 = 0;
349  int trk2 = 0;
350  int tdtrk1 = 0;
351  int tdtrk2 = 0;
352  std::vector<unsigned int> trkidx1;
353  std::vector<unsigned int> trkidx2;
354  clusters.push_back(L1clusters[phibin][imax]);
355 
356  L1clusters[phibin][imax].used = true;
357 
358  // if we are in the last phi bin, dont check phi+1 phi+2
359  if (phibin == phiBins_ - 1)
360  continue;
361 
362  std::vector<unsigned int> used_already; //keep phi+1 clusters that have been used
363  for (unsigned int icluster = 0; icluster < L1clusters[phibin + 1].size(); ++icluster) {
364  if (L1clusters[phibin + 1][icluster].used)
365  continue;
366 
367  if (((L1clusters[phibin + 1][icluster].eta - L1clusters[phibin][imax].eta) > (3 * etaStep_) / 2) ||
368  ((L1clusters[phibin + 1][icluster].eta - L1clusters[phibin][imax].eta) < -(3 * etaStep_) / 2))
369  continue;
370 
371  pt_next += L1clusters[phibin + 1][icluster].pTtot;
372  trk1 += L1clusters[phibin + 1][icluster].ntracks;
373  tdtrk1 += L1clusters[phibin + 1][icluster].nxtracks;
374 
375  for (unsigned int itrk = 0; itrk < L1clusters[phibin + 1][icluster].trackidx.size(); itrk++)
376  trkidx1.push_back(L1clusters[phibin + 1][icluster].trackidx[itrk]);
377  used_already.push_back(icluster);
378  }
379 
380  if (pt_next < pt_current) { // if pt1<pt1, merge both clusters
381  Fill_L2Cluster<T, Pt>(clusters[clusters.size() - 1], pt_next, trk1, tdtrk1, trkidx1);
382  for (unsigned int iused : used_already)
383  L1clusters[phibin + 1][iused].used = true;
384  continue;
385  }
386  // if phi = next to last bin there is no "next to next"
387  if (phibin == phiBins_ - 2) {
388  Fill_L2Cluster<T, Pt>(clusters[clusters.size() - 1], pt_next, trk1, tdtrk1, trkidx1);
389  clusters[clusters.size() - 1].phi = L1clusters[phibin + 1][used_already[0]].phi;
390  for (unsigned int iused : used_already)
391  L1clusters[phibin + 1][iused].used = true;
392  continue;
393  }
394  std::vector<int> used_already2; //keep used clusters in phi+2
395  for (unsigned int icluster = 0; icluster < L1clusters[phibin + 2].size(); ++icluster) {
396  if (L1clusters[phibin + 2][icluster].used)
397  continue;
398  if (((L1clusters[phibin + 2][icluster].eta - L1clusters[phibin][imax].eta) > (3 * etaStep_) / 2) ||
399  ((L1clusters[phibin + 2][icluster].eta - L1clusters[phibin][imax].eta) < -(3 * etaStep_) / 2))
400  continue;
401  pt_next2 += L1clusters[phibin + 2][icluster].pTtot;
402  trk2 += L1clusters[phibin + 2][icluster].ntracks;
403  tdtrk2 += L1clusters[phibin + 2][icluster].nxtracks;
404 
405  for (unsigned int itrk = 0; itrk < L1clusters[phibin + 2][icluster].trackidx.size(); itrk++)
406  trkidx2.push_back(L1clusters[phibin + 2][icluster].trackidx[itrk]);
407  used_already2.push_back(icluster);
408  }
409  if (pt_next2 < pt_next) {
410  std::vector<unsigned int> trkidx_both;
411  trkidx_both.reserve(trkidx1.size() + trkidx2.size());
412  trkidx_both.insert(trkidx_both.end(), trkidx1.begin(), trkidx1.end());
413  trkidx_both.insert(trkidx_both.end(), trkidx2.begin(), trkidx2.end());
414  Fill_L2Cluster<T, Pt>(
415  clusters[clusters.size() - 1], pt_next + pt_next2, trk1 + trk2, tdtrk1 + tdtrk2, trkidx_both);
416  clusters[clusters.size() - 1].phi = L1clusters[phibin + 1][used_already[0]].phi;
417  for (unsigned int iused : used_already)
418  L1clusters[phibin + 1][iused].used = true;
419  for (unsigned int iused : used_already2)
420  L1clusters[phibin + 2][iused].used = true;
421  }
422  } // for each L1 cluster
423  } // for each phibin
424 
425  int nclust = clusters.size();
426 
427  // merge close-by clusters
428  for (int m = 0; m < nclust - 1; ++m) {
429  for (int n = m + 1; n < nclust; ++n) {
430  if (clusters[n].eta != clusters[m].eta)
431  continue;
432  if ((DPhi(clusters[n].phi, clusters[m].phi) > (3 * phiStep_) / 2) ||
433  (DPhi(clusters[n].phi, clusters[m].phi) < -(3 * phiStep_) / 2))
434  continue;
435  if (clusters[n].pTtot > clusters[m].pTtot)
436  clusters[m].phi = clusters[n].phi;
437  clusters[m].pTtot += clusters[n].pTtot;
438  clusters[m].ntracks += clusters[n].ntracks;
439  clusters[m].nxtracks += clusters[n].nxtracks;
440  for (unsigned int itrk = 0; itrk < clusters[n].trackidx.size(); itrk++)
441  clusters[m].trackidx.push_back(clusters[n].trackidx[itrk]);
442  for (int m1 = n; m1 < nclust - 1; ++m1)
443  clusters[m1] = clusters[m1 + 1];
444  clusters.erase(clusters.begin() + nclust);
445 
446  nclust--;
447  } // end of n-loop
448  } // end of m-loop
449  return clusters;
450  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
long double T
float DPhi(float phi1, float phi2)

◆ phi_bin_firmwareStyle()

unsigned int l1ttrackjet::phi_bin_firmwareStyle ( int  phi_sector_raw,
int  phi_word 
)
inline

Definition at line 167 of file L1TrackJetClustering.h.

References kNumPhiBins, kPhiBinHalfWidth, kPhiBinZeroOffset, kPhiWordLength, and kTwelveBitMask.

Referenced by L1TrackJetEmulatorProducer::produce().

167  {
168  //Function that reads in decimal integers phi_sector_raw and phi_word and returns the index of phi bin in which it belongs
169  //phi_sector_raw is integer 0-8 correspoding to one of 9 phi sectors
170  //phi_word is 12 bit word representing the phi value measured w.r.t the center of the sector
171 
172  int phi_coarse = 3 * phi_sector_raw; //phi_coarse is index of phi coarse binning (sector edges)
173  int phi_fine = 0; //phi_fine is index of fine bin inside sectors. Each sector contains 3 fine bins
174 
175  //Determine fine bin. First bit is sign, next 11 bits determine fine bin
176  //303 is distance from 0 to first fine bin edge
177  //2047 is eleven 1's, use the &2047 to extract leftmost 11 bits.
178 
179  //The allowed range for phi goes further than the edges of bin 0 or 2 (bit value 909). There's an apparent risk of phi being > 909, however this will always mean the track is in the next link (i.e. track beyond bin 2 in this link means track is actually in bin 0 of adjacent link)
180 
181  if (phi_word & (1 << (kPhiWordLength - 1))) { //if phi is negative (first bit 1)
182  //Since negative, we 'flip' the phi word, then check if it is in fine bin 0 or 1
183  if ((kTwelveBitMask - (phi_word & kTwelveBitMask)) > kPhiBinHalfWidth) {
184  phi_fine = 0;
185  } else if ((kTwelveBitMask - (phi_word & kTwelveBitMask)) < kPhiBinHalfWidth) {
186  phi_fine = 1;
187  }
188  } else { //else phi is positive (first bit 0)
189  //positive phi, no 'flip' necessary. Just check if in fine bin 1 or 2
190  if ((phi_word & kTwelveBitMask) < kPhiBinHalfWidth) {
191  phi_fine = 1;
192  } else if ((phi_word & kTwelveBitMask) > kPhiBinHalfWidth) {
193  phi_fine = 2;
194  }
195  }
196 
197  // Final operation is a shift by pi (half a grid) to make bin at index=0 at -pi
198  int phi_bin_ = (phi_coarse + phi_fine + kPhiBinZeroOffset) % kNumPhiBins;
199 
200  return phi_bin_;
201  }
static constexpr int kPhiBinZeroOffset
static constexpr int kPhiBinHalfWidth
static constexpr int kNumPhiBins
static constexpr int kTwelveBitMask
static constexpr int kPhiWordLength

◆ TrackQualitySelection()

bool l1ttrackjet::TrackQualitySelection ( int  trk_nstub,
double  trk_chi2,
double  trk_bendchi2,
double  nStubs4PromptBend_,
double  nStubs5PromptBend_,
double  nStubs4PromptChi2_,
double  nStubs5PromptChi2_,
double  nStubs4DisplacedBend_,
double  nStubs5DisplacedBend_,
double  nStubs4DisplacedChi2_,
double  nStubs5DisplacedChi2_,
bool  displaced_ 
)
inline

Definition at line 101 of file L1TrackJetClustering.h.

References run3scouting_cff::trk_chi2.

112  {
113  bool PassQuality = false;
114  if (!displaced_) {
115  if (trk_nstub == 4 && trk_bendchi2 < nStubs4PromptBend_ &&
116  trk_chi2 < nStubs4PromptChi2_) // 4 stubs are the lowest track quality and have different cuts
117  PassQuality = true;
118  if (trk_nstub > 4 && trk_bendchi2 < nStubs5PromptBend_ &&
119  trk_chi2 < nStubs5PromptChi2_) // above 4 stubs diffent selection imposed (genrally looser)
120  PassQuality = true;
121  } else {
122  if (trk_nstub == 4 && trk_bendchi2 < nStubs4DisplacedBend_ &&
123  trk_chi2 < nStubs4DisplacedChi2_) // 4 stubs are the lowest track quality and have different cuts
124  PassQuality = true;
125  if (trk_nstub > 4 && trk_bendchi2 < nStubs5DisplacedBend_ &&
126  trk_chi2 < nStubs5DisplacedChi2_) // above 4 stubs diffent selection imposed (genrally looser)
127  PassQuality = true;
128  }
129  return PassQuality;
130  }

Variable Documentation

◆ ETA_INTPART_BITS

const unsigned int l1ttrackjet::ETA_INTPART_BITS {3}

Definition at line 17 of file L1TrackJetClustering.h.

◆ kEtaFineBinEdge1

constexpr int l1ttrackjet::kEtaFineBinEdge1 = 0b0011001100110
static

Definition at line 25 of file L1TrackJetClustering.h.

Referenced by eta_bin_firmwareStyle().

◆ kEtaFineBinEdge2

constexpr int l1ttrackjet::kEtaFineBinEdge2 = 0b0110011001100
static

Definition at line 26 of file L1TrackJetClustering.h.

Referenced by eta_bin_firmwareStyle().

◆ kEtaFineBinEdge3

constexpr int l1ttrackjet::kEtaFineBinEdge3 = 0b1001100110010
static

Definition at line 27 of file L1TrackJetClustering.h.

Referenced by eta_bin_firmwareStyle().

◆ kEtaFineBinEdge4

constexpr int l1ttrackjet::kEtaFineBinEdge4 = 0b1100110011000
static

Definition at line 28 of file L1TrackJetClustering.h.

Referenced by eta_bin_firmwareStyle().

◆ kEtaWordLength

constexpr int l1ttrackjet::kEtaWordLength = 15
static

Definition at line 20 of file L1TrackJetClustering.h.

Referenced by eta_bin_firmwareStyle().

◆ kExtraGlobalPhiBit

const unsigned int l1ttrackjet::kExtraGlobalPhiBit {4}

◆ kNumPhiBins

constexpr int l1ttrackjet::kNumPhiBins = 27
static

Definition at line 33 of file L1TrackJetClustering.h.

Referenced by phi_bin_firmwareStyle().

◆ kPhiBinHalfWidth

constexpr int l1ttrackjet::kPhiBinHalfWidth = 0b000100101111
static

Definition at line 32 of file L1TrackJetClustering.h.

Referenced by phi_bin_firmwareStyle().

◆ kPhiBinZeroOffset

constexpr int l1ttrackjet::kPhiBinZeroOffset = 12
static

Definition at line 34 of file L1TrackJetClustering.h.

Referenced by phi_bin_firmwareStyle().

◆ kPhiWordLength

constexpr int l1ttrackjet::kPhiWordLength = 12
static

Definition at line 21 of file L1TrackJetClustering.h.

Referenced by phi_bin_firmwareStyle().

◆ kThirteenBitMask

constexpr int l1ttrackjet::kThirteenBitMask = 0b1111111111111
static

Definition at line 24 of file L1TrackJetClustering.h.

Referenced by eta_bin_firmwareStyle().

◆ kTwelveBitMask

constexpr int l1ttrackjet::kTwelveBitMask = 0b011111111111
static

Definition at line 31 of file L1TrackJetClustering.h.

Referenced by phi_bin_firmwareStyle().

◆ PT_INTPART_BITS

const unsigned int l1ttrackjet::PT_INTPART_BITS {9}

Definition at line 16 of file L1TrackJetClustering.h.