CMS 3D CMS Logo

List of all members | Public Member Functions
PtAssignmentEngine2016 Class Reference

#include <PtAssignmentEngine2016.h>

Inheritance diagram for PtAssignmentEngine2016:
PtAssignmentEngine

Public Member Functions

const PtAssignmentEngineAux2016aux () const
 
address_t calculate_address (const EMTFTrack &track) const override
 
float calculate_pt_xml (const address_t &address) const override
 
float calculate_pt_xml (const EMTFTrack &track) const override
 
 PtAssignmentEngine2016 ()
 
float scale_pt (const float pt, const int mode=15) const override
 
float unscale_pt (const float pt, const int mode=15) const override
 
 ~PtAssignmentEngine2016 () override
 
- Public Member Functions inherited from PtAssignmentEngine
const PtAssignmentEngineAuxaux () const
 
virtual float calculate_pt (const address_t &address) const
 
virtual float calculate_pt (const EMTFTrack &track) const
 
virtual float calculate_pt_lut (const address_t &address) const
 
void configure (int verbose, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt)
 
void configure_details ()
 
int get_pt_lut_version () const
 
const std::vector< int > & getAllowedModes (void) const
 
const std::array< emtf::Forest, 16 > & getForests (void) const
 
void load (int pt_lut_version, const L1TMuonEndCapForest *payload)
 
 PtAssignmentEngine ()
 
void read (int pt_lut_version, const std::string &xml_dir)
 
virtual ~PtAssignmentEngine ()
 

Additional Inherited Members

- Public Types inherited from PtAssignmentEngine
typedef uint64_t address_t
 
- Protected Attributes inherited from PtAssignmentEngine
std::vector< int > allowedModes_
 
bool bug9BitDPhi_
 
bool bugMode7CLCT_
 
bool bugNegPt_
 
bool fixMode15HighPt_
 
std::array< emtf::Forest, 16 > forests_
 
PtLUTReader ptlut_reader_
 
int ptLUTVersion_
 
bool readPtLUTFile_
 
int verbose_
 

Detailed Description

Definition at line 7 of file PtAssignmentEngine2016.h.

Constructor & Destructor Documentation

PtAssignmentEngine2016::PtAssignmentEngine2016 ( )
inlineexplicit

Definition at line 9 of file PtAssignmentEngine2016.h.

PtAssignmentEngine2016::~PtAssignmentEngine2016 ( )
inlineoverride

Member Function Documentation

const PtAssignmentEngineAux2016 & PtAssignmentEngine2016::aux ( ) const

Definition at line 8 of file PtAssignmentEngine2016.cc.

References instance.

Referenced by calculate_address(), calculate_pt_xml(), and ~PtAssignmentEngine2016().

8  {
10  return instance;
11 }
static PFTauRenderPlugin instance
PtAssignmentEngine::address_t PtAssignmentEngine2016::calculate_address ( const EMTFTrack track) const
overridevirtual

Reimplemented from PtAssignmentEngine.

Definition at line 27 of file PtAssignmentEngine2016.cc.

References funct::abs(), aux(), l1t::EMTFPtLUT::bt_ci, l1t::EMTFPtLUT::bt_vi, PtAssignmentEngine::bug9BitDPhi_, l1t::EMTFPtLUT::cpattern, l1t::EMTFPtLUT::delta_ph, l1t::EMTFPtLUT::delta_th, l1t::EMTFPtLUT::fr, PtAssignmentEngineAux2016::getCLCT(), PtAssignmentEngineAux2016::getdTheta(), PtAssignmentEngineAux2016::getFRLUT(), PtAssignmentEngineAux2016::getNLBdPhiBin(), min(), l1t::EMTFTrack::Mode_inv(), l1t::EMTFTrack::PtLUT(), l1t::EMTFTrack::Sector(), Validation_hcalonly_cfi::sign, l1t::EMTFPtLUT::sign_ph, l1t::EMTFPtLUT::sign_th, theta(), l1t::EMTFTrack::Theta_fp(), and trigObjTnPSource_cfi::var.

Referenced by ~PtAssignmentEngine2016().

