CMS 3D CMS Logo

List of all members | Public Member Functions
PtAssignmentEngineAux2016 Class Reference

#include <PtAssignmentEngineAux2016.h>

Inheritance diagram for PtAssignmentEngineAux2016:
PtAssignmentEngineAux

Public Member Functions

int getCLCT (int clct) const
 
int getdEta (int dEta) const
 
int getdPhiFromBin (int dPhiBin, int bits, int max=512) const
 
int getdTheta (int dTheta) const
 
float getEtaFromBin (int etaBin, int bits=5) const
 
float getEtaFromEtaInt (int etaInt, int bits=5) const
 
float getEtaFromThetaInt (int thetaInt, int bits=5) const
 
int getEtaInt (float eta, int bits=5) const
 
int getFRLUT (int sector, int station, int chamber) const
 
const int(* getModeVariables () const)[6]
 
int getNLBdPhi (int dPhi, int bits, int max=512) const
 
int getNLBdPhiBin (int dPhi, int bits, int max=512) const
 
- Public Member Functions inherited from PtAssignmentEngineAux
std::pair< int, int > getGMTCharge (int mode, const std::vector< int > &phidiffs) const
 
int getGMTDxy (float dxy) const
 
int getGMTEta (int theta, int endcap) const
 
int getGMTPhi (int phi) const
 
int getGMTPhiV2 (int phi) const
 
int getGMTPt (float pt) const
 
int getGMTPtDxy (float pt) const
 
int getGMTQuality (int mode, int theta, bool promoteMode7, int version) const
 
float getPtFromGMTPt (int gmt_pt) const
 
float getPtFromGMTPtDxy (int gmt_pt_dxy) const
 

Detailed Description

Definition at line 6 of file PtAssignmentEngineAux2016.h.

Member Function Documentation

◆ getCLCT()

int PtAssignmentEngineAux2016::getCLCT ( int  clct) const

Definition at line 249 of file PtAssignmentEngineAux2016.cc.

Referenced by PtAssignmentEngine2016::calculate_address().

249  {
250  int clct_ = 0;
251  int sign_ = 1;
252 
253  switch (clct) {
254  case 10:
255  clct_ = 0;
256  sign_ = -1;
257  break;
258  case 9:
259  clct_ = 1;
260  sign_ = 1;
261  break;
262  case 8:
263  clct_ = 1;
264  sign_ = -1;
265  break;
266  case 7:
267  clct_ = 2;
268  sign_ = 1;
269  break;
270  case 6:
271  clct_ = 2;
272  sign_ = -1;
273  break;
274  case 5:
275  clct_ = 3;
276  sign_ = 1;
277  break;
278  case 4:
279  clct_ = 3;
280  sign_ = -1;
281  break;
282  case 3:
283  clct_ = 3;
284  sign_ = 1;
285  break;
286  case 2:
287  clct_ = 3;
288  sign_ = -1;
289  break;
290  case 1:
291  clct_ = 3;
292  sign_ = -1;
293  break; //case 1: clct_ = 3; sign_ = 1; break;
294  case 0:
295  clct_ = 3;
296  sign_ = -1;
297  break;
298  default:
299  clct_ = 3;
300  sign_ = -1;
301  break;
302  }
303  return (sign_ * clct_);
304 }

◆ getdEta()

int PtAssignmentEngineAux2016::getdEta ( int  dEta) const

Definition at line 328 of file PtAssignmentEngineAux2016.cc.

References HLT_2024v10_cff::dEta.

328  {
329  int dEta_ = 0;
330 
331  if (dEta <= -5)
332  dEta_ = 0;
333  else if (dEta <= -2)
334  dEta_ = 1;
335  else if (dEta <= -1)
336  dEta_ = 2;
337  else if (dEta <= 0)
338  dEta_ = 3;
339  else if (dEta <= 1)
340  dEta_ = 4;
341  else if (dEta <= 3)
342  dEta_ = 5;
343  else if (dEta <= 6)
344  dEta_ = 6;
345  else
346  dEta_ = 7;
347  return (dEta_);
348 }

