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 260 of file PtAssignmentEngineAux2016.cc.

Referenced by PtAssignmentEngine2016::calculate_address().

260  {
261  int clct_ = 0;
262  int sign_ = 1;
263 
264  switch (clct) {
265  case 10: clct_ = 0; sign_ = -1; break;
266  case 9: clct_ = 1; sign_ = 1; break;
267  case 8: clct_ = 1; sign_ = -1; break;
268  case 7: clct_ = 2; sign_ = 1; break;
269  case 6: clct_ = 2; sign_ = -1; break;
270  case 5: clct_ = 3; sign_ = 1; break;
271  case 4: clct_ = 3; sign_ = -1; break;
272  case 3: clct_ = 3; sign_ = 1; break;
273  case 2: clct_ = 3; sign_ = -1; break;
274  case 1: clct_ = 3; sign_ = -1; break; //case 1: clct_ = 3; sign_ = 1; break;
275  case 0: clct_ = 3; sign_ = -1; break;
276  default: clct_ = 3; sign_ = -1; break;
277  }
278  return (sign_ * clct_);
279 }
int PtAssignmentEngineAux2016::getdEta ( int  dEta) const

Definition at line 303 of file PtAssignmentEngineAux2016.cc.

303  {
304  int dEta_ = 0;
305 
306  if (dEta<=-5)
307  dEta_ = 0;
308  else if (dEta<=-2)
309  dEta_ = 1;
310  else if (dEta<=-1)
311  dEta_ = 2;
312  else if (dEta<=0)
313  dEta_ = 3;
314  else if (dEta<=1)
315  dEta_ = 4;
316  else if (dEta<=3)
317  dEta_ = 5;
318  else if (dEta<=6)
319  dEta_ = 6;
320  else
321  dEta_ = 7;
322  return (dEta_);
323 }
int PtAssignmentEngineAux2016::getdPhiFromBin ( int  dPhiBin,
int  bits,
int  max = 512 
) const

Definition at line 233 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().

233  {
234  int dPhi_= (1<<bits)-1;
235 
236  if (dPhiBin>(1<<bits)-1)
237  dPhiBin = (1<<bits)-1;
238 
239  if (max==256)
240  {
241  if (bits == 5)
243  if (bits == 6)
245  if (bits == 7)
247  }
248 
249  else if (max==512)
250  {
251  if (bits == 7)
253  if (bits == 8)
255  }
256 
257  return (dPhi_);
258 }
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 281 of file PtAssignmentEngineAux2016.cc.

Referenced by PtAssignmentEngine2016::calculate_address().

281  {
282  int dTheta_ = 0;
283 
284  if (dTheta<=-3)
285  dTheta_ = 0;
286  else if (dTheta<=-2)
287  dTheta_ = 1;
288  else if (dTheta<=-1)
289  dTheta_ = 2;
290  else if (dTheta<=0)
291  dTheta_ = 3;
292  else if (dTheta<=1)
293  dTheta_ = 4;
294  else if (dTheta<=2)
295  dTheta_ = 5;
296  else if (dTheta<=3)
297  dTheta_ = 6;
298  else
299  dTheta_ = 7;
300  return (dTheta_);
301 }
float PtAssignmentEngineAux2016::getEtaFromBin ( int  etaBin,
int  bits = 5 
) const

Definition at line 358 of file PtAssignmentEngineAux2016.cc.

References getEtaFromEtaInt().

358  {
359  // For backward compatibility
360  return getEtaFromEtaInt(etaBin, bits);
361 }
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 347 of file PtAssignmentEngineAux2016.cc.

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

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

347  {
348  etaInt = (etaInt > 31) ? 31 : etaInt; // 5-bit
349  etaInt = (etaInt < 0) ? 0 : etaInt;
350  bits = (bits > 5) ? 5 : bits;
351  int shift = 5 - bits;
352  etaInt <<= shift;
353  // decode 5-bit etaInt to 0.9<abs(eta)<1.6
354  float eta = ((0.5 + etaInt)*1.6)/32 + 0.9;
355  return eta;
356 }
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 337 of file PtAssignmentEngineAux2016.cc.

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

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

337  {
338  thetaInt = (thetaInt > 127) ? 127 : thetaInt; // 7-bit
339  thetaInt = (thetaInt < 0) ? 0 : thetaInt;
340  float theta = thetaInt;
341  theta = (theta*0.2874016 + 8.5)*(3.14159265359/180); // use this version to reproduce what happened when the pT LUT was made
342  //theta = (theta*(45.0-8.5)/128. + 8.5) * M_PI/180.;
343  float eta = -std::log(std::tan(theta/2));
344  return eta;
345 }
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 325 of file PtAssignmentEngineAux2016.cc.

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

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

325  {
326  eta = std::abs(eta);
327  eta = (eta < 0.9) ? 0.9 : eta;
328  bits = (bits > 5) ? 5 : bits;
329  // encode 0.9<abs(eta)<1.6 in 5-bit (32 possible values)
330  int etaInt = ((eta - 0.9)*32)/(1.6) - 0.5;
331  int shift = 5 - bits;
332  etaInt >>= shift;
333  etaInt = (etaInt > 31) ? 31 : etaInt;
334  return etaInt;
335 }
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 371 of file PtAssignmentEngineAux2016.cc.

References bits, and relativeConstraints::chamber.

Referenced by PtAssignmentEngine2016::calculate_address().

371  {
372  int bits = FRLUT[(sector-1)%2][station];
373  bool isFront = bits & (1<<chamber);
374  return isFront;
375 }
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 77 of file PtAssignmentEngineAux2016.cc.

