CMS 3D CMS Logo

L1TrackJetClustering.h
Go to the documentation of this file.
1 #ifndef L1Trigger_L1TTrackMatch_L1TrackJetClustering_HH
2 #define L1Trigger_L1TTrackMatch_L1TrackJetClustering_HH
3 #include <iostream>
4 #include <fstream>
5 #include <cmath>
6 #include <cstdlib>
7 #include <string>
8 #include <cstdlib>
13 
14 namespace l1ttrackjet {
15  //For precision studies
16  const unsigned int PT_INTPART_BITS{9};
17  const unsigned int ETA_INTPART_BITS{3};
18  const unsigned int kExtraGlobalPhiBit{4};
19 
20  static constexpr int kEtaWordLength = 15;
21  static constexpr int kPhiWordLength = 12;
22 
23  //Constants used for jet clustering in eta direction
24  static constexpr int kThirteenBitMask = 0b1111111111111;
25  static constexpr int kEtaFineBinEdge1 = 0b0011001100110;
26  static constexpr int kEtaFineBinEdge2 = 0b0110011001100;
27  static constexpr int kEtaFineBinEdge3 = 0b1001100110010;
28  static constexpr int kEtaFineBinEdge4 = 0b1100110011000;
29 
30  //Constants used for jet clustering in phi direction
31  static constexpr int kTwelveBitMask = 0b011111111111;
32  static constexpr int kPhiBinHalfWidth = 0b000100101111;
33  static constexpr int kNumPhiBins = 27;
34  static constexpr int kPhiBinZeroOffset = 12; // phi bin zero offset between firmware and emulator
35 
36  typedef ap_ufixed<TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, PT_INTPART_BITS, AP_TRN, AP_SAT> pt_intern;
37  typedef ap_fixed<TTTrack_TrackWord::TrackBitWidths::kTanlSize, ETA_INTPART_BITS, AP_TRN, AP_SAT> glbeta_intern;
38  typedef ap_int<TTTrack_TrackWord::TrackBitWidths::kPhiSize + kExtraGlobalPhiBit> glbphi_intern;
39  typedef ap_int<TTTrack_TrackWord::TrackBitWidths::kZ0Size> z0_intern; // 40cm / 0.1
40  typedef ap_uint<TTTrack_TrackWord::TrackBitWidths::kD0Size> d0_intern;
41 
42  inline const unsigned int DoubleToBit(double value, unsigned int maxBits, double step) {
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  }
51  inline const double BitToDouble(unsigned int bits, unsigned int maxBits, double step) {
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  }
60 
61  // eta/phi clusters - simulation
62  struct EtaPhiBin {
63  float pTtot;
64  int ntracks;
65  int nxtracks;
66  bool used;
67  float phi; //average phi value (halfway b/t min and max)
68  float eta; //average eta value
69  std::vector<unsigned int> trackidx;
70  };
71  // z bin struct - simulation (used if z bin are many)
72  struct MaxZBin {
73  int znum; //Numbered from 0 to nzbins (16, 32, or 64) in order
74  int nclust; //number of clusters in this bin
75  float zbincenter;
76  std::vector<EtaPhiBin> clusters; //list of all the clusters in this bin
77  float ht; //sum of all cluster pTs--only the zbin with the maximum ht is stored
78  };
79 
80  // eta/phi clusters - emulation
85  bool used;
86  glbphi_intern phi; //average phi value (halfway b/t min and max)
87  glbeta_intern eta; //average eta value
88  std::vector<unsigned int> trackidx;
89  };
90 
91  // z bin struct - emulation (used if z bin are many)
93  int znum; //Numbered from 0 to nzbins (16, 32, or 64) in order
94  int nclust; //number of clusters in this bin
96  std::vector<TrackJetEmulationEtaPhiBin> clusters; //list of all the clusters in this bin
97  pt_intern ht; //sum of all cluster pTs--only the zbin with the maximum ht is stored
98  };
99 
100  // track quality cuts
101  inline bool TrackQualitySelection(int trk_nstub,
102  double trk_chi2,
103  double trk_bendchi2,
104  double nStubs4PromptBend_,
105  double nStubs5PromptBend_,
106  double nStubs4PromptChi2_,
107  double nStubs5PromptChi2_,
108  double nStubs4DisplacedBend_,
109  double nStubs5DisplacedBend_,
110  double nStubs4DisplacedChi2_,
111  double nStubs5DisplacedChi2_,
112  bool displaced_) {
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  }
131 
132  // Eta binning following the hardware logic
133  inline unsigned int eta_bin_firmwareStyle(int eta_word) {
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  }
165 
166  // Phi binning following the hardware logic
167  inline unsigned int phi_bin_firmwareStyle(int phi_sector_raw, int phi_word) {
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  }
202 
203  // L1 clustering (in eta)
204  template <typename T, typename Pt, typename Eta, typename Phi>
205  inline std::vector<T> L1_clustering(T *phislice, int etaBins_, Eta etaStep_) {
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  }
294 
295  // Fill L2 clusters (helper function)
296  template <typename T, typename Pt>
297  inline void Fill_L2Cluster(T &bin, Pt pt, int ntrk, int ndtrk, std::vector<unsigned int> trkidx) {
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  }
304 
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  }
318 
319  inline float DPhi(float phi1, float phi2) {
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  }
327 
328  // L2 clustering (in phi)
329  template <typename T, typename Pt, typename Eta, typename Phi>
330  inline std::vector<T> L2_clustering(std::vector<std::vector<T> > &L1clusters,
331  int phiBins_,
332  Phi phiStep_,
333  Eta etaStep_) {
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  }
451 } // namespace l1ttrackjet
452 #endif
ap_uint< TTTrack_TrackWord::TrackBitWidths::kD0Size > d0_intern
const unsigned int kExtraGlobalPhiBit
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_)
const unsigned int DoubleToBit(double value, unsigned int maxBits, double step)
static constexpr int kPhiBinZeroOffset
std::vector< unsigned int > trackidx
const unsigned int ETA_INTPART_BITS
static constexpr int kEtaFineBinEdge4
const unsigned int PT_INTPART_BITS
static constexpr int kPhiBinHalfWidth
static constexpr int kNumPhiBins
const double BitToDouble(unsigned int bits, unsigned int maxBits, double step)
ap_fixed< TTTrack_TrackWord::TrackBitWidths::kTanlSize, ETA_INTPART_BITS, AP_TRN, AP_SAT > glbeta_intern
ap_ufixed< TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, PT_INTPART_BITS, AP_TRN, AP_SAT > pt_intern
static constexpr int kEtaFineBinEdge3
std::vector< EtaPhiBin > clusters
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr int kThirteenBitMask
ap_int< TTTrack_TrackWord::TrackBitWidths::kZ0Size > z0_intern
unsigned int eta_bin_firmwareStyle(int eta_word)
Definition: value.py:1
std::vector< TrackJetEmulationEtaPhiBin > clusters
ap_uint< kXtSize > nx_t
Definition: TkJetWord.h:63
unsigned int phi_bin_firmwareStyle(int phi_sector_raw, int phi_word)
#define M_PI
glbphi_intern DPhi(glbphi_intern phi1, glbphi_intern phi2)
void Fill_L2Cluster(T &bin, Pt pt, int ntrk, int ndtrk, std::vector< unsigned int > trkidx)
static constexpr int kEtaFineBinEdge2
ap_int< TTTrack_TrackWord::TrackBitWidths::kPhiSize+kExtraGlobalPhiBit > glbphi_intern
double b
Definition: hdecay.h:120
static constexpr int kEtaFineBinEdge1
static constexpr double stepPhi0
static constexpr int kEtaWordLength
static constexpr int kTwelveBitMask
ap_uint< kNtSize > nt_t
Definition: TkJetWord.h:62
double a
Definition: hdecay.h:121
float x
std::vector< T > L2_clustering(std::vector< std::vector< T > > &L1clusters, int phiBins_, Phi phiStep_, Eta etaStep_)
static constexpr int kPhiWordLength
step
Definition: StallMonitor.cc:83
std::vector< T > L1_clustering(T *phislice, int etaBins_, Eta etaStep_)
long double T