CMS 3D CMS Logo

L1ExtraParticleMapProd.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1ExtraParticleMapProd
4 // Class: L1ExtraParticleMapProd
5 //
10 //
11 // Original Author: Werner Sun
12 // Created: Mon Oct 16 23:19:38 EDT 2006
13 //
14 //
15 
16 // system include files
17 #include <memory>
18 
19 // user include files
21 
22 //#include "FWCore/Framework/interface/MakerMacros.h"
23 
26 
27 #include "CLHEP/Random/RandFlat.h"
28 
29 static const int kDefault = -1;
30 
31 //
32 // constants, enums and typedefs
33 //
34 
35 //
36 // static data member definitions
37 //
38 
39 //
40 // constructors and destructor
41 //
43  : muonSource_(iConfig.getParameter<edm::InputTag>("muonSource")),
44  isoEmSource_(iConfig.getParameter<edm::InputTag>("isolatedEmSource")),
45  nonIsoEmSource_(
46  iConfig.getParameter<edm::InputTag>("nonIsolatedEmSource")),
47  cenJetSource_(iConfig.getParameter<edm::InputTag>("centralJetSource")),
48  forJetSource_(iConfig.getParameter<edm::InputTag>("forwardJetSource")),
49  tauJetSource_(iConfig.getParameter<edm::InputTag>("tauJetSource")),
50  etMissSource_(iConfig.getParameter<edm::InputTag>("etMissSource")),
51  htMissSource_(iConfig.getParameter<edm::InputTag>("htMissSource")) {
52  using namespace l1extra;
53 
54  // register your products
55  produces<L1ParticleMapCollection>();
56  produces<L1GlobalTriggerReadoutRecord>();
57 
58  // now do what ever other initialization is needed
59  for (int i = 0; i < L1ParticleMap::kNumOfL1TriggerTypes; ++i) {
60  singleThresholds_[i] = 0.;
61  doubleThresholds_[i].first = 0.;
62  doubleThresholds_[i].second = 0.;
63  prescaleCounters_[i] = 1;
64  prescales_[i] = 1;
65  }
66 
67  // Single object triggers, 5 thresholds each
68 
69  singleThresholds_[L1ParticleMap::kSingleMu3] =
70  iConfig.getParameter<double>("L1_SingleMu3_thresh");
71  prescales_[L1ParticleMap::kSingleMu3] =
72  iConfig.getParameter<int>("L1_SingleMu3_prescale");
73  singleThresholds_[L1ParticleMap::kSingleMu5] =
74  iConfig.getParameter<double>("L1_SingleMu5_thresh");
75  prescales_[L1ParticleMap::kSingleMu5] =
76  iConfig.getParameter<int>("L1_SingleMu5_prescale");
77  singleThresholds_[L1ParticleMap::kSingleMu7] =
78  iConfig.getParameter<double>("L1_SingleMu7_thresh");
79  prescales_[L1ParticleMap::kSingleMu7] =
80  iConfig.getParameter<int>("L1_SingleMu7_prescale");
81  singleThresholds_[L1ParticleMap::kSingleMu10] =
82  iConfig.getParameter<double>("L1_SingleMu10_thresh");
83  prescales_[L1ParticleMap::kSingleMu10] =
84  iConfig.getParameter<int>("L1_SingleMu10_prescale");
85  singleThresholds_[L1ParticleMap::kSingleMu14] =
86  iConfig.getParameter<double>("L1_SingleMu14_thresh");
87  prescales_[L1ParticleMap::kSingleMu14] =
88  iConfig.getParameter<int>("L1_SingleMu14_prescale");
89  singleThresholds_[L1ParticleMap::kSingleMu20] =
90  iConfig.getParameter<double>("L1_SingleMu20_thresh");
91  prescales_[L1ParticleMap::kSingleMu20] =
92  iConfig.getParameter<int>("L1_SingleMu20_prescale");
93  singleThresholds_[L1ParticleMap::kSingleMu25] =
94  iConfig.getParameter<double>("L1_SingleMu25_thresh");
95  prescales_[L1ParticleMap::kSingleMu25] =
96  iConfig.getParameter<int>("L1_SingleMu25_prescale");
97 
98  singleThresholds_[L1ParticleMap::kSingleIsoEG5] =
99  iConfig.getParameter<double>("L1_SingleIsoEG5_thresh");
100  prescales_[L1ParticleMap::kSingleIsoEG5] =
101  iConfig.getParameter<int>("L1_SingleIsoEG5_prescale");
102  singleThresholds_[L1ParticleMap::kSingleIsoEG8] =
103  iConfig.getParameter<double>("L1_SingleIsoEG8_thresh");
104  prescales_[L1ParticleMap::kSingleIsoEG8] =
105  iConfig.getParameter<int>("L1_SingleIsoEG8_prescale");
106  singleThresholds_[L1ParticleMap::kSingleIsoEG10] =
107  iConfig.getParameter<double>("L1_SingleIsoEG10_thresh");
108  prescales_[L1ParticleMap::kSingleIsoEG10] =
109  iConfig.getParameter<int>("L1_SingleIsoEG10_prescale");
110  singleThresholds_[L1ParticleMap::kSingleIsoEG12] =
111  iConfig.getParameter<double>("L1_SingleIsoEG12_thresh");
112  prescales_[L1ParticleMap::kSingleIsoEG12] =
113  iConfig.getParameter<int>("L1_SingleIsoEG12_prescale");
114  singleThresholds_[L1ParticleMap::kSingleIsoEG15] =
115  iConfig.getParameter<double>("L1_SingleIsoEG15_thresh");
116  prescales_[L1ParticleMap::kSingleIsoEG15] =
117  iConfig.getParameter<int>("L1_SingleIsoEG15_prescale");
118  singleThresholds_[L1ParticleMap::kSingleIsoEG20] =
119  iConfig.getParameter<double>("L1_SingleIsoEG20_thresh");
120  prescales_[L1ParticleMap::kSingleIsoEG20] =
121  iConfig.getParameter<int>("L1_SingleIsoEG20_prescale");
122  singleThresholds_[L1ParticleMap::kSingleIsoEG25] =
123  iConfig.getParameter<double>("L1_SingleIsoEG25_thresh");
124  prescales_[L1ParticleMap::kSingleIsoEG25] =
125  iConfig.getParameter<int>("L1_SingleIsoEG25_prescale");
126 
127  singleThresholds_[L1ParticleMap::kSingleEG5] =
128  iConfig.getParameter<double>("L1_SingleEG5_thresh");
129  prescales_[L1ParticleMap::kSingleEG5] =
130  iConfig.getParameter<int>("L1_SingleEG5_prescale");
131  singleThresholds_[L1ParticleMap::kSingleEG8] =
132  iConfig.getParameter<double>("L1_SingleEG8_thresh");
133  prescales_[L1ParticleMap::kSingleEG8] =
134  iConfig.getParameter<int>("L1_SingleEG8_prescale");
135  singleThresholds_[L1ParticleMap::kSingleEG10] =
136  iConfig.getParameter<double>("L1_SingleEG10_thresh");
137  prescales_[L1ParticleMap::kSingleEG10] =
138  iConfig.getParameter<int>("L1_SingleEG10_prescale");
139  singleThresholds_[L1ParticleMap::kSingleEG12] =
140  iConfig.getParameter<double>("L1_SingleEG12_thresh");
141  prescales_[L1ParticleMap::kSingleEG12] =
142  iConfig.getParameter<int>("L1_SingleEG12_prescale");
143  singleThresholds_[L1ParticleMap::kSingleEG15] =
144  iConfig.getParameter<double>("L1_SingleEG15_thresh");
145  prescales_[L1ParticleMap::kSingleEG15] =
146  iConfig.getParameter<int>("L1_SingleEG15_prescale");
147  singleThresholds_[L1ParticleMap::kSingleEG20] =
148  iConfig.getParameter<double>("L1_SingleEG20_thresh");
149  prescales_[L1ParticleMap::kSingleEG20] =
150  iConfig.getParameter<int>("L1_SingleEG20_prescale");
151  singleThresholds_[L1ParticleMap::kSingleEG25] =
152  iConfig.getParameter<double>("L1_SingleEG25_thresh");
153  prescales_[L1ParticleMap::kSingleEG25] =
154  iConfig.getParameter<int>("L1_SingleEG25_prescale");
155 
156  singleThresholds_[L1ParticleMap::kSingleJet15] =
157  iConfig.getParameter<double>("L1_SingleJet15_thresh");
158  prescales_[L1ParticleMap::kSingleJet15] =
159  iConfig.getParameter<int>("L1_SingleJet15_prescale");
160  singleThresholds_[L1ParticleMap::kSingleJet20] =
161  iConfig.getParameter<double>("L1_SingleJet20_thresh");
162  prescales_[L1ParticleMap::kSingleJet20] =
163  iConfig.getParameter<int>("L1_SingleJet20_prescale");
164  singleThresholds_[L1ParticleMap::kSingleJet30] =
165  iConfig.getParameter<double>("L1_SingleJet30_thresh");
166  prescales_[L1ParticleMap::kSingleJet30] =
167  iConfig.getParameter<int>("L1_SingleJet30_prescale");
168  singleThresholds_[L1ParticleMap::kSingleJet50] =
169  iConfig.getParameter<double>("L1_SingleJet50_thresh");
170  prescales_[L1ParticleMap::kSingleJet50] =
171  iConfig.getParameter<int>("L1_SingleJet50_prescale");
172  singleThresholds_[L1ParticleMap::kSingleJet70] =
173  iConfig.getParameter<double>("L1_SingleJet70_thresh");
174  prescales_[L1ParticleMap::kSingleJet70] =
175  iConfig.getParameter<int>("L1_SingleJet70_prescale");
176  singleThresholds_[L1ParticleMap::kSingleJet100] =
177  iConfig.getParameter<double>("L1_SingleJet100_thresh");
178  prescales_[L1ParticleMap::kSingleJet100] =
179  iConfig.getParameter<int>("L1_SingleJet100_prescale");
180  singleThresholds_[L1ParticleMap::kSingleJet150] =
181  iConfig.getParameter<double>("L1_SingleJet150_thresh");
182  prescales_[L1ParticleMap::kSingleJet150] =
183  iConfig.getParameter<int>("L1_SingleJet150_prescale");
184  singleThresholds_[L1ParticleMap::kSingleJet200] =
185  iConfig.getParameter<double>("L1_SingleJet200_thresh");
186  prescales_[L1ParticleMap::kSingleJet200] =
187  iConfig.getParameter<int>("L1_SingleJet200_prescale");
188 
189  singleThresholds_[L1ParticleMap::kSingleTauJet10] =
190  iConfig.getParameter<double>("L1_SingleTauJet10_thresh");
191  prescales_[L1ParticleMap::kSingleTauJet10] =
192  iConfig.getParameter<int>("L1_SingleTauJet10_prescale");
193  singleThresholds_[L1ParticleMap::kSingleTauJet20] =
194  iConfig.getParameter<double>("L1_SingleTauJet20_thresh");
195  prescales_[L1ParticleMap::kSingleTauJet20] =
196  iConfig.getParameter<int>("L1_SingleTauJet20_prescale");
197  singleThresholds_[L1ParticleMap::kSingleTauJet30] =
198  iConfig.getParameter<double>("L1_SingleTauJet30_thresh");
199  prescales_[L1ParticleMap::kSingleTauJet30] =
200  iConfig.getParameter<int>("L1_SingleTauJet30_prescale");
201  singleThresholds_[L1ParticleMap::kSingleTauJet35] =
202  iConfig.getParameter<double>("L1_SingleTauJet35_thresh");
203  prescales_[L1ParticleMap::kSingleTauJet35] =
204  iConfig.getParameter<int>("L1_SingleTauJet35_prescale");
205  singleThresholds_[L1ParticleMap::kSingleTauJet40] =
206  iConfig.getParameter<double>("L1_SingleTauJet40_thresh");
207  prescales_[L1ParticleMap::kSingleTauJet40] =
208  iConfig.getParameter<int>("L1_SingleTauJet40_prescale");
209  singleThresholds_[L1ParticleMap::kSingleTauJet60] =
210  iConfig.getParameter<double>("L1_SingleTauJet60_thresh");
211  prescales_[L1ParticleMap::kSingleTauJet60] =
212  iConfig.getParameter<int>("L1_SingleTauJet60_prescale");
213  singleThresholds_[L1ParticleMap::kSingleTauJet80] =
214  iConfig.getParameter<double>("L1_SingleTauJet80_thresh");
215  prescales_[L1ParticleMap::kSingleTauJet80] =
216  iConfig.getParameter<int>("L1_SingleTauJet80_prescale");
217  singleThresholds_[L1ParticleMap::kSingleTauJet100] =
218  iConfig.getParameter<double>("L1_SingleTauJet100_thresh");
219  prescales_[L1ParticleMap::kSingleTauJet100] =
220  iConfig.getParameter<int>("L1_SingleTauJet100_prescale");
221 
222  singleThresholds_[L1ParticleMap::kHTT100] =
223  iConfig.getParameter<double>("L1_HTT100_thresh");
224  prescales_[L1ParticleMap::kHTT100] =
225  iConfig.getParameter<int>("L1_HTT100_prescale");
226  singleThresholds_[L1ParticleMap::kHTT200] =
227  iConfig.getParameter<double>("L1_HTT200_thresh");
228  prescales_[L1ParticleMap::kHTT200] =
229  iConfig.getParameter<int>("L1_HTT200_prescale");
230  singleThresholds_[L1ParticleMap::kHTT250] =
231  iConfig.getParameter<double>("L1_HTT250_thresh");
232  prescales_[L1ParticleMap::kHTT250] =
233  iConfig.getParameter<int>("L1_HTT250_prescale");
234  singleThresholds_[L1ParticleMap::kHTT300] =
235  iConfig.getParameter<double>("L1_HTT300_thresh");
236  prescales_[L1ParticleMap::kHTT300] =
237  iConfig.getParameter<int>("L1_HTT300_prescale");
238  singleThresholds_[L1ParticleMap::kHTT400] =
239  iConfig.getParameter<double>("L1_HTT400_thresh");
240  prescales_[L1ParticleMap::kHTT400] =
241  iConfig.getParameter<int>("L1_HTT400_prescale");
242  singleThresholds_[L1ParticleMap::kHTT500] =
243  iConfig.getParameter<double>("L1_HTT500_thresh");
244  prescales_[L1ParticleMap::kHTT500] =
245  iConfig.getParameter<int>("L1_HTT500_prescale");
246 
247  singleThresholds_[L1ParticleMap::kETM10] =
248  iConfig.getParameter<double>("L1_ETM10_thresh");
249  prescales_[L1ParticleMap::kETM10] =
250  iConfig.getParameter<int>("L1_ETM10_prescale");
251  singleThresholds_[L1ParticleMap::kETM15] =
252  iConfig.getParameter<double>("L1_ETM15_thresh");
253  prescales_[L1ParticleMap::kETM15] =
254  iConfig.getParameter<int>("L1_ETM15_prescale");
255  singleThresholds_[L1ParticleMap::kETM20] =
256  iConfig.getParameter<double>("L1_ETM20_thresh");
257  prescales_[L1ParticleMap::kETM20] =
258  iConfig.getParameter<int>("L1_ETM20_prescale");
259  singleThresholds_[L1ParticleMap::kETM30] =
260  iConfig.getParameter<double>("L1_ETM30_thresh");
261  prescales_[L1ParticleMap::kETM30] =
262  iConfig.getParameter<int>("L1_ETM30_prescale");
263  singleThresholds_[L1ParticleMap::kETM40] =
264  iConfig.getParameter<double>("L1_ETM40_thresh");
265  prescales_[L1ParticleMap::kETM40] =
266  iConfig.getParameter<int>("L1_ETM40_prescale");
267  singleThresholds_[L1ParticleMap::kETM50] =
268  iConfig.getParameter<double>("L1_ETM50_thresh");
269  prescales_[L1ParticleMap::kETM50] =
270  iConfig.getParameter<int>("L1_ETM50_prescale");
271  singleThresholds_[L1ParticleMap::kETM60] =
272  iConfig.getParameter<double>("L1_ETM60_thresh");
273  prescales_[L1ParticleMap::kETM60] =
274  iConfig.getParameter<int>("L1_ETM60_prescale");
275 
276  singleThresholds_[L1ParticleMap::kETT60] =
277  iConfig.getParameter<double>("L1_ETT60_thresh");
278  prescales_[L1ParticleMap::kETT60] =
279  iConfig.getParameter<int>("L1_ETT60_prescale");
280 
281  // AA triggers
282 
283  singleThresholds_[L1ParticleMap::kDoubleMu3] =
284  iConfig.getParameter<double>("L1_DoubleMu3_thresh");
285  prescales_[L1ParticleMap::kDoubleMu3] =
286  iConfig.getParameter<int>("L1_DoubleMu3_prescale");
287 
288  singleThresholds_[L1ParticleMap::kDoubleIsoEG8] =
289  iConfig.getParameter<double>("L1_DoubleIsoEG8_thresh");
290  prescales_[L1ParticleMap::kDoubleIsoEG8] =
291  iConfig.getParameter<int>("L1_DoubleIsoEG8_prescale");
292  singleThresholds_[L1ParticleMap::kDoubleIsoEG10] =
293  iConfig.getParameter<double>("L1_DoubleIsoEG10_thresh");
294  prescales_[L1ParticleMap::kDoubleIsoEG10] =
295  iConfig.getParameter<int>("L1_DoubleIsoEG10_prescale");
296 
297  singleThresholds_[L1ParticleMap::kDoubleEG5] =
298  iConfig.getParameter<double>("L1_DoubleEG5_thresh");
299  prescales_[L1ParticleMap::kDoubleEG5] =
300  iConfig.getParameter<int>("L1_DoubleEG5_prescale");
301  singleThresholds_[L1ParticleMap::kDoubleEG10] =
302  iConfig.getParameter<double>("L1_DoubleEG10_thresh");
303  prescales_[L1ParticleMap::kDoubleEG10] =
304  iConfig.getParameter<int>("L1_DoubleEG10_prescale");
305  singleThresholds_[L1ParticleMap::kDoubleEG15] =
306  iConfig.getParameter<double>("L1_DoubleEG15_thresh");
307  prescales_[L1ParticleMap::kDoubleEG15] =
308  iConfig.getParameter<int>("L1_DoubleEG15_prescale");
309 
310  singleThresholds_[L1ParticleMap::kDoubleJet70] =
311  iConfig.getParameter<double>("L1_DoubleJet70_thresh");
312  prescales_[L1ParticleMap::kDoubleJet70] =
313  iConfig.getParameter<int>("L1_DoubleJet70_prescale");
314  singleThresholds_[L1ParticleMap::kDoubleJet100] =
315  iConfig.getParameter<double>("L1_DoubleJet100_thresh");
316  prescales_[L1ParticleMap::kDoubleJet100] =
317  iConfig.getParameter<int>("L1_DoubleJet100_prescale");
318 
319  singleThresholds_[L1ParticleMap::kDoubleTauJet20] =
320  iConfig.getParameter<double>("L1_DoubleTauJet20_thresh");
321  prescales_[L1ParticleMap::kDoubleTauJet20] =
322  iConfig.getParameter<int>("L1_DoubleTauJet20_prescale");
323  singleThresholds_[L1ParticleMap::kDoubleTauJet30] =
324  iConfig.getParameter<double>("L1_DoubleTauJet30_thresh");
325  prescales_[L1ParticleMap::kDoubleTauJet30] =
326  iConfig.getParameter<int>("L1_DoubleTauJet30_prescale");
327  singleThresholds_[L1ParticleMap::kDoubleTauJet35] =
328  iConfig.getParameter<double>("L1_DoubleTauJet35_thresh");
329  prescales_[L1ParticleMap::kDoubleTauJet35] =
330  iConfig.getParameter<int>("L1_DoubleTauJet35_prescale");
331  singleThresholds_[L1ParticleMap::kDoubleTauJet40] =
332  iConfig.getParameter<double>("L1_DoubleTauJet40_thresh");
333  prescales_[L1ParticleMap::kDoubleTauJet40] =
334  iConfig.getParameter<int>("L1_DoubleTauJet40_prescale");
335 
336  // AB triggers
337 
338  doubleThresholds_[L1ParticleMap::kMu3_IsoEG5].first =
339  iConfig.getParameter<double>("L1_Mu3_IsoEG5_thresh1");
340  doubleThresholds_[L1ParticleMap::kMu3_IsoEG5].second =
341  iConfig.getParameter<double>("L1_Mu3_IsoEG5_thresh2");
342  prescales_[L1ParticleMap::kMu3_IsoEG5] =
343  iConfig.getParameter<int>("L1_Mu3_IsoEG5_prescale");
344  doubleThresholds_[L1ParticleMap::kMu5_IsoEG10].first =
345  iConfig.getParameter<double>("L1_Mu5_IsoEG10_thresh1");
346  doubleThresholds_[L1ParticleMap::kMu5_IsoEG10].second =
347  iConfig.getParameter<double>("L1_Mu5_IsoEG10_thresh2");
348  prescales_[L1ParticleMap::kMu5_IsoEG10] =
349  iConfig.getParameter<int>("L1_Mu5_IsoEG10_prescale");
350 
351  doubleThresholds_[L1ParticleMap::kMu3_EG12].first =
352  iConfig.getParameter<double>("L1_Mu3_EG12_thresh1");
353  doubleThresholds_[L1ParticleMap::kMu3_EG12].second =
354  iConfig.getParameter<double>("L1_Mu3_EG12_thresh2");
355  prescales_[L1ParticleMap::kMu3_EG12] =
356  iConfig.getParameter<int>("L1_Mu3_EG12_prescale");
357 
358  doubleThresholds_[L1ParticleMap::kMu3_Jet15].first =
359  iConfig.getParameter<double>("L1_Mu3_Jet15_thresh1");
360  doubleThresholds_[L1ParticleMap::kMu3_Jet15].second =
361  iConfig.getParameter<double>("L1_Mu3_Jet15_thresh2");
362  prescales_[L1ParticleMap::kMu3_Jet15] =
363  iConfig.getParameter<int>("L1_Mu3_Jet15_prescale");
364  doubleThresholds_[L1ParticleMap::kMu5_Jet15].first =
365  iConfig.getParameter<double>("L1_Mu5_Jet15_thresh1");
366  doubleThresholds_[L1ParticleMap::kMu5_Jet15].second =
367  iConfig.getParameter<double>("L1_Mu5_Jet15_thresh2");
368  prescales_[L1ParticleMap::kMu5_Jet15] =
369  iConfig.getParameter<int>("L1_Mu5_Jet15_prescale");
370  doubleThresholds_[L1ParticleMap::kMu3_Jet70].first =
371  iConfig.getParameter<double>("L1_Mu3_Jet70_thresh1");
372  doubleThresholds_[L1ParticleMap::kMu3_Jet70].second =
373  iConfig.getParameter<double>("L1_Mu3_Jet70_thresh2");
374  prescales_[L1ParticleMap::kMu3_Jet70] =
375  iConfig.getParameter<int>("L1_Mu3_Jet70_prescale");
376  doubleThresholds_[L1ParticleMap::kMu5_Jet20].first =
377  iConfig.getParameter<double>("L1_Mu5_Jet20_thresh1");
378  doubleThresholds_[L1ParticleMap::kMu5_Jet20].second =
379  iConfig.getParameter<double>("L1_Mu5_Jet20_thresh2");
380  prescales_[L1ParticleMap::kMu5_Jet20] =
381  iConfig.getParameter<int>("L1_Mu5_Jet20_prescale");
382 
383  doubleThresholds_[L1ParticleMap::kMu5_TauJet20].first =
384  iConfig.getParameter<double>("L1_Mu5_TauJet20_thresh1");
385  doubleThresholds_[L1ParticleMap::kMu5_TauJet20].second =
386  iConfig.getParameter<double>("L1_Mu5_TauJet20_thresh2");
387  prescales_[L1ParticleMap::kMu5_TauJet20] =
388  iConfig.getParameter<int>("L1_Mu5_TauJet20_prescale");
389  doubleThresholds_[L1ParticleMap::kMu5_TauJet30].first =
390  iConfig.getParameter<double>("L1_Mu5_TauJet30_thresh1");
391  doubleThresholds_[L1ParticleMap::kMu5_TauJet30].second =
392  iConfig.getParameter<double>("L1_Mu5_TauJet30_thresh2");
393  prescales_[L1ParticleMap::kMu5_TauJet30] =
394  iConfig.getParameter<int>("L1_Mu5_TauJet30_prescale");
395 
396  doubleThresholds_[L1ParticleMap::kIsoEG10_EG10].first =
397  iConfig.getParameter<double>("L1_IsoEG10_EG10_thresh1");
398  doubleThresholds_[L1ParticleMap::kIsoEG10_EG10].second =
399  iConfig.getParameter<double>("L1_IsoEG10_EG10_thresh2");
400  prescales_[L1ParticleMap::kIsoEG10_EG10] =
401  iConfig.getParameter<int>("L1_IsoEG10_EG10_prescale");
402 
403  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet15].first =
404  iConfig.getParameter<double>("L1_IsoEG10_Jet15_thresh1");
405  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet15].second =
406  iConfig.getParameter<double>("L1_IsoEG10_Jet15_thresh2");
407  prescales_[L1ParticleMap::kIsoEG10_Jet15] =
408  iConfig.getParameter<int>("L1_IsoEG10_Jet15_prescale");
409  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet30].first =
410  iConfig.getParameter<double>("L1_IsoEG10_Jet30_thresh1");
411  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet30].second =
412  iConfig.getParameter<double>("L1_IsoEG10_Jet30_thresh2");
413  prescales_[L1ParticleMap::kIsoEG10_Jet30] =
414  iConfig.getParameter<int>("L1_IsoEG10_Jet30_prescale");
415  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet20].first =
416  iConfig.getParameter<double>("L1_IsoEG10_Jet20_thresh1");
417  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet20].second =
418  iConfig.getParameter<double>("L1_IsoEG10_Jet20_thresh2");
419  prescales_[L1ParticleMap::kIsoEG10_Jet20] =
420  iConfig.getParameter<int>("L1_IsoEG10_Jet20_prescale");
421  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet70].first =
422  iConfig.getParameter<double>("L1_IsoEG10_Jet70_thresh1");
423  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet70].second =
424  iConfig.getParameter<double>("L1_IsoEG10_Jet70_thresh2");
425  prescales_[L1ParticleMap::kIsoEG10_Jet70] =
426  iConfig.getParameter<int>("L1_IsoEG10_Jet70_prescale");
427 
428  doubleThresholds_[L1ParticleMap::kIsoEG10_TauJet20].first =
429  iConfig.getParameter<double>("L1_IsoEG10_TauJet20_thresh1");
430  doubleThresholds_[L1ParticleMap::kIsoEG10_TauJet20].second =
431  iConfig.getParameter<double>("L1_IsoEG10_TauJet20_thresh2");
432  prescales_[L1ParticleMap::kIsoEG10_TauJet20] =
433  iConfig.getParameter<int>("L1_IsoEG10_TauJet20_prescale");
434  doubleThresholds_[L1ParticleMap::kIsoEG10_TauJet30].first =
435  iConfig.getParameter<double>("L1_IsoEG10_TauJet30_thresh1");
436  doubleThresholds_[L1ParticleMap::kIsoEG10_TauJet30].second =
437  iConfig.getParameter<double>("L1_IsoEG10_TauJet30_thresh2");
438  prescales_[L1ParticleMap::kIsoEG10_TauJet30] =
439  iConfig.getParameter<int>("L1_IsoEG10_TauJet30_prescale");
440 
441  doubleThresholds_[L1ParticleMap::kEG10_Jet15].first =
442  iConfig.getParameter<double>("L1_EG10_Jet15_thresh1");
443  doubleThresholds_[L1ParticleMap::kEG10_Jet15].second =
444  iConfig.getParameter<double>("L1_EG10_Jet15_thresh2");
445  prescales_[L1ParticleMap::kEG10_Jet15] =
446  iConfig.getParameter<int>("L1_EG10_Jet15_prescale");
447  doubleThresholds_[L1ParticleMap::kEG12_Jet20].first =
448  iConfig.getParameter<double>("L1_EG12_Jet20_thresh1");
449  doubleThresholds_[L1ParticleMap::kEG12_Jet20].second =
450  iConfig.getParameter<double>("L1_EG12_Jet20_thresh2");
451  prescales_[L1ParticleMap::kEG12_Jet20] =
452  iConfig.getParameter<int>("L1_EG12_Jet20_prescale");
453  doubleThresholds_[L1ParticleMap::kEG12_Jet70].first =
454  iConfig.getParameter<double>("L1_EG12_Jet70_thresh1");
455  doubleThresholds_[L1ParticleMap::kEG12_Jet70].second =
456  iConfig.getParameter<double>("L1_EG12_Jet70_thresh2");
457  prescales_[L1ParticleMap::kEG12_Jet70] =
458  iConfig.getParameter<int>("L1_EG12_Jet70_prescale");
459 
460  doubleThresholds_[L1ParticleMap::kEG12_TauJet40].first =
461  iConfig.getParameter<double>("L1_EG12_TauJet40_thresh1");
462  doubleThresholds_[L1ParticleMap::kEG12_TauJet40].second =
463  iConfig.getParameter<double>("L1_EG12_TauJet40_thresh2");
464  prescales_[L1ParticleMap::kEG12_TauJet40] =
465  iConfig.getParameter<int>("L1_EG12_TauJet40_prescale");
466 
467  doubleThresholds_[L1ParticleMap::kJet70_TauJet40].first =
468  iConfig.getParameter<double>("L1_Jet70_TauJet40_thresh1");
469  doubleThresholds_[L1ParticleMap::kJet70_TauJet40].second =
470  iConfig.getParameter<double>("L1_Jet70_TauJet40_thresh2");
471  prescales_[L1ParticleMap::kJet70_TauJet40] =
472  iConfig.getParameter<int>("L1_Jet70_TauJet40_prescale");
473 
474  doubleThresholds_[L1ParticleMap::kMu3_HTT200].first =
475  iConfig.getParameter<double>("L1_Mu3_HTT200_thresh1");
476  doubleThresholds_[L1ParticleMap::kMu3_HTT200].second =
477  iConfig.getParameter<double>("L1_Mu3_HTT200_thresh2");
478  prescales_[L1ParticleMap::kMu3_HTT200] =
479  iConfig.getParameter<int>("L1_Mu3_HTT200_prescale");
480  doubleThresholds_[L1ParticleMap::kIsoEG10_HTT200].first =
481  iConfig.getParameter<double>("L1_IsoEG10_HTT200_thresh1");
482  doubleThresholds_[L1ParticleMap::kIsoEG10_HTT200].second =
483  iConfig.getParameter<double>("L1_IsoEG10_HTT200_thresh2");
484  prescales_[L1ParticleMap::kIsoEG10_HTT200] =
485  iConfig.getParameter<int>("L1_IsoEG10_HTT200_prescale");
486  doubleThresholds_[L1ParticleMap::kEG12_HTT200].first =
487  iConfig.getParameter<double>("L1_EG12_HTT200_thresh1");
488  doubleThresholds_[L1ParticleMap::kEG12_HTT200].second =
489  iConfig.getParameter<double>("L1_EG12_HTT200_thresh2");
490  prescales_[L1ParticleMap::kEG12_HTT200] =
491  iConfig.getParameter<int>("L1_EG12_HTT200_prescale");
492  doubleThresholds_[L1ParticleMap::kJet70_HTT200].first =
493  iConfig.getParameter<double>("L1_Jet70_HTT200_thresh1");
494  doubleThresholds_[L1ParticleMap::kJet70_HTT200].second =
495  iConfig.getParameter<double>("L1_Jet70_HTT200_thresh2");
496  prescales_[L1ParticleMap::kJet70_HTT200] =
497  iConfig.getParameter<int>("L1_Jet70_HTT200_prescale");
498  doubleThresholds_[L1ParticleMap::kTauJet40_HTT200].first =
499  iConfig.getParameter<double>("L1_TauJet40_HTT200_thresh1");
500  doubleThresholds_[L1ParticleMap::kTauJet40_HTT200].second =
501  iConfig.getParameter<double>("L1_TauJet40_HTT200_thresh2");
502  prescales_[L1ParticleMap::kTauJet40_HTT200] =
503  iConfig.getParameter<int>("L1_TauJet40_HTT200_prescale");
504 
505  doubleThresholds_[L1ParticleMap::kMu3_ETM30].first =
506  iConfig.getParameter<double>("L1_Mu3_ETM30_thresh1");
507  doubleThresholds_[L1ParticleMap::kMu3_ETM30].second =
508  iConfig.getParameter<double>("L1_Mu3_ETM30_thresh2");
509  prescales_[L1ParticleMap::kMu3_ETM30] =
510  iConfig.getParameter<int>("L1_Mu3_ETM30_prescale");
511  doubleThresholds_[L1ParticleMap::kIsoEG10_ETM30].first =
512  iConfig.getParameter<double>("L1_IsoEG10_ETM30_thresh1");
513  doubleThresholds_[L1ParticleMap::kIsoEG10_ETM30].second =
514  iConfig.getParameter<double>("L1_IsoEG10_ETM30_thresh2");
515  prescales_[L1ParticleMap::kIsoEG10_ETM30] =
516  iConfig.getParameter<int>("L1_IsoEG10_ETM30_prescale");
517  doubleThresholds_[L1ParticleMap::kEG12_ETM30].first =
518  iConfig.getParameter<double>("L1_EG12_ETM30_thresh1");
519  doubleThresholds_[L1ParticleMap::kEG12_ETM30].second =
520  iConfig.getParameter<double>("L1_EG12_ETM30_thresh2");
521  prescales_[L1ParticleMap::kEG12_ETM30] =
522  iConfig.getParameter<int>("L1_EG12_ETM30_prescale");
523  doubleThresholds_[L1ParticleMap::kJet70_ETM40].first =
524  iConfig.getParameter<double>("L1_Jet70_ETM40_thresh1");
525  doubleThresholds_[L1ParticleMap::kJet70_ETM40].second =
526  iConfig.getParameter<double>("L1_Jet70_ETM40_thresh2");
527  prescales_[L1ParticleMap::kJet70_ETM40] =
528  iConfig.getParameter<int>("L1_Jet70_ETM40_prescale");
529 
530  doubleThresholds_[L1ParticleMap::kTauJet20_ETM20].first =
531  iConfig.getParameter<double>("L1_TauJet20_ETM20_thresh1");
532  doubleThresholds_[L1ParticleMap::kTauJet20_ETM20].second =
533  iConfig.getParameter<double>("L1_TauJet20_ETM20_thresh2");
534  prescales_[L1ParticleMap::kTauJet20_ETM20] =
535  iConfig.getParameter<int>("L1_TauJet20_ETM20_prescale");
536  doubleThresholds_[L1ParticleMap::kTauJet30_ETM30].first =
537  iConfig.getParameter<double>("L1_TauJet30_ETM30_thresh1");
538  doubleThresholds_[L1ParticleMap::kTauJet30_ETM30].second =
539  iConfig.getParameter<double>("L1_TauJet30_ETM30_thresh2");
540  prescales_[L1ParticleMap::kTauJet30_ETM30] =
541  iConfig.getParameter<int>("L1_TauJet30_ETM30_prescale");
542  doubleThresholds_[L1ParticleMap::kTauJet30_ETM40].first =
543  iConfig.getParameter<double>("L1_TauJet30_ETM40_thresh1");
544  doubleThresholds_[L1ParticleMap::kTauJet30_ETM40].second =
545  iConfig.getParameter<double>("L1_TauJet30_ETM40_thresh2");
546  prescales_[L1ParticleMap::kTauJet30_ETM40] =
547  iConfig.getParameter<int>("L1_TauJet30_ETM40_prescale");
548 
549  doubleThresholds_[L1ParticleMap::kHTT100_ETM30].first =
550  iConfig.getParameter<double>("L1_HTT100_ETM30_thresh1");
551  doubleThresholds_[L1ParticleMap::kHTT100_ETM30].second =
552  iConfig.getParameter<double>("L1_HTT100_ETM30_thresh2");
553  prescales_[L1ParticleMap::kHTT100_ETM30] =
554  iConfig.getParameter<int>("L1_HTT100_ETM30_prescale");
555 
556  // AAA triggers
557 
558  singleThresholds_[L1ParticleMap::kTripleMu3] =
559  iConfig.getParameter<double>("L1_TripleMu3_thresh");
560  prescales_[L1ParticleMap::kTripleMu3] =
561  iConfig.getParameter<int>("L1_TripleMu3_prescale");
562  singleThresholds_[L1ParticleMap::kTripleIsoEG5] =
563  iConfig.getParameter<double>("L1_TripleIsoEG5_thresh");
564  prescales_[L1ParticleMap::kTripleIsoEG5] =
565  iConfig.getParameter<int>("L1_TripleIsoEG5_prescale");
566  singleThresholds_[L1ParticleMap::kTripleEG10] =
567  iConfig.getParameter<double>("L1_TripleEG10_thresh");
568  prescales_[L1ParticleMap::kTripleEG10] =
569  iConfig.getParameter<int>("L1_TripleEG10_prescale");
570  singleThresholds_[L1ParticleMap::kTripleJet50] =
571  iConfig.getParameter<double>("L1_TripleJet50_thresh");
572  prescales_[L1ParticleMap::kTripleJet50] =
573  iConfig.getParameter<int>("L1_TripleJet50_prescale");
574  singleThresholds_[L1ParticleMap::kTripleTauJet40] =
575  iConfig.getParameter<double>("L1_TripleTauJet40_thresh");
576  prescales_[L1ParticleMap::kTripleTauJet40] =
577  iConfig.getParameter<int>("L1_TripleTauJet40_prescale");
578 
579  // AAB triggers
580 
581  doubleThresholds_[L1ParticleMap::kDoubleMu3_IsoEG5].first =
582  iConfig.getParameter<double>("L1_DoubleMu3_IsoEG5_thresh1");
583  doubleThresholds_[L1ParticleMap::kDoubleMu3_IsoEG5].second =
584  iConfig.getParameter<double>("L1_DoubleMu3_IsoEG5_thresh2");
585  prescales_[L1ParticleMap::kDoubleMu3_IsoEG5] =
586  iConfig.getParameter<int>("L1_DoubleMu3_IsoEG5_prescale");
587  doubleThresholds_[L1ParticleMap::kDoubleMu3_EG10].first =
588  iConfig.getParameter<double>("L1_DoubleMu3_EG10_thresh1");
589  doubleThresholds_[L1ParticleMap::kDoubleMu3_EG10].second =
590  iConfig.getParameter<double>("L1_DoubleMu3_EG10_thresh2");
591  prescales_[L1ParticleMap::kDoubleMu3_EG10] =
592  iConfig.getParameter<int>("L1_DoubleMu3_EG10_prescale");
593  doubleThresholds_[L1ParticleMap::kDoubleIsoEG5_Mu3].first =
594  iConfig.getParameter<double>("L1_DoubleIsoEG5_Mu3_thresh1");
595  doubleThresholds_[L1ParticleMap::kDoubleIsoEG5_Mu3].second =
596  iConfig.getParameter<double>("L1_DoubleIsoEG5_Mu3_thresh2");
597  prescales_[L1ParticleMap::kDoubleIsoEG5_Mu3] =
598  iConfig.getParameter<int>("L1_DoubleIsoEG5_Mu3_prescale");
599  doubleThresholds_[L1ParticleMap::kDoubleEG10_Mu3].first =
600  iConfig.getParameter<double>("L1_DoubleEG10_Mu3_thresh1");
601  doubleThresholds_[L1ParticleMap::kDoubleEG10_Mu3].second =
602  iConfig.getParameter<double>("L1_DoubleEG10_Mu3_thresh2");
603  prescales_[L1ParticleMap::kDoubleEG10_Mu3] =
604  iConfig.getParameter<int>("L1_DoubleEG10_Mu3_prescale");
605 
606  doubleThresholds_[L1ParticleMap::kDoubleMu3_HTT200].first =
607  iConfig.getParameter<double>("L1_DoubleMu3_HTT200_thresh1");
608  doubleThresholds_[L1ParticleMap::kDoubleMu3_HTT200].second =
609  iConfig.getParameter<double>("L1_DoubleMu3_HTT200_thresh2");
610  prescales_[L1ParticleMap::kDoubleMu3_HTT200] =
611  iConfig.getParameter<int>("L1_DoubleMu3_HTT200_prescale");
612  doubleThresholds_[L1ParticleMap::kDoubleIsoEG5_HTT200].first =
613  iConfig.getParameter<double>("L1_DoubleIsoEG5_HTT200_thresh1");
614  doubleThresholds_[L1ParticleMap::kDoubleIsoEG5_HTT200].second =
615  iConfig.getParameter<double>("L1_DoubleIsoEG5_HTT200_thresh2");
616  prescales_[L1ParticleMap::kDoubleIsoEG5_HTT200] =
617  iConfig.getParameter<int>("L1_DoubleIsoEG5_HTT200_prescale");
618  doubleThresholds_[L1ParticleMap::kDoubleEG10_HTT200].first =
619  iConfig.getParameter<double>("L1_DoubleEG10_HTT200_thresh1");
620  doubleThresholds_[L1ParticleMap::kDoubleEG10_HTT200].second =
621  iConfig.getParameter<double>("L1_DoubleEG10_HTT200_thresh2");
622  prescales_[L1ParticleMap::kDoubleEG10_HTT200] =
623  iConfig.getParameter<int>("L1_DoubleEG10_HTT200_prescale");
624  doubleThresholds_[L1ParticleMap::kDoubleJet50_HTT200].first =
625  iConfig.getParameter<double>("L1_DoubleJet50_HTT200_thresh1");
626  doubleThresholds_[L1ParticleMap::kDoubleJet50_HTT200].second =
627  iConfig.getParameter<double>("L1_DoubleJet50_HTT200_thresh2");
628  prescales_[L1ParticleMap::kDoubleJet50_HTT200] =
629  iConfig.getParameter<int>("L1_DoubleJet50_HTT200_prescale");
630  doubleThresholds_[L1ParticleMap::kDoubleTauJet40_HTT200].first =
631  iConfig.getParameter<double>("L1_DoubleTauJet40_HTT200_thresh1");
632  doubleThresholds_[L1ParticleMap::kDoubleTauJet40_HTT200].second =
633  iConfig.getParameter<double>("L1_DoubleTauJet40_HTT200_thresh2");
634  prescales_[L1ParticleMap::kDoubleTauJet40_HTT200] =
635  iConfig.getParameter<int>("L1_DoubleTauJet40_HTT200_prescale");
636 
637  doubleThresholds_[L1ParticleMap::kDoubleMu3_ETM20].first =
638  iConfig.getParameter<double>("L1_DoubleMu3_ETM20_thresh1");
639  doubleThresholds_[L1ParticleMap::kDoubleMu3_ETM20].second =
640  iConfig.getParameter<double>("L1_DoubleMu3_ETM20_thresh2");
641  prescales_[L1ParticleMap::kDoubleMu3_ETM20] =
642  iConfig.getParameter<int>("L1_DoubleMu3_ETM20_prescale");
643  doubleThresholds_[L1ParticleMap::kDoubleIsoEG5_ETM20].first =
644  iConfig.getParameter<double>("L1_DoubleIsoEG5_ETM20_thresh1");
645  doubleThresholds_[L1ParticleMap::kDoubleIsoEG5_ETM20].second =
646  iConfig.getParameter<double>("L1_DoubleIsoEG5_ETM20_thresh2");
647  prescales_[L1ParticleMap::kDoubleIsoEG5_ETM20] =
648  iConfig.getParameter<int>("L1_DoubleIsoEG5_ETM20_prescale");
649  doubleThresholds_[L1ParticleMap::kDoubleEG10_ETM20].first =
650  iConfig.getParameter<double>("L1_DoubleEG10_ETM20_thresh1");
651  doubleThresholds_[L1ParticleMap::kDoubleEG10_ETM20].second =
652  iConfig.getParameter<double>("L1_DoubleEG10_ETM20_thresh2");
653  prescales_[L1ParticleMap::kDoubleEG10_ETM20] =
654  iConfig.getParameter<int>("L1_DoubleEG10_ETM20_prescale");
655  doubleThresholds_[L1ParticleMap::kDoubleJet50_ETM20].first =
656  iConfig.getParameter<double>("L1_DoubleJet50_ETM20_thresh1");
657  doubleThresholds_[L1ParticleMap::kDoubleJet50_ETM20].second =
658  iConfig.getParameter<double>("L1_DoubleJet50_ETM20_thresh2");
659  prescales_[L1ParticleMap::kDoubleJet50_ETM20] =
660  iConfig.getParameter<int>("L1_DoubleJet50_ETM20_prescale");
661  doubleThresholds_[L1ParticleMap::kDoubleTauJet40_ETM20].first =
662  iConfig.getParameter<double>("L1_DoubleTauJet40_ETM20_thresh1");
663  doubleThresholds_[L1ParticleMap::kDoubleTauJet40_ETM20].second =
664  iConfig.getParameter<double>("L1_DoubleTauJet40_ETM20_thresh2");
665  prescales_[L1ParticleMap::kDoubleTauJet40_ETM20] =
666  iConfig.getParameter<int>("L1_DoubleTauJet40_ETM20_prescale");
667 
668  singleThresholds_[L1ParticleMap::kQuadJet30] =
669  iConfig.getParameter<double>("L1_QuadJet30_thresh");
670  prescales_[L1ParticleMap::kQuadJet30] =
671  iConfig.getParameter<int>("L1_QuadJet30_prescale");
672 
673  // Diffractive triggers
674  doubleThresholds_[L1ParticleMap::kExclusiveDoubleIsoEG4].first =
675  iConfig.getParameter<double>("L1_ExclusiveDoubleIsoEG4_thresh1");
676  doubleThresholds_[L1ParticleMap::kExclusiveDoubleIsoEG4].second =
677  iConfig.getParameter<double>(
678  "L1_ExclusiveDoubleIsoEG4_thresh2"); // for jet rejection
679  prescales_[L1ParticleMap::kExclusiveDoubleIsoEG4] =
680  iConfig.getParameter<int>("L1_ExclusiveDoubleIsoEG4_prescale");
681  singleThresholds_[L1ParticleMap::kExclusiveDoubleJet60] =
682  iConfig.getParameter<double>("L1_ExclusiveDoubleJet60_thresh");
683  prescales_[L1ParticleMap::kExclusiveDoubleJet60] =
684  iConfig.getParameter<int>("L1_ExclusiveDoubleJet60_prescale");
685  singleThresholds_[L1ParticleMap::kExclusiveJet25_Gap_Jet25] =
686  iConfig.getParameter<double>("L1_ExclusiveJet25_Gap_Jet25_thresh");
687  prescales_[L1ParticleMap::kExclusiveJet25_Gap_Jet25] =
688  iConfig.getParameter<int>("L1_ExclusiveJet25_Gap_Jet25_prescale");
689  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet20_ForJet10].first =
690  iConfig.getParameter<double>("L1_IsoEG10_Jet20_ForJet10_thresh1");
691  doubleThresholds_[L1ParticleMap::kIsoEG10_Jet20_ForJet10].second =
692  iConfig.getParameter<double>("L1_IsoEG10_Jet20_ForJet10_thresh2");
693  singleThresholds_[L1ParticleMap::kIsoEG10_Jet20_ForJet10] =
694  iConfig.getParameter<double>("L1_IsoEG10_Jet20_ForJet10_thresh3");
695  prescales_[L1ParticleMap::kIsoEG10_Jet20_ForJet10] =
696  iConfig.getParameter<int>("L1_IsoEG10_Jet20_ForJet10_prescale");
697 
698  prescales_[L1ParticleMap::kMinBias_HTT10] =
699  iConfig.getParameter<int>("L1_MinBias_HTT10_prescale");
700  prescales_[L1ParticleMap::kZeroBias] =
701  iConfig.getParameter<int>("L1_ZeroBias_prescale");
702 
703  // // Print trigger table in Twiki table format.
704  // std::cout << "| *Trigger Index* | *Trigger Name* | *E<sub>T</sub>
705  // Threshold (!GeV)* | *Prescale* |"
706  // << std::endl ;
707 
708  // for( int i = 0 ; i < L1ParticleMap::kNumOfL1TriggerTypes ; ++i )
709  // {
710  // std::cout
711  // << "| "
712  // << i
713  // << " | " ;
714  // if( prescales_[ i ] == 999999999 ) std::cout << "<strike>" ;
715  // std::cout
716  // << L1ParticleMap::triggerName( ( L1ParticleMap::L1TriggerType ) i ) ;
717  // if( prescales_[ i ] == 999999999 ) std::cout << "</strike>" ;
718  // std::cout << " | " ;
719 
720  // if( singleThresholds_[ i ] > 0 )
721  // {
722  // if( doubleThresholds_[ i ].first > 0 )
723  // {
724  // std::cout << doubleThresholds_[ i ].first << ", "
725  // << doubleThresholds_[ i ].second << ", " ;
726  // }
727 
728  // std::cout << singleThresholds_[ i ] ;
729  // }
730  // else if( doubleThresholds_[ i ].first > 0 )
731  // {
732  // std::cout << doubleThresholds_[ i ].first << ", "
733  // << doubleThresholds_[ i ].second ;
734  // }
735  // else
736  // {
737  // std::cout << "---" ;
738  // }
739 
740  // std::cout << " | " ;
741  // if( prescales_[ i ] != 999999999 ) std::cout << prescales_[ i ] ;
742  // std::cout << " |"
743  // << std::endl ;
744  // }
745 }
746 
748  // do anything here that needs to be done at desctruction time
749  // (e.g. close files, deallocate resources etc.)
750 }
751 
752 //
753 // member functions
754 //
755 
756 // ------------ method called to produce the data ------------
758  const edm::EventSetup &iSetup) {
759  using namespace edm;
760  using namespace std;
761  using namespace reco;
762  using namespace l1extra;
763 
764  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
765  // ~~~~~~~~ Get L1Extra particles ~~~~~~~~
766  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
767 
768  Handle<L1EmParticleCollection> isoEmHandle;
769  iEvent.getByLabel(isoEmSource_, isoEmHandle);
770 
771  Handle<L1EmParticleCollection> nonIsoEmHandle;
772  iEvent.getByLabel(nonIsoEmSource_, nonIsoEmHandle);
773 
774  Handle<L1JetParticleCollection> cenJetHandle;
775  iEvent.getByLabel(cenJetSource_, cenJetHandle);
776 
777  Handle<L1JetParticleCollection> forJetHandle;
778  iEvent.getByLabel(forJetSource_, forJetHandle);
779 
780  Handle<L1JetParticleCollection> tauJetHandle;
781  iEvent.getByLabel(tauJetSource_, tauJetHandle);
782 
784  iEvent.getByLabel(muonSource_, muHandle);
785 
786  Handle<L1EtMissParticle> metHandle;
787  iEvent.getByLabel(etMissSource_, metHandle);
788 
789  Handle<L1EtMissParticle> mhtHandle;
790  iEvent.getByLabel(htMissSource_, mhtHandle);
791 
792  double met = metHandle->etMiss();
793  double ht = mhtHandle->etTotal();
794  double ett = metHandle->etTotal();
795 
796  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
797  // ~~~ Evaluate trigger conditions and make a L1ParticleMapCollection. ~~~
798  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
799 
800  // First, form the input vector<Ref>s that will be needed.
801  L1EmParticleVectorRef inputIsoEmRefs;
802  addToVectorRefs(isoEmHandle, inputIsoEmRefs);
803 
804  L1EmParticleVectorRef inputRelaxedEmRefs;
805  addToVectorRefs(isoEmHandle, inputRelaxedEmRefs);
806  addToVectorRefs(nonIsoEmHandle, inputRelaxedEmRefs);
807 
808  L1JetParticleVectorRef inputTauRefs;
809  addToVectorRefs(tauJetHandle, inputTauRefs);
810 
811  L1JetParticleVectorRef inputJetRefs;
812  addToVectorRefs(forJetHandle, inputJetRefs);
813  addToVectorRefs(cenJetHandle, inputJetRefs);
814  addToVectorRefs(tauJetHandle, inputJetRefs);
815 
816  L1JetParticleVectorRef inputForJetRefs;
817  addToVectorRefs(forJetHandle, inputForJetRefs);
818 
819  L1JetParticleVectorRef inputCenJetTauJetRefs;
820  addToVectorRefs(cenJetHandle, inputCenJetTauJetRefs);
821  addToVectorRefs(tauJetHandle, inputCenJetTauJetRefs);
822 
823  L1MuonParticleVectorRef inputMuonRefsSingle;
824  L1MuonParticleVectorRef inputMuonRefsDouble;
825  L1MuonParticleCollection::const_iterator muItr = muHandle->begin();
826  L1MuonParticleCollection::const_iterator muEnd = muHandle->end();
827 
828  for (size_t i = 0; muItr != muEnd; ++muItr, ++i) {
829  if (!muItr->gmtMuonCand().empty()) {
830  unsigned int qual = muItr->gmtMuonCand().quality();
831 
832  if (qual == 4 || qual == 5 || qual == 6 || qual == 7) {
833  inputMuonRefsSingle.push_back(
835  }
836 
837  if (qual == 3 || qual == 5 || qual == 6 || qual == 7) {
838  inputMuonRefsDouble.push_back(
840  }
841  }
842  }
843 
844  unique_ptr<L1ParticleMapCollection> mapColl(new L1ParticleMapCollection);
845  bool globalDecision = false;
846  std::vector<bool> decisionWord;
847 
848  for (int itrig = 0; itrig < L1ParticleMap::kNumOfL1TriggerTypes; ++itrig) {
849  bool decision = false;
850  std::vector<L1ParticleMap::L1ObjectType> objectTypes;
851  L1EmParticleVectorRef outputEmRefsTmp;
852  L1JetParticleVectorRef outputJetRefsTmp;
853  L1MuonParticleVectorRef outputMuonRefsTmp;
854  L1EtMissParticleRefProd metRefTmp;
855  L1ParticleMap::L1IndexComboVector combosTmp; // unfilled for single objs
856 
857  if (itrig == L1ParticleMap::kSingleMu3 ||
858  itrig == L1ParticleMap::kSingleMu5 ||
859  itrig == L1ParticleMap::kSingleMu7 ||
860  itrig == L1ParticleMap::kSingleMu10 ||
861  itrig == L1ParticleMap::kSingleMu14 ||
862  itrig == L1ParticleMap::kSingleMu20 ||
863  itrig == L1ParticleMap::kSingleMu25) {
864  objectTypes.push_back(L1ParticleMap::kMuon);
865 
866  evaluateSingleObjectTrigger(inputMuonRefsSingle, singleThresholds_[itrig],
867  decision, outputMuonRefsTmp);
868  } else if (itrig == L1ParticleMap::kSingleIsoEG5 ||
869  itrig == L1ParticleMap::kSingleIsoEG8 ||
870  itrig == L1ParticleMap::kSingleIsoEG10 ||
871  itrig == L1ParticleMap::kSingleIsoEG12 ||
872  itrig == L1ParticleMap::kSingleIsoEG15 ||
873  itrig == L1ParticleMap::kSingleIsoEG20 ||
874  itrig == L1ParticleMap::kSingleIsoEG25) {
875  objectTypes.push_back(L1ParticleMap::kEM);
876 
877  evaluateSingleObjectTrigger(inputIsoEmRefs, singleThresholds_[itrig],
878  decision, outputEmRefsTmp);
879  } else if (itrig == L1ParticleMap::kSingleEG5 ||
880  itrig == L1ParticleMap::kSingleEG8 ||
881  itrig == L1ParticleMap::kSingleEG10 ||
882  itrig == L1ParticleMap::kSingleEG12 ||
883  itrig == L1ParticleMap::kSingleEG15 ||
884  itrig == L1ParticleMap::kSingleEG20 ||
885  itrig == L1ParticleMap::kSingleEG25) {
886  objectTypes.push_back(L1ParticleMap::kEM);
887 
888  evaluateSingleObjectTrigger(inputRelaxedEmRefs, singleThresholds_[itrig],
889  decision, outputEmRefsTmp);
890  } else if (itrig == L1ParticleMap::kSingleJet15 ||
891  itrig == L1ParticleMap::kSingleJet20 ||
892  itrig == L1ParticleMap::kSingleJet30 ||
893  itrig == L1ParticleMap::kSingleJet50 ||
894  itrig == L1ParticleMap::kSingleJet70 ||
895  itrig == L1ParticleMap::kSingleJet100 ||
896  itrig == L1ParticleMap::kSingleJet150 ||
897  itrig == L1ParticleMap::kSingleJet200) {
898  objectTypes.push_back(L1ParticleMap::kJet);
899 
900  evaluateSingleObjectTrigger(inputJetRefs, singleThresholds_[itrig],
901  decision, outputJetRefsTmp);
902  } else if (itrig == L1ParticleMap::kSingleTauJet10 ||
903  itrig == L1ParticleMap::kSingleTauJet20 ||
904  itrig == L1ParticleMap::kSingleTauJet30 ||
905  itrig == L1ParticleMap::kSingleTauJet35 ||
906  itrig == L1ParticleMap::kSingleTauJet40 ||
907  itrig == L1ParticleMap::kSingleTauJet60 ||
908  itrig == L1ParticleMap::kSingleTauJet80 ||
909  itrig == L1ParticleMap::kSingleTauJet100) {
910  objectTypes.push_back(L1ParticleMap::kJet);
911 
912  evaluateSingleObjectTrigger(inputTauRefs, singleThresholds_[itrig],
913  decision, outputJetRefsTmp);
914  } else if (itrig == L1ParticleMap::kHTT100 ||
915  itrig == L1ParticleMap::kHTT200 ||
916  itrig == L1ParticleMap::kHTT250 ||
917  itrig == L1ParticleMap::kHTT300 ||
918  itrig == L1ParticleMap::kHTT400 ||
919  itrig == L1ParticleMap::kHTT500) {
920  objectTypes.push_back(L1ParticleMap::kEtHad);
921 
922  if (ht >= singleThresholds_[itrig]) {
923  decision = true;
924  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
925  }
926  } else if (itrig == L1ParticleMap::kETM10 ||
927  itrig == L1ParticleMap::kETM15 ||
928  itrig == L1ParticleMap::kETM20 ||
929  itrig == L1ParticleMap::kETM30 ||
930  itrig == L1ParticleMap::kETM40 ||
931  itrig == L1ParticleMap::kETM50 ||
932  itrig == L1ParticleMap::kETM60) {
933  objectTypes.push_back(L1ParticleMap::kEtMiss);
934 
935  if (met >= singleThresholds_[itrig]) {
936  decision = true;
937  metRefTmp = L1EtMissParticleRefProd(metHandle);
938  }
939  } else if (itrig == L1ParticleMap::kETT60) {
940  objectTypes.push_back(L1ParticleMap::kEtTotal);
941 
942  if (ett >= singleThresholds_[itrig]) {
943  decision = true;
944  metRefTmp = L1EtMissParticleRefProd(metHandle);
945  }
946  } else if (itrig == L1ParticleMap::kDoubleMu3) {
947  objectTypes.push_back(L1ParticleMap::kMuon);
948  objectTypes.push_back(L1ParticleMap::kMuon);
949 
950  evaluateDoubleSameObjectTrigger(inputMuonRefsDouble,
951  singleThresholds_[itrig], decision,
952  outputMuonRefsTmp, combosTmp);
953  } else if (itrig == L1ParticleMap::kDoubleIsoEG8 ||
954  itrig == L1ParticleMap::kDoubleIsoEG10) {
955  objectTypes.push_back(L1ParticleMap::kEM);
956  objectTypes.push_back(L1ParticleMap::kEM);
957 
958  evaluateDoubleSameObjectTrigger(inputIsoEmRefs, singleThresholds_[itrig],
959  decision, outputEmRefsTmp, combosTmp);
960  } else if (itrig == L1ParticleMap::kDoubleEG5 ||
961  itrig == L1ParticleMap::kDoubleEG10 ||
962  itrig == L1ParticleMap::kDoubleEG15) {
963  objectTypes.push_back(L1ParticleMap::kEM);
964  objectTypes.push_back(L1ParticleMap::kEM);
965 
966  evaluateDoubleSameObjectTrigger(inputRelaxedEmRefs,
967  singleThresholds_[itrig], decision,
968  outputEmRefsTmp, combosTmp);
969  } else if (itrig == L1ParticleMap::kDoubleJet70 ||
970  itrig == L1ParticleMap::kDoubleJet100) {
971  objectTypes.push_back(L1ParticleMap::kJet);
972  objectTypes.push_back(L1ParticleMap::kJet);
973 
975  decision, outputJetRefsTmp, combosTmp);
976  } else if (itrig == L1ParticleMap::kDoubleTauJet20 ||
977  itrig == L1ParticleMap::kDoubleTauJet30 ||
978  itrig == L1ParticleMap::kDoubleTauJet35 ||
979  itrig == L1ParticleMap::kDoubleTauJet40) {
980  objectTypes.push_back(L1ParticleMap::kJet);
981  objectTypes.push_back(L1ParticleMap::kJet);
982 
984  decision, outputJetRefsTmp, combosTmp);
985  } else if (itrig == L1ParticleMap::kMu3_IsoEG5 ||
986  itrig == L1ParticleMap::kMu5_IsoEG10) {
987  objectTypes.push_back(L1ParticleMap::kMuon);
988  objectTypes.push_back(L1ParticleMap::kEM);
989 
991  inputMuonRefsSingle, inputIsoEmRefs, doubleThresholds_[itrig].first,
992  doubleThresholds_[itrig].second, decision, outputMuonRefsTmp,
993  outputEmRefsTmp, combosTmp);
994  } else if (itrig == L1ParticleMap::kMu3_EG12) {
995  objectTypes.push_back(L1ParticleMap::kMuon);
996  objectTypes.push_back(L1ParticleMap::kEM);
997 
999  inputMuonRefsSingle, inputRelaxedEmRefs,
1001  decision, outputMuonRefsTmp, outputEmRefsTmp, combosTmp);
1002  } else if (itrig == L1ParticleMap::kMu3_Jet15 ||
1003  itrig == L1ParticleMap::kMu5_Jet15 ||
1004  itrig == L1ParticleMap::kMu3_Jet70 ||
1005  itrig == L1ParticleMap::kMu5_Jet20) {
1006  objectTypes.push_back(L1ParticleMap::kMuon);
1007  objectTypes.push_back(L1ParticleMap::kJet);
1008 
1010  inputMuonRefsSingle, inputJetRefs, doubleThresholds_[itrig].first,
1011  doubleThresholds_[itrig].second, decision, outputMuonRefsTmp,
1012  outputJetRefsTmp, combosTmp);
1013  } else if (itrig == L1ParticleMap::kMu5_TauJet20 ||
1014  itrig == L1ParticleMap::kMu5_TauJet30) {
1015  objectTypes.push_back(L1ParticleMap::kMuon);
1016  objectTypes.push_back(L1ParticleMap::kJet);
1017 
1019  inputMuonRefsSingle, inputTauRefs, doubleThresholds_[itrig].first,
1020  doubleThresholds_[itrig].second, decision, outputMuonRefsTmp,
1021  outputJetRefsTmp, combosTmp);
1022  } else if (itrig == L1ParticleMap::kIsoEG10_EG10) {
1023  objectTypes.push_back(L1ParticleMap::kEM);
1024  objectTypes.push_back(L1ParticleMap::kEM);
1025 
1027  inputIsoEmRefs, inputRelaxedEmRefs, doubleThresholds_[itrig].first,
1028  doubleThresholds_[itrig].second, decision, outputEmRefsTmp,
1029  combosTmp);
1030  } else if (itrig == L1ParticleMap::kIsoEG10_Jet15 ||
1031  itrig == L1ParticleMap::kIsoEG10_Jet30 ||
1032  itrig == L1ParticleMap::kIsoEG10_Jet20 ||
1033  itrig == L1ParticleMap::kIsoEG10_Jet70) {
1034  objectTypes.push_back(L1ParticleMap::kEM);
1035  objectTypes.push_back(L1ParticleMap::kJet);
1036 
1038  inputIsoEmRefs, inputJetRefs, doubleThresholds_[itrig].first,
1039  doubleThresholds_[itrig].second, decision, outputEmRefsTmp,
1040  outputJetRefsTmp, combosTmp);
1041  } else if (itrig == L1ParticleMap::kIsoEG10_TauJet20 ||
1042  itrig == L1ParticleMap::kIsoEG10_TauJet30) {
1043  objectTypes.push_back(L1ParticleMap::kEM);
1044  objectTypes.push_back(L1ParticleMap::kJet);
1045 
1047  inputIsoEmRefs, inputTauRefs, doubleThresholds_[itrig].first,
1048  doubleThresholds_[itrig].second, decision, outputEmRefsTmp,
1049  outputJetRefsTmp, combosTmp);
1050  } else if (itrig == L1ParticleMap::kEG10_Jet15 ||
1051  itrig == L1ParticleMap::kEG12_Jet20 ||
1052  itrig == L1ParticleMap::kEG12_Jet70) {
1053  objectTypes.push_back(L1ParticleMap::kEM);
1054  objectTypes.push_back(L1ParticleMap::kJet);
1055 
1057  inputRelaxedEmRefs, inputJetRefs, doubleThresholds_[itrig].first,
1058  doubleThresholds_[itrig].second, decision, outputEmRefsTmp,
1059  outputJetRefsTmp, combosTmp);
1060  } else if (itrig == L1ParticleMap::kEG12_TauJet40) {
1061  objectTypes.push_back(L1ParticleMap::kEM);
1062  objectTypes.push_back(L1ParticleMap::kJet);
1063 
1065  inputRelaxedEmRefs, inputTauRefs, doubleThresholds_[itrig].first,
1066  doubleThresholds_[itrig].second, decision, outputEmRefsTmp,
1067  outputJetRefsTmp, combosTmp);
1068  } else if (itrig == L1ParticleMap::kJet70_TauJet40) {
1069  objectTypes.push_back(L1ParticleMap::kJet);
1070  objectTypes.push_back(L1ParticleMap::kJet);
1071 
1073  inputJetRefs, inputTauRefs, doubleThresholds_[itrig].first,
1074  doubleThresholds_[itrig].second, decision, outputJetRefsTmp,
1075  combosTmp);
1076  } else if (itrig == L1ParticleMap::kMu3_HTT200) {
1077  objectTypes.push_back(L1ParticleMap::kMuon);
1078  objectTypes.push_back(L1ParticleMap::kEtHad);
1079 
1080  if (ht >= doubleThresholds_[itrig].second) {
1081  evaluateSingleObjectTrigger(inputMuonRefsSingle,
1082  doubleThresholds_[itrig].first, decision,
1083  outputMuonRefsTmp);
1084 
1085  if (decision) {
1086  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1087  }
1088  }
1089  } else if (itrig == L1ParticleMap::kIsoEG10_HTT200) {
1090  objectTypes.push_back(L1ParticleMap::kEM);
1091  objectTypes.push_back(L1ParticleMap::kEtHad);
1092 
1093  if (ht >= doubleThresholds_[itrig].second) {
1094  evaluateSingleObjectTrigger(inputIsoEmRefs,
1095  doubleThresholds_[itrig].first, decision,
1096  outputEmRefsTmp);
1097 
1098  if (decision) {
1099  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1100  }
1101  }
1102  } else if (itrig == L1ParticleMap::kEG12_HTT200) {
1103  objectTypes.push_back(L1ParticleMap::kEM);
1104  objectTypes.push_back(L1ParticleMap::kEtHad);
1105 
1106  if (ht >= doubleThresholds_[itrig].second) {
1107  evaluateSingleObjectTrigger(inputRelaxedEmRefs,
1108  doubleThresholds_[itrig].first, decision,
1109  outputEmRefsTmp);
1110 
1111  if (decision) {
1112  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1113  }
1114  }
1115  } else if (itrig == L1ParticleMap::kJet70_HTT200) {
1116  objectTypes.push_back(L1ParticleMap::kJet);
1117  objectTypes.push_back(L1ParticleMap::kEtHad);
1118 
1119  if (ht >= doubleThresholds_[itrig].second) {
1120  evaluateSingleObjectTrigger(inputJetRefs,
1121  doubleThresholds_[itrig].first, decision,
1122  outputJetRefsTmp);
1123 
1124  if (decision) {
1125  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1126  }
1127  }
1128  } else if (itrig == L1ParticleMap::kTauJet40_HTT200) {
1129  objectTypes.push_back(L1ParticleMap::kJet);
1130  objectTypes.push_back(L1ParticleMap::kEtHad);
1131 
1132  if (ht >= doubleThresholds_[itrig].second) {
1133  evaluateSingleObjectTrigger(inputTauRefs,
1134  doubleThresholds_[itrig].first, decision,
1135  outputJetRefsTmp);
1136 
1137  if (decision) {
1138  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1139  }
1140  }
1141  } else if (itrig == L1ParticleMap::kMu3_ETM30) {
1142  objectTypes.push_back(L1ParticleMap::kMuon);
1143  objectTypes.push_back(L1ParticleMap::kEtMiss);
1144 
1145  if (met >= doubleThresholds_[itrig].second) {
1146  evaluateSingleObjectTrigger(inputMuonRefsSingle,
1147  doubleThresholds_[itrig].first, decision,
1148  outputMuonRefsTmp);
1149 
1150  if (decision) {
1151  metRefTmp = L1EtMissParticleRefProd(metHandle);
1152  }
1153  }
1154  } else if (itrig == L1ParticleMap::kIsoEG10_ETM30) {
1155  objectTypes.push_back(L1ParticleMap::kEM);
1156  objectTypes.push_back(L1ParticleMap::kEtMiss);
1157 
1158  if (met >= doubleThresholds_[itrig].second) {
1159  evaluateSingleObjectTrigger(inputIsoEmRefs,
1160  doubleThresholds_[itrig].first, decision,
1161  outputEmRefsTmp);
1162 
1163  if (decision) {
1164  metRefTmp = L1EtMissParticleRefProd(metHandle);
1165  }
1166  }
1167  } else if (itrig == L1ParticleMap::kEG12_ETM30) {
1168  objectTypes.push_back(L1ParticleMap::kEM);
1169  objectTypes.push_back(L1ParticleMap::kEtMiss);
1170 
1171  if (met >= doubleThresholds_[itrig].second) {
1172  evaluateSingleObjectTrigger(inputRelaxedEmRefs,
1173  doubleThresholds_[itrig].first, decision,
1174  outputEmRefsTmp);
1175 
1176  if (decision) {
1177  metRefTmp = L1EtMissParticleRefProd(metHandle);
1178  }
1179  }
1180  } else if (itrig == L1ParticleMap::kJet70_ETM40) {
1181  objectTypes.push_back(L1ParticleMap::kJet);
1182  objectTypes.push_back(L1ParticleMap::kEtMiss);
1183 
1184  if (met >= doubleThresholds_[itrig].second) {
1185  evaluateSingleObjectTrigger(inputJetRefs,
1186  doubleThresholds_[itrig].first, decision,
1187  outputJetRefsTmp);
1188 
1189  if (decision) {
1190  metRefTmp = L1EtMissParticleRefProd(metHandle);
1191  }
1192  }
1193  } else if (itrig == L1ParticleMap::kTauJet20_ETM20 ||
1194  itrig == L1ParticleMap::kTauJet30_ETM30 ||
1195  itrig == L1ParticleMap::kTauJet30_ETM40) {
1196  objectTypes.push_back(L1ParticleMap::kJet);
1197  objectTypes.push_back(L1ParticleMap::kEtMiss);
1198 
1199  if (met >= doubleThresholds_[itrig].second) {
1200  evaluateSingleObjectTrigger(inputTauRefs,
1201  doubleThresholds_[itrig].first, decision,
1202  outputJetRefsTmp);
1203 
1204  if (decision) {
1205  metRefTmp = L1EtMissParticleRefProd(metHandle);
1206  }
1207  }
1208  } else if (itrig == L1ParticleMap::kHTT100_ETM30) {
1209  objectTypes.push_back(L1ParticleMap::kEtHad);
1210  objectTypes.push_back(L1ParticleMap::kEtMiss);
1211 
1212  if (ht >= doubleThresholds_[itrig].first &&
1213  met >= doubleThresholds_[itrig].second) {
1214  decision = true;
1215  metRefTmp = L1EtMissParticleRefProd(metHandle);
1216  }
1217  } else if (itrig == L1ParticleMap::kTripleMu3) {
1218  objectTypes.push_back(L1ParticleMap::kMuon);
1219  objectTypes.push_back(L1ParticleMap::kMuon);
1220  objectTypes.push_back(L1ParticleMap::kMuon);
1221 
1222  evaluateTripleSameObjectTrigger(inputMuonRefsDouble,
1223  singleThresholds_[itrig], decision,
1224  outputMuonRefsTmp, combosTmp);
1225  } else if (itrig == L1ParticleMap::kTripleIsoEG5) {
1226  objectTypes.push_back(L1ParticleMap::kEM);
1227  objectTypes.push_back(L1ParticleMap::kEM);
1228  objectTypes.push_back(L1ParticleMap::kEM);
1229 
1230  evaluateTripleSameObjectTrigger(inputIsoEmRefs, singleThresholds_[itrig],
1231  decision, outputEmRefsTmp, combosTmp);
1232  } else if (itrig == L1ParticleMap::kTripleEG10) {
1233  objectTypes.push_back(L1ParticleMap::kEM);
1234  objectTypes.push_back(L1ParticleMap::kEM);
1235  objectTypes.push_back(L1ParticleMap::kEM);
1236 
1237  evaluateTripleSameObjectTrigger(inputRelaxedEmRefs,
1238  singleThresholds_[itrig], decision,
1239  outputEmRefsTmp, combosTmp);
1240  } else if (itrig == L1ParticleMap::kTripleJet50) {
1241  objectTypes.push_back(L1ParticleMap::kJet);
1242  objectTypes.push_back(L1ParticleMap::kJet);
1243  objectTypes.push_back(L1ParticleMap::kJet);
1244 
1246  decision, outputJetRefsTmp, combosTmp);
1247  } else if (itrig == L1ParticleMap::kTripleTauJet40) {
1248  objectTypes.push_back(L1ParticleMap::kJet);
1249  objectTypes.push_back(L1ParticleMap::kJet);
1250  objectTypes.push_back(L1ParticleMap::kJet);
1251 
1253  decision, outputJetRefsTmp, combosTmp);
1254  } else if (itrig == L1ParticleMap::kDoubleMu3_IsoEG5) {
1255  objectTypes.push_back(L1ParticleMap::kMuon);
1256  objectTypes.push_back(L1ParticleMap::kMuon);
1257  objectTypes.push_back(L1ParticleMap::kEM);
1258 
1260  inputMuonRefsDouble, inputIsoEmRefs, doubleThresholds_[itrig].first,
1261  doubleThresholds_[itrig].second, decision, outputMuonRefsTmp,
1262  outputEmRefsTmp, combosTmp);
1263  } else if (itrig == L1ParticleMap::kDoubleMu3_EG10) {
1264  objectTypes.push_back(L1ParticleMap::kMuon);
1265  objectTypes.push_back(L1ParticleMap::kMuon);
1266  objectTypes.push_back(L1ParticleMap::kEM);
1267 
1269  inputMuonRefsDouble, inputRelaxedEmRefs,
1271  decision, outputMuonRefsTmp, outputEmRefsTmp, combosTmp);
1272  } else if (itrig == L1ParticleMap::kDoubleIsoEG5_Mu3) {
1273  objectTypes.push_back(L1ParticleMap::kEM);
1274  objectTypes.push_back(L1ParticleMap::kEM);
1275  objectTypes.push_back(L1ParticleMap::kMuon);
1276 
1278  inputIsoEmRefs, inputMuonRefsSingle, doubleThresholds_[itrig].first,
1279  doubleThresholds_[itrig].second, decision, outputEmRefsTmp,
1280  outputMuonRefsTmp, combosTmp);
1281  } else if (itrig == L1ParticleMap::kDoubleEG10_Mu3) {
1282  objectTypes.push_back(L1ParticleMap::kEM);
1283  objectTypes.push_back(L1ParticleMap::kEM);
1284  objectTypes.push_back(L1ParticleMap::kMuon);
1285 
1287  inputRelaxedEmRefs, inputMuonRefsSingle,
1289  decision, outputEmRefsTmp, outputMuonRefsTmp, combosTmp);
1290  } else if (itrig == L1ParticleMap::kDoubleMu3_HTT200) {
1291  objectTypes.push_back(L1ParticleMap::kMuon);
1292  objectTypes.push_back(L1ParticleMap::kMuon);
1293  objectTypes.push_back(L1ParticleMap::kEtHad);
1294 
1295  if (ht >= doubleThresholds_[itrig].second) {
1297  inputMuonRefsDouble, doubleThresholds_[itrig].first, decision,
1298  outputMuonRefsTmp, combosTmp, true);
1299 
1300  if (decision) {
1301  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1302  }
1303  }
1304  } else if (itrig == L1ParticleMap::kDoubleIsoEG5_HTT200) {
1305  objectTypes.push_back(L1ParticleMap::kEM);
1306  objectTypes.push_back(L1ParticleMap::kEM);
1307  objectTypes.push_back(L1ParticleMap::kEtHad);
1308 
1309  if (ht >= doubleThresholds_[itrig].second) {
1311  inputIsoEmRefs, doubleThresholds_[itrig].first, decision,
1312  outputEmRefsTmp, combosTmp, true);
1313 
1314  if (decision) {
1315  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1316  }
1317  }
1318  } else if (itrig == L1ParticleMap::kDoubleEG10_HTT200) {
1319  objectTypes.push_back(L1ParticleMap::kEM);
1320  objectTypes.push_back(L1ParticleMap::kEM);
1321  objectTypes.push_back(L1ParticleMap::kEtHad);
1322 
1323  if (ht >= doubleThresholds_[itrig].second) {
1325  inputRelaxedEmRefs, doubleThresholds_[itrig].first, decision,
1326  outputEmRefsTmp, combosTmp, true);
1327 
1328  if (decision) {
1329  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1330  }
1331  }
1332  } else if (itrig == L1ParticleMap::kDoubleJet50_HTT200) {
1333  objectTypes.push_back(L1ParticleMap::kJet);
1334  objectTypes.push_back(L1ParticleMap::kJet);
1335  objectTypes.push_back(L1ParticleMap::kEtHad);
1336 
1337  if (ht >= doubleThresholds_[itrig].second) {
1339  inputJetRefs, doubleThresholds_[itrig].first, decision,
1340  outputJetRefsTmp, combosTmp, true);
1341 
1342  if (decision) {
1343  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1344  }
1345  }
1346  } else if (itrig == L1ParticleMap::kDoubleTauJet40_HTT200) {
1347  objectTypes.push_back(L1ParticleMap::kJet);
1348  objectTypes.push_back(L1ParticleMap::kJet);
1349  objectTypes.push_back(L1ParticleMap::kEtHad);
1350 
1351  if (ht >= doubleThresholds_[itrig].second) {
1353  inputTauRefs, doubleThresholds_[itrig].first, decision,
1354  outputJetRefsTmp, combosTmp, true);
1355 
1356  if (decision) {
1357  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1358  }
1359  }
1360  } else if (itrig == L1ParticleMap::kDoubleMu3_ETM20) {
1361  objectTypes.push_back(L1ParticleMap::kMuon);
1362  objectTypes.push_back(L1ParticleMap::kMuon);
1363  objectTypes.push_back(L1ParticleMap::kEtMiss);
1364 
1365  if (met >= doubleThresholds_[itrig].second) {
1367  inputMuonRefsDouble, doubleThresholds_[itrig].first, decision,
1368  outputMuonRefsTmp, combosTmp, true);
1369 
1370  if (decision) {
1371  metRefTmp = L1EtMissParticleRefProd(metHandle);
1372  }
1373  }
1374  } else if (itrig == L1ParticleMap::kDoubleIsoEG5_ETM20) {
1375  objectTypes.push_back(L1ParticleMap::kEM);
1376  objectTypes.push_back(L1ParticleMap::kEM);
1377  objectTypes.push_back(L1ParticleMap::kEtMiss);
1378 
1379  if (met >= doubleThresholds_[itrig].second) {
1381  inputIsoEmRefs, doubleThresholds_[itrig].first, decision,
1382  outputEmRefsTmp, combosTmp, true);
1383 
1384  if (decision) {
1385  metRefTmp = L1EtMissParticleRefProd(metHandle);
1386  }
1387  }
1388  } else if (itrig == L1ParticleMap::kDoubleEG10_ETM20) {
1389  objectTypes.push_back(L1ParticleMap::kEM);
1390  objectTypes.push_back(L1ParticleMap::kEM);
1391  objectTypes.push_back(L1ParticleMap::kEtMiss);
1392 
1393  if (met >= doubleThresholds_[itrig].second) {
1395  inputRelaxedEmRefs, doubleThresholds_[itrig].first, decision,
1396  outputEmRefsTmp, combosTmp, true);
1397 
1398  if (decision) {
1399  metRefTmp = L1EtMissParticleRefProd(metHandle);
1400  }
1401  }
1402  } else if (itrig == L1ParticleMap::kDoubleJet50_ETM20) {
1403  objectTypes.push_back(L1ParticleMap::kJet);
1404  objectTypes.push_back(L1ParticleMap::kJet);
1405  objectTypes.push_back(L1ParticleMap::kEtMiss);
1406 
1407  if (met >= doubleThresholds_[itrig].second) {
1409  inputJetRefs, doubleThresholds_[itrig].first, decision,
1410  outputJetRefsTmp, combosTmp, true);
1411 
1412  if (decision) {
1413  metRefTmp = L1EtMissParticleRefProd(metHandle);
1414  }
1415  }
1416  } else if (itrig == L1ParticleMap::kDoubleTauJet40_ETM20) {
1417  objectTypes.push_back(L1ParticleMap::kJet);
1418  objectTypes.push_back(L1ParticleMap::kJet);
1419  objectTypes.push_back(L1ParticleMap::kEtMiss);
1420 
1421  if (met >= doubleThresholds_[itrig].second) {
1423  inputTauRefs, doubleThresholds_[itrig].first, decision,
1424  outputJetRefsTmp, combosTmp, true);
1425 
1426  if (decision) {
1427  metRefTmp = L1EtMissParticleRefProd(metHandle);
1428  }
1429  }
1430  } else if (itrig == L1ParticleMap::kQuadJet30) {
1431  objectTypes.push_back(L1ParticleMap::kJet);
1432  objectTypes.push_back(L1ParticleMap::kJet);
1433  objectTypes.push_back(L1ParticleMap::kJet);
1434  objectTypes.push_back(L1ParticleMap::kJet);
1435 
1436  evaluateQuadSameObjectTrigger(inputJetRefs, singleThresholds_[itrig],
1437  decision, outputJetRefsTmp, combosTmp);
1438  } else if (itrig == L1ParticleMap::kExclusiveDoubleIsoEG4) {
1439  objectTypes.push_back(L1ParticleMap::kEM);
1440  objectTypes.push_back(L1ParticleMap::kEM);
1441 
1442  evaluateDoubleExclusiveIsoEG(inputIsoEmRefs, inputJetRefs,
1443  doubleThresholds_[itrig].first,
1444  doubleThresholds_[itrig].second, decision,
1445  outputEmRefsTmp, combosTmp);
1446 
1447  } else if (itrig == L1ParticleMap::kExclusiveDoubleJet60) {
1448  objectTypes.push_back(L1ParticleMap::kJet);
1449  objectTypes.push_back(L1ParticleMap::kJet);
1450 
1451  if (inputJetRefs.size() == 2) {
1453  decision, outputJetRefsTmp, combosTmp);
1454  }
1455  } else if (itrig == L1ParticleMap::kExclusiveJet25_Gap_Jet25) {
1456  objectTypes.push_back(L1ParticleMap::kJet);
1457  objectTypes.push_back(L1ParticleMap::kJet);
1458 
1459  if (inputJetRefs.size() == 2) {
1460  evaluateJetGapJetTrigger(inputForJetRefs, singleThresholds_[itrig],
1461  decision, outputJetRefsTmp, combosTmp);
1462  }
1463  } else if (itrig == L1ParticleMap::kIsoEG10_Jet20_ForJet10) {
1464  objectTypes.push_back(L1ParticleMap::kEM);
1465  objectTypes.push_back(L1ParticleMap::kJet);
1466 
1467  evaluateForwardRapidityGap(inputForJetRefs, singleThresholds_[itrig],
1468  decision);
1469 
1470  if (decision) {
1471  decision = false;
1473  inputIsoEmRefs, inputCenJetTauJetRefs,
1475  decision, outputEmRefsTmp, outputJetRefsTmp, combosTmp);
1476  }
1477  } else if (itrig == L1ParticleMap::kMinBias_HTT10) {
1478  objectTypes.push_back(L1ParticleMap::kEtHad);
1479 
1480  if (ht >= 10.) {
1481  decision = true;
1482  metRefTmp = L1EtMissParticleRefProd(mhtHandle);
1483  }
1484  } else if (itrig == L1ParticleMap::kZeroBias) {
1485  decision = true;
1486  }
1487 
1488  L1EmParticleVectorRef outputEmRefs;
1489  L1JetParticleVectorRef outputJetRefs;
1490  L1MuonParticleVectorRef outputMuonRefs;
1491  L1EtMissParticleRefProd metRef;
1492  L1ParticleMap::L1IndexComboVector combos; // unfilled for single objs
1493 
1494  if (decision) {
1495  // if( prescaleCounters_[ itrig ] % prescales_[ itrig ] )
1496 
1497  double rand = CLHEP::RandFlat::shoot() * (double)prescales_[itrig];
1498  if (rand > 1.) {
1499  decision = false;
1500  } else {
1501  outputEmRefs = outputEmRefsTmp;
1502  outputJetRefs = outputJetRefsTmp;
1503  outputMuonRefs = outputMuonRefsTmp;
1504  metRef = metRefTmp;
1505  combos = combosTmp;
1506  }
1507 
1508  ++prescaleCounters_[itrig];
1509  }
1510 
1511  // Construct a L1ParticleMap and add it to the collection.
1512  mapColl->push_back(L1ParticleMap(
1513  (L1ParticleMap::L1TriggerType)itrig, decision, objectTypes,
1514  outputEmRefs, outputJetRefs, outputMuonRefs, metRef, combos));
1515 
1516  globalDecision = globalDecision || decision;
1517  decisionWord.push_back(decision);
1518  }
1519 
1520  // Put the L1ParticleMapCollection into the event.
1521  iEvent.put(std::move(mapColl));
1522 
1523  // Make a L1GlobalTriggerReadoutRecord and put it into the event.
1524  unique_ptr<L1GlobalTriggerReadoutRecord> gtRecord(
1526  gtRecord->setDecision(globalDecision);
1527  gtRecord->setDecisionWord(decisionWord);
1528  iEvent.put(std::move(gtRecord));
1529 
1530  return;
1531 }
1532 
1533 template <class TCollection>
1535  const edm::Handle<TCollection> &handle, // input
1536  std::vector<edm::Ref<TCollection>> &vectorRefs) // output
1537 {
1538  for (size_t i = 0; i < handle->size(); ++i) {
1539  vectorRefs.push_back(edm::Ref<TCollection>(handle, i));
1540  }
1541 }
1542 
1543 template <class TCollection>
1545  const std::vector<edm::Ref<TCollection>> &inputRefs, // input
1546  const double &etThreshold, // input
1547  bool &decision, // output
1548  std::vector<edm::Ref<TCollection>> &outputRefs) // output
1549 {
1550  for (size_t i = 0; i < inputRefs.size(); ++i) {
1551  if (inputRefs[i].get()->et() >= etThreshold) {
1552  decision = true;
1553  outputRefs.push_back(inputRefs[i]);
1554  }
1555  }
1556 }
1557 
1558 template <class TCollection>
1560  const std::vector<edm::Ref<TCollection>> &inputRefs, // input
1561  const double &etThreshold, // input
1562  bool &decision, // output
1563  std::vector<edm::Ref<TCollection>> &outputRefs, // output
1565  bool combinedWithGlobalObject) // input
1566 {
1567  // Use i+1 < inputRefs.size() instead of i < inputRefs.size()-1
1568  // because i is unsigned, and if size() is 0, then RHS undefined.
1569  for (size_t i = 0; i + 1 < inputRefs.size(); ++i) {
1570  const edm::Ref<TCollection> &refi = inputRefs[i];
1571  if (refi.get()->et() >= etThreshold) {
1572  for (size_t j = i + 1; j < inputRefs.size(); ++j) {
1573  const edm::Ref<TCollection> &refj = inputRefs[j];
1574  if (refj.get()->et() >= etThreshold) {
1575  decision = true;
1576 
1577  // If the two objects are already in the list, find
1578  // their indices.
1579  int iInList = kDefault;
1580  int jInList = kDefault;
1581  for (size_t iout = 0; iout < outputRefs.size(); ++iout) {
1582  if (refi == outputRefs[iout]) {
1583  iInList = iout;
1584  }
1585 
1586  if (refj == outputRefs[iout]) {
1587  jInList = iout;
1588  }
1589  }
1590 
1591  // If either object is not in the list, add it, and
1592  // record its index.
1593  if (iInList == kDefault) {
1594  iInList = outputRefs.size();
1595  outputRefs.push_back(refi);
1596  }
1597 
1598  if (jInList == kDefault) {
1599  jInList = outputRefs.size();
1600  outputRefs.push_back(refj);
1601  }
1602 
1603  // Record this object combination.
1605  combo.push_back(iInList);
1606  combo.push_back(jInList);
1607  if (combinedWithGlobalObject)
1608  combo.push_back(0);
1609  combos.push_back(combo);
1610  }
1611  }
1612  }
1613  }
1614 }
1615 
1616 template <class TCollection>
1618  const std::vector<edm::Ref<TCollection>> &inputRefs, // input
1619  const double &etThreshold, // input
1620  bool &decision, // output
1621  std::vector<edm::Ref<TCollection>> &outputRefs, // output
1623 {
1624  // Use i+2 < inputRefs.size() instead of i < inputRefs.size()-2
1625  // because i is unsigned, and if size() is 0, then RHS undefined.
1626  for (size_t i = 0; i + 2 < inputRefs.size(); ++i) {
1627  const edm::Ref<TCollection> &refi = inputRefs[i];
1628  if (refi.get()->et() >= etThreshold) {
1629  for (size_t j = i + 1; j + 1 < inputRefs.size(); ++j) {
1630  const edm::Ref<TCollection> &refj = inputRefs[j];
1631  if (refj.get()->et() >= etThreshold) {
1632  for (size_t k = j + 1; k < inputRefs.size(); ++k) {
1633  const edm::Ref<TCollection> &refk = inputRefs[k];
1634  if (refk.get()->et() >= etThreshold) {
1635  decision = true;
1636 
1637  // If the three objects are already in the list, find
1638  // their indices.
1639  int iInList = kDefault;
1640  int jInList = kDefault;
1641  int kInList = kDefault;
1642  for (size_t iout = 0; iout < outputRefs.size(); ++iout) {
1643  if (refi == outputRefs[iout]) {
1644  iInList = iout;
1645  }
1646 
1647  if (refj == outputRefs[iout]) {
1648  jInList = iout;
1649  }
1650 
1651  if (refk == outputRefs[iout]) {
1652  kInList = iout;
1653  }
1654  }
1655 
1656  // If any object is not in the list, add it, and
1657  // record its index.
1658  if (iInList == kDefault) {
1659  iInList = outputRefs.size();
1660  outputRefs.push_back(refi);
1661  }
1662 
1663  if (jInList == kDefault) {
1664  jInList = outputRefs.size();
1665  outputRefs.push_back(refj);
1666  }
1667 
1668  if (kInList == kDefault) {
1669  kInList = outputRefs.size();
1670  outputRefs.push_back(refk);
1671  }
1672 
1673  // Record this object combination.
1675  combo.push_back(iInList);
1676  combo.push_back(jInList);
1677  combo.push_back(kInList);
1678  combos.push_back(combo);
1679  }
1680  }
1681  }
1682  }
1683  }
1684  }
1685 }
1686 
1687 template <class TCollection1, class TCollection2>
1689  const std::vector<edm::Ref<TCollection1>> &inputRefs1, // input
1690  const std::vector<edm::Ref<TCollection2>> &inputRefs2, // input
1691  const double &etThreshold1, // input
1692  const double &etThreshold2, // input
1693  bool &decision, // output
1694  std::vector<edm::Ref<TCollection1>> &outputRefs1, // output
1695  std::vector<edm::Ref<TCollection2>> &outputRefs2, // output
1697 {
1698  // Use i+1 < inputRefs.size() instead of i < inputRefs.size()-1
1699  // because i is unsigned, and if size() is 0, then RHS undefined.
1700  for (size_t i = 0; i + 1 < inputRefs1.size(); ++i) {
1701  const edm::Ref<TCollection1> &refi = inputRefs1[i];
1702  if (refi.get()->et() >= etThreshold1) {
1703  for (size_t j = i + 1; j < inputRefs1.size(); ++j) {
1704  const edm::Ref<TCollection1> &refj = inputRefs1[j];
1705  if (refj.get()->et() >= etThreshold1) {
1706  for (size_t k = 0; k < inputRefs2.size(); ++k) {
1707  const edm::Ref<TCollection2> &refk = inputRefs2[k];
1708  if (refk.get()->et() >= etThreshold2) {
1709  decision = true;
1710 
1711  // If the three objects are already in the list, find
1712  // their indices.
1713  int iInList = kDefault;
1714  int jInList = kDefault;
1715 
1716  for (size_t iout = 0; iout < outputRefs1.size(); ++iout) {
1717  if (refi == outputRefs1[iout]) {
1718  iInList = iout;
1719  }
1720 
1721  if (refj == outputRefs1[iout]) {
1722  jInList = iout;
1723  }
1724  }
1725 
1726  int kInList = kDefault;
1727  for (size_t kout = 0; kout < outputRefs2.size(); ++kout) {
1728  if (refk == outputRefs2[kout]) {
1729  kInList = kout;
1730  }
1731  }
1732 
1733  // If any object is not in the list, add it, and
1734  // record its index.
1735  if (iInList == kDefault) {
1736  iInList = outputRefs1.size();
1737  outputRefs1.push_back(refi);
1738  }
1739 
1740  if (jInList == kDefault) {
1741  jInList = outputRefs1.size();
1742  outputRefs1.push_back(refj);
1743  }
1744 
1745  if (kInList == kDefault) {
1746  kInList = outputRefs2.size();
1747  outputRefs2.push_back(refk);
1748  }
1749 
1750  // Record this object combination.
1752  combo.push_back(iInList);
1753  combo.push_back(jInList);
1754  combo.push_back(kInList);
1755  combos.push_back(combo);
1756  }
1757  }
1758  }
1759  }
1760  }
1761  }
1762 }
1763 
1764 template <class TCollection>
1766  const std::vector<edm::Ref<TCollection>> &inputRefs, // input
1767  const double &etThreshold, // input
1768  bool &decision, // output
1769  std::vector<edm::Ref<TCollection>> &outputRefs, // output
1771 {
1772  // Use i+3 < inputRefs.size() instead of i < inputRefs.size()-3
1773  // because i is unsigned, and if size() is 0, then RHS undefined.
1774  for (size_t i = 0; i + 3 < inputRefs.size(); ++i) {
1775  const edm::Ref<TCollection> &refi = inputRefs[i];
1776  if (refi.get()->et() >= etThreshold) {
1777  for (size_t j = i + 1; j + 2 < inputRefs.size(); ++j) {
1778  const edm::Ref<TCollection> &refj = inputRefs[j];
1779  if (refj.get()->et() >= etThreshold) {
1780  for (size_t k = j + 1; k + 1 < inputRefs.size(); ++k) {
1781  const edm::Ref<TCollection> &refk = inputRefs[k];
1782  if (refk.get()->et() >= etThreshold) {
1783  for (size_t p = k + 1; p < inputRefs.size(); ++p) {
1784  const edm::Ref<TCollection> &refp = inputRefs[p];
1785  if (refp.get()->et() >= etThreshold) {
1786  decision = true;
1787 
1788  // If the objects are already in the list, find
1789  // their indices.
1790  int iInList = kDefault;
1791  int jInList = kDefault;
1792  int kInList = kDefault;
1793  int pInList = kDefault;
1794  for (size_t iout = 0; iout < outputRefs.size(); ++iout) {
1795  if (refi == outputRefs[iout]) {
1796  iInList = iout;
1797  }
1798 
1799  if (refj == outputRefs[iout]) {
1800  jInList = iout;
1801  }
1802 
1803  if (refk == outputRefs[iout]) {
1804  kInList = iout;
1805  }
1806 
1807  if (refp == outputRefs[iout]) {
1808  pInList = iout;
1809  }
1810  }
1811 
1812  // If any object is not in the list, add it, and
1813  // record its index.
1814  if (iInList == kDefault) {
1815  iInList = outputRefs.size();
1816  outputRefs.push_back(refi);
1817  }
1818 
1819  if (jInList == kDefault) {
1820  jInList = outputRefs.size();
1821  outputRefs.push_back(refj);
1822  }
1823 
1824  if (kInList == kDefault) {
1825  kInList = outputRefs.size();
1826  outputRefs.push_back(refk);
1827  }
1828 
1829  if (pInList == kDefault) {
1830  pInList = outputRefs.size();
1831  outputRefs.push_back(refp);
1832  }
1833 
1834  // Record this object combination.
1836  combo.push_back(iInList);
1837  combo.push_back(jInList);
1838  combo.push_back(kInList);
1839  combo.push_back(pInList);
1840  combos.push_back(combo);
1841  }
1842  }
1843  }
1844  }
1845  }
1846  }
1847  }
1848  }
1849 }
1850 
1851 template <class TCollection1, class TCollection2>
1853  const std::vector<edm::Ref<TCollection1>> &inputRefs1, // input
1854  const std::vector<edm::Ref<TCollection2>> &inputRefs2, // input
1855  const double &etThreshold1, // input
1856  const double &etThreshold2, // input
1857  bool &decision, // output
1858  std::vector<edm::Ref<TCollection1>> &outputRefs1, // output
1859  std::vector<edm::Ref<TCollection2>> &outputRefs2, // output
1861 {
1862  for (size_t i = 0; i < inputRefs1.size(); ++i) {
1863  const edm::Ref<TCollection1> &refi = inputRefs1[i];
1864  if (refi.get()->et() >= etThreshold1) {
1865  for (size_t j = 0; j < inputRefs2.size(); ++j) {
1866  const edm::Ref<TCollection2> &refj = inputRefs2[j];
1867 
1868  if (refj.get()->et() >= etThreshold2) {
1869  decision = true;
1870 
1871  // If the two objects are already in their respective lists,
1872  // find their indices.
1873  int iInList = kDefault;
1874  for (size_t iout = 0; iout < outputRefs1.size(); ++iout) {
1875  if (refi == outputRefs1[iout]) {
1876  iInList = iout;
1877  }
1878  }
1879 
1880  int jInList = kDefault;
1881  for (size_t jout = 0; jout < outputRefs2.size(); ++jout) {
1882  if (refj == outputRefs2[jout]) {
1883  jInList = jout;
1884  }
1885  }
1886 
1887  // If either object is not in the list, add it, and
1888  // record its index.
1889  if (iInList == kDefault) {
1890  iInList = outputRefs1.size();
1891  outputRefs1.push_back(refi);
1892  }
1893 
1894  if (jInList == kDefault) {
1895  jInList = outputRefs2.size();
1896  outputRefs2.push_back(refj);
1897  }
1898 
1899  // Record this object combination.
1901  combo.push_back(iInList);
1902  combo.push_back(jInList);
1903  combos.push_back(combo);
1904  }
1905  }
1906  }
1907  }
1908 }
1909 
1910 template <class TCollection>
1912  const std::vector<edm::Ref<TCollection>> &inputRefs1, // input
1913  const std::vector<edm::Ref<TCollection>> &inputRefs2, // input
1914  const double &etThreshold1, // input
1915  const double &etThreshold2, // input
1916  bool &decision, // output
1917  std::vector<edm::Ref<TCollection>> &outputRefs, // output
1919 {
1920  for (size_t i = 0; i < inputRefs1.size(); ++i) {
1921  const edm::Ref<TCollection> &refi = inputRefs1[i];
1922  if (refi.get()->et() >= etThreshold1) {
1923  for (size_t j = 0; j < inputRefs2.size(); ++j) {
1924  const edm::Ref<TCollection> &refj = inputRefs2[j];
1925 
1926  if (refj.get()->et() >= etThreshold2 && refi != refj) {
1927  decision = true;
1928 
1929  // If the two objects are already in their respective lists,
1930  // find their indices.
1931  int iInList = kDefault;
1932  for (size_t iout = 0; iout < outputRefs.size(); ++iout) {
1933  if (refi == outputRefs[iout]) {
1934  iInList = iout;
1935  }
1936  }
1937 
1938  int jInList = kDefault;
1939  for (size_t jout = 0; jout < outputRefs.size(); ++jout) {
1940  if (refj == outputRefs[jout]) {
1941  jInList = jout;
1942  }
1943  }
1944 
1945  // If either object is not in the list, add it, and
1946  // record its index.
1947  if (iInList == kDefault) {
1948  iInList = outputRefs.size();
1949  outputRefs.push_back(refi);
1950  }
1951 
1952  if (jInList == kDefault) {
1953  jInList = outputRefs.size();
1954  outputRefs.push_back(refj);
1955  }
1956 
1957  // Record this object combination.
1959  combo.push_back(iInList);
1960  combo.push_back(jInList);
1961  combos.push_back(combo);
1962  }
1963  }
1964  }
1965  }
1966 }
1967 
1969  const l1extra::L1EmParticleVectorRef &inputRefs1, // input
1970  const l1extra::L1JetParticleVectorRef &inputRefs2, // input
1971  const double &etThreshold1, // input
1972  const double &etThreshold2, // input
1973  bool &decision, // output
1974  l1extra::L1EmParticleVectorRef &outputRefs1, // output
1975  l1extra::L1JetParticleVectorRef &outputRefs2, // output
1977 {
1978  for (size_t i = 0; i < inputRefs1.size(); ++i) {
1979  const l1extra::L1EmParticleRef &refi = inputRefs1[i];
1980  if (refi.get()->et() >= etThreshold1) {
1981  for (size_t j = 0; j < inputRefs2.size(); ++j) {
1982  const l1extra::L1JetParticleRef &refj = inputRefs2[j];
1983 
1984  // Check for identical region only if both HW objects are non-null.
1985  if (refj.get()->et() >= etThreshold2 &&
1986  (refi.get()->gctEmCand() == nullptr ||
1987  refj.get()->gctJetCand() == nullptr ||
1988  refi.get()->gctEmCand()->regionId() !=
1989  refj.get()->gctJetCand()->regionId())) {
1990  decision = true;
1991 
1992  // If the two objects are already in their respective lists,
1993  // find their indices.
1994  int iInList = kDefault;
1995  for (size_t iout = 0; iout < outputRefs1.size(); ++iout) {
1996  if (refi == outputRefs1[iout]) {
1997  iInList = iout;
1998  }
1999  }
2000 
2001  int jInList = kDefault;
2002  for (size_t jout = 0; jout < outputRefs2.size(); ++jout) {
2003  if (refj == outputRefs2[jout]) {
2004  jInList = jout;
2005  }
2006  }
2007 
2008  // If either object is not in the list, add it, and
2009  // record its index.
2010  if (iInList == kDefault) {
2011  iInList = outputRefs1.size();
2012  outputRefs1.push_back(refi);
2013  }
2014 
2015  if (jInList == kDefault) {
2016  jInList = outputRefs2.size();
2017  outputRefs2.push_back(refj);
2018  }
2019 
2020  // Record this object combination.
2022  combo.push_back(iInList);
2023  combo.push_back(jInList);
2024  combos.push_back(combo);
2025  }
2026  }
2027  }
2028  }
2029 }
2030 
2031 // ok if both objects are above the threshold and are in opposite hemispheres
2033  const l1extra::L1JetParticleVectorRef &inputRefs, // input
2034  const double &etThreshold, // input
2035  bool &decision, // output
2036  l1extra::L1JetParticleVectorRef &outputRefs, // output
2038 {
2039  // Use i+1 < inputRefs.size() instead of i < inputRefs.size()-1
2040  // because i is unsigned, and if size() is 0, then RHS undefined.
2041  for (size_t i = 0; i + 1 < inputRefs.size(); ++i) {
2042  const l1extra::L1JetParticleRef &refi = inputRefs[i];
2043  if (refi.get()->et() >= etThreshold) {
2044  for (size_t j = i + 1; j < inputRefs.size(); ++j) {
2045  const l1extra::L1JetParticleRef &refj = inputRefs[j];
2046  if ((refj.get()->et() >= etThreshold) &&
2047  (((refi.get()->eta() < 0.) && (refj.get()->eta() > 0.)) ||
2048  ((refi.get()->eta() > 0.) && (refj.get()->eta() < 0.)))) {
2049  decision = true;
2050 
2051  // If the two objects are already in the list, find
2052  // their indices.
2053  int iInList = kDefault;
2054  int jInList = kDefault;
2055  for (size_t iout = 0; iout < outputRefs.size(); ++iout) {
2056  if (refi == outputRefs[iout]) {
2057  iInList = iout;
2058  }
2059 
2060  if (refj == outputRefs[iout]) {
2061  jInList = iout;
2062  }
2063  }
2064 
2065  // If either object is not in the list, add it, and
2066  // record its index.
2067  if (iInList == kDefault) {
2068  iInList = outputRefs.size();
2069  outputRefs.push_back(refi);
2070  }
2071 
2072  if (jInList == kDefault) {
2073  jInList = outputRefs.size();
2074  outputRefs.push_back(refj);
2075  }
2076 
2077  // Record this object combination.
2079  combo.push_back(iInList);
2080  combo.push_back(jInList);
2081  combos.push_back(combo);
2082  }
2083  }
2084  }
2085  }
2086 }
2087 
2088 // veto if both forward regions see some jet with e_T > threshold
2090  const l1extra::L1JetParticleVectorRef &inputRefs, // input
2091  const double &etThreshold, // input
2092  bool &decision // output
2093 ) {
2094  decision = true;
2095 
2096  // search for forward pair
2097  for (size_t k = 0; k + 1 < inputRefs.size(); ++k) {
2098  const l1extra::L1JetParticleRef &refk = inputRefs[k];
2099  double etak = refk.get()->eta();
2100  if ((refk.get()->type() == l1extra::L1JetParticle::kForward) &&
2101  (refk.get()->et() >= etThreshold)) {
2102  for (size_t l = k + 1; l < inputRefs.size(); ++l) {
2103  const l1extra::L1JetParticleRef &refl = inputRefs[l];
2104  double etal = refl.get()->eta();
2105  if ((refl.get()->type() == l1extra::L1JetParticle::kForward) &&
2106  (refl.get()->et() >= etThreshold) &&
2107  ((etak > 0 && etal < 0) || (etak < 0 && etal > 0))) {
2108  decision = false;
2109  return; // no need for going further -- for a faster algorithm
2110  }
2111  }
2112  }
2113  }
2114 }
2115 
2117  const l1extra::L1EmParticleVectorRef &inputRefs1, // input
2118  const l1extra::L1JetParticleVectorRef &inputRefs2, // input
2119  const double &etThreshold1, // input
2120  const double &etThreshold2, // input
2121  bool &decision, // output
2122  l1extra::L1EmParticleVectorRef &outputRefs1, // output
2124 {
2125  if (inputRefs1.size() == 2) { // 2 iso EG
2126  decision = true;
2127  if (!inputRefs2.empty()) { // should veto if there are jets, with pt>thresh
2128  for (size_t j = 0; j < inputRefs2.size(); ++j) {
2129  if (inputRefs2[j].get()->gctJetCand()->regionId() ==
2130  inputRefs1[0].get()->gctEmCand()->regionId())
2131  continue;
2132  if (inputRefs2[j].get()->gctJetCand()->regionId() ==
2133  inputRefs1[1].get()->gctEmCand()->regionId())
2134  continue;
2135  if (inputRefs2[j].get()->et() > etThreshold2) {
2136  decision = false;
2137  break;
2138  }
2139  // break : for a faster algorithm
2140  }
2141  }
2142  if (decision) { // threshold evaluation for the Exclusive double isoEG
2143  decision = false;
2144  evaluateDoubleSameObjectTrigger(inputRefs1, etThreshold1, decision,
2145  outputRefs1, combos);
2146  }
2147  }
2148 }
2149 
2150 // define this as a plug-in
2151 // DEFINE_FWK_MODULE(L1ExtraParticleMapProd);
std::vector< L1EmParticleRef > L1EmParticleVectorRef
T getParameter(std::string const &) const
void evaluateDoublePlusSingleObjectTrigger(const std::vector< edm::Ref< TCollection1 >> &inputRefs1, const std::vector< edm::Ref< TCollection2 >> &inputRefs2, const double &etThreshold1, const double &etThreshold2, bool &decision, std::vector< edm::Ref< TCollection1 >> &outputRefs1, std::vector< edm::Ref< TCollection2 >> &outputRefs2, l1extra::L1ParticleMap::L1IndexComboVector &combos)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
std::pair< double, double > doubleThresholds_[l1extra::L1ParticleMap::kNumOfL1TriggerTypes]
void evaluateSingleObjectTrigger(const std::vector< edm::Ref< TCollection >> &inputRefs, const double &etThreshold, bool &decision, std::vector< edm::Ref< TCollection >> &outputRefs)
std::vector< L1JetParticleRef > L1JetParticleVectorRef
void evaluateDoubleSameObjectTrigger(const std::vector< edm::Ref< TCollection >> &inputRefs, const double &etThreshold, bool &decision, std::vector< edm::Ref< TCollection >> &outputRefs, l1extra::L1ParticleMap::L1IndexComboVector &combos, bool combinedWithGlobalObject=false)
void evaluateTripleSameObjectTrigger(const std::vector< edm::Ref< TCollection >> &inputRefs, const double &etThreshold, bool &decision, std::vector< edm::Ref< TCollection >> &outputRefs, l1extra::L1ParticleMap::L1IndexComboVector &combos)
void evaluateDoubleDifferentObjectSameTypeTrigger(const std::vector< edm::Ref< TCollection >> &inputRefs1, const std::vector< edm::Ref< TCollection >> &inputRefs2, const double &etThreshold1, const double &etThreshold2, bool &decision, std::vector< edm::Ref< TCollection >> &outputRefs, l1extra::L1ParticleMap::L1IndexComboVector &combos)
void evaluateForwardRapidityGap(const l1extra::L1JetParticleVectorRef &inputRefs, const double &etThreshold, bool &decision)
void addToVectorRefs(const edm::Handle< TCollection > &handle, std::vector< edm::Ref< TCollection >> &vectorRefs)
void produce(edm::Event &, const edm::EventSetup &) override
static const int kDefault
U second(std::pair< T, U > const &p)
std::vector< unsigned int > L1IndexCombo
int iEvent
Definition: GenABIO.cc:224
std::vector< L1IndexCombo > L1IndexComboVector
int prescaleCounters_[l1extra::L1ParticleMap::kNumOfL1TriggerTypes]
double singleThresholds_[l1extra::L1ParticleMap::kNumOfL1TriggerTypes]
void evaluateDoubleDifferentObjectTrigger(const std::vector< edm::Ref< TCollection1 >> &inputRefs1, const std::vector< edm::Ref< TCollection2 >> &inputRefs2, const double &etThreshold1, const double &etThreshold2, bool &decision, std::vector< edm::Ref< TCollection1 >> &outputRefs1, std::vector< edm::Ref< TCollection2 >> &outputRefs2, l1extra::L1ParticleMap::L1IndexComboVector &combos)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:243
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
int k[5][pyjets_maxn]
void evaluateDoubleExclusiveIsoEG(const l1extra::L1EmParticleVectorRef &inputRefs1, const l1extra::L1JetParticleVectorRef &inputRefs2, const double &etThreshold1, const double &etThreshold2, bool &decision, l1extra::L1EmParticleVectorRef &outputRefs1, l1extra::L1ParticleMap::L1IndexComboVector &combos)
void evaluateDoubleDifferentCaloObjectTrigger(const l1extra::L1EmParticleVectorRef &inputRefs1, const l1extra::L1JetParticleVectorRef &inputRefs2, const double &etThreshold1, const double &etThreshold2, bool &decision, l1extra::L1EmParticleVectorRef &outputRefs1, l1extra::L1JetParticleVectorRef &outputRefs2, l1extra::L1ParticleMap::L1IndexComboVector &combos)
met
===> hadronic RAZOR
void evaluateQuadSameObjectTrigger(const std::vector< edm::Ref< TCollection >> &inputRefs, const double &etThreshold, bool &decision, std::vector< edm::Ref< TCollection >> &outputRefs, l1extra::L1ParticleMap::L1IndexComboVector &combos)
fixed size matrix
HLT enums.
int prescales_[l1extra::L1ParticleMap::kNumOfL1TriggerTypes]
edm::RefProd< L1EtMissParticle > L1EtMissParticleRefProd
const double & etTotal() const
Signal rand(Signal arg)
Definition: vlib.cc:442
std::vector< L1MuonParticleRef > L1MuonParticleVectorRef
Pt3D refl(const Pt3D &p)
L1ExtraParticleMapProd(const edm::ParameterSet &)
def move(src, dest)
Definition: eostools.py:511
void evaluateJetGapJetTrigger(const l1extra::L1JetParticleVectorRef &inputRefs, const double &etThreshold, bool &decision, l1extra::L1JetParticleVectorRef &outputRefs, l1extra::L1ParticleMap::L1IndexComboVector &combos)