CMS 3D CMS Logo

List of all members | Public Member Functions
PtAssignmentEngineAux2016 Class Reference

#include <PtAssignmentEngineAux2016.h>

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
 

Detailed Description

Definition at line 10 of file PtAssignmentEngineAux2016.h.

Member Function Documentation

int PtAssignmentEngineAux2016::getCLCT ( int  clct) const

Definition at line 270 of file PtAssignmentEngineAux2016.cc.

Referenced by PtAssignmentEngine2016::calculate_address().

270  {
271  int clct_ = 0;
272  int sign_ = 1;
273 
274  switch (clct) {
275  case 10: clct_ = 0; sign_ = -1; break;
276  case 9: clct_ = 1; sign_ = 1; break;
277  case 8: clct_ = 1; sign_ = -1; break;
278  case 7: clct_ = 2; sign_ = 1; break;
279  case 6: clct_ = 2; sign_ = -1; break;
280  case 5: clct_ = 3; sign_ = 1; break;
281  case 4: clct_ = 3; sign_ = -1; break;
282  case 3: clct_ = 3; sign_ = 1; break;
283  case 2: clct_ = 3; sign_ = -1; break;
284  case 1: clct_ = 3; sign_ = -1; break; //case 1: clct_ = 3; sign_ = 1; break;
285  case 0: clct_ = 3; sign_ = -1; break;
286  default: clct_ = 3; sign_ = -1; break;
287  }
288  return (sign_ * clct_);
289 }
int PtAssignmentEngineAux2016::getdEta ( int  dEta) const

Definition at line 313 of file PtAssignmentEngineAux2016.cc.

313  {
314  int dEta_ = 0;
315 
316  if (dEta<=-5)
317  dEta_ = 0;
318  else if (dEta<=-2)
319  dEta_ = 1;
320  else if (dEta<=-1)
321  dEta_ = 2;
322  else if (dEta<=0)
323  dEta_ = 3;
324  else if (dEta<=1)
325  dEta_ = 4;
326  else if (dEta<=3)
327  dEta_ = 5;
328  else if (dEta<=6)
329  dEta_ = 6;
330  else
331  dEta_ = 7;
332  return (dEta_);
333 }
int PtAssignmentEngineAux2016::getdPhiFromBin ( int  dPhiBin,
int  bits,
int  max = 512 
) const

Definition at line 243 of file PtAssignmentEngineAux2016.cc.

References bits, photonValidator_cfi::dPhiBin, dPhiNLBMap_5bit_256Max, dPhiNLBMap_6bit_256Max, dPhiNLBMap_7bit_256Max, dPhiNLBMap_7bit_512Max, and dPhiNLBMap_8bit_512Max.

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

243  {
244  int dPhi_= (1<<bits)-1;
245 
246  if (dPhiBin>(1<<bits)-1)
247  dPhiBin = (1<<bits)-1;
248 
249  if (max==256)
250  {
251  if (bits == 5)
253  if (bits == 6)
255  if (bits == 7)
257  }
258 
259  else if (max==512)
260  {
261  if (bits == 7)
263  if (bits == 8)
265  }
266 
267  return (dPhi_);
268 }
static const int dPhiNLBMap_7bit_512Max[128]
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
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]
int PtAssignmentEngineAux2016::getdTheta ( int  dTheta) const

Definition at line 291 of file PtAssignmentEngineAux2016.cc.

Referenced by PtAssignmentEngine2016::calculate_address().

291  {
292  int dTheta_ = 0;
293 
294  if (dTheta<=-3)
295  dTheta_ = 0;
296  else if (dTheta<=-2)
297  dTheta_ = 1;
298  else if (dTheta<=-1)
299  dTheta_ = 2;
300  else if (dTheta<=0)
301  dTheta_ = 3;
302  else if (dTheta<=1)
303  dTheta_ = 4;
304  else if (dTheta<=2)
305  dTheta_ = 5;
306  else if (dTheta<=3)
307  dTheta_ = 6;
308  else
309  dTheta_ = 7;
310  return (dTheta_);
311 }
float PtAssignmentEngineAux2016::getEtaFromBin ( int  etaBin,
int  bits = 5 
) const

Definition at line 368 of file PtAssignmentEngineAux2016.cc.

References getEtaFromEtaInt().

368  {
369  // For backward compatibility
370  return getEtaFromEtaInt(etaBin, bits);
371 }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
float getEtaFromEtaInt(int etaInt, int bits=5) const
float PtAssignmentEngineAux2016::getEtaFromEtaInt ( int  etaInt,
int  bits = 5 
) const

Definition at line 357 of file PtAssignmentEngineAux2016.cc.

