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