◆ getdPhiFromBin()

int PtAssignmentEngineAux2016::getdPhiFromBin ( int  dPhiBin,
int  bits,
int  max = 512 
) const

Definition at line 224 of file PtAssignmentEngineAux2016.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, photonValidator_cfi::dPhiBin, dPhiNLBMap_5bit_256Max, dPhiNLBMap_6bit_256Max, dPhiNLBMap_7bit_256Max, dPhiNLBMap_7bit_512Max, dPhiNLBMap_8bit_512Max, and SiStripPI::max.

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

224  {
225  int dPhi_ = (1 << bits) - 1;
226 
227  if (dPhiBin > (1 << bits) - 1)
228  dPhiBin = (1 << bits) - 1;
229 
230  if (max == 256) {
231  if (bits == 5)
233  if (bits == 6)
235  if (bits == 7)
237  }
238 
239  else if (max == 512) {
240  if (bits == 7)
242  if (bits == 8)
244  }
245 
246  return (dPhi_);
247 }
static const int dPhiNLBMap_7bit_512Max[128]
static const int dPhiNLBMap_5bit_256Max[32]
static const int dPhiNLBMap_7bit_256Max[128]
static const int dPhiNLBMap_6bit_256Max[64]
static const int dPhiNLBMap_8bit_512Max[256]

◆ getdTheta()

int PtAssignmentEngineAux2016::getdTheta ( int  dTheta) const

Definition at line 306 of file PtAssignmentEngineAux2016.cc.

Referenced by PtAssignmentEngine2016::calculate_address().

306  {
307  int dTheta_ = 0;
308 
309  if (dTheta <= -3)
310  dTheta_ = 0;
311  else if (dTheta <= -2)
312  dTheta_ = 1;
313  else if (dTheta <= -1)
314  dTheta_ = 2;
315  else if (dTheta <= 0)
316  dTheta_ = 3;
317  else if (dTheta <= 1)
318  dTheta_ = 4;
319  else if (dTheta <= 2)
320  dTheta_ = 5;
321  else if (dTheta <= 3)
322  dTheta_ = 6;
323  else
324  dTheta_ = 7;
325  return (dTheta_);
326 }

◆ getEtaFromBin()

float PtAssignmentEngineAux2016::getEtaFromBin ( int  etaBin,
int  bits = 5 
) const

◆ getEtaFromEtaInt()

float PtAssignmentEngineAux2016::getEtaFromEtaInt ( int  etaInt,
int  bits = 5 
) const

Definition at line 373 of file PtAssignmentEngineAux2016.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, PVValHelper::eta, and edm::shift.

Referenced by PtAssignmentEngine2016::calculate_pt_xml(), and getEtaFromBin().

373  {
374  etaInt = (etaInt > 31) ? 31 : etaInt; // 5-bit
375  etaInt = (etaInt < 0) ? 0 : etaInt;
376  bits = (bits > 5) ? 5 : bits;
377  int shift = 5 - bits;
378  etaInt <<= shift;
379  // decode 5-bit etaInt to 0.9<abs(eta)<1.6
380  float eta = ((0.5 + etaInt) * 1.6) / 32 + 0.9;
381  return eta;
382 }
static unsigned int const shift

◆ getEtaFromThetaInt()

float PtAssignmentEngineAux2016::getEtaFromThetaInt ( int  thetaInt,
int  bits = 5 
) const

Definition at line 362 of file PtAssignmentEngineAux2016.cc.

References PVValHelper::eta, dqm-mbProfile::log, funct::tan(), and theta().

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

