CMS 3D CMS Logo

HLTInclusiveVBFSource.cc
Go to the documentation of this file.
1 /*
2  HLTInclusiveVBFSource
3  Phat Srimanobhas
4  To monitor VBF DataParking
5 */
6 
8 
14 
16 
26 
28 
29 #include <cmath>
30 #include "TH1F.h"
31 #include "TProfile.h"
32 #include "TH2F.h"
33 #include "TPRegexp.h"
34 #include "TMath.h"
35 
36 using namespace edm;
37 using namespace reco;
38 using namespace std;
39 
41  LogDebug("HLTInclusiveVBFSource") << "constructor....";
42  nCount_ = 0;
43 
44  dirname_ = iConfig.getUntrackedParameter("dirname", std::string("HLT/InclusiveVBF"));
45  processname_ = iConfig.getParameter<std::string>("processname");
46  triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
47  triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
48  triggerSummaryToken = consumes<trigger::TriggerEvent>(triggerSummaryLabel_);
49  triggerResultsToken = consumes<edm::TriggerResults>(triggerResultsLabel_);
50  triggerSummaryFUToken = consumes<trigger::TriggerEvent>(
51  edm::InputTag(triggerSummaryLabel_.label(), triggerSummaryLabel_.instance(), std::string("FU")));
52  triggerResultsFUToken = consumes<edm::TriggerResults>(
53  edm::InputTag(triggerResultsLabel_.label(), triggerResultsLabel_.instance(), std::string("FU")));
54 
55  //path_ = iConfig.getUntrackedParameter<std::vector<std::string> >("paths");
56  //l1path_ = iConfig.getUntrackedParameter<std::vector<std::string> >("l1paths");
57  debug_ = iConfig.getUntrackedParameter<bool>("debug", false);
58 
59  caloJetsToken = consumes<reco::CaloJetCollection>(iConfig.getParameter<edm::InputTag>("CaloJetCollectionLabel"));
60  caloMetToken = consumes<reco::CaloMETCollection>(iConfig.getParameter<edm::InputTag>("CaloMETCollectionLabel"));
61  pfJetsToken = consumes<edm::View<reco::PFJet> >(iConfig.getParameter<edm::InputTag>("PFJetCollectionLabel"));
62  pfMetToken = consumes<edm::View<reco::PFMET> >(iConfig.getParameter<edm::InputTag>("PFMETCollectionLabel"));
63  //jetID = new reco::helper::JetIDHelper(iConfig.getParameter<ParameterSet>("JetIDParams"));
64 
65  minPtHigh_ = iConfig.getUntrackedParameter<double>("minPtHigh", 40.);
66  minPtLow_ = iConfig.getUntrackedParameter<double>("minPtLow", 40.);
67  minDeltaEta_ = iConfig.getUntrackedParameter<double>("minDeltaEta", 3.5);
68  deltaRMatch_ = iConfig.getUntrackedParameter<double>("deltaRMatch", 0.1);
69  minInvMass_ = iConfig.getUntrackedParameter<double>("minInvMass", 1000.0);
70  etaOpposite_ = iConfig.getUntrackedParameter<bool>("etaOpposite", true);
71 
72  check_mjj650_Pt35_DEta3p5 = false;
73  check_mjj700_Pt35_DEta3p5 = false;
74  check_mjj750_Pt35_DEta3p5 = false;
75  check_mjj800_Pt35_DEta3p5 = false;
76  check_mjj650_Pt40_DEta3p5 = false;
77  check_mjj700_Pt40_DEta3p5 = false;
78  check_mjj750_Pt40_DEta3p5 = false;
79  check_mjj800_Pt40_DEta3p5 = false;
80 }
81 
83  //
84  // do anything here that needs to be done at desctruction time
85  // (e.g. close files, deallocate resources etc.)
86 }
87 
89  using namespace std;
90  using namespace edm;
91  using namespace trigger;
92  using namespace reco;
93 
94  if (debug_)
95  cout << "DEBUG-0: Start to analyze" << endl;
96 
97  //****************************************************
98  // Get trigger information.
99  //****************************************************
100  //
101  //---------- triggerResults ----------
103  if (!triggerResults_.isValid()) {
104  iEvent.getByToken(triggerResultsFUToken, triggerResults_);
105  if (!triggerResults_.isValid()) {
106  edm::LogInfo("HLTInclusiveVBFSource") << "TriggerResults not found, "
107  "skipping event";
108  return;
109  }
110  }
111 
112  // Check how many HLT triggers are in triggerResults
113  triggerNames_ = iEvent.triggerNames(*triggerResults_);
114 
115  //---------- triggerSummary ----------
116  iEvent.getByToken(triggerSummaryToken, triggerObj_);
117  if (!triggerObj_.isValid()) {
118  iEvent.getByToken(triggerSummaryFUToken, triggerObj_);
119  if (!triggerObj_.isValid()) {
120  edm::LogInfo("HLTInclusiveVBFSource") << "TriggerEvent not found, "
121  "skipping event";
122  return;
123  }
124  }
125 
126  if (debug_)
127  cout << "DEBUG-1: Trigger information" << endl;
128 
129  //****************************************************
130  // Get AOD information
131  //****************************************************
132  //
134  bool ValidPFMET_ = iEvent.getByToken(pfMetToken, metSrc);
135  if (!ValidPFMET_)
136  return;
137 
139  bool ValidPFJet_ = iEvent.getByToken(pfJetsToken, jetSrc);
140  if (!ValidPFJet_)
141  return;
142 
143  if (!metSrc.isValid())
144  return;
145  if (!jetSrc.isValid())
146  return;
149  if (jets.empty())
150  return;
151  if (mets.empty())
152  return;
153 
154  if (debug_)
155  cout << "DEBUG-2: AOD Information" << endl;
156 
157  //****************************************************
158  // Variable setting
159  //****************************************************
160  //
161  pathname = "dummy";
162  filtername = "dummy";
163 
164  //
165  reco_ejet1 = 0.;
166  //reco_etjet1 = 0.;
167  reco_pxjet1 = 0.;
168  reco_pyjet1 = 0.;
169  reco_pzjet1 = 0.;
170  reco_ptjet1 = 0.;
171  reco_etajet1 = 0.;
172  reco_phijet1 = 0.;
173 
174  //
175  reco_ejet2 = 0.;
176  //reco_etjet2 = 0.;
177  reco_pxjet2 = 0.;
178  reco_pyjet2 = 0.;
179  reco_pzjet2 = 0.;
180  reco_ptjet2 = 0.;
181  reco_etajet2 = 0.;
182  reco_phijet2 = 0.;
183 
184  //
185  hlt_ejet1 = 0.;
186  //hlt_etjet1 = 0.;
187  hlt_pxjet1 = 0.;
188  hlt_pyjet1 = 0.;
189  hlt_pzjet1 = 0.;
190  hlt_ptjet1 = 0.;
191  hlt_etajet1 = 0.;
192  hlt_phijet1 = 0.;
193 
194  //
195  hlt_ejet2 = 0.;
196  //hlt_etjet2 = 0.;
197  hlt_pxjet2 = 0.;
198  hlt_pyjet2 = 0.;
199  hlt_pzjet2 = 0.;
200  hlt_ptjet2 = 0.;
201  hlt_etajet2 = 0.;
202  hlt_phijet2 = 0.;
203 
204  //
205  checkOffline = false;
206  checkHLT = false;
207  checkHLTIndex = false;
208 
209  //
210  dR_HLT_RECO_11 = 0.;
211  dR_HLT_RECO_22 = 0.;
212  dR_HLT_RECO_12 = 0.;
213  dR_HLT_RECO_21 = 0.;
214 
215  //
216  checkdR_sameOrder = false;
217  checkdR_crossOrder = false;
218 
219  //
220  reco_deltaetajet = 0.;
221  reco_deltaphijet = 0.;
222  reco_invmassjet = 0.;
223  hlt_deltaetajet = 0.;
224  hlt_deltaphijet = 0.;
225  hlt_invmassjet = 0.;
226 
227  //****************************************************
228  // Offline analysis
229  //****************************************************
230  //
231  checkOffline = false;
232  for (unsigned int ijet1 = 0; ijet1 < jets.size(); ijet1++) {
233  if (jets[ijet1].neutralHadronEnergyFraction() > 0.99)
234  continue;
235  if (jets[ijet1].neutralEmEnergyFraction() > 0.99)
236  continue;
237  for (unsigned int ijet2 = ijet1 + 1; ijet2 < jets.size(); ijet2++) {
238  if (jets[ijet2].neutralHadronEnergyFraction() > 0.99)
239  continue;
240  if (jets[ijet2].neutralEmEnergyFraction() > 0.99)
241  continue;
242  //
243  reco_ejet1 = jets[ijet1].energy();
244  //reco_etjet1 = jets[ijet1].et();
245  reco_pxjet1 = jets[ijet1].momentum().X();
246  reco_pyjet1 = jets[ijet1].momentum().Y();
247  reco_pzjet1 = jets[ijet1].momentum().Z();
248  reco_ptjet1 = jets[ijet1].pt();
249  reco_etajet1 = jets[ijet1].eta();
250  reco_phijet1 = jets[ijet1].phi();
251  //
252  reco_ejet2 = jets[ijet2].energy();
253  //reco_etjet2 = jets[ijet2].et();
254  reco_pxjet2 = jets[ijet2].momentum().X();
255  reco_pyjet2 = jets[ijet2].momentum().Y();
256  reco_pzjet2 = jets[ijet2].momentum().Z();
257  reco_ptjet2 = jets[ijet2].pt();
258  reco_etajet2 = jets[ijet2].eta();
259  reco_phijet2 = jets[ijet2].phi();
260  //
261  reco_deltaetajet = reco_etajet1 - reco_etajet2;
262  reco_deltaphijet = reco::deltaPhi(reco_phijet1, reco_phijet2);
263  reco_invmassjet = sqrt((reco_ejet1 + reco_ejet2) * (reco_ejet1 + reco_ejet2) -
264  (reco_pxjet1 + reco_pxjet2) * (reco_pxjet1 + reco_pxjet2) -
265  (reco_pyjet1 + reco_pyjet2) * (reco_pyjet1 + reco_pyjet2) -
266  (reco_pzjet1 + reco_pzjet2) * (reco_pzjet1 + reco_pzjet2));
267 
268  //
269  if (reco_ptjet1 < minPtHigh_)
270  continue;
271  if (reco_ptjet2 < minPtLow_)
272  continue;
273  if (etaOpposite_ == true && reco_etajet1 * reco_etajet2 > 0)
274  continue;
275  if (std::abs(reco_deltaetajet) < minDeltaEta_)
276  continue;
277  if (std::abs(reco_invmassjet) < minInvMass_)
278  continue;
279 
280  //
281  if (debug_)
282  cout << "DEBUG-3" << endl;
283  checkOffline = true;
284  break;
285  }
286  if (checkOffline == true)
287  break;
288  }
289  if (checkOffline == false)
290  return;
291 
292  //****************************************************
293  // Trigger efficiency: Loop for all VBF paths
294  //****************************************************
295  //const unsigned int numberOfPaths(hltConfig_.size());
296  const trigger::TriggerObjectCollection& toc(triggerObj_->getObjects());
297  for (auto& v : hltPathsAll_) {
298  checkHLT = false;
299  checkHLTIndex = false;
300 
301  //
302  v.getMEhisto_RECO_deltaEta_DiJet()->Fill(reco_deltaetajet);
303  v.getMEhisto_RECO_deltaPhi_DiJet()->Fill(reco_deltaphijet);
304  v.getMEhisto_RECO_invMass_DiJet()->Fill(reco_invmassjet);
305 
306  //
307  if (debug_)
308  cout << "DEBUG-4-0: Path loops" << endl;
309 
310  //
311  if (isHLTPathAccepted(v.getPath()) == false)
312  continue;
313  checkHLT = true;
314 
315  //
316  if (debug_)
317  cout << "DEBUG-4-1: Path is accepted. Now we are looking for " << v.getLabel() << " module." << endl;
318 
319  //
320  edm::InputTag hltTag(v.getLabel(), "", processname_);
321  const int hltIndex = triggerObj_->filterIndex(hltTag);
322  if (hltIndex >= triggerObj_->sizeFilters())
323  continue;
324  checkHLT = true;
325  if (debug_)
326  cout << "DEBUG-4-2: HLT module " << v.getLabel() << " exists" << endl;
327  const trigger::Keys& khlt = triggerObj_->filterKeys(hltIndex);
328  auto kj = khlt.begin();
329  for (; kj != khlt.end(); kj += 2) {
330  if (debug_)
331  cout << "DEBUG-5" << endl;
332  checkdR_sameOrder = false;
333  checkdR_crossOrder = false; //
334  hlt_ejet1 = toc[*kj].energy();
335  //hlt_etjet1 = toc[*kj].et();
336  hlt_pxjet1 = toc[*kj].px();
337  hlt_pyjet1 = toc[*kj].py();
338  hlt_pzjet1 = toc[*kj].pz();
339  hlt_ptjet1 = toc[*kj].pt();
340  hlt_etajet1 = toc[*kj].eta();
341  hlt_phijet1 = toc[*kj].phi();
342  //
343  hlt_ejet2 = toc[*(kj + 1)].energy();
344  //hlt_etjet2 = toc[*(kj+1)].et();
345  hlt_pxjet2 = toc[*(kj + 1)].px();
346  hlt_pyjet2 = toc[*(kj + 1)].py();
347  hlt_pzjet2 = toc[*(kj + 1)].pz();
348  hlt_ptjet2 = toc[*(kj + 1)].pt();
349  hlt_etajet2 = toc[*(kj + 1)].eta();
350  hlt_phijet2 = toc[*(kj + 1)].phi();
351  //
352  dR_HLT_RECO_11 = reco::deltaR(hlt_etajet1, hlt_phijet1, reco_etajet1, reco_phijet1);
353  dR_HLT_RECO_22 = reco::deltaR(hlt_etajet2, hlt_phijet2, reco_etajet2, reco_phijet2);
354  dR_HLT_RECO_12 = reco::deltaR(hlt_etajet1, hlt_phijet1, reco_etajet2, reco_phijet2);
355  dR_HLT_RECO_21 = reco::deltaR(hlt_etajet2, hlt_phijet2, reco_etajet1, reco_phijet1);
356  if (dR_HLT_RECO_11 < deltaRMatch_ && dR_HLT_RECO_22 < deltaRMatch_)
357  checkdR_sameOrder = true;
358  if (dR_HLT_RECO_12 < deltaRMatch_ && dR_HLT_RECO_21 < deltaRMatch_)
359  checkdR_crossOrder = true;
360  if (checkdR_sameOrder == false && checkdR_crossOrder == false)
361  continue;
362  checkHLTIndex = true;
363  //
364  if (debug_)
365  cout << "DEBUG-6: Match" << endl;
366  hlt_deltaetajet = hlt_etajet1 - hlt_etajet2;
367  hlt_deltaphijet = reco::deltaPhi(hlt_phijet1, hlt_phijet2);
368  if (checkdR_crossOrder) {
369  hlt_deltaetajet = (-1) * hlt_deltaetajet;
370  hlt_deltaphijet = reco::deltaPhi(hlt_phijet2, hlt_phijet1);
371  }
372  hlt_invmassjet = sqrt((hlt_ejet1 + hlt_ejet2) * (hlt_ejet1 + hlt_ejet2) -
373  (hlt_pxjet1 + hlt_pxjet2) * (hlt_pxjet1 + hlt_pxjet2) -
374  (hlt_pyjet1 + hlt_pyjet2) * (hlt_pyjet1 + hlt_pyjet2) -
375  (hlt_pzjet1 + hlt_pzjet2) * (hlt_pzjet1 + hlt_pzjet2));
376  v.getMEhisto_HLT_deltaEta_DiJet()->Fill(hlt_deltaetajet);
377  v.getMEhisto_HLT_deltaPhi_DiJet()->Fill(hlt_deltaphijet);
378  v.getMEhisto_HLT_invMass_DiJet()->Fill(hlt_invmassjet);
379  //
380  v.getMEhisto_RECO_deltaEta_DiJet_Match()->Fill(reco_deltaetajet);
381  v.getMEhisto_RECO_deltaPhi_DiJet_Match()->Fill(reco_deltaphijet);
382  v.getMEhisto_RECO_invMass_DiJet_Match()->Fill(reco_invmassjet);
383  //
384  v.getMEhisto_RECOHLT_deltaEta()->Fill(reco_deltaetajet, hlt_deltaetajet);
385  v.getMEhisto_RECOHLT_deltaPhi()->Fill(reco_deltaphijet, hlt_deltaphijet);
386  v.getMEhisto_RECOHLT_invMass()->Fill(reco_invmassjet, hlt_invmassjet);
387  //
388  if (checkHLTIndex == true)
389  break;
390  }
391 
392  //****************************************************
393  // Match information
394  //****************************************************
395  if (checkHLT == true && checkHLTIndex == true) {
396  if (debug_)
397  cout << "DEBUG-7: Match" << endl;
398  v.getMEhisto_NumberOfMatches()->Fill(1);
399  } else {
400  if (debug_)
401  cout << "DEBUG-8: Not match" << endl;
402  v.getMEhisto_NumberOfMatches()->Fill(0);
403  }
404  }
405 
406  //****************************************************
407  //
408  //****************************************************
409  for (auto& v : hltPathsAll_) {
410  if (isHLTPathAccepted(v.getPath()) == false)
411  continue;
412  if (debug_)
413  cout << "DEBUG-9: Loop for rate approximation: " << v.getPath() << endl;
414  check_mjj650_Pt35_DEta3p5 = false;
415  check_mjj700_Pt35_DEta3p5 = false;
416  check_mjj750_Pt35_DEta3p5 = false;
417  check_mjj800_Pt35_DEta3p5 = false;
418  check_mjj650_Pt40_DEta3p5 = false;
419  check_mjj700_Pt40_DEta3p5 = false;
420  check_mjj750_Pt40_DEta3p5 = false;
421  check_mjj800_Pt40_DEta3p5 = false;
422  edm::InputTag hltTag(v.getLabel(), "", processname_);
423  const int hltIndex = triggerObj_->filterIndex(hltTag);
424  if (hltIndex >= triggerObj_->sizeFilters())
425  continue;
426  const trigger::Keys& khlt = triggerObj_->filterKeys(hltIndex);
427  auto kj = khlt.begin();
428  for (; kj != khlt.end(); kj += 2) {
429  checkdR_sameOrder = false;
430  checkdR_crossOrder = false;
431  //
432  hlt_ejet1 = toc[*kj].energy();
433  //hlt_etjet1 = toc[*kj].et();
434  hlt_pxjet1 = toc[*kj].px();
435  hlt_pyjet1 = toc[*kj].py();
436  hlt_pzjet1 = toc[*kj].pz();
437  hlt_ptjet1 = toc[*kj].pt();
438  hlt_etajet1 = toc[*kj].eta();
439  hlt_phijet1 = toc[*kj].phi();
440  //
441  hlt_ejet2 = toc[*(kj + 1)].energy();
442  //hlt_etjet2 = toc[*(kj+1)].et();
443  hlt_pxjet2 = toc[*(kj + 1)].px();
444  hlt_pyjet2 = toc[*(kj + 1)].py();
445  hlt_pzjet2 = toc[*(kj + 1)].pz();
446  hlt_ptjet2 = toc[*(kj + 1)].pt();
447  hlt_etajet2 = toc[*(kj + 1)].eta();
448  hlt_phijet2 = toc[*(kj + 1)].phi();
449  //
450  hlt_deltaetajet = hlt_etajet1 - hlt_etajet2;
451  hlt_deltaphijet = reco::deltaPhi(hlt_phijet1, hlt_phijet2);
452  hlt_invmassjet = sqrt((hlt_ejet1 + hlt_ejet2) * (hlt_ejet1 + hlt_ejet2) -
453  (hlt_pxjet1 + hlt_pxjet2) * (hlt_pxjet1 + hlt_pxjet2) -
454  (hlt_pyjet1 + hlt_pyjet2) * (hlt_pyjet1 + hlt_pyjet2) -
455  (hlt_pzjet1 + hlt_pzjet2) * (hlt_pzjet1 + hlt_pzjet2));
456  //
457  if (check_mjj650_Pt35_DEta3p5 == false && hlt_ptjet1 > 35. && hlt_ptjet2 >= 35. && hlt_invmassjet > 650 &&
458  std::abs(hlt_deltaetajet) > 3.5) {
459  check_mjj650_Pt35_DEta3p5 = true;
460  }
461  if (check_mjj700_Pt35_DEta3p5 == false && hlt_ptjet1 > 35. && hlt_ptjet2 >= 35. && hlt_invmassjet > 700 &&
462  std::abs(hlt_deltaetajet) > 3.5) {
463  check_mjj700_Pt35_DEta3p5 = true;
464  }
465  if (check_mjj750_Pt35_DEta3p5 == false && hlt_ptjet1 > 35. && hlt_ptjet2 >= 35. && hlt_invmassjet > 750 &&
466  std::abs(hlt_deltaetajet) > 3.5) {
467  check_mjj750_Pt35_DEta3p5 = true;
468  }
469  if (check_mjj800_Pt35_DEta3p5 == false && hlt_ptjet1 > 35. && hlt_ptjet2 >= 35. && hlt_invmassjet > 800 &&
470  std::abs(hlt_deltaetajet) > 3.5) {
471  check_mjj800_Pt35_DEta3p5 = true;
472  }
473  if (check_mjj650_Pt40_DEta3p5 == false && hlt_ptjet1 > 40. && hlt_ptjet2 >= 40. && hlt_invmassjet > 650 &&
474  std::abs(hlt_deltaetajet) > 3.5) {
475  check_mjj650_Pt40_DEta3p5 = true;
476  }
477  if (check_mjj700_Pt40_DEta3p5 == false && hlt_ptjet1 > 40. && hlt_ptjet2 >= 40. && hlt_invmassjet > 700 &&
478  std::abs(hlt_deltaetajet) > 3.5) {
479  check_mjj700_Pt40_DEta3p5 = true;
480  }
481  if (check_mjj750_Pt40_DEta3p5 == false && hlt_ptjet1 > 40. && hlt_ptjet2 >= 40. && hlt_invmassjet > 750 &&
482  std::abs(hlt_deltaetajet) > 3.5) {
483  check_mjj750_Pt40_DEta3p5 = true;
484  }
485  if (check_mjj800_Pt40_DEta3p5 == false && hlt_ptjet1 > 40. && hlt_ptjet2 >= 40. && hlt_invmassjet > 800 &&
486  std::abs(hlt_deltaetajet) > 3.5) {
487  check_mjj800_Pt40_DEta3p5 = true;
488  }
489  }
490  if (check_mjj650_Pt35_DEta3p5 == true)
491  v.getMEhisto_NumberOfEvents()->Fill(0);
492  if (check_mjj700_Pt35_DEta3p5 == true)
493  v.getMEhisto_NumberOfEvents()->Fill(1);
494  if (check_mjj750_Pt35_DEta3p5 == true)
495  v.getMEhisto_NumberOfEvents()->Fill(2);
496  if (check_mjj800_Pt35_DEta3p5 == true)
497  v.getMEhisto_NumberOfEvents()->Fill(3);
498  if (check_mjj650_Pt40_DEta3p5 == true)
499  v.getMEhisto_NumberOfEvents()->Fill(4);
500  if (check_mjj700_Pt40_DEta3p5 == true)
501  v.getMEhisto_NumberOfEvents()->Fill(5);
502  if (check_mjj750_Pt40_DEta3p5 == true)
503  v.getMEhisto_NumberOfEvents()->Fill(6);
504  if (check_mjj800_Pt40_DEta3p5 == true)
505  v.getMEhisto_NumberOfEvents()->Fill(7);
506  }
507 }
508 
509 // BeginRun
511  iBooker.setCurrentFolder(dirname_);
512 
513  //--- htlConfig_
514  bool changed(true);
515  if (!hltConfig_.init(run, c, processname_, changed)) {
516  LogDebug("HLTInclusiveVBFSource") << "HLTConfigProvider failed to initialize.";
517  }
518 
519  const unsigned int numberOfPaths(hltConfig_.size());
520  for (unsigned int i = 0; i != numberOfPaths; ++i) {
521  bool numFound = false;
522  pathname = hltConfig_.triggerName(i);
523  filtername = "dummy";
524  unsigned int usedPrescale = 1;
525  unsigned int objectType = 0;
527 
528  if (pathname.find("HLT_Di") == std::string::npos)
529  continue;
530  if (pathname.find("Jet") == std::string::npos)
531  continue;
532  if (pathname.find("MJJ") == std::string::npos)
533  continue;
534  if (pathname.find("VBF_v") == std::string::npos)
535  continue;
536 
537  if (debug_) {
538  cout << " - Startup:Path = " << pathname << endl;
539  //cout<<" - Startup:PS = "<<hltConfig_.prescaleSize()<<endl;
540  }
541 
542  triggerType = "DiJet_Trigger";
543  objectType = trigger::TriggerJet;
544 
545  // Checking if the trigger exist in HLT table or not
546  for (unsigned int i = 0; i != numberOfPaths; ++i) {
547  std::string HLTname = hltConfig_.triggerName(i);
548  if (HLTname == pathname)
549  numFound = true;
550  }
551 
552  if (numFound == false)
553  continue;
554  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
555  auto numpathmodule = numpathmodules.begin();
556  for (; numpathmodule != numpathmodules.end(); ++numpathmodule) {
557  edm::InputTag testTag(*numpathmodule, "", processname_);
558  if (hltConfig_.moduleType(*numpathmodule) == "HLTCaloJetVBFFilter" ||
559  hltConfig_.moduleType(*numpathmodule) == "HLTPFJetVBFFilter") {
560  filtername = *numpathmodule;
561  if (debug_)
562  cout << " - Startup:Module = " << hltConfig_.moduleType(*numpathmodule) << ", FilterName = " << filtername
563  << endl;
564  }
565  }
566  if (debug_)
567  cout << " - Startup:Final filter = " << filtername << endl;
568 
569  if (objectType == 0 || numFound == false)
570  continue;
571  //if(debug_){
572  //cout<<"Pathname = "<<pathname
573  // <<", Filtername = "<<filtername
574  // <<", ObjectType = "<<objectType<<endl;
575  //}
576  hltPathsAll_.push_back(PathInfo(usedPrescale, pathname, filtername, processname_, objectType, triggerType));
577  } //Loop over paths
578 
579  //if(debug_) cout<<"== end hltPathsEff_.push_back ======" << endl;
580 
581  std::string dirName = dirname_ + "/MonitorInclusiveVBFTrigger/";
582  for (auto& v : hltPathsAll_) {
583  if (debug_)
584  cout << "Storing: " << v.getPath() << ", Prescale = " << v.getprescaleUsed() << endl;
585  //if(v->getprescaleUsed()!=1) continue;
586 
587  std::string subdirName = dirName + v.getPath();
588  std::string trigPath = "(" + v.getPath() + ")";
589  iBooker.setCurrentFolder(subdirName);
590 
591  MonitorElement* RECO_deltaEta_DiJet;
592  MonitorElement* RECO_deltaPhi_DiJet;
593  MonitorElement* RECO_invMass_DiJet;
594  MonitorElement* HLT_deltaEta_DiJet;
595  MonitorElement* HLT_deltaPhi_DiJet;
596  MonitorElement* HLT_invMass_DiJet;
597  MonitorElement* RECO_deltaEta_DiJet_Match;
598  MonitorElement* RECO_deltaPhi_DiJet_Match;
599  MonitorElement* RECO_invMass_DiJet_Match;
600  MonitorElement* RECOHLT_deltaEta;
601  MonitorElement* RECOHLT_deltaPhi;
602  MonitorElement* RECOHLT_invMass;
603  MonitorElement* NumberOfMatches;
604  MonitorElement* NumberOfEvents;
605 
606  //dummy = iBooker.bookFloat("dummy");
607  RECO_deltaEta_DiJet = iBooker.bookFloat("RECO_deltaEta_DiJet");
608  RECO_deltaPhi_DiJet = iBooker.bookFloat("RECO_deltaPhi_DiJet");
609  RECO_invMass_DiJet = iBooker.bookFloat("RECO_invMass_DiJet");
610  HLT_deltaEta_DiJet = iBooker.bookFloat("HLT_deltaEta_DiJet");
611  HLT_deltaPhi_DiJet = iBooker.bookFloat("HLT_deltaPhi_DiJet ");
612  HLT_invMass_DiJet = iBooker.bookFloat("HLT_invMass_DiJet");
613  RECO_deltaEta_DiJet_Match = iBooker.bookFloat("RECO_deltaEta_DiJet_Match");
614  RECO_deltaPhi_DiJet_Match = iBooker.bookFloat("RECO_deltaPhi_DiJet_Match");
615  RECO_invMass_DiJet_Match = iBooker.bookFloat("RECO_invMass_DiJet_Match");
616  RECOHLT_deltaEta = iBooker.bookFloat("RECOHLT_deltaEta");
617  RECOHLT_deltaPhi = iBooker.bookFloat("RECOHLT_deltaPhi ");
618  RECOHLT_invMass = iBooker.bookFloat("RECOHLT_invMass");
619  NumberOfMatches = iBooker.bookFloat("NumberOfMatches");
620  NumberOfEvents = iBooker.bookFloat("NumberOfEvents");
621 
622  std::string labelname("ME");
623  std::string histoname(labelname + "");
624  std::string title(labelname + "");
625 
626  //RECO_deltaEta_DiJet
627  histoname = labelname + "_RECO_deltaEta_DiJet";
628  title = labelname + "_RECO_deltaEta_DiJet " + trigPath;
629  RECO_deltaEta_DiJet = iBooker.book1D(histoname.c_str(), title.c_str(), 50, -10., 10.);
630  RECO_deltaEta_DiJet->getTH1F();
631 
632  //RECO_deltaPhi_DiJet
633  histoname = labelname + "_RECO_deltaPhi_DiJet";
634  title = labelname + "_RECO_deltaPhi_DiJet " + trigPath;
635  RECO_deltaPhi_DiJet = iBooker.book1D(histoname.c_str(), title.c_str(), 35, -3.5, 3.5);
636  RECO_deltaPhi_DiJet->getTH1F();
637 
638  //RECO_invMass_DiJet
639  histoname = labelname + "_RECO_invMass_DiJet";
640  title = labelname + "_RECO_invMass_DiJet " + trigPath;
641  RECO_invMass_DiJet = iBooker.book1D(histoname.c_str(), title.c_str(), 100, 500., 2000.);
642  RECO_invMass_DiJet->getTH1F();
643 
644  //HLT_deltaEta_DiJet
645  histoname = labelname + "_HLT_deltaEta_DiJet";
646  title = labelname + "_HLT_deltaEta_DiJet " + trigPath;
647  HLT_deltaEta_DiJet = iBooker.book1D(histoname.c_str(), title.c_str(), 50, -10., 10.);
648  HLT_deltaEta_DiJet->getTH1F();
649 
650  //HLT_deltaPhi_DiJet
651  histoname = labelname + "_HLT_deltaPhi_DiJet";
652  title = labelname + "_HLT_deltaPhi_DiJet " + trigPath;
653  HLT_deltaPhi_DiJet = iBooker.book1D(histoname.c_str(), title.c_str(), 35, -3.5, 3.5);
654  HLT_deltaPhi_DiJet->getTH1F();
655 
656  //HLT_invMass_DiJet
657  histoname = labelname + "_HLT_invMass_DiJet";
658  title = labelname + "_HLT_invMass_DiJet " + trigPath;
659  HLT_invMass_DiJet = iBooker.book1D(histoname.c_str(), title.c_str(), 100, 500., 2000.);
660  HLT_invMass_DiJet->getTH1F();
661 
662  //RECO_deltaEta_DiJet_Match
663  histoname = labelname + "_RECO_deltaEta_DiJet_Match";
664  title = labelname + "_RECO_deltaEta_DiJet_Match " + trigPath;
665  RECO_deltaEta_DiJet_Match = iBooker.book1D(histoname.c_str(), title.c_str(), 50, -10., 10.);
666  RECO_deltaEta_DiJet_Match->getTH1F();
667 
668  //RECO_deltaPhi_DiJet_Match
669  histoname = labelname + "_RECO_deltaPhi_DiJet_Match";
670  title = labelname + "_RECO_deltaPhi_DiJet_Match " + trigPath;
671  RECO_deltaPhi_DiJet_Match = iBooker.book1D(histoname.c_str(), title.c_str(), 35, -3.5, 3.5);
672  RECO_deltaPhi_DiJet_Match->getTH1F();
673 
674  //RECO_invMass_DiJet_Match
675  histoname = labelname + "_RECO_invMass_DiJet_Match";
676  title = labelname + "_RECO_invMass_DiJet_Match " + trigPath;
677  RECO_invMass_DiJet_Match = iBooker.book1D(histoname.c_str(), title.c_str(), 100, 500., 2000.);
678  RECO_invMass_DiJet_Match->getTH1F();
679 
680  //RECOHLT_deltaEta
681  histoname = labelname + "_RECOHLT_deltaEta";
682  title = labelname + "_RECOHLT_deltaEta " + trigPath;
683  RECOHLT_deltaEta = iBooker.book2D(histoname.c_str(), title.c_str(), 50, -10., 10., 50, -10., 10.);
684  RECOHLT_deltaEta->getTH2F();
685 
686  //RECOHLT_deltaPhi
687  histoname = labelname + "_RECOHLT_deltaPhi";
688  title = labelname + "_RECOHLT_deltaPhi " + trigPath;
689  RECOHLT_deltaPhi = iBooker.book2D(histoname.c_str(), title.c_str(), 35, -3.5, 3.5, 35, -3.5, 3.5);
690  RECOHLT_deltaPhi->getTH2F();
691 
692  //RECOHLT_invMass
693  histoname = labelname + "_RECOHLT_invMass";
694  title = labelname + "_RECOHLT_invMass " + trigPath;
695  RECOHLT_invMass = iBooker.book2D(histoname.c_str(), title.c_str(), 100, 500., 2000., 100, 500., 2000.);
696  RECOHLT_invMass->getTH2F();
697 
698  //NumberOfMatches
699  histoname = labelname + "_NumberOfMatches ";
700  title = labelname + "_NumberOfMatches " + trigPath;
701  NumberOfMatches = iBooker.book1D(histoname.c_str(), title.c_str(), 2, 0., 2.);
702  NumberOfMatches->getTH1F();
703 
704  //NumberOfEvents
705  histoname = labelname + "_NumberOfEvents";
706  title = labelname + "_NumberOfEvents " + trigPath;
707  NumberOfEvents = iBooker.book1D(histoname.c_str(), title.c_str(), 10, 0., 10.);
708  NumberOfEvents->getTH1F();
709 
710  //}
711  v.setHistos(RECO_deltaEta_DiJet,
712  RECO_deltaPhi_DiJet,
713  RECO_invMass_DiJet,
714  HLT_deltaEta_DiJet,
715  HLT_deltaPhi_DiJet,
716  HLT_invMass_DiJet,
717  RECO_deltaEta_DiJet_Match,
718  RECO_deltaPhi_DiJet_Match,
719  RECO_invMass_DiJet_Match,
720  RECOHLT_deltaEta,
721  RECOHLT_deltaPhi,
722  RECOHLT_invMass,
723  NumberOfMatches,
724  NumberOfEvents);
725  //break;//We need only the first unprescale paths
726  }
727 }
728 
730  bool output = false;
731  if (fabs(eta) <= 1.3)
732  output = true;
733  return output;
734 }
735 
737  bool output = false;
738  if (fabs(eta) <= 3.0 && fabs(eta) > 1.3)
739  output = true;
740  return output;
741 }
742 
744  bool output = false;
745  if (fabs(eta) > 3.0)
746  output = true;
747  return output;
748 }
749 
751  // hltConfig_ has to be defined first before calling this method
752  bool output = false;
753  for (unsigned int j = 0; j != hltConfig_.size(); ++j) {
754  if (hltConfig_.triggerName(j) == pathname)
755  output = true;
756  }
757  return output;
758 }
759 
761  // triggerResults_, triggerNames_ has to be defined first before calling this method
762  bool output = false;
763  if (triggerResults_.isValid()) {
764  unsigned index = triggerNames_.triggerIndex(pathName);
765  if (index < triggerNames_.size() && triggerResults_->accept(index))
766  output = true;
767  }
768  return output;
769 }
770 
772  // processname_, triggerObj_ has to be defined before calling this method
773  bool output = false;
774  edm::InputTag testTag(objectName, "", processname_);
775  const int index = triggerObj_->filterIndex(testTag);
776  if (index >= triggerObj_->sizeFilters()) {
777  edm::LogInfo("HLTInclusiveVBFSource") << "no index " << index << " of that name ";
778  } else {
779  const trigger::Keys& k = triggerObj_->filterKeys(index);
780  if (!k.empty())
781  output = true;
782  }
783  return output;
784 }
785 
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
virtual bool isForward(double eta)
virtual bool isBarrel(double eta)
std::string const & instance() const
Definition: InputTag.h:37
virtual bool validPathHLT(std::string path)
std::string const & label() const
Definition: InputTag.h:36
T getUntrackedParameter(std::string const &, T const &) const
void analyze(const edm::Event &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:224
HLTInclusiveVBFSource(const edm::ParameterSet &)
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
Log< level::Info, false > LogInfo
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< size_type > Keys
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
virtual bool isTriggerObjectFound(std::string objectName)
virtual bool isHLTPathAccepted(std::string pathName)
fixed size matrix
HLT enums.
Definition: output.py:1
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
Definition: Run.h:45
#define LogDebug(id)
virtual bool isEndCap(double eta)