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