362  {
363  thetaInt = (thetaInt > 127) ? 127 : thetaInt; // 7-bit
364  thetaInt = (thetaInt < 0) ? 0 : thetaInt;
365  float theta = thetaInt;
366  theta = (theta * 0.2874016 + 8.5) *
367  (3.14159265359 / 180); // use this version to reproduce what happened when the pT LUT was made
368  //theta = (theta*(45.0-8.5)/128. + 8.5) * M_PI/180.;
369  float eta = -std::log(std::tan(theta / 2));
370  return eta;
371 }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Geom::Theta< T > theta() const

◆ getEtaInt()

int PtAssignmentEngineAux2016::getEtaInt ( float  eta,
int  bits = 5 
) const

Definition at line 350 of file PtAssignmentEngineAux2016.cc.

References funct::abs(), ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, PVValHelper::eta, and edm::shift.

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

350  {
351  eta = std::abs(eta);
352  eta = (eta < 0.9) ? 0.9 : eta;
353  bits = (bits > 5) ? 5 : bits;
354  // encode 0.9<abs(eta)<1.6 in 5-bit (32 possible values)
355  int etaInt = ((eta - 0.9) * 32) / (1.6) - 0.5;
356  int shift = 5 - bits;
357  etaInt >>= shift;
358  etaInt = (etaInt > 31) ? 31 : etaInt;
359  return etaInt;
360 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static unsigned int const shift

◆ getFRLUT()

int PtAssignmentEngineAux2016::getFRLUT ( int  sector,
int  station,
int  chamber 
) const

◆ getModeVariables()

const int(* PtAssignmentEngineAux2016::getModeVariables ( ) )[6]

Definition at line 103 of file PtAssignmentEngineAux2016.cc.

References ModeVariables_Scheme3.

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

103 { return ModeVariables_Scheme3; }
static const int ModeVariables_Scheme3[13][6]

◆ getNLBdPhi()

int PtAssignmentEngineAux2016::getNLBdPhi ( int  dPhi,
int  bits,
int  max = 512 
) const

Definition at line 105 of file PtAssignmentEngineAux2016.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, HLT_2024v10_cff::dPhi, dPhiNLBMap_5bit_256Max, dPhiNLBMap_6bit_256Max, dPhiNLBMap_7bit_256Max, dPhiNLBMap_7bit_512Max, dPhiNLBMap_8bit_512Max, and SiStripPI::max.

105  {
106  int dPhi_ = max;
107  int sign_ = 1;
108  if (dPhi < 0)
109  sign_ = -1;
110  dPhi = sign_ * dPhi;
111 
112  if (max == 256) {
113  if (bits == 5) {
114  dPhi_ = dPhiNLBMap_5bit_256Max[(1 << bits) - 1];
115  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
116  if (dPhiNLBMap_5bit_256Max[edge] <= dPhi && dPhiNLBMap_5bit_256Max[edge + 1] > dPhi) {
117  dPhi_ = dPhiNLBMap_5bit_256Max[edge];
118  break;
119  }
120  }
121  }
122  if (bits == 6) {
123  dPhi_ = dPhiNLBMap_6bit_256Max[(1 << bits) - 1];
124  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
125  if (dPhiNLBMap_6bit_256Max[edge] <= dPhi && dPhiNLBMap_6bit_256Max[edge + 1] > dPhi) {
126  dPhi_ = dPhiNLBMap_6bit_256Max[edge];
127  break;
128  }
129  }
130  }
131  if (bits == 7) {
132  dPhi_ = dPhiNLBMap_7bit_256Max[(1 << bits) - 1];
133  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
134  if (dPhiNLBMap_7bit_256Max[edge] <= dPhi && dPhiNLBMap_7bit_256Max[edge + 1] > dPhi) {
135  dPhi_ = dPhiNLBMap_7bit_256Max[edge];
136  break;
137  }
138  }
139  }
140  }
141 
142  else if (max == 512) {
143  if (bits == 7) {
144  dPhi_ = dPhiNLBMap_7bit_512Max[(1 << bits) - 1];
145  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
146  if (dPhiNLBMap_7bit_512Max[edge] <= dPhi && dPhiNLBMap_7bit_512Max[edge + 1] > dPhi) {
147  dPhi_ = dPhiNLBMap_7bit_512Max[edge];
148  break;
149  }
150  }
151  }
152  if (bits == 8) {
153  dPhi_ = dPhiNLBMap_8bit_512Max[(1 << bits) - 1];
154  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
155  if (dPhiNLBMap_8bit_512Max[edge] <= dPhi && dPhiNLBMap_8bit_512Max[edge + 1] > dPhi) {
156  dPhi_ = dPhiNLBMap_8bit_512Max[edge];
157  break;
158  }
159  }
160  }
161  }
162 
163  if (dPhi >= max)
164  dPhi_ = max;
165  return (sign_ * dPhi_);
166 }
static const int dPhiNLBMap_7bit_512Max[128]
static const int dPhiNLBMap_5bit_256Max[32]
static const int dPhiNLBMap_7bit_256Max[128]
static const int dPhiNLBMap_6bit_256Max[64]
static const int dPhiNLBMap_8bit_512Max[256]

