CMS 3D CMS Logo

METAnalyzer.cc
Go to the documentation of this file.
1 
20 
25 
27 
31 #include <cmath>
32 #include "TH2F.h"
33 #include "TH2.h"
34 
35 #include <string>
36 
37 using namespace edm;
38 using namespace reco;
39 using namespace math;
40 
41 // ***********************************************************
43  parameters = pSet;
44 
45  m_l1algoname_ = pSet.getParameter<std::string>("l1algoname");
46  m_bitAlgTechTrig_ = -1;
47 
48  miniaodfilterdec = -1;
49 
50  LSBegin_ = pSet.getParameter<int>("LSBegin");
51  LSEnd_ = pSet.getParameter<int>("LSEnd");
52  // Smallest track pt
53  ptMinCand_ = pSet.getParameter<double>("ptMinCand");
54 
55  MetType_ = parameters.getUntrackedParameter<std::string>("METType");
56 
57  triggerResultsLabel_ = parameters.getParameter<edm::InputTag>("TriggerResultsLabel");
58  triggerResultsToken_ = consumes<edm::TriggerResults>(edm::InputTag(triggerResultsLabel_));
59 
60  isCaloMet_ = (std::string("calo") == MetType_);
61  //isTCMet_ = (std::string("tc") ==MetType_);
62  isPFMet_ = (std::string("pf") == MetType_);
63  isMiniAODMet_ = (std::string("miniaod") == MetType_);
64  if (!isMiniAODMet_) {
65  jetCorrectorToken_ = consumes<reco::JetCorrector>(pSet.getParameter<edm::InputTag>("JetCorrections"));
66  }
67 
68  // MET information
69  metCollectionLabel_ = parameters.getParameter<edm::InputTag>("METCollectionLabel");
70 
71  if (/*isTCMet_ || */ isCaloMet_) {
72  inputJetIDValueMap = pSet.getParameter<edm::InputTag>("InputJetIDValueMap");
73  jetID_ValueMapToken_ = consumes<edm::ValueMap<reco::JetID> >(inputJetIDValueMap);
75  }
76 
77  if (isPFMet_) {
78  pflowToken_ = consumes<std::vector<reco::PFCandidate> >(pSet.getParameter<edm::InputTag>("srcPFlow"));
80  }
81  if (isMiniAODMet_) {
82  pflowPackedToken_ = consumes<std::vector<pat::PackedCandidate> >(pSet.getParameter<edm::InputTag>("srcPFlow"));
84  }
85  MuonsToken_ = consumes<reco::MuonCollection>(pSet.getParameter<edm::InputTag>("muonsrc"));
86 
87  ptThreshold_ = parameters.getParameter<double>("ptThreshold");
88 
89  if (isPFMet_) {
90  pfMetToken_ = consumes<reco::PFMETCollection>(edm::InputTag(metCollectionLabel_));
91  }
92  if (isCaloMet_) {
93  caloMetToken_ = consumes<reco::CaloMETCollection>(edm::InputTag(metCollectionLabel_));
94  }
95  if (isMiniAODMet_) {
96  patMetToken_ = consumes<pat::METCollection>(edm::InputTag(metCollectionLabel_));
97  }
98  //if(isTCMet_){
99  // tcMetToken_= consumes<reco::METCollection>(edm::InputTag(metCollectionLabel_));
100  //}
101 
102  fill_met_high_level_histo = parameters.getParameter<bool>("fillMetHighLevel");
103  fillCandidateMap_histos = parameters.getParameter<bool>("fillCandidateMaps");
104 
105  hTriggerLabelsIsSet_ = false;
106  //jet cleanup parameters
107  cleaningParameters_ = pSet.getParameter<ParameterSet>("CleaningParameters");
108 
109  diagnosticsParameters_ = pSet.getParameter<std::vector<edm::ParameterSet> >("METDiagonisticsParameters");
110 
111  edm::ConsumesCollector iC = consumesCollector();
112  //DCS
113  DCSFilter_ = new JetMETDQMDCSFilter(parameters.getParameter<ParameterSet>("DCSFilter"), iC);
114 
115  //Vertex requirements
116  bypassAllPVChecks_ = cleaningParameters_.getParameter<bool>("bypassAllPVChecks");
117  bypassAllDCSChecks_ = cleaningParameters_.getParameter<bool>("bypassAllDCSChecks");
118  runcosmics_ = parameters.getUntrackedParameter<bool>("runcosmics");
119  onlyCleaned_ = parameters.getUntrackedParameter<bool>("onlyCleaned");
120  vertexTag_ = cleaningParameters_.getParameter<edm::InputTag>("vertexCollection");
121  vertexToken_ = consumes<std::vector<reco::Vertex> >(edm::InputTag(vertexTag_));
122 
123  //Trigger parameters
124  gtTag_ = cleaningParameters_.getParameter<edm::InputTag>("gtLabel");
125  gtToken_ = consumes<L1GlobalTriggerReadoutRecord>(edm::InputTag(gtTag_));
126 
127  // Other data collections
128  jetCollectionLabel_ = parameters.getParameter<edm::InputTag>("JetCollectionLabel");
129  if (isCaloMet_)
130  caloJetsToken_ = consumes<reco::CaloJetCollection>(jetCollectionLabel_);
131  //if (isTCMet_) jptJetsToken_ = consumes<reco::JPTJetCollection>(jetCollectionLabel_);
132  if (isPFMet_)
133  pfJetsToken_ = consumes<reco::PFJetCollection>(jetCollectionLabel_);
134  if (isMiniAODMet_)
135  patJetsToken_ = consumes<pat::JetCollection>(jetCollectionLabel_);
136 
137  HBHENoiseStringMiniAOD = parameters.getParameter<std::string>("HBHENoiseLabelMiniAOD");
138  HBHEIsoNoiseStringMiniAOD = parameters.getParameter<std::string>("HBHEIsoNoiseLabelMiniAOD");
139 
140  hbheNoiseFilterResultTag_ = parameters.getParameter<edm::InputTag>("HBHENoiseFilterResultLabel");
141  hbheNoiseFilterResultToken_ = consumes<bool>(hbheNoiseFilterResultTag_);
142  hbheNoiseIsoFilterResultTag_ = parameters.getParameter<edm::InputTag>("HBHENoiseIsoFilterResultLabel");
143  hbheIsoNoiseFilterResultToken_ = consumes<bool>(hbheNoiseIsoFilterResultTag_);
144  CSCHaloResultTag_ = parameters.getParameter<edm::InputTag>("CSCHaloResultLabel");
145  CSCHaloResultToken_ = consumes<bool>(CSCHaloResultTag_);
146  CSCHalo2015ResultTag_ = parameters.getParameter<edm::InputTag>("CSCHalo2015ResultLabel");
147  CSCHalo2015ResultToken_ = consumes<bool>(CSCHalo2015ResultTag_);
148  EcalDeadCellTriggerTag_ = parameters.getParameter<edm::InputTag>("EcalDeadCellTriggerPrimitiveFilterLabel");
149  EcalDeadCellTriggerToken_ = consumes<bool>(EcalDeadCellTriggerTag_);
150  EcalDeadCellBoundaryTag_ = parameters.getParameter<edm::InputTag>("EcalDeadCellBoundaryEnergyFilterLabel");
151  EcalDeadCellBoundaryToken_ = consumes<bool>(EcalDeadCellBoundaryTag_);
152  eeBadScFilterTag_ = parameters.getParameter<edm::InputTag>("eeBadScFilterLabel");
153  eeBadScFilterToken_ = consumes<bool>(eeBadScFilterTag_);
154  HcalStripHaloTag_ = parameters.getParameter<edm::InputTag>("HcalStripHaloFilterLabel");
155  HcalStripHaloToken_ = consumes<bool>(HcalStripHaloTag_);
156 
157  if (isMiniAODMet_) {
158  METFilterMiniAODLabel_ = parameters.getParameter<edm::InputTag>("FilterResultsLabelMiniAOD");
159  METFilterMiniAODToken_ = consumes<edm::TriggerResults>(METFilterMiniAODLabel_);
160 
161  METFilterMiniAODLabel2_ = parameters.getParameter<edm::InputTag>("FilterResultsLabelMiniAOD2");
162  METFilterMiniAODToken2_ = consumes<edm::TriggerResults>(METFilterMiniAODLabel2_);
163  }
164 
165  //
166  nbinsPV_ = parameters.getParameter<int>("pVBin");
167  nPVMin_ = parameters.getParameter<double>("pVMin");
168  nPVMax_ = parameters.getParameter<double>("pVMax");
169 
170  triggerSelectedSubFolders_ = parameters.getParameter<edm::VParameterSet>("triggerSelectedSubFolders");
171  for (edm::VParameterSet::const_iterator it = triggerSelectedSubFolders_.begin();
172  it != triggerSelectedSubFolders_.end();
173  it++) {
174  triggerFolderEventFlag_.push_back(new GenericTriggerEventFlag(*it, consumesCollector(), *this));
175  triggerFolderExpr_.push_back(it->getParameter<std::vector<std::string> >("hltPaths"));
176  triggerFolderLabels_.push_back(it->getParameter<std::string>("label"));
177  }
178 
179  cleaningParameters_ = parameters.getParameter<ParameterSet>("CleaningParameters");
180 
181  verbose_ = parameters.getParameter<int>("verbose");
182 
183  FolderName_ = parameters.getUntrackedParameter<std::string>("FolderName");
184 }
185 
186 // ***********************************************************
188  for (std::vector<GenericTriggerEventFlag*>::const_iterator it = triggerFolderEventFlag_.begin();
189  it != triggerFolderEventFlag_.end();
190  it++) {
191  delete *it;
192  }
193  delete DCSFilter_;
194 }
195 
196 void METAnalyzer::bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const&) {
197  std::string DirName = FolderName_ + metCollectionLabel_.label();
198  ibooker.setCurrentFolder(DirName);
199  // since this module does things in dqmEndRun, we need to make sure to have
200  // per-run histograms.
201  ibooker.setScope(MonitorElementData::Scope::RUN);
202 
203  if (!folderNames_.empty()) {
204  folderNames_.clear();
205  }
206  if (runcosmics_) {
207  folderNames_.push_back("Uncleaned");
208  } else {
209  if (!onlyCleaned_) {
210  folderNames_.push_back("Uncleaned");
211  }
212  folderNames_.push_back("Cleaned");
213  folderNames_.push_back("DiJet");
214  if (!isMiniAODMet_) {
215  folderNames_.push_back("ZJets");
216  }
217  }
218  for (std::vector<std::string>::const_iterator ic = folderNames_.begin(); ic != folderNames_.end(); ic++) {
219  bookMESet(DirName + "/" + *ic, ibooker, map_dijet_MEs);
220  }
221 }
222 
223 // ***********************************************************
225  DQMStore::IBooker& ibooker,
226  std::map<std::string, MonitorElement*>& map_of_MEs) {
227  bool bLumiSecPlot = fill_met_high_level_histo;
228  //bool inTriggerPathPlots=false;
229  bool fillPFCandidatePlots = false;
230  bool fillZPlots = false;
231 
232  if (DirName.find("Cleaned") != std::string::npos) {
233  fillPFCandidatePlots = true;
234  bookMonitorElement(DirName, ibooker, map_of_MEs, bLumiSecPlot, fillPFCandidatePlots, fillZPlots);
235  //for (unsigned int i = 0; i<triggerFolderEventFlag_.size(); i++) {
236  //fillPFCandidatePlots=false;
237  //if (triggerFolderEventFlag_[i]->on()) {
238  //bookMonitorElement(DirName+"/"+triggerFolderLabels_[i],ibooker,map_of_MEs,bLumiSecPlot,fillPFCandidatePlots,fillZPlots);
239  //}
240  //}
241  } else if (DirName.find("ZJets") != std::string::npos) {
242  fillPFCandidatePlots = false;
243  fillZPlots = true;
244  bookMonitorElement(DirName, ibooker, map_of_MEs, bLumiSecPlot, fillPFCandidatePlots, fillZPlots);
245  } else {
246  bookMonitorElement(DirName, ibooker, map_of_MEs, bLumiSecPlot, fillPFCandidatePlots, fillZPlots);
247  }
248 }
249 
250 // ***********************************************************
252  DQMStore::IBooker& ibooker,
253  std::map<std::string, MonitorElement*>& map_of_MEs,
254  bool bLumiSecPlot = false,
255  bool fillPFCandPlots = false,
256  bool fillZPlots = false) {
257  if (verbose_)
258  std::cout << "bookMonitorElement " << DirName << std::endl;
259 
260  ibooker.setCurrentFolder(DirName);
261  if (fillZPlots) {
262  if (isCaloMet_) {
263  meZJets_u_par = ibooker.book1D("u_parallel_Z_inc", "u_parallel_Z_inc", 50, -1000., 75);
264  } else {
265  meZJets_u_par = ibooker.book1D("u_parallel_Z_inc", "u_parallel_Z_inc", 50, -800., 75);
266  }
267  meZJets_u_par_ZPt_0_15 = ibooker.book1D("u_parallel_ZPt_0_15", "u_parallel_ZPt_0_15", 50, -100, 75);
268  meZJets_u_par_ZPt_15_30 = ibooker.book1D("u_parallel_ZPt_15_30", "u_parallel_ZPt_15_30", 50, -100, 50);
269  meZJets_u_par_ZPt_30_55 = ibooker.book1D("u_parallel_ZPt_30_55", "u_parallel_ZPt_30_55", 50, -175, 50);
270  meZJets_u_par_ZPt_55_75 = ibooker.book1D("u_parallel_ZPt_55_75", "u_parallel_ZPt_55_75", 50, -175, 0);
271  meZJets_u_par_ZPt_75_150 = ibooker.book1D("u_parallel_ZPt_75_150", "u_parallel_ZPt_75_150", 50, -300, 0);
272  if (isCaloMet_) {
273  meZJets_u_par_ZPt_150_290 = ibooker.book1D("u_parallel_ZPt_150_290", "u_parallel_ZPt_150_290", 50, -750, -100);
274  } else {
275  meZJets_u_par_ZPt_150_290 = ibooker.book1D("u_parallel_ZPt_150_290", "u_parallel_ZPt_150_290", 50, -450, -50);
276  }
277  if (isCaloMet_) {
278  meZJets_u_par_ZPt_290 = ibooker.book1D("u_parallel_ZPt_290", "u_parallel_ZPt_290", 50, -1000., -350.);
279  } else {
280  meZJets_u_par_ZPt_290 = ibooker.book1D("u_parallel_ZPt_290", "u_parallel_ZPt_290", 50, -750., -150.);
281  }
282  meZJets_u_perp = ibooker.book1D("u_perp_Z_inc", "u_perp_Z_inc", 50, -85., 85.);
283  meZJets_u_perp_ZPt_0_15 = ibooker.book1D("u_perp_ZPt_0_15", "u_perp_ZPt_0_15", 50, -85., 85.);
284  meZJets_u_perp_ZPt_15_30 = ibooker.book1D("u_perp_ZPt_15_30", "u_perp_ZPt_15_30", 50, -85., 85.);
285  meZJets_u_perp_ZPt_30_55 = ibooker.book1D("u_perp_ZPt_30_55", "u_perp_ZPt_30_55", 50, -85., 85.);
286  meZJets_u_perp_ZPt_55_75 = ibooker.book1D("u_perp_ZPt_55_75", "u_perp_ZPt_55_75", 50, -85., 85.);
287  meZJets_u_perp_ZPt_75_150 = ibooker.book1D("u_perp_ZPt_75_150", "u_perp_ZPt_75_150", 50, -85., 85.);
288  meZJets_u_perp_ZPt_150_290 = ibooker.book1D("u_perp_ZPt_150_290", "u_perp_ZPt_150_290", 50, -85., 85.);
289  meZJets_u_perp_ZPt_290 = ibooker.book1D("u_perp_ZPt_290", "u_perp_ZPt_290", 50, -85., 85.);
290 
291  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "u_parallel_Z_inc", meZJets_u_par));
292  map_of_MEs.insert(
293  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_parallel_ZPt_0_15", meZJets_u_par_ZPt_0_15));
294  map_of_MEs.insert(
295  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_parallel_ZPt_15_30", meZJets_u_par_ZPt_15_30));
296  map_of_MEs.insert(
297  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_parallel_ZPt_30_55", meZJets_u_par_ZPt_30_55));
298  map_of_MEs.insert(
299  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_parallel_ZPt_55_75", meZJets_u_par_ZPt_55_75));
300  map_of_MEs.insert(
301  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_parallel_ZPt_75_150", meZJets_u_par_ZPt_75_150));
302  map_of_MEs.insert(
303  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_parallel_ZPt_150_290", meZJets_u_par_ZPt_150_290));
304  map_of_MEs.insert(
305  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_parallel_ZPt_290", meZJets_u_par_ZPt_290));
306 
307  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "u_perp_Z_inc", meZJets_u_perp));
308  map_of_MEs.insert(
309  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_perp_ZPt_0_15", meZJets_u_perp_ZPt_0_15));
310  map_of_MEs.insert(
311  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_perp_ZPt_15_30", meZJets_u_perp_ZPt_15_30));
312  map_of_MEs.insert(
313  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_perp_ZPt_30_55", meZJets_u_perp_ZPt_30_55));
314  map_of_MEs.insert(
315  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_perp_ZPt_55_75", meZJets_u_perp_ZPt_55_75));
316  map_of_MEs.insert(
317  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_perp_ZPt_75_150", meZJets_u_perp_ZPt_75_150));
318  map_of_MEs.insert(
319  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_perp_ZPt_150_290", meZJets_u_perp_ZPt_150_290));
320  map_of_MEs.insert(
321  std::pair<std::string, MonitorElement*>(DirName + "/" + "u_perp_ZPt_290", meZJets_u_perp_ZPt_290));
322  }
323 
324  if (!fillZPlots) {
325  hTrigger = ibooker.book1D("triggerResults", "triggerResults", 500, 0, 500);
326  for (unsigned int i = 0; i < allTriggerNames_.size(); i++) {
327  if (i < (unsigned int)hTrigger->getNbinsX()) {
328  if (!hTriggerLabelsIsSet_) {
329  hTrigger->setBinLabel(i + 1, allTriggerNames_[i]);
330  }
331  }
332  }
333  hTriggerLabelsIsSet_ = true;
334 
335  hMEx = ibooker.book1D("MEx", "MEx", 200, -500, 500);
336  hMEy = ibooker.book1D("MEy", "MEy", 200, -500, 500);
337  hMET = ibooker.book1D("MET", "MET", 200, 0, 1000);
338  hMET_2 = ibooker.book1D("MET_2", "MET Range 2", 200, 0, 2000);
339  hSumET = ibooker.book1D("SumET", "SumET", 400, 0, 4000);
340 
341  {
342  auto scope = DQMStore::IBooker::UseLumiScope(ibooker);
343  hMETSig = ibooker.book1D("METSig", "METSig", 51, 0, 51);
344  }
345 
346  hMETPhi = ibooker.book1D("METPhi", "METPhi", 60, -M_PI, M_PI);
347  hMET_logx = ibooker.book1D("MET_logx", "MET_logx", 40, -1, 9);
348  hSumET_logx = ibooker.book1D("SumET_logx", "SumET_logx", 40, -1, 9);
349 
350  hMEx->setAxisTitle("MEx [GeV]", 1);
351  hMEy->setAxisTitle("MEy [GeV]", 1);
352  hMET->setAxisTitle("MET [GeV]", 1);
353  hMET_2->setAxisTitle("MET [GeV]", 1);
354  hSumET->setAxisTitle("SumET [GeV]", 1);
355  hMETSig->setAxisTitle("METSig", 1);
356  hMETPhi->setAxisTitle("METPhi [rad]", 1);
357  hMET_logx->setAxisTitle("log(MET) [GeV]", 1);
358  hSumET_logx->setAxisTitle("log(SumET) [GeV]", 1);
359 
360  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "triggerResults", hTrigger));
361  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MEx", hMEx));
362  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MEy", hMEy));
363  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET", hMET));
364  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_2", hMET_2));
365  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "SumET", hSumET));
366  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METSig", hMETSig));
367  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhi", hMETPhi));
368  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_logx", hMET_logx));
369  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "SumET_logx", hSumET_logx));
370 
371  hMET_HBHENoiseFilter = ibooker.book1D("MET_HBHENoiseFilter", "MET_HBHENoiseFiltered", 200, 0, 1000);
372  hMET_CSCTightHaloFilter = ibooker.book1D("MET_CSCTightHaloFilter", "MET_CSCTightHaloFiltered", 200, 0, 1000);
373  hMET_eeBadScFilter = ibooker.book1D("MET_eeBadScFilter", "MET_eeBadScFiltered", 200, 0, 1000);
374  hMET_HBHEIsoNoiseFilter = ibooker.book1D("MET_HBHEIsoNoiseFilter", "MET_HBHEIsoNoiseFiltered", 200, 0, 1000);
375  hMET_CSCTightHalo2015Filter =
376  ibooker.book1D("MET_CSCTightHalo2015Filter", "MET_CSCTightHalo2015Filtered", 200, 0, 1000);
377  hMET_EcalDeadCellTriggerFilter =
378  ibooker.book1D("MET_EcalDeadCellTriggerFilter", "MET_EcalDeadCellTriggerFiltered", 200, 0, 1000);
379  hMET_EcalDeadCellBoundaryFilter =
380  ibooker.book1D("MET_EcalDeadCellBoundaryFilter", "MET_EcalDeadCellBoundaryFiltered", 200, 0, 1000);
381  hMET_HcalStripHaloFilter = ibooker.book1D("MET_HcalStripHaloFilter", "MET_HcalStripHaloFiltered", 200, 0, 1000);
382 
383  map_of_MEs.insert(
384  std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_HBHENoiseFilter", hMET_HBHENoiseFilter));
385  map_of_MEs.insert(
386  std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_CSCTightHaloFilter", hMET_CSCTightHaloFilter));
387  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_eeBadScFilter", hMET_eeBadScFilter));
388  map_of_MEs.insert(
389  std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_HBHEIsoNoiseFilter", hMET_HBHEIsoNoiseFilter));
390  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_CSCTightHalo2015Filter",
391  hMET_CSCTightHalo2015Filter));
392  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_EcalDeadCellTriggerFilter",
393  hMET_EcalDeadCellTriggerFilter));
394  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_EcalDeadCellBoundaryFilter",
395  hMET_EcalDeadCellBoundaryFilter));
396  map_of_MEs.insert(
397  std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_HcalStripHaloFilter", hMET_HcalStripHaloFilter));
398 
399  // Book NPV profiles --> would some of these profiles be interesting for other MET types too
400  //----------------------------------------------------------------------------
401  meMEx_profile = ibooker.bookProfile("MEx_profile", "met.px()", nbinsPV_, nPVMin_, nPVMax_, 200, -500, 500);
402  meMEy_profile = ibooker.bookProfile("MEy_profile", "met.py()", nbinsPV_, nPVMin_, nPVMax_, 200, -500, 500);
403  meMET_profile = ibooker.bookProfile("MET_profile", "met.pt()", nbinsPV_, nPVMin_, nPVMax_, 200, 0, 1000);
404  meSumET_profile = ibooker.bookProfile("SumET_profile", "met.sumEt()", nbinsPV_, nPVMin_, nPVMax_, 400, 0, 4000);
405  // Set NPV profiles x-axis title
406  //----------------------------------------------------------------------------
407  meMEx_profile->setAxisTitle("nvtx", 1);
408  meMEy_profile->setAxisTitle("nvtx", 1);
409  meMET_profile->setAxisTitle("nvtx", 1);
410  meSumET_profile->setAxisTitle("nvtx", 1);
411 
412  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MEx_profile", meMEx_profile));
413  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MEy_profile", meMEy_profile));
414  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_profile", meMET_profile));
415  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "SumET_profile", meSumET_profile));
416 
417  if (isCaloMet_) {
418  hCaloHadEtInHB = ibooker.book1D("CaloHadEtInHB", "CaloHadEtInHB", 50, 0, 2000);
419  hCaloHadEtInHB->setAxisTitle("Had Et [GeV]", 1);
420  hCaloHadEtInHO = ibooker.book1D("CaloHadEtInHO", "CaloHadEtInHO", 25, 0, 500);
421  hCaloHadEtInHO->setAxisTitle("Had Et [GeV]", 1);
422  hCaloHadEtInHE = ibooker.book1D("CaloHadEtInHE", "CaloHadEtInHE", 50, 0, 2000);
423  hCaloHadEtInHE->setAxisTitle("Had Et [GeV]", 1);
424  hCaloHadEtInHF = ibooker.book1D("CaloHadEtInHF", "CaloHadEtInHF", 50, 0, 1000);
425  hCaloHadEtInHF->setAxisTitle("Had Et [GeV]", 1);
426  hCaloEmEtInHF = ibooker.book1D("CaloEmEtInHF", "CaloEmEtInHF", 25, 0, 500);
427  hCaloEmEtInHF->setAxisTitle("EM Et [GeV]", 1);
428  hCaloEmEtInEE = ibooker.book1D("CaloEmEtInEE", "CaloEmEtInEE", 50, 0, 1000);
429  hCaloEmEtInEE->setAxisTitle("EM Et [GeV]", 1);
430  hCaloEmEtInEB = ibooker.book1D("CaloEmEtInEB", "CaloEmEtInEB", 50, 0, 2000);
431  hCaloEmEtInEB->setAxisTitle("EM Et [GeV]", 1);
432 
433  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloHadEtInHO", hCaloHadEtInHO));
434  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloHadEtInHF", hCaloHadEtInHF));
435  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloHadEtInHE", hCaloHadEtInHE));
436  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloHadEtInHB", hCaloHadEtInHB));
437  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloEmEtInHF", hCaloEmEtInHF));
438  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloEmEtInEE", hCaloEmEtInEE));
439  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloEmEtInEB", hCaloEmEtInEB));
440 
441  hCaloMETPhi020 = ibooker.book1D("CaloMETPhi020", "CaloMETPhi020", 60, -M_PI, M_PI);
442  hCaloMETPhi020->setAxisTitle("METPhi [rad] (MET>20 GeV)", 1);
443 
444  hCaloEtFractionHadronic = ibooker.book1D("CaloEtFractionHadronic", "CaloEtFractionHadronic", 50, 0, 1);
445  hCaloEtFractionHadronic->setAxisTitle("Hadronic Et Fraction", 1);
446  hCaloEmEtFraction = ibooker.book1D("CaloEmEtFraction", "CaloEmEtFraction", 50, 0, 1);
447  hCaloEmEtFraction->setAxisTitle("EM Et Fraction", 1);
448 
449  hCaloEmEtFraction020 = ibooker.book1D("CaloEmEtFraction020", "CaloEmEtFraction020", 50, 0, 1);
450  hCaloEmEtFraction020->setAxisTitle("EM Et Fraction (MET>20 GeV)", 1);
451 
452  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloMETPhi020", hCaloMETPhi020));
453  map_of_MEs.insert(
454  std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloEtFractionHadronic", hCaloEtFractionHadronic));
455  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloEmEtFraction", hCaloEmEtFraction));
456  map_of_MEs.insert(
457  std::pair<std::string, MonitorElement*>(DirName + "/" + "CaloEmEtFraction020", hCaloEmEtFraction020));
458  }
459 
460  if (isPFMet_) {
461  if (fillPFCandPlots &&
462  fillCandidateMap_histos) { //first bool internal checks for subdirectory filling, second bool given in cfg file, checks that we fill maps only in one module in total
463 
464  meCHF_Barrel = ibooker.book1D("PfChargedHadronEtFractionBarrel", "chargedHadronEtFractionBarrel", 50, 0, 1);
465  meCHF_EndcapPlus =
466  ibooker.book1D("PfChargedHadronEtFractionEndcapPlus", "chargedHadronEtFractionEndcapPlus", 50, 0, 1);
467  meCHF_EndcapMinus =
468  ibooker.book1D("PfChargedHadronEtFractionEndcapMinus", "chargedHadronEtFractionEndcapMinus", 50, 0, 1);
469  meCHF_Barrel_BXm1Empty = ibooker.book1D(
470  "PfChargedHadronEtFractionBarrel_BXm1Empty", "chargedHadronEtFractionBarrel prev empty bunch", 50, 0, 1);
471  meCHF_EndcapPlus_BXm1Empty = ibooker.book1D("PfChargedHadronEtFractionEndcapPlus_BXm1Empty",
472  "chargedHadronEtFractionEndcapPlus prev empty bunch",
473  50,
474  0,
475  1);
476  meCHF_EndcapMinus_BXm1Empty = ibooker.book1D("PfChargedHadronEtFractionEndcapMinus_BXm1Empty",
477  "chargedHadronEtFractionEndcapMinus prev empty bunch",
478  50,
479  0,
480  1);
481  meCHF_Barrel_BXm1Filled = ibooker.book1D("PfChargedHadronEtFractionBarrel_BXm1Filled",
482  "chargedHadronEtFractionBarrel prev filled 2 bunches",
483  50,
484  0,
485  1);
486  meCHF_EndcapPlus_BXm1Filled = ibooker.book1D("PfChargedHadronEtFractionEndcapPlus_BXm1Filled",
487  "chargedHadronEtFractionEndcapPlus prev filled bunch",
488  50,
489  0,
490  1);
491  meCHF_EndcapMinus_BXm1Filled = ibooker.book1D("PfChargedHadronEtFractionEndcapMinus_BXm1Filled",
492  "chargedHadronEtFractionEndcapMinus prev filled bunch",
493  50,
494  0,
495  1);
496 
497  map_of_MEs.insert(
498  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfChargedHadronEtFractionBarrel", meCHF_Barrel));
499  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfChargedHadronEtFractionEndcapPlus",
500  meCHF_EndcapPlus));
501  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
502  DirName + "/" + "PfChargedHadronEtFractionEndcapMinus", meCHF_EndcapMinus));
503  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
504  DirName + "/" + "PfChargedHadronEtFractionBarrel_BXm1Empty", meCHF_Barrel_BXm1Empty));
505  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
506  DirName + "/" + "PfChargedHadronEtFractionEndcapPlus_BXm1Empty", meCHF_EndcapPlus_BXm1Empty));
507  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
508  DirName + "/" + "PfChargedHadronEtFractionEndcapMinus_BXm1Empty", meCHF_EndcapMinus_BXm1Empty));
509  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm2BXm1Empty", meCHF_Barrel_BXm2BXm1Empty));
510  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm2BXm1Empty", meCHF_EndcapPlus_BXm2BXm1Empty));
511  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm2BXm1Empty", meCHF_EndcapMinus_BXm2BXm1Empty));
512  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
513  DirName + "/" + "PfChargedHadronEtFractionBarrel_BXm1Filled", meCHF_Barrel_BXm1Filled));
514  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
515  DirName + "/" + "PfChargedHadronEtFractionEndcapPlus_BXm1Filled", meCHF_EndcapPlus_BXm1Filled));
516  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
517  DirName + "/" + "PfChargedHadronEtFractionEndcapMinus_BXm1Filled", meCHF_EndcapMinus_BXm1Filled));
518  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm2BXm1Filled", meCHF_Barrel_BXm2BXm1Filled));
519  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm2BXm1Filled", meCHF_EndcapPlus_BXm2BXm1Filled));
520  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm2BXm1Filled", meCHF_EndcapMinus_BXm2BXm1Filled));
521 
522  meNHF_Barrel = ibooker.book1D("PfNeutralHadronEtFractionBarrel", "neutralHadronEtFractionBarrel", 50, 0, 1);
523  meNHF_EndcapPlus =
524  ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus", "neutralHadronEtFractionEndcapPlus", 50, 0, 1);
525  meNHF_EndcapMinus =
526  ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus", "neutralHadronEtFractionEndcapMinus", 50, 0, 1);
527  meNHF_Barrel_BXm1Empty = ibooker.book1D(
528  "PfNeutralHadronEtFractionBarrel_BXm1Empty", "neutralHadronEtFractionBarrel prev empty bunch", 50, 0, 1);
529  meNHF_EndcapPlus_BXm1Empty = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus_BXm1Empty",
530  "neutralHadronEtFractionEndcapPlus prev empty bunch",
531  50,
532  0,
533  1);
534  meNHF_EndcapMinus_BXm1Empty = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus_BXm1Empty",
535  "neutralHadronEtFractionEndcapMinus prev empty bunch",
536  50,
537  0,
538  1);
539  //meNHF_Barrel_BXm2BXm1Empty = ibooker.book1D("PfNeutralHadronEtFractionBarrel_BXm2BXm1Empty", "neutralHadronEtFractionBarrel prev empty 2 bunches", 50, 0, 1);
540  //meNHF_EndcapPlus_BXm2BXm1Empty = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus_BXm2BXm1Empty", "neutralHadronEtFractionEndcapPlus prev empty 2 bunches", 50, 0, 1);
541  //meNHF_EndcapMinus_BXm2BXm1Empty = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus_BXm2BXm1Empty", "neutralHadronEtFractionEndcapMinus prev empty 2 bunches", 50, 0, 1);
542  meNHF_Barrel_BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionBarrel_BXm1Filled",
543  "neutralHadronEtFractionBarrel prev filled 2 bunches",
544  50,
545  0,
546  1);
547  meNHF_EndcapPlus_BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus_BXm1Filled",
548  "neutralHadronEtFractionEndcapPlus prev filled bunch",
549  50,
550  0,
551  1);
552  meNHF_EndcapMinus_BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus_BXm1Filled",
553  "neutralHadronEtFractionEndcapMinus prev filled bunch",
554  50,
555  0,
556  1);
557  //meNHF_Barrel_BXm2BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionBarrel_BXm2BXm1Filled", "neutralHadronEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
558  //meNHF_EndcapPlus_BXm2BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus_BXm2BXm1Filled", "neutralHadronEtFractionEndcapPlus prev filled 2 bunches", 50, 0, 1);
559  //meNHF_EndcapMinus_BXm2BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus_BXm2BXm1Filled", "neutralHadronEtFractionEndcapMinus prev filled 2 bunches", 50, 0, 1);
560 
561  map_of_MEs.insert(
562  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfNeutralHadronEtFractionBarrel", meNHF_Barrel));
563  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfNeutralHadronEtFractionEndcapPlus",
564  meNHF_EndcapPlus));
565  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
566  DirName + "/" + "PfNeutralHadronEtFractionEndcapMinus", meNHF_EndcapMinus));
567  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
568  DirName + "/" + "PfNeutralHadronEtFractionBarrel_BXm1Empty", meNHF_Barrel_BXm1Empty));
569  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
570  DirName + "/" + "PfNeutralHadronEtFractionEndcapPlus_BXm1Empty", meNHF_EndcapPlus_BXm1Empty));
571  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
572  DirName + "/" + "PfNeutralHadronEtFractionEndcapMinus_BXm1Empty", meNHF_EndcapMinus_BXm1Empty));
573  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm2BXm1Empty", meNHF_Barrel_BXm2BXm1Empty));
574  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm2BXm1Empty", meNHF_EndcapPlus_BXm2BXm1Empty));
575  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm2BXm1Empty", meNHF_EndcapMinus_BXm2BXm1Empty));
576  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
577  DirName + "/" + "PfNeutralHadronEtFractionBarrel_BXm1Filled", meNHF_Barrel_BXm1Filled));
578  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
579  DirName + "/" + "PfNeutralHadronEtFractionEndcapPlus_BXm1Filled", meNHF_EndcapPlus_BXm1Filled));
580  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
581  DirName + "/" + "PfNeutralHadronEtFractionEndcapMinus_BXm1Filled", meNHF_EndcapMinus_BXm1Filled));
582  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm2BXm1Filled", meNHF_Barrel_BXm2BXm1Filled));
583  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm2BXm1Filled", meNHF_EndcapPlus_BXm2BXm1Filled));
584  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm2BXm1Filled", meNHF_EndcapMinus_BXm2BXm1Filled));
585 
586  mePhF_Barrel = ibooker.book1D("PfPhotonEtFractionBarrel", "photonEtFractionBarrel", 50, 0, 1);
587  mePhF_EndcapPlus = ibooker.book1D("PfPhotonEtFractionEndcapPlus", "photonEtFractionEndcapPlus", 50, 0, 1);
588  mePhF_EndcapMinus = ibooker.book1D("PfPhotonEtFractionEndcapMinus", "photonEtFractionEndcapMinus", 50, 0, 1);
589  mePhF_Barrel_BXm1Empty =
590  ibooker.book1D("PfPhotonEtFractionBarrel_BXm1Empty", "photonEtFractionBarrel prev empty bunch", 50, 0, 1);
591  mePhF_EndcapPlus_BXm1Empty = ibooker.book1D(
592  "PfPhotonEtFractionEndcapPlus_BXm1Empty", "photonEtFractionEndcapPlus prev empty bunch", 50, 0, 1);
593  mePhF_EndcapMinus_BXm1Empty = ibooker.book1D(
594  "PfPhotonEtFractionEndcapMinus_BXm1Empty", "photonEtFractionEndcapMinus prev empty bunch", 50, 0, 1);
595  //mePhF_Barrel_BXm2BXm1Empty = ibooker.book1D("PfPhotonEtFractionBarrel_BXm2BXm1Empty", "photonEtFractionBarrel prev empty 2 bunches", 50, 0, 1);
596  //mePhF_EndcapPlus_BXm2BXm1Empty = ibooker.book1D("PfPhotonEtFractionEndcapPlus_BXm2BXm1Empty", "photonEtFractionEndcapPlus prev empty 2 bunches", 50, 0, 1);
597  //mePhF_EndcapMinus_BXm2BXm1Empty = ibooker.book1D("PfPhotonEtFractionEndcapMinus_BXm2BXm1Empty", "photonEtFractionEndcapMinus prev empty 2 bunches", 50, 0, 1);
598  mePhF_Barrel_BXm1Filled = ibooker.book1D(
599  "PfPhotonEtFractionBarrel_BXm1Filled", "photonEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
600  mePhF_EndcapPlus_BXm1Filled = ibooker.book1D(
601  "PfPhotonEtFractionEndcapPlus_BXm1Filled", "photonEtFractionEndcapPlus prev filled bunch", 50, 0, 1);
602  mePhF_EndcapMinus_BXm1Filled = ibooker.book1D(
603  "PfPhotonEtFractionEndcapMinus_BXm1Filled", "photonEtFractionEndcapMinus prev filled bunch", 50, 0, 1);
604  //mePhF_Barrel_BXm2BXm1Filled = ibooker.book1D("PfPhotonEtFractionBarrel_BXm2BXm1Filled", "photonEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
605  //mePhF_EndcapPlus_BXm2BXm1Filled = ibooker.book1D("PfPhotonEtFractionEndcapPlus_BXm2BXm1Filled", "photonEtFractionEndcapPlus prev filled 2 bunches", 50, 0, 1);
606  //mePhF_EndcapMinus_BXm2BXm1Filled = ibooker.book1D("PfPhotonEtFractionEndcapMinus_BXm2BXm1Filled", "photonEtFractionEndcapMinus prev filled 2 bunches", 50, 0, 1);
607 
608  map_of_MEs.insert(
609  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFractionBarrel", mePhF_Barrel));
610  map_of_MEs.insert(
611  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFractionEndcapPlus", mePhF_EndcapPlus));
612  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFractionEndcapMinus",
613  mePhF_EndcapMinus));
614  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFractionBarrel_BXm1Empty",
615  mePhF_Barrel_BXm1Empty));
616  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
617  DirName + "/" + "PfPhotonEtFractionEndcapPlus_BXm1Empty", mePhF_EndcapPlus_BXm1Empty));
618  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
619  DirName + "/" + "PfPhotonEtFractionEndcapMinus_BXm1Empty", mePhF_EndcapMinus_BXm1Empty));
620  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionBarrel_BXm2BXm1Empty", mePhF_Barrel_BXm2BXm1Empty));
621  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm2BXm1Empty", mePhF_EndcapPlus_BXm2BXm1Empty));
622  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm2BXm1Empty", mePhF_EndcapMinus_BXm2BXm1Empty));
623  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFractionBarrel_BXm1Filled",
624  mePhF_Barrel_BXm1Filled));
625  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
626  DirName + "/" + "PfPhotonEtFractionEndcapPlus_BXm1Filled", mePhF_EndcapPlus_BXm1Filled));
627  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
628  DirName + "/" + "PfPhotonEtFractionEndcapMinus_BXm1Filled", mePhF_EndcapMinus_BXm1Filled));
629  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionBarrel_BXm2BXm1Filled", mePhF_Barrel_BXm2BXm1Filled));
630  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm2BXm1Filled", mePhF_EndcapPlus_BXm2BXm1Filled));
631  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm2BXm1Filled", mePhF_EndcapMinus_BXm2BXm1Filled));
632 
633  meHFHadF_Plus = ibooker.book1D("PfHFHadronEtFractionPlus", "HFHadronEtFractionPlus", 50, 0, 1);
634  meHFHadF_Minus = ibooker.book1D("PfHFHadronEtFractionMinus", "HFHadronEtFractionMinus", 50, 0, 1);
635  meHFHadF_Plus_BXm1Empty =
636  ibooker.book1D("PfHFHadronEtFractionPlus_BXm1Empty", "HFHadronEtFractionPlus prev empty bunch", 50, 0, 1);
637  meHFHadF_Minus_BXm1Empty =
638  ibooker.book1D("PfHFHadronEtFractionMinus_BXm1Empty", "HFHadronEtFractionMinus prev empty bunch", 50, 0, 1);
639  //meHFHadF_Plus_BXm2BXm1Empty = ibooker.book1D("PfHFHadronEtFractionPlus_BXm2BXm1Empty", "HFHadronEtFractionPlus prev empty 2 bunches", 50, 0, 1);
640  //meHFHadF_Minus_BXm2BXm1Empty = ibooker.book1D("PfHFHadronEtFractionMinus_BXm2BXm1Empty", "HFHadronEtFractionMinus prev empty 2 bunches", 50, 0, 1);
641  meHFHadF_Plus_BXm1Filled =
642  ibooker.book1D("PfHFHadronEtFractionPlus_BXm1Filled", "HFHadronEtFractionPlus prev filled bunch", 50, 0, 1);
643  meHFHadF_Minus_BXm1Filled = ibooker.book1D(
644  "PfHFHadronEtFractionMinus_BXm1Filled", "HFHadronEtFractionMinus prev filled bunch", 50, 0, 1);
645  //meHFHadF_Plus_BXm2BXm1Filled = ibooker.book1D("PfHFHadronEtFractionPlus_BXm2BXm1Filled", "HFHadronEtFractionPlus prev filled 2 bunches", 50, 0, 1);
646  //meHFHadF_Minus_BXm2BXm1Filled = ibooker.book1D("PfHFHadronEtFractionMinus_BXm2BXm1Filled", "HFHadronEtFractionMinus prev filled 2 bunches", 50, 0, 1);
647 
648  map_of_MEs.insert(
649  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEtFractionPlus", meHFHadF_Plus));
650  map_of_MEs.insert(
651  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEtFractionMinus", meHFHadF_Minus));
652  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEtFractionPlus_BXm1Empty",
653  meHFHadF_Plus_BXm1Empty));
654  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEtFractionMinus_BXm1Empty",
655  meHFHadF_Minus_BXm1Empty));
656  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionPlus_BXm2BXm1Empty", meHFHadF_Plus_BXm2BXm1Empty));
657  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionMinus_BXm2BXm1Empty", meHFHadF_Minus_BXm2BXm1Empty));
658  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEtFractionPlus_BXm1Filled",
659  meHFHadF_Plus_BXm1Filled));
660  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
661  DirName + "/" + "PfHFHadronEtFractionMinus_BXm1Filled", meHFHadF_Minus_BXm1Filled));
662  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionPlus_BXm2BXm1Filled", meHFHadF_Plus_BXm2BXm1Filled));
663  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionMinus_BXm2BXm1Filled", meHFHadF_Minus_BXm2BXm1Filled));
664 
665  meHFEMF_Plus = ibooker.book1D("PfHFEMEtFractionPlus", "HFEMEtFractionPlus", 50, 0, 1);
666  meHFEMF_Minus = ibooker.book1D("PfHFEMEtFractionMinus", "HFEMEtFractionMinus", 50, 0, 1);
667  meHFEMF_Plus_BXm1Empty =
668  ibooker.book1D("PfHFEMEtFractionPlus_BXm1Empty", "HFEMEtFractionPlus prev empty bunch", 50, 0, 1);
669  meHFEMF_Minus_BXm1Empty =
670  ibooker.book1D("PfHFEMEtFractionMinus_BXm1Empty", "HFEMEtFractionMinus prev empty bunch", 50, 0, 1);
671  //meHFEMF_Plus_BXm2BXm1Empty = ibooker.book1D("PfHFEMEtFractionPlus_BXm2BXm1Empty", "HFEMEtFractionPlus prev empty 2 bunches", 50, 0, 1);
672  //meHFEMF_Minus_BXm2BXm1Empty = ibooker.book1D("PfHFEMEtFractionMinus_BXm2BXm1Empty", "HFEMEtFractionMinus prev empty 2 bunches", 50, 0, 1);
673  meHFEMF_Plus_BXm1Filled =
674  ibooker.book1D("PfHFEMEtFractionPlus_BXm1Filled", "HFEMEtFractionPlus prev filled bunch", 50, 0, 1);
675  meHFEMF_Minus_BXm1Filled =
676  ibooker.book1D("PfHFEMEtFractionMinus_BXm1Filled", "HFEMEtFractionMinus prev filled bunch", 50, 0, 1);
677  //meHFEMF_Plus_BXm2BXm1Filled = ibooker.book1D("PfHFEMEtFractionPlus_BXm2BXm1Filled", "HFEMEtFractionPlus prev filled 2 bunches", 50, 0, 1);
678  //meHFEMF_Minus_BXm2BXm1Filled = ibooker.book1D("PfHFEMEtFractionMinus_BXm2BXm1Filled", "HFEMEtFractionMinus prev filled 2 bunches", 50, 0, 1);
679 
680  map_of_MEs.insert(
681  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEtFractionPlus", meHFEMF_Plus));
682  map_of_MEs.insert(
683  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEtFractionMinus", meHFEMF_Minus));
684  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEtFractionPlus_BXm1Empty",
685  meHFEMF_Plus_BXm1Empty));
686  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEtFractionMinus_BXm1Empty",
687  meHFEMF_Minus_BXm1Empty));
688  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionPlus_BXm2BXm1Empty", meHFEMF_Plus_BXm2BXm1Empty));
689  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionMinus_BXm2BXm1Empty", meHFEMF_Minus_BXm2BXm1Empty));
690  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEtFractionPlus_BXm1Filled",
691  meHFEMF_Plus_BXm1Filled));
692  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEtFractionMinus_BXm1Filled",
693  meHFEMF_Minus_BXm1Filled));
694  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionPlus_BXm2BXm1Filled", meHFEMF_Plus_BXm2BXm1Filled));
695  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionMinus_BXm2BXm1Filled", meHFEMF_Minus_BXm2BXm1Filled));
696  /*
697  meMETPhiChargedHadronsBarrel_BXm2BXm1Filled = ibooker.book1D("METPhiChargedHadronsBarrel_BXm2BXm1Filled", "METPhi_PFChargedHadronsBarrel prev two bunches filled", 50, -M_PI,M_PI);
698  meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Filled = ibooker.book1D("METPhiChargedHadronsEndcapPlus_BXm2BXm1Filled", "METPhi_PFChargedHadronsEndcapPlus prev two bunches filled", 50, -M_PI,M_PI);
699  meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Filled = ibooker.book1D("METPhiChargedHadronsEndcapMinus_BXm2BXm1Filled","METPhi_PFChargedHadronsEndcapMinus prev two bunches filled", 50, -M_PI,M_PI);
700  meMETPhiNeutralHadronsBarrel_BXm2BXm1Filled = ibooker.book1D("METPhiNeutralHadronsBarrel_BXm2BXm1Filled", "METPhi_PFNeutralHadronsBarrel prev two bunches filled", 50, -M_PI,M_PI);
701  meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled = ibooker.book1D("METPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled", "METPhi_PFNeutralHadronsEndcapPlus prev two bunches filled", 50, -M_PI,M_PI);
702  meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled = ibooker.book1D("METPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled","METPhi_PFNeutralHadronsEndcapMinus prev two bunches filled", 50, -M_PI,M_PI);
703  meMETPhiPhotonsBarrel_BXm2BXm1Filled = ibooker.book1D("METPhiPhotonsBarrel_BXm2BXm1Filled", "METPhi_PFPhotonsBarrel prev two bunches filled", 50, -M_PI,M_PI);
704  meMETPhiPhotonsEndcapPlus_BXm2BXm1Filled = ibooker.book1D("METPhiPhotonsEndcapPlus_BXm2BXm1Filled", "METPhi_PFPhotonsEndcapPlus prev two bunches filled", 50, -M_PI,M_PI);
705  meMETPhiPhotonsEndcapMinus_BXm2BXm1Filled = ibooker.book1D("METPhiPhotonsEndcapMinus_BXm2BXm1Filled", "METPhi_PFPhotonsEndcapMinus prev two bunches filled", 50, -M_PI,M_PI);
706  meMETPhiHFHadronsPlus_BXm2BXm1Filled = ibooker.book1D("METPhiHFHadronsPlus_BXm2BXm1Filled", "METPhi_PFHFHadronsPlus prev two bunches filled", 50, -M_PI,M_PI);
707  meMETPhiHFHadronsMinus_BXm2BXm1Filled = ibooker.book1D("METPhiHFHadronsMinus_BXm2BXm1Filled", "METPhi_PFHFHadronsMinus prev two bunches filled", 50, -M_PI,M_PI);
708  meMETPhiHFEGammasPlus_BXm2BXm1Filled = ibooker.book1D("METPhiHFEGammasPlus_BXm2BXm1Filled", "METPhi_PFHFEGammasPlus prev two bunches filled", 50, -M_PI,M_PI);
709  meMETPhiHFEGammasMinus_BXm2BXm1Filled = ibooker.book1D("METPhiHFEGammasMinus_BXm2BXm1Filled", "METPhi_PFHFEGammasMinus prev two bunches filled", 50, -M_PI,M_PI);
710 
711  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsBarrel_BXm2BXm1Filled" ,meMETPhiChargedHadronsBarrel_BXm2BXm1Filled));
712  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm2BXm1Filled" ,meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Filled));
713  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm2BXm1Filled" ,meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Filled));
714  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsBarrel_BXm2BXm1Filled" ,meMETPhiNeutralHadronsBarrel_BXm2BXm1Filled));
715  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled" ,meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled));
716  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled" ,meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled));
717  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsBarrel_BXm2BXm1Filled" ,meMETPhiPhotonsBarrel_BXm2BXm1Filled));
718  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapPlus_BXm2BXm1Filled" ,meMETPhiPhotonsEndcapPlus_BXm2BXm1Filled));
719  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapMinus_BXm2BXm1Filled" ,meMETPhiPhotonsEndcapMinus_BXm2BXm1Filled));
720  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsPlus_BXm2BXm1Filled" ,meMETPhiHFHadronsPlus_BXm2BXm1Filled));
721  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsMinus_BXm2BXm1Filled" ,meMETPhiHFHadronsMinus_BXm2BXm1Filled));
722  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasPlus_BXm2BXm1Filled" ,meMETPhiHFEGammasPlus_BXm2BXm1Filled));
723  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasMinus_BXm2BXm1Filled" ,meMETPhiHFEGammasMinus_BXm2BXm1Filled));
724 
725  meMETPhiChargedHadronsBarrel_BXm2BXm1Empty = ibooker.book1D("METPhiChargedHadronsBarrel_BXm2BXm1Empty", "METPhi_PFChargedHadronsBarrel prev two bunches empty", 50, -M_PI,M_PI);
726  meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty = ibooker.book1D("METPhiChargedHadronsEndcapPlus_BXm2BXm1Empty", "METPhi_PFChargedHadronsEndcapPlus prev two bunches empty", 50, -M_PI,M_PI);
727  meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty = ibooker.book1D("METPhiChargedHadronsEndcapMinus_BXm2BXm1Empty","METPhi_PFChargedHadronsEndcapMinus prev two bunches empty", 50, -M_PI,M_PI);
728  meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty = ibooker.book1D("METPhiNeutralHadronsBarrel_BXm2BXm1Empty", "METPhi_PFNeutralHadronsBarrel prev two bunches empty", 50, -M_PI,M_PI);
729  meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty = ibooker.book1D("METPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty", "METPhi_PFNeutralHadronsEndcapPlus prev two bunches empty", 50, -M_PI,M_PI);
730  meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty = ibooker.book1D("METPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty","METPhi_PFNeutralHadronsEndcapMinus prev two bunches empty", 50, -M_PI,M_PI);
731  meMETPhiPhotonsBarrel_BXm2BXm1Empty = ibooker.book1D("METPhiPhotonsBarrel_BXm2BXm1Empty", "METPhi_PFPhotonsBarrel prev two bunches empty", 50, -M_PI,M_PI);
732  meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty = ibooker.book1D("METPhiPhotonsEndcapPlus_BXm2BXm1Empty", "METPhi_PFPhotonsEndcapPlus prev two bunches empty", 50, -M_PI,M_PI);
733  meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty = ibooker.book1D("METPhiPhotonsEndcapMinus_BXm2BXm1Empty", "METPhi_PFPhotonsEndcapMinus prev two bunches empty", 50, -M_PI,M_PI);
734  meMETPhiHFHadronsPlus_BXm2BXm1Empty = ibooker.book1D("METPhiHFHadronsPlus_BXm2BXm1Empty", "METPhi_PFHFHadronsPlus prev two bunches empty", 50, -M_PI,M_PI);
735  meMETPhiHFHadronsMinus_BXm2BXm1Empty = ibooker.book1D("METPhiHFHadronsMinus_BXm2BXm1Empty", "METPhi_PFHFHadronsMinus prev two bunches empty", 50, -M_PI,M_PI);
736  meMETPhiHFEGammasPlus_BXm2BXm1Empty = ibooker.book1D("METPhiHFEGammasPlus_BXm2BXm1Empty", "METPhi_PFHFEGammasPlus prev two bunches empty", 50, -M_PI,M_PI);
737  meMETPhiHFEGammasMinus_BXm2BXm1Empty = ibooker.book1D("METPhiHFEGammasMinus_BXm2BXm1Empty", "METPhi_PFHFEGammasMinus prev two bunches empty", 50, -M_PI,M_PI);
738 
739  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsBarrel_BXm2BXm1Empty" ,meMETPhiChargedHadronsBarrel_BXm2BXm1Empty));
740  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm2BXm1Empty" ,meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty));
741  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm2BXm1Empty" ,meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty));
742  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsBarrel_BXm2BXm1Empty" ,meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty));
743  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty" ,meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty));
744  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty" ,meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty));
745  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsBarrel_BXm2BXm1Empty" ,meMETPhiPhotonsBarrel_BXm2BXm1Empty));
746  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapPlus_BXm2BXm1Empty" ,meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty));
747  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapMinus_BXm2BXm1Empty" ,meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty));
748  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsPlus_BXm2BXm1Empty" ,meMETPhiHFHadronsPlus_BXm2BXm1Empty));
749  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsMinus_BXm2BXm1Empty" ,meMETPhiHFHadronsMinus_BXm2BXm1Empty));
750  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasPlus_BXm2BXm1Empty" ,meMETPhiHFEGammasPlus_BXm2BXm1Empty));
751  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasMinus_BXm2BXm1Empty" ,meMETPhiHFEGammasMinus_BXm2BXm1Empty));
752  */
753  //histos where one previous bunch was empty/filled
754  mePhotonEtFraction_BXm1Empty =
755  ibooker.book1D("PfPhotonEtFraction_BXm1Empty", "photonEtFraction() prev empty bunch", 50, 0, 1);
756  mePhotonEtFraction_BXm1Filled =
757  ibooker.book1D("PfPhotonEtFraction_BXm1Filled", "photonEtFraction() prev filled bunch", 50, 0, 1);
758  meNeutralHadronEtFraction_BXm1Empty = ibooker.book1D(
759  "PfNeutralHadronEtFraction_BXm1Empty", "neutralHadronEtFraction() prev empty bunch", 50, 0, 1);
760  meNeutralHadronEtFraction_BXm1Filled = ibooker.book1D(
761  "PfNeutralHadronEtFraction_BXm1Filled", "neutralHadronEtFraction() prev filled bunch", 50, 0, 1);
762  meChargedHadronEtFraction_BXm1Empty = ibooker.book1D(
763  "PfChargedHadronEtFraction_BXm1Empty", "chargedHadronEtFraction() prev empty bunch", 50, 0, 1);
764  meChargedHadronEtFraction_BXm1Filled = ibooker.book1D(
765  "PfChargedHadronEtFraction_BXm1Filled", "chargedHadronEtFraction() prev filled bunch", 50, 0, 1);
766  meMET_BXm1Empty = ibooker.book1D("MET_BXm1Empty", "MET prev empty bunch", 200, 0, 1000);
767  meMET_BXm1Filled = ibooker.book1D("MET_BXm1Filled", "MET prev filled bunch", 200, 0, 1000);
768  meSumET_BXm1Empty = ibooker.book1D("SumET_BXm1Empty", "SumET prev empty bunch", 400, 0, 4000);
769  meSumET_BXm1Filled = ibooker.book1D("SumET_BXm1Filled", "SumET prev filled bunch", 400, 0, 4000);
770 
771  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFraction_BXm1Empty",
772  mePhotonEtFraction_BXm1Empty));
773  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFraction_BXm1Filled",
774  mePhotonEtFraction_BXm1Filled));
775  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfNeutralHadronEtFraction_BXm1Empty",
776  meNeutralHadronEtFraction_BXm1Empty));
777  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfNeutralEtFraction_BXm1Filled",
778  meNeutralHadronEtFraction_BXm1Filled));
779  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfChargedHadronEtFraction_BXm1Empty",
780  meChargedHadronEtFraction_BXm1Empty));
781  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfChargedEtFraction_BXm1Filled",
782  meChargedHadronEtFraction_BXm1Filled));
783  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_BXm1Empty", meMET_BXm1Empty));
784  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MET_BXm1Filled", meMET_BXm1Filled));
785  map_of_MEs.insert(
786  std::pair<std::string, MonitorElement*>(DirName + "/" + "SumET_BXm1Empty", meSumET_BXm1Empty));
787  map_of_MEs.insert(
788  std::pair<std::string, MonitorElement*>(DirName + "/" + "SumET_BXm1Filled", meSumET_BXm1Filled));
789 
790  meMETPhiChargedHadronsBarrel_BXm1Filled = ibooker.book1D(
791  "METPhiChargedHadronsBarrel_BXm1Filled", "METPhi_PFChargedHadronsBarrel prev bunch filled", 50, -M_PI, M_PI);
792  meMETPhiChargedHadronsEndcapPlus_BXm1Filled =
793  ibooker.book1D("METPhiChargedHadronsEndcapPlus_BXm1Filled",
794  "METPhi_PFChargedHadronsEndcapPlus prev bunch filled",
795  50,
796  -M_PI,
797  M_PI);
798  meMETPhiChargedHadronsEndcapMinus_BXm1Filled =
799  ibooker.book1D("METPhiChargedHadronsEndcapMinus_BXm1Filled",
800  "METPhi_PFChargedHadronsEndcapMinus prev bunch filled",
801  50,
802  -M_PI,
803  M_PI);
804  meMETPhiNeutralHadronsBarrel_BXm1Filled = ibooker.book1D(
805  "METPhiNeutralHadronsBarrel_BXm1Filled", "METPhi_PFNeutralHadronsBarrel prev bunch filled", 50, -M_PI, M_PI);
806  meMETPhiNeutralHadronsEndcapPlus_BXm1Filled =
807  ibooker.book1D("METPhiNeutralHadronsEndcapPlus_BXm1Filled",
808  "METPhi_PFNeutralHadronsEndcapPlus prev bunch filled",
809  50,
810  -M_PI,
811  M_PI);
812  meMETPhiNeutralHadronsEndcapMinus_BXm1Filled =
813  ibooker.book1D("METPhiNeutralHadronsEndcapMinus_BXm1Filled",
814  "METPhi_PFNeutralHadronsEndcapMinus prev bunch filled",
815  50,
816  -M_PI,
817  M_PI);
818  meMETPhiPhotonsBarrel_BXm1Filled = ibooker.book1D(
819  "METPhiPhotonsBarrel_BXm1Filled", "METPhi_PFPhotonsBarrel prev bunch filled", 50, -M_PI, M_PI);
820  meMETPhiPhotonsEndcapPlus_BXm1Filled = ibooker.book1D(
821  "METPhiPhotonsEndcapPlus_BXm1Filled", "METPhi_PFPhotonsEndcapPlus prev bunch filled", 50, -M_PI, M_PI);
822  meMETPhiPhotonsEndcapMinus_BXm1Filled = ibooker.book1D(
823  "METPhiPhotonsEndcapMinus_BXm1Filled", "METPhi_PFPhotonsEndcapMinus prev bunch filled", 50, -M_PI, M_PI);
824  meMETPhiHFHadronsPlus_BXm1Filled = ibooker.book1D(
825  "METPhiHFHadronsPlus_BXm1Filled", "METPhi_PFHFHadronsPlus prev bunch filled", 50, -M_PI, M_PI);
826  meMETPhiHFHadronsMinus_BXm1Filled = ibooker.book1D(
827  "METPhiHFHadronsMinus_BXm1Filled", "METPhi_PFHFHadronsMinus prev bunch filled", 50, -M_PI, M_PI);
828  meMETPhiHFEGammasPlus_BXm1Filled = ibooker.book1D(
829  "METPhiHFEGammasPlus_BXm1Filled", "METPhi_PFHFEGammasPlus prev bunch filled", 50, -M_PI, M_PI);
830  meMETPhiHFEGammasMinus_BXm1Filled = ibooker.book1D(
831  "METPhiHFEGammasMinus_BXm1Filled", "METPhi_PFHFEGammasMinus prev bunch filled", 50, -M_PI, M_PI);
832 
833  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
834  DirName + "/" + "METPhiChargedHadronsBarrel_BXm1Filled", meMETPhiChargedHadronsBarrel_BXm1Filled));
835  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
836  DirName + "/" + "METPhiChargedHadronsEndcapPlus_BXm1Filled", meMETPhiChargedHadronsEndcapPlus_BXm1Filled));
837  map_of_MEs.insert(
838  std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiChargedHadronsEndcapMinus_BXm1Filled",
839  meMETPhiChargedHadronsEndcapMinus_BXm1Filled));
840  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
841  DirName + "/" + "METPhiNeutralHadronsBarrel_BXm1Filled", meMETPhiNeutralHadronsBarrel_BXm1Filled));
842  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
843  DirName + "/" + "METPhiNeutralHadronsEndcapPlus_BXm1Filled", meMETPhiNeutralHadronsEndcapPlus_BXm1Filled));
844  map_of_MEs.insert(
845  std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiNeutralHadronsEndcapMinus_BXm1Filled",
846  meMETPhiNeutralHadronsEndcapMinus_BXm1Filled));
847  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsBarrel_BXm1Filled",
848  meMETPhiPhotonsBarrel_BXm1Filled));
849  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsEndcapPlus_BXm1Filled",
850  meMETPhiPhotonsEndcapPlus_BXm1Filled));
851  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsEndcapMinus_BXm1Filled",
852  meMETPhiPhotonsEndcapMinus_BXm1Filled));
853  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFHadronsPlus_BXm1Filled",
854  meMETPhiHFHadronsPlus_BXm1Filled));
855  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFHadronsMinus_BXm1Filled",
856  meMETPhiHFHadronsMinus_BXm1Filled));
857  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFEGammasPlus_BXm1Filled",
858  meMETPhiHFEGammasPlus_BXm1Filled));
859  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFEGammasMinus_BXm1Filled",
860  meMETPhiHFEGammasMinus_BXm1Filled));
861 
862  meMETPhiChargedHadronsBarrel_BXm1Empty = ibooker.book1D(
863  "METPhiChargedHadronsBarrel_BXm1Empty", "METPhi_PFChargedHadronsBarrel prev bunch empty", 50, -M_PI, M_PI);
864  meMETPhiChargedHadronsEndcapPlus_BXm1Empty =
865  ibooker.book1D("METPhiChargedHadronsEndcapPlus_BXm1Empty",
866  "METPhi_PFChargedHadronsEndcapPlus prev bunch empty",
867  50,
868  -M_PI,
869  M_PI);
870  meMETPhiChargedHadronsEndcapMinus_BXm1Empty =
871  ibooker.book1D("METPhiChargedHadronsEndcapMinus_BXm1Empty",
872  "METPhi_PFChargedHadronsEndcapMinus prev bunch empty",
873  50,
874  -M_PI,
875  M_PI);
876  meMETPhiNeutralHadronsBarrel_BXm1Empty = ibooker.book1D(
877  "METPhiNeutralHadronsBarrel_BXm1Empty", "METPhi_PFNeutralHadronsBarrel prev bunch empty", 50, -M_PI, M_PI);
878  meMETPhiNeutralHadronsEndcapPlus_BXm1Empty =
879  ibooker.book1D("METPhiNeutralHadronsEndcapPlus_BXm1Empty",
880  "METPhi_PFNeutralHadronsEndcapPlus prev bunch empty",
881  50,
882  -M_PI,
883  M_PI);
884  meMETPhiNeutralHadronsEndcapMinus_BXm1Empty =
885  ibooker.book1D("METPhiNeutralHadronsEndcapMinus_BXm1Empty",
886  "METPhi_PFNeutralHadronsEndcapMinus prev bunch empty",
887  50,
888  -M_PI,
889  M_PI);
890  meMETPhiPhotonsBarrel_BXm1Empty =
891  ibooker.book1D("METPhiPhotonsBarrel_BXm1Empty", "METPhi_PFPhotonsBarrel prev bunch empty", 50, -M_PI, M_PI);
892  meMETPhiPhotonsEndcapPlus_BXm1Empty = ibooker.book1D(
893  "METPhiPhotonsEndcapPlus_BXm1Empty", "METPhi_PFPhotonsEndcapPlus prev bunch empty", 50, -M_PI, M_PI);
894  meMETPhiPhotonsEndcapMinus_BXm1Empty = ibooker.book1D(
895  "METPhiPhotonsEndcapMinus_BXm1Empty", "METPhi_PFPhotonsEndcapMinus prev bunch empty", 50, -M_PI, M_PI);
896  meMETPhiHFHadronsPlus_BXm1Empty =
897  ibooker.book1D("METPhiHFHadronsPlus_BXm1Empty", "METPhi_PFHFHadronsPlus prev bunch empty", 50, -M_PI, M_PI);
898  meMETPhiHFHadronsMinus_BXm1Empty = ibooker.book1D(
899  "METPhiHFHadronsMinus_BXm1Empty", "METPhi_PFHFHadronsMinus prev bunch empty", 50, -M_PI, M_PI);
900  meMETPhiHFEGammasPlus_BXm1Empty =
901  ibooker.book1D("METPhiHFEGammasPlus_BXm1Empty", "METPhi_PFHFEGammasPlus prev bunch empty", 50, -M_PI, M_PI);
902  meMETPhiHFEGammasMinus_BXm1Empty = ibooker.book1D(
903  "METPhiHFEGammasMinus_BXm1Empty", "METPhi_PFHFEGammasMinus prev bunch empty", 50, -M_PI, M_PI);
904 
905  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
906  DirName + "/" + "METPhiChargedHadronsBarrel_BXm1Empty", meMETPhiChargedHadronsBarrel_BXm1Empty));
907  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
908  DirName + "/" + "METPhiChargedHadronsEndcapPlus_BXm1Empty", meMETPhiChargedHadronsEndcapPlus_BXm1Empty));
909  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
910  DirName + "/" + "METPhiChargedHadronsEndcapMinus_BXm1Empty", meMETPhiChargedHadronsEndcapMinus_BXm1Empty));
911  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
912  DirName + "/" + "METPhiNeutralHadronsBarrel_BXm1Empty", meMETPhiNeutralHadronsBarrel_BXm1Empty));
913  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
914  DirName + "/" + "METPhiNeutralHadronsEndcapPlus_BXm1Empty", meMETPhiNeutralHadronsEndcapPlus_BXm1Empty));
915  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
916  DirName + "/" + "METPhiNeutralHadronsEndcapMinus_BXm1Empty", meMETPhiNeutralHadronsEndcapMinus_BXm1Empty));
917  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsBarrel_BXm1Empty",
918  meMETPhiPhotonsBarrel_BXm1Empty));
919  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsEndcapPlus_BXm1Empty",
920  meMETPhiPhotonsEndcapPlus_BXm1Empty));
921  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsEndcapMinus_BXm1Empty",
922  meMETPhiPhotonsEndcapMinus_BXm1Empty));
923  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFHadronsPlus_BXm1Empty",
924  meMETPhiHFHadronsPlus_BXm1Empty));
925  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFHadronsMinus_BXm1Empty",
926  meMETPhiHFHadronsMinus_BXm1Empty));
927  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFEGammasPlus_BXm1Empty",
928  meMETPhiHFEGammasPlus_BXm1Empty));
929  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFEGammasMinus_BXm1Empty",
930  meMETPhiHFEGammasMinus_BXm1Empty));
931 
932  meMETPhiChargedHadronsBarrel =
933  ibooker.book1D("METPhiChargedHadronsBarrel", "METPhi_PFChargedHadronsBarrel", 50, -M_PI, M_PI);
934  meMETPhiChargedHadronsEndcapPlus =
935  ibooker.book1D("METPhiChargedHadronsEndcapPlus", "METPhi_PFChargedHadronsEndcapPlus", 50, -M_PI, M_PI);
936  meMETPhiChargedHadronsEndcapMinus =
937  ibooker.book1D("METPhiChargedHadronsEndcapMinus", "METPhi_PFChargedHadronsEndcapMinus", 50, -M_PI, M_PI);
938  meMETPhiNeutralHadronsBarrel =
939  ibooker.book1D("METPhiNeutralHadronsBarrel", "METPhi_PFNeutralHadronsBarrel", 50, -M_PI, M_PI);
940  meMETPhiNeutralHadronsEndcapPlus =
941  ibooker.book1D("METPhiNeutralHadronsEndcapPlus", "METPhi_PFNeutralHadronsEndcapPlus", 50, -M_PI, M_PI);
942  meMETPhiNeutralHadronsEndcapMinus =
943  ibooker.book1D("METPhiNeutralHadronsEndcapMinus", "METPhi_PFNeutralHadronsEndcapMinus", 50, -M_PI, M_PI);
944  meMETPhiPhotonsBarrel = ibooker.book1D("METPhiPhotonsBarrel", "METPhi_PFPhotonsBarrel", 50, -M_PI, M_PI);
945  meMETPhiPhotonsEndcapPlus =
946  ibooker.book1D("METPhiPhotonsEndcapPlus", "METPhi_PFPhotonsEndcapPlus", 50, -M_PI, M_PI);
947  meMETPhiPhotonsEndcapMinus =
948  ibooker.book1D("METPhiPhotonsEndcapMinus", "METPhi_PFPhotonsEndcapMinus", 50, -M_PI, M_PI);
949  meMETPhiHFHadronsPlus = ibooker.book1D("METPhiHFHadronsPlus", "METPhi_PFHFHadronsPlus", 50, -M_PI, M_PI);
950  meMETPhiHFHadronsMinus = ibooker.book1D("METPhiHFHadronsMinus", "METPhi_PFHFHadronsMinus", 50, -M_PI, M_PI);
951  meMETPhiHFEGammasPlus = ibooker.book1D("METPhiHFEGammasPlus", "METPhi_PFHFEGammasPlus", 50, -M_PI, M_PI);
952  meMETPhiHFEGammasMinus = ibooker.book1D("METPhiHFEGammasMinus", "METPhi_PFHFEGammasMinus", 50, -M_PI, M_PI);
953 
954  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiChargedHadronsBarrel",
955  meMETPhiChargedHadronsBarrel));
956  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiChargedHadronsEndcapPlus",
957  meMETPhiChargedHadronsEndcapPlus));
958  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiChargedHadronsEndcapMinus",
959  meMETPhiChargedHadronsEndcapMinus));
960  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiNeutralHadronsBarrel",
961  meMETPhiNeutralHadronsBarrel));
962  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiNeutralHadronsEndcapPlus",
963  meMETPhiNeutralHadronsEndcapPlus));
964  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiNeutralHadronsEndcapMinus",
965  meMETPhiNeutralHadronsEndcapMinus));
966  map_of_MEs.insert(
967  std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsBarrel", meMETPhiPhotonsBarrel));
968  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsEndcapPlus",
969  meMETPhiPhotonsEndcapPlus));
970  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiPhotonsEndcapMinus",
971  meMETPhiPhotonsEndcapMinus));
972  map_of_MEs.insert(
973  std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFHadronsPlus", meMETPhiHFHadronsPlus));
974  map_of_MEs.insert(
975  std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFHadronsMinus", meMETPhiHFHadronsMinus));
976  map_of_MEs.insert(
977  std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFEGammasPlus", meMETPhiHFEGammasPlus));
978  map_of_MEs.insert(
979  std::pair<std::string, MonitorElement*>(DirName + "/" + "METPhiHFEGammasMinus", meMETPhiHFEGammasMinus));
980  }
981 
982  if (fillPFCandPlots && fillCandidateMap_histos) {
983  if (!profilePFCand_x_.empty()) {
984  etaMinPFCand_.clear();
985  etaMaxPFCand_.clear();
986  typePFCand_.clear();
987  countsPFCand_.clear();
988  MExPFCand_.clear();
989  MEyPFCand_.clear();
990  profilePFCand_x_.clear();
991  profilePFCand_y_.clear();
992  profilePFCand_x_name_.clear();
993  profilePFCand_y_name_.clear();
994  }
995  for (std::vector<edm::ParameterSet>::const_iterator v = diagnosticsParameters_.begin();
996  v != diagnosticsParameters_.end();
997  v++) {
998  double etaMinPFCand = v->getParameter<double>("etaMin");
999  double etaMaxPFCand = v->getParameter<double>("etaMax");
1000  int nMinPFCand = v->getParameter<int>("nMin");
1001  int nMaxPFCand = v->getParameter<int>("nMax");
1002  int nbinsPFCand = v->getParameter<double>("nbins");
1003 
1004  // etaNBins_.push_back(etaNBins);
1005  etaMinPFCand_.push_back(etaMinPFCand);
1006  etaMaxPFCand_.push_back(etaMaxPFCand);
1007  typePFCand_.push_back(v->getParameter<int>("type"));
1008  countsPFCand_.push_back(0);
1009  MExPFCand_.push_back(0.);
1010  MEyPFCand_.push_back(0.);
1011 
1012  profilePFCand_x_.push_back(
1013  ibooker.bookProfile(std::string(v->getParameter<std::string>("name")).append("_Px_").c_str(),
1014  std::string(v->getParameter<std::string>("name")) + "Px",
1015  nbinsPFCand,
1016  nMinPFCand,
1017  nMaxPFCand,
1018  -300,
1019  300));
1020  profilePFCand_x_name_.push_back(std::string(v->getParameter<std::string>("name")).append("_Px_"));
1021  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
1022  DirName + "/" + profilePFCand_x_name_[profilePFCand_x_name_.size() - 1],
1023  profilePFCand_x_[profilePFCand_x_.size() - 1]));
1024  profilePFCand_y_.push_back(
1025  ibooker.bookProfile(std::string(v->getParameter<std::string>("name")).append("_Py_").c_str(),
1026  std::string(v->getParameter<std::string>("name")) + "Py",
1027  nbinsPFCand,
1028  nMinPFCand,
1029  nMaxPFCand,
1030  -300,
1031  300));
1032  profilePFCand_y_name_.push_back(std::string(v->getParameter<std::string>("name")).append("_Py_"));
1033  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
1034  DirName + "/" + profilePFCand_y_name_[profilePFCand_y_name_.size() - 1],
1035  profilePFCand_y_[profilePFCand_y_.size() - 1]));
1036  }
1037  }
1038  }
1039  if (isMiniAODMet_) {
1040  if (fillPFCandPlots &&
1041  fillCandidateMap_histos) { //first bool internal checks for subdirectory filling, second bool given in cfg file, checks that we fill maps only in one module in total
1042  if (!profilePFCand_x_.empty()) {
1043  etaMinPFCand_.clear();
1044  etaMaxPFCand_.clear();
1045  typePFCand_.clear();
1046  countsPFCand_.clear();
1047  profilePFCand_x_.clear();
1048  profilePFCand_y_.clear();
1049  }
1050  for (std::vector<edm::ParameterSet>::const_iterator v = diagnosticsParameters_.begin();
1051  v != diagnosticsParameters_.end();
1052  v++) {
1053  double etaMinPFCand = v->getParameter<double>("etaMin");
1054  double etaMaxPFCand = v->getParameter<double>("etaMax");
1055 
1056  etaMinPFCand_.push_back(etaMinPFCand);
1057  etaMaxPFCand_.push_back(etaMaxPFCand);
1058  typePFCand_.push_back(v->getParameter<int>("type"));
1059  countsPFCand_.push_back(0);
1060  MExPFCand_.push_back(0.);
1061  MEyPFCand_.push_back(0.);
1062  }
1063  }
1064  }
1065 
1066  if (isPFMet_ || isMiniAODMet_) {
1067  mePhotonEtFraction = ibooker.book1D("PfPhotonEtFraction", "photonEtFraction()", 50, 0, 1);
1068  meNeutralHadronEtFraction = ibooker.book1D("PfNeutralHadronEtFraction", "neutralHadronEtFraction()", 50, 0, 1);
1069  meChargedHadronEtFraction = ibooker.book1D("PfChargedHadronEtFraction", "chargedHadronEtFraction()", 50, 0, 1);
1070  meHFHadronEtFraction = ibooker.book1D("PfHFHadronEtFraction", "HFHadronEtFraction()", 50, 0, 1);
1071  meHFEMEtFraction = ibooker.book1D("PfHFEMEtFraction", "HFEMEtFraction()", 50, 0, 1);
1072 
1073  map_of_MEs.insert(
1074  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFraction", mePhotonEtFraction));
1075  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfNeutralHadronEtFraction",
1076  meNeutralHadronEtFraction));
1077  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfChargedHadronEtFraction",
1078  meChargedHadronEtFraction));
1079  map_of_MEs.insert(
1080  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEtFraction", meHFHadronEtFraction));
1081  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEtFraction", meHFEMEtFraction));
1082 
1083  mePhotonEtFraction_profile =
1084  ibooker.bookProfile("PfPhotonEtFraction_profile", "photonEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
1085  meNeutralHadronEtFraction_profile = ibooker.bookProfile(
1086  "PfNeutralHadronEtFraction_profile", "neutralHadronEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
1087  meChargedHadronEtFraction_profile = ibooker.bookProfile(
1088  "PfChargedHadronEtFraction_profile", "chargedHadronEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
1089  meHFHadronEtFraction_profile = ibooker.bookProfile(
1090  "PfHFHadronEtFraction_profile", "HFHadronEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
1091  meHFEMEtFraction_profile =
1092  ibooker.bookProfile("PfHFEMEtFraction_profile", "HFEMEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
1093  mePhotonEtFraction_profile->setAxisTitle("nvtx", 1);
1094  meNeutralHadronEtFraction_profile->setAxisTitle("nvtx", 1);
1095  meChargedHadronEtFraction_profile->setAxisTitle("nvtx", 1);
1096  meHFHadronEtFraction_profile->setAxisTitle("nvtx", 1);
1097  meHFEMEtFraction_profile->setAxisTitle("nvtx", 1);
1098 
1099  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEtFraction_profile",
1100  mePhotonEtFraction_profile));
1101  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfNeutralHadronEtFraction_profile",
1102  meNeutralHadronEtFraction_profile));
1103  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfChargedHadronEtFraction_profile",
1104  meChargedHadronEtFraction_profile));
1105  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEtFraction_profile",
1106  meHFHadronEtFraction_profile));
1107  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEtFraction_profile",
1108  meHFEMEtFraction_profile));
1109 
1110  mePhotonEt = ibooker.book1D("PfPhotonEt", "photonEt()", 50, 0, 1000);
1111  meNeutralHadronEt = ibooker.book1D("PfNeutralHadronEt", "neutralHadronEt()", 50, 0, 1000);
1112  meElectronEt = ibooker.book1D("PfElectronEt", "electronEt()", 50, 0, 100);
1113  meChargedHadronEt = ibooker.book1D("PfChargedHadronEt", "chargedHadronEt()", 50, 0, 2000);
1114  meMuonEt = ibooker.book1D("PfMuonEt", "muonEt()", 50, 0, 100);
1115  meHFHadronEt = ibooker.book1D("PfHFHadronEt", "HFHadronEt()", 50, 0, 2000);
1116  meHFEMEt = ibooker.book1D("PfHFEMEt", "HFEMEt()", 50, 0, 1000);
1117 
1118  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEt", mePhotonEt));
1119  map_of_MEs.insert(
1120  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfNeutralHadronEt", meNeutralHadronEt));
1121  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfElectronEt", meElectronEt));
1122  map_of_MEs.insert(
1123  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfChargedHadronEt", meChargedHadronEt));
1124  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfMuonEt", meMuonEt));
1125  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEt", meHFHadronEt));
1126  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEt", meHFEMEt));
1127 
1128  mePhotonEt_profile =
1129  ibooker.bookProfile("PfPhotonEt_profile", "photonEt()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1000);
1130  meNeutralHadronEt_profile = ibooker.bookProfile(
1131  "PfNeutralHadronEt_profile", "neutralHadronEt()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1000);
1132  meChargedHadronEt_profile = ibooker.bookProfile(
1133  "PfChargedHadronEt_profile", "chargedHadronEt()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1000);
1134  meHFHadronEt_profile =
1135  ibooker.bookProfile("PfHFHadronEt_profile", "HFHadronEt()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1000);
1136  meHFEMEt_profile = ibooker.bookProfile("PfHFEMEt_profile", "HFEMEt()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1000);
1137 
1138  mePhotonEt_profile->setAxisTitle("nvtx", 1);
1139  meNeutralHadronEt_profile->setAxisTitle("nvtx", 1);
1140  meChargedHadronEt_profile->setAxisTitle("nvtx", 1);
1141  meHFHadronEt_profile->setAxisTitle("nvtx", 1);
1142  meHFEMEt_profile->setAxisTitle("nvtx", 1);
1143 
1144  map_of_MEs.insert(
1145  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfPhotonEt_profile", mePhotonEt_profile));
1146  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfNeutralHadronEt_profile",
1147  meNeutralHadronEt_profile));
1148  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfChargedHadronEt_profile",
1149  meChargedHadronEt_profile));
1150  map_of_MEs.insert(
1151  std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFHadronEt_profile", meHFHadronEt_profile));
1152  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "PfHFEMEt_profile", meHFEMEt_profile));
1153  }
1154 
1155  if (isCaloMet_) {
1156  if (fill_met_high_level_histo) { //now configurable in python file
1157  hMExLS = ibooker.book2D("MExLS", "MEx_LS", 200, -200, 200, 250, 0., 2500.);
1158  hMExLS->setAxisTitle("MEx [GeV]", 1);
1159  hMExLS->setAxisTitle("Lumi Section", 2);
1160  hMExLS->setOption("colz");
1161  hMEyLS = ibooker.book2D("MEyLS", "MEy_LS", 200, -200, 200, 250, 0., 2500.);
1162  hMEyLS->setAxisTitle("MEy [GeV]", 1);
1163  hMEyLS->setAxisTitle("Lumi Section", 2);
1164  hMEyLS->setOption("colz");
1165  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MExLS", hMExLS));
1166  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "MEyLS", hMEyLS));
1167  }
1168  }
1169 
1170  hMETRate = ibooker.book1D("METRate", "METRate", 200, 0, 1000);
1171  map_of_MEs.insert(std::pair<std::string, MonitorElement*>(DirName + "/" + "METRate", hMETRate));
1172 
1173  ibooker.setCurrentFolder("JetMET");
1174  lumisecME = ibooker.book1D("lumisec", "lumisec", 2501, -1., 2500.);
1175  map_of_MEs.insert(std::pair<std::string, MonitorElement*>("JetMET/lumisec", lumisecME));
1176  } //all non Z plots (restrict Z Plots only for resolution study)
1177 }
1178 
1179 // ***********************************************************
1180 void METAnalyzer::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
1182  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
1183  const L1GtTriggerMenu* menu = menuRcd.product();
1184  for (CItAlgo techTrig = menu->gtTechnicalTriggerMap().begin(); techTrig != menu->gtTechnicalTriggerMap().end();
1185  ++techTrig) {
1186  if ((techTrig->second).algoName() == m_l1algoname_) {
1187  m_bitAlgTechTrig_ = (techTrig->second).algoBitNumber();
1188  break;
1189  }
1190  }
1191 
1192  // std::cout << "Run " << iRun.run() << " hltconfig.init "
1193  // << hltConfig_.init(iRun,iSetup,triggerResultsLabel_.process(),changed_) << " length: "<<hltConfig_.triggerNames().size()<<" changed "<<changed_<<std::endl;
1194  bool changed(true);
1195  if (hltConfig_.init(iRun, iSetup, triggerResultsLabel_.process(), changed)) {
1196  if (changed) {
1197  //hltConfig_.dump("ProcessName");
1198  //hltConfig_.dump("GlobalTag");
1199  //hltConfig_.dump("TableName");
1200  // hltConfig_.dump("Streams");
1201  // hltConfig_.dump("Datasets");
1202  // hltConfig_.dump("PrescaleTable");
1203  // hltConfig_.dump("ProcessPSet");
1204  }
1205  } else {
1206  if (verbose_)
1207  std::cout << "HLTEventAnalyzerAOD::analyze:"
1208  << " config extraction failure with process name " << triggerResultsLabel_.process() << std::endl;
1209  }
1210 
1211  allTriggerNames_.clear();
1212  for (unsigned int i = 0; i < hltConfig_.size(); i++) {
1213  allTriggerNames_.push_back(hltConfig_.triggerName(i));
1214  }
1215  // std::cout<<"Length: "<<allTriggerNames_.size()<<std::endl;
1216 
1217  triggerSelectedSubFolders_ = parameters.getParameter<edm::VParameterSet>("triggerSelectedSubFolders");
1218  for (std::vector<GenericTriggerEventFlag*>::const_iterator it = triggerFolderEventFlag_.begin();
1219  it != triggerFolderEventFlag_.end();
1220  it++) {
1221  int pos = it - triggerFolderEventFlag_.begin();
1222  if ((*it)->on()) {
1223  (*it)->initRun(iRun, iSetup);
1224  if (triggerSelectedSubFolders_[pos].exists(std::string("hltDBKey"))) {
1225  if ((*it)->expressionsFromDB((*it)->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
1226  triggerFolderExpr_[pos] = (*it)->expressionsFromDB((*it)->hltDBKey(), iSetup);
1227  }
1228  }
1229  }
1230  if (isMiniAODMet_) {
1231  bool changed_filter = true;
1232  std::vector<int> initializeFilter(8, -1); //we have 8 filters at the moment
1233  miniaodFilterIndex_ = initializeFilter;
1234  if (FilterhltConfig_.init(iRun, iSetup, METFilterMiniAODLabel_.process(), changed_filter)) {
1235  miniaodfilterdec = 0;
1236  for (unsigned int i = 0; i < FilterhltConfig_.size(); i++) {
1237  std::string search = FilterhltConfig_.triggerName(i).substr(
1238  5); //actual label of filter, the first 5 items are Flag_, so stripped off
1240  HBHENoiseStringMiniAOD; //all filters end with DQM, which is not in the flag --> ONLY not for HBHEFilters
1241  std::size_t found = search2.find(search);
1242  if (found != std::string::npos) {
1243  miniaodFilterIndex_[0] = i;
1244  }
1245  search2 = CSCHaloResultTag_.label().substr(0, CSCHaloResultTag_.label().size() - 3);
1246  found = search2.find(search);
1247  if (found != std::string::npos) {
1248  miniaodFilterIndex_[1] = i;
1249  }
1250  search2 = eeBadScFilterTag_.label().substr(0, eeBadScFilterTag_.label().size() - 3);
1251  found = search2.find(search);
1252  if (found != std::string::npos) {
1253  miniaodFilterIndex_[2] = i;
1254  }
1255  search2 = HBHEIsoNoiseStringMiniAOD;
1256  found = search2.find(search);
1257  if (found != std::string::npos) {
1258  miniaodFilterIndex_[3] = i;
1259  }
1260  search2 = CSCHalo2015ResultTag_.label().substr(0, CSCHalo2015ResultTag_.label().size() - 3);
1261  found = search2.find(search);
1262  if (found != std::string::npos) {
1263  miniaodFilterIndex_[4] = i;
1264  }
1265  search2 = EcalDeadCellTriggerTag_.label().substr(0, EcalDeadCellTriggerTag_.label().size() - 3);
1266  found = search2.find(search);
1267  if (found != std::string::npos) {
1268  miniaodFilterIndex_[5] = i;
1269  }
1270  search2 = EcalDeadCellBoundaryTag_.label().substr(0, EcalDeadCellBoundaryTag_.label().size() - 3);
1271  found = search2.find(search);
1272  if (found != std::string::npos) {
1273  miniaodFilterIndex_[6] = i;
1274  }
1275  search2 = HcalStripHaloTag_.label().substr(0, HcalStripHaloTag_.label().size() - 3);
1276  found = search2.find(search);
1277  if (found != std::string::npos) {
1278  miniaodFilterIndex_[7] = i;
1279  }
1280  }
1281  } else if (FilterhltConfig_.init(iRun, iSetup, METFilterMiniAODLabel2_.process(), changed_filter)) {
1282  miniaodfilterdec = 1;
1283  for (unsigned int i = 0; i < FilterhltConfig_.size(); i++) {
1284  std::string search = FilterhltConfig_.triggerName(i).substr(
1285  5); //actual label of filter, the first 5 items are Flag_, so stripped off
1287  HBHENoiseStringMiniAOD; //all filters end with DQM, which is not in the flag --> ONLY not for HBHEFilters
1288  std::size_t found = search2.find(search);
1289  if (found != std::string::npos) {
1290  miniaodFilterIndex_[0] = i;
1291  }
1292  search2 = CSCHaloResultTag_.label().substr(0, CSCHaloResultTag_.label().size() - 3);
1293  found = search2.find(search);
1294  if (found != std::string::npos) {
1295  miniaodFilterIndex_[1] = i;
1296  }
1297  search2 = eeBadScFilterTag_.label().substr(0, eeBadScFilterTag_.label().size() - 3);
1298  found = search2.find(search);
1299  if (found != std::string::npos) {
1300  miniaodFilterIndex_[2] = i;
1301  }
1302  search2 = HBHEIsoNoiseStringMiniAOD;
1303  found = search2.find(search);
1304  if (found != std::string::npos) {
1305  miniaodFilterIndex_[3] = i;
1306  }
1307  search2 = CSCHalo2015ResultTag_.label().substr(0, CSCHalo2015ResultTag_.label().size() - 3);
1308  found = search2.find(search);
1309  if (found != std::string::npos) {
1310  miniaodFilterIndex_[4] = i;
1311  }
1312  search2 = EcalDeadCellTriggerTag_.label().substr(0, EcalDeadCellTriggerTag_.label().size() - 3);
1313  found = search2.find(search);
1314  if (found != std::string::npos) {
1315  miniaodFilterIndex_[5] = i;
1316  }
1317  search2 = EcalDeadCellBoundaryTag_.label().substr(0, EcalDeadCellBoundaryTag_.label().size() - 3);
1318  found = search2.find(search);
1319  if (found != std::string::npos) {
1320  miniaodFilterIndex_[6] = i;
1321  }
1322  search2 = HcalStripHaloTag_.label().substr(0, HcalStripHaloTag_.label().size() - 3);
1323  found = search2.find(search);
1324  if (found != std::string::npos) {
1325  miniaodFilterIndex_[7] = i;
1326  }
1327  }
1328  } else {
1329  edm::LogWarning("MiniAOD METAN Filter HLT OBject version")
1330  << "nothing found with both RECO and reRECO label" << std::endl;
1331  }
1332  }
1333 }
1334 
1335 // ***********************************************************
1336 void METAnalyzer::dqmEndRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
1337  //
1338  //--- Check the time length of the Run from the lumi section plots
1339 
1340  TH1F* tlumisec;
1341 
1342  MonitorElement* meLumiSec = map_dijet_MEs["aaa"];
1343  meLumiSec = map_dijet_MEs["JetMET/lumisec"];
1344 
1345  int totlsec = 0;
1346  int totlssecsum = 0;
1347  double totltime = 0.;
1348  if (meLumiSec && meLumiSec->getRootObject()) {
1349  tlumisec = meLumiSec->getTH1F();
1350  //check overflow bin (if we have more than 2500 LS in a run)
1351  //lumisec is filled every time the analyze section is processed
1352  //we know an LS is present only once in a run: normalize how many events we had on average
1353  //if lumi fluctuates strongly might be unreliable for overflow bin though
1354  for (int i = 0; i < (tlumisec->GetNbinsX()); i++) {
1355  if (tlumisec->GetBinContent(i) != 0) {
1356  totlsec += 1;
1357  totlssecsum += tlumisec->GetBinContent(i);
1358  }
1359  }
1360  int num_per_ls = (double)totlssecsum / (double)totlsec;
1361  totlsec = totlsec + tlumisec->GetBinContent(tlumisec->GetNbinsX() + 1) / (double)num_per_ls;
1362  totltime = double(totlsec * 90); // one lumi sec ~ 90 (sec)
1363  }
1364 
1365  if (totltime == 0.)
1366  totltime = 1.;
1367 
1368  std::string dirName = FolderName_ + metCollectionLabel_.label() + "/";
1369  //dbe_->setCurrentFolder(dirName);
1370 
1371  //below is the original METAnalyzer formulation
1372 
1373  for (std::vector<std::string>::const_iterator ic = folderNames_.begin(); ic != folderNames_.end(); ic++) {
1375  DirName = dirName + *ic;
1376  makeRatePlot(DirName, totltime);
1377  for (std::vector<GenericTriggerEventFlag*>::const_iterator it = triggerFolderEventFlag_.begin();
1378  it != triggerFolderEventFlag_.end();
1379  it++) {
1380  int pos = it - triggerFolderEventFlag_.begin();
1381  if ((*it)->on()) {
1382  makeRatePlot(DirName + "/" + triggerFolderLabels_[pos], totltime);
1383  }
1384  }
1385  }
1386 }
1387 
1388 // ***********************************************************
1390  //dbe_->setCurrentFolder(DirName);
1391  MonitorElement* meMET = map_dijet_MEs[DirName + "/" + "MET"];
1392  MonitorElement* mMETRate = map_dijet_MEs[DirName + "/" + "METRate"];
1393 
1394  TH1F* tMET;
1395  TH1F* tMETRate;
1396 
1397  if (meMET && mMETRate) {
1398  if (meMET->getRootObject() && mMETRate->getRootObject()) {
1399  tMET = meMET->getTH1F();
1400 
1401  // Integral plot & convert number of events to rate (hz)
1402  tMETRate = (TH1F*)tMET->Clone("METRateHist");
1403  for (int i = tMETRate->GetNbinsX() - 1; i >= 0; i--) {
1404  mMETRate->setBinContent(i + 1, tMETRate->GetBinContent(i + 2) + tMET->GetBinContent(i + 1));
1405  }
1406  for (int i = 0; i < tMETRate->GetNbinsX(); i++) {
1407  mMETRate->setBinContent(i + 1, tMETRate->GetBinContent(i + 1) / double(totltime));
1408  }
1409  }
1410  }
1411 }
1412 
1413 // ***********************************************************
1415  // *** Fill lumisection ME
1416  int myLuminosityBlock;
1417  myLuminosityBlock = iEvent.luminosityBlock();
1418  if (fill_met_high_level_histo) {
1419  lumisecME = map_dijet_MEs["JetMET/lumisec"];
1420  if (lumisecME && lumisecME->getRootObject())
1421  lumisecME->Fill(myLuminosityBlock);
1422  }
1423 
1424  if (myLuminosityBlock < LSBegin_)
1425  return;
1426  if (myLuminosityBlock > LSEnd_ && LSEnd_ > 0)
1427  return;
1428 
1429  if (verbose_)
1430  std::cout << "METAnalyzer analyze" << std::endl;
1431 
1432  std::string DirName = FolderName_ + metCollectionLabel_.label();
1433 
1434  // ==========================================================
1435  // Trigger information
1436  //
1437  // trigJetMB_=0;
1438  // trigHighPtJet_=0;
1439  // trigLowPtJet_=0;
1440  // trigMinBias_=0;
1441  // trigHighMET_=0;
1442  // // _trig_LowMET=0;
1443  // trigEle_=0;
1444  // trigMuon_=0;
1445  // trigPhysDec_=0;
1446  std::vector<int> triggerFolderDecisions;
1447  triggerFolderDecisions_ = std::vector<int>(triggerFolderEventFlag_.size(), 0);
1448  // **** Get the TriggerResults container
1450  iEvent.getByToken(triggerResultsToken_, triggerResults);
1451 
1452  if (triggerResults.isValid()) {
1454  // Check how many HLT triggers are in triggerResults
1455  int ntrigs = (*triggerResults).size();
1456  if (verbose_)
1457  std::cout << "ntrigs=" << ntrigs << std::endl;
1458  // If index=ntrigs, this HLT trigger doesn't exist in the HLT table for this data.
1459  for (std::vector<GenericTriggerEventFlag*>::const_iterator it = triggerFolderEventFlag_.begin();
1460  it != triggerFolderEventFlag_.end();
1461  it++) {
1462  unsigned int pos = it - triggerFolderEventFlag_.begin();
1463  bool fd = (*it)->accept(iEvent, iSetup);
1464  triggerFolderDecisions_[pos] = fd;
1465  }
1466  allTriggerDecisions_.clear();
1467  for (unsigned int i = 0; i < allTriggerNames_.size(); ++i) {
1468  allTriggerDecisions_.push_back((*triggerResults).accept(i));
1469  //std::cout<<"TR "<<(*triggerResults).size()<<" "<<(*triggerResults).accept(i)<<" "<<allTriggerNames_[i]<<std::endl;
1470  }
1471  }
1472 
1473  // ==========================================================
1474  // MET information
1475 
1476  // **** Get the MET container
1481 
1482  //if(isTCMet_){
1483  //iEvent.getByToken(tcMetToken_, tcmetcoll);
1484  //if(!tcmetcoll.isValid()) return;
1485  //}
1486  if (isCaloMet_) {
1487  iEvent.getByToken(caloMetToken_, calometcoll);
1488  if (!calometcoll.isValid())
1489  return;
1490  }
1491  if (isPFMet_) {
1492  iEvent.getByToken(pfMetToken_, pfmetcoll);
1493  if (!pfmetcoll.isValid())
1494  return;
1495  }
1496  if (isMiniAODMet_) {
1497  iEvent.getByToken(patMetToken_, patmetcoll);
1498  if (!patmetcoll.isValid())
1499  return;
1500  }
1501 
1502  const MET* met = nullptr;
1503  const pat::MET* patmet = nullptr;
1504  const PFMET* pfmet = nullptr;
1505  const CaloMET* calomet = nullptr;
1506  //if(isTCMet_){
1507  //met=&(tcmetcoll->front());
1508  //}
1509  if (isPFMet_) {
1510  assert(!pfmetcoll->empty());
1511  met = &(pfmetcoll->front());
1512  pfmet = &(pfmetcoll->front());
1513  }
1514  if (isCaloMet_) {
1515  assert(!calometcoll->empty());
1516  met = &(calometcoll->front());
1517  calomet = &(calometcoll->front());
1518  }
1519  if (isMiniAODMet_) {
1520  assert(!patmetcoll->empty());
1521  met = &(patmetcoll->front());
1522  patmet = &(patmetcoll->front());
1523  }
1524 
1525  LogTrace("METAnalyzer") << "[METAnalyzer] Call to the MET analyzer";
1526 
1527  // ==========================================================
1528  // TCMET
1529 
1530  //if (/*isTCMet_ || */(isCaloMet_ && metCollectionLabel_.label() == "corMetGlobalMuons")) {
1531 
1532  //iEvent.getByToken(MuonToken_, muonHandle_);
1533  //iEvent.getByToken(TrackToken_, trackHandle_);
1534  //iEvent.getByToken(ElectronToken_, electronHandle_);
1535  //iEvent.getByToken(BeamspotToken_, beamSpotHandle_);
1536  //iEvent.getByToken(tcMETValueMapToken_,tcMetValueMapHandle_);
1537 
1538  //if(!muonHandle_.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve muon data require by MET Task";
1539  //if(!trackHandle_.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve track data require by MET Task";
1540  //if(!electronHandle_.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve electron data require by MET Task";
1541  //if(!beamSpotHandle_.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve beam spot data require by MET Task";
1542 
1543  //beamSpot_ = ( beamSpotHandle_.isValid() ) ? beamSpotHandle_->position() : math::XYZPoint(0, 0, 0);
1544  //}
1545 
1546  // ==========================================================
1547  bool bJetID = false;
1548  bool bDiJetID = false;
1549  // Jet ID -------------------------------------------------------
1550  //
1551 
1556 
1557  int collsize = -1;
1558 
1559  if (isCaloMet_) {
1560  iEvent.getByToken(caloJetsToken_, caloJets);
1561  if (!caloJets.isValid()) {
1562  LogDebug("") << "METAnalyzer: Could not find calojet product" << std::endl;
1563  if (verbose_)
1564  std::cout << "METAnalyzer: Could not find calojet product" << std::endl;
1565  }
1566  collsize = caloJets->size();
1567  }
1569  //if (isTCMet_){
1570  //iEvent.getByToken(jptJetsToken_, jptJets);
1571  //if (!jptJets.isValid()) {
1572  // LogDebug("") << "METAnalyzer: Could not find jptjet product" << std::endl;
1573  // if (verbose_) std::cout << "METAnalyzer: Could not find jptjet product" << std::endl;
1574  //}
1575  //collsize=jptJets->size();
1576  //}*/
1577 
1578  edm::Handle<edm::ValueMap<reco::JetID> > jetID_ValueMap_Handle;
1579  if (/*isTCMet_ || */ isCaloMet_) {
1580  if (!runcosmics_) {
1581  iEvent.getByToken(jetID_ValueMapToken_, jetID_ValueMap_Handle);
1582  }
1583  }
1584 
1585  if (isMiniAODMet_) {
1586  iEvent.getByToken(patJetsToken_, patJets);
1587  if (!patJets.isValid()) {
1588  LogDebug("") << "METAnalyzer: Could not find patjet product" << std::endl;
1589  if (verbose_)
1590  std::cout << "METAnalyzer: Could not find patjet product" << std::endl;
1591  }
1592  collsize = patJets->size();
1593  }
1594 
1595  if (isPFMet_) {
1596  iEvent.getByToken(pfJetsToken_, pfJets);
1597  if (!pfJets.isValid()) {
1598  LogDebug("") << "METAnalyzer: Could not find pfjet product" << std::endl;
1599  if (verbose_)
1600  std::cout << "METAnalyzer: Could not find pfjet product" << std::endl;
1601  }
1602  collsize = pfJets->size();
1603  }
1604 
1605  unsigned int ind1 = -1;
1606  double pt1 = -1;
1607  bool pass_jetID1 = false;
1608  unsigned int ind2 = -1;
1609  double pt2 = -1;
1610  bool pass_jetID2 = false;
1611 
1613  bool pass_correction_flag = false;
1614  if (!isMiniAODMet_) {
1615  iEvent.getByToken(jetCorrectorToken_, jetCorr);
1616  if (jetCorr.isValid()) {
1617  pass_correction_flag = true;
1618  }
1619  } else {
1620  pass_correction_flag = true;
1621  }
1622  //do loose jet ID-> check threshold on corrected jets
1623  for (int ijet = 0; ijet < collsize; ijet++) {
1624  double pt_jet = -10;
1625  double scale = 1.;
1626  bool iscleaned = false;
1627  if (pass_correction_flag) {
1628  if (isCaloMet_) {
1629  scale = jetCorr->correction((*caloJets)[ijet]);
1630  }
1631  //if(isTCMet_){
1632  //scale = jetCorr->correction((*jptJets)[ijet]);
1633  //}
1634  if (isPFMet_) {
1635  scale = jetCorr->correction((*pfJets)[ijet]);
1636  }
1637  }
1638  if (isCaloMet_) {
1639  pt_jet = scale * (*caloJets)[ijet].pt();
1640  if (pt_jet > ptThreshold_) {
1641  reco::CaloJetRef calojetref(caloJets, ijet);
1642  if (!runcosmics_) {
1643  reco::JetID jetID = (*jetID_ValueMap_Handle)[calojetref];
1644  iscleaned = jetIDFunctorLoose((*caloJets)[ijet], jetID);
1645  } else {
1646  iscleaned = true;
1647  }
1648  }
1649  }
1651  //if(isTCMet_){
1652  //pt_jet=scale*(*jptJets)[ijet].pt();
1653  //if(pt_jet> ptThreshold_){
1654  // const edm::RefToBase<reco::Jet>& rawJet = (*jptJets)[ijet].getCaloJetRef();
1655  // const reco::CaloJet *rawCaloJet = dynamic_cast<const reco::CaloJet*>(&*rawJet);
1656  // reco::CaloJetRef const theCaloJetRef = (rawJet).castTo<reco::CaloJetRef>();
1657  // if(!runcosmics_){
1658  // reco::JetID jetID = (*jetID_ValueMap_Handle)[theCaloJetRef];
1659  // iscleaned = jetIDFunctorLoose(*rawCaloJet, jetID);
1660  // }else{
1661  // iscleaned=true;
1662  // }
1663  //}
1664  //}*/
1665  if (isPFMet_) {
1666  pt_jet = scale * (*pfJets)[ijet].pt();
1667  if (pt_jet > ptThreshold_) {
1668  iscleaned = pfjetIDFunctorLoose((*pfJets)[ijet]);
1669  }
1670  }
1671  if (isMiniAODMet_) {
1672  pt_jet = (*patJets)[ijet].pt();
1673  if (pt_jet > ptThreshold_) {
1674  pat::strbitset stringbitset = pfjetIDFunctorLoose.getBitTemplate();
1675  iscleaned = pfjetIDFunctorLoose((*patJets)[ijet], stringbitset);
1676  }
1677  }
1678  if (iscleaned) {
1679  bJetID = true;
1680  }
1681  if (pt_jet > pt1) {
1682  pt2 = pt1;
1683  ind2 = ind1;
1684  pass_jetID2 = pass_jetID1;
1685  pt1 = pt_jet;
1686  ind1 = ijet;
1687  pass_jetID1 = iscleaned;
1688  } else if (pt_jet > pt2) {
1689  pt2 = pt_jet;
1690  ind2 = ijet;
1691  pass_jetID2 = iscleaned;
1692  }
1693  }
1694  if (pass_jetID1 && pass_jetID2) {
1695  double dphi = -1.0;
1696  if (isCaloMet_) {
1697  dphi = fabs((*caloJets)[ind1].phi() - (*caloJets)[ind2].phi());
1698  }
1700  //dphi=fabs((*jptJets)[ind1].phi()-(*jptJets)[ind2].phi());
1701  //}*/
1702  if (isPFMet_) {
1703  dphi = fabs((*pfJets)[ind1].phi() - (*pfJets)[ind2].phi());
1704  }
1705  if (isMiniAODMet_) {
1706  dphi = fabs((*patJets)[0].phi() - (*patJets)[1].phi());
1707  }
1708  if (dphi > acos(-1.)) {
1709  dphi = 2 * acos(-1.) - dphi;
1710  }
1711  if (dphi > 2.7) {
1712  bDiJetID = true;
1713  }
1714  }
1715  // ==========================================================
1716  // ==========================================================
1717  //Vertex information
1718  Handle<VertexCollection> vertexHandle;
1719  iEvent.getByToken(vertexToken_, vertexHandle);
1720 
1721  if (!vertexHandle.isValid()) {
1722  LogDebug("") << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
1723  if (verbose_)
1724  std::cout << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
1725  }
1726  numPV_ = 0;
1727  if (vertexHandle.isValid()) {
1728  VertexCollection vertexCollection = *(vertexHandle.product());
1729  numPV_ = vertexCollection.size();
1730  }
1731  bool bPrimaryVertex = (bypassAllPVChecks_ || (numPV_ > 0));
1732 
1733  bool bZJets = false;
1734 
1736  iEvent.getByToken(MuonsToken_, Muons);
1737 
1739 
1740  double pt_muon0 = -1;
1741  double pt_muon1 = -1;
1742  int mu_index0 = -1;
1743  int mu_index1 = -1;
1744  //fill it only for cleaned jets
1745  if (Muons.isValid() && Muons->size() > 1) {
1746  for (unsigned int i = 0; i < Muons->size(); i++) {
1747  bool pass_muon_id = false;
1748  bool pass_muon_iso = false;
1749  double dxy = fabs((*Muons)[i].muonBestTrack()->dxy());
1750  double dz = fabs((*Muons)[i].muonBestTrack()->dz());
1751  if (numPV_ > 0) {
1752  dxy = fabs((*Muons)[i].muonBestTrack()->dxy((*vertexHandle)[0].position()));
1753  dz = fabs((*Muons)[i].muonBestTrack()->dz((*vertexHandle)[0].position()));
1754  }
1755  if ((*Muons)[i].pt() > 20 && fabs((*Muons)[i].eta()) < 2.3) {
1756  if ((*Muons)[i].isGlobalMuon() && (*Muons)[i].isPFMuon() &&
1757  (*Muons)[i].globalTrack()->hitPattern().numberOfValidMuonHits() > 0 &&
1758  (*Muons)[i].numberOfMatchedStations() > 1 && dxy < 0.2 && (*Muons)[i].numberOfMatchedStations() > 1 &&
1759  dz < 0.5 && (*Muons)[i].innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
1760  (*Muons)[i].innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5) {
1761  pass_muon_id = true;
1762  }
1763  // Muon pf isolation DB corrected
1764  float muonIsoPFdb =
1765  ((*Muons)[i].pfIsolationR04().sumChargedHadronPt +
1766  std::max(0.,
1767  (*Muons)[i].pfIsolationR04().sumNeutralHadronEt + (*Muons)[i].pfIsolationR04().sumPhotonEt -
1768  0.5 * (*Muons)[i].pfIsolationR04().sumPUPt)) /
1769  (*Muons)[i].pt();
1770  if (muonIsoPFdb < 0.12) {
1771  pass_muon_iso = true;
1772  }
1773 
1774  if (pass_muon_id && pass_muon_iso) {
1775  if ((*Muons)[i].pt() > pt_muon0) {
1776  mu_index1 = mu_index0;
1777  pt_muon1 = pt_muon0;
1778  mu_index0 = i;
1779  pt_muon0 = (*Muons)[i].pt();
1780  } else if ((*Muons)[i].pt() > pt_muon1) {
1781  mu_index1 = i;
1782  pt_muon1 = (*Muons)[i].pt();
1783  }
1784  }
1785  }
1786  }
1787  if (mu_index0 >= 0 && mu_index1 >= 0) {
1788  if ((*Muons)[mu_index0].charge() * (*Muons)[mu_index1].charge() < 0) {
1789  zCand = (*Muons)[mu_index0].polarP4() + (*Muons)[mu_index1].polarP4();
1790  if (fabs(zCand.M() - 91.) < 20) {
1791  bZJets = true;
1792  }
1793  }
1794  }
1795  }
1796 
1797  // ==========================================================
1798 
1800  iEvent.getByToken(gtToken_, gtReadoutRecord);
1801 
1802  bool techTriggerResultBxM2 = false;
1803  bool techTriggerResultBxM1 = false;
1804  bool techTriggerResultBx0 = false;
1805 
1806  if (!gtReadoutRecord.isValid()) {
1807  LogDebug("") << "METAnalyzer: Could not find GT readout record" << std::endl;
1808  if (verbose_)
1809  std::cout << "METAnalyzer: Could not find GT readout record product" << std::endl;
1810  } else {
1811  // trigger results before mask for BxInEvent -2 (E), -1 (F), 0 (L1A), 1, 2
1812  const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxM2 = gtReadoutRecord->technicalTriggerWord(-2);
1813  const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxM1 = gtReadoutRecord->technicalTriggerWord(-1);
1814  const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBx0 = gtReadoutRecord->technicalTriggerWord();
1815  //const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxG = gtReadoutRecord->technicalTriggerWord(1);
1816  //const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxH = gtReadoutRecord->technicalTriggerWord(2);
1817  if (m_bitAlgTechTrig_ > -1 && !technicalTriggerWordBeforeMaskBx0.empty()) {
1818  techTriggerResultBx0 = technicalTriggerWordBeforeMaskBx0.at(m_bitAlgTechTrig_);
1819  if (techTriggerResultBx0 != 0) {
1820  techTriggerResultBxM2 = technicalTriggerWordBeforeMaskBxM2.at(m_bitAlgTechTrig_);
1821  techTriggerResultBxM1 = technicalTriggerWordBeforeMaskBxM1.at(m_bitAlgTechTrig_);
1822  }
1823  }
1824  }
1825 
1826  std::vector<bool> trigger_flag(4, false);
1827  if (techTriggerResultBx0 && techTriggerResultBxM2 &&
1828  techTriggerResultBxM1) { //current and previous two bunches filled
1829  trigger_flag[0] = true;
1830  }
1831  if (techTriggerResultBx0 && techTriggerResultBxM1) { //current and previous bunch filled
1832  trigger_flag[1] = true;
1833  }
1834  if (techTriggerResultBx0 && !techTriggerResultBxM1) { //current bunch filled, but previous bunch emtpy
1835  trigger_flag[2] = true;
1836  }
1837  if (techTriggerResultBx0 && !techTriggerResultBxM2 &&
1838  !techTriggerResultBxM1) { //current bunch filled, but previous two bunches emtpy
1839  trigger_flag[3] = true;
1840  }
1841  std::vector<bool> filter_decisions(
1842  8, false); //include all recommended filters, old filters in MiniAOD, and 2 new filters in testing phase
1843  if (!isMiniAODMet_ &&
1844  !runcosmics_) { //not checked for MiniAOD -> for miniaod decision filled as "triggerResults" bool
1845  edm::Handle<bool> HBHENoiseFilterResultHandle;
1846  iEvent.getByToken(hbheNoiseFilterResultToken_, HBHENoiseFilterResultHandle);
1847  if (!HBHENoiseFilterResultHandle.isValid()) {
1848  LogDebug("") << "METAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
1849  if (verbose_)
1850  std::cout << "METAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
1851  }
1852  filter_decisions[0] = *HBHENoiseFilterResultHandle;
1853  edm::Handle<bool> CSCTightHaloFilterResultHandle;
1854  iEvent.getByToken(CSCHaloResultToken_, CSCTightHaloFilterResultHandle);
1855  if (!CSCTightHaloFilterResultHandle.isValid()) {
1856  LogDebug("") << "METAnalyzer: Could not find CSCTightHaloFilterResultHandle" << std::endl;
1857  if (verbose_)
1858  std::cout << "METAnalyzer: CSCTightHaloFilterResultHandle" << std::endl;
1859  }
1860  filter_decisions[1] = *CSCTightHaloFilterResultHandle;
1861  edm::Handle<bool> eeBadScFilterResultHandle;
1862  iEvent.getByToken(eeBadScFilterToken_, eeBadScFilterResultHandle);
1863  if (!eeBadScFilterResultHandle.isValid()) {
1864  LogDebug("") << "METAnalyzer: Could not find eeBadScFilterResultHandle" << std::endl;
1865  if (verbose_)
1866  std::cout << "METAnalyzer: eeBadScFilterResultHandle" << std::endl;
1867  }
1868  filter_decisions[2] = *eeBadScFilterResultHandle;
1869  edm::Handle<bool> HBHENoiseIsoFilterResultHandle;
1870  iEvent.getByToken(hbheIsoNoiseFilterResultToken_, HBHENoiseIsoFilterResultHandle);
1871  if (!HBHENoiseIsoFilterResultHandle.isValid()) {
1872  LogDebug("") << "METAnalyzer: Could not find HBHENoiseIsoFilterResult" << std::endl;
1873  if (verbose_)
1874  std::cout << "METAnalyzer: Could not find HBHENoiseIsoFilterResult" << std::endl;
1875  }
1876  filter_decisions[3] = *HBHENoiseIsoFilterResultHandle;
1877  edm::Handle<bool> CSCTightHalo2015FilterResultHandle;
1878  iEvent.getByToken(CSCHalo2015ResultToken_, CSCTightHalo2015FilterResultHandle);
1879  if (!CSCTightHalo2015FilterResultHandle.isValid()) {
1880  LogDebug("") << "METAnalyzer: Could not find CSCTightHalo2015FilterResultHandle" << std::endl;
1881  if (verbose_)
1882  std::cout << "METAnalyzer: CSCTightHalo2015FilterResultHandle" << std::endl;
1883  }
1884  filter_decisions[4] = *CSCTightHalo2015FilterResultHandle;
1885  edm::Handle<bool> EcalDeadCellTriggerFilterResultHandle;
1886  iEvent.getByToken(EcalDeadCellTriggerToken_, EcalDeadCellTriggerFilterResultHandle);
1887  if (!EcalDeadCellTriggerFilterResultHandle.isValid()) {
1888  LogDebug("") << "METAnalyzer: Could not find EcalDeadCellTriggerFilterResultHandle" << std::endl;
1889  if (verbose_)
1890  std::cout << "METAnalyzer: EcalDeadCellTriggerFilterResultHandle" << std::endl;
1891  }
1892  filter_decisions[5] = *EcalDeadCellTriggerFilterResultHandle;
1893  edm::Handle<bool> EcalDeadCellBoundaryHandle;
1894  iEvent.getByToken(EcalDeadCellBoundaryToken_, EcalDeadCellBoundaryHandle);
1895  if (!EcalDeadCellBoundaryHandle.isValid()) {
1896  LogDebug("") << "METAnalyzer: Could not find EcalDeadCellBoundaryHandle" << std::endl;
1897  if (verbose_)
1898  std::cout << "METAnalyzer: EcalDeadCellBoundaryHandle" << std::endl;
1899  }
1900  filter_decisions[6] = *EcalDeadCellBoundaryHandle;
1901  edm::Handle<bool> HcalStripHaloFilterHandle;
1902  iEvent.getByToken(HcalStripHaloToken_, HcalStripHaloFilterHandle);
1903  if (!HcalStripHaloFilterHandle.isValid()) {
1904  LogDebug("") << "METAnalyzer: Could not find CSCTightHalo2015FilterResultHandle" << std::endl;
1905  if (verbose_)
1906  std::cout << "METAnalyzer: CSCTightHalo2015FilterResultHandle" << std::endl;
1907  }
1908  filter_decisions[7] = *HcalStripHaloFilterHandle;
1909  } else if (isMiniAODMet_) {
1910  //miniaodFilterIndex_ is only filled in dqmBeginRun if isMiniAODMet_ true
1911  edm::Handle<edm::TriggerResults> metFilterResults;
1912  iEvent.getByToken(METFilterMiniAODToken_, metFilterResults);
1913  if (metFilterResults.isValid()) {
1914  if (miniaodFilterIndex_[0] != -1) {
1915  filter_decisions[0] = metFilterResults->accept(miniaodFilterIndex_[0]);
1916  }
1917  if (miniaodFilterIndex_[1] != -1) {
1918  filter_decisions[1] = metFilterResults->accept(miniaodFilterIndex_[1]);
1919  }
1920  if (miniaodFilterIndex_[2] != -1) {
1921  filter_decisions[2] = metFilterResults->accept(miniaodFilterIndex_[2]);
1922  }
1923  if (miniaodFilterIndex_[3] != -1) {
1924  filter_decisions[3] = metFilterResults->accept(miniaodFilterIndex_[3]);
1925  }
1926  if (miniaodFilterIndex_[4] != -1) {
1927  filter_decisions[4] = metFilterResults->accept(miniaodFilterIndex_[4]);
1928  }
1929  if (miniaodFilterIndex_[5] != -1) {
1930  filter_decisions[5] = metFilterResults->accept(miniaodFilterIndex_[5]);
1931  }
1932  if (miniaodFilterIndex_[6] != -1) {
1933  filter_decisions[6] = metFilterResults->accept(miniaodFilterIndex_[6]);
1934  }
1935  if (miniaodFilterIndex_[7] != -1) {
1936  filter_decisions[7] = metFilterResults->accept(miniaodFilterIndex_[7]);
1937  }
1938  } else {
1939  iEvent.getByToken(METFilterMiniAODToken2_, metFilterResults);
1940  if (metFilterResults.isValid()) {
1941  if (miniaodFilterIndex_[0] != -1) {
1942  filter_decisions[0] = metFilterResults->accept(miniaodFilterIndex_[0]);
1943  }
1944  if (miniaodFilterIndex_[1] != -1) {
1945  filter_decisions[1] = metFilterResults->accept(miniaodFilterIndex_[1]);
1946  }
1947  if (miniaodFilterIndex_[2] != -1) {
1948  filter_decisions[2] = metFilterResults->accept(miniaodFilterIndex_[2]);
1949  }
1950  if (miniaodFilterIndex_[3] != -1) {
1951  filter_decisions[3] = metFilterResults->accept(miniaodFilterIndex_[3]);
1952  }
1953  if (miniaodFilterIndex_[4] != -1) {
1954  filter_decisions[4] = metFilterResults->accept(miniaodFilterIndex_[4]);
1955  }
1956  if (miniaodFilterIndex_[5] != -1) {
1957  filter_decisions[5] = metFilterResults->accept(miniaodFilterIndex_[5]);
1958  }
1959  if (miniaodFilterIndex_[6] != -1) {
1960  filter_decisions[6] = metFilterResults->accept(miniaodFilterIndex_[6]);
1961  }
1962  if (miniaodFilterIndex_[7] != -1) {
1963  filter_decisions[7] = metFilterResults->accept(miniaodFilterIndex_[7]);
1964  }
1965  }
1966  }
1967  }
1968  bool HBHENoiseFilterResultFlag = filter_decisions[0]; //setup for RECO and MINIAOD
1969  // ==========================================================
1970  // HCAL Noise filter
1971  bool bHBHENoiseFilter = HBHENoiseFilterResultFlag;
1972 
1973  // DCS Filter
1974  bool bDCSFilter = (bypassAllDCSChecks_ || DCSFilter_->filter(iEvent, iSetup));
1975  // ==========================================================
1976  // Reconstructed MET Information - fill MonitorElements
1977  std::string DirName_old = DirName;
1978  for (std::vector<std::string>::const_iterator ic = folderNames_.begin(); ic != folderNames_.end(); ic++) {
1979  bool pass_selection = false;
1980  if ((*ic == "Uncleaned") && (isCaloMet_ || bPrimaryVertex)) {
1981  fillMESet(iEvent,
1982  DirName_old + "/" + *ic,
1983  *met,
1984  patmet,
1985  pfmet,
1986  calomet,
1987  zCand,
1988  map_dijet_MEs,
1989  trigger_flag,
1990  filter_decisions);
1991  pass_selection = true;
1992  }
1993  //take two lines out for first check
1994  if ((*ic == "Cleaned") && bDCSFilter && bHBHENoiseFilter && bPrimaryVertex && bJetID) {
1995  fillMESet(iEvent,
1996  DirName_old + "/" + *ic,
1997  *met,
1998  patmet,
1999  pfmet,
2000  calomet,
2001  zCand,
2002  map_dijet_MEs,
2003  trigger_flag,
2004  filter_decisions);
2005  pass_selection = true;
2006  }
2007  if ((*ic == "DiJet") && bDCSFilter && bHBHENoiseFilter && bPrimaryVertex && bDiJetID) {
2008  fillMESet(iEvent,
2009  DirName_old + "/" + *ic,
2010  *met,
2011  patmet,
2012  pfmet,
2013  calomet,
2014  zCand,
2015  map_dijet_MEs,
2016  trigger_flag,
2017  filter_decisions);
2018  pass_selection = true;
2019  }
2020  if ((*ic == "ZJets") && bDCSFilter && bHBHENoiseFilter && bPrimaryVertex && bZJets) {
2021  fillMESet(iEvent,
2022  DirName_old + "/" + *ic,
2023  *met,
2024  patmet,
2025  pfmet,
2026  calomet,
2027  zCand,
2028  map_dijet_MEs,
2029  trigger_flag,
2030  filter_decisions);
2031  pass_selection = true;
2032  }
2033  if (pass_selection && isPFMet_) {
2034  DirName = DirName_old + "/" + *ic;
2035  }
2036  }
2037 }
2038 
2039 // ***********************************************************
2042  const reco::MET& met,
2043  const pat::MET* patmet,
2044  const reco::PFMET* pfmet,
2045  const reco::CaloMET* calomet,
2047  std::map<std::string, MonitorElement*>& map_of_MEs,
2048  std::vector<bool> techTriggerCase,
2049  std::vector<bool> METFilterDecision) {
2050  bool bLumiSecPlot = fill_met_high_level_histo;
2051  bool fillPFCandidatePlots = false;
2052  if (DirName.find("Cleaned") != std::string::npos) {
2053  fillPFCandidatePlots = true;
2054  fillMonitorElement(iEvent,
2055  DirName,
2056  std::string(""),
2057  met,
2058  patmet,
2059  pfmet,
2060  calomet,
2061  zCand,
2062  map_of_MEs,
2063  bLumiSecPlot,
2064  fillPFCandidatePlots,
2065  techTriggerCase,
2066  METFilterDecision);
2067  for (unsigned int i = 0; i < triggerFolderLabels_.size(); i++) {
2068  fillPFCandidatePlots = false;
2069  if (triggerFolderDecisions_[i]) {
2070  fillMonitorElement(iEvent,
2071  DirName,
2072  triggerFolderLabels_[i],
2073  met,
2074  patmet,
2075  pfmet,
2076  calomet,
2077  zCand,
2078  map_of_MEs,
2079  bLumiSecPlot,
2080  fillPFCandidatePlots,
2081  techTriggerCase,
2082  METFilterDecision);
2083  }
2084  }
2085  } else if (DirName.find("DiJet") != std::string::npos) {
2086  fillMonitorElement(iEvent,
2087  DirName,
2088  std::string(""),
2089  met,
2090  patmet,
2091  pfmet,
2092  calomet,
2093  zCand,
2094  map_of_MEs,
2095  bLumiSecPlot,
2096  fillPFCandidatePlots,
2097  techTriggerCase,
2098  METFilterDecision);
2099  for (unsigned int i = 0; i < triggerFolderLabels_.size(); i++) {
2100  if (triggerFolderDecisions_[i])
2101  fillMonitorElement(iEvent,
2102  DirName,
2103  triggerFolderLabels_[i],
2104  met,
2105  patmet,
2106  pfmet,
2107  calomet,
2108  zCand,
2109  map_of_MEs,
2110  bLumiSecPlot,
2111  fillPFCandidatePlots,
2112  techTriggerCase,
2113  METFilterDecision);
2114  }
2115  } else if (DirName.find("ZJets") != std::string::npos) {
2116  fillMonitorElement(iEvent,
2117  DirName,
2118  std::string(""),
2119  met,
2120  patmet,
2121  pfmet,
2122  calomet,
2123  zCand,
2124  map_of_MEs,
2125  bLumiSecPlot,
2126  fillPFCandidatePlots,
2127  techTriggerCase,
2128  METFilterDecision);
2129  } else {
2130  fillMonitorElement(iEvent,
2131  DirName,
2132  std::string(""),
2133  met,
2134  patmet,
2135  pfmet,
2136  calomet,
2137  zCand,
2138  map_of_MEs,
2139  bLumiSecPlot,
2140  fillPFCandidatePlots,
2141  techTriggerCase,
2142  METFilterDecision);
2143  }
2144 }
2145 
2146 // ***********************************************************
2149  std::string subFolderName,
2150  const reco::MET& met,
2151  const pat::MET* patmet,
2152  const reco::PFMET* pfmet,
2153  const reco::CaloMET* calomet,
2155  std::map<std::string, MonitorElement*>& map_of_MEs,
2156  bool bLumiSecPlot,
2157  bool fillPFCandidatePlots,
2158  std::vector<bool> techTriggerCase,
2159  std::vector<bool> METFilterDecision) {
2160  bool do_only_Z_histograms = false;
2161  if (DirName.find("ZJets") != std::string::npos) { //do Z plots only
2162  do_only_Z_histograms = true;
2163  //\vec{p}_{T}^{Z}+vec{u}_{T}+\vec{MET}=0
2164 
2165  double u_x = -met.px() - zCand.Px();
2166  double u_y = -met.py() - zCand.Py();
2167 
2168  //protection for VERY special case where Z-Pt==0
2169  double u_par = 0;
2170  double u_perp = sqrt(u_x * u_x + u_y * u_y);
2171  double e_Z_x = 0;
2172  double e_Z_y = 0;
2173  if (zCand.Pt() != 0) {
2174  e_Z_x = zCand.Px() / zCand.Pt();
2175  e_Z_y = zCand.Py() / zCand.Pt();
2176  }
2177  u_par = u_x * e_Z_x + u_y * e_Z_y;
2178  u_perp = -e_Z_y * u_x + e_Z_x * u_y;
2179 
2180  meZJets_u_par = map_of_MEs[DirName + "/" + "u_parallel_Z_inc"];
2181  if (meZJets_u_par && meZJets_u_par->getRootObject())
2182  meZJets_u_par->Fill(u_par);
2183  if (zCand.Pt() < 15) {
2184  meZJets_u_par_ZPt_0_15 = map_of_MEs[DirName + "/" + "u_parallel_ZPt_0_15"];
2185  if (meZJets_u_par_ZPt_0_15 && meZJets_u_par_ZPt_0_15->getRootObject())
2186  meZJets_u_par_ZPt_0_15->Fill(u_par);
2187  } else if (zCand.Pt() < 30) {
2188  meZJets_u_par_ZPt_15_30 = map_of_MEs[DirName + "/" + "u_parallel_ZPt_15_30"];
2189  if (meZJets_u_par_ZPt_15_30 && meZJets_u_par_ZPt_15_30->getRootObject())
2190  meZJets_u_par_ZPt_15_30->Fill(u_par);
2191  } else if (zCand.Pt() < 55) {
2192  meZJets_u_par_ZPt_30_55 = map_of_MEs[DirName + "/" + "u_parallel_ZPt_30_55"];
2193  if (meZJets_u_par_ZPt_30_55 && meZJets_u_par_ZPt_30_55->getRootObject())
2194  meZJets_u_par_ZPt_30_55->Fill(u_par);
2195  } else if (zCand.Pt() < 75) {
2196  meZJets_u_par_ZPt_55_75 = map_of_MEs[DirName + "/" + "u_parallel_ZPt_55_75"];
2197  if (meZJets_u_par_ZPt_55_75 && meZJets_u_par_ZPt_55_75->getRootObject())
2198  meZJets_u_par_ZPt_55_75->Fill(u_par);
2199  } else if (zCand.Pt() < 150) {
2200  meZJets_u_par_ZPt_75_150 = map_of_MEs[DirName + "/" + "u_parallel_ZPt_75_150"];
2201  if (meZJets_u_par_ZPt_75_150 && meZJets_u_par_ZPt_75_150->getRootObject())
2202  meZJets_u_par_ZPt_75_150->Fill(u_par);
2203  } else if (zCand.Pt() < 290) {
2204  meZJets_u_par_ZPt_150_290 = map_of_MEs[DirName + "/" + "u_parallel_ZPt_150_290"];
2205  if (meZJets_u_par_ZPt_150_290 && meZJets_u_par_ZPt_150_290->getRootObject())
2206  meZJets_u_par_ZPt_150_290->Fill(u_par);
2207  } else {
2208  meZJets_u_par_ZPt_290 = map_of_MEs[DirName + "/" + "u_parallel_ZPt_290"];
2209  if (meZJets_u_par_ZPt_290 && meZJets_u_par_ZPt_290->getRootObject())
2210  meZJets_u_par_ZPt_290->Fill(u_par);
2211  }
2212 
2213  meZJets_u_perp = map_of_MEs[DirName + "/" + "u_perp_Z_inc"];
2214  if (meZJets_u_perp && meZJets_u_perp->getRootObject())
2215  meZJets_u_perp->Fill(u_perp);
2216  if (zCand.Pt() < 15) {
2217  meZJets_u_perp_ZPt_0_15 = map_of_MEs[DirName + "/" + "u_perp_ZPt_0_15"];
2218  if (meZJets_u_perp_ZPt_0_15 && meZJets_u_perp_ZPt_0_15->getRootObject())
2219  meZJets_u_perp_ZPt_0_15->Fill(u_perp);
2220  } else if (zCand.Pt() < 30) {
2221  meZJets_u_perp_ZPt_15_30 = map_of_MEs[DirName + "/" + "u_perp_ZPt_15_30"];
2222  if (meZJets_u_perp_ZPt_15_30 && meZJets_u_perp_ZPt_15_30->getRootObject())
2223  meZJets_u_perp_ZPt_15_30->Fill(u_perp);
2224  } else if (zCand.Pt() < 55) {
2225  meZJets_u_perp_ZPt_30_55 = map_of_MEs[DirName + "/" + "u_perp_ZPt_30_55"];
2226  if (meZJets_u_perp_ZPt_30_55 && meZJets_u_perp_ZPt_30_55->getRootObject())
2227  meZJets_u_perp_ZPt_30_55->Fill(u_perp);
2228  } else if (zCand.Pt() < 75) {
2229  meZJets_u_perp_ZPt_55_75 = map_of_MEs[DirName + "/" + "u_perp_ZPt_55_75"];
2230  if (meZJets_u_perp_ZPt_55_75 && meZJets_u_perp_ZPt_55_75->getRootObject())
2231  meZJets_u_perp_ZPt_55_75->Fill(u_perp);
2232  } else if (zCand.Pt() < 150) {
2233  meZJets_u_perp_ZPt_75_150 = map_of_MEs[DirName + "/" + "u_perp_ZPt_75_150"];
2234  if (meZJets_u_perp_ZPt_75_150 && meZJets_u_perp_ZPt_75_150->getRootObject())
2235  meZJets_u_perp_ZPt_75_150->Fill(u_perp);
2236  } else if (zCand.Pt() < 290) {
2237  meZJets_u_perp_ZPt_150_290 = map_of_MEs[DirName + "/" + "u_perp_ZPt_150_290"];
2238  if (meZJets_u_perp_ZPt_150_290 && meZJets_u_perp_ZPt_150_290->getRootObject())
2239  meZJets_u_perp_ZPt_150_290->Fill(u_perp);
2240  } else {
2241  meZJets_u_perp_ZPt_290 = map_of_MEs[DirName + "/" + "u_perp_ZPt_290"];
2242  if (meZJets_u_perp_ZPt_290 && meZJets_u_perp_ZPt_290->getRootObject())
2243  meZJets_u_perp_ZPt_290->Fill(u_perp);
2244  }
2245  }
2246  if (!do_only_Z_histograms) {
2247  // Reconstructed MET Information
2248  double SumET = met.sumEt();
2249  double METSig = met.mEtSig();
2250  //double Ez = met.e_longitudinal();
2251  double MET = met.pt();
2252  double MEx = met.px();
2253  double MEy = met.py();
2254  double METPhi = met.phi();
2255  //
2256  int myLuminosityBlock;
2257  myLuminosityBlock = iEvent.luminosityBlock();
2258  //
2259 
2260  if (!subFolderName.empty()) {
2261  DirName = DirName + "/" + subFolderName;
2262  }
2263 
2264  hTrigger = map_of_MEs[DirName + "/triggerResults"];
2265  if (hTrigger && hTrigger->getRootObject()) {
2266  for (unsigned int i = 0; i < allTriggerDecisions_.size(); i++) {
2267  if (i < (unsigned int)hTrigger->getNbinsX()) {
2268  hTrigger->Fill(i + .5, allTriggerDecisions_[i]);
2269  }
2270  }
2271  }
2272 
2273  hMEx = map_of_MEs[DirName + "/" + "MEx"];
2274  if (hMEx && hMEx->getRootObject())
2275  hMEx->Fill(MEx);
2276  hMEy = map_of_MEs[DirName + "/" + "MEy"];
2277  if (hMEy && hMEy->getRootObject())
2278  hMEy->Fill(MEy);
2279  hMET = map_of_MEs[DirName + "/" + "MET"];
2280  if (hMET && hMET->getRootObject())
2281  hMET->Fill(MET);
2282  hMET_2 = map_of_MEs[DirName + "/" + "MET_2"];
2283  if (hMET_2 && hMET_2->getRootObject())
2284  hMET_2->Fill(MET);
2285 
2286  //hMET_HBHENoiseFilter = ibooker.book1D("MET_HBHENoiseFilter", "MET_HBHENoiseFiltered", 200, 0, 1000);
2287  //hMET_CSCTightHaloFilter = ibooker.book1D("MET_CSCTightHaloFilter", "MET_CSCTightHaloFiltered", 200, 0, 1000);
2288  //hMET_eeBadScFilter = ibooker.book1D("MET_eeBadScFilter", "MET_eeBadScFiltered", 200, 0, 1000);
2289  //hMET_HBHEIsoNoiseFilter = ibooker.book1D("MET_HBHEIsoNoiseFilter", "MET_HBHEIsoNoiseFiltered", 200, 0, 1000);
2290  //hMET_CSCTightHalo2015Filter = ibooker.book1D("MET_CSCTightHalo2015Filter", "MET_CSCTightHalo2015Filtered", 200, 0, 1000);
2291  //hMET_EcalDeadCellTriggerFilter = ibooker.book1D("MET_EcalDeadCellTriggerFilter", "MET_EcalDeadCellTriggerFiltered", 200, 0, 1000);
2292  //hMET_EcalDeadCellBoundaryFilter = ibooker.book1D("MET_EcalDeadCellBoundaryFilter", "MET_EcalDeadCellBoundaryFiltered", 200, 0, 1000);
2293  //hMET_HcalStripHaloFilter = ibooker.book1D("MET_HcalStripHaloFilter", "MET_HcalStripHaloFiltered", 200, 0, 1000);
2294 
2295  bool HBHENoiseFilterResult = false;
2296  bool CSCTightHaloFilterResult = false;
2297  bool eeBadScFilterResult = false;
2298  bool HBHEIsoNoiseFilterResult = false;
2299  bool CSCTightHalo2015FilterResult = false;
2300  bool EcalDeadCellTriggerFilterResult = false;
2301  bool EcalDeadCellBoundaryFilterResult = false;
2302  bool HcalStripHaloFilterResult = false;
2303  HBHENoiseFilterResult = METFilterDecision[0];
2304  if (HBHENoiseFilterResult) {
2305  hMET_HBHENoiseFilter = map_of_MEs[DirName + "/" + "MET_HBHENoiseFilter"];
2306  if (hMET_HBHENoiseFilter && hMET_HBHENoiseFilter->getRootObject())
2307  hMET_HBHENoiseFilter->Fill(MET);
2308  }
2309  CSCTightHaloFilterResult = METFilterDecision[1];
2310  if (CSCTightHaloFilterResult) {
2311  hMET_CSCTightHaloFilter = map_of_MEs[DirName + "/" + "MET_CSCTightHaloFilter"];
2312  if (hMET_CSCTightHaloFilter && hMET_CSCTightHaloFilter->getRootObject())
2313  hMET_CSCTightHaloFilter->Fill(MET);
2314  }
2315  eeBadScFilterResult = METFilterDecision[2];
2316  if (eeBadScFilterResult) {
2317  hMET_eeBadScFilter = map_of_MEs[DirName + "/" + "MET_eeBadScFilter"];
2318  if (hMET_eeBadScFilter && hMET_eeBadScFilter->getRootObject())
2319  hMET_eeBadScFilter->Fill(MET);
2320  }
2321  HBHEIsoNoiseFilterResult = METFilterDecision[3];
2322  if (HBHEIsoNoiseFilterResult) {
2323  hMET_HBHEIsoNoiseFilter = map_of_MEs[DirName + "/" + "MET_HBHEIsoNoiseFilter"];
2324  if (hMET_HBHEIsoNoiseFilter && hMET_HBHEIsoNoiseFilter->getRootObject())
2325  hMET_HBHEIsoNoiseFilter->Fill(MET);
2326  }
2327  CSCTightHalo2015FilterResult = METFilterDecision[4];
2328  if (CSCTightHalo2015FilterResult) {
2329  hMET_CSCTightHalo2015Filter = map_of_MEs[DirName + "/" + "MET_CSCTightHalo2015Filter"];
2330  if (hMET_CSCTightHalo2015Filter && hMET_CSCTightHalo2015Filter->getRootObject())
2331  hMET_CSCTightHalo2015Filter->Fill(MET);
2332  }
2333  EcalDeadCellTriggerFilterResult = METFilterDecision[5];
2334  if (EcalDeadCellTriggerFilterResult) {
2335  hMET_EcalDeadCellTriggerFilter = map_of_MEs[DirName + "/" + "MET_EcalDeadCellTriggerFilter"];
2336  if (hMET_EcalDeadCellTriggerFilter && hMET_EcalDeadCellTriggerFilter->getRootObject())
2337  hMET_EcalDeadCellTriggerFilter->Fill(MET);
2338  }
2339  EcalDeadCellBoundaryFilterResult = METFilterDecision[6];
2340  if (EcalDeadCellBoundaryFilterResult) {
2341  hMET_EcalDeadCellBoundaryFilter = map_of_MEs[DirName + "/" + "MET_EcalDeadCellBoundaryFilter"];
2342  if (hMET_EcalDeadCellBoundaryFilter && hMET_EcalDeadCellBoundaryFilter->getRootObject())
2343  hMET_EcalDeadCellBoundaryFilter->Fill(MET);
2344  }
2345  HcalStripHaloFilterResult = METFilterDecision[7];
2346  if (HcalStripHaloFilterResult) {
2347  hMET_HcalStripHaloFilter = map_of_MEs[DirName + "/" + "MET_HcalStripHaloFilter"];
2348  if (hMET_HcalStripHaloFilter && hMET_HcalStripHaloFilter->getRootObject())
2349  hMET_HcalStripHaloFilter->Fill(MET);
2350  }
2351  hMETPhi = map_of_MEs[DirName + "/" + "METPhi"];
2352  if (hMETPhi && hMETPhi->getRootObject())
2353  hMETPhi->Fill(METPhi);
2354  hSumET = map_of_MEs[DirName + "/" + "SumET"];
2355  if (hSumET && hSumET->getRootObject())
2356  hSumET->Fill(SumET);
2357  hMETSig = map_of_MEs[DirName + "/" + "METSig"];
2358  if (hMETSig && hMETSig->getRootObject())
2359  hMETSig->Fill(METSig);
2360  hMET_logx = map_of_MEs[DirName + "/" + "MET_logx"];
2361  if (hMET_logx && hMET_logx->getRootObject())
2362  hMET_logx->Fill(log10(MET));
2363  hSumET_logx = map_of_MEs[DirName + "/" + "SumET_logx"];
2364  if (hSumET_logx && hSumET_logx->getRootObject())
2365  hSumET_logx->Fill(log10(SumET));
2366 
2367  // Fill NPV profiles
2368  //--------------------------------------------------------------------------
2369  meMEx_profile = map_of_MEs[DirName + "/MEx_profile"];
2370  meMEy_profile = map_of_MEs[DirName + "/MEy_profile"];
2371  meMET_profile = map_of_MEs[DirName + "/MET_profile"];
2372  meSumET_profile = map_of_MEs[DirName + "/SumET_profile"];
2373 
2374  if (meMEx_profile && meMEx_profile->getRootObject())
2375  meMEx_profile->Fill(numPV_, MEx);
2376  if (meMEy_profile && meMEy_profile->getRootObject())
2377  meMEy_profile->Fill(numPV_, MEy);
2378  if (meMET_profile && meMET_profile->getRootObject())
2379  meMET_profile->Fill(numPV_, MET);
2380  if (meSumET_profile && meSumET_profile->getRootObject())
2381  meSumET_profile->Fill(numPV_, SumET);
2382 
2383  if (isCaloMet_) {
2384  //const reco::CaloMETCollection *calometcol = calometcoll.product();
2385  //const reco::CaloMET *calomet;
2386  //calomet = &(calometcol->front());
2387 
2388  double caloEtFractionHadronic = calomet->etFractionHadronic();
2389  double caloEmEtFraction = calomet->emEtFraction();
2390 
2391  double caloHadEtInHB = calomet->hadEtInHB();
2392  double caloHadEtInHO = calomet->hadEtInHO();
2393  double caloHadEtInHE = calomet->hadEtInHE();
2394  double caloHadEtInHF = calomet->hadEtInHF();
2395  double caloEmEtInEB = calomet->emEtInEB();
2396  double caloEmEtInEE = calomet->emEtInEE();
2397  double caloEmEtInHF = calomet->emEtInHF();
2398 
2399  hCaloHadEtInHB = map_of_MEs[DirName + "/" + "CaloHadEtInHB"];
2400  if (hCaloHadEtInHB && hCaloHadEtInHB->getRootObject())
2401  hCaloHadEtInHB->Fill(caloHadEtInHB);
2402  hCaloHadEtInHO = map_of_MEs[DirName + "/" + "CaloHadEtInHO"];
2403  if (hCaloHadEtInHO && hCaloHadEtInHO->getRootObject())
2404  hCaloHadEtInHO->Fill(caloHadEtInHO);
2405  hCaloHadEtInHE = map_of_MEs[DirName + "/" + "CaloHadEtInHE"];
2406  if (hCaloHadEtInHE && hCaloHadEtInHE->getRootObject())
2407  hCaloHadEtInHE->Fill(caloHadEtInHE);
2408  hCaloHadEtInHF = map_of_MEs[DirName + "/" + "CaloHadEtInHF"];
2409  if (hCaloHadEtInHF && hCaloHadEtInHF->getRootObject())
2410  hCaloHadEtInHF->Fill(caloHadEtInHF);
2411  hCaloEmEtInEB = map_of_MEs[DirName + "/" + "CaloEmEtInEB"];
2412  if (hCaloEmEtInEB && hCaloEmEtInEB->getRootObject())
2413  hCaloEmEtInEB->Fill(caloEmEtInEB);
2414  hCaloEmEtInEE = map_of_MEs[DirName + "/" + "CaloEmEtInEE"];
2415  if (hCaloEmEtInEE && hCaloEmEtInEE->getRootObject())
2416  hCaloEmEtInEE->Fill(caloEmEtInEE);
2417  hCaloEmEtInHF = map_of_MEs[DirName + "/" + "CaloEmEtInHF"];
2418  if (hCaloEmEtInHF && hCaloEmEtInHF->getRootObject())
2419  hCaloEmEtInHF->Fill(caloEmEtInHF);
2420 
2421  hCaloMETPhi020 = map_of_MEs[DirName + "/" + "CaloMETPhi020"];
2422  if (MET > 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) {
2423  hCaloMETPhi020->Fill(METPhi);
2424  }
2425 
2426  hCaloEtFractionHadronic = map_of_MEs[DirName + "/" + "CaloEtFractionHadronic"];
2427  if (hCaloEtFractionHadronic && hCaloEtFractionHadronic->getRootObject())
2428  hCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
2429  hCaloEmEtFraction = map_of_MEs[DirName + "/" + "CaloEmEtFraction"];
2430  if (hCaloEmEtFraction && hCaloEmEtFraction->getRootObject())
2431  hCaloEmEtFraction->Fill(caloEmEtFraction);
2432  hCaloEmEtFraction020 = map_of_MEs[DirName + "/" + "CaloEmEtFraction020"];
2433  if (MET > 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject())
2434  hCaloEmEtFraction020->Fill(caloEmEtFraction);
2435  }
2436  if (isPFMet_) {
2437  if (fillPFCandidatePlots && fillCandidateMap_histos) {
2438  for (unsigned int i = 0; i < countsPFCand_.size(); i++) {
2439  countsPFCand_[i] = 0;
2440  MExPFCand_[i] = 0.;
2441  MEyPFCand_[i] = 0.;
2442  }
2443 
2444  // typedef std::vector<reco::PFCandidate> pfCand;
2446  iEvent.getByToken(pflowToken_, particleFlow);
2447 
2448  float pt_sum_CHF_Barrel = 0;
2449  float pt_sum_CHF_Endcap_plus = 0;
2450  float pt_sum_CHF_Endcap_minus = 0;
2451  float pt_sum_NHF_Barrel = 0;
2452  float pt_sum_NHF_Endcap_plus = 0;
2453  float pt_sum_NHF_Endcap_minus = 0;
2454  float pt_sum_PhF_Barrel = 0;
2455  float pt_sum_PhF_Endcap_plus = 0;
2456  float pt_sum_PhF_Endcap_minus = 0;
2457  float pt_sum_HFH_plus = 0;
2458  float pt_sum_HFH_minus = 0;
2459  float pt_sum_HFE_plus = 0;
2460  float pt_sum_HFE_minus = 0;
2461 
2462  float px_chargedHadronsBarrel = 0;
2463  float py_chargedHadronsBarrel = 0;
2464  float px_chargedHadronsEndcapPlus = 0;
2465  float py_chargedHadronsEndcapPlus = 0;
2466  float px_chargedHadronsEndcapMinus = 0;
2467  float py_chargedHadronsEndcapMinus = 0;
2468  float px_neutralHadronsBarrel = 0;
2469  float py_neutralHadronsBarrel = 0;
2470  float px_neutralHadronsEndcapPlus = 0;
2471  float py_neutralHadronsEndcapPlus = 0;
2472  float px_neutralHadronsEndcapMinus = 0;
2473  float py_neutralHadronsEndcapMinus = 0;
2474  float px_PhotonsBarrel = 0;
2475  float py_PhotonsBarrel = 0;
2476  float px_PhotonsEndcapPlus = 0;
2477  float py_PhotonsEndcapPlus = 0;
2478  float px_PhotonsEndcapMinus = 0;
2479  float py_PhotonsEndcapMinus = 0;
2480  float px_HFHadronsPlus = 0;
2481  float py_HFHadronsPlus = 0;
2482  float px_HFHadronsMinus = 0;
2483  float py_HFHadronsMinus = 0;
2484  float px_HFEGammasPlus = 0;
2485  float py_HFEGammasPlus = 0;
2486  float px_HFEGammasMinus = 0;
2487  float py_HFEGammasMinus = 0;
2488  for (unsigned int i = 0; i < particleFlow->size(); i++) {
2489  const reco::PFCandidate& c = particleFlow->at(i);
2490  if (c.particleId() == 1) { //charged hadrons
2491  //endcap minus
2492  if (c.eta() > (-3.0) && c.eta() < (-1.392)) {
2493  px_chargedHadronsEndcapMinus -= c.px();
2494  py_chargedHadronsEndcapMinus -= c.py();
2495  pt_sum_CHF_Endcap_minus += c.et();
2496  } else if (c.eta() >= (-1.392) && c.eta() <= 1.392) { //barrel
2497  px_chargedHadronsBarrel -= c.px();
2498  py_chargedHadronsBarrel -= c.py();
2499  pt_sum_CHF_Barrel += c.et();
2500  } else if (c.eta() > 1.392 && c.eta() < 3.0) { //endcap plus
2501  px_chargedHadronsEndcapPlus -= c.px();
2502  py_chargedHadronsEndcapPlus -= c.py();
2503  pt_sum_CHF_Endcap_plus += c.et();
2504  }
2505  }
2506  if (c.particleId() == 5) { //neutral hadrons
2507  //endcap minus
2508  if (c.eta() > (-3.0) && c.eta() < (-1.392)) {
2509  px_neutralHadronsEndcapMinus -= c.px();
2510  py_neutralHadronsEndcapMinus -= c.py();
2511  pt_sum_NHF_Endcap_minus += c.et();
2512  } else if (c.eta() >= (-1.392) && c.eta() <= 1.392) {
2513  px_neutralHadronsBarrel -= c.px();
2514  py_neutralHadronsBarrel -= c.py();
2515  pt_sum_NHF_Barrel += c.et();
2516  } else if (c.eta() > 1.392 && c.eta() < 3.0) {
2517  px_neutralHadronsEndcapPlus -= c.px();
2518  py_neutralHadronsEndcapPlus -= c.py();
2519  pt_sum_NHF_Endcap_plus += c.et();
2520  }
2521  }
2522  if (c.particleId() == 4) { //photons
2523  //endcap minus
2524  if (c.eta() > (-3.0) && c.eta() < (-1.479)) {
2525  px_PhotonsEndcapMinus -= c.px();
2526  py_PhotonsEndcapMinus -= c.py();
2527  pt_sum_PhF_Endcap_minus += c.et();
2528  } else if (c.eta() >= (-1.479) && c.eta() <= 1.479) {
2529  px_PhotonsBarrel -= c.px();
2530  py_PhotonsBarrel -= c.py();
2531  pt_sum_PhF_Barrel += c.et();
2532  } else if (c.eta() > 1.479 && c.eta() < 3.0) {
2533  px_PhotonsEndcapPlus -= c.px();
2534  py_PhotonsEndcapPlus -= c.py();
2535  pt_sum_PhF_Endcap_plus += c.et();
2536  }
2537  }
2538  if (c.particleId() == 6) { //HFHadrons
2539  //forward minus
2540  if (c.eta() > (-5.20) && c.eta() < -2.901376) {
2541  pt_sum_HFH_minus += c.et();
2542  px_HFHadronsMinus -= c.px();
2543  py_HFHadronsMinus -= c.py();
2544  } else if (c.eta() > 2.901376 && c.eta() < 5.20) { //forward plus
2545  px_HFHadronsPlus -= c.px();
2546  py_HFHadronsPlus -= c.py();
2547  pt_sum_HFH_plus += c.et();
2548  }
2549  }
2550  if (c.particleId() == 7) { //HFEGammas
2551  //forward minus
2552  if (c.eta() > (-5.20) && c.eta() < -2.901376) {
2553  pt_sum_HFE_minus += c.et();
2554  px_HFEGammasMinus -= c.px();
2555  py_HFEGammasMinus -= c.py();
2556  } else if (c.eta() > 2.901376 && c.eta() < 5.20) { //forward plus
2557  px_HFEGammasPlus -= c.px();
2558  py_HFEGammasPlus -= c.py();
2559  pt_sum_HFE_plus += c.et();
2560  }
2561  }
2562  for (unsigned int j = 0; j < typePFCand_.size(); j++) {
2563  if (c.particleId() == typePFCand_[j]) {
2564  //second check for endcap, if inside barrel Max and Min symmetric around 0
2565  if (((c.eta() > etaMinPFCand_[j]) && (c.eta() < etaMaxPFCand_[j])) ||
2566  ((c.eta() > (-etaMaxPFCand_[j])) && (c.eta() < (-etaMinPFCand_[j])))) {
2567  countsPFCand_[j] += 1;
2568  MExPFCand_[j] -= c.px();
2569  MEyPFCand_[j] -= c.py();
2570  }
2571  }
2572  }
2573  }
2574 
2575  for (unsigned int j = 0; j < countsPFCand_.size(); j++) {
2576  profilePFCand_x_[j] = map_of_MEs[DirName + "/" + profilePFCand_x_name_[j]];
2577  if (profilePFCand_x_[j] && profilePFCand_x_[j]->getRootObject())
2578  profilePFCand_x_[j]->Fill(countsPFCand_[j], MExPFCand_[j]);
2579  profilePFCand_y_[j] = map_of_MEs[DirName + "/" + profilePFCand_y_name_[j]];
2580  if (profilePFCand_y_[j] && profilePFCand_y_[j]->getRootObject())
2581  profilePFCand_y_[j]->Fill(countsPFCand_[j], MEyPFCand_[j]);
2582  }
2583  meCHF_Barrel = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionBarrel"];
2584  if (meCHF_Barrel && meCHF_Barrel->getRootObject())
2585  meCHF_Barrel->Fill(pt_sum_CHF_Barrel / pfmet->sumEt());
2586  meCHF_EndcapPlus = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionEndcapPlus"];
2587  if (meCHF_EndcapPlus && meCHF_EndcapPlus->getRootObject())
2588  meCHF_EndcapPlus->Fill(pt_sum_CHF_Endcap_plus / pfmet->sumEt());
2589  meCHF_EndcapMinus = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionEndcapMinus"];
2590  if (meCHF_EndcapMinus && meCHF_EndcapMinus->getRootObject())
2591  meCHF_EndcapMinus->Fill(pt_sum_CHF_Endcap_minus / pfmet->sumEt());
2592  meNHF_Barrel = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionBarrel"];
2593  if (meNHF_Barrel && meNHF_Barrel->getRootObject())
2594  meNHF_Barrel->Fill(pt_sum_NHF_Barrel / pfmet->sumEt());
2595  meNHF_EndcapPlus = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionEndcapPlus"];
2596  if (meNHF_EndcapPlus && meNHF_EndcapPlus->getRootObject())
2597  meNHF_EndcapPlus->Fill(pt_sum_NHF_Endcap_plus / pfmet->sumEt());
2598  meNHF_EndcapMinus = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionEndcapMinus"];
2599  if (meNHF_EndcapMinus && meNHF_EndcapMinus->getRootObject())
2600  meNHF_EndcapMinus->Fill(pt_sum_NHF_Endcap_minus / pfmet->sumEt());
2601  mePhF_Barrel = map_of_MEs[DirName + "/" + "PfPhotonEtFractionBarrel"];
2602  if (mePhF_Barrel && mePhF_Barrel->getRootObject())
2603  mePhF_Barrel->Fill(pt_sum_PhF_Barrel / pfmet->sumEt());
2604  mePhF_EndcapPlus = map_of_MEs[DirName + "/" + "PfPhotonEtFractionEndcapPlus"];
2605  if (mePhF_EndcapPlus && mePhF_EndcapPlus->getRootObject())
2606  mePhF_EndcapPlus->Fill(pt_sum_PhF_Endcap_plus / pfmet->sumEt());
2607  mePhF_EndcapMinus = map_of_MEs[DirName + "/" + "PfPhotonEtFractionEndcapMinus"];
2608  if (mePhF_EndcapMinus && mePhF_EndcapMinus->getRootObject())
2609  mePhF_EndcapMinus->Fill(pt_sum_PhF_Endcap_minus / pfmet->sumEt());
2610  meHFHadF_Plus = map_of_MEs[DirName + "/" + "PfHFHadronEtFractionPlus"];
2611  if (meHFHadF_Plus && meHFHadF_Plus->getRootObject())
2612  meHFHadF_Plus->Fill(pt_sum_HFH_plus / pfmet->sumEt());
2613  meHFHadF_Minus = map_of_MEs[DirName + "/" + "PfHFHadronEtFractionMinus"];
2614  if (meHFHadF_Minus && meHFHadF_Minus->getRootObject())
2615  meHFHadF_Minus->Fill(pt_sum_HFH_minus / pfmet->sumEt());
2616  meHFEMF_Plus = map_of_MEs[DirName + "/" + "PfHFEMEtFractionPlus"];
2617  if (meHFEMF_Plus && meHFEMF_Plus->getRootObject())
2618  meHFEMF_Plus->Fill(pt_sum_HFE_plus / pfmet->sumEt());
2619  meHFEMF_Minus = map_of_MEs[DirName + "/" + "PfHFEMEtFractionMinus"];
2620  if (meHFEMF_Minus && meHFEMF_Minus->getRootObject())
2621  meHFEMF_Minus->Fill(pt_sum_HFE_minus / pfmet->sumEt());
2622  //sanity check if we have any type of the respective species in the events
2623  //else don't fill phi, as else we have a results of a biased peak at 0
2624  //if pt_sum of species part is 0, obviously that would be the case
2625  if (pt_sum_CHF_Barrel) {
2626  meMETPhiChargedHadronsBarrel = map_of_MEs[DirName + "/" + "METPhiChargedHadronsBarrel"];
2627  if (meMETPhiChargedHadronsBarrel && meMETPhiChargedHadronsBarrel->getRootObject())
2628  meMETPhiChargedHadronsBarrel->Fill(atan2(py_chargedHadronsBarrel, px_chargedHadronsBarrel));
2629  }
2630  if (pt_sum_CHF_Endcap_plus) {
2631  meMETPhiChargedHadronsEndcapPlus = map_of_MEs[DirName + "/" + "METPhiChargedHadronsEndcapPlus"];
2632  if (meMETPhiChargedHadronsEndcapPlus && meMETPhiChargedHadronsEndcapPlus->getRootObject())
2633  meMETPhiChargedHadronsEndcapPlus->Fill(atan2(py_chargedHadronsEndcapPlus, px_chargedHadronsEndcapPlus));
2634  }
2635  if (pt_sum_CHF_Endcap_minus) {
2636  meMETPhiChargedHadronsEndcapMinus = map_of_MEs[DirName + "/" + "METPhiChargedHadronsEndcapMinus"];
2637  if (meMETPhiChargedHadronsEndcapMinus && meMETPhiChargedHadronsEndcapMinus->getRootObject())
2638  meMETPhiChargedHadronsEndcapMinus->Fill(atan2(py_chargedHadronsEndcapMinus, px_chargedHadronsEndcapMinus));
2639  }
2640  if (pt_sum_NHF_Barrel) {
2641  meMETPhiNeutralHadronsBarrel = map_of_MEs[DirName + "/" + "METPhiNeutralHadronsBarrel"];
2642  if (meMETPhiNeutralHadronsBarrel && meMETPhiNeutralHadronsBarrel->getRootObject())
2643  meMETPhiNeutralHadronsBarrel->Fill(atan2(py_neutralHadronsBarrel, px_neutralHadronsBarrel));
2644  }
2645  if (pt_sum_NHF_Endcap_plus) {
2646  meMETPhiNeutralHadronsEndcapPlus = map_of_MEs[DirName + "/" + "METPhiNeutralHadronsEndcapPlus"];
2647  if (meMETPhiNeutralHadronsEndcapPlus && meMETPhiNeutralHadronsEndcapPlus->getRootObject())
2648  meMETPhiNeutralHadronsEndcapPlus->Fill(atan2(py_neutralHadronsEndcapPlus, px_neutralHadronsEndcapPlus));
2649  }
2650  if (pt_sum_NHF_Endcap_minus) {
2651  meMETPhiNeutralHadronsEndcapMinus = map_of_MEs[DirName + "/" + "METPhiNeutralHadronsEndcapMinus"];
2652  if (meMETPhiNeutralHadronsEndcapMinus && meMETPhiNeutralHadronsEndcapMinus->getRootObject())
2653  meMETPhiNeutralHadronsEndcapMinus->Fill(atan2(py_neutralHadronsEndcapMinus, px_neutralHadronsEndcapMinus));
2654  }
2655  if (pt_sum_PhF_Barrel) {
2656  meMETPhiPhotonsBarrel = map_of_MEs[DirName + "/" + "METPhiPhotonsBarrel"];
2657  if (meMETPhiPhotonsBarrel && meMETPhiPhotonsBarrel->getRootObject())
2658  meMETPhiPhotonsBarrel->Fill(atan2(py_PhotonsBarrel, px_PhotonsBarrel));
2659  }
2660  if (pt_sum_PhF_Endcap_plus) {
2661  meMETPhiPhotonsEndcapPlus = map_of_MEs[DirName + "/" + "METPhiPhotonsEndcapPlus"];
2662  if (meMETPhiPhotonsEndcapPlus && meMETPhiPhotonsEndcapPlus->getRootObject())
2663  meMETPhiPhotonsEndcapPlus->Fill(atan2(py_PhotonsEndcapPlus, px_PhotonsEndcapPlus));
2664  }
2665  if (pt_sum_PhF_Endcap_minus) {
2666  meMETPhiPhotonsEndcapMinus = map_of_MEs[DirName + "/" + "METPhiPhotonsEndcapMinus"];
2667  if (meMETPhiPhotonsEndcapMinus && meMETPhiPhotonsEndcapMinus->getRootObject())
2668  meMETPhiPhotonsEndcapMinus->Fill(atan2(py_PhotonsEndcapMinus, px_PhotonsEndcapMinus));
2669  }
2670  if (pt_sum_HFH_plus) {
2671  meMETPhiHFHadronsPlus = map_of_MEs[DirName + "/" + "METPhiHFHadronsPlus"];
2672  if (meMETPhiHFHadronsPlus && meMETPhiHFHadronsPlus->getRootObject())
2673  meMETPhiHFHadronsPlus->Fill(atan2(py_HFHadronsPlus, px_HFHadronsPlus));
2674  }
2675  if (pt_sum_HFH_minus) {
2676  meMETPhiHFHadronsMinus = map_of_MEs[DirName + "/" + "METPhiHFHadronsMinus"];
2677  if (meMETPhiHFHadronsMinus && meMETPhiHFHadronsMinus->getRootObject())
2678  meMETPhiHFHadronsMinus->Fill(atan2(py_HFHadronsMinus, px_HFHadronsMinus));
2679  }
2680  if (pt_sum_HFE_plus) {
2681  meMETPhiHFEGammasPlus = map_of_MEs[DirName + "/" + "METPhiHFEGammasPlus"];
2682  if (meMETPhiHFEGammasPlus && meMETPhiHFEGammasPlus->getRootObject())
2683  meMETPhiHFEGammasPlus->Fill(atan2(py_HFEGammasPlus, px_HFEGammasPlus));
2684  }
2685  if (pt_sum_HFE_minus) {
2686  meMETPhiHFEGammasMinus = map_of_MEs[DirName + "/" + "METPhiHFEGammasMinus"];
2687  if (meMETPhiHFEGammasMinus && meMETPhiHFEGammasMinus->getRootObject())
2688  meMETPhiHFEGammasMinus->Fill(atan2(py_HFEGammasMinus, px_HFEGammasMinus));
2689  }
2690  //fill other diagnostic plots based on trigger decision
2691  /*if(techTriggerCase[0]){//techTriggerResultBx0 && techTriggerResultBxM2 && techTriggerResultBxM1 -> both previous bunches filled
2692  meCHF_Barrel_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm2BXm1Filled"]; if(meCHF_Barrel_BXm2BXm1Filled && meCHF_Barrel_BXm2BXm1Filled->getRootObject()) meCHF_Barrel_BXm2BXm1Filled->Fill(pt_sum_CHF_Barrel/pfmet->sumEt());
2693  meCHF_EndcapPlus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm2BXm1Filled"]; if(meCHF_EndcapPlus_BXm2BXm1Filled && meCHF_EndcapPlus_BXm2BXm1Filled->getRootObject()) meCHF_EndcapPlus_BXm2BXm1Filled->Fill(pt_sum_CHF_Endcap_plus/pfmet->sumEt());
2694  meCHF_EndcapMinus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm2BXm1Filled"]; if(meCHF_EndcapMinus_BXm2BXm1Filled && meCHF_EndcapMinus_BXm2BXm1Filled->getRootObject()) meCHF_EndcapMinus_BXm2BXm1Filled->Fill(pt_sum_CHF_Endcap_minus/pfmet->sumEt());
2695  meNHF_Barrel_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm2BXm1Filled"]; if(meNHF_Barrel_BXm2BXm1Filled && meNHF_Barrel_BXm2BXm1Filled->getRootObject()) meNHF_Barrel_BXm2BXm1Filled->Fill(pt_sum_NHF_Barrel/pfmet->sumEt());
2696  meNHF_EndcapPlus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm2BXm1Filled"]; if(meNHF_EndcapPlus_BXm2BXm1Filled && meNHF_EndcapPlus_BXm2BXm1Filled->getRootObject()) meNHF_EndcapPlus_BXm2BXm1Filled->Fill(pt_sum_NHF_Endcap_plus/pfmet->sumEt());
2697  meNHF_EndcapMinus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm2BXm1Filled"]; if(meNHF_EndcapMinus_BXm2BXm1Filled && meNHF_EndcapMinus_BXm2BXm1Filled->getRootObject()) meNHF_EndcapMinus_BXm2BXm1Filled->Fill(pt_sum_NHF_Endcap_minus/pfmet->sumEt());
2698  mePhF_Barrel_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionBarrel_BXm2BXm1Filled"]; if(mePhF_Barrel_BXm2BXm1Filled && mePhF_Barrel_BXm2BXm1Filled->getRootObject()) mePhF_Barrel_BXm2BXm1Filled->Fill(pt_sum_PhF_Barrel/pfmet->sumEt());
2699  mePhF_EndcapPlus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm2BXm1Filled"]; if(mePhF_EndcapPlus_BXm2BXm1Filled && mePhF_EndcapPlus_BXm2BXm1Filled->getRootObject()) mePhF_EndcapPlus_BXm2BXm1Filled->Fill(pt_sum_PhF_Endcap_plus/pfmet->sumEt());
2700  mePhF_EndcapMinus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm2BXm1Filled"]; if(mePhF_EndcapMinus_BXm2BXm1Filled && mePhF_EndcapMinus_BXm2BXm1Filled->getRootObject()) mePhF_EndcapMinus_BXm2BXm1Filled->Fill(pt_sum_PhF_Endcap_minus/pfmet->sumEt());
2701  meHFHadF_Plus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionPlus_BXm2BXm1Filled"]; if(meHFHadF_Plus_BXm2BXm1Filled && meHFHadF_Plus_BXm2BXm1Filled->getRootObject()) meHFHadF_Plus_BXm2BXm1Filled->Fill(pt_sum_HFH_plus/pfmet->sumEt());
2702  meHFHadF_Minus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionMinus_BXm2BXm1Filled"]; if(meHFHadF_Minus_BXm2BXm1Filled && meHFHadF_Minus_BXm2BXm1Filled->getRootObject()) meHFHadF_Minus_BXm2BXm1Filled->Fill(pt_sum_HFH_minus/pfmet->sumEt());
2703  meHFEMF_Plus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfHFEMEtFractionPlus_BXm2BXm1Filled"]; if(meHFEMF_Plus_BXm2BXm1Filled && meHFEMF_Plus_BXm2BXm1Filled->getRootObject()) meHFEMF_Plus_BXm2BXm1Filled->Fill(pt_sum_HFE_plus/pfmet->sumEt());
2704  meHFEMF_Minus_BXm2BXm1Filled=map_of_MEs[DirName+"/"+"PfHFEMEtFractionMinus_BXm2BXm1Filled"]; if(meHFEMF_Minus_BXm2BXm1Filled && meHFEMF_Minus_BXm2BXm1Filled->getRootObject()) meHFEMF_Minus_BXm2BXm1Filled->Fill(pt_sum_HFE_minus/pfmet->sumEt());
2705  mePhotonEtFraction_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PfPhotonEtFraction_BXm2BXm1Filled"]; if ( mePhotonEtFraction_BXm2BXm1Filled && mePhotonEtFraction_BXm2BXm1Filled ->getRootObject()) mePhotonEtFraction_BXm2BXm1Filled ->Fill(pfmet->photonEtFraction());
2706  meNeutralHadronEtFraction_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PfNeutralHadronEtFraction_BXm2BXm1Filled"]; if ( meNeutralHadronEtFraction_BXm2BXm1Filled && meNeutralHadronEtFraction_BXm2BXm1Filled ->getRootObject()) meNeutralHadronEtFraction_BXm2BXm1Filled ->Fill(pfmet->neutralHadronEtFraction());
2707  meChargedHadronEtFraction_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PfChargedHadronEtFraction_BXm2BXm1Filled"]; if ( meChargedHadronEtFraction_BXm2BXm1Filled && meChargedHadronEtFraction_BXm2BXm1Filled ->getRootObject()) meChargedHadronEtFraction_BXm2BXm1Filled ->Fill(pfmet->chargedHadronEtFraction());
2708  meMET_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"MET_BXm2BXm1Filled"]; if ( meMET_BXm2BXm1Filled && meMET_BXm2BXm1Filled ->getRootObject()) meMET_BXm2BXm1Filled ->Fill(pfmet->pt());
2709  meSumET_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"SumET_BXm2BXm1Filled"]; if ( meSumET_BXm2BXm1Filled && meSumET_BXm2BXm1Filled ->getRootObject()) meSumET_BXm2BXm1Filled ->Fill(pfmet->sumEt());
2710  if(pt_sum_CHF_Barrel){
2711  meMETPhiChargedHadronsBarrel_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsBarrel_BXm2BXm1Filled"];if(meMETPhiChargedHadronsBarrel_BXm2BXm1Filled && meMETPhiChargedHadronsBarrel_BXm2BXm1Filled ->getRootObject())meMETPhiChargedHadronsBarrel_BXm2BXm1Filled->Fill(atan2(py_chargedHadronsBarrel,px_chargedHadronsBarrel));
2712  }
2713  if(pt_sum_CHF_Endcap_plus){
2714  meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm2BXm1Filled"];if(meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Filled && meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Filled ->getRootObject())meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Filled->Fill(atan2(py_chargedHadronsEndcapPlus,px_chargedHadronsEndcapPlus));
2715  }
2716  if(pt_sum_CHF_Endcap_minus){
2717  meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm2BXm1Filled"];if(meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Filled && meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Filled ->getRootObject())meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Filled->Fill(atan2(py_chargedHadronsEndcapMinus,px_chargedHadronsEndcapMinus));
2718  }
2719  if(pt_sum_NHF_Barrel){
2720  meMETPhiNeutralHadronsBarrel_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsBarrel_BXm2BXm1Filled"];if(meMETPhiNeutralHadronsBarrel_BXm2BXm1Filled && meMETPhiNeutralHadronsBarrel_BXm2BXm1Filled ->getRootObject())meMETPhiNeutralHadronsBarrel_BXm2BXm1Filled->Fill(atan2(py_neutralHadronsBarrel,px_neutralHadronsBarrel));
2721  }
2722  if(pt_sum_NHF_Endcap_plus){
2723  meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled"];if(meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled && meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled ->getRootObject())meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled->Fill(atan2(py_neutralHadronsEndcapPlus,px_neutralHadronsEndcapPlus));
2724  }
2725  if(pt_sum_NHF_Endcap_minus){
2726  meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled"];if(meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled && meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled ->getRootObject())meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled->Fill(atan2(py_neutralHadronsEndcapMinus,px_neutralHadronsEndcapMinus));
2727  }
2728  if(pt_sum_PhF_Barrel){
2729  meMETPhiPhotonsBarrel_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsBarrel_BXm2BXm1Filled"];if(meMETPhiPhotonsBarrel_BXm2BXm1Filled && meMETPhiPhotonsBarrel_BXm2BXm1Filled ->getRootObject())meMETPhiPhotonsBarrel_BXm2BXm1Filled->Fill(atan2(py_PhotonsBarrel,px_PhotonsBarrel));
2730  }
2731  if(pt_sum_PhF_Endcap_plus){
2732  meMETPhiPhotonsEndcapPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapPlus_BXm2BXm1Filled"];if(meMETPhiPhotonsEndcapPlus_BXm2BXm1Filled && meMETPhiPhotonsEndcapPlus_BXm2BXm1Filled ->getRootObject())meMETPhiPhotonsEndcapPlus_BXm2BXm1Filled->Fill(atan2(py_PhotonsEndcapPlus,px_PhotonsEndcapPlus));
2733  }
2734  if(pt_sum_PhF_Endcap_minus){
2735  meMETPhiPhotonsEndcapMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapMinus_BXm2BXm1Filled"];if(meMETPhiPhotonsEndcapMinus_BXm2BXm1Filled && meMETPhiPhotonsEndcapMinus_BXm2BXm1Filled ->getRootObject())meMETPhiPhotonsEndcapMinus_BXm2BXm1Filled->Fill(atan2(py_PhotonsEndcapMinus,px_PhotonsEndcapMinus));
2736  }
2737  if(pt_sum_HFH_plus){
2738  meMETPhiHFHadronsPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiHFHadronsPlus_BXm2BXm1Filled"];if(meMETPhiHFHadronsPlus_BXm2BXm1Filled && meMETPhiHFHadronsPlus_BXm2BXm1Filled ->getRootObject())meMETPhiHFHadronsPlus_BXm2BXm1Filled->Fill(atan2(py_HFHadronsPlus,px_HFHadronsPlus));
2739  }
2740  if(pt_sum_HFH_minus){
2741  meMETPhiHFHadronsMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiHFHadronsMinus_BXm2BXm1Filled"];if(meMETPhiHFHadronsMinus_BXm2BXm1Filled && meMETPhiHFHadronsMinus_BXm2BXm1Filled ->getRootObject())meMETPhiHFHadronsMinus_BXm2BXm1Filled->Fill(atan2(py_HFHadronsMinus,px_HFHadronsMinus));
2742  }
2743  if(pt_sum_HFE_plus){
2744  meMETPhiHFEGammasPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiHFEGammasPlus_BXm2BXm1Filled"];if(meMETPhiHFEGammasPlus_BXm2BXm1Filled && meMETPhiHFEGammasPlus_BXm2BXm1Filled ->getRootObject())meMETPhiHFEGammasPlus_BXm2BXm1Filled->Fill(atan2(py_HFEGammasPlus,px_HFEGammasPlus));
2745  }
2746  if(pt_sum_HFE_minus){
2747  meMETPhiHFEGammasMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"METPhiHFEGammasMinus_BXm2BXm1Filled"];if(meMETPhiHFEGammasMinus_BXm2BXm1Filled && meMETPhiHFEGammasMinus_BXm2BXm1Filled ->getRootObject())meMETPhiHFEGammasMinus_BXm2BXm1Filled->Fill(atan2(py_HFEGammasMinus,px_HFEGammasMinus));
2748  }
2749  }*/
2750  if (techTriggerCase[1]) { //techTriggerResultBx0 && techTriggerResultBxM1 -> previous bunch filled
2751  meCHF_Barrel_BXm1Filled = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionBarrel_BXm1Filled"];
2752  if (meCHF_Barrel_BXm1Filled && meCHF_Barrel_BXm1Filled->getRootObject())
2753  meCHF_Barrel_BXm1Filled->Fill(pt_sum_CHF_Barrel / pfmet->sumEt());
2754  meCHF_EndcapPlus_BXm1Filled = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionEndcapPlus_BXm1Filled"];
2755  if (meCHF_EndcapPlus_BXm1Filled && meCHF_EndcapPlus_BXm1Filled->getRootObject())
2756  meCHF_EndcapPlus_BXm1Filled->Fill(pt_sum_CHF_Endcap_plus / pfmet->sumEt());
2757  meCHF_EndcapMinus_BXm1Filled = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionEndcapMinus_BXm1Filled"];
2758  if (meCHF_EndcapMinus_BXm1Filled && meCHF_EndcapMinus_BXm1Filled->getRootObject())
2759  meCHF_EndcapMinus_BXm1Filled->Fill(pt_sum_CHF_Endcap_minus / pfmet->sumEt());
2760  meNHF_Barrel_BXm1Filled = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionBarrel_BXm1Filled"];
2761  if (meNHF_Barrel_BXm1Filled && meNHF_Barrel_BXm1Filled->getRootObject())
2762  meNHF_Barrel_BXm1Filled->Fill(pt_sum_NHF_Barrel / pfmet->sumEt());
2763  meNHF_EndcapPlus_BXm1Filled = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionEndcapPlus_BXm1Filled"];
2764  if (meNHF_EndcapPlus_BXm1Filled && meNHF_EndcapPlus_BXm1Filled->getRootObject())
2765  meNHF_EndcapPlus_BXm1Filled->Fill(pt_sum_NHF_Endcap_plus / pfmet->sumEt());
2766  meNHF_EndcapMinus_BXm1Filled = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionEndcapMinus_BXm1Filled"];
2767  if (meNHF_EndcapMinus_BXm1Filled && meNHF_EndcapMinus_BXm1Filled->getRootObject())
2768  meNHF_EndcapMinus_BXm1Filled->Fill(pt_sum_NHF_Endcap_minus / pfmet->sumEt());
2769  mePhF_Barrel_BXm1Filled = map_of_MEs[DirName + "/" + "PfPhotonEtFractionBarrel_BXm1Filled"];
2770  if (mePhF_Barrel_BXm1Filled && mePhF_Barrel_BXm1Filled->getRootObject())
2771  mePhF_Barrel_BXm1Filled->Fill(pt_sum_PhF_Barrel / pfmet->sumEt());
2772  mePhF_EndcapPlus_BXm1Filled = map_of_MEs[DirName + "/" + "PfPhotonEtFractionEndcapPlus_BXm1Filled"];
2773  if (mePhF_EndcapPlus_BXm1Filled && mePhF_EndcapPlus_BXm1Filled->getRootObject())
2774  mePhF_EndcapPlus_BXm1Filled->Fill(pt_sum_PhF_Endcap_plus / pfmet->sumEt());
2775  mePhF_EndcapMinus_BXm1Filled = map_of_MEs[DirName + "/" + "PfPhotonEtFractionEndcapMinus_BXm1Filled"];
2776  if (mePhF_EndcapMinus_BXm1Filled && mePhF_EndcapMinus_BXm1Filled->getRootObject())
2777  mePhF_EndcapMinus_BXm1Filled->Fill(pt_sum_PhF_Endcap_minus / pfmet->sumEt());
2778  meHFHadF_Plus_BXm1Filled = map_of_MEs[DirName + "/" + "PfHFHadronEtFractionPlus_BXm1Filled"];
2779  if (meHFHadF_Plus_BXm1Filled && meHFHadF_Plus_BXm1Filled->getRootObject())
2780  meHFHadF_Plus_BXm1Filled->Fill(pt_sum_HFH_plus / pfmet->sumEt());
2781  meHFHadF_Minus_BXm1Filled = map_of_MEs[DirName + "/" + "PfHFHadronEtFractionMinus_BXm1Filled"];
2782  if (meHFHadF_Minus_BXm1Filled && meHFHadF_Minus_BXm1Filled->getRootObject())
2783  meHFHadF_Minus_BXm1Filled->Fill(pt_sum_HFH_minus / pfmet->sumEt());
2784  meHFEMF_Plus_BXm1Filled = map_of_MEs[DirName + "/" + "PfHFEMEtFractionPlus_BXm1Filled"];
2785  if (meHFEMF_Plus_BXm1Filled && meHFEMF_Plus_BXm1Filled->getRootObject())
2786  meHFEMF_Plus_BXm1Filled->Fill(pt_sum_HFE_plus / pfmet->sumEt());
2787  meHFEMF_Minus_BXm1Filled = map_of_MEs[DirName + "/" + "PfHFEMEtFractionMinus_BXm1Filled"];
2788  if (meHFEMF_Minus_BXm1Filled && meHFEMF_Minus_BXm1Filled->getRootObject())
2789  meHFEMF_Minus_BXm1Filled->Fill(pt_sum_HFE_minus / pfmet->sumEt());
2790  mePhotonEtFraction_BXm1Filled = map_of_MEs[DirName + "/" + "PfPhotonEtFraction_BXm1Filled"];
2791  if (mePhotonEtFraction_BXm1Filled && mePhotonEtFraction_BXm1Filled->getRootObject())
2792  mePhotonEtFraction_BXm1Filled->Fill(pfmet->photonEtFraction());
2793  meNeutralHadronEtFraction_BXm1Filled = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFraction_BXm1Filled"];
2794  if (meNeutralHadronEtFraction_BXm1Filled && meNeutralHadronEtFraction_BXm1Filled->getRootObject())
2795  meNeutralHadronEtFraction_BXm1Filled->Fill(pfmet->neutralHadronEtFraction());
2796  meChargedHadronEtFraction_BXm1Filled = map_of_MEs[DirName + "/" + "PfChargedHadronEtFraction_BXm1Filled"];
2797  if (meChargedHadronEtFraction_BXm1Filled && meChargedHadronEtFraction_BXm1Filled->getRootObject())
2798  meChargedHadronEtFraction_BXm1Filled->Fill(pfmet->chargedHadronEtFraction());
2799  meMET_BXm1Filled = map_of_MEs[DirName + "/" + "MET_BXm1Filled"];
2800  if (meMET_BXm1Filled && meMET_BXm1Filled->getRootObject())
2801  meMET_BXm1Filled->Fill(pfmet->pt());
2802  meSumET_BXm1Filled = map_of_MEs[DirName + "/" + "SumET_BXm1Filled"];
2803  if (meSumET_BXm1Filled && meSumET_BXm1Filled->getRootObject())
2804  meSumET_BXm1Filled->Fill(pfmet->sumEt());
2805  if (pt_sum_CHF_Barrel) {
2806  meMETPhiChargedHadronsBarrel_BXm1Filled =
2807  map_of_MEs[DirName + "/" + "METPhiChargedHadronsBarrel_BXm1Filled"];
2808  if (meMETPhiChargedHadronsBarrel_BXm1Filled && meMETPhiChargedHadronsBarrel_BXm1Filled->getRootObject())
2809  meMETPhiChargedHadronsBarrel_BXm1Filled->Fill(atan2(py_chargedHadronsBarrel, px_chargedHadronsBarrel));
2810  }
2811  if (pt_sum_CHF_Endcap_plus) {
2812  meMETPhiChargedHadronsEndcapPlus_BXm1Filled =
2813  map_of_MEs[DirName + "/" + "METPhiChargedHadronsEndcapPlus_BXm1Filled"];
2814  if (meMETPhiChargedHadronsEndcapPlus_BXm1Filled &&
2815  meMETPhiChargedHadronsEndcapPlus_BXm1Filled->getRootObject())
2816  meMETPhiChargedHadronsEndcapPlus_BXm1Filled->Fill(
2817  atan2(py_chargedHadronsEndcapPlus, px_chargedHadronsEndcapPlus));
2818  }
2819  if (pt_sum_CHF_Endcap_minus) {
2820  meMETPhiChargedHadronsEndcapMinus_BXm1Filled =
2821  map_of_MEs[DirName + "/" + "METPhiChargedHadronsEndcapMinus_BXm1Filled"];
2822  if (meMETPhiChargedHadronsEndcapMinus_BXm1Filled &&
2823  meMETPhiChargedHadronsEndcapMinus_BXm1Filled->getRootObject())
2824  meMETPhiChargedHadronsEndcapMinus_BXm1Filled->Fill(
2825  atan2(py_chargedHadronsEndcapMinus, px_chargedHadronsEndcapMinus));
2826  }
2827  if (pt_sum_NHF_Barrel) {
2828  meMETPhiNeutralHadronsBarrel_BXm1Filled =
2829  map_of_MEs[DirName + "/" + "METPhiNeutralHadronsBarrel_BXm1Filled"];
2830  if (meMETPhiNeutralHadronsBarrel_BXm1Filled && meMETPhiNeutralHadronsBarrel_BXm1Filled->getRootObject())
2831  meMETPhiNeutralHadronsBarrel_BXm1Filled->Fill(atan2(py_neutralHadronsBarrel, px_neutralHadronsBarrel));
2832  }
2833  if (pt_sum_NHF_Endcap_plus) {
2834  meMETPhiNeutralHadronsEndcapPlus_BXm1Filled =
2835  map_of_MEs[DirName + "/" + "METPhiNeutralHadronsEndcapPlus_BXm1Filled"];
2836  if (meMETPhiNeutralHadronsEndcapPlus_BXm1Filled &&
2837  meMETPhiNeutralHadronsEndcapPlus_BXm1Filled->getRootObject())
2838  meMETPhiNeutralHadronsEndcapPlus_BXm1Filled->Fill(
2839  atan2(py_neutralHadronsEndcapPlus, px_neutralHadronsEndcapPlus));
2840  }
2841  if (pt_sum_NHF_Endcap_minus) {
2842  meMETPhiNeutralHadronsEndcapMinus_BXm1Filled =
2843  map_of_MEs[DirName + "/" + "METPhiNeutralHadronsEndcapMinus_BXm1Filled"];
2844  if (meMETPhiNeutralHadronsEndcapMinus_BXm1Filled &&
2845  meMETPhiNeutralHadronsEndcapMinus_BXm1Filled->getRootObject())
2846  meMETPhiNeutralHadronsEndcapMinus_BXm1Filled->Fill(
2847  atan2(py_neutralHadronsEndcapMinus, px_neutralHadronsEndcapMinus));
2848  }
2849  if (pt_sum_PhF_Barrel) {
2850  meMETPhiPhotonsBarrel_BXm1Filled = map_of_MEs[DirName + "/" + "METPhiPhotonsBarrel_BXm1Filled"];
2851  if (meMETPhiPhotonsBarrel_BXm1Filled && meMETPhiPhotonsBarrel_BXm1Filled->getRootObject())
2852  meMETPhiPhotonsBarrel_BXm1Filled->Fill(atan2(py_PhotonsBarrel, px_PhotonsBarrel));
2853  }
2854  if (pt_sum_PhF_Endcap_plus) {
2855  meMETPhiPhotonsEndcapPlus_BXm1Filled = map_of_MEs[DirName + "/" + "METPhiPhotonsEndcapPlus_BXm1Filled"];
2856  if (meMETPhiPhotonsEndcapPlus_BXm1Filled && meMETPhiPhotonsEndcapPlus_BXm1Filled->getRootObject())
2857  meMETPhiPhotonsEndcapPlus_BXm1Filled->Fill(atan2(py_PhotonsEndcapPlus, px_PhotonsEndcapPlus));
2858  }
2859  if (pt_sum_PhF_Endcap_minus) {
2860  meMETPhiPhotonsEndcapMinus_BXm1Filled = map_of_MEs[DirName + "/" + "METPhiPhotonsEndcapMinus_BXm1Filled"];
2861  if (meMETPhiPhotonsEndcapMinus_BXm1Filled && meMETPhiPhotonsEndcapMinus_BXm1Filled->getRootObject())
2862  meMETPhiPhotonsEndcapMinus_BXm1Filled->Fill(atan2(py_PhotonsEndcapMinus, px_PhotonsEndcapMinus));
2863  }
2864  if (pt_sum_HFH_plus) {
2865  meMETPhiHFHadronsPlus_BXm1Filled = map_of_MEs[DirName + "/" + "METPhiHFHadronsPlus_BXm1Filled"];
2866  if (meMETPhiHFHadronsPlus_BXm1Filled && meMETPhiHFHadronsPlus_BXm1Filled->getRootObject())
2867  meMETPhiHFHadronsPlus_BXm1Filled->Fill(atan2(py_HFHadronsPlus, px_HFHadronsPlus));
2868  }
2869  if (pt_sum_HFH_minus) {
2870  meMETPhiHFHadronsMinus_BXm1Filled = map_of_MEs[DirName + "/" + "METPhiHFHadronsMinus_BXm1Filled"];
2871  if (meMETPhiHFHadronsMinus_BXm1Filled && meMETPhiHFHadronsMinus_BXm1Filled->getRootObject())
2872  meMETPhiHFHadronsMinus_BXm1Filled->Fill(atan2(py_HFHadronsMinus, px_HFHadronsMinus));
2873  }
2874  if (pt_sum_HFE_plus) {
2875  meMETPhiHFEGammasPlus_BXm1Filled = map_of_MEs[DirName + "/" + "METPhiHFEGammasPlus_BXm1Filled"];
2876  if (meMETPhiHFEGammasPlus_BXm1Filled && meMETPhiHFEGammasPlus_BXm1Filled->getRootObject())
2877  meMETPhiHFEGammasPlus_BXm1Filled->Fill(atan2(py_HFEGammasPlus, px_HFEGammasPlus));
2878  }
2879  if (pt_sum_HFE_minus) {
2880  meMETPhiHFEGammasMinus_BXm1Filled = map_of_MEs[DirName + "/" + "METPhiHFEGammasMinus_BXm1Filled"];
2881  if (meMETPhiHFEGammasMinus_BXm1Filled && meMETPhiHFEGammasMinus_BXm1Filled->getRootObject())
2882  meMETPhiHFEGammasMinus_BXm1Filled->Fill(atan2(py_HFEGammasMinus, px_HFEGammasMinus));
2883  }
2884  }
2885  /*if(techTriggerCase[3]){//techTriggerResultBx0 && !techTriggerResultBxM2 && !techTriggerResultBxM1 ->previous two bunches empty
2886  meCHF_Barrel_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm2BXm1Empty"]; if(meCHF_Barrel_BXm2BXm1Empty && meCHF_Barrel_BXm2BXm1Empty->getRootObject()) meCHF_Barrel_BXm2BXm1Empty->Fill(pt_sum_CHF_Barrel/pfmet->sumEt());
2887  meCHF_EndcapPlus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm2BXm1Empty"]; if(meCHF_EndcapPlus_BXm2BXm1Empty && meCHF_EndcapPlus_BXm2BXm1Empty->getRootObject()) meCHF_EndcapPlus_BXm2BXm1Empty->Fill(pt_sum_CHF_Endcap_plus/pfmet->sumEt());
2888  meCHF_EndcapMinus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm2BXm1Empty"]; if(meCHF_EndcapMinus_BXm2BXm1Empty && meCHF_EndcapMinus_BXm2BXm1Empty->getRootObject()) meCHF_EndcapMinus_BXm2BXm1Empty->Fill(pt_sum_CHF_Endcap_minus/pfmet->sumEt());
2889  meNHF_Barrel_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm2BXm1Empty"]; if(meNHF_Barrel_BXm2BXm1Empty && meNHF_Barrel_BXm2BXm1Empty->getRootObject()) meNHF_Barrel_BXm2BXm1Empty->Fill(pt_sum_NHF_Barrel/pfmet->sumEt());
2890  meNHF_EndcapPlus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm2BXm1Empty"]; if(meNHF_EndcapPlus_BXm2BXm1Empty && meNHF_EndcapPlus_BXm2BXm1Empty->getRootObject()) meNHF_EndcapPlus_BXm2BXm1Empty->Fill(pt_sum_NHF_Endcap_plus/pfmet->sumEt());
2891  meNHF_EndcapMinus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm2BXm1Empty"]; if(meNHF_EndcapMinus_BXm2BXm1Empty && meNHF_EndcapMinus_BXm2BXm1Empty->getRootObject()) meNHF_EndcapMinus_BXm2BXm1Empty->Fill(pt_sum_NHF_Endcap_minus/pfmet->sumEt());
2892  mePhF_Barrel_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionBarrel_BXm2BXm1Empty"]; if(mePhF_Barrel_BXm2BXm1Empty && mePhF_Barrel_BXm2BXm1Empty->getRootObject()) mePhF_Barrel_BXm2BXm1Empty->Fill(pt_sum_PhF_Barrel/pfmet->sumEt());
2893  mePhF_EndcapPlus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm2BXm1Empty"]; if(mePhF_EndcapPlus_BXm2BXm1Empty && mePhF_EndcapPlus_BXm2BXm1Empty->getRootObject()) mePhF_EndcapPlus_BXm2BXm1Empty->Fill(pt_sum_PhF_Endcap_plus/pfmet->sumEt());
2894  mePhF_EndcapMinus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm2BXm1Empty"]; if(mePhF_EndcapMinus_BXm2BXm1Empty && mePhF_EndcapMinus_BXm2BXm1Empty->getRootObject()) mePhF_EndcapMinus_BXm2BXm1Empty->Fill(pt_sum_PhF_Endcap_minus/pfmet->sumEt());
2895  meHFHadF_Plus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionPlus_BXm2BXm1Empty"]; if(meHFHadF_Plus_BXm2BXm1Empty && meHFHadF_Plus_BXm2BXm1Empty->getRootObject()) meHFHadF_Plus_BXm2BXm1Empty->Fill(pt_sum_HFH_plus/pfmet->sumEt());
2896  meHFHadF_Minus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionMinus_BXm2BXm1Empty"]; if(meHFHadF_Minus_BXm2BXm1Empty && meHFHadF_Minus_BXm2BXm1Empty->getRootObject()) meHFHadF_Minus_BXm2BXm1Empty->Fill(pt_sum_HFH_minus/pfmet->sumEt());
2897  meHFEMF_Plus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfHFEMEtFractionPlus_BXm2BXm1Empty"]; if(meHFEMF_Plus_BXm2BXm1Empty && meHFEMF_Plus_BXm2BXm1Empty->getRootObject()) meHFEMF_Plus_BXm2BXm1Empty->Fill(pt_sum_HFE_plus/pfmet->sumEt());
2898  meHFEMF_Minus_BXm2BXm1Empty=map_of_MEs[DirName+"/"+"PfHFEMEtFractionMinus_BXm2BXm1Empty"]; if(meHFEMF_Minus_BXm2BXm1Empty && meHFEMF_Minus_BXm2BXm1Empty->getRootObject()) meHFEMF_Minus_BXm2BXm1Empty->Fill(pt_sum_HFE_minus/pfmet->sumEt());
2899  mePhotonEtFraction_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PfPhotonEtFraction_BXm2BXm1Empty"]; if ( mePhotonEtFraction_BXm2BXm1Empty && mePhotonEtFraction_BXm2BXm1Empty ->getRootObject()) mePhotonEtFraction_BXm2BXm1Empty ->Fill(pfmet->photonEtFraction());
2900  meNeutralHadronEtFraction_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PfNeutralHadronEtFraction_BXm2BXm1Empty"]; if ( meNeutralHadronEtFraction_BXm2BXm1Empty && meNeutralHadronEtFraction_BXm2BXm1Empty ->getRootObject()) meNeutralHadronEtFraction_BXm2BXm1Empty ->Fill(pfmet->neutralHadronEtFraction());
2901  meChargedHadronEtFraction_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PfChargedHadronEtFraction_BXm2BXm1Empty"]; if ( meChargedHadronEtFraction_BXm2BXm1Empty && meChargedHadronEtFraction_BXm2BXm1Empty ->getRootObject()) meChargedHadronEtFraction_BXm2BXm1Empty ->Fill(pfmet->chargedHadronEtFraction());
2902  meMET_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"MET_BXm2BXm1Empty"]; if ( meMET_BXm2BXm1Empty && meMET_BXm2BXm1Empty ->getRootObject()) meMET_BXm2BXm1Empty ->Fill(pfmet->pt());
2903  meSumET_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"SumET_BXm2BXm1Empty"]; if ( meSumET_BXm2BXm1Empty && meSumET_BXm2BXm1Empty ->getRootObject()) meSumET_BXm2BXm1Empty ->Fill(pfmet->sumEt());
2904  if(pt_sum_CHF_Barrel){
2905  meMETPhiChargedHadronsBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsBarrel_BXm2BXm1Empty"];if(meMETPhiChargedHadronsBarrel_BXm2BXm1Empty && meMETPhiChargedHadronsBarrel_BXm2BXm1Empty ->getRootObject())meMETPhiChargedHadronsBarrel_BXm2BXm1Empty->Fill(atan2(py_chargedHadronsBarrel,px_chargedHadronsBarrel));
2906  }
2907  if(pt_sum_CHF_Endcap_plus){
2908  meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm2BXm1Empty"];if(meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty && meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty ->getRootObject())meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty->Fill(atan2(py_chargedHadronsEndcapPlus,px_chargedHadronsEndcapPlus));
2909  }
2910  if(pt_sum_CHF_Endcap_minus){
2911  meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm2BXm1Empty"];if(meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty && meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty ->getRootObject())meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty->Fill(atan2(py_chargedHadronsEndcapMinus,px_chargedHadronsEndcapMinus));
2912  }
2913  if(pt_sum_NHF_Barrel){
2914  meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsBarrel_BXm2BXm1Empty"];if(meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty && meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty ->getRootObject())meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty->Fill(atan2(py_neutralHadronsBarrel,px_neutralHadronsBarrel));
2915  }
2916  if(pt_sum_NHF_Endcap_plus){
2917  meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty"];if(meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty && meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty ->getRootObject())meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty->Fill(atan2(py_neutralHadronsEndcapPlus,px_neutralHadronsEndcapPlus));
2918  }
2919  if(pt_sum_NHF_Endcap_minus){
2920  meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty"];if(meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty && meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty ->getRootObject())meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty->Fill(atan2(py_neutralHadronsEndcapMinus,px_neutralHadronsEndcapMinus));
2921  }
2922  if(pt_sum_PhF_Barrel){
2923  meMETPhiPhotonsBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsBarrel_BXm2BXm1Empty"];if(meMETPhiPhotonsBarrel_BXm2BXm1Empty && meMETPhiPhotonsBarrel_BXm2BXm1Empty ->getRootObject())meMETPhiPhotonsBarrel_BXm2BXm1Empty->Fill(atan2(py_PhotonsBarrel,px_PhotonsBarrel));
2924  }
2925  if(pt_sum_PhF_Endcap_plus){
2926  meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapPlus_BXm2BXm1Empty"];if(meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty && meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty ->getRootObject())meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty->Fill(atan2(py_PhotonsEndcapPlus,px_PhotonsEndcapPlus));
2927  }
2928  if(pt_sum_PhF_Endcap_minus){
2929  meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapMinus_BXm2BXm1Empty"];if(meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty && meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty ->getRootObject())meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty->Fill(atan2(py_PhotonsEndcapMinus,px_PhotonsEndcapMinus));
2930  }
2931  if(pt_sum_HFH_plus){
2932  meMETPhiHFHadronsPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFHadronsPlus_BXm2BXm1Empty"];if(meMETPhiHFHadronsPlus_BXm2BXm1Empty && meMETPhiHFHadronsPlus_BXm2BXm1Empty ->getRootObject())meMETPhiHFHadronsPlus_BXm2BXm1Empty->Fill(atan2(py_HFHadronsPlus,px_HFHadronsPlus));
2933  }
2934  if(pt_sum_HFH_minus){
2935  meMETPhiHFHadronsMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFHadronsMinus_BXm2BXm1Empty"];if(meMETPhiHFHadronsMinus_BXm2BXm1Empty && meMETPhiHFHadronsMinus_BXm2BXm1Empty ->getRootObject())meMETPhiHFHadronsMinus_BXm2BXm1Empty->Fill(atan2(py_HFHadronsMinus,px_HFHadronsMinus));
2936  }
2937  if(pt_sum_HFE_plus){
2938  meMETPhiHFEGammasPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFEGammasPlus_BXm2BXm1Empty"];if(meMETPhiHFEGammasPlus_BXm2BXm1Empty && meMETPhiHFEGammasPlus_BXm2BXm1Empty ->getRootObject())meMETPhiHFEGammasPlus_BXm2BXm1Empty->Fill(atan2(py_HFEGammasPlus,px_HFEGammasPlus));
2939  }
2940  if(pt_sum_HFE_minus){
2941  meMETPhiHFEGammasMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFEGammasMinus_BXm2BXm1Empty"];if(meMETPhiHFEGammasMinus_BXm2BXm1Empty && meMETPhiHFEGammasMinus_BXm2BXm1Empty ->getRootObject())meMETPhiHFEGammasMinus_BXm2BXm1Empty->Fill(atan2(py_HFEGammasMinus,px_HFEGammasMinus));
2942  }
2943  }*/
2944  if (techTriggerCase[2]) { //techTriggerResultBx0 && !techTriggerResultBxM1 --> previous bunch empty
2945  meCHF_Barrel_BXm1Empty = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionBarrel_BXm1Empty"];
2946  if (meCHF_Barrel_BXm1Empty && meCHF_Barrel_BXm1Empty->getRootObject())
2947  meCHF_Barrel_BXm1Empty->Fill(pt_sum_CHF_Barrel / pfmet->sumEt());
2948  meCHF_EndcapPlus_BXm1Empty = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionEndcapPlus_BXm1Empty"];
2949  if (meCHF_EndcapPlus_BXm1Empty && meCHF_EndcapPlus_BXm1Empty->getRootObject())
2950  meCHF_EndcapPlus_BXm1Empty->Fill(pt_sum_CHF_Endcap_plus / pfmet->sumEt());
2951  meCHF_EndcapMinus_BXm1Empty = map_of_MEs[DirName + "/" + "PfChargedHadronEtFractionEndcapMinus_BXm1Empty"];
2952  if (meCHF_EndcapMinus_BXm1Empty && meCHF_EndcapMinus_BXm1Empty->getRootObject())
2953  meCHF_EndcapMinus_BXm1Empty->Fill(pt_sum_CHF_Endcap_minus / pfmet->sumEt());
2954  meNHF_Barrel_BXm1Empty = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionBarrel_BXm1Empty"];
2955  if (meNHF_Barrel_BXm1Empty && meNHF_Barrel_BXm1Empty->getRootObject())
2956  meNHF_Barrel_BXm1Empty->Fill(pt_sum_NHF_Barrel / pfmet->sumEt());
2957  meNHF_EndcapPlus_BXm1Empty = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionEndcapPlus_BXm1Empty"];
2958  if (meNHF_EndcapPlus_BXm1Empty && meNHF_EndcapPlus_BXm1Empty->getRootObject())
2959  meNHF_EndcapPlus_BXm1Empty->Fill(pt_sum_NHF_Endcap_plus / pfmet->sumEt());
2960  meNHF_EndcapMinus_BXm1Empty = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFractionEndcapMinus_BXm1Empty"];
2961  if (meNHF_EndcapMinus_BXm1Empty && meNHF_EndcapMinus_BXm1Empty->getRootObject())
2962  meNHF_EndcapMinus_BXm1Empty->Fill(pt_sum_NHF_Endcap_minus / pfmet->sumEt());
2963  mePhF_Barrel_BXm1Empty = map_of_MEs[DirName + "/" + "PfPhotonEtFractionBarrel_BXm1Empty"];
2964  if (mePhF_Barrel_BXm1Empty && mePhF_Barrel_BXm1Empty->getRootObject())
2965  mePhF_Barrel_BXm1Empty->Fill(pt_sum_PhF_Barrel / pfmet->sumEt());
2966  mePhF_EndcapPlus_BXm1Empty = map_of_MEs[DirName + "/" + "PfPhotonEtFractionEndcapPlus_BXm1Empty"];
2967  if (mePhF_EndcapPlus_BXm1Empty && mePhF_EndcapPlus_BXm1Empty->getRootObject())
2968  mePhF_EndcapPlus_BXm1Empty->Fill(pt_sum_PhF_Endcap_plus / pfmet->sumEt());
2969  mePhF_EndcapMinus_BXm1Empty = map_of_MEs[DirName + "/" + "PfPhotonEtFractionEndcapMinus_BXm1Empty"];
2970  if (mePhF_EndcapMinus_BXm1Empty && mePhF_EndcapMinus_BXm1Empty->getRootObject())
2971  mePhF_EndcapMinus_BXm1Empty->Fill(pt_sum_PhF_Endcap_minus / pfmet->sumEt());
2972  meHFHadF_Plus_BXm1Empty = map_of_MEs[DirName + "/" + "PfHFHadronEtFractionPlus_BXm1Empty"];
2973  if (meHFHadF_Plus_BXm1Empty && meHFHadF_Plus_BXm1Empty->getRootObject())
2974  meHFHadF_Plus_BXm1Empty->Fill(pt_sum_HFH_plus / pfmet->sumEt());
2975  meHFHadF_Minus_BXm1Empty = map_of_MEs[DirName + "/" + "PfHFHadronEtFractionMinus_BXm1Empty"];
2976  if (meHFHadF_Minus_BXm1Empty && meHFHadF_Minus_BXm1Empty->getRootObject())
2977  meHFHadF_Minus_BXm1Empty->Fill(pt_sum_HFH_minus / pfmet->sumEt());
2978  meHFEMF_Plus_BXm1Empty = map_of_MEs[DirName + "/" + "PfHFEMEtFractionPlus_BXm1Empty"];
2979  if (meHFEMF_Plus_BXm1Empty && meHFEMF_Plus_BXm1Empty->getRootObject())
2980  meHFEMF_Plus_BXm1Empty->Fill(pt_sum_HFE_plus / pfmet->sumEt());
2981  meHFEMF_Minus_BXm1Empty = map_of_MEs[DirName + "/" + "PfHFEMEtFractionMinus_BXm1Empty"];
2982  if (meHFEMF_Minus_BXm1Empty && meHFEMF_Minus_BXm1Empty->getRootObject())
2983  meHFEMF_Minus_BXm1Empty->Fill(pt_sum_HFE_minus / pfmet->sumEt());
2984  mePhotonEtFraction_BXm1Empty = map_of_MEs[DirName + "/" + "PfPhotonEtFraction_BXm1Empty"];
2985  if (mePhotonEtFraction_BXm1Empty && mePhotonEtFraction_BXm1Empty->getRootObject())
2986  mePhotonEtFraction_BXm1Empty->Fill(pfmet->photonEtFraction());
2987  meNeutralHadronEtFraction_BXm1Empty = map_of_MEs[DirName + "/" + "PfNeutralHadronEtFraction_BXm1Empty"];
2988  if (meNeutralHadronEtFraction_BXm1Empty && meNeutralHadronEtFraction_BXm1Empty->getRootObject())
2989  meNeutralHadronEtFraction_BXm1Empty->Fill(pfmet->neutralHadronEtFraction());
2990  meChargedHadronEtFraction_BXm1Empty = map_of_MEs[DirName + "/" + "PfChargedHadronEtFraction_BXm1Empty"];
2991  if (meChargedHadronEtFraction_BXm1Empty && meChargedHadronEtFraction_BXm1Empty->getRootObject())
2992  meChargedHadronEtFraction_BXm1Empty->Fill(pfmet->chargedHadronEtFraction());
2993  meMET_BXm1Empty = map_of_MEs[DirName + "/" + "MET_BXm1Empty"];
2994  if (meMET_BXm1Empty && meMET_BXm1Empty->getRootObject())
2995  meMET_BXm1Empty->Fill(pfmet->pt());
2996  meSumET_BXm1Empty = map_of_MEs[DirName + "/" + "SumET_BXm1Empty"];
2997  if (meSumET_BXm1Empty && meSumET_BXm1Empty->getRootObject())
2998  meSumET_BXm1Empty->Fill(pfmet->sumEt());
2999  if (pt_sum_CHF_Barrel) {
3000  meMETPhiChargedHadronsBarrel_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiChargedHadronsBarrel_BXm1Empty"];
3001  if (meMETPhiChargedHadronsBarrel_BXm1Empty && meMETPhiChargedHadronsBarrel_BXm1Empty->getRootObject())
3002  meMETPhiChargedHadronsBarrel_BXm1Empty->Fill(atan2(py_chargedHadronsBarrel, px_chargedHadronsBarrel));
3003  }
3004  if (pt_sum_CHF_Endcap_plus) {
3005  meMETPhiChargedHadronsEndcapPlus_BXm1Empty =
3006  map_of_MEs[DirName + "/" + "METPhiChargedHadronsEndcapPlus_BXm1Empty"];
3007  if (meMETPhiChargedHadronsEndcapPlus_BXm1Empty &&
3008  meMETPhiChargedHadronsEndcapPlus_BXm1Empty->getRootObject())
3009  meMETPhiChargedHadronsEndcapPlus_BXm1Empty->Fill(
3010  atan2(py_chargedHadronsEndcapPlus, px_chargedHadronsEndcapPlus));
3011  }
3012  if (pt_sum_CHF_Endcap_minus) {
3013  meMETPhiChargedHadronsEndcapMinus_BXm1Empty =
3014  map_of_MEs[DirName + "/" + "METPhiChargedHadronsEndcapMinus_BXm1Empty"];
3015  if (meMETPhiChargedHadronsEndcapMinus_BXm1Empty &&
3016  meMETPhiChargedHadronsEndcapMinus_BXm1Empty->getRootObject())
3017  meMETPhiChargedHadronsEndcapMinus_BXm1Empty->Fill(
3018  atan2(py_chargedHadronsEndcapMinus, px_chargedHadronsEndcapMinus));
3019  }
3020  if (pt_sum_NHF_Barrel) {
3021  meMETPhiNeutralHadronsBarrel_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiNeutralHadronsBarrel_BXm1Empty"];
3022  if (meMETPhiNeutralHadronsBarrel_BXm1Empty && meMETPhiNeutralHadronsBarrel_BXm1Empty->getRootObject())
3023  meMETPhiNeutralHadronsBarrel_BXm1Empty->Fill(atan2(py_neutralHadronsBarrel, px_neutralHadronsBarrel));
3024  }
3025  if (pt_sum_NHF_Endcap_plus) {
3026  meMETPhiNeutralHadronsEndcapPlus_BXm1Empty =
3027  map_of_MEs[DirName + "/" + "METPhiNeutralHadronsEndcapPlus_BXm1Empty"];
3028  if (meMETPhiNeutralHadronsEndcapPlus_BXm1Empty &&
3029  meMETPhiNeutralHadronsEndcapPlus_BXm1Empty->getRootObject())
3030  meMETPhiNeutralHadronsEndcapPlus_BXm1Empty->Fill(
3031  atan2(py_neutralHadronsEndcapPlus, px_neutralHadronsEndcapPlus));
3032  }
3033  if (pt_sum_NHF_Endcap_minus) {
3034  meMETPhiNeutralHadronsEndcapMinus_BXm1Empty =
3035  map_of_MEs[DirName + "/" + "METPhiNeutralHadronsEndcapMinus_BXm1Empty"];
3036  if (meMETPhiNeutralHadronsEndcapMinus_BXm1Empty &&
3037  meMETPhiNeutralHadronsEndcapMinus_BXm1Empty->getRootObject())
3038  meMETPhiNeutralHadronsEndcapMinus_BXm1Empty->Fill(
3039  atan2(py_neutralHadronsEndcapMinus, px_neutralHadronsEndcapMinus));
3040  }
3041  if (pt_sum_PhF_Barrel) {
3042  meMETPhiPhotonsBarrel_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiPhotonsBarrel_BXm1Empty"];
3043  if (meMETPhiPhotonsBarrel_BXm1Empty && meMETPhiPhotonsBarrel_BXm1Empty->getRootObject())
3044  meMETPhiPhotonsBarrel_BXm1Empty->Fill(atan2(py_PhotonsBarrel, px_PhotonsBarrel));
3045  }
3046  if (pt_sum_PhF_Endcap_plus) {
3047  meMETPhiPhotonsEndcapPlus_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiPhotonsEndcapPlus_BXm1Empty"];
3048  if (meMETPhiPhotonsEndcapPlus_BXm1Empty && meMETPhiPhotonsEndcapPlus_BXm1Empty->getRootObject())
3049  meMETPhiPhotonsEndcapPlus_BXm1Empty->Fill(atan2(py_PhotonsEndcapPlus, px_PhotonsEndcapPlus));
3050  }
3051  if (pt_sum_PhF_Endcap_minus) {
3052  meMETPhiPhotonsEndcapMinus_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiPhotonsEndcapMinus_BXm1Empty"];
3053  if (meMETPhiPhotonsEndcapMinus_BXm1Empty && meMETPhiPhotonsEndcapMinus_BXm1Empty->getRootObject())
3054  meMETPhiPhotonsEndcapMinus_BXm1Empty->Fill(atan2(py_PhotonsEndcapMinus, px_PhotonsEndcapMinus));
3055  }
3056  if (pt_sum_HFH_plus) {
3057  meMETPhiHFHadronsPlus_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiHFHadronsPlus_BXm1Empty"];
3058  if (meMETPhiHFHadronsPlus_BXm1Empty && meMETPhiHFHadronsPlus_BXm1Empty->getRootObject())
3059  meMETPhiHFHadronsPlus_BXm1Empty->Fill(atan2(py_HFHadronsPlus, px_HFHadronsPlus));
3060  }
3061  if (pt_sum_HFH_minus) {
3062  meMETPhiHFHadronsMinus_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiHFHadronsMinus_BXm1Empty"];
3063  if (meMETPhiHFHadronsMinus_BXm1Empty && meMETPhiHFHadronsMinus_BXm1Empty->getRootObject())
3064  meMETPhiHFHadronsMinus_BXm1Empty->Fill(atan2(py_HFHadronsMinus, px_HFHadronsMinus));
3065  }
3066  if (pt_sum_HFE_plus) {
3067  meMETPhiHFEGammasPlus_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiHFEGammasPlus_BXm1Empty"];
3068  if (meMETPhiHFEGammasPlus_BXm1Empty && meMETPhiHFEGammasPlus_BXm1Empty->getRootObject())
3069  meMETPhiHFEGammasPlus_BXm1Empty->Fill(atan2(py_HFEGammasPlus, px_HFEGammasPlus));
3070  }
3071  if (pt_sum_HFE_minus) {
3072  meMETPhiHFEGammasMinus_BXm1Empty = map_of_MEs[DirName + "/" + "METPhiHFEGammasMinus_BXm1Empty"];
3073  if (meMETPhiHFEGammasMinus_BXm1Empty && meMETPhiHFEGammasMinus_BXm1Empty->getRootObject())
3074  meMETPhiHFEGammasMinus_BXm1Empty->Fill(atan2(py_HFEGammasMinus, px_HFEGammasMinus));
3075  }
3076  }
3077 
3078  } //fill candidate plots only then
3079 
3080  // PFMET getters
3081  //----------------------------------------------------------------------------
3082  double pfPhotonEtFraction = pfmet->photonEtFraction();
3083  double pfPhotonEt = pfmet->photonEt();
3084  double pfNeutralHadronEtFraction = pfmet->neutralHadronEtFraction();
3085  double pfNeutralHadronEt = pfmet->neutralHadronEt();
3086  double pfElectronEt = pfmet->electronEt();
3087  double pfChargedHadronEtFraction = pfmet->chargedHadronEtFraction();
3088  double pfChargedHadronEt = pfmet->chargedHadronEt();
3089  double pfMuonEt = pfmet->muonEt();
3090  double pfHFHadronEtFraction = pfmet->HFHadronEtFraction();
3091  double pfHFHadronEt = pfmet->HFHadronEt();
3092  double pfHFEMEtFraction = pfmet->HFEMEtFraction();
3093  double pfHFEMEt = pfmet->HFEMEt();
3094  mePhotonEtFraction = map_of_MEs[DirName + "/PfPhotonEtFraction"];
3095  mePhotonEt = map_of_MEs[DirName + "/PfPhotonEt"];
3096  meNeutralHadronEtFraction = map_of_MEs[DirName + "/PfNeutralHadronEtFraction"];
3097  meNeutralHadronEt = map_of_MEs[DirName + "/PfNeutralHadronEt"];
3098  meElectronEt = map_of_MEs[DirName + "/PfElectronEt"];
3099  meChargedHadronEtFraction = map_of_MEs[DirName + "/PfChargedHadronEtFraction"];
3100  meChargedHadronEt = map_of_MEs[DirName + "/PfChargedHadronEt"];
3101  meMuonEt = map_of_MEs[DirName + "/PfMuonEt"];
3102  meHFHadronEtFraction = map_of_MEs[DirName + "/PfHFHadronEtFraction"];
3103  meHFHadronEt = map_of_MEs[DirName + "/PfHFHadronEt"];
3104  meHFEMEtFraction = map_of_MEs[DirName + "/PfHFEMEtFraction"];
3105  meHFEMEt = map_of_MEs[DirName + "/PfHFEMEt"];
3106 
3107  if (mePhotonEtFraction && mePhotonEtFraction->getRootObject())
3108  mePhotonEtFraction->Fill(pfPhotonEtFraction);
3109  if (mePhotonEt && mePhotonEt->getRootObject())
3110  mePhotonEt->Fill(pfPhotonEt);
3111  if (meNeutralHadronEtFraction && meNeutralHadronEtFraction->getRootObject())
3112  meNeutralHadronEtFraction->Fill(pfNeutralHadronEtFraction);
3113  if (meNeutralHadronEt && meNeutralHadronEt->getRootObject())
3114  meNeutralHadronEt->Fill(pfNeutralHadronEt);
3115  if (meElectronEt && meElectronEt->getRootObject())
3116  meElectronEt->Fill(pfElectronEt);
3117  if (meChargedHadronEtFraction && meChargedHadronEtFraction->getRootObject())
3118  meChargedHadronEtFraction->Fill(pfChargedHadronEtFraction);
3119  if (meChargedHadronEt && meChargedHadronEt->getRootObject())
3120  meChargedHadronEt->Fill(pfChargedHadronEt);
3121  if (meMuonEt && meMuonEt->getRootObject())
3122  meMuonEt->Fill(pfMuonEt);
3123  if (meHFHadronEtFraction && meHFHadronEtFraction->getRootObject())
3124  meHFHadronEtFraction->Fill(pfHFHadronEtFraction);
3125  if (meHFHadronEt && meHFHadronEt->getRootObject())
3126  meHFHadronEt->Fill(pfHFHadronEt);
3127  if (meHFEMEtFraction && meHFEMEtFraction->getRootObject())
3128  meHFEMEtFraction->Fill(pfHFEMEtFraction);
3129  if (meHFEMEt && meHFEMEt->getRootObject())
3130  meHFEMEt->Fill(pfHFEMEt);
3131 
3132  //NPV profiles
3133 
3134  mePhotonEtFraction_profile = map_of_MEs[DirName + "/PfPhotonEtFraction_profile"];
3135  mePhotonEt_profile = map_of_MEs[DirName + "/PfPhotonEt_profile"];
3136  meNeutralHadronEtFraction_profile = map_of_MEs[DirName + "/PfNeutralHadronEtFraction_profile"];
3137  meNeutralHadronEt_profile = map_of_MEs[DirName + "/PfNeutralHadronEt_profile"];
3138  meChargedHadronEtFraction_profile = map_of_MEs[DirName + "/PfChargedHadronEtFraction_profile"];
3139  meChargedHadronEt_profile = map_of_MEs[DirName + "/PfChargedHadronEt_profile"];
3140  meHFHadronEtFraction_profile = map_of_MEs[DirName + "/PfHFHadronEtFraction_profile"];
3141  meHFHadronEt_profile = map_of_MEs[DirName + "/PfHFHadronEt_profile"];
3142  meHFEMEtFraction_profile = map_of_MEs[DirName + "/PfHFEMEtFraction_profile"];
3143  meHFEMEt_profile = map_of_MEs[DirName + "/PfHFEMEt_profile"];
3144 
3145  if (mePhotonEtFraction_profile && mePhotonEtFraction_profile->getRootObject())
3146  mePhotonEtFraction_profile->Fill(numPV_, pfPhotonEtFraction);
3147  if (mePhotonEt_profile && mePhotonEt_profile->getRootObject())
3148  mePhotonEt_profile->Fill(numPV_, pfPhotonEt);
3149  if (meNeutralHadronEtFraction_profile && meNeutralHadronEtFraction_profile->getRootObject())
3150  meNeutralHadronEtFraction_profile->Fill(numPV_, pfNeutralHadronEtFraction);
3151  if (meNeutralHadronEt_profile && meNeutralHadronEt_profile->getRootObject())
3152  meNeutralHadronEt_profile->Fill(numPV_, pfNeutralHadronEt);
3153  if (meChargedHadronEtFraction_profile && meChargedHadronEtFraction_profile->getRootObject())
3154  meChargedHadronEtFraction_profile->Fill(numPV_, pfChargedHadronEtFraction);
3155  if (meChargedHadronEt_profile && meChargedHadronEt_profile->getRootObject())
3156  meChargedHadronEt_profile->Fill(numPV_, pfChargedHadronEt);
3157  if (meHFHadronEtFraction_profile && meHFHadronEtFraction_profile->getRootObject())
3158  meHFHadronEtFraction_profile->Fill(numPV_, pfHFHadronEtFraction);
3159  if (meHFHadronEt_profile && meHFHadronEt_profile->getRootObject())
3160  meHFHadronEt_profile->Fill(numPV_, pfHFHadronEt);
3161  if (meHFEMEtFraction_profile && meHFEMEtFraction_profile->getRootObject())
3162  meHFEMEtFraction_profile->Fill(numPV_, pfHFEMEtFraction);
3163  if (meHFEMEt_profile && meHFEMEt_profile->getRootObject())
3164  meHFEMEt_profile->Fill(numPV_, pfHFEMEt);
3165  }
3166 
3167  if (isMiniAODMet_) {
3168  mePhotonEtFraction = map_of_MEs[DirName + "/PfPhotonEtFraction"];
3169  meNeutralHadronEtFraction = map_of_MEs[DirName + "/PfNeutralHadronEtFraction"];
3170  meChargedHadronEtFraction = map_of_MEs[DirName + "/PfChargedHadronEtFraction"];
3171  meHFHadronEtFraction = map_of_MEs[DirName + "/PfHFHadronEtFraction"];
3172  meHFEMEtFraction = map_of_MEs[DirName + "/PfHFEMEtFraction"];
3173 
3174  if (mePhotonEtFraction && mePhotonEtFraction->getRootObject())
3175  mePhotonEtFraction->Fill(patmet->NeutralEMFraction());
3176  if (meNeutralHadronEtFraction && meNeutralHadronEtFraction->getRootObject())
3177  meNeutralHadronEtFraction->Fill(patmet->NeutralHadEtFraction());
3178  if (meChargedHadronEtFraction && meChargedHadronEtFraction->getRootObject())
3179  meChargedHadronEtFraction->Fill(patmet->ChargedHadEtFraction());
3180  if (meHFHadronEtFraction && meHFHadronEtFraction->getRootObject())
3181  meHFHadronEtFraction->Fill(patmet->Type6EtFraction()); //HFHadrons
3182  if (meHFEMEtFraction && meHFEMEtFraction->getRootObject())
3183  meHFEMEtFraction->Fill(patmet->Type7EtFraction());
3184 
3185  //NPV profiles
3186  mePhotonEtFraction_profile = map_of_MEs[DirName + "/PfPhotonEtFraction_profile"];
3187  meNeutralHadronEtFraction_profile = map_of_MEs[DirName + "/PfNeutralHadronEtFraction_profile"];
3188  meChargedHadronEtFraction_profile = map_of_MEs[DirName + "/PfChargedHadronEtFraction_profile"];
3189  meHFHadronEtFraction_profile = map_of_MEs[DirName + "/PfHFHadronEtFraction_profile"];
3190  meHFEMEtFraction_profile = map_of_MEs[DirName + "/PfHFEMEtFraction_profile"];
3191 
3192  if (mePhotonEtFraction_profile && mePhotonEtFraction_profile->getRootObject())
3193  mePhotonEtFraction_profile->Fill(numPV_, patmet->NeutralEMFraction());
3194  if (meNeutralHadronEtFraction_profile && meNeutralHadronEtFraction_profile->getRootObject())
3195  meNeutralHadronEtFraction_profile->Fill(numPV_, patmet->NeutralHadEtFraction());
3196  if (meChargedHadronEtFraction_profile && meChargedHadronEtFraction_profile->getRootObject())
3197  meChargedHadronEtFraction_profile->Fill(numPV_, patmet->ChargedHadEtFraction());
3198  if (meHFHadronEtFraction_profile && meHFHadronEtFraction_profile->getRootObject())
3199  meHFHadronEtFraction_profile->Fill(numPV_, patmet->Type6EtFraction());
3200  if (meHFEMEtFraction_profile && meHFEMEtFraction_profile->getRootObject())
3201  meHFEMEtFraction_profile->Fill(numPV_, patmet->Type7EtFraction());
3202 
3203  mePhotonEt = map_of_MEs[DirName + "/PfPhotonEt"];
3204  meNeutralHadronEt = map_of_MEs[DirName + "/PfNeutralHadronEt"];
3205  meChargedHadronEt = map_of_MEs[DirName + "/PfChargedHadronEt"];
3206  meHFHadronEt = map_of_MEs[DirName + "/PfHFHadronEt"];
3207  meHFEMEt = map_of_MEs[DirName + "/PfHFEMEt"];
3208  meMuonEt = map_of_MEs[DirName + "/PfMuonEt"];
3209  meElectronEt = map_of_MEs[DirName + "/PfElectronEt"];
3210 
3211  if (mePhotonEt && mePhotonEt->getRootObject())
3212  mePhotonEt->Fill(patmet->NeutralEMFraction() * patmet->sumEt());
3213  if (meNeutralHadronEt && meNeutralHadronEt->getRootObject())
3214  meNeutralHadronEt->Fill(patmet->NeutralHadEtFraction() * patmet->sumEt());
3215  if (meChargedHadronEt && meChargedHadronEt->getRootObject())
3216  meChargedHadronEt->Fill(patmet->ChargedHadEtFraction() * patmet->sumEt());
3217  if (meHFHadronEt && meHFHadronEt->getRootObject())
3218  meHFHadronEt->Fill(patmet->Type6EtFraction() * patmet->sumEt()); //HFHadrons
3219  if (meHFEMEt && meHFEMEt->getRootObject())
3220  meHFEMEt->Fill(patmet->Type7EtFraction() * patmet->sumEt());
3221  if (meMuonEt && meMuonEt->getRootObject())
3222  meMuonEt->Fill(patmet->MuonEtFraction() * patmet->sumEt());
3223  if (meElectronEt && meElectronEt->getRootObject())
3224  meElectronEt->Fill(patmet->ChargedEMEtFraction() * patmet->sumEt());
3225 
3226  //NPV profiles
3227  mePhotonEt_profile = map_of_MEs[DirName + "/PfPhotonEt_profile"];
3228  meNeutralHadronEt_profile = map_of_MEs[DirName + "/PfNeutralHadronEt_profile"];
3229  meChargedHadronEt_profile = map_of_MEs[DirName + "/PfChargedHadronEt_profile"];
3230  meHFHadronEt_profile = map_of_MEs[DirName + "/PfHFHadronEt_profile"];
3231  meHFEMEt_profile = map_of_MEs[DirName + "/PfHFEMEt_profile"];
3232 
3233  if (mePhotonEt_profile && mePhotonEt_profile->getRootObject())
3234  mePhotonEt_profile->Fill(numPV_, patmet->NeutralEMFraction() * patmet->sumEt());
3235  if (meNeutralHadronEt_profile && meNeutralHadronEt_profile->getRootObject())
3236  meNeutralHadronEt_profile->Fill(numPV_, patmet->NeutralHadEtFraction() * patmet->sumEt());
3237  if (meChargedHadronEt_profile && meChargedHadronEt_profile->getRootObject())
3238  meChargedHadronEt_profile->Fill(numPV_, patmet->ChargedHadEtFraction() * patmet->sumEt());
3239  if (meHFHadronEt_profile && meHFHadronEt_profile->getRootObject())
3240  meHFHadronEt_profile->Fill(numPV_, patmet->Type6EtFraction() * patmet->sumEt());
3241  if (meHFEMEt_profile && meHFEMEt_profile->getRootObject())
3242  meHFEMEt_profile->Fill(numPV_, patmet->Type7EtFraction() * patmet->sumEt());
3243  }
3244 
3245  if (isCaloMet_) {
3246  //if (bLumiSecPlot){//get from config level
3247  if (fill_met_high_level_histo) {
3248  hMExLS = map_of_MEs[DirName + "/" + "MExLS"];
3249  if (hMExLS && hMExLS->getRootObject())
3250  hMExLS->Fill(MEx, myLuminosityBlock);
3251  hMEyLS = map_of_MEs[DirName + "/" + "MEyLS"];
3252  if (hMEyLS && hMEyLS->getRootObject())
3253  hMEyLS->Fill(MEy, myLuminosityBlock);
3254  }
3255  }
3256  } //check if we only wanna do Z plots
3257 }
pat::MET::NeutralEMFraction
double NeutralEMFraction() const
Definition: MET.h:137
JetMETDQMDCSFilter
Definition: JetMETDQMDCSFilter.h:24
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::JetID
Jet ID object.
Definition: JetID.h:16
METAnalyzer::dqmBeginRun
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Initialize run-based parameters.
Definition: METAnalyzer.cc:1180
cutBasedMuonId_MuonPOG_V0_cff.globalTrack
globalTrack
Definition: cutBasedMuonId_MuonPOG_V0_cff.py:135
Handle.h
mps_fire.i
i
Definition: mps_fire.py:355
HLT_2018_cff.pt2
pt2
Definition: HLT_2018_cff.py:8552
MessageLogger.h
reco::CaloMET::emEtFraction
double emEtFraction() const
Definition: CaloMET.h:43
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::PFMET::neutralHadronEtFraction
double neutralHadronEtFraction() const
Definition: PFMET.h:34
reco::CaloMET::etFractionHadronic
double etFractionHadronic() const
Definition: CaloMET.h:41
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
L1GlobalTriggerReadoutSetupFwd.h
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
pat::MET::ChargedHadEtFraction
double ChargedHadEtFraction() const
Definition: MET.h:140
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
TrackCollections2monitor_cff.numberOfValidPixelHits
numberOfValidPixelHits
at most 999 lost hits
Definition: TrackCollections2monitor_cff.py:250
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
reco::PFMET::HFEMEt
double HFEMEt() const
Definition: PFMET.h:50
reco::PFMET::chargedHadronEt
double chargedHadronEt() const
Definition: PFMET.h:41
reco::MET::sumEt
double sumEt() const
Definition: MET.h:56
reco::CaloMET::emEtInHF
double emEtInHF() const
Definition: CaloMET.h:57
reco::PFMET::HFHadronEt
double HFHadronEt() const
Definition: PFMET.h:47
HLT_2018_cff.pt1
pt1
Definition: HLT_2018_cff.py:8550
cms::cuda::assert
assert(be >=bs)
edm::VParameterSet
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
reco::JetCorrector::correction
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:47
pat::MET::MuonEtFraction
double MuonEtFraction() const
Definition: MET.h:141
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
PFJetIDSelectionFunctor::WINTER16
Definition: PFJetIDSelectionFunctor.h:27
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::CaloMET::hadEtInHO
double hadEtInHO() const
Definition: CaloMET.h:47
findQualityFiles.v
v
Definition: findQualityFiles.py:179
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle< edm::TriggerResults >
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
pat::MET::Type6EtFraction
double Type6EtFraction() const
Definition: MET.h:142
PFJetIDSelectionFunctor
PF Jet selector for pat::Jets.
Definition: PFJetIDSelectionFunctor.h:25
reco::PFMET::photonEtFraction
double photonEtFraction() const
Definition: PFMET.h:31
edm::Ref
Definition: AssociativeIterator.h:58
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
reco::CaloMET
Definition: CaloMET.h:21
reco::PFMET::electronEt
double electronEt() const
Definition: PFMET.h:38
reco::MET
Definition: MET.h:41
ztee.fd
fd
Definition: ztee.py:136
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
CItAlgo
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
Definition: L1GtTriggerMenuFwd.h:38
METAnalyzer::METAnalyzer
METAnalyzer(const edm::ParameterSet &)
Constructor.
Definition: METAnalyzer.cc:42
dqm::legacy::MonitorElement::getRootObject
TObject * getRootObject() const override
Definition: MonitorElement.h:469
JetIDSelectionFunctor
Jet selector for pat::Jets and for CaloJets.
Definition: JetIDSelectionFunctor.h:28
PVValHelper::eta
Definition: PVValidationHelpers.h:69
pat::MET::ChargedEMEtFraction
double ChargedEMEtFraction() const
Definition: MET.h:139
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::PFMET::neutralHadronEt
double neutralHadronEt() const
Definition: PFMET.h:35
L1GtTriggerMenuRcd
Definition: L1GtTriggerMenuRcd.h:32
edm::ESHandle< L1GtTriggerMenu >
JetIDSelectionFunctor::LOOSE
Definition: JetIDSelectionFunctor.h:31
reco::PFMET::HFEMEtFraction
double HFEMEtFraction() const
Definition: PFMET.h:49
pfLinker_cff.particleFlow
particleFlow
Definition: pfLinker_cff.py:5
isolatedTracks_cfi.caloJets
caloJets
Definition: isolatedTracks_cfi.py:33
cond::persistency::search
std::vector< T >::const_iterator search(const cond::Time_t &val, const std::vector< T > &container)
Definition: IOVProxy.cc:19
electronDataDiscovery.search2
def search2()
Definition: electronDataDiscovery.py:269
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLTTauDQMOffline_cfi.Muons
Muons
Definition: HLTTauDQMOffline_cfi.py:57
EcalSubdetector.h
METAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Get the analysis.
Definition: METAnalyzer.cc:1414
edm::LogWarning
Definition: MessageLogger.h:141
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
reco::PFMET
Definition: PFMET.h:18
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
optionsL1T.menu
menu
Definition: optionsL1T.py:29
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
dqm::implementation::IBooker::UseScope
Definition: DQMStore.h:457
L1GtTriggerMenu
Definition: L1GtTriggerMenu.h:48
L1GlobalTriggerReadoutSetup.h
reco::PFMET::HFHadronEtFraction
double HFHadronEtFraction() const
Definition: PFMET.h:46
METAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Inizialize parameters for histo binning.
Definition: METAnalyzer.cc:196
GenericTriggerEventFlag
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Definition: GenericTriggerEventFlag.h:42
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
JetIDSelectionFunctor::PURE09
Definition: JetIDSelectionFunctor.h:30
reco::CaloMET::emEtInEE
double emEtInEE() const
Definition: CaloMET.h:55
HcalDetId.h
edm::get
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:669
METAnalyzer.h
pat::MET::NeutralHadEtFraction
double NeutralHadEtFraction() const
Definition: MET.h:138
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
LorentzVector.h
reco::CaloMET::hadEtInHB
double hadEtInHB() const
Definition: CaloMET.h:45
TriggerNames.h
iEvent
int iEvent
Definition: GenABIO.cc:224
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
pat::MET
Analysis-level MET class.
Definition: MET.h:40
susybsm::HSCParticleType::innerTrack
Definition: HSCParticle.h:20
METAnalyzer::fillMonitorElement
void fillMonitorElement(const edm::Event &, std::string, std::string, const reco::MET &, const pat::MET *, const reco::PFMET *, const reco::CaloMET *, const reco::Candidate::PolarLorentzVector &, std::map< std::string, MonitorElement * > &, bool, bool, std::vector< bool >, std::vector< bool >)
Definition: METAnalyzer.cc:2147
CaloTowerDetId.h
edm::EventSetup
Definition: EventSetup.h:57
reco::CaloMET::emEtInEB
double emEtInEB() const
Definition: CaloMET.h:53
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
hemisphereProducer_cfi.patJets
patJets
Definition: hemisphereProducer_cfi.py:5
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
reco::CaloMET::hadEtInHE
double hadEtInHE() const
Definition: CaloMET.h:49
muons_cfi.pfIsolationR04
pfIsolationR04
Definition: muons_cfi.py:31
METAnalyzer::bookMESet
void bookMESet(std::string, DQMStore::IBooker &, std::map< std::string, MonitorElement * > &)
Definition: METAnalyzer.cc:224
CaloTowerCollection.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
pat::strbitset
Definition: strbitset.h:23
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
PVValHelper::dxy
Definition: PVValidationHelpers.h:47
reco::PFMET::photonEt
double photonEt() const
Definition: PFMET.h:32
math
Definition: choleskyInversion.h:19
PVValHelper::dz
Definition: PVValidationHelpers.h:50
METAnalyzer::~METAnalyzer
~METAnalyzer() override
Destructor.
Definition: METAnalyzer.cc:187
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
reco::PFMET::chargedHadronEtFraction
double chargedHadronEtFraction() const
Definition: PFMET.h:40
fed_dqm_sourceclient-live_cfg.DirName
DirName
Definition: fed_dqm_sourceclient-live_cfg.py:52
edm::triggerResults
static const std::string triggerResults("TriggerResults")
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
METAnalyzer::fillMESet
void fillMESet(const edm::Event &, std::string, const reco::MET &, const pat::MET *, const reco::PFMET *, const reco::CaloMET *, const reco::Candidate::PolarLorentzVector &, std::map< std::string, MonitorElement * > &, std::vector< bool >, std::vector< bool >)
Definition: METAnalyzer.cc:2040
METAnalyzer::makeRatePlot
void makeRatePlot(std::string, double)
Definition: METAnalyzer.cc:1389
METAnalyzer::bookMonitorElement
void bookMonitorElement(std::string, DQMStore::IBooker &, std::map< std::string, MonitorElement * > &, bool, bool, bool)
Definition: METAnalyzer.cc:251
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
reco::PFMET::muonEt
double muonEt() const
Definition: PFMET.h:44
L1GlobalTriggerReadoutRecord::technicalTriggerWord
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:212
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
TechnicalTriggerWord
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
Definition: L1GlobalTriggerReadoutSetupFwd.h:41
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
pat::MET::Type7EtFraction
double Type7EtFraction() const
Definition: MET.h:143
METAnalyzer::dqmEndRun
void dqmEndRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
Finish up a run.
Definition: METAnalyzer.cc:1336
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
pfJetBenchmark_cfi.pfJets
pfJets
Definition: pfJetBenchmark_cfi.py:4
reco::CaloMET::hadEtInHF
double hadEtInHF() const
Definition: CaloMET.h:51
PFJetIDSelectionFunctor::LOOSE
Definition: PFJetIDSelectionFunctor.h:28