CMS 3D CMS Logo

List of all members | Public Member Functions
PtAssignmentEngineAux Class Reference

#include <PtAssignmentEngineAux.h>

Inheritance diagram for PtAssignmentEngineAux:
PtAssignmentEngineAux2016 PtAssignmentEngineAux2017

Public Member Functions

std::pair< int, int > getGMTCharge (int mode, const std::vector< int > &phidiffs) const
 
int getGMTEta (int theta, int endcap) const
 
int getGMTPhi (int phi) const
 
int getGMTPhiV2 (int phi) const
 
int getGMTPt (float pt) const
 
int getGMTQuality (int mode, int theta, bool promoteMode7, int version) const
 
float getPtFromGMTPt (int gmt_pt) const
 

Detailed Description

Definition at line 13 of file PtAssignmentEngineAux.h.

Member Function Documentation

◆ getGMTCharge()

std::pair< int, int > PtAssignmentEngineAux::getGMTCharge ( int  mode,
const std::vector< int > &  phidiffs 
) const

Definition at line 166 of file PtAssignmentEngineAux.cc.

166  {
167  // -1 = postive physical charge to match pdgId code (i.e. -13 is positive, anti-muon). +1 = negative physical charge.
168  // Also matches DN-2015/017 format for track finder --> uGMT interface format, where 0 indicates positive, 1 negative.
169  int emuCharge = 0;
170 
171  // Note: sign_ph[0] == 1 in firmware actually translates to phidiffs[0] >= 0 (instead of phidiffs[0] > 0 in the old emulator)
172  // The effect needs to be checked
173 
174  switch (mode) {
175  case 15: // 1-2-3-4
176  if (phidiffs[0] >= 0) // 1-2 (should use > 0)
177  emuCharge = 1;
178  else if (phidiffs[0] == 0 && phidiffs[1] < 0) // 1-3
179  emuCharge = 1;
180  else if (phidiffs[1] == 0 && phidiffs[2] < 0) // 1-4
181  emuCharge = 1;
182  else
183  emuCharge = -1;
184  break;
185 
186  case 14: // 1-2-3
187  if (phidiffs[0] < 0) // 1-2
188  emuCharge = -1;
189  else if (phidiffs[0] == 0 && phidiffs[1] < 0) // 1-3
190  emuCharge = -1;
191  else
192  emuCharge = 1;
193  break;
194 
195  case 13: // 1-2-4
196  if (phidiffs[0] >= 0) // 1-2 (should use > 0)
197  emuCharge = 1;
198  else if (phidiffs[0] == 0 && phidiffs[2] < 0) // 1-4
199  emuCharge = 1;
200  else
201  emuCharge = -1;
202  break;
203 
204  case 12: // 1-2
205  if (phidiffs[0] >= 0) // 1-2
206  emuCharge = 1;
207  else
208  emuCharge = -1;
209  break;
210 
211  case 11: // 1-3-4
212  if (phidiffs[1] >= 0) // 1-3 (should use > 0)
213  emuCharge = 1;
214  else if (phidiffs[1] == 0 && phidiffs[2] < 0) // 1-4
215  emuCharge = 1;
216  else
217  emuCharge = -1;
218  break;
219 
220  case 10: // 1-3
221  if (phidiffs[1] >= 0) // 1-3
222  emuCharge = 1;
223  else
224  emuCharge = -1;
225  break;
226 
227  case 9: // 1-4
228  if (phidiffs[2] >= 0) // 1-4
229  emuCharge = 1;
230  else
231  emuCharge = -1;
232  break;
233 
234  case 7: // 2-3-4
235  if (phidiffs[3] >= 0) // 2-3 (should use > 0)
236  emuCharge = 1;
237  else if (phidiffs[3] == 0 && phidiffs[4] < 0) // 2-4
238  emuCharge = 1;
239  else
240  emuCharge = -1;
241  break;
242 
243  case 6: // 2-3
244  if (phidiffs[3] >= 0) // 2-3
245  emuCharge = 1;
246  else
247  emuCharge = -1;
248  break;
249 
250  case 5: // 2-4
251  if (phidiffs[4] >= 0) // 2-4
252  emuCharge = 1;
253  else
254  emuCharge = -1;
255  break;
256 
257  case 3: // 3-4
258  if (phidiffs[5] >= 0) // 3-4
259  emuCharge = 1;
260  else
261  emuCharge = -1;
262  break;
263 
264  default:
265  //emuCharge = -1;
266  emuCharge = 0;
267  break;
268  }
269 
270  int charge = 0;
271  if (emuCharge == 1)
272  charge = 1;
273 
274  int charge_valid = 1;
275  if (emuCharge == 0)
276  charge_valid = 0;
277  return std::make_pair(charge, charge_valid);
278 }

References ALCARECOTkAlJpsiMuMu_cff::charge, and ALCARECOPromptCalibProdSiPixelAli0T_cff::mode.

Referenced by PtAssignment::process().

◆ getGMTEta()

int PtAssignmentEngineAux::getGMTEta ( int  theta,
int  endcap 
) const

Definition at line 44 of file PtAssignmentEngineAux.cc.

44  { // [-1,+1]
45  if (theta < 0)
46  return 0;
47  if (endcap == -1 && theta > 127)
48  return -240;
49  if (endcap == +1 && theta > 127)
50  return 239;
51 
53  if (endcap == -1)
54  eta = -eta;
55  return eta;
56 }

