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("FourVectorHLTOffline") << "TriggerResults not found, "
122  "skipping event";
123  return;
124  }
125  }
126  //
127  //int npath;
128  if(&triggerResults_) {
129  // Check how many HLT triggers are in triggerResults
130  //npath = triggerResults_->size();
132  }
133  else {
134  edm::LogInfo("CaloMETHLTOfflineSource") << "TriggerResults::HLT not found, "
135  "automatically select events";
136  return;
137  }
138  //
139  //---------- triggerSummary ----------
141  if(!triggerObj_.isValid()) {
143  if(!triggerObj_.isValid()) {
144  edm::LogInfo("FourVectorHLTOffline") << "TriggerEvent not found, "
145  "skipping event";
146  return;
147  }
148  }
149 
150  if(debug_) cout<<"DEBUG-1: Trigger information"<<endl;
151 
152  //****************************************************
153  // Get AOD information
154  //****************************************************
155  //
157  bool ValidPFMET_ = iEvent.getByToken(pfMetToken, metSrc);
158  if(!ValidPFMET_) return;
159 
161  bool ValidPFJet_ = iEvent.getByToken(pfJetsToken, jetSrc);
162  if(!ValidPFJet_) return;
163 
164  if(!metSrc.isValid()) return;
165  if(!jetSrc.isValid()) return;
166  const edm::View<reco::PFMET> & mets = *metSrc;
168  if(jets.size()<=0) return;
169  if(mets.size()<=0) return;
170 
171  if(debug_) cout<<"DEBUG-2: AOD Information"<<endl;
172 
173  //****************************************************
174  // Variable setting
175  //****************************************************
176  //
177  pathname = "dummy";
178  filtername = "dummy";
179 
180  //
181  reco_ejet1 = 0.;
182  //reco_etjet1 = 0.;
183  reco_pxjet1 = 0.;
184  reco_pyjet1 = 0.;
185  reco_pzjet1 = 0.;
186  reco_ptjet1 = 0.;
187  reco_etajet1 = 0.;
188  reco_phijet1 = 0.;
189 
190  //
191  reco_ejet2 = 0.;
192  //reco_etjet2 = 0.;
193  reco_pxjet2 = 0.;
194  reco_pyjet2 = 0.;
195  reco_pzjet2 = 0.;
196  reco_ptjet2 = 0.;
197  reco_etajet2 = 0.;
198  reco_phijet2 = 0.;
199 
200  //
201  hlt_ejet1 = 0.;
202  //hlt_etjet1 = 0.;
203  hlt_pxjet1 = 0.;
204  hlt_pyjet1 = 0.;
205  hlt_pzjet1 = 0.;
206  hlt_ptjet1 = 0.;
207  hlt_etajet1 = 0.;
208  hlt_phijet1 = 0.;
209 
210  //
211  hlt_ejet2 = 0.;
212  //hlt_etjet2 = 0.;
213  hlt_pxjet2 = 0.;
214  hlt_pyjet2 = 0.;
215  hlt_pzjet2 = 0.;
216  hlt_ptjet2 = 0.;
217  hlt_etajet2 = 0.;
218  hlt_phijet2 = 0.;
219 
220  //
221  checkOffline = false;
222  checkHLT = false;
223  checkHLTIndex = false;
224 
225  //
226  dR_HLT_RECO_11 = 0.;
227  dR_HLT_RECO_22 = 0.;
228  dR_HLT_RECO_12 = 0.;
229  dR_HLT_RECO_21 = 0.;
230 
231  //
232  checkdR_sameOrder = false;
233  checkdR_crossOrder = false;
234 
235  //
236  reco_deltaetajet = 0.;
237  reco_deltaphijet = 0.;
238  reco_invmassjet = 0.;
239  hlt_deltaetajet = 0.;
240  hlt_deltaphijet = 0.;
241  hlt_invmassjet = 0.;
242 
243  //****************************************************
244  // Offline analysis
245  //****************************************************
246  //
247  checkOffline = false;
248  for(unsigned int ijet1=0; ijet1<jets.size(); ijet1++){
249  if(jets[ijet1].neutralHadronEnergyFraction()>0.99) continue;
250  if(jets[ijet1].neutralEmEnergyFraction()>0.99) continue;
251  for(unsigned int ijet2=ijet1+1; ijet2<jets.size(); ijet2++){
252  if(jets[ijet2].neutralHadronEnergyFraction()>0.99) continue;
253  if(jets[ijet2].neutralEmEnergyFraction()>0.99) continue;
254  //
255  reco_ejet1 = jets[ijet1].energy();
256  //reco_etjet1 = jets[ijet1].et();
257  reco_pxjet1 = jets[ijet1].momentum().X();
258  reco_pyjet1 = jets[ijet1].momentum().Y();
259  reco_pzjet1 = jets[ijet1].momentum().Z();
260  reco_ptjet1 = jets[ijet1].pt();
261  reco_etajet1 = jets[ijet1].eta();
262  reco_phijet1 = jets[ijet1].phi();
263  //
264  reco_ejet2 = jets[ijet2].energy();
265  //reco_etjet2 = jets[ijet2].et();
266  reco_pxjet2 = jets[ijet2].momentum().X();
267  reco_pyjet2 = jets[ijet2].momentum().Y();
268  reco_pzjet2 = jets[ijet2].momentum().Z();
269  reco_ptjet2 = jets[ijet2].pt();
270  reco_etajet2 = jets[ijet2].eta();
271  reco_phijet2 = jets[ijet2].phi();
272  //
279 
280  //
281  if(reco_ptjet1 < minPtHigh_) continue;
282  if(reco_ptjet2 < minPtLow_) continue;
283  if(etaOpposite_ == true && reco_etajet1*reco_etajet2 > 0) continue;
284  if(std::abs(reco_deltaetajet) < minDeltaEta_) continue;
285  if(std::abs(reco_invmassjet) < minInvMass_) continue;
286 
287  //
288  if(debug_) cout<<"DEBUG-3"<<endl;
289  checkOffline = true;
290  break;
291  }
292  if(checkOffline == true) break;
293  }
294  if(checkOffline == false) return;
295 
296  //****************************************************
297  // Trigger efficiency: Loop for all VBF paths
298  //****************************************************
299  //const unsigned int numberOfPaths(hltConfig_.size());
300  const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
301  for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
302  checkHLT = false;
303  checkHLTIndex = false;
304 
305  //
306  v->getMEhisto_RECO_deltaEta_DiJet()->Fill(reco_deltaetajet);
307  v->getMEhisto_RECO_deltaPhi_DiJet()->Fill(reco_deltaphijet);
308  v->getMEhisto_RECO_invMass_DiJet()->Fill(reco_invmassjet);
309 
310  //
311  if(debug_) cout<<"DEBUG-4-0: Path loops"<<endl;
312 
313  //
314  if(isHLTPathAccepted(v->getPath())==false) continue;
315  checkHLT = true;
316 
317  //
318  if(debug_) cout<<"DEBUG-4-1: Path is accepted. Now we are looking for "<<v->getLabel()<<" module."<<endl;
319 
320  //
321  edm::InputTag hltTag(v->getLabel(),"",processname_);
322  const int hltIndex = triggerObj_->filterIndex(hltTag);
323  if(hltIndex >= triggerObj_->sizeFilters()) continue;
324  checkHLT = true;
325  if(debug_) cout<<"DEBUG-4-2: HLT module "<<v->getLabel()<<" exists"<<endl;
326  const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
327  trigger::Keys::const_iterator kj = khlt.begin();
328  for(; kj != khlt.end(); kj+=2){
329  if(debug_) cout<<"DEBUG-5"<<endl;
330  checkdR_sameOrder = false;
331  checkdR_crossOrder = false; //
332  hlt_ejet1 = toc[*kj].energy();
333  //hlt_etjet1 = toc[*kj].et();
334  hlt_pxjet1 = toc[*kj].px();
335  hlt_pyjet1 = toc[*kj].py();
336  hlt_pzjet1 = toc[*kj].pz();
337  hlt_ptjet1 = toc[*kj].pt();
338  hlt_etajet1 = toc[*kj].eta();
339  hlt_phijet1 = toc[*kj].phi();
340  //
341  hlt_ejet2 = toc[*(kj+1)].energy();
342  //hlt_etjet2 = toc[*(kj+1)].et();
343  hlt_pxjet2 = toc[*(kj+1)].px();
344  hlt_pyjet2 = toc[*(kj+1)].py();
345  hlt_pzjet2 = toc[*(kj+1)].pz();
346  hlt_ptjet2 = toc[*(kj+1)].pt();
347  hlt_etajet2 = toc[*(kj+1)].eta();
348  hlt_phijet2 = toc[*(kj+1)].phi();
349  //
356  if(checkdR_sameOrder == false && checkdR_crossOrder == false) continue;
357  checkHLTIndex = true;
358  //
359  if(debug_) cout<<"DEBUG-6: Match"<<endl;
362  if(checkdR_crossOrder){
365  }
370  v->getMEhisto_HLT_deltaEta_DiJet()->Fill(hlt_deltaetajet);
371  v->getMEhisto_HLT_deltaPhi_DiJet()->Fill(hlt_deltaphijet);
372  v->getMEhisto_HLT_invMass_DiJet()->Fill(hlt_invmassjet);
373  //
374  v->getMEhisto_RECO_deltaEta_DiJet_Match()->Fill(reco_deltaetajet);
375  v->getMEhisto_RECO_deltaPhi_DiJet_Match()->Fill(reco_deltaphijet);
376  v->getMEhisto_RECO_invMass_DiJet_Match()->Fill(reco_invmassjet);
377  //
378  v->getMEhisto_RECOHLT_deltaEta()->Fill(reco_deltaetajet,hlt_deltaetajet);
379  v->getMEhisto_RECOHLT_deltaPhi()->Fill(reco_deltaphijet,hlt_deltaphijet);
380  v->getMEhisto_RECOHLT_invMass()->Fill(reco_invmassjet,hlt_invmassjet);
381  //
382  if(checkHLTIndex==true) break;
383  }
384 
385  //****************************************************
386  // Match information
387  //****************************************************
388  if(checkHLT==true && checkHLTIndex==true){
389  if(debug_) cout<<"DEBUG-7: Match"<<endl;
390  v->getMEhisto_NumberOfMatches()->Fill(1);
391  }
392  else{
393  if(debug_) cout<<"DEBUG-8: Not match"<<endl;
394  v->getMEhisto_NumberOfMatches()->Fill(0);
395  }
396  }
397 
398 
399  //****************************************************
400  //
401  //****************************************************
402  for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
403  if(isHLTPathAccepted(v->getPath())==false) continue;
404  if(debug_) cout<<"DEBUG-9: Loop for rate approximation: "<<v->getPath()<<endl;
409  check_mjj650_Pt40_DEta3p5 = false;
411  check_mjj750_Pt40_DEta3p5 = false;
413  edm::InputTag hltTag(v->getLabel(),"",processname_);
414  const int hltIndex = triggerObj_->filterIndex(hltTag);
415  if(hltIndex >= triggerObj_->sizeFilters()) continue;
416  const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
417  trigger::Keys::const_iterator kj = khlt.begin();
418  for(; kj != khlt.end(); kj+=2){
419  checkdR_sameOrder = false;
420  checkdR_crossOrder = false;
421  //
422  hlt_ejet1 = toc[*kj].energy();
423  //hlt_etjet1 = toc[*kj].et();
424  hlt_pxjet1 = toc[*kj].px();
425  hlt_pyjet1 = toc[*kj].py();
426  hlt_pzjet1 = toc[*kj].pz();
427  hlt_ptjet1 = toc[*kj].pt();
428  hlt_etajet1 = toc[*kj].eta();
429  hlt_phijet1 = toc[*kj].phi();
430  //
431  hlt_ejet2 = toc[*(kj+1)].energy();
432  //hlt_etjet2 = toc[*(kj+1)].et();
433  hlt_pxjet2 = toc[*(kj+1)].px();
434  hlt_pyjet2 = toc[*(kj+1)].py();
435  hlt_pzjet2 = toc[*(kj+1)].pz();
436  hlt_ptjet2 = toc[*(kj+1)].pt();
437  hlt_etajet2 = toc[*(kj+1)].eta();
438  hlt_phijet2 = toc[*(kj+1)].phi();
439  //
446  //
449  }
452  }
455  }
458  }
461  }
464  }
467  }
470  }
471  }
472  if(check_mjj650_Pt35_DEta3p5==true) v->getMEhisto_NumberOfEvents()->Fill(0);
473  if(check_mjj700_Pt35_DEta3p5==true) v->getMEhisto_NumberOfEvents()->Fill(1);
474  if(check_mjj750_Pt35_DEta3p5==true) v->getMEhisto_NumberOfEvents()->Fill(2);
475  if(check_mjj800_Pt35_DEta3p5==true) v->getMEhisto_NumberOfEvents()->Fill(3);
476  if(check_mjj650_Pt40_DEta3p5==true) v->getMEhisto_NumberOfEvents()->Fill(4);
477  if(check_mjj700_Pt40_DEta3p5==true) v->getMEhisto_NumberOfEvents()->Fill(5);
478  if(check_mjj750_Pt40_DEta3p5==true) v->getMEhisto_NumberOfEvents()->Fill(6);
479  if(check_mjj800_Pt40_DEta3p5==true) v->getMEhisto_NumberOfEvents()->Fill(7);
480  }
481 }
482 
483 
484 // -- method called once each job just before starting event loop --------
485 void
487 }
488 
489 // BeginRun
490 void
492  if(!isSetup_){
493  DQMStore *dbe = 0;
494  dbe = Service<DQMStore>().operator->();
495  if (dbe) {
497  dbe->rmdir(dirname_);
498  }
499  if (dbe) {
501  }
502 
503  //--- htlConfig_
504  bool changed(true);
505  if (!hltConfig_.init(run, c, processname_, changed)) {
506  LogDebug("HLTInclusiveVBFSource") << "HLTConfigProvider failed to initialize.";
507  }
508 
509  const unsigned int numberOfPaths(hltConfig_.size());
510  for(unsigned int i=0; i!=numberOfPaths; ++i){
511  bool numFound = false;
513  filtername = "dummy";
514  unsigned int usedPrescale = 1;
515  unsigned int objectType = 0;
516  std::string triggerType = "";
517 
518  if(pathname.find("HLT_Di") == std::string::npos) continue;
519  if(pathname.find("Jet") == std::string::npos) continue;
520  if(pathname.find("MJJ") == std::string::npos) continue;
521  if(pathname.find("VBF_v") == std::string::npos) continue;
522 
523  if(debug_){
524  cout<<" - Startup:Path = "<<pathname<<endl;
525  //cout<<" - Startup:PS = "<<hltConfig_.prescaleSize()<<endl;
526  }
527 
528  triggerType = "DiJet_Trigger";
529  objectType = trigger::TriggerJet;
530 
531  // Checking if the trigger exist in HLT table or not
532  for (unsigned int i=0; i!=numberOfPaths; ++i) {
533  std::string HLTname = hltConfig_.triggerName(i);
534  if(HLTname == pathname)numFound = true;
535  }
536 
537  if(numFound==false) continue;
538  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
539  std::vector<std::string>::iterator numpathmodule = numpathmodules.begin();
540  for(; numpathmodule!= numpathmodules.end(); ++numpathmodule){
541  edm::InputTag testTag(*numpathmodule,"",processname_);
542  if (hltConfig_.moduleType(*numpathmodule) == "HLTCaloJetVBFFilter"
543  || hltConfig_.moduleType(*numpathmodule) == "HLTPFJetVBFFilter")
544  {
545  filtername = *numpathmodule;
546  if(debug_) cout<<" - Startup:Module = "<<hltConfig_.moduleType(*numpathmodule)<<", FilterName = "<<filtername<<endl;
547  }
548 
549  }
550  if(debug_) cout<<" - Startup:Final filter = "<<filtername<<endl;
551 
552  if(objectType == 0 || numFound==false) continue;
553  //if(debug_){
554  //cout<<"Pathname = "<<pathname
555  // <<", Filtername = "<<filtername
556  // <<", ObjectType = "<<objectType<<endl;
557  //}
558  hltPathsAll_.push_back(PathInfo(usedPrescale, pathname, filtername, processname_, objectType, triggerType));
559  }//Loop over paths
560 
561  //if(debug_) cout<<"== end hltPathsEff_.push_back ======" << endl;
562 
563  std::string dirName = dirname_ + "/MonitorInclusiveVBFTrigger/";
564  for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
565  if(debug_) cout<<"Storing: "<<v->getPath()<<", Prescale = "<<v->getprescaleUsed()<<endl;
566  //if(v->getprescaleUsed()!=1) continue;
567 
568  std::string subdirName = dirName + v->getPath();
569  std::string trigPath = "("+v->getPath()+")";
570  dbe->setCurrentFolder(subdirName);
571 
572  MonitorElement* RECO_deltaEta_DiJet;
573  MonitorElement* RECO_deltaPhi_DiJet;
574  MonitorElement* RECO_invMass_DiJet;
575  MonitorElement* HLT_deltaEta_DiJet;
576  MonitorElement* HLT_deltaPhi_DiJet;
577  MonitorElement* HLT_invMass_DiJet;
578  MonitorElement* RECO_deltaEta_DiJet_Match;
579  MonitorElement* RECO_deltaPhi_DiJet_Match;
580  MonitorElement* RECO_invMass_DiJet_Match;
581  MonitorElement* RECOHLT_deltaEta;
582  MonitorElement* RECOHLT_deltaPhi;
583  MonitorElement* RECOHLT_invMass;
584  MonitorElement* NumberOfMatches;
585  MonitorElement* NumberOfEvents;
586 
587  //dummy = dbe->bookFloat("dummy");
588  RECO_deltaEta_DiJet = dbe->bookFloat("RECO_deltaEta_DiJet");
589  RECO_deltaPhi_DiJet = dbe->bookFloat("RECO_deltaPhi_DiJet");
590  RECO_invMass_DiJet = dbe->bookFloat("RECO_invMass_DiJet");
591  HLT_deltaEta_DiJet = dbe->bookFloat("HLT_deltaEta_DiJet");
592  HLT_deltaPhi_DiJet = dbe->bookFloat("HLT_deltaPhi_DiJet ");
593  HLT_invMass_DiJet = dbe->bookFloat("HLT_invMass_DiJet");
594  RECO_deltaEta_DiJet_Match = dbe->bookFloat("RECO_deltaEta_DiJet_Match");
595  RECO_deltaPhi_DiJet_Match = dbe->bookFloat("RECO_deltaPhi_DiJet_Match");
596  RECO_invMass_DiJet_Match = dbe->bookFloat("RECO_invMass_DiJet_Match");
597  RECOHLT_deltaEta = dbe->bookFloat("RECOHLT_deltaEta");
598  RECOHLT_deltaPhi = dbe->bookFloat("RECOHLT_deltaPhi ");
599  RECOHLT_invMass = dbe->bookFloat("RECOHLT_invMass");
600  NumberOfMatches = dbe->bookFloat("NumberOfMatches");
601  NumberOfEvents = dbe->bookFloat("NumberOfEvents");
602 
603  std::string labelname("ME");
604  std::string histoname(labelname+"");
605  std::string title(labelname+"");
606 
607  //RECO_deltaEta_DiJet
608  histoname = labelname+"_RECO_deltaEta_DiJet";
609  title = labelname+"_RECO_deltaEta_DiJet "+trigPath;
610  RECO_deltaEta_DiJet = dbe->book1D(histoname.c_str(),title.c_str(),50,-10.,10.);
611  RECO_deltaEta_DiJet->getTH1F();
612 
613  //RECO_deltaPhi_DiJet
614  histoname = labelname+"_RECO_deltaPhi_DiJet";
615  title = labelname+"_RECO_deltaPhi_DiJet "+trigPath;
616  RECO_deltaPhi_DiJet = dbe->book1D(histoname.c_str(),title.c_str(),35,-3.5,3.5);
617  RECO_deltaPhi_DiJet->getTH1F();
618 
619  //RECO_invMass_DiJet
620  histoname = labelname+"_RECO_invMass_DiJet";
621  title = labelname+"_RECO_invMass_DiJet "+trigPath;
622  RECO_invMass_DiJet = dbe->book1D(histoname.c_str(),title.c_str(),100,500.,2000.);
623  RECO_invMass_DiJet->getTH1F();
624 
625  //HLT_deltaEta_DiJet
626  histoname = labelname+"_HLT_deltaEta_DiJet";
627  title = labelname+"_HLT_deltaEta_DiJet "+trigPath;
628  HLT_deltaEta_DiJet = dbe->book1D(histoname.c_str(),title.c_str(),50,-10.,10.);
629  HLT_deltaEta_DiJet->getTH1F();
630 
631  //HLT_deltaPhi_DiJet
632  histoname = labelname+"_HLT_deltaPhi_DiJet";
633  title = labelname+"_HLT_deltaPhi_DiJet "+trigPath;
634  HLT_deltaPhi_DiJet = dbe->book1D(histoname.c_str(),title.c_str(),35,-3.5,3.5);
635  HLT_deltaPhi_DiJet->getTH1F();
636 
637  //HLT_invMass_DiJet
638  histoname = labelname+"_HLT_invMass_DiJet";
639  title = labelname+"_HLT_invMass_DiJet "+trigPath;
640  HLT_invMass_DiJet = dbe->book1D(histoname.c_str(),title.c_str(),100,500.,2000.);
641  HLT_invMass_DiJet->getTH1F();
642 
643  //RECO_deltaEta_DiJet_Match
644  histoname = labelname+"_RECO_deltaEta_DiJet_Match";
645  title = labelname+"_RECO_deltaEta_DiJet_Match "+trigPath;
646  RECO_deltaEta_DiJet_Match = dbe->book1D(histoname.c_str(),title.c_str(),50,-10.,10.);
647  RECO_deltaEta_DiJet_Match->getTH1F();
648 
649  //RECO_deltaPhi_DiJet_Match
650  histoname = labelname+"_RECO_deltaPhi_DiJet_Match";
651  title = labelname+"_RECO_deltaPhi_DiJet_Match "+trigPath;
652  RECO_deltaPhi_DiJet_Match = dbe->book1D(histoname.c_str(),title.c_str(),35,-3.5,3.5);
653  RECO_deltaPhi_DiJet_Match->getTH1F();
654 
655  //RECO_invMass_DiJet_Match
656  histoname = labelname+"_RECO_invMass_DiJet_Match";
657  title = labelname+"_RECO_invMass_DiJet_Match "+trigPath;
658  RECO_invMass_DiJet_Match = dbe->book1D(histoname.c_str(),title.c_str(),100,500.,2000.);
659  RECO_invMass_DiJet_Match->getTH1F();
660 
661  //RECOHLT_deltaEta
662  histoname = labelname+"_RECOHLT_deltaEta";
663  title = labelname+"_RECOHLT_deltaEta "+trigPath;
664  RECOHLT_deltaEta = dbe->book2D(histoname.c_str(),title.c_str(),50,-10.,10.,50,-10.,10.);
665  RECOHLT_deltaEta->getTH2F();
666 
667  //RECOHLT_deltaPhi
668  histoname = labelname+"_RECOHLT_deltaPhi";
669  title = labelname+"_RECOHLT_deltaPhi "+trigPath;
670  RECOHLT_deltaPhi = dbe->book2D(histoname.c_str(),title.c_str(),35,-3.5,3.5,35,-3.5,3.5);
671  RECOHLT_deltaPhi->getTH2F();
672 
673  //RECOHLT_invMass
674  histoname = labelname+"_RECOHLT_invMass";
675  title = labelname+"_RECOHLT_invMass "+trigPath;
676  RECOHLT_invMass = dbe->book2D(histoname.c_str(),title.c_str(),100,500.,2000.,100,500.,2000.);
677  RECOHLT_invMass->getTH2F();
678 
679  //NumberOfMatches
680  histoname = labelname+"_NumberOfMatches ";
681  title = labelname+"_NumberOfMatches "+trigPath;
682  NumberOfMatches = dbe->book1D(histoname.c_str(),title.c_str(),2,0.,2.);
683  NumberOfMatches->getTH1F();
684 
685  //NumberOfEvents
686  histoname = labelname+"_NumberOfEvents";
687  title = labelname+"_NumberOfEvents "+trigPath;
688  NumberOfEvents = dbe->book1D(histoname.c_str(),title.c_str(),10,0.,10.);
689  NumberOfEvents->getTH1F();
690 
691  //}
692  v->setHistos(
693  RECO_deltaEta_DiJet,
694  RECO_deltaPhi_DiJet,
695  RECO_invMass_DiJet,
696  HLT_deltaEta_DiJet,
697  HLT_deltaPhi_DiJet,
698  HLT_invMass_DiJet,
699  RECO_deltaEta_DiJet_Match,
700  RECO_deltaPhi_DiJet_Match,
701  RECO_invMass_DiJet_Match,
702  RECOHLT_deltaEta,
703  RECOHLT_deltaPhi,
704  RECOHLT_invMass,
705  NumberOfMatches,
706  NumberOfEvents
707  );
708  //break;//We need only the first unprescale paths
709  }
710  }
711 }
712 
713 //--------------------------------------------------------
715  const EventSetup& context) {
716 }
717 
718 //--------------------------------------------------------
719 void
721  const EventSetup& context) {
722 }
723 
724 // - method called once each job just after ending the event loop ------------
725 void
727  //delete jetID;
728 }
729 
732  //if (debug_) std::cout << "endRun, run " << run.id() << std::endl;
733 }
734 
736  bool output = false;
737  if (fabs(eta)<=1.3) output=true;
738  return output;
739 }
740 
742  bool output = false;
743  if (fabs(eta)<=3.0 && fabs(eta)>1.3) output=true;
744  return output;
745 }
746 
748  bool output = false;
749  if (fabs(eta)>3.0) output=true;
750  return output;
751 }
752 
754  // hltConfig_ has to be defined first before calling this method
755  bool output=false;
756  for (unsigned int j=0; j!=hltConfig_.size(); ++j) {
757  if (hltConfig_.triggerName(j) == pathname )
758  output=true;
759  }
760  return output;
761 }
762 
764  // triggerResults_, triggerNames_ has to be defined first before calling this method
765  bool output=false;
766  if(&triggerResults_) {
767  unsigned index = triggerNames_.triggerIndex(pathName);
768  //std::cout<<" -index = "<<index<<endl;
769  if(index < triggerNames_.size() && triggerResults_->accept(index)) output = true;
770  }
771  return output;
772 }
773 
775  // processname_, triggerObj_ has to be defined before calling this method
776  bool output=false;
777  edm::InputTag testTag(objectName,"",processname_);
778  const int index = triggerObj_->filterIndex(testTag);
779  if ( index >= triggerObj_->sizeFilters() ) {
780  edm::LogInfo("HLTInclusiveVBFSource") << "no index "<< index << " of that name ";
781  } else {
782  const trigger::Keys & k = triggerObj_->filterKeys(index);
783  if (k.size()) output=true;
784  }
785  return output;
786 }
787 
788 
#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:204
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
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
edm::EDGetTokenT< reco::CaloMETCollection > caloMetToken
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:3046
virtual bool isForward(double eta)
PathInfoCollection hltPathsAll_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
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
void endRun(const edm::Run &run, const edm::EventSetup &c)
EndRun.
T eta() const
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:879
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
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
void setVerbose(unsigned level)
Definition: DQMStore.cc:619
bool isValid() const
Definition: HandleBase.h:76
edm::TriggerNames triggerNames_
int k[5][pyjets_maxn]
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_
string histoname
Definition: dt-layouts.py:48
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
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
std::string const & instance() const
Definition: InputTag.h:43
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
Definition: Run.h:41
edm::Handle< edm::TriggerResults > triggerResults_
virtual bool isEndCap(double eta)
Definition: DDAxes.h:10