◆ getNLBdPhiBin()

int PtAssignmentEngineAux2016::getNLBdPhiBin ( int  dPhi,
int  bits,
int  max = 512 
) const

Definition at line 168 of file PtAssignmentEngineAux2016.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, HLT_2024v10_cff::dPhi, dPhiNLBMap_5bit_256Max, dPhiNLBMap_6bit_256Max, dPhiNLBMap_7bit_256Max, dPhiNLBMap_7bit_512Max, dPhiNLBMap_8bit_512Max, and SiStripPI::max.

Referenced by PtAssignmentEngine2016::calculate_address().

168  {
169  int dPhiBin_ = (1 << bits) - 1;
170  int sign_ = 1;
171  if (dPhi < 0)
172  sign_ = -1;
173  dPhi = sign_ * dPhi;
174 
175  if (max == 256) {
176  if (bits == 5) {
177  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
178  if (dPhiNLBMap_5bit_256Max[edge] <= dPhi && dPhiNLBMap_5bit_256Max[edge + 1] > dPhi) {
179  dPhiBin_ = edge;
180  break;
181  }
182  }
183  }
184  if (bits == 6) {
185  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
186  if (dPhiNLBMap_6bit_256Max[edge] <= dPhi && dPhiNLBMap_6bit_256Max[edge + 1] > dPhi) {
187  dPhiBin_ = edge;
188  break;
189  }
190  }
191  }
192  if (bits == 7) {
193  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
194  if (dPhiNLBMap_7bit_256Max[edge] <= dPhi && dPhiNLBMap_7bit_256Max[edge + 1] > dPhi) {
195  dPhiBin_ = edge;
196  break;
197  }
198  }
199  }
200  }
201 
202  else if (max == 512) {
203  if (bits == 7) {
204  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
205  if (dPhiNLBMap_7bit_512Max[edge] <= dPhi && dPhiNLBMap_7bit_512Max[edge + 1] > dPhi) {
206  dPhiBin_ = edge;
207  break;
208  }
209  }
210  }
211  if (bits == 8) {
212  for (int edge = 0; edge < (1 << bits) - 1; edge++) {
213  if (dPhiNLBMap_8bit_512Max[edge] <= dPhi && dPhiNLBMap_8bit_512Max[edge + 1] > dPhi) {
214  dPhiBin_ = edge;
215  break;
216  }
217  }
218  }
219  }
220 
221  return (dPhiBin_);
222 }
static const int dPhiNLBMap_7bit_512Max[128]
static const int dPhiNLBMap_5bit_256Max[32]
static const int dPhiNLBMap_7bit_256Max[128]
static const int dPhiNLBMap_6bit_256Max[64]
static const int dPhiNLBMap_8bit_512Max[256]