CMS 3D CMS Logo

JetMETHLTOfflineSource.cc
Go to the documentation of this file.
1 /*
2  JetMETHLTOffline DQM code
3  Migrated to use DQMEDAnalyzer by: Jyothsna Rani Komaragiri, Oct 2014
4 */
5 
7 
16 
23 
25 
27 
28 #include "TMath.h"
29 #include "TH1F.h"
30 #include "TH2F.h"
31 #include "TProfile.h"
32 #include "TPRegexp.h"
33 
34 #include <cmath>
35 
36 using namespace edm;
37 using namespace reco;
38 using namespace std;
39 using namespace trigger;
40 
42  isSetup_(false)
43 {
44  LogDebug("JetMETHLTOfflineSource") << "constructor....";
45 
46  //
47  dirname_ = iConfig.getUntrackedParameter("dirname",std::string("HLT/JetMET/"));
48  processname_ = iConfig.getParameter<std::string>("processname");
49  triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
50  triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
51  triggerSummaryToken = consumes <trigger::TriggerEvent> (triggerSummaryLabel_);
52  triggerResultsToken = consumes <edm::TriggerResults> (triggerResultsLabel_);
53  triggerSummaryFUToken= consumes <trigger::TriggerEvent> (edm::InputTag(triggerSummaryLabel_.label(),triggerSummaryLabel_.instance(),std::string("FU")));
54  triggerResultsFUToken= consumes <edm::TriggerResults> (edm::InputTag(triggerResultsLabel_.label(),triggerResultsLabel_.instance(),std::string("FU")));
55  //
56  verbose_ = iConfig.getUntrackedParameter< bool >("verbose", false);
57  runStandalone_ = iConfig.getUntrackedParameter< bool >("runStandalone", false);
58  //
59  plotAll_ = iConfig.getUntrackedParameter< bool >("plotAll", true);
60  plotEff_ = iConfig.getUntrackedParameter< bool >("plotEff", true);
61  nameForEff_ = iConfig.getUntrackedParameter< bool >("nameForEff", true);
62  MuonTrigPaths_ = iConfig.getUntrackedParameter<vector<std::string> >("pathnameMuon");
63  MBTrigPaths_ = iConfig.getUntrackedParameter<vector<std::string> >("pathnameMB");
64  //CaloJet, CaloMET
65  caloJetsToken = consumes<reco::CaloJetCollection> (iConfig.getParameter<edm::InputTag>("CaloJetCollectionLabel"));
66  caloMetToken = consumes<reco::CaloMETCollection> (iConfig.getParameter<edm::InputTag>("CaloMETCollectionLabel"));
67  //PFJet, PFMET
68  pfJetsToken = consumes<reco::PFJetCollection> (iConfig.getParameter<edm::InputTag>("PFJetCollectionLabel"));
69  pfMetToken = consumes<reco::PFMETCollection> (iConfig.getParameter<edm::InputTag>("PFMETCollectionLabel"));
70  //pfmhtTag_ = iConfig.getParameter<edm::InputTag>("PFMHTCollectionLabel");
71  //Vertex info
72  vertexToken = consumes<reco::VertexCollection> (std::string("offlinePrimaryVertices"));
73  //
74  CaloJetCorToken_ = consumes<reco::JetCorrector>(iConfig.getParameter<edm::InputTag>("CaloJetCorLabel"));
75  PFJetCorToken_ = consumes<reco::JetCorrector>(iConfig.getParameter<edm::InputTag>("PFJetCorLabel"));
76  //JetID
78  _fEMF = iConfig.getUntrackedParameter< double >("fEMF", 0.01);
79  _feta = iConfig.getUntrackedParameter< double >("feta", 2.60);
80  _fHPD = iConfig.getUntrackedParameter< double >("fHPD", 0.98);
81  _n90Hits = iConfig.getUntrackedParameter< double >("n90Hits", 1.0);
82  _min_NHEF = iConfig.getUntrackedParameter< double >("minNHEF",0.);
83  _max_NHEF = iConfig.getUntrackedParameter< double >("maxNHEF",0.99);
84  _min_CHEF = iConfig.getUntrackedParameter< double >("minCHEF",0.);
85  _max_CHEF = iConfig.getUntrackedParameter< double >("maxCHEF",1.);
86  _min_NEMF = iConfig.getUntrackedParameter< double >("minNEMF",0.);
87  _max_NEMF = iConfig.getUntrackedParameter< double >("maxNEMF",0.99);
88  _min_CEMF = iConfig.getUntrackedParameter< double >("minCEMF",0.);
89  _max_CEMF = iConfig.getUntrackedParameter< double >("maxCEMF",0.99);
90  //Paths
91  pathFilter_ = iConfig.getUntrackedParameter<vector<std::string> >("pathFilter");
92  pathRejectKeyword_ = iConfig.getUntrackedParameter<vector<std::string> >("pathRejectKeyword");
93  std::vector<edm::ParameterSet> paths = iConfig.getParameter<std::vector<edm::ParameterSet> >("pathPairs");
94  for(auto & path : paths) {
95  custompathnamepairs_.push_back(make_pair(
96  path.getParameter<std::string>("pathname"),
97  path.getParameter<std::string>("denompathname")
98  ));
99  }
100 }
101 
102 //------------------------------------------------------------------------//
104 {
105  //
106  // do anything here that needs to be done at desctruction time
107  // (e.g. close files, deallocate resources etc.)
108  delete jetID;
109 }
110 
111 //------------------------------------------------------------------------//
112 void
114 {
115  if (verbose_) {
116  cout << endl;
117  cout << "============================================================" << endl;
118  cout << " New event" << endl << endl;
119  }
120 
121  //---------- triggerResults ----------
123  if(!triggerResults_.isValid()) {
125  if(!triggerResults_.isValid()) {
126  if (verbose_) cout << " triggerResults not valid" << endl;
127  edm::LogInfo("JetMETHLTOfflineSource") << "TriggerResults not found, "
128  "skipping event";
129  return;
130  }
131  }
132  if (verbose_) cout << " done triggerResults" << endl;
133 
134  //---------- triggerResults ----------
136 
137  //---------- triggerSummary ----------
139  if(!triggerObj_.isValid()) {
141  if(!triggerObj_.isValid()) {
142  edm::LogInfo("JetMETHLTOfflineSource") << "TriggerEvent not found, "
143  "skipping event";
144  return;
145  }
146  }
147  if (verbose_) cout << " done triggerSummary" << endl;
148 
149  if (verbose_) {
150  cout << endl;
151  cout << "============================================================" << endl;
152  cout << " Reading in offline objects" << endl << endl;
153  }
154 
155  //------------ Offline Objects -------
157  if(!calojetColl_.isValid()) return;
158  calojet = *calojetColl_;
159  //std::stable_sort( calojet.begin(), calojet.end(), PtSorter() );
160 
161  if (verbose_) cout << " done calo" << endl;
162 
164  if(!pfjetColl_.isValid()) return;
165  pfjet = *pfjetColl_;
166  //std::stable_sort( pfjet.begin(), pfjet.end(), PtSorter() );
167 
168  if (verbose_) cout << " done pf" << endl;
169 
171  if(!calometColl_.isValid()) return;
172 
174  if(!pfmetColl_.isValid()) return;
175 
176  if (verbose_) {
177  cout << endl;
178  cout << "============================================================" << endl;
179  cout << " Read in offline objects" << endl << endl;
180  }
181 
182  //---------- Event counting (DEBUG) ----------
183  if(verbose_ && iEvent.id().event()%10000==0)
184  cout<<"Run = "<<iEvent.id().run()<<", LS = "<<iEvent.luminosityBlock()<<", Event = "<<iEvent.id().event()<<endl;
185 
186  //Define on-the-fly correction Jet
187  for(int i=0; i<2; i++){
188  CaloJetPx[i] = 0.;
189  CaloJetPy[i] = 0.;
190  CaloJetPt[i] = 0.;
191  CaloJetEta[i] = 0.;
192  CaloJetPhi[i] = 0.;
193  CaloJetEMF[i] = 0.;
194  CaloJetfHPD[i] = 0.;
195  CaloJetn90[i] = 0.;
196  PFJetPx[i] = 0.;
197  PFJetPy[i] = 0.;
198  PFJetPt[i] = 0.;
199  PFJetEta[i] = 0.;
200  PFJetPhi[i] = 0.;
201  PFJetNHEF[i] = 0.;
202  PFJetCHEF[i] = 0.;
203  PFJetNEMF[i] = 0.;
204  PFJetCEMF[i] = 0.;
205  }
206 
207  //---------- CaloJet Correction (on-the-fly) ----------
208  edm::Handle<reco::JetCorrector> calocorrector;
209  iEvent.getByToken(CaloJetCorToken_, calocorrector);
210  auto calojet_ = calojet.begin();
211  for(; calojet_ != calojet.end(); ++calojet_){
212  double scale = calocorrector->correction(*calojet_);
213  jetID->calculate(iEvent, iSetup, *calojet_);
214 
215  if(scale*calojet_->pt()>CaloJetPt[0]){
216  CaloJetPt[1] = CaloJetPt[0];
217  CaloJetPx[1] = CaloJetPx[0];
218  CaloJetPy[1] = CaloJetPy[0];
219  CaloJetEta[1] = CaloJetEta[0];
220  CaloJetPhi[1] = CaloJetPhi[0];
221  CaloJetEMF[1] = CaloJetEMF[0];
222  CaloJetfHPD[1] = CaloJetfHPD[0];
223  CaloJetn90[1] = CaloJetn90[0];
224  //
225  CaloJetPt[0] = scale*calojet_->pt();
226  CaloJetPx[0] = scale*calojet_->px();
227  CaloJetPy[0] = scale*calojet_->py();
228  CaloJetEta[0] = calojet_->eta();
229  CaloJetPhi[0] = calojet_->phi();
230  CaloJetEMF[0] = calojet_->emEnergyFraction();
231  CaloJetfHPD[0] = jetID->fHPD();
232  CaloJetn90[0] = jetID->n90Hits();
233  }
234  else if(scale*calojet_->pt()<CaloJetPt[0] && scale*calojet_->pt()>CaloJetPt[1] ){
235  CaloJetPt[1] = scale*calojet_->pt();
236  CaloJetPx[1] = scale*calojet_->px();
237  CaloJetPy[1] = scale*calojet_->py();
238  CaloJetEta[1] = calojet_->eta();
239  CaloJetPhi[1] = calojet_->phi();
240  CaloJetEMF[1] = calojet_->emEnergyFraction();
241  CaloJetfHPD[1] = jetID->fHPD();
242  CaloJetn90[1] = jetID->n90Hits();
243  }
244  else{}
245  }
246 
247  //---------- PFJet Correction (on-the-fly) ----------
248  pfMHTx_All = 0.;
249  pfMHTy_All = 0.;
251  iEvent.getByToken(PFJetCorToken_, pfcorrector);
252  auto pfjet_ = pfjet.begin();
253  for(; pfjet_ != pfjet.end(); ++pfjet_){
254  double scale = pfcorrector->correction(*pfjet_);
255  pfMHTx_All = pfMHTx_All + scale*pfjet_->px();
256  pfMHTy_All = pfMHTy_All + scale*pfjet_->py();
257  if(scale*pfjet_->pt()>PFJetPt[0]){
258  PFJetPt[1] = PFJetPt[0];
259  PFJetPx[1] = PFJetPx[0];
260  PFJetPy[1] = PFJetPy[0];
261  PFJetEta[1] = PFJetEta[0];
262  PFJetPhi[1] = PFJetPhi[0];
263  PFJetNHEF[1] = PFJetNHEF[0];
264  PFJetCHEF[1] = PFJetCHEF[0];
265  PFJetNEMF[1] = PFJetNEMF[0];
266  PFJetCEMF[1] = PFJetCEMF[0];
267  //
268  PFJetPt[0] = scale*pfjet_->pt();
269  PFJetPx[0] = scale*pfjet_->px();
270  PFJetPy[0] = scale*pfjet_->py();
271  PFJetEta[0] = pfjet_->eta();
272  PFJetPhi[0] = pfjet_->phi();
273  PFJetNHEF[0] = pfjet_->neutralHadronEnergyFraction();
274  PFJetCHEF[0] = pfjet_->chargedHadronEnergyFraction();
275  PFJetNEMF[0] = pfjet_->neutralEmEnergyFraction();
276  PFJetCEMF[0] = pfjet_->chargedEmEnergyFraction();
277  }
278  else if(scale*pfjet_->pt()<PFJetPt[0] && scale*pfjet_->pt()>PFJetPt[1] ){
279  PFJetPt[1] = scale*pfjet_->pt();
280  PFJetPx[1] = scale*pfjet_->px();
281  PFJetPy[1] = scale*pfjet_->py();
282  PFJetEta[1] = pfjet_->eta();
283  PFJetPhi[1] = pfjet_->phi();
284  PFJetNHEF[1] = pfjet_->neutralHadronEnergyFraction();
285  PFJetCHEF[1] = pfjet_->chargedHadronEnergyFraction();
286  PFJetNEMF[1] = pfjet_->neutralEmEnergyFraction();
287  PFJetCEMF[1] = pfjet_->chargedEmEnergyFraction();
288  }
289  else{}
290  }
291 
292  if(verbose_){
293  for(int i = 0; i<2; i++){
294  cout<<"CaloJet-0: "<<CaloJetPt[i]<<", Eta = "<<CaloJetEta[i]<<", Phi = "<<CaloJetPhi[i]<<endl;
295  cout<<"fHPD = "<<CaloJetfHPD[0]<<", n90 = "<<CaloJetn90[0]<<endl;
296  }
297  for(int i = 0; i<2; i++){
298  cout<<"PFJet-0: "<<PFJetPt[i]<<", Eta = "<<PFJetEta[i]<<", Phi = "<<PFJetPhi[i]<<endl;
299  }
300  }
301 
302  //---------- RUN ----------
303  fillMEforMonTriggerSummary(iEvent, iSetup);
304  if(plotAll_) fillMEforMonAllTrigger(iEvent, iSetup);
305  if(plotEff_) fillMEforEffAllTrigger(iEvent,iSetup);
307 }
308 
309 //------------------------------------------------------------------------//
310 // Trigger summary for all paths
311 void
313 {
314  if (verbose_)
315  cout << ">> Inside fillMEforMonTriggerSummary " << endl;
316  bool muTrig = false;
317 
318  for(auto const & MuonTrigPath : MuonTrigPaths_){
319  const unsigned int nPath(hltConfig_.size());
320  for (unsigned int j=0; j!=nPath; ++j) {
321  std::string pathname = hltConfig_.triggerName(j);
322  if(pathname.find(MuonTrigPath) != std::string::npos){
323  if(isHLTPathAccepted(pathname)){
324  muTrig = true;
325  if(verbose_) cout<<"fillMEforMonTriggerSummary: Muon Match"<<endl;
326  }
327  }
328  if(muTrig) break;
329  }
330  if(muTrig) break;
331  }
332 
333  bool mbTrig = false;
334  for(auto const & MBTrigPath : MBTrigPaths_){
335  const unsigned int nPath(hltConfig_.size());
336  for (unsigned int j=0; j!=nPath; ++j) {
337  std::string pathname = hltConfig_.triggerName(j);
338  if(pathname.find(MBTrigPath) != std::string::npos){
339  if(isHLTPathAccepted(pathname)){
340  mbTrig = true;
341  if(verbose_) cout<<"fillMEforMonTriggerSummary: MinBias Match"<<endl;
342  }
343  }
344  if(mbTrig) break;
345  }
346  if(mbTrig) break;
347  }
348 
349  auto v = hltPathsAll_.begin();
350  for(; v!= hltPathsAll_.end(); ++v ){
351  bool trigFirst= false;
352  double binV = TriggerPosition(v->getPath());
353  if(isHLTPathAccepted(v->getPath())) trigFirst = true;
354  if(!trigFirst)continue;
355  if(trigFirst){
356  rate_All->Fill(binV);
357  correlation_All->Fill(binV,binV);
358  if(muTrig && runStandalone_){
359  rate_AllWrtMu->Fill(binV);
360  correlation_AllWrtMu->Fill(binV,binV);
361  }
362  if(mbTrig && runStandalone_){
363  rate_AllWrtMB->Fill(binV);
364  correlation_AllWrtMB->Fill(binV,binV);
365  }
366  }
367  for(auto w = v+1; w!= hltPathsAll_.end(); ++w ){
368  bool trigSec = false;
369  double binW = TriggerPosition(w->getPath());
370  if(isHLTPathAccepted(w->getPath()))trigSec = true;
371  if(trigSec && trigFirst){
372  correlation_All->Fill(binV,binW);
373  if(muTrig && runStandalone_) correlation_AllWrtMu->Fill(binV,binW);
374  if(mbTrig && runStandalone_) correlation_AllWrtMB->Fill(binV,binW);
375  }
376  if(!trigSec && trigFirst){
377  correlation_All->Fill(binW,binV);
378  if(muTrig && runStandalone_) correlation_AllWrtMu->Fill(binW,binV);
379  if(mbTrig && runStandalone_) correlation_AllWrtMB->Fill(binW,binV);
380  }
381  }
382  }
383 
384  //Vertex
386  iEvent.getByToken (vertexToken,Vtx);
387  int vtxcnt=0;
388  for (auto const & itv : *Vtx){
389  //if(vtxcnt>=20) break;
390  PVZ->Fill(itv.z());
391  //chi2vtx[vtxcnt] = itv->chi2();
392  //ndofvtx[vtxcnt] = itv->ndof();
393  //ntrkvtx[vtxcnt] = itv->tracksSize();
394  vtxcnt++;
395  }
396  NVertices->Fill(vtxcnt);
397 }
398 
399 //------------------------------------------------------------------------//
400 void
402 {
403  if (verbose_)
404  cout << ">> Inside fillMEforTriggerNTfired" << endl;
405  if(!triggerResults_.isValid()) return;
406  if (verbose_)
407  cout << " ... and triggerResults is valid" << endl;
408 
409  //
410  for(auto & v : hltPathsAll_){
411  unsigned index = triggerNames_.triggerIndex(v.getPath());
412  if (index < triggerNames_.size() ){
413  v.getMEhisto_TriggerSummary()->Fill(0.);
414  edm::InputTag l1Tag(v.getl1Path(),"",processname_);
415  const int l1Index = triggerObj_->filterIndex(l1Tag);
416  bool l1found = false;
417  if(l1Index < triggerObj_->sizeFilters() ) l1found = true;
418  if(!l1found)v.getMEhisto_TriggerSummary()->Fill(1.);
419  if(!l1found && !(triggerResults_->accept(index)))v.getMEhisto_TriggerSummary()->Fill(2.);
420  if(!l1found && (triggerResults_->accept(index)))v.getMEhisto_TriggerSummary()->Fill(3.);
421  if(l1found)v.getMEhisto_TriggerSummary()->Fill(4.);
422  if(l1found && (triggerResults_->accept(index)))v.getMEhisto_TriggerSummary()->Fill(5.);
423  if(l1found && !(triggerResults_->accept(index)))v.getMEhisto_TriggerSummary()->Fill(6.);
424  if(!(triggerResults_->accept(index)) && l1found){
425  //cout<<v->getTriggerType()<<endl;
426  if((v.getTriggerType() == "SingleJet_Trigger") && (calojetColl_.isValid()) && !calojet.empty()){
427  auto jet = calojet.begin();
428  v.getMEhisto_JetPt()->Fill(jet->pt());
429  v.getMEhisto_EtavsPt()->Fill(jet->eta(),jet->pt());
430  v.getMEhisto_PhivsPt()->Fill(jet->phi(),jet->pt());
431  }
432  // single jet trigger is not fired
433 
434  if((v.getTriggerType() == "DiJet_Trigger") && calojetColl_.isValid() && !calojet.empty()){
435  v.getMEhisto_JetSize()->Fill(calojet.size());
436  if (calojet.size()>=2){
437  auto jet = calojet.begin();
438  auto jet2= calojet.begin(); jet2++;
439  double jet3pt = 0.;
440  if(calojet.size()>2){
441  auto jet3 = jet2++;
442  jet3pt = jet3->pt();
443  }
444  v.getMEhisto_Pt12()->Fill((jet->pt()+jet2->pt())/2.);
445  v.getMEhisto_Eta12()->Fill((jet->eta()+jet2->eta())/2.);
446  v.getMEhisto_Phi12()->Fill(deltaPhi(jet->phi(),jet2->phi()));
447  v.getMEhisto_Pt3()->Fill(jet3pt);
448  v.getMEhisto_Pt12Pt3()->Fill((jet->pt()+jet2->pt())/2., jet3pt);
449  v.getMEhisto_Pt12Phi12()->Fill((jet->pt()+jet2->pt())/2., deltaPhi(jet->phi(),jet2->phi()));
450  }
451  }// di jet trigger is not fired
452 
453  if(((v.getTriggerType() == "MET_Trigger")|| (v.getTriggerType() == "TET_Trigger")) && calometColl_.isValid() ){
454  const CaloMETCollection *calometcol = calometColl_.product();
455  const CaloMET met = calometcol->front();
456  v.getMEhisto_JetPt()->Fill(met.pt());
457  }//MET trigger is not fired
458  } // L1 is fired
459  }//
460  }// trigger not fired
461 }
462 
463 //------------------------------------------------------------------------//
464 void
466 {
467  if (verbose_)
468  cout << ">> Inside fillMEforMonAllTrigger " << endl;
469  if(!triggerResults_.isValid()) return;
470  if (verbose_)
471  cout << " ... and triggerResults is valid" << endl;
472 
474  for(auto & v : hltPathsAll_){
475  if (verbose_)
476  cout << " + Checking path " << v.getPath();
477  if(isHLTPathAccepted(v.getPath())==false) {
478  if (verbose_)
479  cout << " - failed" << endl;
480  continue;
481  }
482  if (verbose_)
483  cout << " - PASSED! " << endl;
484 
485  //New jet collection (after apply JEC)
486  std::vector<double>jetPtVec;
487  std::vector<double>jetPhiVec;
488  std::vector<double>jetEtaVec;
489  std::vector<double>jetPxVec;
490  std::vector<double>jetPyVec;
491  std::vector<double>hltPtVec;
492  std::vector<double>hltPhiVec;
493  std::vector<double>hltEtaVec;
494  std::vector<double>hltPxVec;
495  std::vector<double>hltPyVec;
496 
497  //This will be used to find out punch through trigger
498  //bool fillL1HLT = false;
499 
500  //L1 and HLT indices
501  if (verbose_) {
502  cout << " - L1Path = " << v.getl1Path() << endl;
503  cout << " - Label = " << v.getLabel() << endl;
504  }
505 
506  //edm::InputTag l1Tag(v->getl1Path(),"",processname_);
507  edm::InputTag l1Tag(v.getLabel(),"",processname_);
508  const int l1Index = triggerObj_->filterIndex(l1Tag);
509  if (verbose_)
510  cout << " - l1Index = " << l1Index << " - l1Tag = [" << l1Tag << "]" << endl;
511 
512 
513  edm::InputTag hltTag(v.getLabel(),"",processname_);
514  const int hltIndex = triggerObj_->filterIndex(hltTag);
515  if (verbose_)
516  cout << " - hltIndex = " << hltIndex << " - hltTag = [" << hltTag << "]" << endl;
517 
518 
519  //bool l1TrigBool = false;
520  bool hltTrigBool = false;
521  bool diJetFire = false;
522  int jetsize = 0;
523 
524  if ( l1Index >= triggerObj_->sizeFilters() ) {
525  edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
526  if (verbose_)
527  cout << "[JetMETHLTOfflineSource::fillMEforMonAllTrigger] - No index l1Index="
528  << l1Index << " of that name \"" << l1Tag << "\"" << endl;
529  }
530  else {
531  //l1TrigBool = true;
532  const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
533  //
534  if(v.getObjectType() == trigger::TriggerJet
535  && v.getTriggerType() == "SingleJet_Trigger")
536  v.getMEhisto_N_L1()->Fill(kl1.size());
537  //
538  auto ki = kl1.begin();
539  for(; ki != kl1.end(); ++ki){
540  double l1TrigEta = -100;
541  double l1TrigPhi = -100;
542  //
543  if(v.getObjectType() == trigger::TriggerJet){
544  l1TrigEta = toc[*ki].eta();
545  l1TrigPhi = toc[*ki].phi();
546  if(v.getTriggerType() == "SingleJet_Trigger"){
547  v.getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
548  if (isBarrel(toc[*ki].eta())) v.getMEhisto_PtBarrel_L1()->Fill(toc[*ki].pt());
549  if (isEndCap(toc[*ki].eta())) v.getMEhisto_PtEndcap_L1()->Fill(toc[*ki].pt());
550  if (isForward(toc[*ki].eta())) v.getMEhisto_PtForward_L1()->Fill(toc[*ki].pt());
551  v.getMEhisto_Eta_L1()->Fill(toc[*ki].eta());
552  v.getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
553  v.getMEhisto_EtaPhi_L1()->Fill(toc[*ki].eta(),toc[*ki].phi());
554  }
555  }
556  if(v.getObjectType() == trigger::TriggerMET ||
557  v.getObjectType() == trigger::TriggerTET){
558  v.getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
559  v.getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
560  }
561 
562  //-----------------------------------------------
563  if ( hltIndex >= triggerObj_->sizeFilters() ) {
564  edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
565  if (verbose_)
566  cout << "[JetMETHLTOfflineSource::fillMEforMonAllTrigger] - No index hltIndex="
567  << hltIndex << " of that name " << endl;
568  }
569  else {
570  const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
571  if(v.getObjectType() == trigger::TriggerJet
572  && ki == kl1.begin()
573  && v.getTriggerType() == "SingleJet_Trigger")
574  v.getMEhisto_N_HLT()->Fill(khlt.size());
575  //
576  auto kj = khlt.begin();
577  //Define hltTrigBool
578  for(;kj != khlt.end(); ++kj){
579  if(v.getObjectType() == trigger::TriggerJet){
580  double hltTrigEta = -100;
581  double hltTrigPhi = -100;
582  hltTrigEta = toc[*kj].eta();
583  hltTrigPhi = toc[*kj].phi();
584  if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4
585  && (v.getTriggerType() == "DiJet_Trigger"))
586  hltTrigBool = true;
587  }
588  }
589  //
590  kj = khlt.begin();
591  for(;kj != khlt.end(); ++kj){
592  double hltTrigEta = -100.;
593  double hltTrigPhi = -100.;
594  //fillL1HLT = true;
595  //MET Triggers
596  if (verbose_)
597  cout << "+ MET Triggers plots" << endl;
598  if(v.getObjectType() == trigger::TriggerMET || (v.getObjectType() == trigger::TriggerTET)){
599  v.getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
600  v.getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
601  v.getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
602  v.getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
603  v.getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
604  v.getMEhisto_PhiResolution_L1HLT()->Fill(toc[*ki].phi()-toc[*kj].phi());
605  }
606  //Jet Triggers
607  if (verbose_)
608  cout << "+ Jet Trigger plots" << endl;
609  if(v.getObjectType() == trigger::TriggerJet){
610  if (verbose_)
611  cout << " - Going for those..." << endl;
612  hltTrigEta = toc[*kj].eta();
613  hltTrigPhi = toc[*kj].phi();
614  if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4){
615  if(v.getTriggerType() == "SingleJet_Trigger"){
616  v.getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
617  v.getMEhisto_EtaCorrelation_L1HLT()->Fill(toc[*ki].eta(),toc[*kj].eta());
618  v.getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
619  v.getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
620  v.getMEhisto_EtaResolution_L1HLT()->Fill(toc[*ki].eta()-toc[*kj].eta());
621  v.getMEhisto_PhiResolution_L1HLT()->Fill(toc[*ki].phi()-toc[*kj].phi());
622  }
623  }
624  if(((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi) < 0.4 )
625  || ((v.getTriggerType() == "DiJet_Trigger") && hltTrigBool)) && !diJetFire){
626  if(v.getTriggerType() == "SingleJet_Trigger"){
627  v.getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
628  if (isBarrel(toc[*kj].eta())) v.getMEhisto_PtBarrel_HLT()->Fill(toc[*kj].pt());
629  if (isEndCap(toc[*kj].eta())) v.getMEhisto_PtEndcap_HLT()->Fill(toc[*kj].pt());
630  if (isForward(toc[*kj].eta())) v.getMEhisto_PtForward_HLT()->Fill(toc[*kj].pt());
631  v.getMEhisto_Eta_HLT()->Fill(toc[*kj].eta());
632  v.getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
633  v.getMEhisto_EtaPhi_HLT()->Fill(toc[*kj].eta(),toc[*kj].phi());
634  }
635 
636  //Calojet
637  if(calojetColl_.isValid()
638  && (v.getObjectType() == trigger::TriggerJet)
639  && (v.getPath() == "PFJet")){
640  //CaloJetCollection::const_iterator jet = calojet.begin();
641  //for(; jet != calojet.end(); ++jet) {
642  for(int iCalo=0; iCalo<2; iCalo++){
643  if(deltaR(hltTrigEta, hltTrigPhi, CaloJetEta[iCalo], CaloJetPhi[iCalo]) < 0.4){
644  jetsize++;
645  if(v.getTriggerType() == "SingleJet_Trigger"){
646  v.getMEhisto_Pt()->Fill(CaloJetPt[iCalo]);
647  if (isBarrel(CaloJetEta[iCalo])) v.getMEhisto_PtBarrel()->Fill(CaloJetPt[iCalo]);
648  if (isEndCap(CaloJetEta[iCalo])) v.getMEhisto_PtEndcap()->Fill(CaloJetPt[iCalo]);
649  if (isForward(CaloJetEta[iCalo])) v.getMEhisto_PtForward()->Fill(CaloJetPt[iCalo]);
650  //
651  v.getMEhisto_Eta()->Fill(CaloJetEta[iCalo]);
652  v.getMEhisto_Phi()->Fill(CaloJetPhi[iCalo]);
653  v.getMEhisto_EtaPhi()->Fill(CaloJetEta[iCalo],CaloJetPhi[iCalo]);
654  //
655  v.getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),CaloJetPt[iCalo]);
656  v.getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(),CaloJetEta[iCalo]);
657  v.getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),CaloJetPhi[iCalo]);
658  //
659  v.getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-CaloJetPt[iCalo])/(toc[*kj].pt()));
660  v.getMEhisto_EtaResolution_HLTRecObj()->Fill(toc[*kj].eta()-CaloJetEta[iCalo]);
661  v.getMEhisto_PhiResolution_HLTRecObj()->Fill(toc[*kj].phi()-CaloJetPhi[iCalo]);
662  }
663 
664  //-------------------------------------------------------
665  if((v.getTriggerType() == "DiJet_Trigger")){
666  jetPhiVec.push_back(CaloJetPhi[iCalo]);
667  jetPtVec.push_back(CaloJetPt[iCalo]);
668  jetEtaVec.push_back(CaloJetEta[iCalo]);
669  jetPxVec.push_back(CaloJetPx[iCalo]);
670  jetPyVec.push_back(CaloJetPy[iCalo]);
671  //
672  hltPhiVec.push_back(toc[*kj].phi());
673  hltPtVec.push_back(toc[*kj].pt());
674  hltEtaVec.push_back(toc[*kj].eta());
675  hltPxVec.push_back(toc[*kj].px());
676  hltPyVec.push_back(toc[*kj].py());
677  }
678  }// matching jet
679  }// Jet Loop
680  }// valid calojet collection, with calojet trigger
681 
682  //PFJet trigger
683  if(pfjetColl_.isValid()
684  && (v.getObjectType() == trigger::TriggerJet)
685  && (v.getPath() != "PFJet")){
686  //PFJetCollection::const_iterator jet = pfjet.begin();
687  //for(; jet != pfjet.end(); ++jet){
688  for(int iPF=0; iPF<2; iPF++){
689  if(deltaR(hltTrigEta, hltTrigPhi, PFJetEta[iPF], PFJetPhi[iPF]) < 0.4){
690  jetsize++;
691  if(v.getTriggerType() == "SingleJet_Trigger"){
692  v.getMEhisto_Pt()->Fill(PFJetPt[iPF]);
693  if (isBarrel(PFJetEta[iPF])) v.getMEhisto_PtBarrel()->Fill(PFJetPt[iPF]);
694  if (isEndCap(PFJetEta[iPF])) v.getMEhisto_PtEndcap()->Fill(PFJetPt[iPF]);
695  if (isForward(PFJetEta[iPF])) v.getMEhisto_PtForward()->Fill(PFJetPt[iPF]);
696  //
697  v.getMEhisto_Eta()->Fill(PFJetEta[iPF]);
698  v.getMEhisto_Phi()->Fill(PFJetPhi[iPF]);
699  v.getMEhisto_EtaPhi()->Fill(PFJetEta[iPF],PFJetPhi[iPF]);
700  //
701  v.getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),PFJetPt[iPF]);
702  v.getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(),PFJetEta[iPF]);
703  v.getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),PFJetPhi[iPF]);
704  //
705  v.getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-PFJetPt[iPF])/(toc[*kj].pt()));
706  v.getMEhisto_EtaResolution_HLTRecObj()->Fill(toc[*kj].eta()-PFJetEta[iPF]);
707  v.getMEhisto_PhiResolution_HLTRecObj()->Fill(toc[*kj].phi()-PFJetPhi[iPF]);
708  }
709 
710  //-------------------------------------------------------
711  if((v.getTriggerType() == "DiJet_Trigger")){
712  jetPhiVec.push_back(PFJetPhi[iPF]);
713  jetPtVec.push_back(PFJetPt[iPF]);
714  jetEtaVec.push_back(PFJetEta[iPF]);
715  jetPxVec.push_back(PFJetPx[iPF]);
716  jetPyVec.push_back(PFJetPy[iPF]);
717  //
718  hltPhiVec.push_back(toc[*kj].phi());
719  hltPtVec.push_back(toc[*kj].pt());
720  hltEtaVec.push_back(toc[*kj].eta());
721  hltPxVec.push_back(toc[*kj].px());
722  hltPyVec.push_back(toc[*kj].py());
723  }
724  }// matching jet
725  }//PFJet loop
726  }//valid pfjet collection, with pfjet trigger
727  //
728  }// hlt matching with l1
729  }// jet trigger
730 
731  //------------------------------------------------------
732  if(calometColl_.isValid()
733  && ((v.getObjectType() == trigger::TriggerMET) || (v.getObjectType() == trigger::TriggerTET))
734  && (v.getPath().find("HLT_PFMET")==std::string::npos)){
735  const CaloMETCollection *calometcol = calometColl_.product();
736  const CaloMET met = calometcol->front();
737  //
738  v.getMEhisto_Pt()->Fill(met.et());
739  v.getMEhisto_Phi()->Fill(met.phi());
740  //
741  v.getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].et(),met.et());
742  v.getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),met.phi());
743  v.getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].et()-met.et())/(toc[*kj].et()));
744  v.getMEhisto_PhiResolution_HLTRecObj()->Fill(toc[*kj].phi()-met.phi());
745  }
746 
747  //--------------------------------------------------------
748  if(pfmetColl_.isValid()
749  && ((v.getObjectType() == trigger::TriggerMET) || (v.getObjectType() == trigger::TriggerTET))
750  && (v.getPath().find("HLT_PFMET")!=std::string::npos)){
751  const PFMETCollection *pfmetcol = pfmetColl_.product();
752  const PFMET pfmet = pfmetcol->front();
753  //
754  v.getMEhisto_Pt()->Fill(pfmet.et());
755  v.getMEhisto_Phi()->Fill(pfmet.phi());
756  //
757  v.getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].et(),pfmet.et());
758  v.getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),pfmet.phi());
759  v.getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].et()-pfmet.et())/(toc[*kj].et()));
760  v.getMEhisto_PhiResolution_HLTRecObj()->Fill(toc[*kj].phi()-pfmet.phi());
761  }
762  }//Loop over HLT trigger candidates
763  if((v.getTriggerType() == "DiJet_Trigger")) diJetFire = true;
764  }// Valid hlt trigger object
765  }// Loop over L1 objects
766  }// Valid L1 trigger object
767  v.getMEhisto_N()->Fill(jetsize);
768 
769  //--------------------------------------------------------
770  if((v.getTriggerType() == "DiJet_Trigger") && jetPtVec.size() >1){
771  double AveJetPt = (jetPtVec[0] + jetPtVec[1])/2;
772  double AveJetEta = (jetEtaVec[0] + jetEtaVec[1])/2;
773  double JetDelPhi = deltaPhi(jetPhiVec[0],jetPhiVec[1]);
774  double AveHLTPt = (hltPtVec[0] + hltPtVec[1])/2;
775  double AveHLTEta = (hltEtaVec[0] + hltEtaVec[1])/2;
776  double HLTDelPhi = deltaPhi(hltPhiVec[0],hltPhiVec[1]);
777  v.getMEhisto_AveragePt_RecObj()->Fill(AveJetPt);
778  v.getMEhisto_AverageEta_RecObj()->Fill(AveJetEta);
779  v.getMEhisto_DeltaPhi_RecObj()->Fill(JetDelPhi);
780  //
781  v.getMEhisto_AveragePt_HLTObj()->Fill(AveHLTPt);
782  v.getMEhisto_AverageEta_HLTObj()->Fill(AveHLTEta);
783  v.getMEhisto_DeltaPhi_HLTObj()->Fill(HLTDelPhi);
784  }
785 
786  }
787  if (verbose_)
788  cout << "<< Exiting fillMEforMonAllTrigger " << endl;
789 
790 }
791 
792 //------------------------------------------------------------------------//
793 void
795 {
796  if (!triggerResults_.isValid()) return;
797 
798  int num = -1;
799  int denom = -1;
800  bool denompassed = false;
801  bool numpassed = false;
803 
804  for(auto & v : hltPathsEff_){
805  num++;
806  denom++;
807  denompassed = false;
808  numpassed = false;
809 
810  unsigned indexNum = triggerNames_.triggerIndex(v.getPath());
811  unsigned indexDenom = triggerNames_.triggerIndex(v.getDenomPath());
812 
813  if(indexNum < triggerNames_.size() && triggerResults_->accept(indexNum)) numpassed = true;
814  if(indexDenom < triggerNames_.size() && triggerResults_->accept(indexDenom)) denompassed = true;
815 
816  if(denompassed==false) continue;
817 
818  //if(numpassed==true){
819  edm::InputTag hltTag(v.getLabel(),"",processname_);
820  const int hltIndex = triggerObj_->filterIndex(hltTag);
821  edm::InputTag l1Tag(v.getl1Path(),"",processname_);
822  const int l1Index = triggerObj_->filterIndex(l1Tag);
823  //}
824 
825  //----------------------------------------------------------------------
826  //double pTcut = 0;
827  double trigLowpTcut = 0;
828  double trigMedpTcut = 0;
829  double trigHighpTcut = 0;
830  double trigLowpTcutFwd = 0;
831  double trigMedpTcutFwd = 0;
832  double trigHighpTcutFwd = 0;
833  //
834  //double pTPFcut = 0 ;
835  double trigLowpTPFcut = 0;
836  double trigMedpTPFcut = 0;
837  double trigHighpTPFcut = 0;
838  double trigLowpTPFcutFwd = 0;
839  double trigMedpTPFcutFwd = 0;
840  double trigHighpTPFcutFwd = 0;
841  //
842  //cout<<"pre-path" << v->getPath()<<endl;
843  size_t jetstrfound = v.getPath().find("Jet");
844  //size_t censtrfound = v->getPath().find("Central"); //shoouldn't be needed?
845  string tpath = v.getPath();
846  string jetTrigVal;
847  float jetVal = 0.;
848  //
849  if(jetstrfound != string::npos){// && ustrfound != string::npos ){
850  //cout<<v->getPath()<<endl;
851  for(int trig = int(jetstrfound)+3; trig < int(jetstrfound)+7; trig++){// int(ustrfound); trig++){
852  if(!isdigit(tpath[trig])) break;
853  jetTrigVal+=tpath[trig];
854  }
855  auto *cjetTrigVal = (char*)jetTrigVal.c_str();
856  jetVal=atof(cjetTrigVal);
857  //
858  if(jetVal>0.){
859  if(jetVal<50.){
860  //pTcut = jetVal / 2.;
861  trigMedpTcut = jetVal + 5.;
862  trigHighpTcut = jetVal + 10.;
863  //
864  trigLowpTcutFwd = jetVal + 9.;
865  trigMedpTcutFwd = jetVal + 15.;
866  trigHighpTcutFwd = jetVal + 21.;
867  }
868  else{
869  //pTcut = jetVal - 20. ;
870  trigMedpTcut = jetVal + 2.;
871  trigHighpTcut = jetVal + 60.;
872  //
873  trigLowpTcutFwd = jetVal + 22.;
874  trigMedpTcutFwd = jetVal + 25.;
875  trigHighpTcutFwd = jetVal + 110.;
876  }
877  trigLowpTcut = jetVal;
878  }
879  //
880  if(jetVal>0.){
881  if(jetVal<50.){
882  //pTPFcut = jetVal ;
883  trigMedpTPFcut = jetVal + 20.;
884  trigHighpTPFcut = jetVal + 40.;
885  //
886  trigLowpTPFcutFwd = jetVal + 60.;
887  trigMedpTPFcutFwd = jetVal + 80.;
888  trigHighpTPFcutFwd = jetVal + 100.;
889  }
890  else{
891  //pTPFcut = jetVal ;
892  trigMedpTPFcut = jetVal + 40.;
893  trigHighpTPFcut = jetVal + 140.;
894  //
895  trigLowpTPFcutFwd = jetVal + 110.;
896  trigMedpTPFcutFwd = jetVal + 130.;
897  trigHighpTPFcutFwd = jetVal + 190.;
898  }
899  trigLowpTPFcut = jetVal;
900  }
901  }
902  //----------------------------------------------------------------------
903 
904  //CaloJet paths
905  if(verbose_) std::cout << "fillMEforEffAllTrigger: CaloJet -------------------" << std::endl;
906  if(calojetColl_.isValid() && (v.getObjectType() == trigger::TriggerJet)){
907  //cout<<" - CaloJet "<<endl;
908  //&& (v->getPath().find("HLT_PFJet")==std::string::npos)
909  //&& (v->getPath().find("HLT_DiPFJet")==std::string::npos)){
910  bool jetIDbool = false;
911  double leadjpt = CaloJetPt[0];
912  double leadjeta = CaloJetEta[0];
913  double leadjphi = CaloJetPhi[0];
914  //double ljemf = CaloJetEMF[0];
915  double ljfhpd = CaloJetfHPD[0];
916  double ljn90 = CaloJetn90[0];
917  if((v.getTriggerType() == "SingleJet_Trigger") && !calojet.empty()){ //this line stops the central jets
918  if( (ljfhpd < _fHPD) && (ljn90 > _n90Hits )){
919  if(verbose_) cout<<"Passed CaloJet ID -------------------" << endl;
920  jetIDbool = true;
921  //Denominator fill
922  v.getMEhisto_DenominatorPt()->Fill(leadjpt);
923  if (isBarrel(leadjeta)) v.getMEhisto_DenominatorPtBarrel()->Fill(leadjpt);
924  if (isEndCap(leadjeta)) v.getMEhisto_DenominatorPtEndcap()->Fill(leadjpt);
925  if (isForward(leadjeta)) v.getMEhisto_DenominatorPtForward()->Fill(leadjpt);
926  v.getMEhisto_DenominatorEta()->Fill(leadjeta);
927  v.getMEhisto_DenominatorPhi()->Fill(leadjphi);
928  v.getMEhisto_DenominatorEtaPhi()->Fill(leadjeta,leadjphi);
929  if (isBarrel(leadjeta)){
930  v.getMEhisto_DenominatorEtaBarrel()->Fill(leadjeta);
931  v.getMEhisto_DenominatorPhiBarrel()->Fill(leadjphi);
932  }
933  if (isEndCap(leadjeta)){
934  v.getMEhisto_DenominatorEtaEndcap()->Fill(leadjeta);
935  v.getMEhisto_DenominatorPhiEndcap()->Fill(leadjphi);
936  }
937  if (isForward(leadjeta)){
938  v.getMEhisto_DenominatorEtaForward()->Fill(leadjeta);
939  v.getMEhisto_DenominatorPhiForward()->Fill(leadjphi);
940  }
941  if((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))){
942  v.getMEhisto_DenominatorEta_LowpTcut()->Fill(leadjeta);
943  v.getMEhisto_DenominatorPhi_LowpTcut()->Fill(leadjphi);
944  v.getMEhisto_DenominatorEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
945  }
946  if((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))){
947  v.getMEhisto_DenominatorEta_MedpTcut()->Fill(leadjeta);
948  v.getMEhisto_DenominatorPhi_MedpTcut()->Fill(leadjphi);
949  v.getMEhisto_DenominatorEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
950  }
951  if((leadjpt > trigHighpTcut && !isForward(leadjeta)) || (leadjpt > trigHighpTcutFwd && isForward(leadjeta))){
952  v.getMEhisto_DenominatorEta_HighpTcut()->Fill(leadjeta);
953  v.getMEhisto_DenominatorPhi_HighpTcut()->Fill(leadjphi);
954  v.getMEhisto_DenominatorEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
955  }
956 
957  //Numerator fill
958  if(numpassed){
959  //
960  double dRmin = 99999.;
961  double dPhimin = 9999.;
962  if(v.getPath().find("L1") != std::string::npos){
963  if ( l1Index >= triggerObj_->sizeFilters() ) {
964  edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
965  }
966  else {
967  const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
968  for(unsigned short ki : kl1){
969  double dR = deltaR(toc[ki].eta(), toc[ki].phi(), leadjeta, leadjphi);
970  if(dR < dRmin){
971  dRmin = dR;
972  }
973  }
974  }
975  }
976  else{
977  if ( hltIndex >= triggerObj_->sizeFilters() ) {
978  edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
979  }
980  else {
981  const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
982  auto kj = khlt.begin();
983  for(;kj != khlt.end(); ++kj){
984  double dR = deltaR(toc[*kj].eta(), toc[*kj].phi(),
985  leadjeta, leadjphi);
986  if(dR < dRmin){
987  dRmin = dR;
988  }
989  double dPhi = deltaPhi(toc[*kj].phi(), leadjphi);
990  if(dPhi < dPhimin){
991  dPhimin = dPhi;
992  }
993  }
994  //v->getMEhisto_DeltaPhi()->Fill(dPhimin);
995  v.getMEhisto_DeltaPhi()->Fill(dPhimin);
996  v.getMEhisto_DeltaR()->Fill(dRmin);
997  }
998  }
999  if(dRmin < 0.1 || (v.getPath().find("L1") != std::string::npos && dRmin < 0.4)){
1000  v.getMEhisto_NumeratorPt()->Fill(leadjpt);
1001  if (isBarrel(leadjeta)) v.getMEhisto_NumeratorPtBarrel()->Fill(leadjpt);
1002  if (isEndCap(leadjeta)) v.getMEhisto_NumeratorPtEndcap()->Fill(leadjpt);
1003  if (isForward(leadjeta)) v.getMEhisto_NumeratorPtForward()->Fill(leadjpt);
1004  v.getMEhisto_NumeratorEta()->Fill(leadjeta);
1005  v.getMEhisto_NumeratorPhi()->Fill(leadjphi);
1006  v.getMEhisto_NumeratorEtaPhi()->Fill(leadjeta,leadjphi);
1007  if (isBarrel(leadjeta)){
1008  v.getMEhisto_NumeratorEtaBarrel()->Fill(leadjeta);
1009  v.getMEhisto_NumeratorPhiBarrel()->Fill(leadjphi);
1010  }
1011  if (isEndCap(leadjeta)){
1012  v.getMEhisto_NumeratorEtaEndcap()->Fill(leadjeta);
1013  v.getMEhisto_NumeratorPhiEndcap()->Fill(leadjphi);
1014  }
1015  if (isForward(leadjeta)){
1016  v.getMEhisto_NumeratorEtaForward()->Fill(leadjeta);
1017  v.getMEhisto_NumeratorPhiForward()->Fill(leadjphi);
1018  }
1019  if((leadjpt > trigLowpTcut && !isForward(leadjeta)) || (leadjpt > trigLowpTcutFwd && isForward(leadjeta))){
1020  v.getMEhisto_NumeratorEta_LowpTcut()->Fill(leadjeta);
1021  v.getMEhisto_NumeratorPhi_LowpTcut()->Fill(leadjphi);
1022  v.getMEhisto_NumeratorEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
1023  }
1024  if((leadjpt > trigMedpTcut && !isForward(leadjeta)) || (leadjpt > trigMedpTcutFwd && isForward(leadjeta))){
1025  v.getMEhisto_NumeratorEta_MedpTcut()->Fill(leadjeta);
1026  v.getMEhisto_NumeratorPhi_MedpTcut()->Fill(leadjphi);
1027  v.getMEhisto_NumeratorEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
1028  }
1029  if((leadjpt > trigHighpTcut && !isForward(leadjeta)) || (leadjpt > trigHighpTcutFwd && isForward(leadjeta))){
1030  v.getMEhisto_NumeratorEta_HighpTcut()->Fill(leadjeta);
1031  v.getMEhisto_NumeratorPhi_HighpTcut()->Fill(leadjphi);
1032  v.getMEhisto_NumeratorEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
1033  }
1034  }
1035  }//numpassed
1036  }//CalojetID filter
1037  }
1038 
1039  if(jetIDbool == true && (v.getTriggerType() == "DiJet_Trigger") && calojet.size()>1){
1040  if(((CaloJetEMF[1] > _fEMF || std::abs(CaloJetEta[1]) > _feta) &&
1041  CaloJetfHPD[0] < _fHPD && CaloJetn90[0] > _n90Hits)){
1042  v.getMEhisto_DenominatorPt()->Fill((CaloJetPt[0] + CaloJetPt[1])/2.);
1043  v.getMEhisto_DenominatorEta()->Fill((CaloJetEta[0] + CaloJetEta[1])/2.);
1044  if(numpassed==true){
1045  v.getMEhisto_NumeratorPt()->Fill((CaloJetPt[0] + CaloJetPt[1])/2.);
1046  v.getMEhisto_NumeratorEta()->Fill((CaloJetEta[0] + CaloJetEta[1])/2.);
1047  }
1048  }
1049  }
1050  }// Jet trigger and valid jet collection
1051 
1052  //PFJet paths
1053  if(verbose_) std::cout << "fillMEforEffAllTrigger: PFJet -------------------" << std::endl;
1054  if(pfjetColl_.isValid() && (v.getObjectType() == trigger::TriggerJet)){
1055  //cout<<" - PFJet "<<endl;
1056  //&& (v->getPath().find("HLT_PFJet")!=std::string::npos)
1057  //&& (v->getPath().find("HLT_DiPFJet")!=std::string::npos)){
1058  bool jetIDbool = false;
1059  double leadjpt = PFJetPt[0];
1060  double leadjeta = PFJetEta[0];
1061  double leadjphi = PFJetPhi[0];
1062  double ljNHEF = PFJetNHEF[0];
1063  double ljCHEF = PFJetCHEF[0];
1064  double ljNEMF = PFJetNEMF[0];
1065  double ljCEMF = PFJetCEMF[0];
1066  //double sleadjpt = PFJetPt[1];
1067  //double sleadjeta = PFJetEta[1];
1068  //double sleadjphi = PFJetPhi[1];
1069  double sljNHEF = PFJetNHEF[1];
1070  double sljCHEF = PFJetCHEF[1];
1071  double sljNEMF = PFJetNEMF[1];
1072  double sljCEMF = PFJetCEMF[1];
1073  //
1074  double pfMHTx = pfMHTx_All;
1075  double pfMHTy = pfMHTy_All;
1076  //
1077  if((v.getTriggerType() == "SingleJet_Trigger") && !pfjet.empty()){ //this line stops the central jets
1078 
1079  //======get pfmht
1080  _pfMHT = sqrt(pfMHTx*pfMHTx + pfMHTy*pfMHTy);
1081  v.getMEhisto_DenominatorPFMHT()->Fill(_pfMHT);
1082 
1083  if( ljNHEF >= _min_NHEF && ljNHEF <= _max_NHEF
1084  && ljCHEF >= _min_CHEF && ljCHEF <= _max_CHEF
1085  && ljNEMF >= _min_NEMF && ljNEMF <= _max_NEMF
1086  && ljCEMF >= _min_CEMF && ljCEMF <= _max_CEMF){
1087  if(verbose_) cout<<"Passed PFJet ID -------------------" << endl;
1088  jetIDbool = true;
1089  v.getMEhisto_DenominatorPFPt()->Fill(leadjpt);
1090  if (isBarrel(leadjeta)) v.getMEhisto_DenominatorPFPtBarrel()->Fill(leadjpt);
1091  if (isEndCap(leadjeta)) v.getMEhisto_DenominatorPFPtEndcap()->Fill(leadjpt);
1092  if (isForward(leadjeta)) v.getMEhisto_DenominatorPFPtForward()->Fill(leadjpt);
1093  v.getMEhisto_DenominatorPFEta()->Fill(leadjeta);
1094  v.getMEhisto_DenominatorPFPhi()->Fill(leadjphi);
1095  v.getMEhisto_DenominatorPFEtaPhi()->Fill(leadjeta,leadjphi);
1096  if(isBarrel(leadjeta)){
1097  v.getMEhisto_DenominatorPFEtaBarrel()->Fill(leadjeta);
1098  v.getMEhisto_DenominatorPFPhiBarrel()->Fill(leadjphi);
1099  }
1100  if (isEndCap(leadjeta)){
1101  v.getMEhisto_DenominatorPFEtaEndcap()->Fill(leadjeta);
1102  v.getMEhisto_DenominatorPFPhiEndcap()->Fill(leadjphi);
1103  }
1104  if (isForward(leadjeta)){
1105  v.getMEhisto_DenominatorPFEtaForward()->Fill(leadjeta);
1106  v.getMEhisto_DenominatorPFPhiForward()->Fill(leadjphi);
1107  }
1108  if((leadjpt > trigLowpTPFcut && !isForward(leadjeta)) || (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))){
1109  v.getMEhisto_DenominatorPFEta_LowpTcut()->Fill(leadjeta);
1110  v.getMEhisto_DenominatorPFPhi_LowpTcut()->Fill(leadjphi);
1111  v.getMEhisto_DenominatorPFEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
1112  }
1113  if((leadjpt > trigMedpTPFcut && !isForward(leadjeta)) || (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))){
1114  v.getMEhisto_DenominatorPFEta_MedpTcut()->Fill(leadjeta);
1115  v.getMEhisto_DenominatorPFPhi_MedpTcut()->Fill(leadjphi);
1116  v.getMEhisto_DenominatorPFEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
1117  }
1118  if((leadjpt > trigHighpTPFcut && !isForward(leadjeta)) || (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))){
1119  v.getMEhisto_DenominatorPFEta_HighpTcut()->Fill(leadjeta);
1120  v.getMEhisto_DenominatorPFPhi_HighpTcut()->Fill(leadjphi);
1121  v.getMEhisto_DenominatorPFEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
1122  }
1123 
1124  //Numerator fill
1125  if(numpassed){
1126  double dRmin = 99999.;
1127  double dPhimin = 9999.;
1128  if(v.getPath().find("L1") != std::string::npos){
1129  if ( l1Index >= triggerObj_->sizeFilters() ) {
1130  edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
1131  }
1132  else{
1133  const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
1134  for(unsigned short ki : kl1){
1135  double dR = deltaR(toc[ki].eta(), toc[ki].phi(), leadjeta, leadjphi);
1136  if(dR < dRmin){
1137  dRmin = dR;
1138  }
1139  }
1140  }
1141  }
1142  else{
1143  if ( hltIndex >= triggerObj_->sizeFilters() ) {
1144  edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
1145  }
1146  else{
1147  const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
1148  for(unsigned short kj : khlt){
1149  double dR = deltaR(toc[kj].eta(), toc[kj].phi(), leadjeta, leadjphi);
1150  if(dR < dRmin){
1151  dRmin = dR;
1152  }
1153  double dPhi = deltaPhi(toc[kj].phi(), leadjphi);
1154  if(dPhi < dPhimin){
1155  dPhimin = dPhi;
1156  }
1157  }
1158  v.getMEhisto_PFDeltaPhi()->Fill(dPhimin);
1159  v.getMEhisto_PFDeltaR()->Fill(dRmin);
1160  }
1161  }
1162  if(dRmin < 0.1 || (v.getPath().find("L1") != std::string::npos && dRmin < 0.4)){
1163  v.getMEhisto_NumeratorPFPt()->Fill(leadjpt);
1164  if (isBarrel(leadjeta)) v.getMEhisto_NumeratorPFPtBarrel()->Fill(leadjpt);
1165  if (isEndCap(leadjeta)) v.getMEhisto_NumeratorPFPtEndcap()->Fill(leadjpt);
1166  if (isForward(leadjeta)) v.getMEhisto_NumeratorPFPtForward()->Fill(leadjpt);
1167  v.getMEhisto_NumeratorPFEta()->Fill(leadjeta);
1168  v.getMEhisto_NumeratorPFPhi()->Fill(leadjphi);
1169  v.getMEhisto_NumeratorPFEtaPhi()->Fill(leadjeta,leadjphi);
1170  if (isBarrel(leadjeta)){
1171  v.getMEhisto_NumeratorPFEtaBarrel()->Fill(leadjeta);
1172  v.getMEhisto_NumeratorPFPhiBarrel()->Fill(leadjphi);
1173  }
1174  if (isEndCap(leadjeta)){
1175  v.getMEhisto_NumeratorPFEtaEndcap()->Fill(leadjeta);
1176  v.getMEhisto_NumeratorPFPhiEndcap()->Fill(leadjphi);
1177  }
1178  if (isForward(leadjeta)){
1179  v.getMEhisto_NumeratorPFEtaForward()->Fill(leadjeta);
1180  v.getMEhisto_NumeratorPFPhiForward()->Fill(leadjphi);
1181  }
1182  if((leadjpt > trigLowpTPFcut && !isForward(leadjeta))
1183  || (leadjpt > trigLowpTPFcutFwd && isForward(leadjeta))){
1184  v.getMEhisto_NumeratorPFEta_LowpTcut()->Fill(leadjeta);
1185  v.getMEhisto_NumeratorPFPhi_LowpTcut()->Fill(leadjphi);
1186  v.getMEhisto_NumeratorPFEtaPhi_LowpTcut()->Fill(leadjeta,leadjphi);
1187  }
1188  if((leadjpt > trigMedpTPFcut && !isForward(leadjeta))
1189  || (leadjpt > trigMedpTPFcutFwd && isForward(leadjeta))){
1190  v.getMEhisto_NumeratorPFEta_MedpTcut()->Fill(leadjeta);
1191  v.getMEhisto_NumeratorPFPhi_MedpTcut()->Fill(leadjphi);
1192  v.getMEhisto_NumeratorPFEtaPhi_MedpTcut()->Fill(leadjeta,leadjphi);
1193  }
1194  if((leadjpt > trigHighpTPFcut && !isForward(leadjeta))
1195  || (leadjpt > trigHighpTPFcutFwd && isForward(leadjeta))){
1196  v.getMEhisto_NumeratorPFEta_HighpTcut()->Fill(leadjeta);
1197  v.getMEhisto_NumeratorPFPhi_HighpTcut()->Fill(leadjphi);
1198  v.getMEhisto_NumeratorPFEtaPhi_HighpTcut()->Fill(leadjeta,leadjphi);
1199  }
1200  }
1201  }
1202  }
1203  }
1204  if(jetIDbool == true && (v.getTriggerType() == "DiJet_Trigger") && pfjet.size()>1){
1205  if( ljNHEF >= _min_NHEF && ljNHEF <= _max_NHEF
1206  && ljCHEF >= _min_CHEF && ljCHEF <= _max_CHEF
1207  && ljNEMF >= _min_NEMF && ljNEMF <= _max_NEMF
1208  && ljCEMF >= _min_CEMF && ljCEMF <= _max_CEMF
1209  && sljNHEF >= _min_NHEF && sljNHEF <= _max_NHEF
1210  && sljCHEF >= _min_CHEF && sljCHEF <= _max_CHEF
1211  && sljNEMF >= _min_NEMF && sljNEMF <= _max_NEMF
1212  && sljCEMF >= _min_CEMF && sljCEMF <= _max_CEMF ){
1213  v.getMEhisto_DenominatorPFPt()->Fill((PFJetPt[0] + PFJetPt[1])/2.);
1214  v.getMEhisto_DenominatorPFEta()->Fill((PFJetEta[0] + PFJetEta[1])/2.);
1215  if(numpassed){
1216  v.getMEhisto_NumeratorPFPt()->Fill((PFJetPt[0] + PFJetPt[1])/2.);
1217  v.getMEhisto_NumeratorPFEta()->Fill((PFJetEta[0] + PFJetEta[1])/2.);
1218  }
1219  }
1220  }
1221  }// PF Jet trigger and valid jet collection
1222 
1223  //CaloMET path
1224  if(verbose_) std::cout << "fillMEforEffAllTrigger: CaloMET -------------------" << std::endl;
1225  if(calometColl_.isValid()
1226  && ((v.getObjectType() == trigger::TriggerMET) || (v.getObjectType() == trigger::TriggerTET))
1227  && (v.getPath().find("HLT_PFMET")==std::string::npos)){
1228  const CaloMETCollection *calometcol = calometColl_.product();
1229  const CaloMET met = calometcol->front();
1230  v.getMEhisto_DenominatorPt()->Fill(met.et());
1231  v.getMEhisto_DenominatorPhi()->Fill(met.phi());
1232  if(numpassed){
1233  v.getMEhisto_NumeratorPt()->Fill(met.et());
1234  v.getMEhisto_NumeratorPhi()->Fill(met.phi());
1235  if(hltIndex >= triggerObj_->sizeFilters()){
1236  edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
1237  }
1238  else{
1239  double dPhimin = 9999.;//
1240  const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
1241  for(unsigned short kj : khlt){
1242  double dPhi = deltaPhi(toc[kj].phi(), met.phi());
1243  if(dPhi < dPhimin){
1244  dPhimin = dPhi;
1245  }
1246  }
1247  v.getMEhisto_DeltaPhi()->Fill(dPhimin);
1248  }
1249  }
1250  }
1251 
1252  //PFMET
1253  if(verbose_) std::cout << "fillMEforEffAllTrigger: PFMET -------------------" << std::endl;
1254  if(pfmetColl_.isValid()
1255  && ((v.getObjectType() == trigger::TriggerMET) || (v.getObjectType() == trigger::TriggerTET))
1256  && (v.getPath().find("HLT_PFMET")!=std::string::npos)){
1257  const PFMETCollection *pfmetcol = pfmetColl_.product();
1258  const PFMET met = pfmetcol->front();
1259  v.getMEhisto_DenominatorPt()->Fill(met.et());
1260  v.getMEhisto_DenominatorPhi()->Fill(met.phi());
1261  if(numpassed){
1262  v.getMEhisto_NumeratorPt()->Fill(met.et());
1263  v.getMEhisto_NumeratorPhi()->Fill(met.phi());
1264  if(hltIndex >= triggerObj_->sizeFilters()){
1265  edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
1266  }
1267  else{
1268  double dPhimin = 9999.;//
1269  const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
1270  for(unsigned short kj : khlt){
1271  double dPhi = deltaPhi(toc[kj].phi(), met.phi());
1272  if(dPhi < dPhimin){
1273  dPhimin = dPhi;
1274  }
1275  }
1276  v.getMEhisto_DeltaPhi()->Fill(dPhimin);
1277  }
1278  }
1279  }
1280 
1281  /*
1282  if(pfmhtColl_.isValid() && ((v->getObjectType() == trigger::TriggerMET)|| (v->getObjectType() == trigger::TriggerTET))){
1283  const PFMHTCollection *pfmhtcol = pfmhtColl_.product();
1284  const PFMHT met = pfmhtcol->front();
1285  v->getMEhisto_DenominatorPFPt()->Fill(met.pt());
1286  v->getMEhisto_DenominatorPFPhi()->Fill(met.phi());
1287  }// PFMHT trigger and valid MET collection
1288  */
1289  }// trigger under study
1290 }
1291 
1292 //------------------------------------------------------------------------//
1293 //This method is called before the booking action in the DQMStore is triggered.
1294 void
1296 {
1297 
1298  if(!isSetup_){
1299 
1300  //--- htlConfig_
1301  bool changed(true);
1302  if (!hltConfig_.init(run, c, processname_, changed)) {
1303  LogDebug("HLTJetMETDQMSource") << "HLTConfigProvider failed to initialize.";
1304  }
1305 
1306  /*
1307  Here we select the Single Jet, DiJet, MET trigger. SingleJet and DiJet trigger are saved under same object type "TriggerJet".
1308  We can easily separate out single and di jet trigger later. For the first trigger in the list, denominator trigger is dummy
1309  (empty) whereas for other triggers denom is previous trigger of same type. e.g. SingleJet50 has singleJet30 as denominator.
1310  */
1311 
1312  const unsigned int n(hltConfig_.size());
1313  int singleJet = 0;
1314  int diJet = 0;
1315  int met = 0;
1316  int tet = 0;
1317  for (unsigned int i=0; i!=n; ++i) {
1318  bool denomFound = false;
1319  bool numFound = false;
1320  bool checkPath = false;
1321 
1322  //Look for paths if "path name fraction" is found in the pathname
1323  std::string pathname = hltConfig_.triggerName(i);
1324  //Filter only paths JetMET triggers are interested in
1325  auto controlPathname = pathFilter_.begin();
1326  for(;controlPathname!=pathFilter_.end(); ++controlPathname){
1327  if(pathname.find((*controlPathname)) != std::string::npos){
1328  checkPath = true;
1329  break;
1330  }
1331  }
1332  if(checkPath==false) continue;
1333 
1334  //Reject if keyword(s) is found in the pathname
1335  auto rejectPathname = pathRejectKeyword_.begin();
1336  for(; rejectPathname!=pathRejectKeyword_.end();++rejectPathname){
1337  if(pathname.find((*rejectPathname)) != std::string::npos){
1338  checkPath = false;
1339  break;
1340  }
1341  }
1342  if(checkPath==false) continue;
1343 
1344  //
1345  if(verbose_) cout<<"==pathname=="<<pathname<<endl;
1346  std::string dpathname = MuonTrigPaths_[0];
1347  std::string l1pathname = "dummy";
1348  std::string denompathname = "";
1349  unsigned int usedPrescale = 1;
1350  unsigned int objectType = 0;
1351  std::string triggerType = "";
1352  std::string filtername("dummy");
1353  std::string Denomfiltername("denomdummy");
1354 
1355  if(pathname.find("Jet") != std::string::npos
1356  && !(pathname.find("DoubleJet") != std::string::npos)
1357  && !(pathname.find("DiJet") != std::string::npos)
1358  && !(pathname.find("DiPFJet") != std::string::npos)
1359  && !(pathname.find("BTag") != std::string::npos)
1360  && !(pathname.find("Mu") != std::string::npos)
1361  && !(pathname.find("Fwd") != std::string::npos)){
1362  triggerType = "SingleJet_Trigger";
1363  objectType = trigger::TriggerJet;
1364  }
1365  if(pathname.find("DiJet") != std::string::npos
1366  || pathname.find("DiPFJet") != std::string::npos
1367  || pathname.find("DoubleJet") != std::string::npos){
1368  triggerType = "DiJet_Trigger";
1369  objectType = trigger::TriggerJet;
1370  }
1371  if(pathname.find("MET") != std::string::npos){
1372  triggerType = "MET_Trigger";
1373  objectType = trigger::TriggerMET;
1374  }
1375  if(pathname.find("HT") != std::string::npos) {
1376  triggerType = "TET_Trigger";
1377  objectType = trigger::TriggerTET;
1378  }
1379 
1380  //
1381  if(objectType == trigger::TriggerJet
1382  && !(pathname.find("DiJet") != std::string::npos)
1383  && !(pathname.find("DiPFJet") != std::string::npos)
1384  && !(pathname.find("DoubleJet") != std::string::npos)){
1385  singleJet++;
1386  if(singleJet > 1) dpathname = dpathname = hltConfig_.triggerName(i-1);
1387  if(singleJet == 1) dpathname = MuonTrigPaths_[0];
1388  }
1389  if(objectType == trigger::TriggerJet
1390  && ((pathname.find("DiJet") != std::string::npos)
1391  || (pathname.find("DiPFJet") != std::string::npos))){
1392  diJet++;
1393  if(diJet > 1) dpathname = dpathname = hltConfig_.triggerName(i-1);
1394  if(diJet == 1) dpathname = MuonTrigPaths_[0];
1395  }
1396  if(objectType == trigger::TriggerMET ){
1397  met++;
1398  if(met > 1) dpathname = dpathname = hltConfig_.triggerName(i-1);
1399  if(met == 1) dpathname = MuonTrigPaths_[0];
1400  }
1401  if(objectType == trigger::TriggerTET ){
1402  tet++;
1403  if(tet > 1) dpathname = dpathname = hltConfig_.triggerName(i-1);
1404  if(tet == 1) dpathname = MuonTrigPaths_[0];
1405  }
1406 
1407  // find L1 condition for numpath with numpath objecttype
1408  // find PSet for L1 global seed for numpath,sss
1409  // list module labels for numpath
1410 
1411  // Checking if the trigger exist in HLT table or not
1412  for (unsigned int i=0; i!=n; ++i){
1413  std::string HLTname = hltConfig_.triggerName(i);
1414  if(HLTname == pathname) numFound = true;
1415  if(HLTname == dpathname) denomFound = true;
1416  }
1417 
1418  if(numFound){ //make trigger exist in the menu
1419  //ml needs change l1pathname
1420  l1pathname = getL1ConditionModuleName(pathname); //ml added L1conditionmodulename
1421  //ml added
1422  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
1423  for(auto & numpathmodule : numpathmodules) {
1424  edm::InputTag testTag(numpathmodule,"",processname_);
1425  if ((hltConfig_.moduleType(numpathmodule) == "HLT1CaloJet")
1426  || (hltConfig_.moduleType(numpathmodule) == "HLT1PFJet")
1427  || (hltConfig_.moduleType(numpathmodule) == "HLTDiJetAveFilter")
1428  || (hltConfig_.moduleType(numpathmodule) == "HLTDiPFJetAveFilter")
1429  || (hltConfig_.moduleType(numpathmodule) == "HLT1CaloMET")
1430  || (hltConfig_.moduleType(numpathmodule) == "HLTMhtFilter")
1431  || (hltConfig_.moduleType(numpathmodule) == "HLTPrescaler"))
1432  filtername = numpathmodule;
1433  }
1434  }
1435 
1436  if(objectType != 0 && denomFound){
1437  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
1438  for(auto & numpathmodule : numpathmodules) {
1439  edm::InputTag testTag(numpathmodule,"",processname_);
1440  if ((hltConfig_.moduleType(numpathmodule) == "HLT1CaloJet")
1441  || (hltConfig_.moduleType(numpathmodule) == "HLT1PFJet")
1442  || (hltConfig_.moduleType(numpathmodule) == "HLTDiJetAveFilter")
1443  || (hltConfig_.moduleType(numpathmodule) == "HLTDiPFJetAveFilter")
1444  || (hltConfig_.moduleType(numpathmodule) == "HLT1CaloMET" )
1445  || (hltConfig_.moduleType(numpathmodule) == "HLTMhtFilter")
1446  || (hltConfig_.moduleType(numpathmodule) == "HLTPrescaler") )
1447  Denomfiltername = numpathmodule;
1448  }
1449  }
1450 
1451  if(objectType != 0 && numFound){
1452  if(verbose_)
1453  cout<<"=Pathname= "<<pathname
1454  <<" | =Denompath= "<<dpathname
1455  <<" | =Filtername= "<<filtername
1456  <<" | =Denomfiltername= "<<Denomfiltername
1457  <<" | =L1pathname= "<<l1pathname
1458  <<" | =ObjectType= "<<objectType<<endl;
1459  if(!((pathname.find("HT") != std::string::npos) || (pathname.find("Quad") != std::string::npos))){
1460  hltPathsAll_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
1461  if(!nameForEff_ && denomFound) hltPathsEff_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname,
1462  filtername, Denomfiltername, processname_, objectType, triggerType));
1463  }
1464  hltPathsAllTriggerSummary_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname,
1465  filtername, Denomfiltername, processname_, objectType, triggerType));
1466  }
1467  } //Loop over paths
1468 
1469  if (verbose_) cout << "get names for efficicncy------------------"<< endl;
1470  //---------bool to pick trigger names pair from config file-------------
1471  if(nameForEff_){
1472  std::string l1pathname = "dummy";
1473  std::string denompathname = "";
1474  unsigned int usedPrescale = 1;
1475  unsigned int objectType = 0;
1476  std::string triggerType = "";
1477  std::string filtername("dummy");
1478  std::string Denomfiltername("denomdummy");
1479  for (auto & custompathnamepair : custompathnamepairs_){
1480  std::string pathname = custompathnamepair.first;
1481  std::string dpathname = custompathnamepair.second;
1482  bool numFound = false;
1483  bool denomFound = false;
1484  // Checking if the trigger exist in HLT table or not
1485  for (unsigned int i=0; i!=n; ++i) {
1486  std::string HLTname = hltConfig_.triggerName(i);
1487  if(HLTname.find(pathname)!=std::string::npos){numFound = true; pathname = HLTname;} //changed to get versions
1488  if(HLTname.find(dpathname)!=std::string::npos){denomFound = true; dpathname = HLTname;}
1489  }
1490  if(numFound && denomFound){
1491  if (pathname.find("Jet") != std::string::npos
1492  && !(pathname.find("DiJet") != std::string::npos)
1493  && !(pathname.find("DiPFJet") != std::string::npos)
1494  && !(pathname.find("DoubleJet") != std::string::npos)
1495  && !(pathname.find("BTag") != std::string::npos)
1496  && !(pathname.find("Mu") != std::string::npos)
1497  && !(pathname.find("Fwd") != std::string::npos)){
1498  triggerType = "SingleJet_Trigger";
1499  objectType = trigger::TriggerJet;
1500  }
1501  if (pathname.find("DiJet") != std::string::npos
1502  || pathname.find("DiPFJet") != std::string::npos
1503  || pathname.find("DoubleJet") != std::string::npos ){
1504  triggerType = "DiJet_Trigger";
1505  objectType = trigger::TriggerJet;
1506  }
1507  if (pathname.find("MET") != std::string::npos ){
1508  triggerType = "MET_Trigger";
1509  objectType = trigger::TriggerMET;
1510  }
1511  if (pathname.find("TET") != std::string::npos ){
1512  triggerType = "TET_Trigger";
1513  objectType = trigger::TriggerTET;
1514  }
1515 
1516  l1pathname = getL1ConditionModuleName(pathname); //ml added L1conditionmodulename
1517  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
1518  for(auto & numpathmodule : numpathmodules) {
1519  edm::InputTag testTag(numpathmodule,"",processname_);
1520  if ((hltConfig_.moduleType(numpathmodule) == "HLT1CaloJet")
1521  || (hltConfig_.moduleType(numpathmodule) == "HLT1PFJet")
1522  || (hltConfig_.moduleType(numpathmodule) == "HLTDiJetAveFilter")
1523  || (hltConfig_.moduleType(numpathmodule) == "HLTDiPFJetAveFilter")
1524  || (hltConfig_.moduleType(numpathmodule) == "HLT1CaloMET" )
1525  || (hltConfig_.moduleType(numpathmodule) == "HLTMhtFilter")
1526  || (hltConfig_.moduleType(numpathmodule) == "HLTPrescaler") )
1527  filtername = numpathmodule;
1528  }
1529 
1530  if(objectType != 0){
1531  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
1532  for(auto & numpathmodule : numpathmodules) {
1533  edm::InputTag testTag(numpathmodule,"",processname_);
1534  if ((hltConfig_.moduleType(numpathmodule) == "HLT1CaloJet")
1535  || (hltConfig_.moduleType(numpathmodule) == "HLT1PFJet")
1536  || (hltConfig_.moduleType(numpathmodule) == "HLTDiJetAveFilter")
1537  || (hltConfig_.moduleType(numpathmodule) == "HLTDiPFJetAveFilter")
1538  || (hltConfig_.moduleType(numpathmodule) == "HLT1CaloMET" )
1539  || (hltConfig_.moduleType(numpathmodule) == "HLTMhtFilter")
1540  || (hltConfig_.moduleType(numpathmodule) == "HLTPrescaler") )
1541  Denomfiltername = numpathmodule;
1542  }
1543 
1544  if(verbose_)cout<<"==pathname=="<<pathname
1545  <<"==denompath=="<<dpathname
1546  <<"==filtername=="<<filtername
1547  <<"==denomfiltername=="<<Denomfiltername
1548  <<"==l1pathname=="<<l1pathname
1549  <<"==objectType=="<<objectType<<endl;
1550  hltPathsEff_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname,
1551  filtername, Denomfiltername, processname_, objectType, triggerType));
1552  }
1553  }
1554  }
1555  }
1556 
1557  if(verbose_)cout<<"== end hltPathsEff_.push_back ======" << endl;
1558 
1559  }
1560 }
1561 
1562 //------------------------------------------------------------------------//
1563 void
1565 {
1566 
1567  if(!isSetup_){
1568 
1569  iBooker.setCurrentFolder(dirname_);
1570 
1571  //-----------------------------------------------------------------
1572  //---book trigger summary histos
1573  if(!isSetup_){
1574  std::string foldernm = "/TriggerSummary/";
1575  iBooker.setCurrentFolder(dirname_ + foldernm);
1576 
1577  int TrigBins_ = hltPathsAllTriggerSummary_.size();
1578  double TrigMin_ = -0.5;
1579  double TrigMax_ = hltPathsAllTriggerSummary_.size()-0.5;
1580 
1581  std::string histonm="JetMET_TriggerRate";
1582  std::string histot="JetMET TriggerRate Summary";
1583  rate_All = iBooker.book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
1584 
1585  histonm = "JetMET_TriggerRate_Correlation";
1586  histot = "JetMET TriggerRate Correlation Summary;y&&!x;x&&y";
1587  correlation_All = iBooker.book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
1588 
1589  histonm = "JetMET_NVertices";
1590  histot = "No. of vertices";
1591  NVertices = iBooker.book1D(histonm.c_str(),histot.c_str(),100,0,50);
1592 
1593  histonm = "JetMET_PVZ";
1594  histot = "Primary Vertex Z pos";
1595  PVZ = iBooker.book1D(histonm.c_str(),histot.c_str(),100,-50.,50.);
1596 
1597  if(runStandalone_){
1598  histonm="JetMET_TriggerRate_WrtMuTrigger";
1599  histot="JetMET TriggerRate Summary Wrt Muon Trigger ";
1600  rate_AllWrtMu = iBooker.book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
1601 
1602  histonm="JetMET_TriggerRate_Correlation_WrtMuTrigger";
1603  histot="JetMET TriggerRate Correlation Summary Wrt Muon Trigger;y&&!x;x&&y";
1604  correlation_AllWrtMu = iBooker.book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
1605 
1606  histonm="JetMET_TriggerRate_WrtMBTrigger";
1607  histot="JetMET TriggerRate Summary Wrt MB Trigger";
1608  rate_AllWrtMB = iBooker.book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
1609 
1610  histonm="JetMET_TriggerRate_Correlation_WrtMBTrigger";
1611  histot="JetMET TriggerRate Correlation Wrt MB Trigger;y&&!x;x&&y";
1612  correlation_AllWrtMB = iBooker.book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
1613  }
1614  isSetup_ = true;
1615  }
1616  //---Set bin label
1617 
1618  for(auto & v : hltPathsAllTriggerSummary_){
1619  std::string labelnm("dummy");
1620  labelnm = v.getPath();
1621  int nbins = rate_All->getTH1()->GetNbinsX();
1622  for(int ibin=1; ibin<nbins+1; ibin++){
1623  const char * binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
1624  std::string binLabel_str = string(binLabel);
1625  if(binLabel_str==labelnm)break;
1626  if(binLabel[0]=='\0'){
1627  rate_All->setBinLabel(ibin,labelnm);
1628  correlation_All->setBinLabel(ibin,labelnm,1);
1629  correlation_All->setBinLabel(ibin,labelnm,2);
1630  if(runStandalone_){
1631  rate_AllWrtMu->setBinLabel(ibin,labelnm);
1632  rate_AllWrtMB->setBinLabel(ibin,labelnm);
1633  correlation_AllWrtMu->setBinLabel(ibin,labelnm,1);
1634  correlation_AllWrtMB->setBinLabel(ibin,labelnm,1);
1635  correlation_AllWrtMu->setBinLabel(ibin,labelnm,2);
1636  correlation_AllWrtMB->setBinLabel(ibin,labelnm,2);
1637  }
1638  break;
1639  }
1640  }
1641  }
1642 
1643  // Now define histos for All triggers
1644  if(plotAll_){
1645  //
1646  int Nbins_ = 10;
1647  double Nmin_ = -0.5;
1648  double Nmax_ = 9.5;
1649  //
1650  int Ptbins_ = 100;
1651  if(runStandalone_) Ptbins_ = 1000;
1652  double PtMin_ = 0.;
1653  double PtMax_ = 1000.;
1654  //
1655  int Etabins_ = 50;
1656  if(runStandalone_) Etabins_ = 100;
1657  double EtaMin_ = -5.;
1658  double EtaMax_ = 5.;
1659  //
1660  int Phibins_ = 35;
1661  double PhiMin_ = -3.5;
1662  double PhiMax_ = 3.5;
1663 
1664  int Resbins_ = 30;
1665  double ResMin_ = -1.5;
1666  double ResMax_ = 1.5;
1667  //
1668  std::string dirName = dirname_ + "/MonitorAllTriggers/";
1669  for(auto & v : hltPathsAll_){
1670  //
1671  std::string trgPathName = HLTConfigProvider::removeVersion(v.getPath());
1672  std::string subdirName = dirName + trgPathName;
1673  std::string trigPath = "("+trgPathName+")";
1674  iBooker.setCurrentFolder(subdirName);
1675 
1676  std::string labelname("ME");
1677  std::string histoname(labelname+"");
1678  std::string title(labelname+"");
1679 
1681  dummy = iBooker.bookFloat("dummy");
1682 
1683  if(v.getObjectType() == trigger::TriggerJet && v.getTriggerType() == "SingleJet_Trigger"){
1684 
1685  histoname = labelname+"_recObjN";
1686  title = labelname+"_recObjN;Reco multiplicity()"+trigPath;
1687  MonitorElement * N = iBooker.book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
1688  N->getTH1();
1689 
1690  histoname = labelname+"_recObjPt";
1691  title = labelname+"_recObjPt; Reco Pt[GeV/c]"+trigPath;
1692  MonitorElement * Pt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1693  Pt->getTH1();
1694 
1695  histoname = labelname+"_recObjPtBarrel";
1696  title = labelname+"_recObjPtBarrel;Reco Pt[GeV/c]"+trigPath;
1697  MonitorElement * PtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1698  PtBarrel->getTH1();
1699 
1700  histoname = labelname+"_recObjPtEndcap";
1701  title = labelname+"_recObjPtEndcap;Reco Pt[GeV/c]"+trigPath;
1702  MonitorElement * PtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1703  PtEndcap->getTH1();
1704 
1705  histoname = labelname+"_recObjPtForward";
1706  title = labelname+"_recObjPtForward;Reco Pt[GeV/c]"+trigPath;
1707  MonitorElement * PtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1708  PtForward->getTH1();
1709 
1710  histoname = labelname+"_recObjEta";
1711  title = labelname+"_recObjEta;Reco #eta"+trigPath;
1712  MonitorElement * Eta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1713  Eta->getTH1();
1714 
1715  histoname = labelname+"_recObjPhi";
1716  title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
1717  MonitorElement * Phi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1718  Phi->getTH1();
1719 
1720  histoname = labelname+"_recObjEtaPhi";
1721  title = labelname+"_recObjEtaPhi;Reco #eta;Reco #Phi"+trigPath;
1722  MonitorElement * EtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
1723  EtaPhi->getTH1();
1724 
1725  histoname = labelname+"_l1ObjPt";
1726  title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
1727  MonitorElement * Pt_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1728  Pt_L1->getTH1();
1729 
1730  histoname = labelname+"_l1ObjEta";
1731  title = labelname+"_l1ObjEta;L1 #eta"+trigPath;
1732  MonitorElement * Eta_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1733  Eta_L1->getTH1();
1734 
1735  histoname = labelname+"_l1ObjPhi";
1736  title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
1737  MonitorElement * Phi_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1738  Phi_L1->getTH1();
1739 
1740  histoname = labelname+"_l1ObjEtaPhi";
1741  title = labelname+"_l1ObjEtaPhi;L1 #eta;L1 #Phi"+trigPath;
1742  MonitorElement * EtaPhi_L1 = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
1743  EtaPhi_L1->getTH1();
1744 
1745  histoname = labelname+"_l1ObjN";
1746  title = labelname+"_l1ObjN;L1 multiplicity"+trigPath;
1747  MonitorElement * N_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
1748  N_L1->getTH1();
1749 
1750  histoname = labelname+"_l1ObjPtBarrel";
1751  title = labelname+"_l1ObjPtBarrel;L1 Pt[GeV/c]"+trigPath;
1752  MonitorElement * PtBarrel_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1753  PtBarrel_L1->getTH1();
1754 
1755  histoname = labelname+"_l1ObjPtEndcap";
1756  title = labelname+"_l1ObjPtEndcap;L1 Pt[GeV/c]"+trigPath;
1757  MonitorElement * PtEndcap_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1758  PtEndcap_L1->getTH1();
1759 
1760  histoname = labelname+"_l1ObjPtForward";
1761  title = labelname+"_l1ObjPtForward;L1 Pt[GeV/c]"+trigPath;
1762  MonitorElement * PtForward_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1763  PtForward_L1->getTH1();
1764 
1765  histoname = labelname+"_hltObjN";
1766  title = labelname+"_hltObjN;HLT multiplicity"+trigPath;
1767  MonitorElement * N_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
1768  N_HLT->getTH1();
1769 
1770  histoname = labelname+"_hltObjPtBarrel";
1771  title = labelname+"_hltObjPtBarrel;HLT Pt[GeV/c]"+trigPath;
1772  MonitorElement * PtBarrel_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1773  PtBarrel_HLT->getTH1();
1774 
1775  histoname = labelname+"_hltObjPtEndcap";
1776  title = labelname+"_hltObjPtEndcap;HLT Pt[GeV/c]"+trigPath;
1777  MonitorElement * PtEndcap_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1778  PtEndcap_HLT->getTH1();
1779 
1780  histoname = labelname+"_hltObjPtForward";
1781  title = labelname+"_hltObjPtForward;HLT Pt[GeV/c]"+trigPath;
1782  MonitorElement * PtForward_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1783  PtForward_HLT->getTH1();
1784 
1785  histoname = labelname+"_hltObjPt";
1786  title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
1787  MonitorElement * Pt_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1788  Pt_HLT->getTH1();
1789 
1790  histoname = labelname+"_hltObjEta";
1791  title = labelname+"_hltObjEta;HLT #eta"+trigPath;
1792  MonitorElement * Eta_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1793  Eta_HLT->getTH1();
1794 
1795  histoname = labelname+"_hltObjPhi";
1796  title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
1797  MonitorElement * Phi_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1798  Phi_HLT->getTH1();
1799 
1800  histoname = labelname+"_hltObjEtaPhi";
1801  title = labelname+"_hltObjEtaPhi;HLT #eta;HLT #Phi"+trigPath;
1802  MonitorElement * EtaPhi_HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
1803  EtaPhi_HLT->getTH1();
1804 
1805  histoname = labelname+"_l1HLTPtResolution";
1806  title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
1807  MonitorElement * PtResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1808  PtResolution_L1HLT->getTH1();
1809 
1810  histoname = labelname+"_l1HLTEtaResolution";
1811  title = labelname+"_l1HLTEtaResolution;#eta(L1)-#eta(HLT)"+trigPath;
1812  MonitorElement * EtaResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1813  EtaResolution_L1HLT->getTH1();
1814 
1815  histoname = labelname+"_l1HLTPhiResolution";
1816  title = labelname+"_l1HLTPhiResolution;#Phi(L1)-#Phi(HLT)"+trigPath;
1817  MonitorElement * PhiResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1818  PhiResolution_L1HLT->getTH1();
1819 
1820  histoname = labelname+"_l1HLTPtCorrelation";
1821  title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
1822  MonitorElement * PtCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
1823  PtCorrelation_L1HLT->getTH1();
1824 
1825  histoname = labelname+"_l1HLTEtaCorrelation";
1826  title = labelname+"_l1HLTEtaCorrelation;#eta(L1);#eta(HLT)"+trigPath;
1827  MonitorElement * EtaCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
1828  EtaCorrelation_L1HLT->getTH1();
1829 
1830  histoname = labelname+"_l1HLTPhiCorrelation";
1831  title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
1832  MonitorElement * PhiCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
1833  PhiCorrelation_L1HLT->getTH1();
1834 
1835  histoname = labelname+"_hltRecObjPtResolution";
1836  title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
1837  MonitorElement * PtResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1838  PtResolution_HLTRecObj->getTH1();
1839 
1840  histoname = labelname+"_hltRecObjEtaResolution";
1841  title = labelname+"_hltRecObjEtaResolution;#eta(HLT)-#eta(Reco)"+trigPath;
1842  MonitorElement * EtaResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1843  EtaResolution_HLTRecObj->getTH1();
1844 
1845  histoname = labelname+"_hltRecObjPhiResolution";
1846  title = labelname+"_hltRecObjPhiResolution;#Phi(HLT)-#Phi(Reco)"+trigPath;
1847  MonitorElement * PhiResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1848  PhiResolution_HLTRecObj->getTH1();
1849 
1850  histoname = labelname+"_hltRecObjPtCorrelation";
1851  title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
1852  MonitorElement * PtCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
1853  PtCorrelation_HLTRecObj->getTH1();
1854 
1855  histoname = labelname+"_hltRecObjEtaCorrelation";
1856  title = labelname+"_hltRecObjEtaCorrelation;#eta(HLT);#eta(Reco)"+trigPath;
1857  MonitorElement * EtaCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
1858  EtaCorrelation_HLTRecObj->getTH1();
1859 
1860  histoname = labelname+"_hltRecObjPhiCorrelation";
1861  title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
1862  MonitorElement * PhiCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
1863  PhiCorrelation_HLTRecObj->getTH1();
1864 
1865  v.setHistos(N,
1866  Pt,
1867  PtBarrel,
1868  PtEndcap,
1869  PtForward,
1870  Eta,
1871  Phi,
1872  EtaPhi,
1873  N_L1,
1874  Pt_L1,
1875  PtBarrel_L1,
1876  PtEndcap_L1,
1877  PtForward_L1,
1878  Eta_L1,
1879  Phi_L1,
1880  EtaPhi_L1,
1881  N_HLT,
1882  Pt_HLT,
1883  PtBarrel_HLT,
1884  PtEndcap_HLT,
1885  PtForward_HLT,
1886  Eta_HLT,
1887  Phi_HLT,
1888  EtaPhi_HLT,
1889  PtResolution_L1HLT,
1890  EtaResolution_L1HLT,
1891  PhiResolution_L1HLT,
1892  PtResolution_HLTRecObj,
1893  EtaResolution_HLTRecObj,
1894  PhiResolution_HLTRecObj,
1895  PtCorrelation_L1HLT,
1896  EtaCorrelation_L1HLT,
1897  PhiCorrelation_L1HLT,
1898  PtCorrelation_HLTRecObj,
1899  EtaCorrelation_HLTRecObj,
1900  PhiCorrelation_HLTRecObj,
1901  dummy,
1902  dummy,
1903  dummy,
1904  dummy,
1905  dummy,
1906  dummy,
1907  dummy,
1908  dummy,
1909  dummy
1910  );
1911  }// histos for SingleJet Triggers
1912 
1913  if(v.getObjectType() == trigger::TriggerJet && v.getTriggerType() == "DiJet_Trigger"){
1914 
1915  histoname = labelname+"_RecObjAveragePt";
1916  title = labelname+"_RecObjAveragePt;Reco Average Pt[GeV/c]"+trigPath;
1917  MonitorElement * jetAveragePt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1918  jetAveragePt->getTH1();
1919 
1920  histoname = labelname+"_RecObjAverageEta";
1921  title = labelname+"_RecObjAverageEta;Reco Average #eta"+trigPath;
1922  MonitorElement * jetAverageEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1923  jetAverageEta->getTH1();
1924 
1925  histoname = labelname+"_RecObjPhiDifference";
1926  title = labelname+"_RecObjPhiDifference;Reco #Delta#Phi"+trigPath;
1927  MonitorElement * jetPhiDifference = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1928  jetPhiDifference->getTH1();
1929 
1930  histoname = labelname+"_hltObjAveragePt";
1931  title = labelname+"_hltObjAveragePt;HLT Average Pt[GeV/c]"+trigPath;
1932  MonitorElement * hltAveragePt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1933  hltAveragePt->getTH1();
1934 
1935  histoname = labelname+"_hltObjAverageEta";
1936  title = labelname+"_hltObjAverageEta;HLT Average #eta"+trigPath;
1937  MonitorElement * hltAverageEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1938  hltAverageEta->getTH1();
1939 
1940  histoname = labelname+"_hltObjPhiDifference";
1941  title = labelname+"_hltObjPhiDifference;Reco #Delta#Phi"+trigPath;
1942  MonitorElement * hltPhiDifference = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1943  hltPhiDifference->getTH1();
1944 
1945  v.setHistos(dummy,
1946  dummy,
1947  dummy,
1948  dummy,
1949  dummy,
1950  dummy,
1951  dummy,
1952  dummy,
1953  dummy,
1954  dummy,
1955  dummy,
1956  dummy,
1957  dummy,
1958  dummy,
1959  dummy,
1960  dummy,
1961  dummy,
1962  dummy,
1963  dummy,
1964  dummy,
1965  dummy,
1966  dummy,
1967  dummy,
1968  dummy,
1969  dummy,
1970  dummy,
1971  dummy,
1972  dummy,
1973  dummy,
1974  dummy,
1975  dummy,
1976  dummy,
1977  dummy,
1978  dummy,
1979  dummy,
1980  dummy,
1981  jetAveragePt,
1982  jetAverageEta,
1983  jetPhiDifference,
1984  hltAveragePt,
1985  hltAverageEta,
1986  hltPhiDifference,
1987  dummy,
1988  dummy,
1989  dummy
1990  );
1991  }// histos for DiJet Triggers
1992 
1993  if(v.getObjectType() == trigger::TriggerMET || (v.getObjectType() == trigger::TriggerTET)){
1994 
1995  histoname = labelname+"_recObjPt";
1996  title = labelname+"_recObjPt;Reco Pt[GeV/c]"+trigPath;
1997  MonitorElement * Pt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1998  Pt->getTH1();
1999 
2000  histoname = labelname+"_recObjPhi";
2001  title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
2002  MonitorElement * Phi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2003  Phi->getTH1();
2004 
2005  histoname = labelname+"_l1ObjPt";
2006  title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
2007  MonitorElement * Pt_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2008  Pt_L1->getTH1();
2009 
2010  histoname = labelname+"_l1ObjPhi";
2011  title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
2012  MonitorElement * Phi_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2013  Phi_L1->getTH1();
2014 
2015  histoname = labelname+"_hltObjPt";
2016  title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
2017  MonitorElement * Pt_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2018  Pt_HLT->getTH1();
2019 
2020  histoname = labelname+"_hltObjPhi";
2021  title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
2022  MonitorElement * Phi_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2023  Phi_HLT->getTH1();
2024 
2025  histoname = labelname+"_l1HLTPtResolution";
2026  title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
2027  MonitorElement * PtResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
2028  PtResolution_L1HLT->getTH1();
2029 
2030  histoname = labelname+"_l1HLTPhiResolution";
2031  title = labelname+"_l1HLTPhiResolution;#Phi(L1)-#Phi(HLT)"+trigPath;
2032  MonitorElement * PhiResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
2033  PhiResolution_L1HLT->getTH1();
2034 
2035  histoname = labelname+"_l1HLTPtCorrelation";
2036  title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
2037  MonitorElement * PtCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
2038  PtCorrelation_L1HLT->getTH1();
2039 
2040  histoname = labelname+"_l1HLTPhiCorrelation";
2041  title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
2042  MonitorElement * PhiCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
2043  PhiCorrelation_L1HLT->getTH1();
2044 
2045  histoname = labelname+"_hltRecObjPtResolution";
2046  title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
2047  MonitorElement * PtResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
2048  PtResolution_HLTRecObj->getTH1();
2049 
2050  histoname = labelname+"_hltRecObjPhiResolution";
2051  title = labelname+"_hltRecObjPhiResolution;#Phi(HLT)-#Phi(Reco)"+trigPath;
2052  MonitorElement * PhiResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
2053  PhiResolution_HLTRecObj->getTH1();
2054 
2055  histoname = labelname+"_hltRecObjPtCorrelation";
2056  title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
2057  MonitorElement * PtCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
2058  PtCorrelation_HLTRecObj->getTH1();
2059 
2060  histoname = labelname+"_hltRecObjPhiCorrelation";
2061  title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
2062  MonitorElement * PhiCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
2063  PhiCorrelation_HLTRecObj->getTH1();
2064 
2065  v.setHistos(dummy,
2066  Pt,
2067  dummy,
2068  dummy,
2069  dummy,
2070  dummy,
2071  Phi,
2072  dummy,
2073  dummy,
2074  Pt_L1,
2075  dummy,
2076  dummy,
2077  dummy,
2078  dummy,
2079  Phi_L1,
2080  dummy,
2081  dummy,
2082  Pt_HLT,
2083  dummy,
2084  dummy,
2085  dummy,
2086  dummy,
2087  Phi_HLT,
2088  dummy,
2089  PtResolution_L1HLT,
2090  dummy,
2091  PhiResolution_L1HLT,
2092  PtResolution_HLTRecObj,
2093  dummy,
2094  PhiResolution_HLTRecObj,
2095  PtCorrelation_L1HLT,
2096  dummy,
2097  PhiCorrelation_L1HLT,
2098  PtCorrelation_HLTRecObj,
2099  dummy,
2100  PhiCorrelation_HLTRecObj,
2101  dummy,
2102  dummy,
2103  dummy,
2104  dummy,
2105  dummy,
2106  dummy,
2107  dummy,
2108  dummy,
2109  dummy
2110  );
2111  }// histos for MET Triggers
2112  }
2113  }//plotAll_
2114 
2115  //-------Now Efficiency histos--------
2116  if(plotEff_){
2117  int Ptbins_ = 100;
2118  if(runStandalone_) Ptbins_ = 1000;
2119  double PtMin_ = 0.;
2120  double PtMax_ = 1000.;
2121  //
2122  int Etabins_ = 50;
2123  double EtaMin_ = -5.;
2124  double EtaMax_ = 5.;
2125  //
2126  int Phibins_ = 35;
2127  double PhiMin_ = -3.5;
2128  double PhiMax_ = 3.5;
2129  // Now define histos wrt lower threshold trigger
2130  std::string dirName1 = dirname_ + "/RelativeTriggerEff/";
2131  for(auto & v : hltPathsEff_){
2132  //
2133  std::string trgPathName = HLTConfigProvider::removeVersion(v.getPath());
2134  std::string trgPathNameD = HLTConfigProvider::removeVersion(v.getDenomPath());
2135  //
2136  std::string labelname("ME") ;
2137  std::string subdirName = dirName1 + trgPathName + "_wrt_" + trgPathNameD;
2138  iBooker.setCurrentFolder(subdirName);
2139  //
2140  std::string histoname(labelname+"");
2141  std::string title(labelname+"");
2142 
2144  dummy = iBooker.bookFloat("dummy");
2145 
2146  if((v.getObjectType() == trigger::TriggerJet) && (v.getTriggerType() == "SingleJet_Trigger")){
2147 
2148  histoname = labelname+"_NumeratorPt";
2149  title = labelname+"NumeratorPt;Calo Pt[GeV/c]";
2150  MonitorElement * NumeratorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2151  NumeratorPt->getTH1();
2152 
2153  histoname = labelname+"_NumeratorPtBarrel";
2154  title = labelname+"NumeratorPtBarrel;Calo Pt[GeV/c] ";
2155  MonitorElement * NumeratorPtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2156  NumeratorPtBarrel->getTH1();
2157 
2158  histoname = labelname+"_NumeratorPtEndcap";
2159  title = labelname+"NumeratorPtEndcap;Calo Pt[GeV/c]";
2160  MonitorElement * NumeratorPtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2161  NumeratorPtEndcap->getTH1();
2162 
2163  histoname = labelname+"_NumeratorPtForward";
2164  title = labelname+"NumeratorPtForward;Calo Pt[GeV/c]";
2165  MonitorElement * NumeratorPtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2166  NumeratorPtForward->getTH1();
2167 
2168  histoname = labelname+"_NumeratorEta";
2169  title = labelname+"NumeratorEta;Calo #eta ";
2170  MonitorElement * NumeratorEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2171  NumeratorEta->getTH1();
2172 
2173  histoname = labelname+"_NumeratorPhi";
2174  title = labelname+"NumeratorPhi;Calo #Phi";
2175  MonitorElement * NumeratorPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2176  NumeratorPhi->getTH1();
2177 
2178  histoname = labelname+"_NumeratorEtaPhi";
2179  title = labelname+"NumeratorEtaPhi;Calo #eta;Calo #Phi";
2180  MonitorElement * NumeratorEtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2181  NumeratorEtaPhi->getTH1();
2182 
2183  histoname = labelname+"_NumeratorEtaBarrel";
2184  title = labelname+"NumeratorEtaBarrel;Calo #eta ";
2185  MonitorElement * NumeratorEtaBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2186  NumeratorEtaBarrel->getTH1();
2187 
2188  histoname = labelname+"_NumeratorPhiBarrel";
2189  title = labelname+"NumeratorPhiBarrel;Calo #Phi";
2190  MonitorElement * NumeratorPhiBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2191  NumeratorPhiBarrel->getTH1();
2192 
2193  histoname = labelname+"_NumeratorEtaEndcap";
2194  title = labelname+"NumeratorEtaEndcap;Calo #eta ";
2195  MonitorElement * NumeratorEtaEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2196  NumeratorEtaEndcap->getTH1();
2197 
2198  histoname = labelname+"_NumeratorPhiEndcap";
2199  title = labelname+"NumeratorPhiEndcap;Calo #Phi";
2200  MonitorElement * NumeratorPhiEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2201  NumeratorPhiEndcap->getTH1();
2202 
2203  histoname = labelname+"_NumeratorEtaForward";
2204  title = labelname+"NumeratorEtaForward;Calo #eta ";
2205  MonitorElement * NumeratorEtaForward = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2206  NumeratorEtaForward->getTH1();
2207 
2208  histoname = labelname+"_NumeratorPhiForward";
2209  title = labelname+"NumeratorPhiForward;Calo #Phi";
2210  MonitorElement * NumeratorPhiForward = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2211  NumeratorPhiForward->getTH1();
2212 
2213  histoname = labelname+"_NumeratorEta_LowpTcut";
2214  title = labelname+"NumeratorEta_LowpTcut;Calo #eta ";
2215  MonitorElement * NumeratorEta_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2216  NumeratorEta_LowpTcut->getTH1();
2217 
2218  histoname = labelname+"_NumeratorPhi_LowpTcut";
2219  title = labelname+"NumeratorPhi_LowpTcut;Calo #Phi";
2220  MonitorElement * NumeratorPhi_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2221  NumeratorPhi_LowpTcut->getTH1();
2222 
2223  histoname = labelname+"_NumeratorEtaPhi_LowpTcut";
2224  title = labelname+"NumeratorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
2225  MonitorElement * NumeratorEtaPhi_LowpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2226  NumeratorEtaPhi_LowpTcut->getTH1();
2227 
2228  histoname = labelname+"_NumeratorEta_MedpTcut";
2229  title = labelname+"NumeratorEta_MedpTcut;Calo #eta ";
2230  MonitorElement * NumeratorEta_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2231  NumeratorEta_MedpTcut->getTH1();
2232 
2233  histoname = labelname+"_NumeratorPhi_MedpTcut";
2234  title = labelname+"NumeratorPhi_MedpTcut;Calo #Phi";
2235  MonitorElement * NumeratorPhi_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2236  NumeratorPhi_MedpTcut->getTH1();
2237 
2238  histoname = labelname+"_NumeratorEtaPhi_MedpTcut";
2239  title = labelname+"NumeratorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
2240  MonitorElement * NumeratorEtaPhi_MedpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2241  NumeratorEtaPhi_MedpTcut->getTH1();
2242 
2243  histoname = labelname+"_NumeratorEta_HighpTcut";
2244  title = labelname+"NumeratorEta_HighpTcut;Calo #eta ";
2245  MonitorElement * NumeratorEta_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2246  NumeratorEta_HighpTcut->getTH1();
2247 
2248  histoname = labelname+"_NumeratorPhi_HighpTcut";
2249  title = labelname+"NumeratorPhi_HighpTcut;Calo #Phi";
2250  MonitorElement * NumeratorPhi_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2251  NumeratorPhi_HighpTcut->getTH1();
2252 
2253  histoname = labelname+"_NumeratorEtaPhi_HighpTcut";
2254  title = labelname+"NumeratorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
2255  MonitorElement * NumeratorEtaPhi_HighpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2256  NumeratorEtaPhi_HighpTcut->getTH1();
2257 
2258  histoname = labelname+"_DenominatorPt";
2259  title = labelname+"DenominatorPt;Calo Pt[GeV/c]";
2260  MonitorElement * DenominatorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2261  DenominatorPt->getTH1();
2262 
2263  histoname = labelname+"_DenominatorPtBarrel";
2264  title = labelname+"DenominatorPtBarrel;Calo Pt[GeV/c]";
2265  MonitorElement * DenominatorPtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2266  DenominatorPtBarrel->getTH1();
2267 
2268  histoname = labelname+"_DenominatorPtEndcap";
2269  title = labelname+"DenominatorPtEndcap;Calo Pt[GeV/c]";
2270  MonitorElement * DenominatorPtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2271  DenominatorPtEndcap->getTH1();
2272 
2273  histoname = labelname+"_DenominatorPtForward";
2274  title = labelname+"DenominatorPtForward;Calo Pt[GeV/c] ";
2275  MonitorElement * DenominatorPtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2276  DenominatorPtForward->getTH1();
2277 
2278  histoname = labelname+"_DenominatorEta";
2279  title = labelname+"DenominatorEta;Calo #eta ";
2280  MonitorElement * DenominatorEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2281  DenominatorEta->getTH1();
2282 
2283  histoname = labelname+"_DenominatorPhi";
2284  title = labelname+"DenominatorPhi;Calo #Phi";
2285  MonitorElement * DenominatorPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2286  DenominatorPhi->getTH1();
2287 
2288  histoname = labelname+"_DenominatorEtaPhi";
2289  title = labelname+"DenominatorEtaPhi;Calo #eta; Calo #Phi";
2290  MonitorElement * DenominatorEtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2291  DenominatorEtaPhi->getTH1();
2292 
2293  histoname = labelname+"_DenominatorEtaBarrel";
2294  title = labelname+"DenominatorEtaBarrel;Calo #eta ";
2295  MonitorElement * DenominatorEtaBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2296  DenominatorEtaBarrel->getTH1();
2297 
2298  histoname = labelname+"_DenominatorPhiBarrel";
2299  title = labelname+"DenominatorPhiBarrel;Calo #Phi";
2300  MonitorElement * DenominatorPhiBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2301  DenominatorPhiBarrel->getTH1();
2302 
2303  histoname = labelname+"_DenominatorEtaEndcap";
2304  title = labelname+"DenominatorEtaEndcap;Calo #eta ";
2305  MonitorElement * DenominatorEtaEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2306  DenominatorEtaEndcap->getTH1();
2307 
2308  histoname = labelname+"_DenominatorPhiEndcap";
2309  title = labelname+"DenominatorPhiEndcap;Calo #Phi";
2310  MonitorElement * DenominatorPhiEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2311  DenominatorPhiEndcap->getTH1();
2312 
2313  histoname = labelname+"_DenominatorEtaForward";
2314  title = labelname+"DenominatorEtaForward;Calo #eta ";
2315  MonitorElement * DenominatorEtaForward = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2316  DenominatorEtaForward->getTH1();
2317 
2318  histoname = labelname+"_DenominatorPhiForward";
2319  title = labelname+"DenominatorPhiForward;Calo #Phi";
2320  MonitorElement * DenominatorPhiForward = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2321  DenominatorPhiForward->getTH1();
2322 
2323  histoname = labelname+"_DenominatorEta_LowpTcut";
2324  title = labelname+"DenominatorEta_LowpTcut;Calo #eta ";
2325  MonitorElement * DenominatorEta_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2326  DenominatorEta_LowpTcut->getTH1();
2327 
2328  histoname = labelname+"_DenominatorPhi_LowpTcut";
2329  title = labelname+"DenominatorPhi_LowpTcut;Calo #Phi";
2330  MonitorElement * DenominatorPhi_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2331  DenominatorPhi_LowpTcut->getTH1();
2332 
2333  histoname = labelname+"_DenominatorEtaPhi_LowpTcut";
2334  title = labelname+"DenominatorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
2335  MonitorElement * DenominatorEtaPhi_LowpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2336  DenominatorEtaPhi_LowpTcut->getTH1();
2337 
2338  histoname = labelname+"_DenominatorEta_MedpTcut";
2339  title = labelname+"DenominatorEta_MedpTcut;Calo #eta ";
2340  MonitorElement * DenominatorEta_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2341  DenominatorEta_MedpTcut->getTH1();
2342 
2343  histoname = labelname+"_DenominatorPhi_MedpTcut";
2344  title = labelname+"DenominatorPhi_MedpTcut;Calo #Phi";
2345  MonitorElement * DenominatorPhi_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2346  DenominatorPhi_MedpTcut->getTH1();
2347 
2348  histoname = labelname+"_DenominatorEtaPhi_MedpTcut";
2349  title = labelname+"DenominatorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
2350  MonitorElement * DenominatorEtaPhi_MedpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2351  DenominatorEtaPhi_MedpTcut->getTH1();
2352 
2353  histoname = labelname+"_DenominatorEta_HighpTcut";
2354  title = labelname+"DenominatorEta_HighpTcut;Calo #eta ";
2355  MonitorElement * DenominatorEta_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2356  DenominatorEta_HighpTcut->getTH1();
2357 
2358  histoname = labelname+"_DenominatorPhi_HighpTcut";
2359  title = labelname+"DenominatorPhi_HighpTcut;Calo #Phi";
2360  MonitorElement * DenominatorPhi_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2361  DenominatorPhi_HighpTcut->getTH1();
2362 
2363  histoname = labelname+"_DenominatorEtaPhi_HighpTcut";
2364  title = labelname+"DenominatorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
2365  MonitorElement * DenominatorEtaPhi_HighpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2366  DenominatorEtaPhi_HighpTcut->getTH1();
2367 
2368  histoname = labelname+"_DeltaR";
2369  title = labelname+"DeltaR;";
2370  MonitorElement * DeltaR = iBooker.book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
2371  DeltaR->getTH1();
2372 
2373  histoname = labelname+"_DeltaPhi";
2374  title = labelname+"DeltaPhi;";
2375  MonitorElement * DeltaPhi = iBooker.book1D(histoname.c_str(),title.c_str(),500,-5.0,5.0);
2376  DeltaPhi->getTH1();
2377 
2378  histoname = labelname+"_NumeratorPFMHT";
2379  title = labelname+"NumeratorPFMHT;PFMHT[GeV/c]";
2380  MonitorElement * NumeratorPFMHT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2381  NumeratorPFMHT->getTH1();
2382 
2383  histoname = labelname+"_NumeratorPFPt";
2384  title = labelname+"NumeratorPFPt;PF Pt[GeV/c]";
2385  MonitorElement * NumeratorPFPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2386  NumeratorPFPt->getTH1();
2387 
2388  histoname = labelname+"_NumeratorPFPtBarrel";
2389  title = labelname+"NumeratorPFPtBarrel;PF Pt[GeV/c] ";
2390  MonitorElement * NumeratorPFPtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2391  NumeratorPFPtBarrel->getTH1();
2392 
2393  histoname = labelname+"_NumeratorPFPtEndcap";
2394  title = labelname+"NumeratorPFPtEndcap;PF Pt[GeV/c]";
2395  MonitorElement * NumeratorPFPtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2396  NumeratorPFPtEndcap->getTH1();
2397 
2398  histoname = labelname+"_NumeratorPFPtForward";
2399  title = labelname+"NumeratorPFPtForward;PF Pt[GeV/c]";
2400  MonitorElement * NumeratorPFPtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2401  NumeratorPFPtForward->getTH1();
2402 
2403  histoname = labelname+"_NumeratorPFEta";
2404  title = labelname+"NumeratorPFEta;PF #eta ";
2405  MonitorElement * NumeratorPFEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2406  NumeratorPFEta->getTH1();
2407 
2408  histoname = labelname+"_NumeratorPFPhi";
2409  title = labelname+"NumeratorPFPhi;Calo #Phi";
2410  MonitorElement * NumeratorPFPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2411  NumeratorPFPhi->getTH1();
2412 
2413  histoname = labelname+"_NumeratorPFEtaPhi";
2414  title = labelname+"NumeratorPFEtaPhi;PF #eta;Calo #Phi";
2415  MonitorElement * NumeratorPFEtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2416  NumeratorPFEtaPhi->getTH1();
2417 
2418  histoname = labelname+"_NumeratorPFEtaBarrel";
2419  title = labelname+"NumeratorPFEtaBarrel;PF #eta ";
2420  MonitorElement * NumeratorPFEtaBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2421  NumeratorPFEtaBarrel->getTH1();
2422 
2423  histoname = labelname+"_NumeratorPFPhiBarrel";
2424  title = labelname+"NumeratorPFPhiBarrel;PF #Phi";
2425  MonitorElement * NumeratorPFPhiBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2426  NumeratorPFPhiBarrel->getTH1();
2427 
2428  histoname = labelname+"_NumeratorPFEtaEndcap";
2429  title = labelname+"NumeratorPFEtaEndcap;Calo #eta ";
2430  MonitorElement * NumeratorPFEtaEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2431  NumeratorPFEtaEndcap->getTH1();
2432 
2433  histoname = labelname+"_NumeratorPFPhiEndcap";
2434  title = labelname+"NumeratorPFPhiEndcap;PF #Phi";
2435  MonitorElement * NumeratorPFPhiEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2436  NumeratorPFPhiEndcap->getTH1();
2437 
2438  histoname = labelname+"_NumeratorPFEtaForward";
2439  title = labelname+"NumeratorPFEtaForward;Calo #eta ";
2440  MonitorElement * NumeratorPFEtaForward = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2441  NumeratorPFEtaForward->getTH1();
2442 
2443  histoname = labelname+"_NumeratorPFPhiForward";
2444  title = labelname+"NumeratorPFPhiForward;PF #Phi";
2445  MonitorElement * NumeratorPFPhiForward = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2446  NumeratorPFPhiForward->getTH1();
2447 
2448  histoname = labelname+"_NumeratorPFEta_LowpTcut";
2449  title = labelname+"NumeratorPFEta_LowpTcut;PF #eta ";
2450  MonitorElement * NumeratorPFEta_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2451  NumeratorPFEta_LowpTcut->getTH1();
2452 
2453  histoname = labelname+"_NumeratorPFPhi_LowpTcut";
2454  title = labelname+"NumeratorPFPhi_LowpTcut;PF #Phi";
2455  MonitorElement * NumeratorPFPhi_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2456  NumeratorPFPhi_LowpTcut->getTH1();
2457 
2458  histoname = labelname+"_NumeratorPFEtaPhi_LowpTcut";
2459  title = labelname+"NumeratorPFEtaPhi_LowpTcut;PF #eta;Calo #Phi";
2460  MonitorElement * NumeratorPFEtaPhi_LowpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2461  NumeratorPFEtaPhi_LowpTcut->getTH1();
2462 
2463  histoname = labelname+"_NumeratorPFEta_MedpTcut";
2464  title = labelname+"NumeratorPFEta_MedpTcut;PF #eta ";
2465  MonitorElement * NumeratorPFEta_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2466  NumeratorPFEta_MedpTcut->getTH1();
2467 
2468  histoname = labelname+"_NumeratorPFPhi_MedpTcut";
2469  title = labelname+"NumeratorPFPhi_MedpTcut;PF #Phi";
2470  MonitorElement * NumeratorPFPhi_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2471  NumeratorPFPhi_MedpTcut->getTH1();
2472 
2473  histoname = labelname+"_NumeratorPFEtaPhi_MedpTcut";
2474  title = labelname+"NumeratorPFEtaPhi_MedpTcut;PF #eta;PF #Phi";
2475  MonitorElement * NumeratorPFEtaPhi_MedpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2476  NumeratorPFEtaPhi_MedpTcut->getTH1();
2477 
2478  histoname = labelname+"_NumeratorPFEta_HighpTcut";
2479  title = labelname+"NumeratorPFEta_HighpTcut;Calo #eta ";
2480  MonitorElement * NumeratorPFEta_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2481  NumeratorPFEta_HighpTcut->getTH1();
2482 
2483  histoname = labelname+"_NumeratorPFPhi_HighpTcut";
2484  title = labelname+"NumeratorPFPhi_HighpTcut;PF #Phi";
2485  MonitorElement * NumeratorPFPhi_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2486  NumeratorPFPhi_HighpTcut->getTH1();
2487 
2488  histoname = labelname+"_NumeratorPFEtaPhi_HighpTcut";
2489  title = labelname+"NumeratorPFEtaPhi_HighpTcut;PF #eta;PF #Phi";
2490  MonitorElement * NumeratorPFEtaPhi_HighpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2491  NumeratorPFEtaPhi_HighpTcut->getTH1();
2492 
2493  histoname = labelname+"_DenominatorPFMHT";
2494  title = labelname+"DenominatorPFMHT;PF Pt[GeV/c]";
2495  MonitorElement * DenominatorPFMHT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2496  DenominatorPFMHT->getTH1();
2497 
2498  histoname = labelname+"_DenominatorPFPt";
2499  title = labelname+"DenominatorPFPt;PF Pt[GeV/c]";
2500  MonitorElement * DenominatorPFPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2501  DenominatorPFPt->getTH1();
2502 
2503  histoname = labelname+"_DenominatorPFPtBarrel";
2504  title = labelname+"DenominatorPFPtBarrel;Calo Pt[GeV/c]";
2505  MonitorElement * DenominatorPFPtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2506  DenominatorPFPtBarrel->getTH1();
2507 
2508  histoname = labelname+"_DenominatorPFPtEndcap";
2509  title = labelname+"DenominatorPFPtEndcap;PF Pt[GeV/c]";
2510  MonitorElement * DenominatorPFPtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2511  DenominatorPFPtEndcap->getTH1();
2512 
2513  histoname = labelname+"_DenominatorPFPtForward";
2514  title = labelname+"DenominatorPFPtForward;PF Pt[GeV/c] ";
2515  MonitorElement * DenominatorPFPtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2516  DenominatorPFPtForward->getTH1();
2517 
2518  histoname = labelname+"_DenominatorPFEta";
2519  title = labelname+"DenominatorPFEta;PF #eta ";
2520  MonitorElement * DenominatorPFEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2521  DenominatorPFEta->getTH1();
2522 
2523  histoname = labelname+"_DenominatorPFPhi";
2524  title = labelname+"DenominatorPFPhi;PF #Phi";
2525  MonitorElement * DenominatorPFPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2526  DenominatorPFPhi->getTH1();
2527 
2528  histoname = labelname+"_DenominatorPFEtaPhi";
2529  title = labelname+"DenominatorPFEtaPhi;PF #eta; Calo #Phi";
2530  MonitorElement * DenominatorPFEtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2531  DenominatorPFEtaPhi->getTH1();
2532 
2533  histoname = labelname+"_DenominatorPFEtaBarrel";
2534  title = labelname+"DenominatorPFEtaBarrel;Calo #eta ";
2535  MonitorElement * DenominatorPFEtaBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2536  DenominatorPFEtaBarrel->getTH1();
2537 
2538  histoname = labelname+"_DenominatorPFPhiBarrel";
2539  title = labelname+"DenominatorPFPhiBarrel;PF #Phi";
2540  MonitorElement * DenominatorPFPhiBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2541  DenominatorPFPhiBarrel->getTH1();
2542 
2543  histoname = labelname+"_DenominatorPFEtaEndcap";
2544  title = labelname+"DenominatorPFEtaEndcap;PF #eta ";
2545  MonitorElement * DenominatorPFEtaEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2546  DenominatorPFEtaEndcap->getTH1();
2547 
2548  histoname = labelname+"_DenominatorPFPhiEndcap";
2549  title = labelname+"DenominatorPFPhiEndcap;Calo #Phi";
2550  MonitorElement * DenominatorPFPhiEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2551  DenominatorPFPhiEndcap->getTH1();
2552 
2553  histoname = labelname+"_DenominatorPFEtaForward";
2554  title = labelname+"DenominatorPFEtaForward;PF #eta ";
2555  MonitorElement * DenominatorPFEtaForward = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2556  DenominatorPFEtaForward->getTH1();
2557 
2558  histoname = labelname+"_DenominatorPFPhiForward";
2559  title = labelname+"DenominatorPFPhiForward;PF #Phi";
2560  MonitorElement * DenominatorPFPhiForward = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2561  DenominatorPFPhiForward->getTH1();
2562 
2563  histoname = labelname+"_DenominatorPFEta_LowpTcut";
2564  title = labelname+"DenominatorPFEta_LowpTcut;PF #eta ";
2565  MonitorElement * DenominatorPFEta_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2566  DenominatorPFEta_LowpTcut->getTH1();
2567 
2568  histoname = labelname+"_DenominatorPFPhi_LowpTcut";
2569  title = labelname+"DenominatorPFPhi_LowpTcut;PF #Phi";
2570  MonitorElement * DenominatorPFPhi_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2571  DenominatorPFPhi_LowpTcut->getTH1();
2572 
2573  histoname = labelname+"_DenominatorPFEtaPhi_LowpTcut";
2574  title = labelname+"DenominatorPFEtaPhi_LowpTcut;PF #eta;Calo #Phi";
2575  MonitorElement * DenominatorPFEtaPhi_LowpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2576  DenominatorPFEtaPhi_LowpTcut->getTH1();
2577 
2578  histoname = labelname+"_DenominatorPFEta_MedpTcut";
2579  title = labelname+"DenominatorPFEta_MedpTcut;PF #eta ";
2580  MonitorElement * DenominatorPFEta_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2581  DenominatorPFEta_MedpTcut->getTH1();
2582 
2583  histoname = labelname+"_DenominatorPFPhi_MedpTcut";
2584  title = labelname+"DenominatorPFPhi_MedpTcut;PF #Phi";
2585  MonitorElement * DenominatorPFPhi_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2586  DenominatorPFPhi_MedpTcut->getTH1();
2587 
2588  histoname = labelname+"_DenominatorPFEtaPhi_MedpTcut";
2589  title = labelname+"DenominatorPFEtaPhi_MedpTcut;PF #eta;Calo #Phi";
2590  MonitorElement * DenominatorPFEtaPhi_MedpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2591  DenominatorPFEtaPhi_MedpTcut->getTH1();
2592 
2593  histoname = labelname+"_DenominatorPFEta_HighpTcut";
2594  title = labelname+"DenominatorPFEta_HighpTcut;PF #eta ";
2595  MonitorElement * DenominatorPFEta_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2596  DenominatorPFEta_HighpTcut->getTH1();
2597 
2598  histoname = labelname+"_DenominatorPFPhi_HighpTcut";
2599  title = labelname+"DenominatorPFPhi_HighpTcut;PF #Phi";
2600  MonitorElement * DenominatorPFPhi_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2601  DenominatorPFPhi_HighpTcut->getTH1();
2602 
2603  histoname = labelname+"_DenominatorPFEtaPhi_HighpTcut";
2604  title = labelname+"DenominatorPFEtaPhi_HighpTcut;PF #eta;Calo #Phi";
2605  MonitorElement * DenominatorPFEtaPhi_HighpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2606  DenominatorPFEtaPhi_HighpTcut->getTH1();
2607 
2608  histoname = labelname+"_PFDeltaR";
2609  title = labelname+"PFDeltaR;";
2610  MonitorElement * PFDeltaR = iBooker.book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
2611  PFDeltaR->getTH1();
2612 
2613  histoname = labelname+"_PFDeltaPhi";
2614  title = labelname+"PFDeltaPhi;";
2615  MonitorElement * PFDeltaPhi = iBooker.book1D(histoname.c_str(),title.c_str(),500,-5.0,5.0);
2616  PFDeltaPhi->getTH1();
2617 
2618  v.setEffHistos(NumeratorPt,
2619  NumeratorPtBarrel,
2620  NumeratorPtEndcap,
2621  NumeratorPtForward,
2622  NumeratorEta,
2623  NumeratorPhi,
2624  NumeratorEtaPhi,
2625  //
2626  NumeratorEtaBarrel,
2627  NumeratorPhiBarrel,
2628  NumeratorEtaEndcap,
2629  NumeratorPhiEndcap,
2630  NumeratorEtaForward,
2631  NumeratorPhiForward,
2632  NumeratorEta_LowpTcut,
2633  NumeratorPhi_LowpTcut,
2634  NumeratorEtaPhi_LowpTcut,
2635  NumeratorEta_MedpTcut,
2636  NumeratorPhi_MedpTcut,
2637  NumeratorEtaPhi_MedpTcut,
2638  NumeratorEta_HighpTcut,
2639  NumeratorPhi_HighpTcut,
2640  NumeratorEtaPhi_HighpTcut,
2641  //
2642  DenominatorPt,
2643  DenominatorPtBarrel,
2644  DenominatorPtEndcap,
2645  DenominatorPtForward,
2646  DenominatorEta,
2647  DenominatorPhi,
2648  DenominatorEtaPhi,
2649  //
2650  DenominatorEtaBarrel,
2651  DenominatorPhiBarrel,
2652  DenominatorEtaEndcap,
2653  DenominatorPhiEndcap,
2654  DenominatorEtaForward,
2655  DenominatorPhiForward,
2656  DenominatorEta_LowpTcut,
2657  DenominatorPhi_LowpTcut,
2658  DenominatorEtaPhi_LowpTcut,
2659  DenominatorEta_MedpTcut,
2660  DenominatorPhi_MedpTcut,
2661  DenominatorEtaPhi_MedpTcut,
2662  DenominatorEta_HighpTcut,
2663  DenominatorPhi_HighpTcut,
2664  DenominatorEtaPhi_HighpTcut,
2665  DeltaR,
2666  DeltaPhi,
2667  //
2668  NumeratorPFPt,
2669  NumeratorPFMHT,
2670  NumeratorPFPtBarrel,
2671  NumeratorPFPtEndcap,
2672  NumeratorPFPtForward,
2673  NumeratorPFEta,
2674  NumeratorPFPhi,
2675  NumeratorPFEtaPhi,
2676  NumeratorPFEtaBarrel,
2677  NumeratorPFPhiBarrel,
2678  NumeratorPFEtaEndcap,
2679  NumeratorPFPhiEndcap,
2680  NumeratorPFEtaForward,
2681  NumeratorPFPhiForward,
2682  NumeratorPFEta_LowpTcut,
2683  NumeratorPFPhi_LowpTcut,
2684  NumeratorPFEtaPhi_LowpTcut,
2685  NumeratorPFEta_MedpTcut,
2686  NumeratorPFPhi_MedpTcut,
2687  NumeratorPFEtaPhi_MedpTcut,
2688  NumeratorPFEta_HighpTcut,
2689  NumeratorPFPhi_HighpTcut,
2690  NumeratorPFEtaPhi_HighpTcut,
2691  DenominatorPFPt,
2692  DenominatorPFMHT,
2693  DenominatorPFPtBarrel,
2694  DenominatorPFPtEndcap,
2695  DenominatorPFPtForward,
2696  DenominatorPFEta,
2697  DenominatorPFPhi,
2698  DenominatorPFEtaPhi,
2699  DenominatorPFEtaBarrel,
2700  DenominatorPFPhiBarrel,
2701  DenominatorPFEtaEndcap,
2702  DenominatorPFPhiEndcap,
2703  DenominatorPFEtaForward,
2704  DenominatorPFPhiForward,
2705  DenominatorPFEta_LowpTcut,
2706  DenominatorPFPhi_LowpTcut,
2707  DenominatorPFEtaPhi_LowpTcut,
2708  DenominatorPFEta_MedpTcut,
2709  DenominatorPFPhi_MedpTcut,
2710  DenominatorPFEtaPhi_MedpTcut,
2711  DenominatorPFEta_HighpTcut,
2712  DenominatorPFPhi_HighpTcut,
2713  DenominatorPFEtaPhi_HighpTcut,
2714  PFDeltaR,
2715  PFDeltaPhi
2716  );
2717 
2718  }// Loop over Jet Trigger
2719 
2720  if((v.getObjectType() == trigger::TriggerJet) && (v.getTriggerType() == "DiJet_Trigger")){
2721 
2722  histoname = labelname+"_NumeratorAvrgPt";
2723  title = labelname+"NumeratorAvrgPt;Calo Pt[GeV/c]";
2724  MonitorElement * NumeratorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2725  NumeratorPt->getTH1();
2726 
2727  histoname = labelname+"_NumeratorAvrgEta";
2728  title = labelname+"NumeratorAvrgEta;Calo #eta";
2729  MonitorElement * NumeratorEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2730  NumeratorEta->getTH1();
2731 
2732  histoname = labelname+"_DenominatorAvrgPt";
2733  title = labelname+"DenominatorAvrgPt;Calo Pt[GeV/c] ";
2734  MonitorElement * DenominatorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2735  DenominatorPt->getTH1();
2736 
2737  histoname = labelname+"_DenominatorAvrgEta";
2738  title = labelname+"DenominatorAvrgEta;Calo #eta";
2739  MonitorElement * DenominatorEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2740  DenominatorEta->getTH1();
2741 
2742  histoname = labelname+"_DeltaR";
2743  title = labelname+"DeltaR;";
2744  MonitorElement * DeltaR = iBooker.book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
2745  DeltaR->getTH1();
2746 
2747  histoname = labelname+"_DeltaPhi";
2748  title = labelname+"DeltaPhi;";
2749  MonitorElement * DeltaPhi = iBooker.book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
2750  DeltaPhi->getTH1();
2751 
2752  //add PF histo: SJ
2753  histoname = labelname+"_NumeratorAvrgPFPt";
2754  title = labelname+"NumeratorAvrgPFPt;PF Pt[GeV/c]";
2755  MonitorElement * NumeratorPFPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2756  NumeratorPFPt->getTH1();
2757 
2758  histoname = labelname+"_NumeratorAvrgPFEta";
2759  title = labelname+"NumeratorAvrgPFEta;PF #eta";
2760  MonitorElement * NumeratorPFEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2761  NumeratorPFEta->getTH1();
2762 
2763  histoname = labelname+"_DenominatorAvrgPFPt";
2764  title = labelname+"DenominatorAvrgPFPt;PF Pt[GeV/c] ";
2765  MonitorElement * DenominatorPFPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2766  DenominatorPFPt->getTH1();
2767 
2768  histoname = labelname+"_DenominatorAvrgPFEta";
2769  title = labelname+"DenominatorAvrgPFEta;PF #eta";
2770  MonitorElement * DenominatorPFEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2771  DenominatorPFEta->getTH1();
2772 
2773  histoname = labelname+"_PFDeltaR";
2774  title = labelname+"PFDeltaR;";
2775  MonitorElement * PFDeltaR = iBooker.book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
2776  PFDeltaR->getTH1();
2777 
2778  histoname = labelname+"_PFDeltaPhi";
2779  title = labelname+"PFDeltaPhi;";
2780  MonitorElement * PFDeltaPhi = iBooker.book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
2781  PFDeltaPhi->getTH1();
2782 
2783  v.setEffHistos( dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2784  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2785  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2786  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2787  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2788  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2789  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2790  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2791  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2792  dummy, dummy, dummy, dummy
2793  );
2794  }
2795 
2796  if(v.getObjectType() == trigger::TriggerMET || (v.getObjectType() == trigger::TriggerTET)){
2797 
2798  histoname = labelname+"_NumeratorPt";
2799  if(v.getPath().find("HLT_PFMET")==std::string::npos)
2800  title = labelname+"NumeratorPt; CaloMET[GeV/c]";
2801  else
2802  title = labelname+"NumeratorPt; PFMET[GeV/c]";
2803  MonitorElement * NumeratorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2804  NumeratorPt->getTH1();
2805 
2806  histoname = labelname+"_NumeratorPhi";
2807  title = labelname+"NumeratorPhi; #Phi";
2808  MonitorElement * NumeratorPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2809  NumeratorPhi->getTH1();
2810 
2811  histoname = labelname+"_DenominatorPt";
2812  if(v.getPath().find("HLT_PFMET")==std::string::npos)
2813  title = labelname+"DenominatorPt; CaloMET[GeV/c]";
2814  else
2815  title = labelname+"DenominatorPt; PFMET[GeV/c]";
2816  MonitorElement * DenominatorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2817  DenominatorPt->getTH1();
2818 
2819  histoname = labelname+"_DenominatorPhi";
2820  title = labelname+"DenominatorPhi; #Phi";
2821  MonitorElement * DenominatorPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2822  DenominatorPhi->getTH1();
2823 
2824  v.setEffHistos( NumeratorPt, dummy, dummy, dummy, dummy, NumeratorPhi, dummy, dummy, dummy, dummy,
2825  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2826  dummy, dummy, DenominatorPt, dummy, dummy, dummy, dummy, DenominatorPhi, dummy, dummy,
2827  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2828  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2829  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2830  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2831  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2832  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2833  dummy, dummy, dummy, dummy
2834  );
2835  }// Loop over MET trigger
2836  }
2837  }//plotEff_
2838 
2839  if(runStandalone_){//runStandalone
2840  //--------Histos to see WHY trigger is NOT fired----------
2841  int Nbins_ = 10;
2842  int Nmin_ = 0;
2843  int Nmax_ = 10;
2844  int Ptbins_ = 1000;
2845  int Etabins_ = 40;
2846  int Phibins_ = 35;
2847  double PtMin_ = 0.;
2848  double PtMax_ = 1000.;
2849  double EtaMin_ = -5.;
2850  double EtaMax_ = 5.;
2851  double PhiMin_ = -3.14159;
2852  double PhiMax_ = 3.14159;
2853 
2854  std::string dirName4_ = dirname_ + "/TriggerNotFired/";
2855  // iBooker.setCurrentFolder(dirName4);
2856 
2857  for(auto & v : hltPathsAll_){
2858 
2860  dummy = iBooker.bookFloat("dummy");
2861 
2862  std::string labelname("ME") ;
2863  std::string histoname(labelname+"");
2864  std::string title(labelname+"");
2865  iBooker.setCurrentFolder(dirName4_ + v.getPath());
2866 
2867  histoname = labelname+"_TriggerSummary";
2868  title = labelname+"Summary of trigger levels";
2869  MonitorElement * TriggerSummary = iBooker.book1D(histoname.c_str(),title.c_str(),7, -0.5,6.5);
2870 
2871  std::vector<std::string> trigger;
2872  trigger.emplace_back("Nevt");
2873  trigger.emplace_back("L1 failed");
2874  trigger.emplace_back("L1 & HLT failed");
2875  trigger.emplace_back("L1 failed but not HLT");
2876  trigger.emplace_back("L1 passed");
2877  trigger.emplace_back("L1 & HLT passed");
2878  trigger.emplace_back("L1 passed but not HLT");
2879 
2880  for(unsigned int i =0; i < trigger.size(); i++)
2881  TriggerSummary->setBinLabel(i+1, trigger[i]);
2882 
2883  if((v.getTriggerType() == "SingleJet_Trigger")){
2884  histoname = labelname+"_JetPt";
2885  title = labelname+"Leading jet pT;Pt[GeV/c]";
2886  MonitorElement * JetPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2887  JetPt->getTH1();
2888 
2889  histoname = labelname+"_JetEtaVsPt";
2890  title = labelname+"Leading jet #eta vs pT;#eta;Pt[GeV/c]";
2891  MonitorElement * JetEtaVsPt = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Ptbins_,PtMin_,PtMax_);
2892  JetEtaVsPt->getTH1();
2893 
2894  histoname = labelname+"_JetPhiVsPt";
2895  title = labelname+"Leading jet #Phi vs pT;#Phi;Pt[GeV/c]";
2896  MonitorElement * JetPhiVsPt = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Ptbins_,PtMin_,PtMax_);
2897  JetPhiVsPt->getTH1();
2898 
2899  v.setDgnsHistos( TriggerSummary, dummy, JetPt, JetEtaVsPt, JetPhiVsPt, dummy, dummy, dummy, dummy, dummy, dummy);
2900  }// single Jet trigger
2901 
2902  if((v.getTriggerType() == "DiJet_Trigger")){
2903  histoname = labelname+"_JetSize";
2904  title = labelname+"Jet Size;multiplicity";
2905  MonitorElement * JetSize = iBooker.book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
2906  JetSize->getTH1();
2907 
2908  histoname = labelname+"_AvergPt";
2909  title = labelname+"Average Pt;Pt[GeV/c]";
2910  MonitorElement * Pt12 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2911  Pt12->getTH1();
2912 
2913  histoname = labelname+"_AvergEta";
2914  title = labelname+"Average Eta;#eta";
2915  MonitorElement * Eta12 = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2916  Eta12->getTH1();
2917 
2918  histoname = labelname+"_PhiDifference";
2919  title = labelname+"#Delta#Phi;#Delta#Phi";
2920  MonitorElement * Phi12 = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2921  Phi12->getTH1();
2922 
2923  histoname = labelname+"_Pt3Jet";
2924  title = labelname+"Pt of 3rd Jet;Pt[GeV/c]";
2925  MonitorElement * Pt3 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2926  Pt3->getTH1();
2927 
2928  histoname = labelname+"_Pt12VsPt3Jet";
2929  title = labelname+"Pt of 3rd Jet vs Average Pt of leading jets;Avergage Pt[GeV/c]; Pt of 3rd Jet [GeV/c]";
2930  MonitorElement * Pt12Pt3 = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
2931  Pt12Pt3->getTH1();
2932 
2933  histoname = labelname+"_Pt12VsPhi12";
2934  title = labelname+"Average Pt of leading jets vs #Delta#Phi between leading jets;Avergage Pt[GeV/c]; #Delta#Phi";
2935  MonitorElement * Pt12Phi12 = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Phibins_,PhiMin_,PhiMax_);
2936  Pt12Phi12->getTH1();
2937 
2938  v.setDgnsHistos( TriggerSummary, JetSize, dummy, dummy, dummy, Pt12, Eta12, Phi12, Pt3, Pt12Pt3, Pt12Phi12);
2939  }// Dijet Jet trigger
2940 
2941  if((v.getTriggerType() == "MET_Trigger")){
2942  histoname = labelname+"_MET";
2943  title = labelname+"MET;Pt[GeV/c]";
2944  MonitorElement * MET = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2945  MET->getTH1();
2946 
2947  v.setDgnsHistos(TriggerSummary, dummy, MET, dummy, dummy, dummy, dummy, dummy,dummy,dummy,dummy);
2948  } // MET trigger
2949 
2950  if((v.getTriggerType() == "TET_Trigger")){
2951  histoname = labelname+"_TET";
2952  title = labelname+"TET;Pt[GeV/c]";
2953  MonitorElement * TET = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2954  TET->getTH1();
2955 
2956  v.setDgnsHistos(TriggerSummary, dummy, TET, dummy, dummy, dummy, dummy, dummy,dummy,dummy,dummy);
2957  } // TET trigger
2958  }
2959  }//runStandalone
2960 
2961  }
2962 }
2963 //------------------------------------------------------------------------//
2965 {
2966 
2967  // find L1 condition for numpath with numpath objecttype
2968  // find PSet for L1 global seed for numpath,
2969  // list module labels for numpath
2970  std::string l1pathname = "dummy";
2971 
2972  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
2973 
2974  for(auto & numpathmodule : numpathmodules) {
2975 
2976  if (hltConfig_.moduleType(numpathmodule) == "HLTLevel1GTSeed") {
2977  l1pathname = numpathmodule;
2978  break;
2979  }
2980  }
2981  return l1pathname;
2982 }
2983 
2984 //------------------------------------------------------------------------//
2986  bool output = false;
2987  if (fabs(eta)<=1.3) output=true;
2988  return output;
2989 }
2990 
2991 //------------------------------------------------------------------------//
2993  bool output = false;
2994  if (fabs(eta)<=3.0 && fabs(eta)>1.3) output=true;
2995  return output;
2996 }
2997 
2998 //------------------------------------------------------------------------//
3000  bool output = false;
3001  if (fabs(eta)>3.0) output=true;
3002  return output;
3003 }
3004 
3005 //------------------------------------------------------------------------//
3007  // hltConfig_ has to be defined first before calling this method
3008  bool output=false;
3009  for (unsigned int j=0; j!=hltConfig_.size(); ++j) {
3010  if (hltConfig_.triggerName(j) == pathname )
3011  output=true;
3012  }
3013  return output;
3014 }
3015 
3016 //------------------------------------------------------------------------//
3018  // triggerResults_, triggerNames_ has to be defined first before calling this method
3019  bool output=false;
3020  if(triggerResults_.isValid()) {
3021  unsigned index = triggerNames_.triggerIndex(pathName);
3022  if(index < triggerNames_.size() && triggerResults_->accept(index)) output = true;
3023  }
3024  return output;
3025 }
3026 
3027 //------------------------------------------------------------------------//
3028 // This returns the position of trigger name defined in summary histograms
3030  int nbins = rate_All->getTH1()->GetNbinsX();
3031  double binVal = -100;
3032  for(int ibin=1; ibin<nbins+1; ibin++)
3033  {
3034  const char * binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
3035  if(binLabel[0]=='\0')continue;
3036  // std::string binLabel_str = string(binLabel);
3037  // if(binLabel_str.compare(trigName)!=0)continue;
3038  if(trigName!=binLabel)continue;
3039 
3040  if(trigName==binLabel){
3041  binVal = rate_All->getTH1()->GetBinCenter(ibin);
3042  break;
3043  }
3044  }
3045  return binVal;
3046 }
3047 
3048 //------------------------------------------------------------------------//
3050  // processname_, triggerObj_ has to be defined before calling this method
3051  bool output=false;
3052  edm::InputTag testTag(objectName,"",processname_);
3053  const int index = triggerObj_->filterIndex(testTag);
3054  if ( index >= triggerObj_->sizeFilters() ) {
3055  edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< index << " of that name ";
3056  } else {
3057  const trigger::Keys & k = triggerObj_->filterKeys(index);
3058  if (!k.empty()) output=true;
3059  }
3060  return output;
3061 }
3062 //------------------------------------------------------------------------//
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
unsigned int size() const
number of trigger paths in trigger table
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
Definition: DeltaR.py:1
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken
edm::EDGetTokenT< reco::VertexCollection > vertexToken
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken
const std::string moduleType(const std::string &module) const
C++ class name of module.
virtual bool isEndCap(double eta)
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
const std::string & triggerName(unsigned int triggerIndex) const
JetMETHLTOfflineSource(const edm::ParameterSet &)
const double w
Definition: UKUtility.cc:23
edm::Handle< reco::PFJetCollection > pfjetColl_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
virtual double TriggerPosition(std::string trigName)
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
TH1 * getTH1() const
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
double fHPD() const
Definition: JetIDHelper.h:41
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
edm::Handle< edm::TriggerResults > triggerResults_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
double pt() const final
transverse momentum
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:47
reco::PFJetCollection pfjet
Strings::size_type size() const
Definition: TriggerNames.cc:39
edm::Handle< reco::PFMETCollection > pfmetColl_
PathInfoCollection hltPathsAllTriggerSummary_
virtual bool validPathHLT(std::string path)
void calculate(const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:100
static const std::string removeVersion(const std::string &trigger)
void bookHistograms(DQMStore::IBooker &, edm::Run const &run, edm::EventSetup const &c) override
virtual void fillMEforMonAllTrigger(const edm::Event &iEvent, const edm::EventSetup &)
void Fill(long long x)
Collection of Calo MET.
virtual bool isBarrel(double eta)
std::vector< std::string > pathFilter_
int iEvent
Definition: GenABIO.cc:230
void analyze(const edm::Event &, const edm::EventSetup &) override
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
edm::EDGetTokenT< reco::JetCorrector > CaloJetCorToken_
std::vector< std::string > MBTrigPaths_
checkPath
Definition: config.py:11
double et() const final
transverse energy
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
virtual bool isTriggerObjectFound(std::string objectName)
Definition: MET.h:42
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T sqrt(T t)
Definition: SSEVec.h:18
virtual bool isForward(double eta)
MonitorElement * correlation_AllWrtMu
std::vector< std::string > pathRejectKeyword_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< reco::CaloMETCollection > caloMetToken
reco::CaloJetCollection calojet
std::vector< std::string > MuonTrigPaths_
bool isValid() const
Definition: HandleBase.h:74
virtual bool isHLTPathAccepted(std::string pathName)
edm::Handle< reco::CaloJetCollection > calojetColl_
int k[5][pyjets_maxn]
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
void dqmBeginRun(edm::Run const &run, edm::EventSetup const &c) override
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
virtual void fillMEforMonTriggerSummary(const edm::Event &iEvent, const edm::EventSetup &)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
#define N
Definition: blowfish.cc:9
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
T const * product() const
Definition: Handle.h:81
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
met
===> hadronic RAZOR
edm::EDGetTokenT< reco::PFMETCollection > pfMetToken
std::vector< size_type > Keys
PathInfoCollection hltPathsAll_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const std::string getL1ConditionModuleName(const std::string &pathname)
edm::Handle< trigger::TriggerEvent > triggerObj_
MonitorElement * correlation_AllWrtMB
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken
et
define resolution functions of each parameter
std::string const & label() const
Definition: InputTag.h:36
edm::EventID id() const
Definition: EventBase.h:60
fixed size matrix
HLT enums.
edm::Handle< reco::CaloMETCollection > calometColl_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
virtual void fillMEforEffAllTrigger(const edm::Event &iEvent, const edm::EventSetup &)
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
double phi() const final
momentum azimuthal angle
reco::helper::JetIDHelper * jetID
std::string const & instance() const
Definition: InputTag.h:37
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
edm::EDGetTokenT< reco::JetCorrector > PFJetCorToken_
Definition: Run.h:43
PathInfoCollection hltPathsEff_
Collection of PF MET.