CMS 3D CMS Logo

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