References bits, PVValHelper::eta, and edm::shift.

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

357  {
358  etaInt = (etaInt > 31) ? 31 : etaInt; // 5-bit
359  etaInt = (etaInt < 0) ? 0 : etaInt;
360  bits = (bits > 5) ? 5 : bits;
361  int shift = 5 - bits;
362  etaInt <<= shift;
363  // decode 5-bit etaInt to 0.9<abs(eta)<1.6
364  float eta = ((0.5 + etaInt)*1.6)/32 + 0.9;
365  return eta;
366 }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
static unsigned int const shift
float PtAssignmentEngineAux2016::getEtaFromThetaInt ( int  thetaInt,
int  bits = 5 
) const

Definition at line 347 of file PtAssignmentEngineAux2016.cc.

References PVValHelper::eta, cmsBatch::log, funct::tan(), and theta().

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

347  {
348  thetaInt = (thetaInt > 127) ? 127 : thetaInt; // 7-bit
349  thetaInt = (thetaInt < 0) ? 0 : thetaInt;
350  float theta = thetaInt;
351  theta = (theta*0.2874016 + 8.5)*(3.14159265359/180); // use this version to reproduce what happened when the pT LUT was made
352  //theta = (theta*(45.0-8.5)/128. + 8.5) * M_PI/180.;
353  float eta = -std::log(std::tan(theta/2));
354  return eta;
355 }
Geom::Theta< T > theta() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
int PtAssignmentEngineAux2016::getEtaInt ( float  eta,
int  bits = 5 
) const

Definition at line 335 of file PtAssignmentEngineAux2016.cc.

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

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

335  {
336  eta = std::abs(eta);
337  eta = (eta < 0.9) ? 0.9 : eta;
338  bits = (bits > 5) ? 5 : bits;
339  // encode 0.9<abs(eta)<1.6 in 5-bit (32 possible values)
340  int etaInt = ((eta - 0.9)*32)/(1.6) - 0.5;
341  int shift = 5 - bits;
342  etaInt >>= shift;
343  etaInt = (etaInt > 31) ? 31 : etaInt;
344  return etaInt;
345 }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static unsigned int const shift
int PtAssignmentEngineAux2016::getFRLUT ( int  sector,
int  station,
int  chamber 
) const

Definition at line 381 of file PtAssignmentEngineAux2016.cc.

References bits, and relativeConstraints::chamber.

Referenced by PtAssignmentEngine2016::calculate_address().

381  {
382  int bits = FRLUT[(sector-1)%2][station];
383  bool isFront = bits & (1<<chamber);
384  return isFront;
385 }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
static const int FRLUT[2][5]
const int(* PtAssignmentEngineAux2016::getModeVariables ( ) )[6]

Definition at line 87 of file PtAssignmentEngineAux2016.cc.

References ModeVariables_Scheme3.

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

87  {
88  return ModeVariables_Scheme3;
89 }
static const int ModeVariables_Scheme3[13][6]
int PtAssignmentEngineAux2016::getNLBdPhi ( int  dPhi,
int  bits,
int  max = 512 
) const

Definition at line 91 of file PtAssignmentEngineAux2016.cc.

References bits, particleFlow_cfi::dPhi, dPhiNLBMap_5bit_256Max, dPhiNLBMap_6bit_256Max, dPhiNLBMap_7bit_256Max, dPhiNLBMap_7bit_512Max, dPhiNLBMap_8bit_512Max, and SiStripPI::max.