27  {
28  address_t address = 0;
29 
30  const EMTFPtLUT& ptlut_data = track.PtLUT();
31 
32  int mode_inv = track.Mode_inv();
33  int theta = track.Theta_fp();
34  theta >>= 2; // truncate from 7-bit to 5-bit
35 
36  int dPhi12 = ptlut_data.delta_ph[0];
37  int dPhi13 = ptlut_data.delta_ph[1];
38  int dPhi14 = ptlut_data.delta_ph[2];
39  int dPhi23 = ptlut_data.delta_ph[3];
40  int dPhi24 = ptlut_data.delta_ph[4];
41  int dPhi34 = ptlut_data.delta_ph[5];
42  int dTheta12 = ptlut_data.delta_th[0];
43  int dTheta13 = ptlut_data.delta_th[1];
44  int dTheta14 = ptlut_data.delta_th[2];
45  int dTheta23 = ptlut_data.delta_th[3];
46  int dTheta24 = ptlut_data.delta_th[4];
47  int dTheta34 = ptlut_data.delta_th[5];
48  int FR1 = ptlut_data.fr[0];
49  int FR2 = ptlut_data.fr[1];
50  int FR3 = ptlut_data.fr[2];
51  int FR4 = ptlut_data.fr[3];
52 
53  int sign12 = ptlut_data.sign_ph[0];
54  int sign13 = ptlut_data.sign_ph[1];
55  int sign14 = ptlut_data.sign_ph[2];
56  int sign23 = ptlut_data.sign_ph[3];
57  int sign24 = ptlut_data.sign_ph[4];
58  int sign34 = ptlut_data.sign_ph[5];
59  int dTheta12Sign = ptlut_data.sign_th[0];
60  int dTheta13Sign = ptlut_data.sign_th[1];
61  int dTheta14Sign = ptlut_data.sign_th[2];
62  int dTheta23Sign = ptlut_data.sign_th[3];
63  int dTheta24Sign = ptlut_data.sign_th[4];
64  int dTheta34Sign = ptlut_data.sign_th[5];
65 
66  int CLCT1 = std::abs(aux().getCLCT(ptlut_data.cpattern[0]));
67  int CLCT2 = std::abs(aux().getCLCT(ptlut_data.cpattern[1]));
68  int CLCT3 = std::abs(aux().getCLCT(ptlut_data.cpattern[2]));
69  int CLCT4 = std::abs(aux().getCLCT(ptlut_data.cpattern[3]));
70  int CLCT1Sign = (aux().getCLCT(ptlut_data.cpattern[0]) > 0);
71  int CLCT2Sign = (aux().getCLCT(ptlut_data.cpattern[1]) > 0);
72  int CLCT3Sign = (aux().getCLCT(ptlut_data.cpattern[2]) > 0);
73  int CLCT4Sign = (aux().getCLCT(ptlut_data.cpattern[3]) > 0);
74 
75  int CSCID1 = (ptlut_data.bt_vi[0] == 0 && ptlut_data.bt_vi[1] != 0) ? ptlut_data.bt_ci[1] + 16 : ptlut_data.bt_ci[0];
76  int CSCID2 = ptlut_data.bt_ci[2];
77  int CSCID3 = ptlut_data.bt_ci[3];
78  int CSCID4 = ptlut_data.bt_ci[4];
79 
80  auto get_signed_int = [](int var, int sign) { return (sign == 1) ? (var * 1) : (var * -1); };
81 
82  dTheta12 = aux().getdTheta(get_signed_int(dTheta12, dTheta12Sign));
83  dTheta13 = aux().getdTheta(get_signed_int(dTheta13, dTheta13Sign));
84  dTheta14 = aux().getdTheta(get_signed_int(dTheta14, dTheta14Sign));
85  dTheta23 = aux().getdTheta(get_signed_int(dTheta23, dTheta23Sign));
86  dTheta24 = aux().getdTheta(get_signed_int(dTheta24, dTheta24Sign));
87  dTheta34 = aux().getdTheta(get_signed_int(dTheta34, dTheta34Sign));
88 
89  bool use_FRLUT = true;
90  if (use_FRLUT) {
91  if (CSCID1 >= 16)
92  FR1 = aux().getFRLUT(track.Sector(), 1, CSCID1 - 16);
93  else
94  FR1 = aux().getFRLUT(track.Sector(), 0, CSCID1);
95  FR2 = aux().getFRLUT(track.Sector(), 2, CSCID2);
96  FR3 = aux().getFRLUT(track.Sector(), 3, CSCID3);
97  FR4 = aux().getFRLUT(track.Sector(), 4, CSCID4);
98  }
99 
100  switch (mode_inv) {
101  case 3: // 1-2
102  if (!bug9BitDPhi_)
103  dPhi12 = std::min(511, dPhi12);
104 
105  address |= (dPhi12 & ((1 << 9) - 1)) << (0);
106  address |= (sign12 & ((1 << 1) - 1)) << (0 + 9);
107  address |= (dTheta12 & ((1 << 3) - 1)) << (0 + 9 + 1);
108  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
109  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
110  address |= (CLCT2 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
111  address |= (CLCT2Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
112  address |= (FR1 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
113  address |= (FR2 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
114  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
115  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
116  break;
117 
118  case 5: // 1-3
119  if (!bug9BitDPhi_)
120  dPhi13 = std::min(511, dPhi13);
121 
122  address |= (dPhi13 & ((1 << 9) - 1)) << (0);
123  address |= (sign13 & ((1 << 1) - 1)) << (0 + 9);
124  address |= (dTheta13 & ((1 << 3) - 1)) << (0 + 9 + 1);
125  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
126  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
127  address |= (CLCT3 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
128  address |= (CLCT3Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
129  address |= (FR1 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
130  address |= (FR3 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
131  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
132  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
133  break;
134 
135  case 9: // 1-4
136  if (!bug9BitDPhi_)
137  dPhi14 = std::min(511, dPhi14);
138 
139  address |= (dPhi14 & ((1 << 9) - 1)) << (0);
140  address |= (sign14 & ((1 << 1) - 1)) << (0 + 9);
141  address |= (dTheta14 & ((1 << 3) - 1)) << (0 + 9 + 1);
142  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
143  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
144  address |= (CLCT4 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
145  address |= (CLCT4Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
146  address |= (FR1 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
147  address |= (FR4 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
148  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
149  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
150  break;
151 
152  case 6: // 2-3
153  if (!bug9BitDPhi_)
154  dPhi23 = std::min(511, dPhi23);
155 
156  address |= (dPhi23 & ((1 << 9) - 1)) << (0);
157  address |= (sign23 & ((1 << 1) - 1)) << (0 + 9);
158  address |= (dTheta23 & ((1 << 3) - 1)) << (0 + 9 + 1);
159  address |= (CLCT2 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
160  address |= (CLCT2Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
161  address |= (CLCT3 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
162  address |= (CLCT3Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
163  address |= (FR2 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
164  address |= (FR3 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
165  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
166  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
167  break;
168 
169  case 10: // 2-4
170  if (!bug9BitDPhi_)
171  dPhi24 = std::min(511, dPhi24);
172 
173  address |= (dPhi24 & ((1 << 9) - 1)) << (0);
174  address |= (sign24 & ((1 << 1) - 1)) << (0 + 9);
175  address |= (dTheta24 & ((1 << 3) - 1)) << (0 + 9 + 1);
176  address |= (CLCT2 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
177  address |= (CLCT2Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
178  address |= (CLCT4 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
179  address |= (CLCT4Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
180  address |= (FR2 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
181  address |= (FR4 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
182  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
183  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
184  break;
185 
186  case 12: // 3-4
187  if (!bug9BitDPhi_)
188  dPhi34 = std::min(511, dPhi34);
189 
190  address |= (dPhi34 & ((1 << 9) - 1)) << (0);
191  address |= (sign34 & ((1 << 1) - 1)) << (0 + 9);
192  address |= (dTheta34 & ((1 << 3) - 1)) << (0 + 9 + 1);
193  address |= (CLCT3 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3);
194  address |= (CLCT3Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2);
195  address |= (CLCT4 & ((1 << 2) - 1)) << (0 + 9 + 1 + 3 + 2 + 1);
196  address |= (CLCT4Sign & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2);
197  address |= (FR3 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1);
198  address |= (FR4 & ((1 << 1) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1);
199  address |= (theta & ((1 << 5) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1);
200  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1 + 5);
201  break;
202 
203  case 7: // 1-2-3
204  dPhi12 = aux().getNLBdPhiBin(dPhi12, 7, 512);
205  dPhi23 = aux().getNLBdPhiBin(dPhi23, 5, 256);
206 
207  address |= (dPhi12 & ((1 << 7) - 1)) << (0);
208  address |= (dPhi23 & ((1 << 5) - 1)) << (0 + 7);
209  address |= (sign12 & ((1 << 1) - 1)) << (0 + 7 + 5);
210  address |= (sign23 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1);
211  address |= (dTheta13 & ((1 << 3) - 1)) << (0 + 7 + 5 + 1 + 1);
212  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 7 + 5 + 1 + 1 + 3);
213  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2);
214  address |= (FR1 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1);
215  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1);
216  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1 + 5);
217  break;
218 
219  case 11: // 1-2-4
220  dPhi12 = aux().getNLBdPhiBin(dPhi12, 7, 512);
221  dPhi24 = aux().getNLBdPhiBin(dPhi24, 5, 256);
222 
223  address |= (dPhi12 & ((1 << 7) - 1)) << (0);
224  address |= (dPhi24 & ((1 << 5) - 1)) << (0 + 7);
225  address |= (sign12 & ((1 << 1) - 1)) << (0 + 7 + 5);
226  address |= (sign24 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1);
227  address |= (dTheta14 & ((1 << 3) - 1)) << (0 + 7 + 5 + 1 + 1);
228  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 7 + 5 + 1 + 1 + 3);
229  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2);
230  address |= (FR1 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1);
231  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1);
232  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1 + 5);
233  break;
234 
235  case 13: // 1-3-4
236  dPhi13 = aux().getNLBdPhiBin(dPhi13, 7, 512);
237  dPhi34 = aux().getNLBdPhiBin(dPhi34, 5, 256);
238 
239  address |= (dPhi13 & ((1 << 7) - 1)) << (0);
240  address |= (dPhi34 & ((1 << 5) - 1)) << (0 + 7);
241  address |= (sign13 & ((1 << 1) - 1)) << (0 + 7 + 5);
242  address |= (sign34 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1);
243  address |= (dTheta14 & ((1 << 3) - 1)) << (0 + 7 + 5 + 1 + 1);
244  address |= (CLCT1 & ((1 << 2) - 1)) << (0 + 7 + 5 + 1 + 1 + 3);
245  address |= (CLCT1Sign & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2);
246  address |= (FR1 & ((1 << 1) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1);
247  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1);
248  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1 + 5);
249  break;
250 
251  case 14: // 2-3-4
252  dPhi23 = aux().getNLBdPhiBin(dPhi23, 7, 512);
253  dPhi34 = aux().getNLBdPhiBin(dPhi34, 6, 256);
254 
255  address |= (dPhi23 & ((1 << 7) - 1)) << (0);
256  address |= (dPhi34 & ((1 << 6) - 1)) << (0 + 7);
257  address |= (sign23 & ((1 << 1) - 1)) << (0 + 7 + 6);
258  address |= (sign34 & ((1 << 1) - 1)) << (0 + 7 + 6 + 1);
259  address |= (dTheta24 & ((1 << 3) - 1)) << (0 + 7 + 6 + 1 + 1);
260  address |= (CLCT2 & ((1 << 2) - 1)) << (0 + 7 + 6 + 1 + 1 + 3);
261  address |= (CLCT2Sign & ((1 << 1) - 1)) << (0 + 7 + 6 + 1 + 1 + 3 + 2);
262  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 6 + 1 + 1 + 3 + 2 + 1);
263  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 6 + 1 + 1 + 3 + 2 + 1 + 5);
264  break;
265 
266  case 15: // 1-2-3-4
267  // Set sign23 and sign34 relative to sign12
268  if (!sign12) {
269  sign12 = !sign12;
270  sign23 = !sign23;
271  sign34 = !sign34;
272  }
273 
274  dPhi12 = aux().getNLBdPhiBin(dPhi12, 7, 512);
275  dPhi23 = aux().getNLBdPhiBin(dPhi23, 5, 256);
276  dPhi34 = aux().getNLBdPhiBin(dPhi34, 6, 256);
277 
278  address |= (dPhi12 & ((1 << 7) - 1)) << (0);
279  address |= (dPhi23 & ((1 << 5) - 1)) << (0 + 7);
280  address |= (dPhi34 & ((1 << 6) - 1)) << (0 + 7 + 5);
281  address |= (sign23 & ((1 << 1) - 1)) << (0 + 7 + 5 + 6);
282  address |= (sign34 & ((1 << 1) - 1)) << (0 + 7 + 5 + 6 + 1);
283  address |= (FR1 & ((1 << 1) - 1)) << (0 + 7 + 5 + 6 + 1 + 1);
284  address |= (theta & ((1 << 5) - 1)) << (0 + 7 + 5 + 6 + 1 + 1 + 1);
285  address |= (mode_inv & ((1 << 4) - 1)) << (0 + 7 + 5 + 6 + 1 + 1 + 1 + 5);
286  break;
287 
288  default:
289  break;
290  }
291 
292  return address;
293 }
int Theta_fp() const
Definition: EMTFTrack.h:167
uint16_t bt_ci[5]
Definition: EMTFTrack.h:30
uint16_t sign_ph[6]
Definition: EMTFTrack.h:24
int Sector() const
Definition: EMTFTrack.h:149
uint16_t bt_vi[5]
Definition: EMTFTrack.h:28
Geom::Theta< T > theta() const
int getNLBdPhiBin(int dPhi, int bits, int max=512) const
uint16_t delta_ph[6]
Definition: EMTFTrack.h:22
const PtAssignmentEngineAux2016 & aux() const
uint16_t delta_th[6]
Definition: EMTFTrack.h:23
int Mode_inv() const
Definition: EMTFTrack.h:155
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
uint16_t cpattern[4]
Definition: EMTFTrack.h:26
T min(T a, T b)
Definition: MathUtil.h:58
uint16_t fr[4]
Definition: EMTFTrack.h:27
uint16_t sign_th[6]
Definition: EMTFTrack.h:25
int getFRLUT(int sector, int station, int chamber) const
EMTFPtLUT PtLUT() const
Definition: EMTFTrack.h:116
float PtAssignmentEngine2016::calculate_pt_xml ( const address_t address) const
overridevirtual

Reimplemented from PtAssignmentEngine.

Definition at line 295 of file PtAssignmentEngine2016.cc.

References funct::abs(), PtAssignmentEngine::allowedModes_, aux(), PtAssignmentEngine::bugMode7CLCT_, PtAssignmentEngine::bugNegPt_, gather_cfg::cout, HTMLExport::elem(), PVValHelper::eta, spr::find(), PtAssignmentEngine::fixMode15HighPt_, PtAssignmentEngine::forests_, PtAssignmentEngineAux2016::getdPhiFromBin(), PtAssignmentEngineAux2016::getEtaFromEtaInt(), PtAssignmentEngineAux2016::getEtaFromThetaInt(), PtAssignmentEngineAux2016::getEtaInt(), PtAssignmentEngineAux2016::getModeVariables(), mps_fire::i, createfilelist::int, emtf::Forest::predictEvent(), DiDispStaMuonMonitor_cfi::pt, Validation_hcalonly_cfi::sign, theta(), findQualityFiles::v, trigObjTnPSource_cfi::var, L1TEGammaDiff_cfi::variables, and PtAssignmentEngine::verbose_.

Referenced by ~PtAssignmentEngine2016().

295  {
296  float pt = 0.;
297 
298  if (address == 0) // invalid address
299  return -1; // return pt;
300 
301  int mode_inv = (address >> (30 - 4)) & ((1 << 4) - 1);
302 
303  auto contain = [](const std::vector<int>& vec, int elem) {
304  return (std::find(vec.begin(), vec.end(), elem) != vec.end());
305  };
306 
307  bool is_good_mode = contain(allowedModes_, mode_inv);
308 
309  if (!is_good_mode) // invalid mode
310  return -1; // return pt;
311 
312  int dPhi12 = -999;
313  int dPhi13 = -999;
314  int dPhi14 = -999;
315  int dPhi23 = -999;
316  int dPhi24 = -999;
317  int dPhi34 = -999;
318  int dTheta12 = -999;
319  int dTheta13 = -999;
320  int dTheta14 = -999;
321  int dTheta23 = -999;
322  int dTheta24 = -999;
323  int dTheta34 = -999;
324  int CLCT1 = -999;
325  int CLCT2 = -999;
326  int CLCT3 = -999;
327  int CLCT4 = -999;
328  int CSCID1 = -999;
329  int CSCID2 = -999;
330  int CSCID3 = -999;
331  int CSCID4 = -999;
332  int FR1 = -999;
333  int FR2 = -999;
334  int FR3 = -999;
335  int FR4 = -999;
336 
337  int sign12 = 1;
338  int sign13 = 1;
339  int sign14 = 1;
340  int sign23 = 1;
341  int sign24 = 1;
342  int sign34 = 1;
343 
344  int CLCT1Sign = 1;
345  int CLCT2Sign = 1;
346  int CLCT3Sign = 1;
347  int CLCT4Sign = 1;
348 
349  int theta = 0;
350 
351  switch (mode_inv) {
352  case 3: // 1-2
353  dPhi12 = (address >> (0)) & ((1 << 9) - 1);
354  sign12 = (address >> (0 + 9)) & ((1 << 1) - 1);
355  dTheta12 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
356  CLCT1 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
357  CLCT1Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
358  CLCT2 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
359  CLCT2Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
360  FR1 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
361  FR2 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
362  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
363  break;
364 
365  case 5: // 1-3
366  dPhi13 = (address >> (0)) & ((1 << 9) - 1);
367  sign13 = (address >> (0 + 9)) & ((1 << 1) - 1);
368  dTheta13 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
369  CLCT1 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
370  CLCT1Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
371  CLCT3 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
372  CLCT3Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
373  FR1 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
374  FR3 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
375  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
376  break;
377 
378  case 9: // 1-4
379  dPhi14 = (address >> (0)) & ((1 << 9) - 1);
380  sign14 = (address >> (0 + 9)) & ((1 << 1) - 1);
381  dTheta14 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
382  CLCT1 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
383  CLCT1Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
384  CLCT4 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
385  CLCT4Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
386  FR1 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
387  FR4 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
388  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
389  break;
390 
391  case 6: // 2-3
392  dPhi23 = (address >> (0)) & ((1 << 9) - 1);
393  sign23 = (address >> (0 + 9)) & ((1 << 1) - 1);
394  dTheta23 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
395  CLCT2 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
396  CLCT2Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
397  CLCT3 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
398  CLCT3Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
399  FR2 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
400  FR3 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
401  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
402  break;
403 
404  case 10: // 2-4
405  dPhi24 = (address >> (0)) & ((1 << 9) - 1);
406  sign24 = (address >> (0 + 9)) & ((1 << 1) - 1);
407  dTheta24 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
408  CLCT2 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
409  CLCT2Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
410  CLCT4 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
411  CLCT4Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
412  FR2 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
413  FR4 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
414  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
415  break;
416 
417  case 12: // 3-4
418  dPhi34 = (address >> (0)) & ((1 << 9) - 1);
419  sign34 = (address >> (0 + 9)) & ((1 << 1) - 1);
420  dTheta34 = (address >> (0 + 9 + 1)) & ((1 << 3) - 1);
421  CLCT3 = (address >> (0 + 9 + 1 + 3)) & ((1 << 2) - 1);
422  CLCT3Sign = (address >> (0 + 9 + 1 + 3 + 2)) & ((1 << 1) - 1);
423  CLCT4 = (address >> (0 + 9 + 1 + 3 + 2 + 1)) & ((1 << 2) - 1);
424  CLCT4Sign = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2)) & ((1 << 1) - 1);
425  FR3 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1)) & ((1 << 1) - 1);
426  FR4 = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1)) & ((1 << 1) - 1);
427  theta = (address >> (0 + 9 + 1 + 3 + 2 + 1 + 2 + 1 + 1 + 1)) & ((1 << 5) - 1);
428  break;
429 
430  case 7: // 1-2-3
431  dPhi12 = (address >> (0)) & ((1 << 7) - 1);
432  dPhi23 = (address >> (0 + 7)) & ((1 << 5) - 1);
433  sign12 = (address >> (0 + 7 + 5)) & ((1 << 1) - 1);
434  sign23 = (address >> (0 + 7 + 5 + 1)) & ((1 << 1) - 1);
435  dTheta13 = (address >> (0 + 7 + 5 + 1 + 1)) & ((1 << 3) - 1);
436  CLCT1 = (address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1);
437  CLCT1Sign = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2)) & ((1 << 1) - 1);
438  FR1 = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1)) & ((1 << 1) - 1);
439  theta = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1)) & ((1 << 5) - 1);
440 
441  dPhi12 = aux().getdPhiFromBin(dPhi12, 7, 512);
442  dPhi23 = aux().getdPhiFromBin(dPhi23, 5, 256);
443  break;
444 
445  case 11: // 1-2-4
446  dPhi12 = (address >> (0)) & ((1 << 7) - 1);
447  dPhi24 = (address >> (0 + 7)) & ((1 << 5) - 1);
448  sign12 = (address >> (0 + 7 + 5)) & ((1 << 1) - 1);
449  sign24 = (address >> (0 + 7 + 5 + 1)) & ((1 << 1) - 1);
450  dTheta14 = (address >> (0 + 7 + 5 + 1 + 1)) & ((1 << 3) - 1);
451  CLCT1 = (address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1);
452  CLCT1Sign = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2)) & ((1 << 1) - 1);
453  FR1 = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1)) & ((1 << 1) - 1);
454  theta = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1)) & ((1 << 5) - 1);
455 
456  dPhi12 = aux().getdPhiFromBin(dPhi12, 7, 512);
457  dPhi24 = aux().getdPhiFromBin(dPhi24, 5, 256);
458  break;
459 
460  case 13: // 1-3-4
461  dPhi13 = (address >> (0)) & ((1 << 7) - 1);
462  dPhi34 = (address >> (0 + 7)) & ((1 << 5) - 1);
463  sign13 = (address >> (0 + 7 + 5)) & ((1 << 1) - 1);
464  sign34 = (address >> (0 + 7 + 5 + 1)) & ((1 << 1) - 1);
465  dTheta14 = (address >> (0 + 7 + 5 + 1 + 1)) & ((1 << 3) - 1);
466  CLCT1 = (address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1);
467  CLCT1Sign = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2)) & ((1 << 1) - 1);
468  FR1 = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1)) & ((1 << 1) - 1);
469  theta = (address >> (0 + 7 + 5 + 1 + 1 + 3 + 2 + 1 + 1)) & ((1 << 5) - 1);
470 
471  dPhi13 = aux().getdPhiFromBin(dPhi13, 7, 512);
472  dPhi34 = aux().getdPhiFromBin(dPhi34, 5, 256);
473  break;
474 
475  case 14: // 2-3-4
476  dPhi23 = (address >> (0)) & ((1 << 7) - 1);
477  dPhi34 = (address >> (0 + 7)) & ((1 << 6) - 1);
478  sign23 = (address >> (0 + 7 + 6)) & ((1 << 1) - 1);
479  sign34 = (address >> (0 + 7 + 6 + 1)) & ((1 << 1) - 1);
480  dTheta24 = (address >> (0 + 7 + 6 + 1 + 1)) & ((1 << 3) - 1);
481  CLCT2 = (address >> (0 + 7 + 6 + 1 + 1 + 3)) & ((1 << 2) - 1);
482  CLCT2Sign = (address >> (0 + 7 + 6 + 1 + 1 + 3 + 2)) & ((1 << 1) - 1);
483  theta = (address >> (0 + 7 + 6 + 1 + 1 + 3 + 2 + 1)) & ((1 << 5) - 1);
484 
485  dPhi23 = aux().getdPhiFromBin(dPhi23, 7, 512);
486  dPhi34 = aux().getdPhiFromBin(dPhi34, 6, 256);
487  break;
488 
489  case 15: // 1-2-3-4
490  dPhi12 = (address >> (0)) & ((1 << 7) - 1);
491  dPhi23 = (address >> (0 + 7)) & ((1 << 5) - 1);
492  dPhi34 = (address >> (0 + 7 + 5)) & ((1 << 6) - 1);
493  sign23 = (address >> (0 + 7 + 5 + 6)) & ((1 << 1) - 1);
494  sign34 = (address >> (0 + 7 + 5 + 6 + 1)) & ((1 << 1) - 1);
495  FR1 = (address >> (0 + 7 + 5 + 6 + 1 + 1)) & ((1 << 1) - 1);
496  theta = (address >> (0 + 7 + 5 + 6 + 1 + 1 + 1)) & ((1 << 5) - 1);
497 
498  dPhi12 = aux().getdPhiFromBin(dPhi12, 7, 512);
499  dPhi23 = aux().getdPhiFromBin(dPhi23, 5, 256);
500  dPhi34 = aux().getdPhiFromBin(dPhi34, 6, 256);
501  break;
502 
503  default:
504  break;
505  }
506 
507  auto get_signed_int = [](int var, int sign) { return (sign == 1) ? (var * 1) : (var * -1); };
508 
509  dPhi12 = get_signed_int(dPhi12, sign12);
510  dPhi13 = get_signed_int(dPhi13, sign13);
511  dPhi14 = get_signed_int(dPhi14, sign14);
512  dPhi23 = get_signed_int(dPhi23, sign23);
513  dPhi24 = get_signed_int(dPhi24, sign24);
514  dPhi34 = get_signed_int(dPhi34, sign34);
515 
516  CLCT1 = get_signed_int(CLCT1, CLCT1Sign);
517  CLCT2 = get_signed_int(CLCT2, CLCT2Sign);
518  CLCT3 = get_signed_int(CLCT3, CLCT3Sign);
519  CLCT4 = get_signed_int(CLCT4, CLCT4Sign);
520 
521  theta <<= 2;
522  float eta = aux().getEtaFromThetaInt(theta, 5);
523 
524  bool use_lossy_eta = true;
525  if (use_lossy_eta) {
526  int etaInt = aux().getEtaInt(eta, 5);
527  etaInt &= ((1 << 5) - 1);
528  eta = aux().getEtaFromEtaInt(etaInt, 5);
529  }
530 
531  // First fix to recover high pT muons with 3 hits in a line and one displaced hit
532  // Done by re-writing a few addresses in the original LUT, according to the following logic
533  // Implemented in FW 26.07.16, as of run 2774278 / fill 5119
534  if (fixMode15HighPt_) {
535  if (mode_inv == 15) { // 1-2-3-4
536  bool st2_off = false;
537  bool st3_off = false;
538  bool st4_off = false;
539 
540  dPhi13 = dPhi12 + dPhi23;
541  dPhi14 = dPhi13 + dPhi34;
542  dPhi24 = dPhi23 + dPhi34;
543 
544  int sum_st1 = abs(dPhi12 + dPhi13 + dPhi14);
545  int sum_st2 = abs(-dPhi12 + dPhi23 + dPhi24);
546  int sum_st3 = abs(-dPhi13 - dPhi23 + dPhi34);
547  int sum_st4 = abs(-dPhi14 - dPhi24 - dPhi34);
548 
549  // Detect outliers
550  if (sum_st2 > sum_st1 && sum_st2 > sum_st3 && sum_st2 > sum_st4)
551  st2_off = true;
552  if (sum_st3 > sum_st1 && sum_st3 > sum_st2 && sum_st3 > sum_st4)
553  st3_off = true;
554  if (sum_st4 > sum_st1 && sum_st4 > sum_st2 && sum_st4 > sum_st3)
555  st4_off = true;
556 
557  // Recover outliers
558  if (st2_off) {
559  if ((abs(dPhi12) > 9 || abs(dPhi23) > 9 || abs(dPhi24) > 9) &&
560  (abs(dPhi13) < 10 && abs(dPhi14) < 10 && abs(dPhi34) < 10)) {
561  dPhi12 = dPhi13 / 2;
562  dPhi23 = dPhi13 / 2;
563  }
564  }
565  if (st3_off) {
566  if ((abs(dPhi13) > 9 || abs(dPhi23) > 9 || abs(dPhi34) > 9) &&
567  (abs(dPhi12) < 10 && abs(dPhi14) < 10 && abs(dPhi24) < 10)) {
568  dPhi23 = dPhi24 / 2;
569  dPhi34 = dPhi24 / 2;
570  }
571  }
572  if (st4_off) {
573  if ((abs(dPhi14) > 9 || abs(dPhi24) > 9 || abs(dPhi34) > 9) &&
574  (abs(dPhi12) < 10 && abs(dPhi13) < 10 && abs(dPhi23) < 10)) {
575  if (abs(dPhi13) < abs(dPhi23))
576  dPhi34 = dPhi13;
577  else
578  dPhi34 = dPhi23;
579  }
580  }
581 
582  // Set sign23 and sign34 relative to sign12
583  //sign12 = (dPhi12 >= 0);
584  //sign23 = (dPhi23 >= 0);
585  //sign34 = (dPhi34 >= 0);
586  //if (!sign12) {
587  // sign12 = !sign12;
588  // sign23 = !sign23;
589  // sign34 = !sign34;
590  //}
591 
592  sign12 = 1;
593  if (dPhi12 > 0) {
594  sign23 = (dPhi23 > 0) ? 1 : 0;
595  sign34 = (dPhi34 > 0) ? 1 : 0;
596  } else {
597  sign23 = (dPhi23 < 0) ? 1 : 0;
598  sign34 = (dPhi34 < 0) ? 1 : 0;
599  }
600 
601  dPhi12 = get_signed_int(abs(dPhi12), sign12);
602  dPhi23 = get_signed_int(abs(dPhi23), sign23);
603  dPhi34 = get_signed_int(abs(dPhi34), sign34);
604 
605  } // end if mode_inv == 15
606  }
607 
608  // Inherit some bugs
609  if (bugMode7CLCT_) {
610  if (mode_inv == 14) { // 2-3-4
611  int bugged_CLCT2;
612  address_t bugged_address;
613 
614  //CLCT2 = (address >> (0+7+6+1+1+3)) & ((1<<2)-1);
615  //address |= (CLCT2 & ((1<<2)-1)) << (0+7+6+1+1+3);
616 
617  bugged_CLCT2 = (address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1); // bad
618  bugged_address = address & ~(((1 << 2) - 1) << (0 + 7 + 6 + 1 + 1 + 3)); // clear bits
619  bugged_address |= (bugged_CLCT2 & ((1 << 2) - 1)) << (0 + 7 + 6 + 1 + 1 + 3);
620  bugged_CLCT2 = (bugged_address >> (0 + 7 + 5 + 1 + 1 + 3)) & ((1 << 2) - 1); // bad
621 
622  CLCT2 = bugged_CLCT2;
623  CLCT2 = get_signed_int(CLCT2, CLCT2Sign);
624 
625  } // end if mode_inv == 14
626  }
627 
628  // Get pT from XML (forest)
629  const int(*mode_variables)[6] = aux().getModeVariables();
630 
631  std::vector<int> variables = {dPhi12, dPhi13, dPhi14, dPhi23, dPhi24, dPhi34, dTheta12, dTheta13,
632  dTheta14, dTheta23, dTheta24, dTheta34, CLCT1, CLCT2, CLCT3, CLCT4,
633  CSCID1, CSCID2, CSCID3, CSCID4, FR1, FR2, FR3, FR4};
634 
635  std::vector<double> tree_data;
636  tree_data.push_back(1.0);
637  tree_data.push_back(eta);
638 
639  for (int i = 0; i < 6; i++) { // loop over 6 variables (or less)
640  int mv = mode_variables[mode_inv - 3][i];
641  if (mv != -999) {
642  int v = variables.at(mv);
643  if (!(mode_inv == 13 && i == 3)) { // somehow this uses CSCID1
644  if (not(v != -999)) {
645  edm::LogError("L1T") << "v = " << v;
646  return -1;
647  }
648  }
649  tree_data.push_back(v);
650  } else {
651  tree_data.push_back(0); // pad with zeroes, somehow BDT tries to access out of bounds
652  }
653  }
654 
655  if (verbose_ > 2) {
656  std::cout << "mode_inv: " << mode_inv << " variables: ";
657  for (const auto& v : tree_data)
658  std::cout << v << " ";
659  std::cout << std::endl;
660  }
661 
662  auto tree_event = std::make_unique<emtf::Event>();
663  tree_event->predictedValue = 0; // must explicitly initialize
664  tree_event->data = tree_data;
665 
666  // forests_.at(mode_inv).predictEvent(tree_event.get(), 64);
667  emtf::Forest& forest = const_cast<emtf::Forest&>(forests_.at(mode_inv));
668  forest.predictEvent(tree_event.get(), 64);
669 
670  float tmp_pt = tree_event->predictedValue; // is actually 1/pT
671 
672  if (verbose_ > 1) {
673  std::cout << "mode_inv: " << mode_inv << " 1/pT: " << tmp_pt << std::endl;
674  std::cout << "dPhi12: " << dPhi12 << " dPhi13: " << dPhi13 << " dPhi14: " << dPhi14 << " dPhi23: " << dPhi23
675  << " dPhi24: " << dPhi24 << " dPhi34: " << dPhi34 << std::endl;
676  std::cout << "dTheta12: " << dTheta12 << " dTheta13: " << dTheta13 << " dTheta14: " << dTheta14
677  << " dTheta23: " << dTheta23 << " dTheta24: " << dTheta24 << " dTheta34: " << dTheta34 << std::endl;
678  std::cout << "CLCT1: " << CLCT1 << " CLCT2: " << CLCT2 << " CLCT3: " << CLCT3 << " CLCT4: " << CLCT4 << std::endl;
679  std::cout << "CSCID1: " << CSCID1 << " CSCID2: " << CSCID2 << " CSCID3: " << CSCID3 << " CSCID4: " << CSCID4
680  << std::endl;
681  std::cout << "FR1: " << FR1 << " FR2: " << FR2 << " FR3: " << FR3 << " FR4: " << FR4 << std::endl;
682  }
683 
684  if (bugNegPt_) {
685  pt = (tmp_pt == 0) ? tmp_pt : 1.0 / tmp_pt;
686  if (pt < 0.0)
687  pt = 1.0;
688  if (pt > 200.0)
689  pt = 200.0;
690 
691  } else {
692  if (tmp_pt < 0.0)
693  tmp_pt = 1.0 / 7000;
694  pt = (tmp_pt == 0) ? tmp_pt : 1.0 / tmp_pt;
695  }
696 
697  assert(pt > 0);
698  return pt;
699 }
void predictEvent(Event *e, unsigned int trees)
Definition: Forest.cc:440
int getdPhiFromBin(int dPhiBin, int bits, int max=512) const
Geom::Theta< T > theta() const
int getEtaInt(float eta, int bits=5) const
float getEtaFromEtaInt(int etaInt, int bits=5) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const PtAssignmentEngineAux2016 & aux() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int(* getModeVariables() const)[6]
def elem(elemtype, innerHTML='', html_class='', kwargs)
Definition: HTMLExport.py:19
std::array< emtf::Forest, 16 > forests_
float getEtaFromThetaInt(int thetaInt, int bits=5) const
std::vector< int > allowedModes_
float PtAssignmentEngine2016::calculate_pt_xml ( const EMTFTrack track) const
overridevirtual

Reimplemented from PtAssignmentEngine.

Definition at line 702 of file PtAssignmentEngine2016.cc.

References DiDispStaMuonMonitor_cfi::pt.

702  {
703  float pt = 0.;
704 
705  return pt;
706 }
float PtAssignmentEngine2016::scale_pt ( const float  pt,
const int  mode = 15 
) const
overridevirtual

Implements PtAssignmentEngine.

Definition at line 13 of file PtAssignmentEngine2016.cc.

Referenced by ~PtAssignmentEngine2016().

13  {
14  // Scaling to achieve 90% efficency at any given L1 pT threshold
15  // For 2016, was a flat scaling factor of 1.4
16 
17  float pt_scale = 1.4;
18 
19  return pt_scale;
20 }
float PtAssignmentEngine2016::unscale_pt ( const float  pt,
const int  mode = 15 
) const
overridevirtual

Implements PtAssignmentEngine.

Definition at line 22 of file PtAssignmentEngine2016.cc.

Referenced by ~PtAssignmentEngine2016().

22  {
23  float pt_unscale = 1. / 1.4;
24  return pt_unscale;
25 }