References makeMuonMisalignmentScenario::endcap, PVValHelper::eta, GMT_eta_from_theta, and theta().

Referenced by PtAssignment::process().

◆ getGMTPhi()

int PtAssignmentEngineAux::getGMTPhi ( int  phi) const

Definition at line 24 of file PtAssignmentEngineAux.cc.

24  {
25  // convert phi into gmt scale according to DN15-017
26  // full scale is -16 to 100, or 116 values, covers range -10 to 62.5 deg
27  // my internal ph scale is 0..5000, covers from -22 to 63.333 deg
28  // converted to GMT scale it is from -35 to 95
29  // bt_phi * 107.01/4096, equivalent to bt_phi * 6849/0x40000
30  phi *= 6849;
31  phi >>= 18; // divide by 0x40000
32  phi -= 35; // offset of -22 deg
33  return phi;
34 }

References phi.

Referenced by PtAssignment::process().

◆ getGMTPhiV2()

int PtAssignmentEngineAux::getGMTPhiV2 ( int  phi) const

Definition at line 36 of file PtAssignmentEngineAux.cc.

36  {
37  // convert phi into gmt scale according to DN15-017
38  phi *= 6991;
39  phi >>= 18; // divide by 0x40000
40  phi -= 35; // offset of -22 deg
41  return phi;
42 }

References phi.

Referenced by PtAssignment::process().

◆ getGMTPt()

int PtAssignmentEngineAux::getGMTPt ( float  pt) const

Definition at line 12 of file PtAssignmentEngineAux.cc.

12  {
13  // compressed pt = pt*2 (scale) + 1 (pt = 0 is empty candidate)
14  int gmt_pt = (pt * 2) + 1;
15  gmt_pt = (gmt_pt > 511) ? 511 : gmt_pt;
16  return gmt_pt;
17 }

References DiDispStaMuonMonitor_cfi::pt.

Referenced by PtAssignment::process().

◆ getGMTQuality()

int PtAssignmentEngineAux::getGMTQuality ( int  mode,
int  theta,
bool  promoteMode7,
int  version 
) const

Definition at line 58 of file PtAssignmentEngineAux.cc.

58  {
59  int quality = 0;
60 
61  if (version == 2) { // 2018 mode <--> quality mapping
62  switch (mode) {
63  case 15:
64  quality = 15;
65  break;
66  case 14:
67  quality = 14;
68  break;
69  case 13:
70  quality = 13;
71  break;
72  case 12:
73  quality = 7;
74  break;
75  case 11:
76  quality = 12;
77  break;
78  case 10:
79  quality = 10;
80  break;
81  case 9:
82  quality = 9;
83  break;
84  case 7:
85  quality = 11;
86  break;
87  case 6:
88  quality = 6;
89  break;
90  case 5:
91  quality = 5;
92  break;
93  case 3:
94  quality = 4;
95  break;
96  default:
97  quality = 0;
98  break;
99  }
100 
101  if (theta > 88) { // if (eta < 1.19)
102  quality /= 4;
103  }
104  } // End 2018 mode <--> quality mapping
105 
106  else { // 2016 and 2017 mode <--> quality mapping
107  if (theta > 87) { // if (eta < 1.2)
108  switch (mode) {
109  case 15:
110  quality = 8;
111  break;
112  case 14:
113  quality = 4;
114  break;
115  case 13:
116  quality = 4;
117  break;
118  case 12:
119  quality = 4;
120  break;
121  case 11:
122  quality = 4;
123  break;
124  default:
125  quality = 4;
126  break;
127  }
128  } else {
129  switch (mode) {
130  case 15:
131  quality = 12;
132  break;
133  case 14:
134  quality = 12;
135  break;
136  case 13:
137  quality = 12;
138  break;
139  case 12:
140  quality = 8;
141  break;
142  case 11:
143  quality = 12;
144  break;
145  case 10:
146  quality = 8;
147  break;
148  case 7:
149  quality = 8;
150  break;
151  default:
152  quality = 4;
153  break;
154  }
155  }
156  quality |= (mode & 3);
157  } // End 2016 and 2017 mode <--> quality mapping
158 
159  // Fix for missing CSC LCTs in ME1/1, including dead "water-leak" chambers ME1/1/34 and 35
160  if (promoteMode7 && mode == 7 && theta <= 50)
161  quality = 12;
162 
163  return quality;
164 }

References ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, qcdUeDQM_cfi::quality, theta(), and BeamSplash_cfg::version.

Referenced by PtAssignment::process().

◆ getPtFromGMTPt()

float PtAssignmentEngineAux::getPtFromGMTPt ( int  gmt_pt) const

Definition at line 19 of file PtAssignmentEngineAux.cc.

19  {
20  float pt = (gmt_pt <= 0) ? 0 : 0.5 * (gmt_pt - 1);
21  return pt;
22 }

References DiDispStaMuonMonitor_cfi::pt.

Referenced by PtAssignmentEngine::calculate_pt_lut().

GMT_eta_from_theta
static const int GMT_eta_from_theta[128]
Definition: PtAssignmentEngineAux.cc:4
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
PVValHelper::eta
Definition: PVValidationHelpers.h:69
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
DDAxes::phi
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45