91  {
92  int dPhi_= max;
93  int sign_ = 1;
94  if (dPhi<0)
95  sign_ = -1;
96  dPhi = sign_ * dPhi;
97 
98  if (max==256)
99  {
100  if (bits == 5)
101  {
102  dPhi_ = dPhiNLBMap_5bit_256Max[(1<<bits)-1];
103  for (int edge=0; edge<(1<<bits)-1; edge++)
104  {
105  if (dPhiNLBMap_5bit_256Max[edge]<=dPhi && dPhiNLBMap_5bit_256Max[edge+1]>dPhi)
106  {
107  dPhi_ = dPhiNLBMap_5bit_256Max[edge];
108  break;
109  }
110  }
111  }
112  if (bits == 6)
113  {
114  dPhi_ = dPhiNLBMap_6bit_256Max[(1<<bits)-1];
115  for (int edge=0; edge<(1<<bits)-1; edge++)
116  {
117  if (dPhiNLBMap_6bit_256Max[edge]<=dPhi && dPhiNLBMap_6bit_256Max[edge+1]>dPhi)
118  {
119  dPhi_ = dPhiNLBMap_6bit_256Max[edge];
120  break;
121  }
122  }
123  }
124  if (bits == 7)
125  {
126  dPhi_ = dPhiNLBMap_7bit_256Max[(1<<bits)-1];
127  for (int edge=0; edge<(1<<bits)-1; edge++)
128  {
129  if (dPhiNLBMap_7bit_256Max[edge]<=dPhi && dPhiNLBMap_7bit_256Max[edge+1]>dPhi)
130  {
131  dPhi_ = dPhiNLBMap_7bit_256Max[edge];
132  break;
133  }
134  }
135  }
136  }
137 
138  else if (max==512)
139  {
140  if (bits == 7)
141  {
142  dPhi_ = dPhiNLBMap_7bit_512Max[(1<<bits)-1];
143  for (int edge=0; edge<(1<<bits)-1; edge++)
144  {
145  if (dPhiNLBMap_7bit_512Max[edge]<=dPhi && dPhiNLBMap_7bit_512Max[edge+1]>dPhi)
146  {
147  dPhi_ = dPhiNLBMap_7bit_512Max[edge];
148  break;
149  }
150  }
151  }
152  if (bits == 8)
153  {
154  dPhi_ = dPhiNLBMap_8bit_512Max[(1<<bits)-1];
155  for (int edge=0; edge<(1<<bits)-1; edge++)
156  {
157  if (dPhiNLBMap_8bit_512Max[edge]<=dPhi && dPhiNLBMap_8bit_512Max[edge+1]>dPhi)
158  {
159  dPhi_ = dPhiNLBMap_8bit_512Max[edge];
160  break;
161  }
162  }
163  }
164  }
165 
166  if (dPhi>=max) dPhi_ = max;
167  return (sign_ * dPhi_);
168 }
static const int dPhiNLBMap_7bit_512Max[128]
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
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]
int PtAssignmentEngineAux2016::getNLBdPhiBin ( int  dPhi,
int  bits,
int  max = 512 
) const

Definition at line 170 of file PtAssignmentEngineAux2016.cc.

References bits, particleFlow_cfi::dPhi, dPhiNLBMap_5bit_256Max, dPhiNLBMap_6bit_256Max, dPhiNLBMap_7bit_256Max, dPhiNLBMap_7bit_512Max, and dPhiNLBMap_8bit_512Max.

Referenced by PtAssignmentEngine2016::calculate_address().

170  {
171  int dPhiBin_= (1<<bits)-1;
172  int sign_ = 1;
173  if (dPhi<0)
174  sign_ = -1;
175  dPhi = sign_ * dPhi;
176 
177  if (max==256)
178  {
179  if (bits == 5)
180  {
181  for (int edge=0; edge<(1<<bits)-1; edge++)
182  {
183  if (dPhiNLBMap_5bit_256Max[edge]<=dPhi && dPhiNLBMap_5bit_256Max[edge+1]>dPhi)
184  {
185  dPhiBin_ = edge;
186  break;
187  }
188  }
189  }
190  if (bits == 6)
191  {
192  for (int edge=0; edge<(1<<bits)-1; edge++)
193  {
194  if (dPhiNLBMap_6bit_256Max[edge]<=dPhi && dPhiNLBMap_6bit_256Max[edge+1]>dPhi)
195  {
196  dPhiBin_ = edge;
197  break;
198  }
199  }
200  }
201  if (bits == 7)
202  {
203  for (int edge=0; edge<(1<<bits)-1; edge++)
204  {
205  if (dPhiNLBMap_7bit_256Max[edge]<=dPhi && dPhiNLBMap_7bit_256Max[edge+1]>dPhi)
206  {
207  dPhiBin_ = edge;
208  break;
209  }
210  }
211  }
212  }
213 
214  else if (max==512)
215  {
216  if (bits == 7)
217  {
218  for (int edge=0; edge<(1<<bits)-1; edge++)
219  {
220  if (dPhiNLBMap_7bit_512Max[edge]<=dPhi && dPhiNLBMap_7bit_512Max[edge+1]>dPhi)
221  {
222  dPhiBin_ = edge;
223  break;
224  }
225  }
226  }
227  if (bits == 8)
228  {
229  for (int edge=0; edge<(1<<bits)-1; edge++)
230  {
231  if (dPhiNLBMap_8bit_512Max[edge]<=dPhi && dPhiNLBMap_8bit_512Max[edge+1]>dPhi)
232  {
233  dPhiBin_ = edge;
234  break;
235  }
236  }
237  }
238  }
239 
240  return (dPhiBin_);
241 }
static const int dPhiNLBMap_7bit_512Max[128]
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
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]