test
CMS 3D CMS Logo

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