CMS 3D CMS Logo

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