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