test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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(std::vector<edm::ParameterSet>::iterator pathconf = paths.begin() ; pathconf != paths.end(); pathconf++) {
95  custompathnamepairs_.push_back(make_pair(
96  pathconf->getParameter<std::string>("pathname"),
97  pathconf->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  CaloJetCollection::const_iterator calojet_ = calojet.begin();
211  for(; calojet_ != calojet.end(); ++calojet_){
212  double scale = calocorrector->correction(*calojet_);
213  jetID->calculate(iEvent, *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  PFJetCollection::const_iterator 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(size_t i=0;i<MuonTrigPaths_.size();++i){
319  const unsigned int nPath(hltConfig_.size());
320  for (unsigned int j=0; j!=nPath; ++j) {
322  if(pathname.find(MuonTrigPaths_[i]) != 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(size_t i=0;i<MBTrigPaths_.size();++i){
335  const unsigned int nPath(hltConfig_.size());
336  for (unsigned int j=0; j!=nPath; ++j) {
338  if(pathname.find(MBTrigPaths_[i]) != 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  PathInfoCollection::iterator 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(PathInfoCollection::iterator 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 (VertexCollection::const_iterator itv=Vtx->begin(); itv!=Vtx->end(); itv++){
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(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
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().compare("SingleJet_Trigger") == 0) && (calojetColl_.isValid()) && calojet.size()){
427  CaloJetCollection::const_iterator 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().compare("DiJet_Trigger") == 0) && calojetColl_.isValid() && calojet.size()){
435  v->getMEhisto_JetSize()->Fill(calojet.size());
436  if (calojet.size()>=2){
437  CaloJetCollection::const_iterator jet = calojet.begin();
438  CaloJetCollection::const_iterator jet2= calojet.begin(); jet2++;
439  double jet3pt = 0.;
440  if(calojet.size()>2){
441  CaloJetCollection::const_iterator 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().compare("MET_Trigger") == 0)|| (v->getTriggerType().compare("TET_Trigger") == 0)) && 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 
473  const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
474  for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
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().compare("SingleJet_Trigger") == 0)
536  v->getMEhisto_N_L1()->Fill(kl1.size());
537  //
538  trigger::Keys::const_iterator 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().compare("SingleJet_Trigger") == 0){
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().compare("SingleJet_Trigger") == 0)
574  v->getMEhisto_N_HLT()->Fill(khlt.size());
575  //
576  trigger::Keys::const_iterator 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().compare("DiJet_Trigger") == 0))
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().compare("SingleJet_Trigger") == 0){
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().compare("DiJet_Trigger") == 0) && hltTrigBool)) && !diJetFire){
626  if(v->getTriggerType().compare("SingleJet_Trigger") == 0){
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().compare("PFJet") == 0)){
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().compare("SingleJet_Trigger") == 0){
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().compare("DiJet_Trigger") == 0)){
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().compare("PFJet") != 0)){
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().compare("SingleJet_Trigger") == 0){
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().compare("DiJet_Trigger") == 0)){
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().compare("DiJet_Trigger") == 0)) 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().compare("DiJet_Trigger") == 0) && 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;
802  const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
803 
804  for(PathInfoCollection::iterator v = hltPathsEff_.begin(); v!= hltPathsEff_.end(); ++v ){
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  char *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().compare("SingleJet_Trigger") == 0) && calojet.size()){ //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(trigger::Keys::const_iterator ki = kl1.begin();ki != kl1.end(); ++ki){
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  trigger::Keys::const_iterator 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().compare("DiJet_Trigger") == 0) && 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().compare("SingleJet_Trigger") == 0) && pfjet.size()){ //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(trigger::Keys::const_iterator ki = kl1.begin();ki != kl1.end(); ++ki){
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(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
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().compare("DiJet_Trigger") == 0) && 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(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
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(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj){
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
1324  //Filter only paths JetMET triggers are interested in
1325  std::vector<std::string>::const_iterator 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  std::vector<std::string>::const_iterator 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(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
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(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
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 (std::vector<std::pair<std::string, std::string> >::iterator custompathnamepair = custompathnamepairs_.begin();
1480  custompathnamepair != custompathnamepairs_.end(); ++custompathnamepair){
1481  std::string pathname = custompathnamepair->first;
1482  std::string dpathname = custompathnamepair->second;
1483  bool numFound = false;
1484  bool denomFound = false;
1485  // Checking if the trigger exist in HLT table or not
1486  for (unsigned int i=0; i!=n; ++i) {
1487  std::string HLTname = hltConfig_.triggerName(i);
1488  if(HLTname.find(pathname)!=std::string::npos){numFound = true; pathname = HLTname;} //changed to get versions
1489  if(HLTname.find(dpathname)!=std::string::npos){denomFound = true; dpathname = HLTname;}
1490  }
1491  if(numFound && denomFound){
1492  if (pathname.find("Jet") != std::string::npos
1493  && !(pathname.find("DiJet") != std::string::npos)
1494  && !(pathname.find("DiPFJet") != std::string::npos)
1495  && !(pathname.find("DoubleJet") != std::string::npos)
1496  && !(pathname.find("BTag") != std::string::npos)
1497  && !(pathname.find("Mu") != std::string::npos)
1498  && !(pathname.find("Fwd") != std::string::npos)){
1499  triggerType = "SingleJet_Trigger";
1500  objectType = trigger::TriggerJet;
1501  }
1502  if (pathname.find("DiJet") != std::string::npos
1503  || pathname.find("DiPFJet") != std::string::npos
1504  || pathname.find("DoubleJet") != std::string::npos ){
1505  triggerType = "DiJet_Trigger";
1506  objectType = trigger::TriggerJet;
1507  }
1508  if (pathname.find("MET") != std::string::npos ){
1509  triggerType = "MET_Trigger";
1510  objectType = trigger::TriggerMET;
1511  }
1512  if (pathname.find("TET") != std::string::npos ){
1513  triggerType = "TET_Trigger";
1514  objectType = trigger::TriggerTET;
1515  }
1516 
1517  l1pathname = getL1ConditionModuleName(pathname); //ml added L1conditionmodulename
1518  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
1519  for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
1520  edm::InputTag testTag(*numpathmodule,"",processname_);
1521  if ((hltConfig_.moduleType(*numpathmodule) == "HLT1CaloJet")
1522  || (hltConfig_.moduleType(*numpathmodule) == "HLT1PFJet")
1523  || (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter")
1524  || (hltConfig_.moduleType(*numpathmodule) == "HLTDiPFJetAveFilter")
1525  || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" )
1526  || (hltConfig_.moduleType(*numpathmodule) == "HLTMhtFilter")
1527  || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )
1528  filtername = *numpathmodule;
1529  }
1530 
1531  if(objectType != 0){
1532  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
1533  for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
1534  edm::InputTag testTag(*numpathmodule,"",processname_);
1535  if ((hltConfig_.moduleType(*numpathmodule) == "HLT1CaloJet")
1536  || (hltConfig_.moduleType(*numpathmodule) == "HLT1PFJet")
1537  || (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter")
1538  || (hltConfig_.moduleType(*numpathmodule) == "HLTDiPFJetAveFilter")
1539  || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" )
1540  || (hltConfig_.moduleType(*numpathmodule) == "HLTMhtFilter")
1541  || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )
1542  Denomfiltername = *numpathmodule;
1543  }
1544 
1545  if(verbose_)cout<<"==pathname=="<<pathname
1546  <<"==denompath=="<<dpathname
1547  <<"==filtername=="<<filtername
1548  <<"==denomfiltername=="<<Denomfiltername
1549  <<"==l1pathname=="<<l1pathname
1550  <<"==objectType=="<<objectType<<endl;
1551  hltPathsEff_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname,
1552  filtername, Denomfiltername, processname_, objectType, triggerType));
1553  }
1554  }
1555  }
1556  }
1557 
1558  if(verbose_)cout<<"== end hltPathsEff_.push_back ======" << endl;
1559 
1560  }
1561 }
1562 
1563 //------------------------------------------------------------------------//
1564 void
1566 {
1567 
1568  if(!isSetup_){
1569 
1570  iBooker.setCurrentFolder(dirname_);
1571 
1572  //-----------------------------------------------------------------
1573  //---book trigger summary histos
1574  if(!isSetup_){
1575  std::string foldernm = "/TriggerSummary/";
1576  iBooker.setCurrentFolder(dirname_ + foldernm);
1577 
1578  int TrigBins_ = hltPathsAllTriggerSummary_.size();
1579  double TrigMin_ = -0.5;
1580  double TrigMax_ = hltPathsAllTriggerSummary_.size()-0.5;
1581 
1582  std::string histonm="JetMET_TriggerRate";
1583  std::string histot="JetMET TriggerRate Summary";
1584  rate_All = iBooker.book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
1585 
1586  histonm = "JetMET_TriggerRate_Correlation";
1587  histot = "JetMET TriggerRate Correlation Summary;y&&!x;x&&y";
1588  correlation_All = iBooker.book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
1589 
1590  histonm = "JetMET_NVertices";
1591  histot = "No. of vertices";
1592  NVertices = iBooker.book1D(histonm.c_str(),histot.c_str(),100,0,50);
1593 
1594  histonm = "JetMET_PVZ";
1595  histot = "Primary Vertex Z pos";
1596  PVZ = iBooker.book1D(histonm.c_str(),histot.c_str(),100,-50.,50.);
1597 
1598  if(runStandalone_){
1599  histonm="JetMET_TriggerRate_WrtMuTrigger";
1600  histot="JetMET TriggerRate Summary Wrt Muon Trigger ";
1601  rate_AllWrtMu = iBooker.book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
1602 
1603  histonm="JetMET_TriggerRate_Correlation_WrtMuTrigger";
1604  histot="JetMET TriggerRate Correlation Summary Wrt Muon Trigger;y&&!x;x&&y";
1605  correlation_AllWrtMu = iBooker.book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
1606 
1607  histonm="JetMET_TriggerRate_WrtMBTrigger";
1608  histot="JetMET TriggerRate Summary Wrt MB Trigger";
1609  rate_AllWrtMB = iBooker.book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
1610 
1611  histonm="JetMET_TriggerRate_Correlation_WrtMBTrigger";
1612  histot="JetMET TriggerRate Correlation Wrt MB Trigger;y&&!x;x&&y";
1613  correlation_AllWrtMB = iBooker.book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
1614  }
1615  isSetup_ = true;
1616  }
1617  //---Set bin label
1618 
1619  for(PathInfoCollection::iterator v = hltPathsAllTriggerSummary_.begin(); v!= hltPathsAllTriggerSummary_.end(); ++v ){
1620  std::string labelnm("dummy");
1621  labelnm = v->getPath();
1622  int nbins = rate_All->getTH1()->GetNbinsX();
1623  for(int ibin=1; ibin<nbins+1; ibin++){
1624  const char * binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
1625  std::string binLabel_str = string(binLabel);
1626  if(binLabel_str.compare(labelnm)==0)break;
1627  if(binLabel[0]=='\0'){
1628  rate_All->setBinLabel(ibin,labelnm);
1629  correlation_All->setBinLabel(ibin,labelnm,1);
1630  correlation_All->setBinLabel(ibin,labelnm,2);
1631  if(runStandalone_){
1632  rate_AllWrtMu->setBinLabel(ibin,labelnm);
1633  rate_AllWrtMB->setBinLabel(ibin,labelnm);
1634  correlation_AllWrtMu->setBinLabel(ibin,labelnm,1);
1635  correlation_AllWrtMB->setBinLabel(ibin,labelnm,1);
1636  correlation_AllWrtMu->setBinLabel(ibin,labelnm,2);
1637  correlation_AllWrtMB->setBinLabel(ibin,labelnm,2);
1638  }
1639  break;
1640  }
1641  }
1642  }
1643 
1644  // Now define histos for All triggers
1645  if(plotAll_){
1646  //
1647  int Nbins_ = 10;
1648  double Nmin_ = -0.5;
1649  double Nmax_ = 9.5;
1650  //
1651  int Ptbins_ = 100;
1652  if(runStandalone_) Ptbins_ = 1000;
1653  double PtMin_ = 0.;
1654  double PtMax_ = 1000.;
1655  //
1656  int Etabins_ = 50;
1657  if(runStandalone_) Etabins_ = 100;
1658  double EtaMin_ = -5.;
1659  double EtaMax_ = 5.;
1660  //
1661  int Phibins_ = 35;
1662  double PhiMin_ = -3.5;
1663  double PhiMax_ = 3.5;
1664 
1665  int Resbins_ = 30;
1666  double ResMin_ = -1.5;
1667  double ResMax_ = 1.5;
1668  //
1669  std::string dirName = dirname_ + "/MonitorAllTriggers/";
1670  for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
1671  //
1672  std::string trgPathName = HLTConfigProvider::removeVersion(v->getPath());
1673  std::string subdirName = dirName + trgPathName;
1674  std::string trigPath = "("+trgPathName+")";
1675  iBooker.setCurrentFolder(subdirName);
1676 
1677  std::string labelname("ME");
1678  std::string histoname(labelname+"");
1679  std::string title(labelname+"");
1680 
1681  MonitorElement *dummy;
1682  dummy = iBooker.bookFloat("dummy");
1683 
1684  if(v->getObjectType() == trigger::TriggerJet && v->getTriggerType().compare("SingleJet_Trigger") == 0){
1685 
1686  histoname = labelname+"_recObjN";
1687  title = labelname+"_recObjN;Reco multiplicity()"+trigPath;
1688  MonitorElement * N = iBooker.book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
1689  N->getTH1();
1690 
1691  histoname = labelname+"_recObjPt";
1692  title = labelname+"_recObjPt; Reco Pt[GeV/c]"+trigPath;
1693  MonitorElement * Pt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1694  Pt->getTH1();
1695 
1696  histoname = labelname+"_recObjPtBarrel";
1697  title = labelname+"_recObjPtBarrel;Reco Pt[GeV/c]"+trigPath;
1698  MonitorElement * PtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1699  PtBarrel->getTH1();
1700 
1701  histoname = labelname+"_recObjPtEndcap";
1702  title = labelname+"_recObjPtEndcap;Reco Pt[GeV/c]"+trigPath;
1703  MonitorElement * PtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1704  PtEndcap->getTH1();
1705 
1706  histoname = labelname+"_recObjPtForward";
1707  title = labelname+"_recObjPtForward;Reco Pt[GeV/c]"+trigPath;
1708  MonitorElement * PtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1709  PtForward->getTH1();
1710 
1711  histoname = labelname+"_recObjEta";
1712  title = labelname+"_recObjEta;Reco #eta"+trigPath;
1713  MonitorElement * Eta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1714  Eta->getTH1();
1715 
1716  histoname = labelname+"_recObjPhi";
1717  title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
1718  MonitorElement * Phi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1719  Phi->getTH1();
1720 
1721  histoname = labelname+"_recObjEtaPhi";
1722  title = labelname+"_recObjEtaPhi;Reco #eta;Reco #Phi"+trigPath;
1723  MonitorElement * EtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
1724  EtaPhi->getTH1();
1725 
1726  histoname = labelname+"_l1ObjPt";
1727  title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
1728  MonitorElement * Pt_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1729  Pt_L1->getTH1();
1730 
1731  histoname = labelname+"_l1ObjEta";
1732  title = labelname+"_l1ObjEta;L1 #eta"+trigPath;
1733  MonitorElement * Eta_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1734  Eta_L1->getTH1();
1735 
1736  histoname = labelname+"_l1ObjPhi";
1737  title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
1738  MonitorElement * Phi_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1739  Phi_L1->getTH1();
1740 
1741  histoname = labelname+"_l1ObjEtaPhi";
1742  title = labelname+"_l1ObjEtaPhi;L1 #eta;L1 #Phi"+trigPath;
1743  MonitorElement * EtaPhi_L1 = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
1744  EtaPhi_L1->getTH1();
1745 
1746  histoname = labelname+"_l1ObjN";
1747  title = labelname+"_l1ObjN;L1 multiplicity"+trigPath;
1748  MonitorElement * N_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
1749  N_L1->getTH1();
1750 
1751  histoname = labelname+"_l1ObjPtBarrel";
1752  title = labelname+"_l1ObjPtBarrel;L1 Pt[GeV/c]"+trigPath;
1753  MonitorElement * PtBarrel_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1754  PtBarrel_L1->getTH1();
1755 
1756  histoname = labelname+"_l1ObjPtEndcap";
1757  title = labelname+"_l1ObjPtEndcap;L1 Pt[GeV/c]"+trigPath;
1758  MonitorElement * PtEndcap_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1759  PtEndcap_L1->getTH1();
1760 
1761  histoname = labelname+"_l1ObjPtForward";
1762  title = labelname+"_l1ObjPtForward;L1 Pt[GeV/c]"+trigPath;
1763  MonitorElement * PtForward_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1764  PtForward_L1->getTH1();
1765 
1766  histoname = labelname+"_hltObjN";
1767  title = labelname+"_hltObjN;HLT multiplicity"+trigPath;
1768  MonitorElement * N_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
1769  N_HLT->getTH1();
1770 
1771  histoname = labelname+"_hltObjPtBarrel";
1772  title = labelname+"_hltObjPtBarrel;HLT Pt[GeV/c]"+trigPath;
1773  MonitorElement * PtBarrel_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1774  PtBarrel_HLT->getTH1();
1775 
1776  histoname = labelname+"_hltObjPtEndcap";
1777  title = labelname+"_hltObjPtEndcap;HLT Pt[GeV/c]"+trigPath;
1778  MonitorElement * PtEndcap_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1779  PtEndcap_HLT->getTH1();
1780 
1781  histoname = labelname+"_hltObjPtForward";
1782  title = labelname+"_hltObjPtForward;HLT Pt[GeV/c]"+trigPath;
1783  MonitorElement * PtForward_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1784  PtForward_HLT->getTH1();
1785 
1786  histoname = labelname+"_hltObjPt";
1787  title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
1788  MonitorElement * Pt_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1789  Pt_HLT->getTH1();
1790 
1791  histoname = labelname+"_hltObjEta";
1792  title = labelname+"_hltObjEta;HLT #eta"+trigPath;
1793  MonitorElement * Eta_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1794  Eta_HLT->getTH1();
1795 
1796  histoname = labelname+"_hltObjPhi";
1797  title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
1798  MonitorElement * Phi_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1799  Phi_HLT->getTH1();
1800 
1801  histoname = labelname+"_hltObjEtaPhi";
1802  title = labelname+"_hltObjEtaPhi;HLT #eta;HLT #Phi"+trigPath;
1803  MonitorElement * EtaPhi_HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
1804  EtaPhi_HLT->getTH1();
1805 
1806  histoname = labelname+"_l1HLTPtResolution";
1807  title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
1808  MonitorElement * PtResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1809  PtResolution_L1HLT->getTH1();
1810 
1811  histoname = labelname+"_l1HLTEtaResolution";
1812  title = labelname+"_l1HLTEtaResolution;#eta(L1)-#eta(HLT)"+trigPath;
1813  MonitorElement * EtaResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1814  EtaResolution_L1HLT->getTH1();
1815 
1816  histoname = labelname+"_l1HLTPhiResolution";
1817  title = labelname+"_l1HLTPhiResolution;#Phi(L1)-#Phi(HLT)"+trigPath;
1818  MonitorElement * PhiResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1819  PhiResolution_L1HLT->getTH1();
1820 
1821  histoname = labelname+"_l1HLTPtCorrelation";
1822  title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
1823  MonitorElement * PtCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
1824  PtCorrelation_L1HLT->getTH1();
1825 
1826  histoname = labelname+"_l1HLTEtaCorrelation";
1827  title = labelname+"_l1HLTEtaCorrelation;#eta(L1);#eta(HLT)"+trigPath;
1828  MonitorElement * EtaCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
1829  EtaCorrelation_L1HLT->getTH1();
1830 
1831  histoname = labelname+"_l1HLTPhiCorrelation";
1832  title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
1833  MonitorElement * PhiCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
1834  PhiCorrelation_L1HLT->getTH1();
1835 
1836  histoname = labelname+"_hltRecObjPtResolution";
1837  title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
1838  MonitorElement * PtResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1839  PtResolution_HLTRecObj->getTH1();
1840 
1841  histoname = labelname+"_hltRecObjEtaResolution";
1842  title = labelname+"_hltRecObjEtaResolution;#eta(HLT)-#eta(Reco)"+trigPath;
1843  MonitorElement * EtaResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1844  EtaResolution_HLTRecObj->getTH1();
1845 
1846  histoname = labelname+"_hltRecObjPhiResolution";
1847  title = labelname+"_hltRecObjPhiResolution;#Phi(HLT)-#Phi(Reco)"+trigPath;
1848  MonitorElement * PhiResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
1849  PhiResolution_HLTRecObj->getTH1();
1850 
1851  histoname = labelname+"_hltRecObjPtCorrelation";
1852  title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
1853  MonitorElement * PtCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
1854  PtCorrelation_HLTRecObj->getTH1();
1855 
1856  histoname = labelname+"_hltRecObjEtaCorrelation";
1857  title = labelname+"_hltRecObjEtaCorrelation;#eta(HLT);#eta(Reco)"+trigPath;
1858  MonitorElement * EtaCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
1859  EtaCorrelation_HLTRecObj->getTH1();
1860 
1861  histoname = labelname+"_hltRecObjPhiCorrelation";
1862  title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
1863  MonitorElement * PhiCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
1864  PhiCorrelation_HLTRecObj->getTH1();
1865 
1866  v->setHistos(N,
1867  Pt,
1868  PtBarrel,
1869  PtEndcap,
1870  PtForward,
1871  Eta,
1872  Phi,
1873  EtaPhi,
1874  N_L1,
1875  Pt_L1,
1876  PtBarrel_L1,
1877  PtEndcap_L1,
1878  PtForward_L1,
1879  Eta_L1,
1880  Phi_L1,
1881  EtaPhi_L1,
1882  N_HLT,
1883  Pt_HLT,
1884  PtBarrel_HLT,
1885  PtEndcap_HLT,
1886  PtForward_HLT,
1887  Eta_HLT,
1888  Phi_HLT,
1889  EtaPhi_HLT,
1890  PtResolution_L1HLT,
1891  EtaResolution_L1HLT,
1892  PhiResolution_L1HLT,
1893  PtResolution_HLTRecObj,
1894  EtaResolution_HLTRecObj,
1895  PhiResolution_HLTRecObj,
1896  PtCorrelation_L1HLT,
1897  EtaCorrelation_L1HLT,
1898  PhiCorrelation_L1HLT,
1899  PtCorrelation_HLTRecObj,
1900  EtaCorrelation_HLTRecObj,
1901  PhiCorrelation_HLTRecObj,
1902  dummy,
1903  dummy,
1904  dummy,
1905  dummy,
1906  dummy,
1907  dummy,
1908  dummy,
1909  dummy,
1910  dummy
1911  );
1912  }// histos for SingleJet Triggers
1913 
1914  if(v->getObjectType() == trigger::TriggerJet && v->getTriggerType().compare("DiJet_Trigger") == 0){
1915 
1916  histoname = labelname+"_RecObjAveragePt";
1917  title = labelname+"_RecObjAveragePt;Reco Average Pt[GeV/c]"+trigPath;
1918  MonitorElement * jetAveragePt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1919  jetAveragePt->getTH1();
1920 
1921  histoname = labelname+"_RecObjAverageEta";
1922  title = labelname+"_RecObjAverageEta;Reco Average #eta"+trigPath;
1923  MonitorElement * jetAverageEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1924  jetAverageEta->getTH1();
1925 
1926  histoname = labelname+"_RecObjPhiDifference";
1927  title = labelname+"_RecObjPhiDifference;Reco #Delta#Phi"+trigPath;
1928  MonitorElement * jetPhiDifference = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1929  jetPhiDifference->getTH1();
1930 
1931  histoname = labelname+"_hltObjAveragePt";
1932  title = labelname+"_hltObjAveragePt;HLT Average Pt[GeV/c]"+trigPath;
1933  MonitorElement * hltAveragePt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1934  hltAveragePt->getTH1();
1935 
1936  histoname = labelname+"_hltObjAverageEta";
1937  title = labelname+"_hltObjAverageEta;HLT Average #eta"+trigPath;
1938  MonitorElement * hltAverageEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
1939  hltAverageEta->getTH1();
1940 
1941  histoname = labelname+"_hltObjPhiDifference";
1942  title = labelname+"_hltObjPhiDifference;Reco #Delta#Phi"+trigPath;
1943  MonitorElement * hltPhiDifference = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
1944  hltPhiDifference->getTH1();
1945 
1946  v->setHistos(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  dummy,
1982  jetAveragePt,
1983  jetAverageEta,
1984  jetPhiDifference,
1985  hltAveragePt,
1986  hltAverageEta,
1987  hltPhiDifference,
1988  dummy,
1989  dummy,
1990  dummy
1991  );
1992  }// histos for DiJet Triggers
1993 
1994  if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){
1995 
1996  histoname = labelname+"_recObjPt";
1997  title = labelname+"_recObjPt;Reco Pt[GeV/c]"+trigPath;
1998  MonitorElement * Pt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
1999  Pt->getTH1();
2000 
2001  histoname = labelname+"_recObjPhi";
2002  title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
2003  MonitorElement * Phi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2004  Phi->getTH1();
2005 
2006  histoname = labelname+"_l1ObjPt";
2007  title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
2008  MonitorElement * Pt_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2009  Pt_L1->getTH1();
2010 
2011  histoname = labelname+"_l1ObjPhi";
2012  title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
2013  MonitorElement * Phi_L1 = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2014  Phi_L1->getTH1();
2015 
2016  histoname = labelname+"_hltObjPt";
2017  title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
2018  MonitorElement * Pt_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2019  Pt_HLT->getTH1();
2020 
2021  histoname = labelname+"_hltObjPhi";
2022  title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
2023  MonitorElement * Phi_HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2024  Phi_HLT->getTH1();
2025 
2026  histoname = labelname+"_l1HLTPtResolution";
2027  title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
2028  MonitorElement * PtResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
2029  PtResolution_L1HLT->getTH1();
2030 
2031  histoname = labelname+"_l1HLTPhiResolution";
2032  title = labelname+"_l1HLTPhiResolution;#Phi(L1)-#Phi(HLT)"+trigPath;
2033  MonitorElement * PhiResolution_L1HLT = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
2034  PhiResolution_L1HLT->getTH1();
2035 
2036  histoname = labelname+"_l1HLTPtCorrelation";
2037  title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
2038  MonitorElement * PtCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
2039  PtCorrelation_L1HLT->getTH1();
2040 
2041  histoname = labelname+"_l1HLTPhiCorrelation";
2042  title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
2043  MonitorElement * PhiCorrelation_L1HLT = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
2044  PhiCorrelation_L1HLT->getTH1();
2045 
2046  histoname = labelname+"_hltRecObjPtResolution";
2047  title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
2048  MonitorElement * PtResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
2049  PtResolution_HLTRecObj->getTH1();
2050 
2051  histoname = labelname+"_hltRecObjPhiResolution";
2052  title = labelname+"_hltRecObjPhiResolution;#Phi(HLT)-#Phi(Reco)"+trigPath;
2053  MonitorElement * PhiResolution_HLTRecObj = iBooker.book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
2054  PhiResolution_HLTRecObj->getTH1();
2055 
2056  histoname = labelname+"_hltRecObjPtCorrelation";
2057  title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
2058  MonitorElement * PtCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
2059  PtCorrelation_HLTRecObj->getTH1();
2060 
2061  histoname = labelname+"_hltRecObjPhiCorrelation";
2062  title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
2063  MonitorElement * PhiCorrelation_HLTRecObj = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
2064  PhiCorrelation_HLTRecObj->getTH1();
2065 
2066  v->setHistos(dummy,
2067  Pt,
2068  dummy,
2069  dummy,
2070  dummy,
2071  dummy,
2072  Phi,
2073  dummy,
2074  dummy,
2075  Pt_L1,
2076  dummy,
2077  dummy,
2078  dummy,
2079  dummy,
2080  Phi_L1,
2081  dummy,
2082  dummy,
2083  Pt_HLT,
2084  dummy,
2085  dummy,
2086  dummy,
2087  dummy,
2088  Phi_HLT,
2089  dummy,
2090  PtResolution_L1HLT,
2091  dummy,
2092  PhiResolution_L1HLT,
2093  PtResolution_HLTRecObj,
2094  dummy,
2095  PhiResolution_HLTRecObj,
2096  PtCorrelation_L1HLT,
2097  dummy,
2098  PhiCorrelation_L1HLT,
2099  PtCorrelation_HLTRecObj,
2100  dummy,
2101  PhiCorrelation_HLTRecObj,
2102  dummy,
2103  dummy,
2104  dummy,
2105  dummy,
2106  dummy,
2107  dummy,
2108  dummy,
2109  dummy,
2110  dummy
2111  );
2112  }// histos for MET Triggers
2113  }
2114  }//plotAll_
2115 
2116  //-------Now Efficiency histos--------
2117  if(plotEff_){
2118  int Ptbins_ = 100;
2119  if(runStandalone_) Ptbins_ = 1000;
2120  double PtMin_ = 0.;
2121  double PtMax_ = 1000.;
2122  //
2123  int Etabins_ = 50;
2124  double EtaMin_ = -5.;
2125  double EtaMax_ = 5.;
2126  //
2127  int Phibins_ = 35;
2128  double PhiMin_ = -3.5;
2129  double PhiMax_ = 3.5;
2130  // Now define histos wrt lower threshold trigger
2131  std::string dirName1 = dirname_ + "/RelativeTriggerEff/";
2132  for(PathInfoCollection::iterator v = hltPathsEff_.begin(); v!= hltPathsEff_.end(); ++v ){
2133  //
2134  std::string trgPathName = HLTConfigProvider::removeVersion(v->getPath());
2135  std::string trgPathNameD = HLTConfigProvider::removeVersion(v->getDenomPath());
2136  //
2137  std::string labelname("ME") ;
2138  std::string subdirName = dirName1 + trgPathName + "_wrt_" + trgPathNameD;
2139  iBooker.setCurrentFolder(subdirName);
2140  //
2141  std::string histoname(labelname+"");
2142  std::string title(labelname+"");
2143 
2144  MonitorElement *dummy;
2145  dummy = iBooker.bookFloat("dummy");
2146 
2147  if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0)){
2148 
2149  histoname = labelname+"_NumeratorPt";
2150  title = labelname+"NumeratorPt;Calo Pt[GeV/c]";
2151  MonitorElement * NumeratorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2152  NumeratorPt->getTH1();
2153 
2154  histoname = labelname+"_NumeratorPtBarrel";
2155  title = labelname+"NumeratorPtBarrel;Calo Pt[GeV/c] ";
2156  MonitorElement * NumeratorPtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2157  NumeratorPtBarrel->getTH1();
2158 
2159  histoname = labelname+"_NumeratorPtEndcap";
2160  title = labelname+"NumeratorPtEndcap;Calo Pt[GeV/c]";
2161  MonitorElement * NumeratorPtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2162  NumeratorPtEndcap->getTH1();
2163 
2164  histoname = labelname+"_NumeratorPtForward";
2165  title = labelname+"NumeratorPtForward;Calo Pt[GeV/c]";
2166  MonitorElement * NumeratorPtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2167  NumeratorPtForward->getTH1();
2168 
2169  histoname = labelname+"_NumeratorEta";
2170  title = labelname+"NumeratorEta;Calo #eta ";
2171  MonitorElement * NumeratorEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2172  NumeratorEta->getTH1();
2173 
2174  histoname = labelname+"_NumeratorPhi";
2175  title = labelname+"NumeratorPhi;Calo #Phi";
2176  MonitorElement * NumeratorPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2177  NumeratorPhi->getTH1();
2178 
2179  histoname = labelname+"_NumeratorEtaPhi";
2180  title = labelname+"NumeratorEtaPhi;Calo #eta;Calo #Phi";
2181  MonitorElement * NumeratorEtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2182  NumeratorEtaPhi->getTH1();
2183 
2184  histoname = labelname+"_NumeratorEtaBarrel";
2185  title = labelname+"NumeratorEtaBarrel;Calo #eta ";
2186  MonitorElement * NumeratorEtaBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2187  NumeratorEtaBarrel->getTH1();
2188 
2189  histoname = labelname+"_NumeratorPhiBarrel";
2190  title = labelname+"NumeratorPhiBarrel;Calo #Phi";
2191  MonitorElement * NumeratorPhiBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2192  NumeratorPhiBarrel->getTH1();
2193 
2194  histoname = labelname+"_NumeratorEtaEndcap";
2195  title = labelname+"NumeratorEtaEndcap;Calo #eta ";
2196  MonitorElement * NumeratorEtaEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2197  NumeratorEtaEndcap->getTH1();
2198 
2199  histoname = labelname+"_NumeratorPhiEndcap";
2200  title = labelname+"NumeratorPhiEndcap;Calo #Phi";
2201  MonitorElement * NumeratorPhiEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2202  NumeratorPhiEndcap->getTH1();
2203 
2204  histoname = labelname+"_NumeratorEtaForward";
2205  title = labelname+"NumeratorEtaForward;Calo #eta ";
2206  MonitorElement * NumeratorEtaForward = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2207  NumeratorEtaForward->getTH1();
2208 
2209  histoname = labelname+"_NumeratorPhiForward";
2210  title = labelname+"NumeratorPhiForward;Calo #Phi";
2211  MonitorElement * NumeratorPhiForward = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2212  NumeratorPhiForward->getTH1();
2213 
2214  histoname = labelname+"_NumeratorEta_LowpTcut";
2215  title = labelname+"NumeratorEta_LowpTcut;Calo #eta ";
2216  MonitorElement * NumeratorEta_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2217  NumeratorEta_LowpTcut->getTH1();
2218 
2219  histoname = labelname+"_NumeratorPhi_LowpTcut";
2220  title = labelname+"NumeratorPhi_LowpTcut;Calo #Phi";
2221  MonitorElement * NumeratorPhi_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2222  NumeratorPhi_LowpTcut->getTH1();
2223 
2224  histoname = labelname+"_NumeratorEtaPhi_LowpTcut";
2225  title = labelname+"NumeratorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
2226  MonitorElement * NumeratorEtaPhi_LowpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2227  NumeratorEtaPhi_LowpTcut->getTH1();
2228 
2229  histoname = labelname+"_NumeratorEta_MedpTcut";
2230  title = labelname+"NumeratorEta_MedpTcut;Calo #eta ";
2231  MonitorElement * NumeratorEta_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2232  NumeratorEta_MedpTcut->getTH1();
2233 
2234  histoname = labelname+"_NumeratorPhi_MedpTcut";
2235  title = labelname+"NumeratorPhi_MedpTcut;Calo #Phi";
2236  MonitorElement * NumeratorPhi_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2237  NumeratorPhi_MedpTcut->getTH1();
2238 
2239  histoname = labelname+"_NumeratorEtaPhi_MedpTcut";
2240  title = labelname+"NumeratorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
2241  MonitorElement * NumeratorEtaPhi_MedpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2242  NumeratorEtaPhi_MedpTcut->getTH1();
2243 
2244  histoname = labelname+"_NumeratorEta_HighpTcut";
2245  title = labelname+"NumeratorEta_HighpTcut;Calo #eta ";
2246  MonitorElement * NumeratorEta_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2247  NumeratorEta_HighpTcut->getTH1();
2248 
2249  histoname = labelname+"_NumeratorPhi_HighpTcut";
2250  title = labelname+"NumeratorPhi_HighpTcut;Calo #Phi";
2251  MonitorElement * NumeratorPhi_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2252  NumeratorPhi_HighpTcut->getTH1();
2253 
2254  histoname = labelname+"_NumeratorEtaPhi_HighpTcut";
2255  title = labelname+"NumeratorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
2256  MonitorElement * NumeratorEtaPhi_HighpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2257  NumeratorEtaPhi_HighpTcut->getTH1();
2258 
2259  histoname = labelname+"_DenominatorPt";
2260  title = labelname+"DenominatorPt;Calo Pt[GeV/c]";
2261  MonitorElement * DenominatorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2262  DenominatorPt->getTH1();
2263 
2264  histoname = labelname+"_DenominatorPtBarrel";
2265  title = labelname+"DenominatorPtBarrel;Calo Pt[GeV/c]";
2266  MonitorElement * DenominatorPtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2267  DenominatorPtBarrel->getTH1();
2268 
2269  histoname = labelname+"_DenominatorPtEndcap";
2270  title = labelname+"DenominatorPtEndcap;Calo Pt[GeV/c]";
2271  MonitorElement * DenominatorPtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2272  DenominatorPtEndcap->getTH1();
2273 
2274  histoname = labelname+"_DenominatorPtForward";
2275  title = labelname+"DenominatorPtForward;Calo Pt[GeV/c] ";
2276  MonitorElement * DenominatorPtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2277  DenominatorPtForward->getTH1();
2278 
2279  histoname = labelname+"_DenominatorEta";
2280  title = labelname+"DenominatorEta;Calo #eta ";
2281  MonitorElement * DenominatorEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2282  DenominatorEta->getTH1();
2283 
2284  histoname = labelname+"_DenominatorPhi";
2285  title = labelname+"DenominatorPhi;Calo #Phi";
2286  MonitorElement * DenominatorPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2287  DenominatorPhi->getTH1();
2288 
2289  histoname = labelname+"_DenominatorEtaPhi";
2290  title = labelname+"DenominatorEtaPhi;Calo #eta; Calo #Phi";
2291  MonitorElement * DenominatorEtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2292  DenominatorEtaPhi->getTH1();
2293 
2294  histoname = labelname+"_DenominatorEtaBarrel";
2295  title = labelname+"DenominatorEtaBarrel;Calo #eta ";
2296  MonitorElement * DenominatorEtaBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2297  DenominatorEtaBarrel->getTH1();
2298 
2299  histoname = labelname+"_DenominatorPhiBarrel";
2300  title = labelname+"DenominatorPhiBarrel;Calo #Phi";
2301  MonitorElement * DenominatorPhiBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2302  DenominatorPhiBarrel->getTH1();
2303 
2304  histoname = labelname+"_DenominatorEtaEndcap";
2305  title = labelname+"DenominatorEtaEndcap;Calo #eta ";
2306  MonitorElement * DenominatorEtaEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2307  DenominatorEtaEndcap->getTH1();
2308 
2309  histoname = labelname+"_DenominatorPhiEndcap";
2310  title = labelname+"DenominatorPhiEndcap;Calo #Phi";
2311  MonitorElement * DenominatorPhiEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2312  DenominatorPhiEndcap->getTH1();
2313 
2314  histoname = labelname+"_DenominatorEtaForward";
2315  title = labelname+"DenominatorEtaForward;Calo #eta ";
2316  MonitorElement * DenominatorEtaForward = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2317  DenominatorEtaForward->getTH1();
2318 
2319  histoname = labelname+"_DenominatorPhiForward";
2320  title = labelname+"DenominatorPhiForward;Calo #Phi";
2321  MonitorElement * DenominatorPhiForward = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2322  DenominatorPhiForward->getTH1();
2323 
2324  histoname = labelname+"_DenominatorEta_LowpTcut";
2325  title = labelname+"DenominatorEta_LowpTcut;Calo #eta ";
2326  MonitorElement * DenominatorEta_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2327  DenominatorEta_LowpTcut->getTH1();
2328 
2329  histoname = labelname+"_DenominatorPhi_LowpTcut";
2330  title = labelname+"DenominatorPhi_LowpTcut;Calo #Phi";
2331  MonitorElement * DenominatorPhi_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2332  DenominatorPhi_LowpTcut->getTH1();
2333 
2334  histoname = labelname+"_DenominatorEtaPhi_LowpTcut";
2335  title = labelname+"DenominatorEtaPhi_LowpTcut;Calo #eta;Calo #Phi";
2336  MonitorElement * DenominatorEtaPhi_LowpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2337  DenominatorEtaPhi_LowpTcut->getTH1();
2338 
2339  histoname = labelname+"_DenominatorEta_MedpTcut";
2340  title = labelname+"DenominatorEta_MedpTcut;Calo #eta ";
2341  MonitorElement * DenominatorEta_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2342  DenominatorEta_MedpTcut->getTH1();
2343 
2344  histoname = labelname+"_DenominatorPhi_MedpTcut";
2345  title = labelname+"DenominatorPhi_MedpTcut;Calo #Phi";
2346  MonitorElement * DenominatorPhi_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2347  DenominatorPhi_MedpTcut->getTH1();
2348 
2349  histoname = labelname+"_DenominatorEtaPhi_MedpTcut";
2350  title = labelname+"DenominatorEtaPhi_MedpTcut;Calo #eta;Calo #Phi";
2351  MonitorElement * DenominatorEtaPhi_MedpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2352  DenominatorEtaPhi_MedpTcut->getTH1();
2353 
2354  histoname = labelname+"_DenominatorEta_HighpTcut";
2355  title = labelname+"DenominatorEta_HighpTcut;Calo #eta ";
2356  MonitorElement * DenominatorEta_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2357  DenominatorEta_HighpTcut->getTH1();
2358 
2359  histoname = labelname+"_DenominatorPhi_HighpTcut";
2360  title = labelname+"DenominatorPhi_HighpTcut;Calo #Phi";
2361  MonitorElement * DenominatorPhi_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2362  DenominatorPhi_HighpTcut->getTH1();
2363 
2364  histoname = labelname+"_DenominatorEtaPhi_HighpTcut";
2365  title = labelname+"DenominatorEtaPhi_HighpTcut;Calo #eta;Calo #Phi";
2366  MonitorElement * DenominatorEtaPhi_HighpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2367  DenominatorEtaPhi_HighpTcut->getTH1();
2368 
2369  histoname = labelname+"_DeltaR";
2370  title = labelname+"DeltaR;";
2371  MonitorElement * DeltaR = iBooker.book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
2372  DeltaR->getTH1();
2373 
2374  histoname = labelname+"_DeltaPhi";
2375  title = labelname+"DeltaPhi;";
2376  MonitorElement * DeltaPhi = iBooker.book1D(histoname.c_str(),title.c_str(),500,-5.0,5.0);
2377  DeltaPhi->getTH1();
2378 
2379  histoname = labelname+"_NumeratorPFMHT";
2380  title = labelname+"NumeratorPFMHT;PFMHT[GeV/c]";
2381  MonitorElement * NumeratorPFMHT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2382  NumeratorPFMHT->getTH1();
2383 
2384  histoname = labelname+"_NumeratorPFPt";
2385  title = labelname+"NumeratorPFPt;PF Pt[GeV/c]";
2386  MonitorElement * NumeratorPFPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2387  NumeratorPFPt->getTH1();
2388 
2389  histoname = labelname+"_NumeratorPFPtBarrel";
2390  title = labelname+"NumeratorPFPtBarrel;PF Pt[GeV/c] ";
2391  MonitorElement * NumeratorPFPtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2392  NumeratorPFPtBarrel->getTH1();
2393 
2394  histoname = labelname+"_NumeratorPFPtEndcap";
2395  title = labelname+"NumeratorPFPtEndcap;PF Pt[GeV/c]";
2396  MonitorElement * NumeratorPFPtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2397  NumeratorPFPtEndcap->getTH1();
2398 
2399  histoname = labelname+"_NumeratorPFPtForward";
2400  title = labelname+"NumeratorPFPtForward;PF Pt[GeV/c]";
2401  MonitorElement * NumeratorPFPtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2402  NumeratorPFPtForward->getTH1();
2403 
2404  histoname = labelname+"_NumeratorPFEta";
2405  title = labelname+"NumeratorPFEta;PF #eta ";
2406  MonitorElement * NumeratorPFEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2407  NumeratorPFEta->getTH1();
2408 
2409  histoname = labelname+"_NumeratorPFPhi";
2410  title = labelname+"NumeratorPFPhi;Calo #Phi";
2411  MonitorElement * NumeratorPFPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2412  NumeratorPFPhi->getTH1();
2413 
2414  histoname = labelname+"_NumeratorPFEtaPhi";
2415  title = labelname+"NumeratorPFEtaPhi;PF #eta;Calo #Phi";
2416  MonitorElement * NumeratorPFEtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2417  NumeratorPFEtaPhi->getTH1();
2418 
2419  histoname = labelname+"_NumeratorPFEtaBarrel";
2420  title = labelname+"NumeratorPFEtaBarrel;PF #eta ";
2421  MonitorElement * NumeratorPFEtaBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2422  NumeratorPFEtaBarrel->getTH1();
2423 
2424  histoname = labelname+"_NumeratorPFPhiBarrel";
2425  title = labelname+"NumeratorPFPhiBarrel;PF #Phi";
2426  MonitorElement * NumeratorPFPhiBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2427  NumeratorPFPhiBarrel->getTH1();
2428 
2429  histoname = labelname+"_NumeratorPFEtaEndcap";
2430  title = labelname+"NumeratorPFEtaEndcap;Calo #eta ";
2431  MonitorElement * NumeratorPFEtaEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2432  NumeratorPFEtaEndcap->getTH1();
2433 
2434  histoname = labelname+"_NumeratorPFPhiEndcap";
2435  title = labelname+"NumeratorPFPhiEndcap;PF #Phi";
2436  MonitorElement * NumeratorPFPhiEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2437  NumeratorPFPhiEndcap->getTH1();
2438 
2439  histoname = labelname+"_NumeratorPFEtaForward";
2440  title = labelname+"NumeratorPFEtaForward;Calo #eta ";
2441  MonitorElement * NumeratorPFEtaForward = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2442  NumeratorPFEtaForward->getTH1();
2443 
2444  histoname = labelname+"_NumeratorPFPhiForward";
2445  title = labelname+"NumeratorPFPhiForward;PF #Phi";
2446  MonitorElement * NumeratorPFPhiForward = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2447  NumeratorPFPhiForward->getTH1();
2448 
2449  histoname = labelname+"_NumeratorPFEta_LowpTcut";
2450  title = labelname+"NumeratorPFEta_LowpTcut;PF #eta ";
2451  MonitorElement * NumeratorPFEta_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2452  NumeratorPFEta_LowpTcut->getTH1();
2453 
2454  histoname = labelname+"_NumeratorPFPhi_LowpTcut";
2455  title = labelname+"NumeratorPFPhi_LowpTcut;PF #Phi";
2456  MonitorElement * NumeratorPFPhi_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2457  NumeratorPFPhi_LowpTcut->getTH1();
2458 
2459  histoname = labelname+"_NumeratorPFEtaPhi_LowpTcut";
2460  title = labelname+"NumeratorPFEtaPhi_LowpTcut;PF #eta;Calo #Phi";
2461  MonitorElement * NumeratorPFEtaPhi_LowpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2462  NumeratorPFEtaPhi_LowpTcut->getTH1();
2463 
2464  histoname = labelname+"_NumeratorPFEta_MedpTcut";
2465  title = labelname+"NumeratorPFEta_MedpTcut;PF #eta ";
2466  MonitorElement * NumeratorPFEta_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2467  NumeratorPFEta_MedpTcut->getTH1();
2468 
2469  histoname = labelname+"_NumeratorPFPhi_MedpTcut";
2470  title = labelname+"NumeratorPFPhi_MedpTcut;PF #Phi";
2471  MonitorElement * NumeratorPFPhi_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2472  NumeratorPFPhi_MedpTcut->getTH1();
2473 
2474  histoname = labelname+"_NumeratorPFEtaPhi_MedpTcut";
2475  title = labelname+"NumeratorPFEtaPhi_MedpTcut;PF #eta;PF #Phi";
2476  MonitorElement * NumeratorPFEtaPhi_MedpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2477  NumeratorPFEtaPhi_MedpTcut->getTH1();
2478 
2479  histoname = labelname+"_NumeratorPFEta_HighpTcut";
2480  title = labelname+"NumeratorPFEta_HighpTcut;Calo #eta ";
2481  MonitorElement * NumeratorPFEta_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2482  NumeratorPFEta_HighpTcut->getTH1();
2483 
2484  histoname = labelname+"_NumeratorPFPhi_HighpTcut";
2485  title = labelname+"NumeratorPFPhi_HighpTcut;PF #Phi";
2486  MonitorElement * NumeratorPFPhi_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2487  NumeratorPFPhi_HighpTcut->getTH1();
2488 
2489  histoname = labelname+"_NumeratorPFEtaPhi_HighpTcut";
2490  title = labelname+"NumeratorPFEtaPhi_HighpTcut;PF #eta;PF #Phi";
2491  MonitorElement * NumeratorPFEtaPhi_HighpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2492  NumeratorPFEtaPhi_HighpTcut->getTH1();
2493 
2494  histoname = labelname+"_DenominatorPFMHT";
2495  title = labelname+"DenominatorPFMHT;PF Pt[GeV/c]";
2496  MonitorElement * DenominatorPFMHT = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2497  DenominatorPFMHT->getTH1();
2498 
2499  histoname = labelname+"_DenominatorPFPt";
2500  title = labelname+"DenominatorPFPt;PF Pt[GeV/c]";
2501  MonitorElement * DenominatorPFPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2502  DenominatorPFPt->getTH1();
2503 
2504  histoname = labelname+"_DenominatorPFPtBarrel";
2505  title = labelname+"DenominatorPFPtBarrel;Calo Pt[GeV/c]";
2506  MonitorElement * DenominatorPFPtBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2507  DenominatorPFPtBarrel->getTH1();
2508 
2509  histoname = labelname+"_DenominatorPFPtEndcap";
2510  title = labelname+"DenominatorPFPtEndcap;PF Pt[GeV/c]";
2511  MonitorElement * DenominatorPFPtEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2512  DenominatorPFPtEndcap->getTH1();
2513 
2514  histoname = labelname+"_DenominatorPFPtForward";
2515  title = labelname+"DenominatorPFPtForward;PF Pt[GeV/c] ";
2516  MonitorElement * DenominatorPFPtForward = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2517  DenominatorPFPtForward->getTH1();
2518 
2519  histoname = labelname+"_DenominatorPFEta";
2520  title = labelname+"DenominatorPFEta;PF #eta ";
2521  MonitorElement * DenominatorPFEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2522  DenominatorPFEta->getTH1();
2523 
2524  histoname = labelname+"_DenominatorPFPhi";
2525  title = labelname+"DenominatorPFPhi;PF #Phi";
2526  MonitorElement * DenominatorPFPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2527  DenominatorPFPhi->getTH1();
2528 
2529  histoname = labelname+"_DenominatorPFEtaPhi";
2530  title = labelname+"DenominatorPFEtaPhi;PF #eta; Calo #Phi";
2531  MonitorElement * DenominatorPFEtaPhi = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2532  DenominatorPFEtaPhi->getTH1();
2533 
2534  histoname = labelname+"_DenominatorPFEtaBarrel";
2535  title = labelname+"DenominatorPFEtaBarrel;Calo #eta ";
2536  MonitorElement * DenominatorPFEtaBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2537  DenominatorPFEtaBarrel->getTH1();
2538 
2539  histoname = labelname+"_DenominatorPFPhiBarrel";
2540  title = labelname+"DenominatorPFPhiBarrel;PF #Phi";
2541  MonitorElement * DenominatorPFPhiBarrel = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2542  DenominatorPFPhiBarrel->getTH1();
2543 
2544  histoname = labelname+"_DenominatorPFEtaEndcap";
2545  title = labelname+"DenominatorPFEtaEndcap;PF #eta ";
2546  MonitorElement * DenominatorPFEtaEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2547  DenominatorPFEtaEndcap->getTH1();
2548 
2549  histoname = labelname+"_DenominatorPFPhiEndcap";
2550  title = labelname+"DenominatorPFPhiEndcap;Calo #Phi";
2551  MonitorElement * DenominatorPFPhiEndcap = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2552  DenominatorPFPhiEndcap->getTH1();
2553 
2554  histoname = labelname+"_DenominatorPFEtaForward";
2555  title = labelname+"DenominatorPFEtaForward;PF #eta ";
2556  MonitorElement * DenominatorPFEtaForward = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2557  DenominatorPFEtaForward->getTH1();
2558 
2559  histoname = labelname+"_DenominatorPFPhiForward";
2560  title = labelname+"DenominatorPFPhiForward;PF #Phi";
2561  MonitorElement * DenominatorPFPhiForward = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2562  DenominatorPFPhiForward->getTH1();
2563 
2564  histoname = labelname+"_DenominatorPFEta_LowpTcut";
2565  title = labelname+"DenominatorPFEta_LowpTcut;PF #eta ";
2566  MonitorElement * DenominatorPFEta_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2567  DenominatorPFEta_LowpTcut->getTH1();
2568 
2569  histoname = labelname+"_DenominatorPFPhi_LowpTcut";
2570  title = labelname+"DenominatorPFPhi_LowpTcut;PF #Phi";
2571  MonitorElement * DenominatorPFPhi_LowpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2572  DenominatorPFPhi_LowpTcut->getTH1();
2573 
2574  histoname = labelname+"_DenominatorPFEtaPhi_LowpTcut";
2575  title = labelname+"DenominatorPFEtaPhi_LowpTcut;PF #eta;Calo #Phi";
2576  MonitorElement * DenominatorPFEtaPhi_LowpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2577  DenominatorPFEtaPhi_LowpTcut->getTH1();
2578 
2579  histoname = labelname+"_DenominatorPFEta_MedpTcut";
2580  title = labelname+"DenominatorPFEta_MedpTcut;PF #eta ";
2581  MonitorElement * DenominatorPFEta_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2582  DenominatorPFEta_MedpTcut->getTH1();
2583 
2584  histoname = labelname+"_DenominatorPFPhi_MedpTcut";
2585  title = labelname+"DenominatorPFPhi_MedpTcut;PF #Phi";
2586  MonitorElement * DenominatorPFPhi_MedpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2587  DenominatorPFPhi_MedpTcut->getTH1();
2588 
2589  histoname = labelname+"_DenominatorPFEtaPhi_MedpTcut";
2590  title = labelname+"DenominatorPFEtaPhi_MedpTcut;PF #eta;Calo #Phi";
2591  MonitorElement * DenominatorPFEtaPhi_MedpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2592  DenominatorPFEtaPhi_MedpTcut->getTH1();
2593 
2594  histoname = labelname+"_DenominatorPFEta_HighpTcut";
2595  title = labelname+"DenominatorPFEta_HighpTcut;PF #eta ";
2596  MonitorElement * DenominatorPFEta_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2597  DenominatorPFEta_HighpTcut->getTH1();
2598 
2599  histoname = labelname+"_DenominatorPFPhi_HighpTcut";
2600  title = labelname+"DenominatorPFPhi_HighpTcut;PF #Phi";
2601  MonitorElement * DenominatorPFPhi_HighpTcut = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2602  DenominatorPFPhi_HighpTcut->getTH1();
2603 
2604  histoname = labelname+"_DenominatorPFEtaPhi_HighpTcut";
2605  title = labelname+"DenominatorPFEtaPhi_HighpTcut;PF #eta;Calo #Phi";
2606  MonitorElement * DenominatorPFEtaPhi_HighpTcut = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
2607  DenominatorPFEtaPhi_HighpTcut->getTH1();
2608 
2609  histoname = labelname+"_PFDeltaR";
2610  title = labelname+"PFDeltaR;";
2611  MonitorElement * PFDeltaR = iBooker.book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
2612  PFDeltaR->getTH1();
2613 
2614  histoname = labelname+"_PFDeltaPhi";
2615  title = labelname+"PFDeltaPhi;";
2616  MonitorElement * PFDeltaPhi = iBooker.book1D(histoname.c_str(),title.c_str(),500,-5.0,5.0);
2617  PFDeltaPhi->getTH1();
2618 
2619  v->setEffHistos(NumeratorPt,
2620  NumeratorPtBarrel,
2621  NumeratorPtEndcap,
2622  NumeratorPtForward,
2623  NumeratorEta,
2624  NumeratorPhi,
2625  NumeratorEtaPhi,
2626  //
2627  NumeratorEtaBarrel,
2628  NumeratorPhiBarrel,
2629  NumeratorEtaEndcap,
2630  NumeratorPhiEndcap,
2631  NumeratorEtaForward,
2632  NumeratorPhiForward,
2633  NumeratorEta_LowpTcut,
2634  NumeratorPhi_LowpTcut,
2635  NumeratorEtaPhi_LowpTcut,
2636  NumeratorEta_MedpTcut,
2637  NumeratorPhi_MedpTcut,
2638  NumeratorEtaPhi_MedpTcut,
2639  NumeratorEta_HighpTcut,
2640  NumeratorPhi_HighpTcut,
2641  NumeratorEtaPhi_HighpTcut,
2642  //
2643  DenominatorPt,
2644  DenominatorPtBarrel,
2645  DenominatorPtEndcap,
2646  DenominatorPtForward,
2647  DenominatorEta,
2648  DenominatorPhi,
2649  DenominatorEtaPhi,
2650  //
2651  DenominatorEtaBarrel,
2652  DenominatorPhiBarrel,
2653  DenominatorEtaEndcap,
2654  DenominatorPhiEndcap,
2655  DenominatorEtaForward,
2656  DenominatorPhiForward,
2657  DenominatorEta_LowpTcut,
2658  DenominatorPhi_LowpTcut,
2659  DenominatorEtaPhi_LowpTcut,
2660  DenominatorEta_MedpTcut,
2661  DenominatorPhi_MedpTcut,
2662  DenominatorEtaPhi_MedpTcut,
2663  DenominatorEta_HighpTcut,
2664  DenominatorPhi_HighpTcut,
2665  DenominatorEtaPhi_HighpTcut,
2666  DeltaR,
2667  DeltaPhi,
2668  //
2669  NumeratorPFPt,
2670  NumeratorPFMHT,
2671  NumeratorPFPtBarrel,
2672  NumeratorPFPtEndcap,
2673  NumeratorPFPtForward,
2674  NumeratorPFEta,
2675  NumeratorPFPhi,
2676  NumeratorPFEtaPhi,
2677  NumeratorPFEtaBarrel,
2678  NumeratorPFPhiBarrel,
2679  NumeratorPFEtaEndcap,
2680  NumeratorPFPhiEndcap,
2681  NumeratorPFEtaForward,
2682  NumeratorPFPhiForward,
2683  NumeratorPFEta_LowpTcut,
2684  NumeratorPFPhi_LowpTcut,
2685  NumeratorPFEtaPhi_LowpTcut,
2686  NumeratorPFEta_MedpTcut,
2687  NumeratorPFPhi_MedpTcut,
2688  NumeratorPFEtaPhi_MedpTcut,
2689  NumeratorPFEta_HighpTcut,
2690  NumeratorPFPhi_HighpTcut,
2691  NumeratorPFEtaPhi_HighpTcut,
2692  DenominatorPFPt,
2693  DenominatorPFMHT,
2694  DenominatorPFPtBarrel,
2695  DenominatorPFPtEndcap,
2696  DenominatorPFPtForward,
2697  DenominatorPFEta,
2698  DenominatorPFPhi,
2699  DenominatorPFEtaPhi,
2700  DenominatorPFEtaBarrel,
2701  DenominatorPFPhiBarrel,
2702  DenominatorPFEtaEndcap,
2703  DenominatorPFPhiEndcap,
2704  DenominatorPFEtaForward,
2705  DenominatorPFPhiForward,
2706  DenominatorPFEta_LowpTcut,
2707  DenominatorPFPhi_LowpTcut,
2708  DenominatorPFEtaPhi_LowpTcut,
2709  DenominatorPFEta_MedpTcut,
2710  DenominatorPFPhi_MedpTcut,
2711  DenominatorPFEtaPhi_MedpTcut,
2712  DenominatorPFEta_HighpTcut,
2713  DenominatorPFPhi_HighpTcut,
2714  DenominatorPFEtaPhi_HighpTcut,
2715  PFDeltaR,
2716  PFDeltaPhi
2717  );
2718 
2719  }// Loop over Jet Trigger
2720 
2721  if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("DiJet_Trigger") == 0)){
2722 
2723  histoname = labelname+"_NumeratorAvrgPt";
2724  title = labelname+"NumeratorAvrgPt;Calo Pt[GeV/c]";
2725  MonitorElement * NumeratorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2726  NumeratorPt->getTH1();
2727 
2728  histoname = labelname+"_NumeratorAvrgEta";
2729  title = labelname+"NumeratorAvrgEta;Calo #eta";
2730  MonitorElement * NumeratorEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2731  NumeratorEta->getTH1();
2732 
2733  histoname = labelname+"_DenominatorAvrgPt";
2734  title = labelname+"DenominatorAvrgPt;Calo Pt[GeV/c] ";
2735  MonitorElement * DenominatorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2736  DenominatorPt->getTH1();
2737 
2738  histoname = labelname+"_DenominatorAvrgEta";
2739  title = labelname+"DenominatorAvrgEta;Calo #eta";
2740  MonitorElement * DenominatorEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2741  DenominatorEta->getTH1();
2742 
2743  histoname = labelname+"_DeltaR";
2744  title = labelname+"DeltaR;";
2745  MonitorElement * DeltaR = iBooker.book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
2746  DeltaR->getTH1();
2747 
2748  histoname = labelname+"_DeltaPhi";
2749  title = labelname+"DeltaPhi;";
2750  MonitorElement * DeltaPhi = iBooker.book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
2751  DeltaPhi->getTH1();
2752 
2753  //add PF histo: SJ
2754  histoname = labelname+"_NumeratorAvrgPFPt";
2755  title = labelname+"NumeratorAvrgPFPt;PF Pt[GeV/c]";
2756  MonitorElement * NumeratorPFPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2757  NumeratorPFPt->getTH1();
2758 
2759  histoname = labelname+"_NumeratorAvrgPFEta";
2760  title = labelname+"NumeratorAvrgPFEta;PF #eta";
2761  MonitorElement * NumeratorPFEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2762  NumeratorPFEta->getTH1();
2763 
2764  histoname = labelname+"_DenominatorAvrgPFPt";
2765  title = labelname+"DenominatorAvrgPFPt;PF Pt[GeV/c] ";
2766  MonitorElement * DenominatorPFPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2767  DenominatorPFPt->getTH1();
2768 
2769  histoname = labelname+"_DenominatorAvrgPFEta";
2770  title = labelname+"DenominatorAvrgPFEta;PF #eta";
2771  MonitorElement * DenominatorPFEta = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2772  DenominatorPFEta->getTH1();
2773 
2774  histoname = labelname+"_PFDeltaR";
2775  title = labelname+"PFDeltaR;";
2776  MonitorElement * PFDeltaR = iBooker.book1D(histoname.c_str(),title.c_str(),100,0.,1.5);
2777  PFDeltaR->getTH1();
2778 
2779  histoname = labelname+"_PFDeltaPhi";
2780  title = labelname+"PFDeltaPhi;";
2781  MonitorElement * PFDeltaPhi = iBooker.book1D(histoname.c_str(),title.c_str(),500,-5.,5.);
2782  PFDeltaPhi->getTH1();
2783 
2784  v->setEffHistos( 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, dummy, dummy, dummy, dummy, dummy, dummy,
2793  dummy, dummy, dummy, dummy
2794  );
2795  }
2796 
2797  if(v->getObjectType() == trigger::TriggerMET || (v->getObjectType() == trigger::TriggerTET)){
2798 
2799  histoname = labelname+"_NumeratorPt";
2800  if(v->getPath().find("HLT_PFMET")==std::string::npos)
2801  title = labelname+"NumeratorPt; CaloMET[GeV/c]";
2802  else
2803  title = labelname+"NumeratorPt; PFMET[GeV/c]";
2804  MonitorElement * NumeratorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2805  NumeratorPt->getTH1();
2806 
2807  histoname = labelname+"_NumeratorPhi";
2808  title = labelname+"NumeratorPhi; #Phi";
2809  MonitorElement * NumeratorPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2810  NumeratorPhi->getTH1();
2811 
2812  histoname = labelname+"_DenominatorPt";
2813  if(v->getPath().find("HLT_PFMET")==std::string::npos)
2814  title = labelname+"DenominatorPt; CaloMET[GeV/c]";
2815  else
2816  title = labelname+"DenominatorPt; PFMET[GeV/c]";
2817  MonitorElement * DenominatorPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2818  DenominatorPt->getTH1();
2819 
2820  histoname = labelname+"_DenominatorPhi";
2821  title = labelname+"DenominatorPhi; #Phi";
2822  MonitorElement * DenominatorPhi = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2823  DenominatorPhi->getTH1();
2824 
2825  v->setEffHistos( NumeratorPt, dummy, dummy, dummy, dummy, NumeratorPhi, dummy, dummy, dummy, dummy,
2826  dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy, dummy,
2827  dummy, dummy, DenominatorPt, dummy, dummy, dummy, dummy, DenominatorPhi, 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, dummy, dummy, dummy, dummy, dummy, dummy,
2834  dummy, dummy, dummy, dummy
2835  );
2836  }// Loop over MET trigger
2837  }
2838  }//plotEff_
2839 
2840  if(runStandalone_){//runStandalone
2841  //--------Histos to see WHY trigger is NOT fired----------
2842  int Nbins_ = 10;
2843  int Nmin_ = 0;
2844  int Nmax_ = 10;
2845  int Ptbins_ = 1000;
2846  int Etabins_ = 40;
2847  int Phibins_ = 35;
2848  double PtMin_ = 0.;
2849  double PtMax_ = 1000.;
2850  double EtaMin_ = -5.;
2851  double EtaMax_ = 5.;
2852  double PhiMin_ = -3.14159;
2853  double PhiMax_ = 3.14159;
2854 
2855  std::string dirName4_ = dirname_ + "/TriggerNotFired/";
2856  // iBooker.setCurrentFolder(dirName4);
2857 
2858  for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
2859 
2860  MonitorElement *dummy;
2861  dummy = iBooker.bookFloat("dummy");
2862 
2863  std::string labelname("ME") ;
2864  std::string histoname(labelname+"");
2865  std::string title(labelname+"");
2866  iBooker.setCurrentFolder(dirName4_ + v->getPath());
2867 
2868  histoname = labelname+"_TriggerSummary";
2869  title = labelname+"Summary of trigger levels";
2870  MonitorElement * TriggerSummary = iBooker.book1D(histoname.c_str(),title.c_str(),7, -0.5,6.5);
2871 
2872  std::vector<std::string> trigger;
2873  trigger.push_back("Nevt");
2874  trigger.push_back("L1 failed");
2875  trigger.push_back("L1 & HLT failed");
2876  trigger.push_back("L1 failed but not HLT");
2877  trigger.push_back("L1 passed");
2878  trigger.push_back("L1 & HLT passed");
2879  trigger.push_back("L1 passed but not HLT");
2880 
2881  for(unsigned int i =0; i < trigger.size(); i++)
2882  TriggerSummary->setBinLabel(i+1, trigger[i]);
2883 
2884  if((v->getTriggerType().compare("SingleJet_Trigger") == 0)){
2885  histoname = labelname+"_JetPt";
2886  title = labelname+"Leading jet pT;Pt[GeV/c]";
2887  MonitorElement * JetPt = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2888  JetPt->getTH1();
2889 
2890  histoname = labelname+"_JetEtaVsPt";
2891  title = labelname+"Leading jet #eta vs pT;#eta;Pt[GeV/c]";
2892  MonitorElement * JetEtaVsPt = iBooker.book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Ptbins_,PtMin_,PtMax_);
2893  JetEtaVsPt->getTH1();
2894 
2895  histoname = labelname+"_JetPhiVsPt";
2896  title = labelname+"Leading jet #Phi vs pT;#Phi;Pt[GeV/c]";
2897  MonitorElement * JetPhiVsPt = iBooker.book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Ptbins_,PtMin_,PtMax_);
2898  JetPhiVsPt->getTH1();
2899 
2900  v->setDgnsHistos( TriggerSummary, dummy, JetPt, JetEtaVsPt, JetPhiVsPt, dummy, dummy, dummy, dummy, dummy, dummy);
2901  }// single Jet trigger
2902 
2903  if((v->getTriggerType().compare("DiJet_Trigger") == 0)){
2904  histoname = labelname+"_JetSize";
2905  title = labelname+"Jet Size;multiplicity";
2906  MonitorElement * JetSize = iBooker.book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
2907  JetSize->getTH1();
2908 
2909  histoname = labelname+"_AvergPt";
2910  title = labelname+"Average Pt;Pt[GeV/c]";
2911  MonitorElement * Pt12 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2912  Pt12->getTH1();
2913 
2914  histoname = labelname+"_AvergEta";
2915  title = labelname+"Average Eta;#eta";
2916  MonitorElement * Eta12 = iBooker.book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
2917  Eta12->getTH1();
2918 
2919  histoname = labelname+"_PhiDifference";
2920  title = labelname+"#Delta#Phi;#Delta#Phi";
2921  MonitorElement * Phi12 = iBooker.book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
2922  Phi12->getTH1();
2923 
2924  histoname = labelname+"_Pt3Jet";
2925  title = labelname+"Pt of 3rd Jet;Pt[GeV/c]";
2926  MonitorElement * Pt3 = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2927  Pt3->getTH1();
2928 
2929  histoname = labelname+"_Pt12VsPt3Jet";
2930  title = labelname+"Pt of 3rd Jet vs Average Pt of leading jets;Avergage Pt[GeV/c]; Pt of 3rd Jet [GeV/c]";
2931  MonitorElement * Pt12Pt3 = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
2932  Pt12Pt3->getTH1();
2933 
2934  histoname = labelname+"_Pt12VsPhi12";
2935  title = labelname+"Average Pt of leading jets vs #Delta#Phi between leading jets;Avergage Pt[GeV/c]; #Delta#Phi";
2936  MonitorElement * Pt12Phi12 = iBooker.book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Phibins_,PhiMin_,PhiMax_);
2937  Pt12Phi12->getTH1();
2938 
2939  v->setDgnsHistos( TriggerSummary, JetSize, dummy, dummy, dummy, Pt12, Eta12, Phi12, Pt3, Pt12Pt3, Pt12Phi12);
2940  }// Dijet Jet trigger
2941 
2942  if((v->getTriggerType().compare("MET_Trigger") == 0)){
2943  histoname = labelname+"_MET";
2944  title = labelname+"MET;Pt[GeV/c]";
2945  MonitorElement * MET = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2946  MET->getTH1();
2947 
2948  v->setDgnsHistos(TriggerSummary, dummy, MET, dummy, dummy, dummy, dummy, dummy,dummy,dummy,dummy);
2949  } // MET trigger
2950 
2951  if((v->getTriggerType().compare("TET_Trigger") == 0)){
2952  histoname = labelname+"_TET";
2953  title = labelname+"TET;Pt[GeV/c]";
2954  MonitorElement * TET = iBooker.book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
2955  TET->getTH1();
2956 
2957  v->setDgnsHistos(TriggerSummary, dummy, TET, dummy, dummy, dummy, dummy, dummy,dummy,dummy,dummy);
2958  } // TET trigger
2959  }
2960  }//runStandalone
2961 
2962  }
2963 }
2964 //------------------------------------------------------------------------//
2966 {
2967 
2968  // find L1 condition for numpath with numpath objecttype
2969  // find PSet for L1 global seed for numpath,
2970  // list module labels for numpath
2971  std::string l1pathname = "dummy";
2972 
2973  std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
2974 
2975  for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin();
2976  numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
2977 
2978  if (hltConfig_.moduleType(*numpathmodule) == "HLTLevel1GTSeed") {
2979  l1pathname = *numpathmodule;
2980  break;
2981  }
2982  }
2983  return l1pathname;
2984 }
2985 
2986 //------------------------------------------------------------------------//
2988  bool output = false;
2989  if (fabs(eta)<=1.3) output=true;
2990  return output;
2991 }
2992 
2993 //------------------------------------------------------------------------//
2995  bool output = false;
2996  if (fabs(eta)<=3.0 && fabs(eta)>1.3) output=true;
2997  return output;
2998 }
2999 
3000 //------------------------------------------------------------------------//
3002  bool output = false;
3003  if (fabs(eta)>3.0) output=true;
3004  return output;
3005 }
3006 
3007 //------------------------------------------------------------------------//
3009  // hltConfig_ has to be defined first before calling this method
3010  bool output=false;
3011  for (unsigned int j=0; j!=hltConfig_.size(); ++j) {
3012  if (hltConfig_.triggerName(j) == pathname )
3013  output=true;
3014  }
3015  return output;
3016 }
3017 
3018 //------------------------------------------------------------------------//
3020  // triggerResults_, triggerNames_ has to be defined first before calling this method
3021  bool output=false;
3022  if(triggerResults_.isValid()) {
3023  unsigned index = triggerNames_.triggerIndex(pathName);
3024  if(index < triggerNames_.size() && triggerResults_->accept(index)) output = true;
3025  }
3026  return output;
3027 }
3028 
3029 //------------------------------------------------------------------------//
3030 // This returns the position of trigger name defined in summary histograms
3032  int nbins = rate_All->getTH1()->GetNbinsX();
3033  double binVal = -100;
3034  for(int ibin=1; ibin<nbins+1; ibin++)
3035  {
3036  const char * binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
3037  if(binLabel[0]=='\0')continue;
3038  // std::string binLabel_str = string(binLabel);
3039  // if(binLabel_str.compare(trigName)!=0)continue;
3040  if(trigName.compare(binLabel)!=0)continue;
3041 
3042  if(trigName.compare(binLabel)==0){
3043  binVal = rate_All->getTH1()->GetBinCenter(ibin);
3044  break;
3045  }
3046  }
3047  return binVal;
3048 }
3049 
3050 //------------------------------------------------------------------------//
3052  // processname_, triggerObj_ has to be defined before calling this method
3053  bool output=false;
3054  edm::InputTag testTag(objectName,"",processname_);
3055  const int index = triggerObj_->filterIndex(testTag);
3056  if ( index >= triggerObj_->sizeFilters() ) {
3057  edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< index << " of that name ";
3058  } else {
3059  const trigger::Keys & k = triggerObj_->filterKeys(index);
3060  if (k.size()) output=true;
3061  }
3062  return output;
3063 }
3064 //------------------------------------------------------------------------//
#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
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
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.
tuple checkPath
Definition: config.py:11
virtual bool isEndCap(double eta)
const std::string & triggerName(unsigned int triggerIndex) const
JetMETHLTOfflineSource(const edm::ParameterSet &)
const double w
Definition: UKUtility.cc:23
Definition: deltaR.h:57
edm::Handle< reco::PFJetCollection > pfjetColl_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
virtual double TriggerPosition(std::string trigName)
double fHPD() const
Definition: JetIDHelper.h:40
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:62
virtual double phi() const final
momentum azimuthal angle
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)
static const std::string removeVersion(const std::string &trigger)
virtual 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
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
edm::EDGetTokenT< reco::JetCorrector > CaloJetCorToken_
std::vector< std::string > MBTrigPaths_
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
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:115
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
TH1 * getTH1(void) const
edm::EDGetTokenT< reco::CaloMETCollection > caloMetToken
reco::CaloJetCollection calojet
std::vector< std::string > MuonTrigPaths_
bool isValid() const
Definition: HandleBase.h:75
virtual bool isHLTPathAccepted(std::string pathName)
edm::Handle< reco::CaloJetCollection > calojetColl_
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
virtual 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:276
#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:133
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
std::string const & label() const
Definition: InputTag.h:36
edm::EventID id() const
Definition: EventBase.h:59
edm::Handle< reco::CaloMETCollection > calometColl_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual double et() const final
transverse energy
tuple cout
Definition: gather_cfg.py:145
virtual void fillMEforEffAllTrigger(const edm::Event &iEvent, const edm::EventSetup &)
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
volatile std::atomic< bool > shutdown_flag false
reco::helper::JetIDHelper * jetID
std::string const & instance() const
Definition: InputTag.h:37
edm::EDGetTokenT< reco::JetCorrector > PFJetCorToken_
void calculate(const edm::Event &event, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:98
Definition: Run.h:43
PathInfoCollection hltPathsEff_
virtual double pt() const final
transverse momentum
Collection of PF MET.