References ModeVariables_Scheme3.

Referenced by PtAssignmentEngine2016::calculate_pt_xml().

77  {
78  return ModeVariables_Scheme3;
79 }
static const int ModeVariables_Scheme3[13][6]
int PtAssignmentEngineAux2016::getNLBdPhi ( int  dPhi,
int  bits,
int  max = 512 
) const

Definition at line 81 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.

81  {
82  int dPhi_= max;
83  int sign_ = 1;
84  if (dPhi<0)
85  sign_ = -1;
86  dPhi = sign_ * dPhi;
87 
88  if (max==256)
89  {
90  if (bits == 5)
91  {
92  dPhi_ = dPhiNLBMap_5bit_256Max[(1<<bits)-1];
93  for (int edge=0; edge<(1<<bits)-1; edge++)
94  {
95  if (dPhiNLBMap_5bit_256Max[edge]<=dPhi && dPhiNLBMap_5bit_256Max[edge+1]>dPhi)
96  {
97  dPhi_ = dPhiNLBMap_5bit_256Max[edge];
98  break;
99  }
100  }
101  }
102  if (bits == 6)
103  {
104  dPhi_ = dPhiNLBMap_6bit_256Max[(1<<bits)-1];
105  for (int edge=0; edge<(1<<bits)-1; edge++)
106  {
107  if (dPhiNLBMap_6bit_256Max[edge]<=dPhi && dPhiNLBMap_6bit_256Max[edge+1]>dPhi)
108  {
109  dPhi_ = dPhiNLBMap_6bit_256Max[edge];
110  break;
111  }
112  }
113  }
114  if (bits == 7)
115  {
116  dPhi_ = dPhiNLBMap_7bit_256Max[(1<<bits)-1];
117  for (int edge=0; edge<(1<<bits)-1; edge++)
118  {
119  if (dPhiNLBMap_7bit_256Max[edge]<=dPhi && dPhiNLBMap_7bit_256Max[edge+1]>dPhi)
120  {
121  dPhi_ = dPhiNLBMap_7bit_256Max[edge];
122  break;
123  }
124  }
125  }
126  }
127 
128  else if (max==512)
129  {
130  if (bits == 7)
131  {
132  dPhi_ = dPhiNLBMap_7bit_512Max[(1<<bits)-1];
133  for (int edge=0; edge<(1<<bits)-1; edge++)
134  {
135  if (dPhiNLBMap_7bit_512Max[edge]<=dPhi && dPhiNLBMap_7bit_512Max[edge+1]>dPhi)
136  {
137  dPhi_ = dPhiNLBMap_7bit_512Max[edge];
138  break;
139  }
140  }
141  }
142  if (bits == 8)
143  {
144  dPhi_ = dPhiNLBMap_8bit_512Max[(1<<bits)-1];
145  for (int edge=0; edge<(1<<bits)-1; edge++)
146  {
147  if (dPhiNLBMap_8bit_512Max[edge]<=dPhi && dPhiNLBMap_8bit_512Max[edge+1]>dPhi)
148  {
149  dPhi_ = dPhiNLBMap_8bit_512Max[edge];
150  break;
151  }
152  }
153  }
154  }
155 
156  if (dPhi>=max) dPhi_ = max;
157  return (sign_ * dPhi_);
158 }
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 160 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().

160  {
161  int dPhiBin_= (1<<bits)-1;
162  int sign_ = 1;
163  if (dPhi<0)
164  sign_ = -1;
165  dPhi = sign_ * dPhi;
166 
167  if (max==256)
168  {
169  if (bits == 5)
170  {
171  for (int edge=0; edge<(1<<bits)-1; edge++)
172  {
173  if (dPhiNLBMap_5bit_256Max[edge]<=dPhi && dPhiNLBMap_5bit_256Max[edge+1]>dPhi)
174  {
175  dPhiBin_ = edge;
176  break;
177  }
178  }
179  }
180  if (bits == 6)
181  {
182  for (int edge=0; edge<(1<<bits)-1; edge++)
183  {
184  if (dPhiNLBMap_6bit_256Max[edge]<=dPhi && dPhiNLBMap_6bit_256Max[edge+1]>dPhi)
185  {
186  dPhiBin_ = edge;
187  break;
188  }
189  }
190  }
191  if (bits == 7)
192  {
193  for (int edge=0; edge<(1<<bits)-1; edge++)
194  {
195  if (dPhiNLBMap_7bit_256Max[edge]<=dPhi && dPhiNLBMap_7bit_256Max[edge+1]>dPhi)
196  {
197  dPhiBin_ = edge;
198  break;
199  }
200  }
201  }
202  }
203 
204  else if (max==512)
205  {
206  if (bits == 7)
207  {
208  for (int edge=0; edge<(1<<bits)-1; edge++)
209  {
210  if (dPhiNLBMap_7bit_512Max[edge]<=dPhi && dPhiNLBMap_7bit_512Max[edge+1]>dPhi)
211  {
212  dPhiBin_ = edge;
213  break;
214  }
215  }
216  }
217  if (bits == 8)
218  {
219  for (int edge=0; edge<(1<<bits)-1; edge++)
220  {
221  if (dPhiNLBMap_8bit_512Max[edge]<=dPhi && dPhiNLBMap_8bit_512Max[edge+1]>dPhi)
222  {
223  dPhiBin_ = edge;
224  break;
225  }
226  }
227  }
228  }
229 
230  return (dPhiBin_);
231 }
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]