CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
METAnalyzer.cc
Go to the documentation of this file.
1 
20 
25 
27 
31 #include "math.h"
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  LSBegin_ = pSet.getParameter<int>("LSBegin");
49  LSEnd_ = pSet.getParameter<int>("LSEnd");
50  // Smallest track pt
51  ptMinCand_ = pSet.getParameter<double>("ptMinCand");
52 
53  // Smallest raw HCAL energy linked to the track
54  hcalMin_ = pSet.getParameter<double>("hcalMin");
55 
56  MetType_ = parameters.getUntrackedParameter<std::string>("METType");
57 
58  triggerResultsLabel_ = parameters.getParameter<edm::InputTag>("TriggerResultsLabel");
59  triggerResultsToken_= consumes<edm::TriggerResults>(edm::InputTag(triggerResultsLabel_));
60 
61  isCaloMet_ = (std::string("calo")==MetType_);
62  //isTCMet_ = (std::string("tc") ==MetType_);
63  isPFMet_ = (std::string("pf") ==MetType_);
64  isMiniAODMet_ = (std::string("miniaod") ==MetType_);
65  if(!isMiniAODMet_){
66  jetCorrectorToken_ = consumes<reco::JetCorrector>(pSet.getParameter<edm::InputTag>("JetCorrections"));
67  }
68 
69  // MET information
70  metCollectionLabel_ = parameters.getParameter<edm::InputTag>("METCollectionLabel");
71 
72  if(/*isTCMet_ || */isCaloMet_){
73  inputJetIDValueMap = pSet.getParameter<edm::InputTag>("InputJetIDValueMap");
74  jetID_ValueMapToken_= consumes< edm::ValueMap<reco::JetID> >(inputJetIDValueMap);
76  }
77  if(isPFMet_ || isMiniAODMet_){
78  pflowToken_ = consumes<std::vector<reco::PFCandidate> >(pSet.getParameter<edm::InputTag>("srcPFlow"));
80  }
81  ptThreshold_ = parameters.getParameter<double>("ptThreshold");
82 
83 
84  if(isPFMet_){
85  pfMetToken_= consumes<reco::PFMETCollection>(edm::InputTag(metCollectionLabel_));
86  }
87  if(isCaloMet_){
88  caloMetToken_= consumes<reco::CaloMETCollection>(edm::InputTag(metCollectionLabel_));
89  }
90  if(isMiniAODMet_){
91  patMetToken_= consumes<pat::METCollection>(edm::InputTag(metCollectionLabel_));
92  }
93  //if(isTCMet_){
94  // tcMetToken_= consumes<reco::METCollection>(edm::InputTag(metCollectionLabel_));
95  //}
96 
97  fill_met_high_level_histo = parameters.getParameter<bool>("fillMetHighLevel");
98  fillCandidateMap_histos = parameters.getParameter<bool>("fillCandidateMaps");
99 
100  hTriggerLabelsIsSet_ = false;
101  //jet cleanup parameters
102  cleaningParameters_ = pSet.getParameter<ParameterSet>("CleaningParameters");
103 
104  diagnosticsParameters_ = pSet.getParameter<std::vector<edm::ParameterSet> >("METDiagonisticsParameters");
105 
106  edm::ConsumesCollector iC = consumesCollector();
107  //DCS
108  DCSFilter_ = new JetMETDQMDCSFilter(parameters.getParameter<ParameterSet>("DCSFilter"), iC );
109 
110  //Vertex requirements
111  bypassAllPVChecks_ = cleaningParameters_.getParameter<bool>("bypassAllPVChecks");
112  bypassAllDCSChecks_ = cleaningParameters_.getParameter<bool>("bypassAllDCSChecks");
113  runcosmics_ = parameters.getUntrackedParameter<bool>("runcosmics");
114  onlyCleaned_ = parameters.getUntrackedParameter<bool>("onlyCleaned");
115  vertexTag_ = cleaningParameters_.getParameter<edm::InputTag>("vertexCollection");
116  vertexToken_ = consumes<std::vector<reco::Vertex> >(edm::InputTag(vertexTag_));
117 
118  //Trigger parameters
119  gtTag_ = cleaningParameters_.getParameter<edm::InputTag>("gtLabel");
120  gtToken_= consumes<L1GlobalTriggerReadoutRecord>(edm::InputTag(gtTag_));
121 
122  // Other data collections
123  jetCollectionLabel_ = parameters.getParameter<edm::InputTag>("JetCollectionLabel");
124  if (isCaloMet_) caloJetsToken_ = consumes<reco::CaloJetCollection>(jetCollectionLabel_);
125  //if (isTCMet_) jptJetsToken_ = consumes<reco::JPTJetCollection>(jetCollectionLabel_);
126  if (isPFMet_) pfJetsToken_ = consumes<reco::PFJetCollection>(jetCollectionLabel_);
127  if (isMiniAODMet_) patJetsToken_ = consumes<pat::JetCollection>(jetCollectionLabel_);
128 
129  hbheNoiseFilterResultTag_ = parameters.getParameter<edm::InputTag>("HBHENoiseFilterResultLabel");
130  hbheNoiseFilterResultToken_=consumes<bool>(hbheNoiseFilterResultTag_);
131 
132  //
133  nbinsPV_ = parameters.getParameter<int>("pVBin");
134  nPVMin_ = parameters.getParameter<double>("pVMin");
135  nPVMax_ = parameters.getParameter<double>("pVMax");
136 
137  triggerSelectedSubFolders_ = parameters.getParameter<edm::VParameterSet>("triggerSelectedSubFolders");
138  for (edm::VParameterSet::const_iterator it = triggerSelectedSubFolders_.begin(); it!= triggerSelectedSubFolders_.end(); it++) {
139  triggerFolderEventFlag_.push_back(new GenericTriggerEventFlag( *it, consumesCollector() ));
140  triggerFolderExpr_.push_back(it->getParameter<std::vector<std::string> >("hltPaths"));
141  triggerFolderLabels_.push_back(it->getParameter<std::string>("label"));
142  }
143 
144  cleaningParameters_ = parameters.getParameter<ParameterSet>("CleaningParameters");
145 
146  verbose_ = parameters.getParameter<int>("verbose");
147 
148  FolderName_ = parameters.getUntrackedParameter<std::string>("FolderName");
149 
150  nCh = std::vector<unsigned int>(10,static_cast<unsigned int>(0));
151  nEv = std::vector<unsigned int>(2,static_cast<unsigned int>(0));
152 
153 }
154 
155 // ***********************************************************
157  for (std::vector<GenericTriggerEventFlag *>::const_iterator it = triggerFolderEventFlag_.begin(); it!= triggerFolderEventFlag_.end(); it++) {
158  delete *it;
159  }
160  delete DCSFilter_;
161 }
162 
163 
165  edm::Run const & iRun,
166  edm::EventSetup const &) {
167  std::string DirName = FolderName_+metCollectionLabel_.label();
168  ibooker.setCurrentFolder(DirName);
169 
170  if(!folderNames_.empty()){
171  folderNames_.clear();
172  }
173  if(runcosmics_){
174  folderNames_.push_back("Uncleaned");
175  }else{
176  if(!onlyCleaned_){
177  folderNames_.push_back("Uncleaned");
178  }
179  folderNames_.push_back("Cleaned");
180  folderNames_.push_back("DiJet");
181  }
182  for (std::vector<std::string>::const_iterator ic = folderNames_.begin();
183  ic != folderNames_.end(); ic++){
184  bookMESet(DirName+"/"+*ic, ibooker,map_dijet_MEs);
185  }
186 }
187 
188 
189 // ***********************************************************
190 void METAnalyzer::bookMESet(std::string DirName, DQMStore::IBooker & ibooker, std::map<std::string,MonitorElement*>& map_of_MEs)
191 {
192  bool bLumiSecPlot=fill_met_high_level_histo;
193  //bool inTriggerPathPlots=false;
194  bool fillPFCandidatePlots=false;
195 
196 
197  if (DirName.find("Cleaned")!=std::string::npos) {
198  fillPFCandidatePlots=true;
199  bookMonitorElement(DirName,ibooker,map_of_MEs,bLumiSecPlot,fillPFCandidatePlots);
200  for (unsigned int i = 0; i<triggerFolderEventFlag_.size(); i++) {
201  fillPFCandidatePlots=false;
202  if (triggerFolderEventFlag_[i]->on()) {
203  bookMonitorElement(DirName+"/"+triggerFolderLabels_[i],ibooker,map_of_MEs,bLumiSecPlot,fillPFCandidatePlots);
204  }
205  }
206  }else{
207  bookMonitorElement(DirName,ibooker,map_of_MEs,bLumiSecPlot,fillPFCandidatePlots);
208  }
209 }
210 
211 // ***********************************************************
212 void METAnalyzer::bookMonitorElement(std::string DirName,DQMStore::IBooker & ibooker, std::map<std::string,MonitorElement*>& map_of_MEs, bool bLumiSecPlot=false, bool fillPFCandPlots=false)
213 {
214  if (verbose_) std::cout << "bookMonitorElement " << DirName << std::endl;
215 
216  ibooker.setCurrentFolder(DirName);
217 
218  hTrigger = ibooker.book1D("triggerResults", "triggerResults", 500, 0, 500);
219  for (unsigned int i = 0; i<allTriggerNames_.size();i++){
220  if(i<(unsigned int)hTrigger->getNbinsX()){
221  if (!hTriggerLabelsIsSet_) {
222  hTrigger->setBinLabel(i+1, allTriggerNames_[i]);
223  }
224  }
225  }
226  if (!hTriggerLabelsIsSet_) for (int i = allTriggerNames_.size(); i<hTrigger->getNbinsX();i++){
227  hTrigger->setBinLabel(i+1, "");
228  }
229  hTriggerLabelsIsSet_ = true;
230 
231  hMEx = ibooker.book1D("MEx", "MEx", 200, -500, 500);
232  hMEy = ibooker.book1D("MEy", "MEy", 200, -500, 500);
233  hMET = ibooker.book1D("MET", "MET", 200, 0, 1000);
234  hSumET = ibooker.book1D("SumET", "SumET", 400, 0, 4000);
235  hMETSig = ibooker.book1D("METSig", "METSig", 51, 0, 51);
236  hMETPhi = ibooker.book1D("METPhi", "METPhi", 60, -M_PI, M_PI);
237  hMET_logx = ibooker.book1D("MET_logx", "MET_logx", 40, -1, 7);
238  hSumET_logx = ibooker.book1D("SumET_logx", "SumET_logx", 40, -1, 7);
239 
240  hMEx ->setAxisTitle("MEx [GeV]", 1);
241  hMEy ->setAxisTitle("MEy [GeV]", 1);
242  hMET ->setAxisTitle("MET [GeV]", 1);
243  hSumET ->setAxisTitle("SumET [GeV]", 1);
244  hMETSig ->setAxisTitle("METSig", 1);
245  hMETPhi ->setAxisTitle("METPhi [rad]", 1);
246  hMET_logx ->setAxisTitle("log(MET) [GeV]", 1);
247  hSumET_logx->setAxisTitle("log(SumET) [GeV]", 1);
248 
249  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"triggerResults",hTrigger));
250  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MEx",hMEx));
251  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MEy",hMEy));
252  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MET",hMET));
253  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SumET",hSumET));
254  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METSig",hMETSig));
255  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhi",hMETPhi));
256  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MET_logx",hMET_logx));
257  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SumET_logx",hSumET_logx));
258 
259  // Book NPV profiles --> would some of these profiles be interesting for other MET types too
260  //----------------------------------------------------------------------------
261  meMEx_profile = ibooker.bookProfile("MEx_profile", "met.px()", nbinsPV_, nPVMin_, nPVMax_, 200, -500, 500);
262  meMEy_profile = ibooker.bookProfile("MEy_profile", "met.py()", nbinsPV_, nPVMin_, nPVMax_, 200, -500, 500);
263  meMET_profile = ibooker.bookProfile("MET_profile", "met.pt()", nbinsPV_, nPVMin_, nPVMax_, 200, 0, 1000);
264  meSumET_profile = ibooker.bookProfile("SumET_profile", "met.sumEt()", nbinsPV_, nPVMin_, nPVMax_, 400, 0, 4000);
265  // Set NPV profiles x-axis title
266  //----------------------------------------------------------------------------
267  meMEx_profile ->setAxisTitle("nvtx", 1);
268  meMEy_profile ->setAxisTitle("nvtx", 1);
269  meMET_profile ->setAxisTitle("nvtx", 1);
270  meSumET_profile->setAxisTitle("nvtx", 1);
271 
272  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MEx_profile",meMEx_profile));
273  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MEy_profile",meMEy_profile));
274  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MET_profile",meMET_profile));
275  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SumET_profile",meSumET_profile));
276 
277 
278  if(isCaloMet_){
279  hCaloHadEtInHB = ibooker.book1D("CaloHadEtInHB","CaloHadEtInHB",100,0,2000);
280  hCaloHadEtInHB->setAxisTitle("Had Et [GeV]",1);
281  hCaloHadEtInHO = ibooker.book1D("CaloHadEtInHO","CaloHadEtInHO",25,0,500);
282  hCaloHadEtInHO->setAxisTitle("Had Et [GeV]",1);
283  hCaloHadEtInHE = ibooker.book1D("CaloHadEtInHE","CaloHadEtInHE",100,0,2000);
284  hCaloHadEtInHE->setAxisTitle("Had Et [GeV]",1);
285  hCaloHadEtInHF = ibooker.book1D("CaloHadEtInHF","CaloHadEtInHF",50,0,1000);
286  hCaloHadEtInHF->setAxisTitle("Had Et [GeV]",1);
287  hCaloEmEtInHF = ibooker.book1D("CaloEmEtInHF" ,"CaloEmEtInHF" ,25,0,500);
288  hCaloEmEtInHF->setAxisTitle("EM Et [GeV]",1);
289  hCaloEmEtInEE = ibooker.book1D("CaloEmEtInEE" ,"CaloEmEtInEE" ,50,0,1000);
290  hCaloEmEtInEE->setAxisTitle("EM Et [GeV]",1);
291  hCaloEmEtInEB = ibooker.book1D("CaloEmEtInEB" ,"CaloEmEtInEB" ,100,0,2000);
292  hCaloEmEtInEB->setAxisTitle("EM Et [GeV]",1);
293 
294  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloHadEtInHO",hCaloHadEtInHO));
295  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloHadEtInHF",hCaloHadEtInHF));
296  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloHadEtInHE",hCaloHadEtInHE));
297  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloHadEtInHB",hCaloHadEtInHB));
298  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloEmEtInHF",hCaloEmEtInHF));
299  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloEmEtInEE",hCaloEmEtInEE));
300  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloEmEtInEB",hCaloEmEtInEB));
301 
302  hCaloMETPhi020 = ibooker.book1D("CaloMETPhi020", "CaloMETPhi020", 60, -M_PI, M_PI);
303  hCaloMETPhi020 ->setAxisTitle("METPhi [rad] (MET>20 GeV)", 1);
304 
305  hCaloEtFractionHadronic = ibooker.book1D("CaloEtFractionHadronic","CaloEtFractionHadronic",100,0,1);
306  hCaloEtFractionHadronic->setAxisTitle("Hadronic Et Fraction",1);
307  hCaloEmEtFraction = ibooker.book1D("CaloEmEtFraction", "CaloEmEtFraction" ,100,0,1);
308  hCaloEmEtFraction->setAxisTitle("EM Et Fraction",1);
309 
310  hCaloEmEtFraction020 = ibooker.book1D("CaloEmEtFraction020", "CaloEmEtFraction020" ,100,0,1);
311  hCaloEmEtFraction020->setAxisTitle("EM Et Fraction (MET>20 GeV)",1);
312 
313  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloMETPhi020",hCaloMETPhi020));
314  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloEtFractionHadronic",hCaloEtFractionHadronic));
315  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloEmEtFraction", hCaloEmEtFraction));
316  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CaloEmEtFraction020",hCaloEmEtFraction020));
317 
318  }
319 
320  if(isPFMet_){
321  if(fillPFCandPlots && 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
322  //histos where two previous bunches were empty/filled
323  mePhotonEtFraction_BXm2BXm1Empty = ibooker.book1D("PfPhotonEtFraction_BXm2BXm1Empty", "pfmet.photonEtFraction() prev empty 2 bunches", 50, 0, 1);
324  mePhotonEtFraction_BXm1Bxm2Filled = ibooker.book1D("PfPhotonEtFraction_BXm2BXm1Filled", "pfmet.photonEtFraction() prev filled 2 bunches", 50, 0, 1);
325  meNeutralHadronEtFraction_BXm2BXm1Empty = ibooker.book1D("PfNeutralHadronEtFraction_BXm2BXm1Empty", "pfmet.neutralHadronEtFraction() prev empty 2 bunches", 50, 0, 1);
326  meNeutralHadronEtFraction_BXm1Bxm2Filled = ibooker.book1D("PfNeutralHadronEtFraction_BXm2BXm1Filled", "pfmet.neutralHadronEtFraction() prev filled 2 bunches", 50, 0, 1);
327  meChargedHadronEtFraction_BXm2BXm1Empty = ibooker.book1D("PfChargedHadronEtFraction_BXm2BXm1Empty", "pfmet.chargedHadronEtFraction() prev empty 2 bunches", 50, 0, 1);
328  meChargedHadronEtFraction_BXm1Bxm2Filled = ibooker.book1D("PfChargedHadronEtFraction_BXm2BXm1Filled", "pfmet.chargedHadronEtFraction() prev filled 2 bunches", 50, 0, 1);
329  meMET_BXm2BXm1Empty = ibooker.book1D("MET_BXm2BXm1Empty", "MET prev empty 2 bunches", 200, 0, 1000);
330  meMET_BXm1Bxm2Filled = ibooker.book1D("MET_BXm2BXm1Filled", "MET prev filled 2 bunches", 200, 0, 1000);
331  meSumET_BXm2BXm1Empty = ibooker.book1D("SumET_BXm2BXm1Empty", "SumET prev empty 2 bunches", 400, 0, 4000);
332  meSumET_BXm1Bxm2Filled = ibooker.book1D("SumET_BXm2BXm1Filled", "SumET prev filled 2 bunches", 400, 0, 4000);
333 
334  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFraction_BXm2BXm1Empty" ,mePhotonEtFraction_BXm2BXm1Empty));
335  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFraction_BXm2BXm1Filled" ,mePhotonEtFraction_BXm1Bxm2Filled));
336  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFraction_BXm2BXm1Empty" ,meNeutralHadronEtFraction_BXm2BXm1Empty));
337  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralEtFraction_BXm2BXm1Filled" ,meNeutralHadronEtFraction_BXm1Bxm2Filled));
338  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFraction_BXm2BXm1Empty" ,meChargedHadronEtFraction_BXm2BXm1Empty));
339  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedEtFraction_BXm2BXm1Filled" ,meChargedHadronEtFraction_BXm1Bxm2Filled));
340  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MET_BXm2BXm1Empty" ,meMET_BXm2BXm1Empty));
341  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MET_BXm2BXm1Filled" ,meMET_BXm1Bxm2Filled));
342  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SumET_BXm2BXm1Empty" ,meSumET_BXm2BXm1Empty));
343  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SumET_BXm2BXm1Filled",meSumET_BXm1Bxm2Filled));
344 
345  meCHF_Barrel = ibooker.book1D("PfChargedHadronEtFractionBarrel", "chargedHadronEtFractionBarrel", 50, 0, 1);
346  meCHF_EndcapPlus = ibooker.book1D("PfChargedHadronEtFractionEndcapPlus", "chargedHadronEtFractionEndcapPlus", 50, 0, 1);
347  meCHF_EndcapMinus = ibooker.book1D("PfChargedHadronEtFractionEndcapMinus", "chargedHadronEtFractionEndcapMinus", 50, 0, 1);
348  meCHF_Barrel_BXm1Empty = ibooker.book1D("PfChargedHadronEtFractionBarrel_BXm1Empty", "chargedHadronEtFractionBarrel prev empty bunch", 50, 0, 1);
349  meCHF_EndcapPlus_BXm1Empty = ibooker.book1D("PfChargedHadronEtFractionEndcapPlus_BXm1Empty", "chargedHadronEtFractionEndcapPlus prev empty bunch", 50, 0, 1);
350  meCHF_EndcapMinus_BXm1Empty = ibooker.book1D("PfChargedHadronEtFractionEndcapMinus_BXm1Empty", "chargedHadronEtFractionEndcapMinus prev empty bunch", 50, 0, 1);
351  meCHF_Barrel_BXm1BXm2Empty = ibooker.book1D("PfChargedHadronEtFractionBarrel_BXm1BXm2Empty", "chargedHadronEtFractionBarrel prev empty 2 bunches", 50, 0, 1);
352  meCHF_EndcapPlus_BXm1BXm2Empty = ibooker.book1D("PfChargedHadronEtFractionEndcapPlus_BXm1BXm2Empty", "chargedHadronEtFractionEndcapPlus prev empty 2 bunches", 50, 0, 1);
353  meCHF_EndcapMinus_BXm1BXm2Empty = ibooker.book1D("PfChargedHadronEtFractionEndcapMinus_BXm1BXm2Empty", "chargedHadronEtFractionEndcapMinus prev empty 2 bunches", 50, 0, 1);
354  meCHF_Barrel_BXm1Filled = ibooker.book1D("PfChargedHadronEtFractionBarrel_BXm1Filled", "chargedHadronEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
355  meCHF_EndcapPlus_BXm1Filled = ibooker.book1D("PfChargedHadronEtFractionEndcapPlus_BXm1Filled", "chargedHadronEtFractionEndcapPlus prev filled bunch", 50, 0, 1);
356  meCHF_EndcapMinus_BXm1Filled = ibooker.book1D("PfChargedHadronEtFractionEndcapMinus_BXm1Filled", "chargedHadronEtFractionEndcapMinus prev filled bunch", 50, 0, 1);
357  meCHF_Barrel_BXm1BXm2Filled = ibooker.book1D("PfChargedHadronEtFractionBarrel_BXm1BXm2Filled", "chargedHadronEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
358  meCHF_EndcapPlus_BXm1BXm2Filled = ibooker.book1D("PfChargedHadronEtFractionEndcapPlus_BXm1BXm2Filled", "chargedHadronEtFractionEndcapPlus prev filled 2 bunches", 50, 0, 1);
359  meCHF_EndcapMinus_BXm1BXm2Filled = ibooker.book1D("PfChargedHadronEtFractionEndcapMinus_BXm1BXm2Filled", "chargedHadronEtFractionEndcapMinus prev filled 2 bunches", 50, 0, 1);
360 
361  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionBarrel", meCHF_Barrel));
362  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapPlus", meCHF_EndcapPlus));
363  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapMinus", meCHF_EndcapMinus));
364  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm1Empty", meCHF_Barrel_BXm1Empty));
365  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm1Empty", meCHF_EndcapPlus_BXm1Empty));
366  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm1Empty", meCHF_EndcapMinus_BXm1Empty));
367  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm1BXm2Empty", meCHF_Barrel_BXm1BXm2Empty));
368  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm1BXm2Empty", meCHF_EndcapPlus_BXm1BXm2Empty));
369  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm1BXm2Empty", meCHF_EndcapMinus_BXm1BXm2Empty));
370  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm1Filled", meCHF_Barrel_BXm1Filled));
371  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm1Filled", meCHF_EndcapPlus_BXm1Filled));
372  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm1Filled", meCHF_EndcapMinus_BXm1Filled));
373  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm1BXm2Filled", meCHF_Barrel_BXm1BXm2Filled));
374  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm1BXm2Filled", meCHF_EndcapPlus_BXm1BXm2Filled));
375  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm1BXm2Filled", meCHF_EndcapMinus_BXm1BXm2Filled));
376 
377  meNHF_Barrel = ibooker.book1D("PfNeutralHadronEtFractionBarrel", "neutralHadronEtFractionBarrel", 50, 0, 1);
378  meNHF_EndcapPlus = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus", "neutralHadronEtFractionEndcapPlus", 50, 0, 1);
379  meNHF_EndcapMinus = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus", "neutralHadronEtFractionEndcapMinus", 50, 0, 1);
380  meNHF_Barrel_BXm1Empty = ibooker.book1D("PfNeutralHadronEtFractionBarrel_BXm1Empty", "neutralHadronEtFractionBarrel prev empty bunch", 50, 0, 1);
381  meNHF_EndcapPlus_BXm1Empty = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus_BXm1Empty", "neutralHadronEtFractionEndcapPlus prev empty bunch", 50, 0, 1);
382  meNHF_EndcapMinus_BXm1Empty = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus_BXm1Empty", "neutralHadronEtFractionEndcapMinus prev empty bunch", 50, 0, 1);
383  meNHF_Barrel_BXm1BXm2Empty = ibooker.book1D("PfNeutralHadronEtFractionBarrel_BXm1BXm2Empty", "neutralHadronEtFractionBarrel prev empty 2 bunches", 50, 0, 1);
384  meNHF_EndcapPlus_BXm1BXm2Empty = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus_BXm1BXm2Empty", "neutralHadronEtFractionEndcapPlus prev empty 2 bunches", 50, 0, 1);
385  meNHF_EndcapMinus_BXm1BXm2Empty = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus_BXm1BXm2Empty", "neutralHadronEtFractionEndcapMinus prev empty 2 bunches", 50, 0, 1);
386  meNHF_Barrel_BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionBarrel_BXm1Filled", "neutralHadronEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
387  meNHF_EndcapPlus_BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus_BXm1Filled", "neutralHadronEtFractionEndcapPlus prev filled bunch", 50, 0, 1);
388  meNHF_EndcapMinus_BXm1Filled = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus_BXm1Filled", "neutralHadronEtFractionEndcapMinus prev filled bunch", 50, 0, 1);
389  meNHF_Barrel_BXm1BXm2Filled = ibooker.book1D("PfNeutralHadronEtFractionBarrel_BXm1BXm2Filled", "neutralHadronEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
390  meNHF_EndcapPlus_BXm1BXm2Filled = ibooker.book1D("PfNeutralHadronEtFractionEndcapPlus_BXm1BXm2Filled", "neutralHadronEtFractionEndcapPlus prev filled 2 bunches", 50, 0, 1);
391  meNHF_EndcapMinus_BXm1BXm2Filled = ibooker.book1D("PfNeutralHadronEtFractionEndcapMinus_BXm1BXm2Filled", "neutralHadronEtFractionEndcapMinus prev filled 2 bunches", 50, 0, 1);
392 
393  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionBarrel", meNHF_Barrel));
394  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus", meNHF_EndcapPlus));
395  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus", meNHF_EndcapMinus));
396  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm1Empty", meNHF_Barrel_BXm1Empty));
397  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm1Empty", meNHF_EndcapPlus_BXm1Empty));
398  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm1Empty", meNHF_EndcapMinus_BXm1Empty));
399  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm1BXm2Empty", meNHF_Barrel_BXm1BXm2Empty));
400  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm1BXm2Empty", meNHF_EndcapPlus_BXm1BXm2Empty));
401  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm1BXm2Empty", meNHF_EndcapMinus_BXm1BXm2Empty));
402  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm1Filled", meNHF_Barrel_BXm1Filled));
403  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm1Filled", meNHF_EndcapPlus_BXm1Filled));
404  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm1Filled", meNHF_EndcapMinus_BXm1Filled));
405  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm1BXm2Filled", meNHF_Barrel_BXm1BXm2Filled));
406  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm1BXm2Filled", meNHF_EndcapPlus_BXm1BXm2Filled));
407  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm1BXm2Filled", meNHF_EndcapMinus_BXm1BXm2Filled));
408 
409  mePhF_Barrel = ibooker.book1D("PfPhotonEtFractionBarrel", "photonEtFractionBarrel", 50, 0, 1);
410  mePhF_EndcapPlus = ibooker.book1D("PfPhotonEtFractionEndcapPlus", "photonEtFractionEndcapPlus", 50, 0, 1);
411  mePhF_EndcapMinus = ibooker.book1D("PfPhotonEtFractionEndcapMinus", "photonEtFractionEndcapMinus", 50, 0, 1);
412  mePhF_Barrel_BXm1Empty = ibooker.book1D("PfPhotonEtFractionBarrel_BXm1Empty", "photonEtFractionBarrel prev empty bunch", 50, 0, 1);
413  mePhF_EndcapPlus_BXm1Empty = ibooker.book1D("PfPhotonEtFractionEndcapPlus_BXm1Empty", "photonEtFractionEndcapPlus prev empty bunch", 50, 0, 1);
414  mePhF_EndcapMinus_BXm1Empty = ibooker.book1D("PfPhotonEtFractionEndcapMinus_BXm1Empty", "photonEtFractionEndcapMinus prev empty bunch", 50, 0, 1);
415  mePhF_Barrel_BXm1BXm2Empty = ibooker.book1D("PfPhotonEtFractionBarrel_BXm1BXm2Empty", "photonEtFractionBarrel prev empty 2 bunches", 50, 0, 1);
416  mePhF_EndcapPlus_BXm1BXm2Empty = ibooker.book1D("PfPhotonEtFractionEndcapPlus_BXm1BXm2Empty", "photonEtFractionEndcapPlus prev empty 2 bunches", 50, 0, 1);
417  mePhF_EndcapMinus_BXm1BXm2Empty = ibooker.book1D("PfPhotonEtFractionEndcapMinus_BXm1BXm2Empty", "photonEtFractionEndcapMinus prev empty 2 bunches", 50, 0, 1);
418  mePhF_Barrel_BXm1Filled = ibooker.book1D("PfPhotonEtFractionBarrel_BXm1Filled", "photonEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
419  mePhF_EndcapPlus_BXm1Filled = ibooker.book1D("PfPhotonEtFractionEndcapPlus_BXm1Filled", "photonEtFractionEndcapPlus prev filled bunch", 50, 0, 1);
420  mePhF_EndcapMinus_BXm1Filled = ibooker.book1D("PfPhotonEtFractionEndcapMinus_BXm1Filled", "photonEtFractionEndcapMinus prev filled bunch", 50, 0, 1);
421  mePhF_Barrel_BXm1BXm2Filled = ibooker.book1D("PfPhotonEtFractionBarrel_BXm1BXm2Filled", "photonEtFractionBarrel prev filled 2 bunches", 50, 0, 1);
422  mePhF_EndcapPlus_BXm1BXm2Filled = ibooker.book1D("PfPhotonEtFractionEndcapPlus_BXm1BXm2Filled", "photonEtFractionEndcapPlus prev filled 2 bunches", 50, 0, 1);
423  mePhF_EndcapMinus_BXm1BXm2Filled = ibooker.book1D("PfPhotonEtFractionEndcapMinus_BXm1BXm2Filled", "photonEtFractionEndcapMinus prev filled 2 bunches", 50, 0, 1);
424 
425  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionBarrel", mePhF_Barrel));
426  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapPlus", mePhF_EndcapPlus));
427  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapMinus", mePhF_EndcapMinus));
428  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionBarrel_BXm1Empty", mePhF_Barrel_BXm1Empty));
429  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm1Empty", mePhF_EndcapPlus_BXm1Empty));
430  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm1Empty", mePhF_EndcapMinus_BXm1Empty));
431  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionBarrel_BXm1BXm2Empty", mePhF_Barrel_BXm1BXm2Empty));
432  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm1BXm2Empty", mePhF_EndcapPlus_BXm1BXm2Empty));
433  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm1BXm2Empty", mePhF_EndcapMinus_BXm1BXm2Empty));
434  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionBarrel_BXm1Filled", mePhF_Barrel_BXm1Filled));
435  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm1Filled", mePhF_EndcapPlus_BXm1Filled));
436  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm1Filled", mePhF_EndcapMinus_BXm1Filled));
437  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionBarrel_BXm1BXm2Filled", mePhF_Barrel_BXm1BXm2Filled));
438  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm1BXm2Filled", mePhF_EndcapPlus_BXm1BXm2Filled));
439  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm1BXm2Filled", mePhF_EndcapMinus_BXm1BXm2Filled));
440 
441  meHFHadF_Plus = ibooker.book1D("PfHFHadronEtFractionPlus", "HFHadronEtFractionPlus", 50, 0, 1);
442  meHFHadF_Minus = ibooker.book1D("PfHFHadronEtFractionMinus", "HFHadronEtFractionMinus", 50, 0, 1);
443  meHFHadF_Plus_BXm1Empty = ibooker.book1D("PfHFHadronEtFractionPlus_BXm1Empty", "HFHadronEtFractionPlus prev empty bunch", 50, 0, 1);
444  meHFHadF_Minus_BXm1Empty = ibooker.book1D("PfHFHadronEtFractionMinus_BXm1Empty", "HFHadronEtFractionMinus prev empty bunch", 50, 0, 1);
445  meHFHadF_Plus_BXm1BXm2Empty = ibooker.book1D("PfHFHadronEtFractionPlus_BXm1BXm2Empty", "HFHadronEtFractionPlus prev empty 2 bunches", 50, 0, 1);
446  meHFHadF_Minus_BXm1BXm2Empty = ibooker.book1D("PfHFHadronEtFractionMinus_BXm1BXm2Empty", "HFHadronEtFractionMinus prev empty 2 bunches", 50, 0, 1);
447  meHFHadF_Plus_BXm1Filled = ibooker.book1D("PfHFHadronEtFractionPlus_BXm1Filled", "HFHadronEtFractionPlus prev filled bunch", 50, 0, 1);
448  meHFHadF_Minus_BXm1Filled = ibooker.book1D("PfHFHadronEtFractionMinus_BXm1Filled", "HFHadronEtFractionMinus prev filled bunch", 50, 0, 1);
449  meHFHadF_Plus_BXm1BXm2Filled = ibooker.book1D("PfHFHadronEtFractionPlus_BXm1BXm2Filled", "HFHadronEtFractionPlus prev filled 2 bunches", 50, 0, 1);
450  meHFHadF_Minus_BXm1BXm2Filled = ibooker.book1D("PfHFHadronEtFractionMinus_BXm1BXm2Filled", "HFHadronEtFractionMinus prev filled 2 bunches", 50, 0, 1);
451 
452  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionPlus", meHFHadF_Plus));
453  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionMinus", meHFHadF_Minus));
454  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionPlus_BXm1Empty", meHFHadF_Plus_BXm1Empty));
455  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionMinus_BXm1Empty", meHFHadF_Minus_BXm1Empty));
456  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionPlus_BXm1BXm2Empty", meHFHadF_Plus_BXm1BXm2Empty));
457  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionMinus_BXm1BXm2Empty", meHFHadF_Minus_BXm1BXm2Empty));
458  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionPlus_BXm1Filled", meHFHadF_Plus_BXm1Filled));
459  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionMinus_BXm1Filled", meHFHadF_Minus_BXm1Filled));
460  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionPlus_BXm1BXm2Filled", meHFHadF_Plus_BXm1BXm2Filled));
461  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFractionMinus_BXm1BXm2Filled", meHFHadF_Minus_BXm1BXm2Filled));
462 
463  meHFEMF_Plus = ibooker.book1D("PfHFEMEtFractionPlus", "HFEMEtFractionPlus", 50, 0, 1);
464  meHFEMF_Minus = ibooker.book1D("PfHFEMEtFractionMinus", "HFEMEtFractionMinus", 50, 0, 1);
465  meHFEMF_Plus_BXm1Empty = ibooker.book1D("PfHFEMEtFractionPlus_BXm1Empty", "HFEMEtFractionPlus prev empty bunch", 50, 0, 1);
466  meHFEMF_Minus_BXm1Empty = ibooker.book1D("PfHFEMEtFractionMinus_BXm1Empty", "HFEMEtFractionMinus prev empty bunch", 50, 0, 1);
467  meHFEMF_Plus_BXm1BXm2Empty = ibooker.book1D("PfHFEMEtFractionPlus_BXm1BXm2Empty", "HFEMEtFractionPlus prev empty 2 bunches", 50, 0, 1);
468  meHFEMF_Minus_BXm1BXm2Empty = ibooker.book1D("PfHFEMEtFractionMinus_BXm1BXm2Empty", "HFEMEtFractionMinus prev empty 2 bunches", 50, 0, 1);
469  meHFEMF_Plus_BXm1Filled = ibooker.book1D("PfHFEMEtFractionPlus_BXm1Filled", "HFEMEtFractionPlus prev filled bunch", 50, 0, 1);
470  meHFEMF_Minus_BXm1Filled = ibooker.book1D("PfHFEMEtFractionMinus_BXm1Filled", "HFEMEtFractionMinus prev filled bunch", 50, 0, 1);
471  meHFEMF_Plus_BXm1BXm2Filled = ibooker.book1D("PfHFEMEtFractionPlus_BXm1BXm2Filled", "HFEMEtFractionPlus prev filled 2 bunches", 50, 0, 1);
472  meHFEMF_Minus_BXm1BXm2Filled = ibooker.book1D("PfHFEMEtFractionMinus_BXm1BXm2Filled", "HFEMEtFractionMinus prev filled 2 bunches", 50, 0, 1);
473 
474  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionPlus", meHFEMF_Plus));
475  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionMinus", meHFEMF_Minus));
476  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionPlus_BXm1Empty", meHFEMF_Plus_BXm1Empty));
477  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionMinus_BXm1Empty", meHFEMF_Minus_BXm1Empty));
478  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionPlus_BXm1BXm2Empty", meHFEMF_Plus_BXm1BXm2Empty));
479  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionMinus_BXm1BXm2Empty", meHFEMF_Minus_BXm1BXm2Empty));
480  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionPlus_BXm1Filled", meHFEMF_Plus_BXm1Filled));
481  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionMinus_BXm1Filled", meHFEMF_Minus_BXm1Filled));
482  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionPlus_BXm1BXm2Filled", meHFEMF_Plus_BXm1BXm2Filled));
483  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFractionMinus_BXm1BXm2Filled", meHFEMF_Minus_BXm1BXm2Filled));
484 
485  meMETPhiChargedHadronsBarrel_BXm1Bxm2Filled = ibooker.book1D("METPhiChargedHadronsBarrel_BXm2BXm1Filled", "METPhi_PFChargedHadronsBarrel prev two bunches filled", 50, -M_PI,M_PI);
486  meMETPhiChargedHadronsEndcapPlus_BXm1Bxm2Filled = ibooker.book1D("METPhiChargedHadronsEndcapPlus_BXm2BXm1Filled", "METPhi_PFChargedHadronsEndcapPlus prev two bunches filled", 50, -M_PI,M_PI);
487  meMETPhiChargedHadronsEndcapMinus_BXm1Bxm2Filled = ibooker.book1D("METPhiChargedHadronsEndcapMinus_BXm2BXm1Filled","METPhi_PFChargedHadronsEndcapMinus prev two bunches filled", 50, -M_PI,M_PI);
488  meMETPhiNeutralHadronsBarrel_BXm1Bxm2Filled = ibooker.book1D("METPhiNeutralHadronsBarrel_BXm2BXm1Filled", "METPhi_PFNeutralHadronsBarrel prev two bunches filled", 50, -M_PI,M_PI);
489  meMETPhiNeutralHadronsEndcapPlus_BXm1Bxm2Filled = ibooker.book1D("METPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled", "METPhi_PFNeutralHadronsEndcapPlus prev two bunches filled", 50, -M_PI,M_PI);
490  meMETPhiNeutralHadronsEndcapMinus_BXm1Bxm2Filled = ibooker.book1D("METPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled","METPhi_PFNeutralHadronsEndcapMinus prev two bunches filled", 50, -M_PI,M_PI);
491  meMETPhiPhotonsBarrel_BXm1Bxm2Filled = ibooker.book1D("METPhiPhotonsBarrel_BXm2BXm1Filled", "METPhi_PFPhotonsBarrel prev two bunches filled", 50, -M_PI,M_PI);
492  meMETPhiPhotonsEndcapPlus_BXm1Bxm2Filled = ibooker.book1D("METPhiPhotonsEndcapPlus_BXm2BXm1Filled", "METPhi_PFPhotonsEndcapPlus prev two bunches filled", 50, -M_PI,M_PI);
493  meMETPhiPhotonsEndcapMinus_BXm1Bxm2Filled = ibooker.book1D("METPhiPhotonsEndcapMinus_BXm2BXm1Filled", "METPhi_PFPhotonsEndcapMinus prev two bunches filled", 50, -M_PI,M_PI);
494  meMETPhiHFHadronsPlus_BXm1Bxm2Filled = ibooker.book1D("METPhiHFHadronsPlus_BXm2BXm1Filled", "METPhi_PFHFHadronsPlus prev two bunches filled", 50, -M_PI,M_PI);
495  meMETPhiHFHadronsMinus_BXm1Bxm2Filled = ibooker.book1D("METPhiHFHadronsMinus_BXm2BXm1Filled", "METPhi_PFHFHadronsMinus prev two bunches filled", 50, -M_PI,M_PI);
496  meMETPhiHFEGammasPlus_BXm1Bxm2Filled = ibooker.book1D("METPhiHFEGammasPlus_BXm2BXm1Filled", "METPhi_PFHFEGammasPlus prev two bunches filled", 50, -M_PI,M_PI);
497  meMETPhiHFEGammasMinus_BXm1Bxm2Filled = ibooker.book1D("METPhiHFEGammasMinus_BXm2BXm1Filled", "METPhi_PFHFEGammasMinus prev two bunches filled", 50, -M_PI,M_PI);
498 
499  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsBarrel_BXm2BXm1Filled" ,meMETPhiChargedHadronsBarrel_BXm1Bxm2Filled));
500  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm2BXm1Filled" ,meMETPhiChargedHadronsEndcapPlus_BXm1Bxm2Filled));
501  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm2BXm1Filled" ,meMETPhiChargedHadronsEndcapMinus_BXm1Bxm2Filled));
502  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsBarrel_BXm2BXm1Filled" ,meMETPhiNeutralHadronsBarrel_BXm1Bxm2Filled));
503  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled" ,meMETPhiNeutralHadronsEndcapPlus_BXm1Bxm2Filled));
504  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled" ,meMETPhiNeutralHadronsEndcapMinus_BXm1Bxm2Filled));
505  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsBarrel_BXm2BXm1Filled" ,meMETPhiPhotonsBarrel_BXm1Bxm2Filled));
506  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapPlus_BXm2BXm1Filled" ,meMETPhiPhotonsEndcapPlus_BXm1Bxm2Filled));
507  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapMinus_BXm2BXm1Filled" ,meMETPhiPhotonsEndcapMinus_BXm1Bxm2Filled));
508  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsPlus_BXm2BXm1Filled" ,meMETPhiHFHadronsPlus_BXm1Bxm2Filled));
509  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsMinus_BXm2BXm1Filled" ,meMETPhiHFHadronsMinus_BXm1Bxm2Filled));
510  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasPlus_BXm2BXm1Filled" ,meMETPhiHFEGammasPlus_BXm1Bxm2Filled));
511  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasMinus_BXm2BXm1Filled" ,meMETPhiHFEGammasMinus_BXm1Bxm2Filled));
512 
513  meMETPhiChargedHadronsBarrel_BXm2BXm1Empty = ibooker.book1D("METPhiChargedHadronsBarrel_BXm2BXm1Empty", "METPhi_PFChargedHadronsBarrel prev two bunches empty", 50, -M_PI,M_PI);
514  meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty = ibooker.book1D("METPhiChargedHadronsEndcapPlus_BXm2BXm1Empty", "METPhi_PFChargedHadronsEndcapPlus prev two bunches empty", 50, -M_PI,M_PI);
515  meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty = ibooker.book1D("METPhiChargedHadronsEndcapMinus_BXm2BXm1Empty","METPhi_PFChargedHadronsEndcapMinus prev two bunches empty", 50, -M_PI,M_PI);
516  meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty = ibooker.book1D("METPhiNeutralHadronsBarrel_BXm2BXm1Empty", "METPhi_PFNeutralHadronsBarrel prev two bunches empty", 50, -M_PI,M_PI);
517  meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty = ibooker.book1D("METPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty", "METPhi_PFNeutralHadronsEndcapPlus prev two bunches empty", 50, -M_PI,M_PI);
518  meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty = ibooker.book1D("METPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty","METPhi_PFNeutralHadronsEndcapMinus prev two bunches empty", 50, -M_PI,M_PI);
519  meMETPhiPhotonsBarrel_BXm2BXm1Empty = ibooker.book1D("METPhiPhotonsBarrel_BXm2BXm1Empty", "METPhi_PFPhotonsBarrel prev two bunches empty", 50, -M_PI,M_PI);
520  meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty = ibooker.book1D("METPhiPhotonsEndcapPlus_BXm2BXm1Empty", "METPhi_PFPhotonsEndcapPlus prev two bunches empty", 50, -M_PI,M_PI);
521  meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty = ibooker.book1D("METPhiPhotonsEndcapMinus_BXm2BXm1Empty", "METPhi_PFPhotonsEndcapMinus prev two bunches empty", 50, -M_PI,M_PI);
522  meMETPhiHFHadronsPlus_BXm2BXm1Empty = ibooker.book1D("METPhiHFHadronsPlus_BXm2BXm1Empty", "METPhi_PFHFHadronsPlus prev two bunches empty", 50, -M_PI,M_PI);
523  meMETPhiHFHadronsMinus_BXm2BXm1Empty = ibooker.book1D("METPhiHFHadronsMinus_BXm2BXm1Empty", "METPhi_PFHFHadronsMinus prev two bunches empty", 50, -M_PI,M_PI);
524  meMETPhiHFEGammasPlus_BXm2BXm1Empty = ibooker.book1D("METPhiHFEGammasPlus_BXm2BXm1Empty", "METPhi_PFHFEGammasPlus prev two bunches empty", 50, -M_PI,M_PI);
525  meMETPhiHFEGammasMinus_BXm2BXm1Empty = ibooker.book1D("METPhiHFEGammasMinus_BXm2BXm1Empty", "METPhi_PFHFEGammasMinus prev two bunches empty", 50, -M_PI,M_PI);
526 
527  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsBarrel_BXm2BXm1Empty" ,meMETPhiChargedHadronsBarrel_BXm2BXm1Empty));
528  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm2BXm1Empty" ,meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty));
529  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm2BXm1Empty" ,meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty));
530  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsBarrel_BXm2BXm1Empty" ,meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty));
531  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty" ,meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty));
532  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty" ,meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty));
533  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsBarrel_BXm2BXm1Empty" ,meMETPhiPhotonsBarrel_BXm2BXm1Empty));
534  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapPlus_BXm2BXm1Empty" ,meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty));
535  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapMinus_BXm2BXm1Empty" ,meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty));
536  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsPlus_BXm2BXm1Empty" ,meMETPhiHFHadronsPlus_BXm2BXm1Empty));
537  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsMinus_BXm2BXm1Empty" ,meMETPhiHFHadronsMinus_BXm2BXm1Empty));
538  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasPlus_BXm2BXm1Empty" ,meMETPhiHFEGammasPlus_BXm2BXm1Empty));
539  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasMinus_BXm2BXm1Empty" ,meMETPhiHFEGammasMinus_BXm2BXm1Empty));
540 
541  //histos where one previous bunch was empty/filled
542  mePhotonEtFraction_BXm1Empty = ibooker.book1D("PfPhotonEtFraction_BXm1Empty", "photonEtFraction() prev empty bunch", 50, 0, 1);
543  mePhotonEtFraction_BXm1Filled = ibooker.book1D("PfPhotonEtFraction_BXm1Filled", "photonEtFraction() prev filled bunch", 50, 0, 1);
544  meNeutralHadronEtFraction_BXm1Empty = ibooker.book1D("PfNeutralHadronEtFraction_BXm1Empty", "neutralHadronEtFraction() prev empty bunch", 50, 0, 1);
545  meNeutralHadronEtFraction_BXm1Filled = ibooker.book1D("PfNeutralHadronEtFraction_BXm1Filled", "neutralHadronEtFraction() prev filled bunch", 50, 0, 1);
546  meChargedHadronEtFraction_BXm1Empty = ibooker.book1D("PfChargedHadronEtFraction_BXm1Empty", "chargedHadronEtFraction() prev empty bunch", 50, 0, 1);
547  meChargedHadronEtFraction_BXm1Filled = ibooker.book1D("PfChargedHadronEtFraction_BXm1Filled", "chargedHadronEtFraction() prev filled bunch", 50, 0, 1);
548  meMET_BXm1Empty = ibooker.book1D("MET_BXm1Empty", "MET prev empty bunch", 200, 0, 1000);
549  meMET_BXm1Filled = ibooker.book1D("MET_BXm1Filled", "MET prev filled bunch", 200, 0, 1000);
550  meSumET_BXm1Empty = ibooker.book1D("SumET_BXm1Empty", "SumET prev empty bunch", 400, 0, 4000);
551  meSumET_BXm1Filled = ibooker.book1D("SumET_BXm1Filled", "SumET prev filled bunch", 400, 0, 4000);
552 
553  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFraction_BXm1Empty" ,mePhotonEtFraction_BXm1Empty));
554  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFraction_BXm1Filled" ,mePhotonEtFraction_BXm1Filled));
555  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFraction_BXm1Empty" ,meNeutralHadronEtFraction_BXm1Empty));
556  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralEtFraction_BXm1Filled" ,meNeutralHadronEtFraction_BXm1Filled));
557  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFraction_BXm1Empty" ,meChargedHadronEtFraction_BXm1Empty));
558  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedEtFraction_BXm1Filled" ,meChargedHadronEtFraction_BXm1Filled));
559  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MET_BXm1Empty" ,meMET_BXm1Empty));
560  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MET_BXm1Filled" ,meMET_BXm1Filled));
561  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SumET_BXm1Empty" ,meSumET_BXm1Empty));
562  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SumET_BXm1Filled",meSumET_BXm1Filled));
563 
564  meMETPhiChargedHadronsBarrel_BXm1Filled = ibooker.book1D("METPhiChargedHadronsBarrel_BXm1Filled", "METPhi_PFChargedHadronsBarrel prev bunch filled", 50, -M_PI,M_PI);
565  meMETPhiChargedHadronsEndcapPlus_BXm1Filled = ibooker.book1D("METPhiChargedHadronsEndcapPlus_BXm1Filled", "METPhi_PFChargedHadronsEndcapPlus prev bunch filled", 50, -M_PI,M_PI);
566  meMETPhiChargedHadronsEndcapMinus_BXm1Filled = ibooker.book1D("METPhiChargedHadronsEndcapMinus_BXm1Filled","METPhi_PFChargedHadronsEndcapMinus prev bunch filled", 50, -M_PI,M_PI);
567  meMETPhiNeutralHadronsBarrel_BXm1Filled = ibooker.book1D("METPhiNeutralHadronsBarrel_BXm1Filled", "METPhi_PFNeutralHadronsBarrel prev bunch filled", 50, -M_PI,M_PI);
568  meMETPhiNeutralHadronsEndcapPlus_BXm1Filled = ibooker.book1D("METPhiNeutralHadronsEndcapPlus_BXm1Filled", "METPhi_PFNeutralHadronsEndcapPlus prev bunch filled", 50, -M_PI,M_PI);
569  meMETPhiNeutralHadronsEndcapMinus_BXm1Filled = ibooker.book1D("METPhiNeutralHadronsEndcapMinus_BXm1Filled","METPhi_PFNeutralHadronsEndcapMinus prev bunch filled", 50, -M_PI,M_PI);
570  meMETPhiPhotonsBarrel_BXm1Filled = ibooker.book1D("METPhiPhotonsBarrel_BXm1Filled", "METPhi_PFPhotonsBarrel prev bunch filled", 50, -M_PI,M_PI);
571  meMETPhiPhotonsEndcapPlus_BXm1Filled = ibooker.book1D("METPhiPhotonsEndcapPlus_BXm1Filled", "METPhi_PFPhotonsEndcapPlus prev bunch filled", 50, -M_PI,M_PI);
572  meMETPhiPhotonsEndcapMinus_BXm1Filled = ibooker.book1D("METPhiPhotonsEndcapMinus_BXm1Filled", "METPhi_PFPhotonsEndcapMinus prev bunch filled", 50, -M_PI,M_PI);
573  meMETPhiHFHadronsPlus_BXm1Filled = ibooker.book1D("METPhiHFHadronsPlus_BXm1Filled", "METPhi_PFHFHadronsPlus prev bunch filled", 50, -M_PI,M_PI);
574  meMETPhiHFHadronsMinus_BXm1Filled = ibooker.book1D("METPhiHFHadronsMinus_BXm1Filled", "METPhi_PFHFHadronsMinus prev bunch filled", 50, -M_PI,M_PI);
575  meMETPhiHFEGammasPlus_BXm1Filled = ibooker.book1D("METPhiHFEGammasPlus_BXm1Filled", "METPhi_PFHFEGammasPlus prev bunch filled", 50, -M_PI,M_PI);
576  meMETPhiHFEGammasMinus_BXm1Filled = ibooker.book1D("METPhiHFEGammasMinus_BXm1Filled", "METPhi_PFHFEGammasMinus prev bunch filled", 50, -M_PI,M_PI);
577 
578  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsBarrel_BXm1Filled" ,meMETPhiChargedHadronsBarrel_BXm1Filled));
579  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm1Filled" ,meMETPhiChargedHadronsEndcapPlus_BXm1Filled));
580  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm1Filled" ,meMETPhiChargedHadronsEndcapMinus_BXm1Filled));
581  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsBarrel_BXm1Filled" ,meMETPhiNeutralHadronsBarrel_BXm1Filled));
582  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm1Filled" ,meMETPhiNeutralHadronsEndcapPlus_BXm1Filled));
583  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm1Filled" ,meMETPhiNeutralHadronsEndcapMinus_BXm1Filled));
584  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsBarrel_BXm1Filled" ,meMETPhiPhotonsBarrel_BXm1Filled));
585  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapPlus_BXm1Filled" ,meMETPhiPhotonsEndcapPlus_BXm1Filled));
586  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapMinus_BXm1Filled" ,meMETPhiPhotonsEndcapMinus_BXm1Filled));
587  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsPlus_BXm1Filled" ,meMETPhiHFHadronsPlus_BXm1Filled));
588  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsMinus_BXm1Filled" ,meMETPhiHFHadronsMinus_BXm1Filled));
589  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasPlus_BXm1Filled" ,meMETPhiHFEGammasPlus_BXm1Filled));
590  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasMinus_BXm1Filled" ,meMETPhiHFEGammasMinus_BXm1Filled));
591 
592  meMETPhiChargedHadronsBarrel_BXm1Empty = ibooker.book1D("METPhiChargedHadronsBarrel_BXm1Empty", "METPhi_PFChargedHadronsBarrel prev bunch empty", 50, -M_PI,M_PI);
593  meMETPhiChargedHadronsEndcapPlus_BXm1Empty = ibooker.book1D("METPhiChargedHadronsEndcapPlus_BXm1Empty", "METPhi_PFChargedHadronsEndcapPlus prev bunch empty", 50, -M_PI,M_PI);
594  meMETPhiChargedHadronsEndcapMinus_BXm1Empty = ibooker.book1D("METPhiChargedHadronsEndcapMinus_BXm1Empty","METPhi_PFChargedHadronsEndcapMinus prev bunch empty", 50, -M_PI,M_PI);
595  meMETPhiNeutralHadronsBarrel_BXm1Empty = ibooker.book1D("METPhiNeutralHadronsBarrel_BXm1Empty", "METPhi_PFNeutralHadronsBarrel prev bunch empty", 50, -M_PI,M_PI);
596  meMETPhiNeutralHadronsEndcapPlus_BXm1Empty = ibooker.book1D("METPhiNeutralHadronsEndcapPlus_BXm1Empty", "METPhi_PFNeutralHadronsEndcapPlus prev bunch empty", 50, -M_PI,M_PI);
597  meMETPhiNeutralHadronsEndcapMinus_BXm1Empty = ibooker.book1D("METPhiNeutralHadronsEndcapMinus_BXm1Empty","METPhi_PFNeutralHadronsEndcapMinus prev bunch empty", 50, -M_PI,M_PI);
598  meMETPhiPhotonsBarrel_BXm1Empty = ibooker.book1D("METPhiPhotonsBarrel_BXm1Empty", "METPhi_PFPhotonsBarrel prev bunch empty", 50, -M_PI,M_PI);
599  meMETPhiPhotonsEndcapPlus_BXm1Empty = ibooker.book1D("METPhiPhotonsEndcapPlus_BXm1Empty", "METPhi_PFPhotonsEndcapPlus prev bunch empty", 50, -M_PI,M_PI);
600  meMETPhiPhotonsEndcapMinus_BXm1Empty = ibooker.book1D("METPhiPhotonsEndcapMinus_BXm1Empty", "METPhi_PFPhotonsEndcapMinus prev bunch empty", 50, -M_PI,M_PI);
601  meMETPhiHFHadronsPlus_BXm1Empty = ibooker.book1D("METPhiHFHadronsPlus_BXm1Empty", "METPhi_PFHFHadronsPlus prev bunch empty", 50, -M_PI,M_PI);
602  meMETPhiHFHadronsMinus_BXm1Empty = ibooker.book1D("METPhiHFHadronsMinus_BXm1Empty", "METPhi_PFHFHadronsMinus prev bunch empty", 50, -M_PI,M_PI);
603  meMETPhiHFEGammasPlus_BXm1Empty = ibooker.book1D("METPhiHFEGammasPlus_BXm1Empty", "METPhi_PFHFEGammasPlus prev bunch empty", 50, -M_PI,M_PI);
604  meMETPhiHFEGammasMinus_BXm1Empty = ibooker.book1D("METPhiHFEGammasMinus_BXm1Empty", "METPhi_PFHFEGammasMinus prev bunch empty", 50, -M_PI,M_PI);
605 
606  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsBarrel_BXm1Empty" ,meMETPhiChargedHadronsBarrel_BXm1Empty));
607  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm1Empty" ,meMETPhiChargedHadronsEndcapPlus_BXm1Empty));
608  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm1Empty" ,meMETPhiChargedHadronsEndcapMinus_BXm1Empty));
609  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsBarrel_BXm1Empty" ,meMETPhiNeutralHadronsBarrel_BXm1Empty));
610  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm1Empty" ,meMETPhiNeutralHadronsEndcapPlus_BXm1Empty));
611  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm1Empty" ,meMETPhiNeutralHadronsEndcapMinus_BXm1Empty));
612  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsBarrel_BXm1Empty" ,meMETPhiPhotonsBarrel_BXm1Empty));
613  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapPlus_BXm1Empty" ,meMETPhiPhotonsEndcapPlus_BXm1Empty));
614  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapMinus_BXm1Empty" ,meMETPhiPhotonsEndcapMinus_BXm1Empty));
615  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsPlus_BXm1Empty" ,meMETPhiHFHadronsPlus_BXm1Empty));
616  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsMinus_BXm1Empty" ,meMETPhiHFHadronsMinus_BXm1Empty));
617  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasPlus_BXm1Empty" ,meMETPhiHFEGammasPlus_BXm1Empty));
618  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasMinus_BXm1Empty" ,meMETPhiHFEGammasMinus_BXm1Empty));
619 
620  meMETPhiChargedHadronsBarrel = ibooker.book1D("METPhiChargedHadronsBarrel", "METPhi_PFChargedHadronsBarrel", 50, -M_PI,M_PI);
621  meMETPhiChargedHadronsEndcapPlus = ibooker.book1D("METPhiChargedHadronsEndcapPlus", "METPhi_PFChargedHadronsEndcapPlus", 50, -M_PI,M_PI);
622  meMETPhiChargedHadronsEndcapMinus = ibooker.book1D("METPhiChargedHadronsEndcapMinus","METPhi_PFChargedHadronsEndcapMinus", 50, -M_PI,M_PI);
623  meMETPhiNeutralHadronsBarrel = ibooker.book1D("METPhiNeutralHadronsBarrel", "METPhi_PFNeutralHadronsBarrel", 50, -M_PI,M_PI);
624  meMETPhiNeutralHadronsEndcapPlus = ibooker.book1D("METPhiNeutralHadronsEndcapPlus", "METPhi_PFNeutralHadronsEndcapPlus", 50, -M_PI,M_PI);
625  meMETPhiNeutralHadronsEndcapMinus = ibooker.book1D("METPhiNeutralHadronsEndcapMinus","METPhi_PFNeutralHadronsEndcapMinus", 50, -M_PI,M_PI);
626  meMETPhiPhotonsBarrel = ibooker.book1D("METPhiPhotonsBarrel", "METPhi_PFPhotonsBarrel", 50, -M_PI,M_PI);
627  meMETPhiPhotonsEndcapPlus = ibooker.book1D("METPhiPhotonsEndcapPlus", "METPhi_PFPhotonsEndcapPlus", 50, -M_PI,M_PI);
628  meMETPhiPhotonsEndcapMinus = ibooker.book1D("METPhiPhotonsEndcapMinus", "METPhi_PFPhotonsEndcapMinus", 50, -M_PI,M_PI);
629  meMETPhiHFHadronsPlus = ibooker.book1D("METPhiHFHadronsPlus", "METPhi_PFHFHadronsPlus", 50, -M_PI,M_PI);
630  meMETPhiHFHadronsMinus = ibooker.book1D("METPhiHFHadronsMinus", "METPhi_PFHFHadronsMinus", 50, -M_PI,M_PI);
631  meMETPhiHFEGammasPlus = ibooker.book1D("METPhiHFEGammasPlus", "METPhi_PFHFEGammasPlus", 50, -M_PI,M_PI);
632  meMETPhiHFEGammasMinus = ibooker.book1D("METPhiHFEGammasMinus", "METPhi_PFHFEGammasMinus", 50, -M_PI,M_PI);
633 
634  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsBarrel" ,meMETPhiChargedHadronsBarrel));
635  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapPlus" ,meMETPhiChargedHadronsEndcapPlus));
636  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiChargedHadronsEndcapMinus" ,meMETPhiChargedHadronsEndcapMinus));
637  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsBarrel" ,meMETPhiNeutralHadronsBarrel));
638  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapPlus" ,meMETPhiNeutralHadronsEndcapPlus));
639  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiNeutralHadronsEndcapMinus" ,meMETPhiNeutralHadronsEndcapMinus));
640  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsBarrel" ,meMETPhiPhotonsBarrel));
641  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapPlus" ,meMETPhiPhotonsEndcapPlus));
642  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiPhotonsEndcapMinus" ,meMETPhiPhotonsEndcapMinus));
643  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsPlus" ,meMETPhiHFHadronsPlus));
644  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFHadronsMinus" ,meMETPhiHFHadronsMinus));
645  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasPlus" ,meMETPhiHFEGammasPlus));
646  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METPhiHFEGammasMinus" ,meMETPhiHFEGammasMinus));
647  }
648  mePhotonEt = ibooker.book1D("PfPhotonEt", "photonEt()", 100, 0, 1000);
649  meNeutralHadronEt = ibooker.book1D("PfNeutralHadronEt", "neutralHadronEt()", 100, 0, 1000);
650  meElectronEt = ibooker.book1D("PfElectronEt", "electronEt()", 100, 0, 100);
651  meChargedHadronEt = ibooker.book1D("PfChargedHadronEt", "chargedHadronEt()", 100, 0, 1000);
652  meMuonEt = ibooker.book1D("PfMuonEt", "muonEt()", 100, 0, 100);
653  meHFHadronEt = ibooker.book1D("PfHFHadronEt", "HFHadronEt()", 100, 0, 1000);
654  meHFEMEt = ibooker.book1D("PfHFEMEt", "HFEMEt()", 100, 0, 1000);
655 
656  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEt" ,mePhotonEt));
657  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEt" ,meNeutralHadronEt));
658  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfElectronEt" ,meElectronEt));
659  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEt" ,meChargedHadronEt));
660  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfMuonEt" ,meMuonEt));
661  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEt" ,meHFHadronEt));
662  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEt" ,meHFEMEt));
663 
664  mePhotonEt_profile = ibooker.bookProfile("PfPhotonEt_profile", "photonEt()", nbinsPV_, nPVMin_, nPVMax_, 100, 0, 1000);
665  meNeutralHadronEt_profile = ibooker.bookProfile("PfNeutralHadronEt_profile", "neutralHadronEt()", nbinsPV_, nPVMin_, nPVMax_, 100, 0, 1000);
666  meChargedHadronEt_profile = ibooker.bookProfile("PfChargedHadronEt_profile", "chargedHadronEt()", nbinsPV_, nPVMin_, nPVMax_, 100, 0, 1000);
667  meHFHadronEt_profile = ibooker.bookProfile("PfHFHadronEt_profile", "HFHadronEt()", nbinsPV_, nPVMin_, nPVMax_, 100, 0, 1000);
668  meHFEMEt_profile = ibooker.bookProfile("PfHFEMEt_profile", "HFEMEt()", nbinsPV_, nPVMin_, nPVMax_, 100, 0, 1000);
669 
670  mePhotonEt_profile ->setAxisTitle("nvtx", 1);
671  meNeutralHadronEt_profile ->setAxisTitle("nvtx", 1);
672  meChargedHadronEt_profile ->setAxisTitle("nvtx", 1);
673  meHFHadronEt_profile ->setAxisTitle("nvtx", 1);
674  meHFEMEt_profile ->setAxisTitle("nvtx", 1);
675 
676  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEt_profile" ,mePhotonEt_profile));
677  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEt_profile" ,meNeutralHadronEt_profile));
678  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEt_profile" ,meChargedHadronEt_profile));
679  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEt_profile" ,meHFHadronEt_profile));
680  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEt_profile" ,meHFEMEt_profile));
681 
682  if(fillPFCandPlots && fillCandidateMap_histos){
683  if(!etaMinPFCand_.empty()){
684  etaMinPFCand_.clear();
685  etaMaxPFCand_.clear();
686  typePFCand_.clear();
687  nbinsPFCand_.clear();
688  countsPFCand_.clear();
689  MExPFCand_.clear();
690  MEyPFCand_.clear();
691  profilePFCand_x_.clear();
692  profilePFCand_y_.clear();
693  occupancyPFCand_.clear();
694  ptPFCand_.clear();
695  multiplicityPFCand_.clear();
696  profilePFCand_x_name_.clear();
697  profilePFCand_y_name_.clear();
698  occupancyPFCand_name_.clear();
699  ptPFCand_name_.clear();
700  multiplicityPFCand_name_.clear();
701  }
702  for (std::vector<edm::ParameterSet>::const_iterator v = diagnosticsParameters_.begin(); v!=diagnosticsParameters_.end(); v++) {
703  int etaNBinsPFCand = v->getParameter<int>("etaNBins");
704  double etaMinPFCand = v->getParameter<double>("etaMin");
705  double etaMaxPFCand = v->getParameter<double>("etaMax");
706  int phiNBinsPFCand = v->getParameter<int>("phiNBins");
707  double phiMinPFCand = v->getParameter<double>("phiMin");
708  double phiMaxPFCand = v->getParameter<double>("phiMax");
709  int nMinPFCand = v->getParameter<int>("nMin");
710  int nMaxPFCand = v->getParameter<int>("nMax");
711  int nbinsPFCand = v->getParameter<double>("nbins");
712 
713  // etaNBins_.push_back(etaNBins);
714  etaMinPFCand_.push_back(etaMinPFCand);
715  etaMaxPFCand_.push_back(etaMaxPFCand);
716  nbinsPFCand_.push_back(nbinsPFCand);
717  typePFCand_.push_back(v->getParameter<int>("type"));
718  countsPFCand_.push_back(0);
719  MExPFCand_.push_back(0.);
720  MEyPFCand_.push_back(0.);
721 
722  profilePFCand_x_.push_back(ibooker.bookProfile(std::string(v->getParameter<std::string>("name")).append("_Px_").c_str(), std::string(v->getParameter<std::string>("name"))+"Px", nbinsPFCand, nMinPFCand, nMaxPFCand, -300,300));
723  profilePFCand_x_name_.push_back(std::string(v->getParameter<std::string>("name")).append("_Px_").c_str());
724  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+profilePFCand_x_name_[profilePFCand_x_name_.size()-1], profilePFCand_x_[profilePFCand_x_.size()-1]));
725  profilePFCand_y_.push_back(ibooker.bookProfile(std::string(v->getParameter<std::string>("name")).append("_Py_").c_str(), std::string(v->getParameter<std::string>("name"))+"Py", nbinsPFCand, nMinPFCand, nMaxPFCand, -300,300));
726  profilePFCand_y_name_.push_back(std::string(v->getParameter<std::string>("name")).append("_Py_").c_str());
727  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+profilePFCand_y_name_[profilePFCand_y_name_.size()-1], profilePFCand_y_[profilePFCand_y_.size()-1]));
728  multiplicityPFCand_.push_back(ibooker.book1D(std::string(v->getParameter<std::string>("name")).append("_multiplicity_").c_str(),std::string(v->getParameter<std::string>("name"))+"multiplicity", nbinsPFCand, nMinPFCand, nMaxPFCand));
729  multiplicityPFCand_name_.push_back(std::string(v->getParameter<std::string>("name")).append("_multiplicity_").c_str());
730  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+ multiplicityPFCand_name_[multiplicityPFCand_name_.size()-1], multiplicityPFCand_[multiplicityPFCand_.size()-1]));
731 
732  //push back names first, we need to create histograms with the name and fill it for endcap plots later
733  occupancyPFCand_name_.push_back(std::string(v->getParameter<std::string>("name")).append("_occupancy_").c_str());
734 
735  ptPFCand_name_.push_back(std::string(v->getParameter<std::string>("name")).append("_pt_").c_str());
736  //special booking for endcap plots, merge plots for eminus and eplus into one plot, using variable binning
737  //barrel plots have eta-boundaries on minus and plus side
738  //parameters start on minus side
739  if(etaMinPFCand*etaMaxPFCand<0){//barrel plots, plot only in barrel region
740  occupancyPFCand_.push_back(ibooker.book2D(std::string(v->getParameter<std::string>("name")).append("_occupancy_").c_str(),std::string(v->getParameter<std::string>("name"))+"occupancy", etaNBinsPFCand, etaMinPFCand, etaMaxPFCand, phiNBinsPFCand, phiMinPFCand, phiMaxPFCand));
741  ptPFCand_.push_back(ibooker.book2D(std::string(v->getParameter<std::string>("name")).append("_pt_").c_str(),std::string(v->getParameter<std::string>("name"))+"pt", etaNBinsPFCand, etaMinPFCand, etaMaxPFCand, phiNBinsPFCand, phiMinPFCand, phiMaxPFCand));
742  }else{//endcap or forward plots,
743  const int nbins_eta_endcap=2*(etaNBinsPFCand+1);
744  double eta_limits_endcap[nbins_eta_endcap];
745  for(int i=0;i<nbins_eta_endcap;i++){
746  if(i<(etaNBinsPFCand+1)){
747  eta_limits_endcap[i]=etaMinPFCand+i*(etaMaxPFCand-etaMinPFCand)/(double)etaNBinsPFCand;
748  }else{
749  eta_limits_endcap[i]= -etaMaxPFCand +(i- (etaNBinsPFCand+1) )*(etaMaxPFCand-etaMinPFCand)/(double)etaNBinsPFCand;
750  }
751  }
752  TH2F* hist_temp_occup = new TH2F((occupancyPFCand_name_[occupancyPFCand_name_.size()-1]).c_str(),"occupancy",nbins_eta_endcap-1, eta_limits_endcap, phiNBinsPFCand, phiMinPFCand, phiMaxPFCand);
753  occupancyPFCand_.push_back(ibooker.book2D(occupancyPFCand_name_[occupancyPFCand_name_.size()-1],hist_temp_occup));
754  TH2F* hist_temp_pt = new TH2F((ptPFCand_name_[ptPFCand_name_.size()-1]).c_str(),"pt",nbins_eta_endcap-1, eta_limits_endcap, phiNBinsPFCand, phiMinPFCand, phiMaxPFCand);
755  ptPFCand_.push_back(ibooker.book2D(ptPFCand_name_[ptPFCand_name_.size()-1], hist_temp_pt));
756  }
757 
758  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+ occupancyPFCand_name_[occupancyPFCand_name_.size()-1], occupancyPFCand_[occupancyPFCand_.size()-1]));
759  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+ ptPFCand_name_[ptPFCand_name_.size()-1], ptPFCand_[ptPFCand_.size()-1]));
760  }
761 
762  mProfileIsoPFChHad_TrackOccupancy=ibooker.book2D("IsoPfChHad_Track_profile","Isolated PFChHadron Tracker_occupancy", 108, -2.7, 2.7, 160, -M_PI,M_PI);
763  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_Track_profile" ,mProfileIsoPFChHad_TrackOccupancy));
764  mProfileIsoPFChHad_TrackPt=ibooker.book2D("IsoPfChHad_TrackPt","Isolated PFChHadron TrackPt", 108, -2.7, 2.7, 160, -M_PI,M_PI);
765  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_TrackPt" ,mProfileIsoPFChHad_TrackPt));
766 
767 
768  mProfileIsoPFChHad_EcalOccupancyCentral = ibooker.book2D("IsoPfChHad_ECAL_profile_central","IsolatedPFChHa ECAL occupancy (Barrel)", 180, -1.479, 1.479, 125, -M_PI,M_PI);
769  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_ECAL_profile_central" ,mProfileIsoPFChHad_EcalOccupancyCentral));
770  mProfileIsoPFChHad_EMPtCentral=ibooker.book2D("IsoPfChHad_EMPt_central","Isolated PFChHadron HadPt_central", 180, -1.479, 1.479, 360, -M_PI,M_PI);
771  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_EMPt_central" ,mProfileIsoPFChHad_EMPtCentral));
772 
773  mProfileIsoPFChHad_EcalOccupancyEndcap = ibooker.book2D("IsoPfChHad_ECAL_profile_endcap","IsolatedPFChHa ECAL occupancy (Endcap)", 110, -2.75, 2.75, 125, -M_PI,M_PI);
774  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_ECAL_profile_endcap" ,mProfileIsoPFChHad_EcalOccupancyEndcap));
775  mProfileIsoPFChHad_EMPtEndcap=ibooker.book2D("IsoPfChHad_EMPt_endcap","Isolated PFChHadron EMPt_endcap", 110, -2.75, 2.75, 125, -M_PI,M_PI);
776  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_EMPt_endcap" ,mProfileIsoPFChHad_EMPtEndcap));
777 
778  const int nbins_eta=16;
779 
780  double eta_limits[nbins_eta]={-2.650,-2.500,-2.322,-2.172,-2.043,-1.930,-1.830,-1.740,1.740,1.830,1.930,2.043,2.172,2.3122,2.500,2.650};
781 
782  TH2F* hist_temp_HCAL =new TH2F("IsoPfChHad_HCAL_profile_endcap","IsolatedPFChHa HCAL occupancy (outer endcap)",nbins_eta-1,eta_limits, 36, -M_PI,M_PI);
783  TH2F* hist_tempPt_HCAL=(TH2F*)hist_temp_HCAL->Clone("Isolated PFCHHadron HadPt (outer endcap)");
784 
785  mProfileIsoPFChHad_HcalOccupancyCentral = ibooker.book2D("IsoPfChHad_HCAL_profile_central","IsolatedPFChHa HCAL occupancy (Central Part)", 40, -1.740, 1.740, 72, -M_PI,M_PI);
786  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_HCAL_profile_central" ,mProfileIsoPFChHad_HcalOccupancyCentral));
787  mProfileIsoPFChHad_HadPtCentral=ibooker.book2D("IsoPfChHad_HadPt_central","Isolated PFChHadron HadPt_central", 40, -1.740, 1.740, 72, -M_PI,M_PI);
788  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_HadPt_central" ,mProfileIsoPFChHad_HadPtCentral));
789 
790  mProfileIsoPFChHad_HcalOccupancyEndcap = ibooker.book2D("IsoPfChHad_HCAL_profile_endcap",hist_temp_HCAL);
791  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_HCAL_profile_endcap" ,mProfileIsoPFChHad_HcalOccupancyEndcap));
792  mProfileIsoPFChHad_HadPtEndcap=ibooker.book2D("IsoPfChHad_HadPt_endcap",hist_tempPt_HCAL);
793  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"IsoPfChHad_HadPt_endcap" ,mProfileIsoPFChHad_HadPtEndcap));
794  }
795 
796  }
797 
798  if(isPFMet_ || isMiniAODMet_){
799  mePhotonEtFraction = ibooker.book1D("PfPhotonEtFraction", "photonEtFraction()", 50, 0, 1);
800  meNeutralHadronEtFraction = ibooker.book1D("PfNeutralHadronEtFraction", "neutralHadronEtFraction()", 50, 0, 1);
801  meChargedHadronEtFraction = ibooker.book1D("PfChargedHadronEtFraction", "chargedHadronEtFraction()", 50, 0, 1);
802  meHFHadronEtFraction = ibooker.book1D("PfHFHadronEtFraction", "HFHadronEtFraction()", 50, 0, 1);
803  meHFEMEtFraction = ibooker.book1D("PfHFEMEtFraction", "HFEMEtFraction()", 50, 0, 1);
804 
805  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFraction" ,mePhotonEtFraction));
806  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFraction",meNeutralHadronEtFraction));
807  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFraction",meChargedHadronEtFraction));
808  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFraction" ,meHFHadronEtFraction));
809  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFraction" ,meHFEMEtFraction));
810 
811  mePhotonEtFraction_profile = ibooker.bookProfile("PfPhotonEtFraction_profile", "photonEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
812  meNeutralHadronEtFraction_profile = ibooker.bookProfile("PfNeutralHadronEtFraction_profile", "neutralHadronEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
813  meChargedHadronEtFraction_profile = ibooker.bookProfile("PfChargedHadronEtFraction_profile", "chargedHadronEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
814  meHFHadronEtFraction_profile = ibooker.bookProfile("PfHFHadronEtFraction_profile", "HFHadronEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
815  meHFEMEtFraction_profile = ibooker.bookProfile("PfHFEMEtFraction_profile", "HFEMEtFraction()", nbinsPV_, nPVMin_, nPVMax_, 50, 0, 1);
816  mePhotonEtFraction_profile ->setAxisTitle("nvtx", 1);
817  meNeutralHadronEtFraction_profile->setAxisTitle("nvtx", 1);
818  meChargedHadronEtFraction_profile->setAxisTitle("nvtx", 1);
819  meHFHadronEtFraction_profile ->setAxisTitle("nvtx", 1);
820  meHFEMEtFraction_profile ->setAxisTitle("nvtx", 1);
821 
822  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfPhotonEtFraction_profile" ,mePhotonEtFraction_profile));
823  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfNeutralHadronEtFraction_profile" ,meNeutralHadronEtFraction_profile));
824  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfChargedHadronEtFraction_profile" ,meChargedHadronEtFraction_profile));
825  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFHadronEtFraction_profile" ,meHFHadronEtFraction_profile));
826  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PfHFEMEtFraction_profile" ,meHFEMEtFraction_profile));
827  }
828 
829  if (isCaloMet_){
830  if (fill_met_high_level_histo){//now configurable in python file
831  hMExLS = ibooker.book2D("MExLS","MEx_LS",200,-200,200,250,0.,2500.);
832  hMExLS->setAxisTitle("MEx [GeV]",1);
833  hMExLS->setAxisTitle("Lumi Section",2);
834  hMExLS->getTH2F()->SetOption("colz");
835  hMEyLS = ibooker.book2D("MEyLS","MEy_LS",200,-200,200,250,0.,2500.);
836  hMEyLS->setAxisTitle("MEy [GeV]",1);
837  hMEyLS->setAxisTitle("Lumi Section",2);
838  hMEyLS->getTH2F()->SetOption("colz");
839  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MExLS",hMExLS));
840  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MEyLS",hMEyLS));
841  }
842  }
843 
844  hMETRate = ibooker.book1D("METRate", "METRate", 200, 0, 1000);
845  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"METRate",hMETRate));
846 
847 
848  ibooker.setCurrentFolder("JetMET");
849  lumisecME = ibooker.book1D("lumisec", "lumisec", 2501, -1., 2500.);
850  map_of_MEs.insert(std::pair<std::string,MonitorElement*>("JetMET/lumisec",lumisecME));
851 
852 }
853 
854 // ***********************************************************
855 void METAnalyzer::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup)
856 {
858  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd) ;
859  const L1GtTriggerMenu* menu = menuRcd.product();
860  for (CItAlgo techTrig = menu->gtTechnicalTriggerMap().begin(); techTrig != menu->gtTechnicalTriggerMap().end(); ++techTrig) {
861  if ((techTrig->second).algoName() == m_l1algoname_) {
862  m_bitAlgTechTrig_=(techTrig->second).algoBitNumber();
863  break;
864  }
865  }
866 
867 // std::cout << "Run " << iRun.run() << " hltconfig.init "
868 // << hltConfig_.init(iRun,iSetup,triggerResultsLabel_.process(),changed_) << " length: "<<hltConfig_.triggerNames().size()<<" changed "<<changed_<<std::endl;
869  bool changed(true);
870  if (hltConfig_.init(iRun,iSetup,triggerResultsLabel_.process(),changed)) {
871  if (changed) {
872  //hltConfig_.dump("ProcessName");
873  //hltConfig_.dump("GlobalTag");
874  //hltConfig_.dump("TableName");
875 // hltConfig_.dump("Streams");
876 // hltConfig_.dump("Datasets");
877 // hltConfig_.dump("PrescaleTable");
878 // hltConfig_.dump("ProcessPSet");
879  }
880  } else {
881  if (verbose_) std::cout << "HLTEventAnalyzerAOD::analyze:"
882  << " config extraction failure with process name "
883  << triggerResultsLabel_.process() << std::endl;
884  }
885 
886  allTriggerNames_.clear();
887  for (unsigned int i = 0; i<hltConfig_.size();i++) {
888  allTriggerNames_.push_back(hltConfig_.triggerName(i));
889  }
890 // std::cout<<"Length: "<<allTriggerNames_.size()<<std::endl;
891 
892  triggerSelectedSubFolders_ = parameters.getParameter<edm::VParameterSet>("triggerSelectedSubFolders");
893  for ( std::vector<GenericTriggerEventFlag *>::const_iterator it = triggerFolderEventFlag_.begin(); it!= triggerFolderEventFlag_.end(); it++) {
894  int pos = it - triggerFolderEventFlag_.begin();
895  if ((*it)->on()) {
896  (*it)->initRun( iRun, iSetup );
897  if (triggerSelectedSubFolders_[pos].exists(std::string("hltDBKey"))) {
898  if ((*it)->expressionsFromDB((*it)->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
899  triggerFolderExpr_[pos] = (*it)->expressionsFromDB((*it)->hltDBKey(), iSetup);
900  }
901  }
902  }
903 }
904 
905 // ***********************************************************
906 void METAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup& iSetup)
907 {
908 
909  //
910  //--- Check the time length of the Run from the lumi section plots
911 
912 
913  TH1F* tlumisec;
914 
915  MonitorElement *meLumiSec = map_dijet_MEs["aaa"];
916  meLumiSec = map_dijet_MEs["JetMET/lumisec"];
917 
918  int totlsec=0;
919  int totlssecsum=0;
920  double totltime=0.;
921  if (meLumiSec && meLumiSec->getRootObject() ) {
922  tlumisec = meLumiSec->getTH1F();
923  //check overflow bin (if we have more than 2500 LS in a run)
924  //lumisec is filled every time the analyze section is processed
925  //we know an LS is present only once in a run: normalize how many events we had on average
926  //if lumi fluctuates strongly might be unreliable for overflow bin though
927  for (int i=0; i< (tlumisec->GetNbinsX()); i++){
928  if (tlumisec->GetBinContent(i)!=0){
929  totlsec+=1;
930  totlssecsum+=tlumisec->GetBinContent(i);
931  }
932  }
933  int num_per_ls=(double)totlssecsum/(double)totlsec;
934  totlsec=totlsec+tlumisec->GetBinContent(tlumisec->GetNbinsX()+1)/(double)num_per_ls;
935  totltime = double(totlsec*90); // one lumi sec ~ 90 (sec)
936  }
937 
938  if (totltime==0.) totltime=1.;
939 
940  std::string dirName = FolderName_+metCollectionLabel_.label()+"/";
941  //dbe_->setCurrentFolder(dirName);
942 
943 
944 
945  //below is the original METAnalyzer formulation
946 
947  for (std::vector<std::string>::const_iterator ic = folderNames_.begin(); ic != folderNames_.end(); ic++) {
949  DirName = dirName+*ic;
950  makeRatePlot(DirName,totltime);
951  for ( std::vector<GenericTriggerEventFlag *>::const_iterator it = triggerFolderEventFlag_.begin(); it!= triggerFolderEventFlag_.end(); it++) {
952  int pos = it - triggerFolderEventFlag_.begin();
953  if ((*it)->on()) {
954  makeRatePlot(DirName+"/"+triggerFolderLabels_[pos],totltime);
955  }
956  }
957  }
958 
959 }
960 
961 
962 // ***********************************************************
964 {
965 
966  //dbe_->setCurrentFolder(DirName);
967  MonitorElement *meMET = map_dijet_MEs[DirName+"/"+"MET"];
968  MonitorElement *mMETRate = map_dijet_MEs[DirName+"/"+"METRate"];
969 
970  TH1F* tMET;
971  TH1F* tMETRate;
972 
973  if ( meMET && mMETRate){
974  if ( meMET->getRootObject() && mMETRate->getRootObject()) {
975  tMET = meMET->getTH1F();
976 
977  // Integral plot & convert number of events to rate (hz)
978  tMETRate = (TH1F*) tMET->Clone("METRateHist");
979  for (int i = tMETRate->GetNbinsX()-1; i>=0; i--){
980  mMETRate->setBinContent(i+1,tMETRate->GetBinContent(i+2)+tMET->GetBinContent(i+1));
981  }
982  for (int i = 0; i<tMETRate->GetNbinsX(); i++){
983  mMETRate->setBinContent(i+1,tMETRate->GetBinContent(i+1)/double(totltime));
984  }
985  }
986  }
987 
988 }
989 
990 // ***********************************************************
992 
993 
994  // *** Fill lumisection ME
995  int myLuminosityBlock;
996  myLuminosityBlock = iEvent.luminosityBlock();
997  if(fill_met_high_level_histo){
998  lumisecME=map_dijet_MEs["JetMET/lumisec"]; if(lumisecME && lumisecME->getRootObject()) lumisecME->Fill(myLuminosityBlock);
999  }
1000 
1001  if (myLuminosityBlock<LSBegin_) return;
1002  if (myLuminosityBlock>LSEnd_ && LSEnd_>0) return;
1003 
1004  if (verbose_) std::cout << "METAnalyzer analyze" << std::endl;
1005 
1006  std::string DirName = FolderName_+metCollectionLabel_.label();
1007 
1008 
1009 
1010 
1011  // ==========================================================
1012  // Trigger information
1013  //
1014 // trigJetMB_=0;
1015 // trigHighPtJet_=0;
1016 // trigLowPtJet_=0;
1017 // trigMinBias_=0;
1018 // trigHighMET_=0;
1019 // // _trig_LowMET=0;
1020 // trigEle_=0;
1021 // trigMuon_=0;
1022 // trigPhysDec_=0;
1023  std::vector<int> triggerFolderDecisions;
1024  triggerFolderDecisions_ = std::vector<int> (triggerFolderEventFlag_.size(), 0);
1025  // **** Get the TriggerResults container
1027  iEvent.getByToken(triggerResultsToken_, triggerResults);
1028 
1029  if( triggerResults.isValid()) {
1031  // Check how many HLT triggers are in triggerResults
1032  int ntrigs = (*triggerResults).size();
1033  if (verbose_) std::cout << "ntrigs=" << ntrigs << std::endl;
1034  // If index=ntrigs, this HLT trigger doesn't exist in the HLT table for this data.
1035  for (std::vector<GenericTriggerEventFlag *>::const_iterator it = triggerFolderEventFlag_.begin(); it!=triggerFolderEventFlag_.end();it++) {
1036  unsigned int pos = it - triggerFolderEventFlag_.begin();
1037  bool fd = (*it)->accept(iEvent, iSetup);
1038  triggerFolderDecisions_[pos] = fd;
1039  }
1040  allTriggerDecisions_.clear();
1041  for (unsigned int i=0;i<allTriggerNames_.size();++i) {
1042  allTriggerDecisions_.push_back((*triggerResults).accept(i));
1043  //std::cout<<"TR "<<(*triggerResults).size()<<" "<<(*triggerResults).accept(i)<<" "<<allTriggerNames_[i]<<std::endl;
1044  }
1045  }
1046 
1047  // ==========================================================
1048  // MET information
1049 
1050  // **** Get the MET container
1055 
1056  //if(isTCMet_){
1057  //iEvent.getByToken(tcMetToken_, tcmetcoll);
1058  //if(!tcmetcoll.isValid()) return;
1059  //}
1060  if(isCaloMet_){
1061  iEvent.getByToken(caloMetToken_, calometcoll);
1062  if(!calometcoll.isValid()) return;
1063  }
1064  if(isPFMet_){
1065  iEvent.getByToken(pfMetToken_, pfmetcoll);
1066  if(!pfmetcoll.isValid()) return;
1067  }
1068  if(isMiniAODMet_){
1069  iEvent.getByToken(patMetToken_, patmetcoll);
1070  if(!patmetcoll.isValid()) return;
1071  }
1072 
1073  const MET *met=NULL;
1074  const pat::MET *patmet=NULL;
1075  const PFMET *pfmet=NULL;
1076  const CaloMET *calomet=NULL;
1077  //if(isTCMet_){
1078  //met=&(tcmetcoll->front());
1079  //}
1080  if(isPFMet_){
1081  met=&(pfmetcoll->front());
1082  pfmet=&(pfmetcoll->front());
1083  }
1084  if(isCaloMet_){
1085  met=&(calometcoll->front());
1086  calomet=&(calometcoll->front());
1087  }
1088  if(isMiniAODMet_){
1089  met=&(patmetcoll->front());
1090  patmet=&(patmetcoll->front());
1091  }
1092 
1093  LogTrace(metname)<<"[METAnalyzer] Call to the MET analyzer";
1094 
1095  // ==========================================================
1096  // TCMET
1097 
1098  //if (/*isTCMet_ || */(isCaloMet_ && metCollectionLabel_.label() == "corMetGlobalMuons")) {
1099 
1100  //iEvent.getByToken(MuonToken_, muonHandle_);
1101  //iEvent.getByToken(TrackToken_, trackHandle_);
1102  //iEvent.getByToken(ElectronToken_, electronHandle_);
1103  //iEvent.getByToken(BeamspotToken_, beamSpotHandle_);
1104  //iEvent.getByToken(tcMETValueMapToken_,tcMetValueMapHandle_);
1105 
1106  //if(!muonHandle_.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve muon data require by MET Task";
1107  //if(!trackHandle_.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve track data require by MET Task";
1108  //if(!electronHandle_.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve electron data require by MET Task";
1109  //if(!beamSpotHandle_.isValid()) edm::LogInfo("OutputInfo") << "falied to retrieve beam spot data require by MET Task";
1110 
1111  //beamSpot_ = ( beamSpotHandle_.isValid() ) ? beamSpotHandle_->position() : math::XYZPoint(0, 0, 0);
1112  //}
1113 
1114  // ==========================================================
1115  //
1116 
1117  edm::Handle<bool> HBHENoiseFilterResultHandle;
1118  bool HBHENoiseFilterResult=true;
1119  if(!isMiniAODMet_){//not checked for MiniAOD
1120  iEvent.getByToken(hbheNoiseFilterResultToken_, HBHENoiseFilterResultHandle);
1121  if (!HBHENoiseFilterResultHandle.isValid()) {
1122  LogDebug("") << "METAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
1123  if (verbose_) std::cout << "METAnalyzer: Could not find HBHENoiseFilterResult" << std::endl;
1124  }
1125  HBHENoiseFilterResult = *HBHENoiseFilterResultHandle;
1126  }
1127  // ==========================================================
1128  bool bJetID = false;
1129  bool bDiJetID = false;
1130  // Jet ID -------------------------------------------------------
1131  //
1132 
1137 
1138  int collsize=-1;
1139 
1140  if (isCaloMet_){
1141  iEvent.getByToken(caloJetsToken_, caloJets);
1142  if (!caloJets.isValid()) {
1143  LogDebug("") << "METAnalyzer: Could not find calojet product" << std::endl;
1144  if (verbose_) std::cout << "METAnalyzer: Could not find calojet product" << std::endl;
1145  }
1146  collsize=caloJets->size();
1147  }
1149  //if (isTCMet_){
1150  //iEvent.getByToken(jptJetsToken_, jptJets);
1151  //if (!jptJets.isValid()) {
1152  // LogDebug("") << "METAnalyzer: Could not find jptjet product" << std::endl;
1153  // if (verbose_) std::cout << "METAnalyzer: Could not find jptjet product" << std::endl;
1154  //}
1155  //collsize=jptJets->size();
1156  //}*/
1157 
1158  edm::Handle< edm::ValueMap<reco::JetID> >jetID_ValueMap_Handle;
1159  if(/*isTCMet_ || */isCaloMet_){
1160  if(!runcosmics_){
1161  iEvent.getByToken(jetID_ValueMapToken_,jetID_ValueMap_Handle);
1162  }
1163  }
1164 
1165  if (isMiniAODMet_){ iEvent.getByToken(patJetsToken_, patJets);
1166  if (!patJets.isValid()) {
1167  LogDebug("") << "METAnalyzer: Could not find patjet product" << std::endl;
1168  if (verbose_) std::cout << "METAnalyzer: Could not find patjet product" << std::endl;
1169  }
1170  collsize=patJets->size();
1171  }
1172 
1173  if (isPFMet_){ iEvent.getByToken(pfJetsToken_, pfJets);
1174  if (!pfJets.isValid()) {
1175  LogDebug("") << "METAnalyzer: Could not find pfjet product" << std::endl;
1176  if (verbose_) std::cout << "METAnalyzer: Could not find pfjet product" << std::endl;
1177  }
1178  collsize=pfJets->size();
1179  }
1180 
1181  unsigned int ind1=-1;
1182  double pt1=-1;
1183  bool pass_jetID1=false;
1184  unsigned int ind2=-1;
1185  double pt2=-1;
1186  bool pass_jetID2=false;
1187 
1189  bool pass_correction_flag=false;
1190  if(!isMiniAODMet_){
1191  iEvent.getByToken(jetCorrectorToken_, jetCorr);
1192  if (jetCorr.isValid()){
1193  pass_correction_flag=true;
1194  }
1195  }else{
1196  pass_correction_flag=true;
1197  }
1198  //do loose jet ID-> check threshold on corrected jets
1199  for (int ijet=0; ijet<collsize; ijet++) {
1200  double pt_jet=-10;
1201  double scale=1.;
1202  bool iscleaned=false;
1203  if (pass_correction_flag) {
1204  if(isCaloMet_){
1205  scale = jetCorr->correction((*caloJets)[ijet]);
1206  }
1207  //if(isTCMet_){
1208  //scale = jetCorr->correction((*jptJets)[ijet]);
1209  //}
1210  if(isPFMet_){
1211  scale = jetCorr->correction((*pfJets)[ijet]);
1212  }
1213  }
1214  if(isCaloMet_){
1215  pt_jet=scale*(*caloJets)[ijet].pt();
1216  if(pt_jet> ptThreshold_){
1217  reco::CaloJetRef calojetref(caloJets, ijet);
1218  if(!runcosmics_){
1219  reco::JetID jetID = (*jetID_ValueMap_Handle)[calojetref];
1220  iscleaned = jetIDFunctorLoose((*caloJets)[ijet], jetID);
1221  }else{
1222  iscleaned=true;
1223  }
1224  }
1225  }
1227  //if(isTCMet_){
1228  //pt_jet=scale*(*jptJets)[ijet].pt();
1229  //if(pt_jet> ptThreshold_){
1230  // const edm::RefToBase<reco::Jet>& rawJet = (*jptJets)[ijet].getCaloJetRef();
1231  // const reco::CaloJet *rawCaloJet = dynamic_cast<const reco::CaloJet*>(&*rawJet);
1232  // reco::CaloJetRef const theCaloJetRef = (rawJet).castTo<reco::CaloJetRef>();
1233  // if(!runcosmics_){
1234  // reco::JetID jetID = (*jetID_ValueMap_Handle)[theCaloJetRef];
1235  // iscleaned = jetIDFunctorLoose(*rawCaloJet, jetID);
1236  // }else{
1237  // iscleaned=true;
1238  // }
1239  //}
1240  //}*/
1241  if(isPFMet_){
1242  pt_jet=scale*(*pfJets)[ijet].pt();
1243  if(pt_jet> ptThreshold_){
1244  iscleaned = pfjetIDFunctorLoose((*pfJets)[ijet]);
1245  }
1246  }
1247  if(isMiniAODMet_){
1248  pt_jet=(*patJets)[ijet].pt();
1249  if(pt_jet> ptThreshold_){
1250  pat::strbitset stringbitset=pfjetIDFunctorLoose.getBitTemplate();
1251  iscleaned = pfjetIDFunctorLoose((*patJets)[ijet],stringbitset);
1252  }
1253  }
1254  if(iscleaned){
1255  bJetID=true;
1256  }
1257  if(pt_jet>pt1){
1258  pt2=pt1;
1259  ind2=ind1;
1260  pass_jetID2=pass_jetID1;
1261  pt1=pt_jet;
1262  ind1=ijet;
1263  pass_jetID1=iscleaned;
1264  }else if (pt_jet>pt2){
1265  pt2=pt_jet;
1266  ind2=ijet;
1267  pass_jetID2=iscleaned;
1268  }
1269  }
1270  if(pass_jetID1 && pass_jetID2){
1271  double dphi=-1.0;
1272  if(isCaloMet_){
1273  dphi=fabs((*caloJets)[ind1].phi()-(*caloJets)[ind2].phi());
1274  }
1276  //dphi=fabs((*jptJets)[ind1].phi()-(*jptJets)[ind2].phi());
1277  //}*/
1278  if(isPFMet_){
1279  dphi=fabs((*pfJets)[ind1].phi()-(*pfJets)[ind2].phi());
1280  }
1281  if(isMiniAODMet_){
1282  dphi=fabs((*patJets)[0].phi()-(*patJets)[1].phi());
1283  }
1284  if(dphi>acos(-1.)){
1285  dphi=2*acos(-1.)-dphi;
1286  }
1287  if(dphi>2.7){
1288  bDiJetID=true;
1289  }
1290  }
1291 
1292  // ==========================================================
1293  // HCAL Noise filter
1294 
1295  bool bHBHENoiseFilter = HBHENoiseFilterResult;
1296  // ==========================================================
1297  //Vertex information
1298  Handle<VertexCollection> vertexHandle;
1299  iEvent.getByToken(vertexToken_, vertexHandle);
1300 
1301  if (!vertexHandle.isValid()) {
1302  LogDebug("") << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
1303  if (verbose_) std::cout << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
1304  }
1305  numPV_ = 0;
1306  if ( vertexHandle.isValid() ){
1307  VertexCollection vertexCollection = *(vertexHandle.product());
1308  numPV_ = vertexCollection.size();
1309  }
1310  bool bPrimaryVertex = (bypassAllPVChecks_ || (numPV_>0));
1311  // ==========================================================
1312 
1314  iEvent.getByToken( gtToken_, gtReadoutRecord);
1315 
1316  bool techTriggerResultBxM2 = false;
1317  bool techTriggerResultBxM1 = false;
1318  bool techTriggerResultBx0 = false;
1319 
1320  if (!gtReadoutRecord.isValid()) {
1321  LogDebug("") << "METAnalyzer: Could not find GT readout record" << std::endl;
1322  if (verbose_) std::cout << "METAnalyzer: Could not find GT readout record product" << std::endl;
1323  }else{
1324  // trigger results before mask for BxInEvent -2 (E), -1 (F), 0 (L1A), 1, 2
1325  const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxM2 = gtReadoutRecord->technicalTriggerWord(-2);
1326  const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxM1 = gtReadoutRecord->technicalTriggerWord(-1);
1327  const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBx0 = gtReadoutRecord->technicalTriggerWord();
1328  //const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxG = gtReadoutRecord->technicalTriggerWord(1);
1329  //const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxH = gtReadoutRecord->technicalTriggerWord(2);
1330  if (m_bitAlgTechTrig_ > -1) {
1331  techTriggerResultBx0 = technicalTriggerWordBeforeMaskBx0.at(m_bitAlgTechTrig_);
1332  if(techTriggerResultBx0!=0){
1333  techTriggerResultBxM2 = technicalTriggerWordBeforeMaskBxM2.at(m_bitAlgTechTrig_);
1334  techTriggerResultBxM1 = technicalTriggerWordBeforeMaskBxM1.at(m_bitAlgTechTrig_);
1335  }
1336  }
1337  }
1338 
1339  int trigger_flag=0;
1340  if(techTriggerResultBx0 && techTriggerResultBxM2 && techTriggerResultBxM1){//current and previous two bunches filled
1341  trigger_flag=2;
1342  }
1343  if(techTriggerResultBx0 && techTriggerResultBxM1){//current and previous bunch filled
1344  trigger_flag=1;
1345  }
1346  if(techTriggerResultBx0 && !techTriggerResultBxM1){//current bunch filled, but previous bunch emtpy
1347  trigger_flag=-1;
1348  }
1349  if(techTriggerResultBx0 && !techTriggerResultBxM2 && !techTriggerResultBxM1){//current bunch filled, but previous two bunches emtpy
1350  trigger_flag=-2;
1351  }
1352 
1353  // DCS Filter
1354  bool bDCSFilter = (bypassAllDCSChecks_ || DCSFilter_->filter(iEvent, iSetup));
1355  // ==========================================================
1356  // Reconstructed MET Information - fill MonitorElements
1357  std::string DirName_old=DirName;
1358  for (std::vector<std::string>::const_iterator ic = folderNames_.begin();
1359  ic != folderNames_.end(); ic++){
1360  bool pass_selection = false;
1361  if ((*ic=="Uncleaned") &&(isCaloMet_ || bPrimaryVertex)){
1362  fillMESet(iEvent, DirName_old+"/"+*ic, *met,*patmet, *pfmet,*calomet,map_dijet_MEs,trigger_flag);
1363  pass_selection =true;
1364  }
1365  //take two lines out for first check
1366  if ((*ic=="Cleaned") &&bDCSFilter&&bHBHENoiseFilter&&bPrimaryVertex&&bJetID){
1367  fillMESet(iEvent, DirName_old+"/"+*ic, *met,*patmet,*pfmet,*calomet,map_dijet_MEs,trigger_flag);
1368  pass_selection=true;
1369  }
1370  if ((*ic=="DiJet" ) &&bDCSFilter&&bHBHENoiseFilter&& bPrimaryVertex&& bDiJetID){
1371  fillMESet(iEvent, DirName_old+"/"+*ic, *met,*patmet,*pfmet,*calomet,map_dijet_MEs,trigger_flag);
1372  pass_selection=true;
1373  }
1374  if(pass_selection && isPFMet_){
1375  DirName=DirName_old+"/"+*ic;
1376  }
1377  }
1378 }
1379 
1380 
1381 // ***********************************************************
1383  const reco::MET& met, const pat::MET& patmet, const reco::PFMET& pfmet, const reco::CaloMET& calomet,std::map<std::string,MonitorElement*>& map_of_MEs, int techTriggerCase)
1384 {
1385  bool bLumiSecPlot=fill_met_high_level_histo;
1386  bool fillPFCandidatePlots=false;
1387  if (DirName.find("Cleaned")) {
1388  fillPFCandidatePlots=true;
1389  fillMonitorElement(iEvent, DirName, std::string(""), met, patmet, pfmet, calomet, map_of_MEs,bLumiSecPlot,fillPFCandidatePlots,techTriggerCase);
1390  for (unsigned int i = 0; i<triggerFolderLabels_.size(); i++) {
1391  fillPFCandidatePlots=false;
1392  if (triggerFolderDecisions_[i]){
1393  fillMonitorElement(iEvent, DirName, triggerFolderLabels_[i], met, patmet, pfmet, calomet, map_of_MEs,bLumiSecPlot,fillPFCandidatePlots,techTriggerCase);
1394  }
1395  }
1396  }else if (DirName.find("DiJet")) {
1397  fillMonitorElement(iEvent, DirName, std::string(""), met, patmet, pfmet, calomet, map_of_MEs,bLumiSecPlot,fillPFCandidatePlots,techTriggerCase);
1398  for (unsigned int i = 0; i<triggerFolderLabels_.size(); i++) {
1399  if (triggerFolderDecisions_[i]) fillMonitorElement(iEvent, DirName, triggerFolderLabels_[i], met, patmet, pfmet, calomet, map_of_MEs,bLumiSecPlot,fillPFCandidatePlots,techTriggerCase);
1400  }
1401  }else{
1402  fillMonitorElement(iEvent, DirName, std::string(""), met, patmet, pfmet, calomet, map_of_MEs,bLumiSecPlot,fillPFCandidatePlots,techTriggerCase);
1403  }
1404 
1405 
1406 }
1407 
1408 // ***********************************************************
1410  std::string subFolderName,
1411  const reco::MET& met,const pat::MET & patmet, const reco::PFMET & pfmet, const reco::CaloMET &calomet, std::map<std::string,MonitorElement*>& map_of_MEs,bool bLumiSecPlot, bool fillPFCandidatePlots,int techTriggerCase)
1412 {
1413 // Reconstructed MET Information
1414  double SumET = met.sumEt();
1415  double METSig = met.mEtSig();
1416  //double Ez = met.e_longitudinal();
1417  double MET = met.pt();
1418  double MEx = met.px();
1419  double MEy = met.py();
1420  double METPhi = met.phi();
1421  //
1422  int myLuminosityBlock;
1423  myLuminosityBlock = iEvent.luminosityBlock();
1424  //
1425 
1426  if (subFolderName!=""){
1427  DirName = DirName +"/"+subFolderName;
1428  }
1429 
1430  hTrigger = map_of_MEs[DirName+"/triggerResults"];
1431  if (hTrigger && hTrigger->getRootObject()) {
1432  for (unsigned int i = 0; i<allTriggerDecisions_.size();i++){
1433  if(i<(unsigned int)hTrigger->getNbinsX()){
1434  hTrigger->Fill(i + .5, allTriggerDecisions_[i]);
1435  }
1436  }
1437  }
1438 
1439 
1440  hMEx = map_of_MEs[DirName+"/"+"MEx"]; if (hMEx && hMEx->getRootObject()) hMEx ->Fill(MEx);
1441  hMEy = map_of_MEs[DirName+"/"+"MEy"]; if (hMEy && hMEy->getRootObject()) hMEy ->Fill(MEy);
1442  hMET = map_of_MEs[DirName+"/"+"MET"]; if (hMET && hMET->getRootObject()) hMET ->Fill(MET);
1443  hMETPhi = map_of_MEs[DirName+"/"+"METPhi"]; if (hMETPhi && hMETPhi->getRootObject()) hMETPhi ->Fill(METPhi);
1444  hSumET = map_of_MEs[DirName+"/"+"SumET"]; if (hSumET && hSumET->getRootObject()) hSumET ->Fill(SumET);
1445  hMETSig = map_of_MEs[DirName+"/"+"METSig"]; if (hMETSig && hMETSig->getRootObject()) hMETSig ->Fill(METSig);
1446  hMET_logx = map_of_MEs[DirName+"/"+"MET_logx"]; if (hMET_logx && hMET_logx->getRootObject()) hMET_logx->Fill(log10(MET));
1447  hSumET_logx = map_of_MEs[DirName+"/"+"SumET_logx"]; if (hSumET_logx && hSumET_logx->getRootObject()) hSumET_logx->Fill(log10(SumET));
1448 
1449  // Fill NPV profiles
1450  //--------------------------------------------------------------------------
1451  meMEx_profile = map_of_MEs[DirName + "/MEx_profile"];
1452  meMEy_profile = map_of_MEs[DirName + "/MEy_profile"];
1453  meMET_profile = map_of_MEs[DirName + "/MET_profile"];
1454  meSumET_profile = map_of_MEs[DirName + "/SumET_profile"];
1455 
1456  if (meMEx_profile && meMEx_profile ->getRootObject()) meMEx_profile ->Fill(numPV_, MEx);
1457  if (meMEy_profile && meMEy_profile ->getRootObject()) meMEy_profile ->Fill(numPV_, MEy);
1458  if (meMET_profile && meMET_profile ->getRootObject()) meMET_profile ->Fill(numPV_, MET);
1459  if (meSumET_profile && meSumET_profile->getRootObject()) meSumET_profile->Fill(numPV_, SumET);
1460 
1461  if(isCaloMet_){
1462  //const reco::CaloMETCollection *calometcol = calometcoll.product();
1463  //const reco::CaloMET *calomet;
1464  //calomet = &(calometcol->front());
1465 
1466  double caloEtFractionHadronic = calomet.etFractionHadronic();
1467  double caloEmEtFraction = calomet.emEtFraction();
1468 
1469  double caloHadEtInHB = calomet.hadEtInHB();
1470  double caloHadEtInHO = calomet.hadEtInHO();
1471  double caloHadEtInHE = calomet.hadEtInHE();
1472  double caloHadEtInHF = calomet.hadEtInHF();
1473  double caloEmEtInEB = calomet.emEtInEB();
1474  double caloEmEtInEE = calomet.emEtInEE();
1475  double caloEmEtInHF = calomet.emEtInHF();
1476 
1477  hCaloHadEtInHB = map_of_MEs[DirName+"/"+"CaloHadEtInHB"]; if (hCaloHadEtInHB && hCaloHadEtInHB->getRootObject()) hCaloHadEtInHB->Fill(caloHadEtInHB);
1478  hCaloHadEtInHO = map_of_MEs[DirName+"/"+"CaloHadEtInHO"]; if (hCaloHadEtInHO && hCaloHadEtInHO->getRootObject()) hCaloHadEtInHO->Fill(caloHadEtInHO);
1479  hCaloHadEtInHE = map_of_MEs[DirName+"/"+"CaloHadEtInHE"]; if (hCaloHadEtInHE && hCaloHadEtInHE->getRootObject()) hCaloHadEtInHE->Fill(caloHadEtInHE);
1480  hCaloHadEtInHF = map_of_MEs[DirName+"/"+"CaloHadEtInHF"]; if (hCaloHadEtInHF && hCaloHadEtInHF->getRootObject()) hCaloHadEtInHF->Fill(caloHadEtInHF);
1481  hCaloEmEtInEB = map_of_MEs[DirName+"/"+"CaloEmEtInEB"]; if (hCaloEmEtInEB && hCaloEmEtInEB->getRootObject()) hCaloEmEtInEB->Fill(caloEmEtInEB);
1482  hCaloEmEtInEE = map_of_MEs[DirName+"/"+"CaloEmEtInEE"]; if (hCaloEmEtInEE && hCaloEmEtInEE->getRootObject()) hCaloEmEtInEE->Fill(caloEmEtInEE);
1483  hCaloEmEtInHF = map_of_MEs[DirName+"/"+"CaloEmEtInHF"]; if (hCaloEmEtInHF && hCaloEmEtInHF->getRootObject()) hCaloEmEtInHF->Fill(caloEmEtInHF);
1484 
1485  hCaloMETPhi020 = map_of_MEs[DirName+"/"+"CaloMETPhi020"]; if (MET> 20. && hCaloMETPhi020 && hCaloMETPhi020->getRootObject()) { hCaloMETPhi020->Fill(METPhi);}
1486 
1487 
1488  hCaloEtFractionHadronic = map_of_MEs[DirName+"/"+"CaloEtFractionHadronic"]; if (hCaloEtFractionHadronic && hCaloEtFractionHadronic->getRootObject()) hCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
1489  hCaloEmEtFraction = map_of_MEs[DirName+"/"+"CaloEmEtFraction"]; if (hCaloEmEtFraction && hCaloEmEtFraction->getRootObject()) hCaloEmEtFraction->Fill(caloEmEtFraction);
1490  hCaloEmEtFraction020 = map_of_MEs[DirName+"/"+"CaloEmEtFraction020"]; if (MET> 20. && hCaloEmEtFraction020 && hCaloEmEtFraction020->getRootObject()) hCaloEmEtFraction020->Fill(caloEmEtFraction);
1491  //if (metCollectionLabel_.label() == "corMetGlobalMuons" ) {
1492 
1493  //for( reco::MuonCollection::const_iterator muonit = muonHandle_->begin(); muonit != muonHandle_->end(); muonit++ ) {
1494  // const reco::TrackRef siTrack = muonit->innerTrack();
1495  // hCalomuPt = map_of_MEs[DirName+"/"+"CalomuonPt"];
1496  // if (hCalomuPt && hCalomuPt->getRootObject()) hCalomuPt->Fill( muonit->p4().pt() );
1497  // hCalomuEta = map_of_MEs[DirName+"/"+"CalomuonEta"]; if (hCalomuEta && hCalomuEta->getRootObject()) hCalomuEta->Fill( muonit->p4().eta() );
1498  // hCalomuNhits = map_of_MEs[DirName+"/"+"CalomuonNhits"]; if (hCalomuNhits && hCalomuNhits->getRootObject()) hCalomuNhits->Fill( siTrack.isNonnull() ? siTrack->numberOfValidHits() : -999 );
1499  // hCalomuChi2 = map_of_MEs[DirName+"/"+"CalomuonNormalizedChi2"]; if (hCalomuChi2 && hCalomuChi2->getRootObject()) hCalomuChi2->Fill( siTrack.isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
1500  // double d0 = siTrack.isNonnull() ? -1 * siTrack->dxy( beamSpot_) : -999;
1501  // hCalomuD0 = map_of_MEs[DirName+"/"+"CalomuonD0"]; if (hCalomuD0 && hCalomuD0->getRootObject()) hCalomuD0->Fill( d0 );
1502  //}
1503 
1504  //const unsigned int nMuons = muonHandle_->size();
1505  //for( unsigned int mus = 0; mus < nMuons; mus++ ) {
1506  // reco::MuonRef muref( muonHandle_, mus);
1507  // reco::MuonMETCorrectionData muCorrData = (*tcMetValueMapHandle_)[muref];
1508  // hCaloMExCorrection = map_of_MEs[DirName+"/"+"CaloMExCorrection"]; if (hCaloMExCorrection && hCaloMExCorrection->getRootObject()) hCaloMExCorrection-> Fill(muCorrData.corrY());
1509  // hCaloMEyCorrection = map_of_MEs[DirName+"/"+"CaloMEyCorrection"]; if (hCaloMEyCorrection && hCaloMEyCorrection->getRootObject()) hCaloMEyCorrection-> Fill(muCorrData.corrX());
1510  // hCaloMuonCorrectionFlag = map_of_MEs[DirName+"/"+"CaloMuonCorrectionFlag"]; if (hCaloMuonCorrectionFlag && hCaloMuonCorrectionFlag->getRootObject()) hCaloMuonCorrectionFlag-> Fill(muCorrData.type());
1511  //}
1512  //}
1513  }
1514 
1515  if(isPFMet_){
1516 
1517  if(fillPFCandidatePlots && fillCandidateMap_histos){
1518  for (unsigned int i=0;i<countsPFCand_.size();i++) {
1519  countsPFCand_[i]=0;
1520  MExPFCand_[i]=0.;
1521  MEyPFCand_[i]=0.;
1522  }
1523 
1524  // typedef std::vector<reco::PFCandidate> pfCand;
1526  iEvent.getByToken(pflowToken_, particleFlow);
1527 
1528  float pt_sum_CHF_Barrel=0;
1529  float pt_sum_CHF_Endcap_plus=0;
1530  float pt_sum_CHF_Endcap_minus=0;
1531  float pt_sum_NHF_Barrel=0;
1532  float pt_sum_NHF_Endcap_plus=0;
1533  float pt_sum_NHF_Endcap_minus=0;
1534  float pt_sum_PhF_Barrel=0;
1535  float pt_sum_PhF_Endcap_plus=0;
1536  float pt_sum_PhF_Endcap_minus=0;
1537  float pt_sum_HFH_plus=0;
1538  float pt_sum_HFH_minus=0;
1539  float pt_sum_HFE_plus=0;
1540  float pt_sum_HFE_minus=0;
1541 
1542 
1543  float px_chargedHadronsBarrel=0;
1544  float py_chargedHadronsBarrel=0;
1545  float px_chargedHadronsEndcapPlus=0;
1546  float py_chargedHadronsEndcapPlus=0;
1547  float px_chargedHadronsEndcapMinus=0;
1548  float py_chargedHadronsEndcapMinus=0;
1549  float px_neutralHadronsBarrel=0;
1550  float py_neutralHadronsBarrel=0;
1551  float px_neutralHadronsEndcapPlus=0;
1552  float py_neutralHadronsEndcapPlus=0;
1553  float px_neutralHadronsEndcapMinus=0;
1554  float py_neutralHadronsEndcapMinus=0;
1555  float px_PhotonsBarrel=0;
1556  float py_PhotonsBarrel=0;
1557  float px_PhotonsEndcapPlus=0;
1558  float py_PhotonsEndcapPlus=0;
1559  float px_PhotonsEndcapMinus=0;
1560  float py_PhotonsEndcapMinus=0;
1561  float px_HFHadronsPlus=0;
1562  float py_HFHadronsPlus=0;
1563  float px_HFHadronsMinus=0;
1564  float py_HFHadronsMinus=0;
1565  float px_HFEGammasPlus=0;
1566  float py_HFEGammasPlus=0;
1567  float px_HFEGammasMinus=0;
1568  float py_HFEGammasMinus=0;
1569  for (unsigned int i = 0; i < particleFlow->size(); i++) {
1570  const reco::PFCandidate& c = particleFlow->at(i);
1571  if(c.particleId()==1){//charged hadrons
1572  //endcap minus
1573  if(c.eta()>(-3.0)&& c.eta()<(-1.392)){
1574  px_chargedHadronsEndcapMinus-=c.px();
1575  py_chargedHadronsEndcapMinus-=c.py();
1576  pt_sum_CHF_Endcap_minus+=c.et();
1577  }else if(c.eta()>=(-1.392)&& c.eta()<=1.392){//barrel
1578  px_chargedHadronsBarrel-=c.px();
1579  py_chargedHadronsBarrel-=c.py();
1580  pt_sum_CHF_Barrel+=c.et();
1581  }else if(c.eta()>1.392 && c.eta()<3.0){//endcap plus
1582  px_chargedHadronsEndcapPlus-=c.px();
1583  py_chargedHadronsEndcapPlus-=c.py();
1584  pt_sum_CHF_Endcap_plus+=c.et();
1585  }
1586  }
1587  if(c.particleId()==5){//neutral hadrons
1588  //endcap minus
1589  if(c.eta()>(-3.0)&& c.eta()<(-1.392)){
1590  px_neutralHadronsEndcapMinus-=c.px();
1591  py_neutralHadronsEndcapMinus-=c.py();
1592  pt_sum_NHF_Endcap_minus+=c.et();
1593  }else if(c.eta()>=(-1.392)&& c.eta()<=1.392){
1594  px_neutralHadronsBarrel-=c.px();
1595  py_neutralHadronsBarrel-=c.py();
1596  pt_sum_NHF_Barrel+=c.et();
1597  }else if(c.eta()>1.392 && c.eta()<3.0){
1598  px_neutralHadronsEndcapPlus-=c.px();
1599  py_neutralHadronsEndcapPlus-=c.py();
1600  pt_sum_NHF_Endcap_plus+=c.et();
1601  }
1602  }
1603  if(c.particleId()==4){//photons
1604  //endcap minus
1605  if(c.eta()>(-3.0)&& c.eta()<(-1.479)){
1606  px_PhotonsEndcapMinus-=c.px();
1607  py_PhotonsEndcapMinus-=c.py();
1608  pt_sum_PhF_Endcap_plus+=c.et();
1609  }else if(c.eta()>=(-1.479)&& c.eta()<=1.479){
1610  px_PhotonsBarrel-=c.px();
1611  py_PhotonsBarrel-=c.py();
1612  pt_sum_PhF_Barrel+=c.et();
1613  }else if(c.eta()>1.479 && c.eta()<3.0){
1614  px_PhotonsEndcapPlus-=c.px();
1615  py_PhotonsEndcapPlus-=c.py();
1616  pt_sum_PhF_Endcap_minus+=c.et();
1617  }
1618  }
1619  if(c.particleId()==6){//HFHadrons
1620  //forward minus
1621  if(c.eta()>(-5.20)&& c.eta()<-2.901376){
1622  pt_sum_HFH_minus+=c.et();
1623  px_HFHadronsMinus-=c.px();
1624  py_HFHadronsMinus-=c.py();
1625  }else if(c.eta()>2.901376 && c.eta()<5.20){//forward plus
1626  px_HFHadronsPlus-=c.px();
1627  py_HFHadronsPlus-=c.py();
1628  pt_sum_HFH_plus+=c.et();
1629  }
1630  }
1631  if(c.particleId()==7){//HFEGammas
1632  //forward minus
1633  if(c.eta()>(-5.20)&& c.eta()<-2.901376){
1634  pt_sum_HFE_minus+=c.et();
1635  px_HFEGammasMinus-=c.px();
1636  py_HFEGammasMinus-=c.py();
1637  }else if(c.eta()>2.901376 && c.eta()<5.20){//forward plus
1638  px_HFEGammasPlus-=c.px();
1639  py_HFEGammasPlus-=c.py();
1640  pt_sum_HFE_plus+=c.et();
1641  }
1642  }
1643  for (unsigned int j=0; j<typePFCand_.size(); j++) {
1644  if (c.particleId()==typePFCand_[j]) {
1645  //second check for endcap, if inside barrel Max and Min symmetric around 0
1646  if ( ((c.eta()>etaMinPFCand_[j]) && (c.eta()<etaMaxPFCand_[j])) || ((c.eta()> (-etaMaxPFCand_[j])) && (c.eta()< (-etaMinPFCand_[j]))) ){
1647  countsPFCand_[j]+=1;
1648  MExPFCand_[j]-=c.px();
1649  MEyPFCand_[j]-=c.py();
1650  ptPFCand_[j] = map_of_MEs[DirName + "/"+ptPFCand_name_[j]];
1651  if ( ptPFCand_[j] && ptPFCand_[j]->getRootObject()) ptPFCand_[j]->Fill(c.eta(), c.phi(), c.pt());
1652  occupancyPFCand_[j] = map_of_MEs[DirName + "/"+occupancyPFCand_name_[j]];
1653  if ( occupancyPFCand_[j] && occupancyPFCand_[j]->getRootObject()) occupancyPFCand_[j]->Fill(c.eta(), c.phi());
1654  }
1655  }
1656  }
1657  //fill quantities for isolated charged hadron quantities
1658  //only for charged hadrons
1659  if ( c.particleId() == 1 && c.pt() > ptMinCand_ ){
1660  // At least 1 GeV in HCAL
1661  double ecalRaw = c.rawEcalEnergy();
1662  double hcalRaw = c.rawHcalEnergy();
1663  if ( (ecalRaw + hcalRaw) > hcalMin_ ){
1664  const PFCandidate::ElementsInBlocks& theElements = c.elementsInBlocks();
1665  if( theElements.empty() ) continue;
1666  unsigned int iTrack=-999;
1667  std::vector<unsigned int> iECAL;// =999;
1668  std::vector<unsigned int> iHCAL;// =999;
1669  const reco::PFBlockRef blockRef = theElements[0].first;
1670  const edm::OwnVector<reco::PFBlockElement>& elements = blockRef->elements();
1671  // Check that there is only one track in the block.
1672  unsigned int nTracks = 0;
1673  for(unsigned int iEle=0; iEle<elements.size(); iEle++) {
1674  // Find the tracks in the block
1675  PFBlockElement::Type type = elements[iEle].type();
1676  switch( type ) {
1677  case PFBlockElement::TRACK:
1678  iTrack = iEle;
1679  nTracks++;
1680  break;
1681  case PFBlockElement::ECAL:
1682  iECAL.push_back( iEle );
1683  break;
1684  case PFBlockElement::HCAL:
1685  iHCAL.push_back( iEle );
1686  break;
1687  default:
1688  continue;
1689  }
1690  }
1691  if ( nTracks == 1 ){
1692  // Characteristics of the track
1693  const reco::PFBlockElementTrack& et = dynamic_cast<const reco::PFBlockElementTrack &>( elements[iTrack] );
1694  mProfileIsoPFChHad_TrackOccupancy=map_of_MEs[DirName+"/"+"IsoPfChHad_Track_profile"];
1695  if (mProfileIsoPFChHad_TrackOccupancy && mProfileIsoPFChHad_TrackOccupancy->getRootObject()) mProfileIsoPFChHad_TrackOccupancy->Fill(et.trackRef()->eta(),et.trackRef()->phi());
1696  mProfileIsoPFChHad_TrackPt=map_of_MEs[DirName+"/"+"IsoPfChHad_TrackPt"];
1697  if (mProfileIsoPFChHad_TrackPt && mProfileIsoPFChHad_TrackPt->getRootObject()) mProfileIsoPFChHad_TrackPt->Fill(et.trackRef()->eta(),et.trackRef()->phi(),et.trackRef()->pt());
1698  //ECAL element
1699  for(unsigned int ii=0;ii<iECAL.size();ii++) {
1700  const reco::PFBlockElementCluster& eecal = dynamic_cast<const reco::PFBlockElementCluster &>( elements[ iECAL[ii] ] );
1701  if(fabs(eecal.clusterRef()->eta())<1.479){
1702  mProfileIsoPFChHad_EcalOccupancyCentral=map_of_MEs[DirName+"/"+"IsoPfChHad_ECAL_profile_central"];
1703  if (mProfileIsoPFChHad_EcalOccupancyCentral && mProfileIsoPFChHad_EcalOccupancyCentral->getRootObject()) mProfileIsoPFChHad_EcalOccupancyCentral->Fill(eecal.clusterRef()->eta(),eecal.clusterRef()->phi());
1704  mProfileIsoPFChHad_EMPtCentral=map_of_MEs[DirName+"/"+"IsoPfChHad_EMPt_central"];
1705  if (mProfileIsoPFChHad_EMPtCentral && mProfileIsoPFChHad_EMPtCentral->getRootObject()) mProfileIsoPFChHad_EMPtCentral->Fill(eecal.clusterRef()->eta(),eecal.clusterRef()->phi(),eecal.clusterRef()->pt());
1706  }else{
1707  mProfileIsoPFChHad_EcalOccupancyEndcap=map_of_MEs[DirName+"/"+"IsoPfChHad_ECAL_profile_endcap"];
1708  if (mProfileIsoPFChHad_EcalOccupancyEndcap && mProfileIsoPFChHad_EcalOccupancyEndcap->getRootObject()) mProfileIsoPFChHad_EcalOccupancyEndcap->Fill(eecal.clusterRef()->eta(),eecal.clusterRef()->phi());
1709  mProfileIsoPFChHad_EMPtEndcap=map_of_MEs[DirName+"/"+"IsoPfChHad_EMPt_endcap"];
1710  if (mProfileIsoPFChHad_EMPtEndcap && mProfileIsoPFChHad_EMPtEndcap->getRootObject()) mProfileIsoPFChHad_EMPtEndcap->Fill(eecal.clusterRef()->eta(),eecal.clusterRef()->phi(),eecal.clusterRef()->pt());
1711  }
1712  }
1713 
1714  //HCAL element
1715  for(unsigned int ii=0;ii<iHCAL.size();ii++) {
1716  const reco::PFBlockElementCluster& ehcal = dynamic_cast<const reco::PFBlockElementCluster &>( elements[ iHCAL[ii] ] );
1717  if(fabs(ehcal.clusterRef()->eta())<1.740){
1718  mProfileIsoPFChHad_HcalOccupancyCentral=map_of_MEs[DirName+"/"+"IsoPfChHad_HCAL_profile_central"];
1719  if (mProfileIsoPFChHad_HcalOccupancyCentral && mProfileIsoPFChHad_HcalOccupancyCentral->getRootObject()) mProfileIsoPFChHad_HcalOccupancyCentral->Fill(ehcal.clusterRef()->eta(),ehcal.clusterRef()->phi());
1720  mProfileIsoPFChHad_HadPtCentral=map_of_MEs[DirName+"/"+"IsoPfChHad_HadPt_central"];
1721  if (mProfileIsoPFChHad_HadPtCentral && mProfileIsoPFChHad_HadPtCentral->getRootObject()) mProfileIsoPFChHad_HadPtCentral->Fill(ehcal.clusterRef()->eta(),ehcal.clusterRef()->phi(),ehcal.clusterRef()->pt());
1722  }else{
1723  mProfileIsoPFChHad_HcalOccupancyEndcap=map_of_MEs[DirName+"/"+"IsoPfChHad_HCAL_profile_endcap"];
1724  if (mProfileIsoPFChHad_HcalOccupancyEndcap && mProfileIsoPFChHad_HcalOccupancyEndcap->getRootObject()) mProfileIsoPFChHad_HcalOccupancyEndcap->Fill(ehcal.clusterRef()->eta(),ehcal.clusterRef()->phi());
1725  mProfileIsoPFChHad_HadPtEndcap=map_of_MEs[DirName+"/"+"IsoPfChHad_HadPt_endcap"];
1726  if (mProfileIsoPFChHad_HadPtEndcap && mProfileIsoPFChHad_HadPtEndcap->getRootObject()) mProfileIsoPFChHad_HadPtEndcap->Fill(ehcal.clusterRef()->eta(),ehcal.clusterRef()->phi(),ehcal.clusterRef()->pt());
1727  }
1728  }
1729  }
1730  }
1731  }
1732  }
1733 
1734  for (unsigned int j=0; j<countsPFCand_.size(); j++) {
1735  profilePFCand_x_[j] = map_of_MEs[DirName + "/"+profilePFCand_x_name_[j]];
1736  if(profilePFCand_x_[j] && profilePFCand_x_[j]->getRootObject()) profilePFCand_x_[j]->Fill(countsPFCand_[j], MExPFCand_[j]);
1737  profilePFCand_y_[j] = map_of_MEs[DirName + "/"+profilePFCand_y_name_[j]];
1738  if(profilePFCand_y_[j] && profilePFCand_y_[j]->getRootObject()) profilePFCand_y_[j]->Fill(countsPFCand_[j], MEyPFCand_[j]);
1739  multiplicityPFCand_[j] = map_of_MEs[DirName + "/"+multiplicityPFCand_name_[j]];
1740  if(multiplicityPFCand_[j] && multiplicityPFCand_[j]->getRootObject()) multiplicityPFCand_[j]->Fill(countsPFCand_[j]);
1741  }
1742  meCHF_Barrel=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionBarrel"]; if(meCHF_Barrel && meCHF_Barrel->getRootObject()) meCHF_Barrel->Fill(pt_sum_CHF_Barrel/pfmet.sumEt());
1743  meCHF_EndcapPlus=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapPlus"]; if(meCHF_EndcapPlus && meCHF_EndcapPlus->getRootObject()) meCHF_EndcapPlus->Fill(pt_sum_CHF_Endcap_plus/pfmet.sumEt());
1744  meCHF_EndcapMinus=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapMinus"]; if(meCHF_EndcapMinus && meCHF_EndcapMinus->getRootObject()) meCHF_EndcapMinus->Fill(pt_sum_CHF_Endcap_minus/pfmet.sumEt());
1745  meNHF_Barrel=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionBarrel"]; if(meNHF_Barrel && meNHF_Barrel->getRootObject()) meNHF_Barrel->Fill(pt_sum_NHF_Barrel/pfmet.sumEt());
1746  meNHF_EndcapPlus=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus"]; if(meNHF_EndcapPlus && meNHF_EndcapPlus->getRootObject()) meNHF_EndcapPlus->Fill(pt_sum_NHF_Endcap_plus/pfmet.sumEt());
1747  meNHF_EndcapMinus=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus"]; if(meNHF_EndcapMinus && meNHF_EndcapMinus->getRootObject()) meNHF_EndcapMinus->Fill(pt_sum_NHF_Endcap_minus/pfmet.sumEt());
1748  mePhF_Barrel=map_of_MEs[DirName+"/"+"PfPhotonEtFractionBarrel"]; if(mePhF_Barrel && mePhF_Barrel->getRootObject()) mePhF_Barrel->Fill(pt_sum_PhF_Barrel/pfmet.sumEt());
1749  mePhF_EndcapPlus=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapPlus"]; if(mePhF_EndcapPlus && mePhF_EndcapPlus->getRootObject()) mePhF_EndcapPlus->Fill(pt_sum_PhF_Endcap_plus/pfmet.sumEt());
1750  mePhF_EndcapMinus=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapMinus"]; if(mePhF_EndcapMinus && mePhF_EndcapMinus->getRootObject()) mePhF_EndcapMinus->Fill(pt_sum_PhF_Endcap_minus/pfmet.sumEt());
1751  meHFHadF_Plus=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionPlus"]; if(meHFHadF_Plus && meHFHadF_Plus->getRootObject()) meHFHadF_Plus->Fill(pt_sum_HFH_plus/pfmet.sumEt());
1752  meHFHadF_Minus=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionMinus"]; if(meHFHadF_Minus && meHFHadF_Minus->getRootObject()) meHFHadF_Minus->Fill(pt_sum_HFH_minus/pfmet.sumEt());
1753  meHFEMF_Plus=map_of_MEs[DirName+"/"+"PfHFEMEtFractionPlus"]; if(meHFEMF_Plus && meHFEMF_Plus->getRootObject()) meHFEMF_Plus->Fill(pt_sum_HFE_plus/pfmet.sumEt());
1754  meHFEMF_Minus=map_of_MEs[DirName+"/"+"PfHFEMEtFractionMinus"]; if(meHFEMF_Minus && meHFEMF_Minus->getRootObject()) meHFEMF_Minus->Fill(pt_sum_HFE_minus/pfmet.sumEt());
1755  mePhotonEtFraction_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"PfPhotonEtFraction_BXm2BXm1Filled"]; if ( mePhotonEtFraction_BXm1Bxm2Filled && mePhotonEtFraction_BXm1Bxm2Filled ->getRootObject()) mePhotonEtFraction_BXm1Bxm2Filled ->Fill(pfmet.photonEtFraction());
1756  meNeutralHadronEtFraction_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"PfNeutralHadronEtFraction_BXm2BXm1Filled"]; if ( meNeutralHadronEtFraction_BXm1Bxm2Filled && meNeutralHadronEtFraction_BXm1Bxm2Filled ->getRootObject()) meNeutralHadronEtFraction_BXm1Bxm2Filled ->Fill(pfmet.neutralHadronEtFraction());
1757  meChargedHadronEtFraction_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"PfChargedHadronEtFraction_BXm2BXm1Filled"]; if ( meChargedHadronEtFraction_BXm1Bxm2Filled && meChargedHadronEtFraction_BXm1Bxm2Filled ->getRootObject()) meChargedHadronEtFraction_BXm1Bxm2Filled ->Fill(pfmet.chargedHadronEtFraction());
1758  meMET_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"MET_BXm2BXm1Filled"]; if ( meMET_BXm1Bxm2Filled && meMET_BXm1Bxm2Filled ->getRootObject()) meMET_BXm1Bxm2Filled ->Fill(pfmet.pt());
1759  meSumET_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"SumET_BXm2BXm1Filled"]; if ( meSumET_BXm1Bxm2Filled && meSumET_BXm1Bxm2Filled ->getRootObject()) meSumET_BXm1Bxm2Filled ->Fill(pfmet.sumEt());
1760  meMETPhiChargedHadronsBarrel = map_of_MEs[DirName+"/"+"METPhiChargedHadronsBarrel"];if(meMETPhiChargedHadronsBarrel && meMETPhiChargedHadronsBarrel ->getRootObject())meMETPhiChargedHadronsBarrel->Fill(atan2(py_chargedHadronsBarrel,px_chargedHadronsBarrel));
1761  meMETPhiChargedHadronsEndcapPlus = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapPlus"];if(meMETPhiChargedHadronsEndcapPlus && meMETPhiChargedHadronsEndcapPlus ->getRootObject())meMETPhiChargedHadronsEndcapPlus->Fill(atan2(py_chargedHadronsEndcapPlus,px_chargedHadronsEndcapPlus));
1762  meMETPhiChargedHadronsEndcapMinus = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapMinus"];if(meMETPhiChargedHadronsEndcapMinus && meMETPhiChargedHadronsEndcapMinus ->getRootObject())meMETPhiChargedHadronsEndcapMinus->Fill(atan2(py_chargedHadronsEndcapMinus,px_chargedHadronsEndcapMinus));
1763  meMETPhiNeutralHadronsBarrel = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsBarrel"];if(meMETPhiNeutralHadronsBarrel && meMETPhiNeutralHadronsBarrel ->getRootObject())meMETPhiNeutralHadronsBarrel->Fill(atan2(py_neutralHadronsBarrel,px_neutralHadronsBarrel));
1764  meMETPhiNeutralHadronsEndcapPlus = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapPlus"];if(meMETPhiNeutralHadronsEndcapPlus && meMETPhiNeutralHadronsEndcapPlus ->getRootObject())meMETPhiNeutralHadronsEndcapPlus->Fill(atan2(py_neutralHadronsEndcapPlus,px_neutralHadronsEndcapPlus));
1765  meMETPhiNeutralHadronsEndcapMinus = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapMinus"];if(meMETPhiNeutralHadronsEndcapMinus && meMETPhiNeutralHadronsEndcapMinus ->getRootObject())meMETPhiNeutralHadronsEndcapMinus->Fill(atan2(py_neutralHadronsEndcapMinus,px_neutralHadronsEndcapMinus));
1766  meMETPhiPhotonsBarrel = map_of_MEs[DirName+"/"+"METPhiPhotonsBarrel"];if(meMETPhiPhotonsBarrel && meMETPhiPhotonsBarrel ->getRootObject())meMETPhiPhotonsBarrel->Fill(atan2(py_PhotonsBarrel,px_PhotonsBarrel));
1767  meMETPhiPhotonsEndcapPlus = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapPlus"];if(meMETPhiPhotonsEndcapPlus && meMETPhiPhotonsEndcapPlus ->getRootObject())meMETPhiPhotonsEndcapPlus->Fill(atan2(py_PhotonsEndcapPlus,px_PhotonsEndcapPlus));
1768  meMETPhiPhotonsEndcapMinus = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapMinus"];if(meMETPhiPhotonsEndcapMinus && meMETPhiPhotonsEndcapMinus ->getRootObject())meMETPhiPhotonsEndcapMinus->Fill(atan2(py_PhotonsEndcapMinus,px_PhotonsEndcapMinus));
1769  meMETPhiHFHadronsPlus = map_of_MEs[DirName+"/"+"METPhiHFHadronsPlus"];if(meMETPhiHFHadronsPlus && meMETPhiHFHadronsPlus ->getRootObject())meMETPhiHFHadronsPlus->Fill(atan2(py_HFHadronsPlus,px_HFHadronsPlus));
1770  meMETPhiHFHadronsMinus = map_of_MEs[DirName+"/"+"METPhiHFHadronsMinus"];if(meMETPhiHFHadronsMinus && meMETPhiHFHadronsMinus ->getRootObject())meMETPhiHFHadronsMinus->Fill(atan2(py_HFHadronsMinus,px_HFHadronsMinus));
1771  meMETPhiHFEGammasPlus = map_of_MEs[DirName+"/"+"METPhiHFEGammasPlus"];if(meMETPhiHFEGammasPlus && meMETPhiHFEGammasPlus ->getRootObject())meMETPhiHFEGammasPlus->Fill(atan2(py_HFEGammasPlus,px_HFEGammasPlus));
1772  meMETPhiHFEGammasMinus = map_of_MEs[DirName+"/"+"METPhiHFEGammasMinus"];if(meMETPhiHFEGammasMinus && meMETPhiHFEGammasMinus ->getRootObject())meMETPhiHFEGammasMinus->Fill(atan2(py_HFEGammasMinus,px_HFEGammasMinus));
1773 
1774  //fill other diagnostic plots based on trigger decision
1775  if(techTriggerCase==2){//techTriggerResultBx0 && techTriggerResultBxM2 && techTriggerResultBxM1
1776  meCHF_Barrel_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm1BXm2Filled"]; if(meCHF_Barrel_BXm1BXm2Filled && meCHF_Barrel_BXm1BXm2Filled->getRootObject()) meCHF_Barrel_BXm1BXm2Filled->Fill(pt_sum_CHF_Barrel/pfmet.sumEt());
1777  meCHF_EndcapPlus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm1BXm2Filled"]; if(meCHF_EndcapPlus_BXm1BXm2Filled && meCHF_EndcapPlus_BXm1BXm2Filled->getRootObject()) meCHF_EndcapPlus_BXm1BXm2Filled->Fill(pt_sum_CHF_Endcap_plus/pfmet.sumEt());
1778  meCHF_EndcapMinus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm1BXm2Filled"]; if(meCHF_EndcapMinus_BXm1BXm2Filled && meCHF_EndcapMinus_BXm1BXm2Filled->getRootObject()) meCHF_EndcapMinus_BXm1BXm2Filled->Fill(pt_sum_CHF_Endcap_minus/pfmet.sumEt());
1779  meNHF_Barrel_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm1BXm2Filled"]; if(meNHF_Barrel_BXm1BXm2Filled && meNHF_Barrel_BXm1BXm2Filled->getRootObject()) meNHF_Barrel_BXm1BXm2Filled->Fill(pt_sum_NHF_Barrel/pfmet.sumEt());
1780  meNHF_EndcapPlus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm1BXm2Filled"]; if(meNHF_EndcapPlus_BXm1BXm2Filled && meNHF_EndcapPlus_BXm1BXm2Filled->getRootObject()) meNHF_EndcapPlus_BXm1BXm2Filled->Fill(pt_sum_NHF_Endcap_plus/pfmet.sumEt());
1781  meNHF_EndcapMinus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm1BXm2Filled"]; if(meNHF_EndcapMinus_BXm1BXm2Filled && meNHF_EndcapMinus_BXm1BXm2Filled->getRootObject()) meNHF_EndcapMinus_BXm1BXm2Filled->Fill(pt_sum_NHF_Endcap_minus/pfmet.sumEt());
1782  mePhF_Barrel_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionBarrel_BXm1BXm2Filled"]; if(mePhF_Barrel_BXm1BXm2Filled && mePhF_Barrel_BXm1BXm2Filled->getRootObject()) mePhF_Barrel_BXm1BXm2Filled->Fill(pt_sum_PhF_Barrel/pfmet.sumEt());
1783  mePhF_EndcapPlus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm1BXm2Filled"]; if(mePhF_EndcapPlus_BXm1BXm2Filled && mePhF_EndcapPlus_BXm1BXm2Filled->getRootObject()) mePhF_EndcapPlus_BXm1BXm2Filled->Fill(pt_sum_PhF_Endcap_plus/pfmet.sumEt());
1784  mePhF_EndcapMinus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm1BXm2Filled"]; if(mePhF_EndcapMinus_BXm1BXm2Filled && mePhF_EndcapMinus_BXm1BXm2Filled->getRootObject()) mePhF_EndcapMinus_BXm1BXm2Filled->Fill(pt_sum_PhF_Endcap_minus/pfmet.sumEt());
1785  meHFHadF_Plus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionPlus_BXm1BXm2Filled"]; if(meHFHadF_Plus_BXm1BXm2Filled && meHFHadF_Plus_BXm1BXm2Filled->getRootObject()) meHFHadF_Plus_BXm1BXm2Filled->Fill(pt_sum_HFH_plus/pfmet.sumEt());
1786  meHFHadF_Minus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionMinus_BXm1BXm2Filled"]; if(meHFHadF_Minus_BXm1BXm2Filled && meHFHadF_Minus_BXm1BXm2Filled->getRootObject()) meHFHadF_Minus_BXm1BXm2Filled->Fill(pt_sum_HFH_minus/pfmet.sumEt());
1787  meHFEMF_Plus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfHFEMEtFractionPlus_BXm1BXm2Filled"]; if(meHFEMF_Plus_BXm1BXm2Filled && meHFEMF_Plus_BXm1BXm2Filled->getRootObject()) meHFEMF_Plus_BXm1BXm2Filled->Fill(pt_sum_HFE_plus/pfmet.sumEt());
1788  meHFEMF_Minus_BXm1BXm2Filled=map_of_MEs[DirName+"/"+"PfHFEMEtFractionMinus_BXm1BXm2Filled"]; if(meHFEMF_Minus_BXm1BXm2Filled && meHFEMF_Minus_BXm1BXm2Filled->getRootObject()) meHFEMF_Minus_BXm1BXm2Filled->Fill(pt_sum_HFE_minus/pfmet.sumEt());
1789  mePhotonEtFraction_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"PfPhotonEtFraction_BXm2BXm1Filled"]; if ( mePhotonEtFraction_BXm1Bxm2Filled && mePhotonEtFraction_BXm1Bxm2Filled ->getRootObject()) mePhotonEtFraction_BXm1Bxm2Filled ->Fill(pfmet.photonEtFraction());
1790  meNeutralHadronEtFraction_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"PfNeutralHadronEtFraction_BXm2BXm1Filled"]; if ( meNeutralHadronEtFraction_BXm1Bxm2Filled && meNeutralHadronEtFraction_BXm1Bxm2Filled ->getRootObject()) meNeutralHadronEtFraction_BXm1Bxm2Filled ->Fill(pfmet.neutralHadronEtFraction());
1791  meChargedHadronEtFraction_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"PfChargedHadronEtFraction_BXm2BXm1Filled"]; if ( meChargedHadronEtFraction_BXm1Bxm2Filled && meChargedHadronEtFraction_BXm1Bxm2Filled ->getRootObject()) meChargedHadronEtFraction_BXm1Bxm2Filled ->Fill(pfmet.chargedHadronEtFraction());
1792  meMET_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"MET_BXm2BXm1Filled"]; if ( meMET_BXm1Bxm2Filled && meMET_BXm1Bxm2Filled ->getRootObject()) meMET_BXm1Bxm2Filled ->Fill(pfmet.pt());
1793  meSumET_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"SumET_BXm2BXm1Filled"]; if ( meSumET_BXm1Bxm2Filled && meSumET_BXm1Bxm2Filled ->getRootObject()) meSumET_BXm1Bxm2Filled ->Fill(pfmet.sumEt());
1794  meMETPhiChargedHadronsBarrel_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsBarrel_BXm2BXm1Filled"];if(meMETPhiChargedHadronsBarrel_BXm1Bxm2Filled && meMETPhiChargedHadronsBarrel_BXm1Bxm2Filled ->getRootObject())meMETPhiChargedHadronsBarrel_BXm1Bxm2Filled->Fill(atan2(py_chargedHadronsBarrel,px_chargedHadronsBarrel));
1795  meMETPhiChargedHadronsEndcapPlus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm2BXm1Filled"];if(meMETPhiChargedHadronsEndcapPlus_BXm1Bxm2Filled && meMETPhiChargedHadronsEndcapPlus_BXm1Bxm2Filled ->getRootObject())meMETPhiChargedHadronsEndcapPlus_BXm1Bxm2Filled->Fill(atan2(py_chargedHadronsEndcapPlus,px_chargedHadronsEndcapPlus));
1796  meMETPhiChargedHadronsEndcapMinus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm2BXm1Filled"];if(meMETPhiChargedHadronsEndcapMinus_BXm1Bxm2Filled && meMETPhiChargedHadronsEndcapMinus_BXm1Bxm2Filled ->getRootObject())meMETPhiChargedHadronsEndcapMinus_BXm1Bxm2Filled->Fill(atan2(py_chargedHadronsEndcapMinus,px_chargedHadronsEndcapMinus));
1797  meMETPhiNeutralHadronsBarrel_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsBarrel_BXm2BXm1Filled"];if(meMETPhiNeutralHadronsBarrel_BXm1Bxm2Filled && meMETPhiNeutralHadronsBarrel_BXm1Bxm2Filled ->getRootObject())meMETPhiNeutralHadronsBarrel_BXm1Bxm2Filled->Fill(atan2(py_neutralHadronsBarrel,px_neutralHadronsBarrel));
1798  meMETPhiNeutralHadronsEndcapPlus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm2BXm1Filled"];if(meMETPhiNeutralHadronsEndcapPlus_BXm1Bxm2Filled && meMETPhiNeutralHadronsEndcapPlus_BXm1Bxm2Filled ->getRootObject())meMETPhiNeutralHadronsEndcapPlus_BXm1Bxm2Filled->Fill(atan2(py_neutralHadronsEndcapPlus,px_neutralHadronsEndcapPlus));
1799  meMETPhiNeutralHadronsEndcapMinus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm2BXm1Filled"];if(meMETPhiNeutralHadronsEndcapMinus_BXm1Bxm2Filled && meMETPhiNeutralHadronsEndcapMinus_BXm1Bxm2Filled ->getRootObject())meMETPhiNeutralHadronsEndcapMinus_BXm1Bxm2Filled->Fill(atan2(py_neutralHadronsEndcapMinus,px_neutralHadronsEndcapMinus));
1800  meMETPhiPhotonsBarrel_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsBarrel_BXm2BXm1Filled"];if(meMETPhiPhotonsBarrel_BXm1Bxm2Filled && meMETPhiPhotonsBarrel_BXm1Bxm2Filled ->getRootObject())meMETPhiPhotonsBarrel_BXm1Bxm2Filled->Fill(atan2(py_PhotonsBarrel,px_PhotonsBarrel));
1801  meMETPhiPhotonsEndcapPlus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapPlus_BXm2BXm1Filled"];if(meMETPhiPhotonsEndcapPlus_BXm1Bxm2Filled && meMETPhiPhotonsEndcapPlus_BXm1Bxm2Filled ->getRootObject())meMETPhiPhotonsEndcapPlus_BXm1Bxm2Filled->Fill(atan2(py_PhotonsEndcapPlus,px_PhotonsEndcapPlus));
1802  meMETPhiPhotonsEndcapMinus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapMinus_BXm2BXm1Filled"];if(meMETPhiPhotonsEndcapMinus_BXm1Bxm2Filled && meMETPhiPhotonsEndcapMinus_BXm1Bxm2Filled ->getRootObject())meMETPhiPhotonsEndcapMinus_BXm1Bxm2Filled->Fill(atan2(py_PhotonsEndcapMinus,px_PhotonsEndcapMinus));
1803  meMETPhiHFHadronsPlus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiHFHadronsPlus_BXm2BXm1Filled"];if(meMETPhiHFHadronsPlus_BXm1Bxm2Filled && meMETPhiHFHadronsPlus_BXm1Bxm2Filled ->getRootObject())meMETPhiHFHadronsPlus_BXm1Bxm2Filled->Fill(atan2(py_HFHadronsPlus,px_HFHadronsPlus));
1804  meMETPhiHFHadronsMinus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiHFHadronsMinus_BXm2BXm1Filled"];if(meMETPhiHFHadronsMinus_BXm1Bxm2Filled && meMETPhiHFHadronsMinus_BXm1Bxm2Filled ->getRootObject())meMETPhiHFHadronsMinus_BXm1Bxm2Filled->Fill(atan2(py_HFHadronsMinus,px_HFHadronsMinus));
1805  meMETPhiHFEGammasPlus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiHFEGammasPlus_BXm2BXm1Filled"];if(meMETPhiHFEGammasPlus_BXm1Bxm2Filled && meMETPhiHFEGammasPlus_BXm1Bxm2Filled ->getRootObject())meMETPhiHFEGammasPlus_BXm1Bxm2Filled->Fill(atan2(py_HFEGammasPlus,px_HFEGammasPlus));
1806  meMETPhiHFEGammasMinus_BXm1Bxm2Filled = map_of_MEs[DirName+"/"+"METPhiHFEGammasMinus_BXm2BXm1Filled"];if(meMETPhiHFEGammasMinus_BXm1Bxm2Filled && meMETPhiHFEGammasMinus_BXm1Bxm2Filled ->getRootObject())meMETPhiHFEGammasMinus_BXm1Bxm2Filled->Fill(atan2(py_HFEGammasMinus,px_HFEGammasMinus));
1807  }
1808  if(techTriggerCase==1){//techTriggerResultBx0 && techTriggerResultBxM1
1809  meCHF_Barrel_BXm1Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm1Filled"]; if(meCHF_Barrel_BXm1Filled && meCHF_Barrel_BXm1Filled->getRootObject()) meCHF_Barrel_BXm1Filled->Fill(pt_sum_CHF_Barrel/pfmet.sumEt());
1810  meCHF_EndcapPlus_BXm1Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm1Filled"]; if(meCHF_EndcapPlus_BXm1Filled && meCHF_EndcapPlus_BXm1Filled->getRootObject()) meCHF_EndcapPlus_BXm1Filled->Fill(pt_sum_CHF_Endcap_plus/pfmet.sumEt());
1811  meCHF_EndcapMinus_BXm1Filled=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm1Filled"]; if(meCHF_EndcapMinus_BXm1Filled && meCHF_EndcapMinus_BXm1Filled->getRootObject()) meCHF_EndcapMinus_BXm1Filled->Fill(pt_sum_CHF_Endcap_minus/pfmet.sumEt());
1812  meNHF_Barrel_BXm1Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm1Filled"]; if(meNHF_Barrel_BXm1Filled && meNHF_Barrel_BXm1Filled->getRootObject()) meNHF_Barrel_BXm1Filled->Fill(pt_sum_NHF_Barrel/pfmet.sumEt());
1813  meNHF_EndcapPlus_BXm1Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm1Filled"]; if(meNHF_EndcapPlus_BXm1Filled && meNHF_EndcapPlus_BXm1Filled->getRootObject()) meNHF_EndcapPlus_BXm1Filled->Fill(pt_sum_NHF_Endcap_plus/pfmet.sumEt());
1814  meNHF_EndcapMinus_BXm1Filled=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm1Filled"]; if(meNHF_EndcapMinus_BXm1Filled && meNHF_EndcapMinus_BXm1Filled->getRootObject()) meNHF_EndcapMinus_BXm1Filled->Fill(pt_sum_NHF_Endcap_minus/pfmet.sumEt());
1815  mePhF_Barrel_BXm1Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionBarrel_BXm1Filled"]; if(mePhF_Barrel_BXm1Filled && mePhF_Barrel_BXm1Filled->getRootObject()) mePhF_Barrel_BXm1Filled->Fill(pt_sum_PhF_Barrel/pfmet.sumEt());
1816  mePhF_EndcapPlus_BXm1Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm1Filled"]; if(mePhF_EndcapPlus_BXm1Filled && mePhF_EndcapPlus_BXm1Filled->getRootObject()) mePhF_EndcapPlus_BXm1Filled->Fill(pt_sum_PhF_Endcap_plus/pfmet.sumEt());
1817  mePhF_EndcapMinus_BXm1Filled=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm1Filled"]; if(mePhF_EndcapMinus_BXm1Filled && mePhF_EndcapMinus_BXm1Filled->getRootObject()) mePhF_EndcapMinus_BXm1Filled->Fill(pt_sum_PhF_Endcap_minus/pfmet.sumEt());
1818  meHFHadF_Plus_BXm1Filled=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionPlus_BXm1Filled"]; if(meHFHadF_Plus_BXm1Filled && meHFHadF_Plus_BXm1Filled->getRootObject()) meHFHadF_Plus_BXm1Filled->Fill(pt_sum_HFH_plus/pfmet.sumEt());
1819  meHFHadF_Minus_BXm1Filled=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionMinus_BXm1Filled"]; if(meHFHadF_Minus_BXm1Filled && meHFHadF_Minus_BXm1Filled->getRootObject()) meHFHadF_Minus_BXm1Filled->Fill(pt_sum_HFH_minus/pfmet.sumEt());
1820  meHFEMF_Plus_BXm1Filled=map_of_MEs[DirName+"/"+"PfHFEMEtFractionPlus_BXm1Filled"]; if(meHFEMF_Plus_BXm1Filled && meHFEMF_Plus_BXm1Filled->getRootObject()) meHFEMF_Plus_BXm1Filled->Fill(pt_sum_HFE_plus/pfmet.sumEt());
1821  meHFEMF_Minus_BXm1Filled=map_of_MEs[DirName+"/"+"PfHFEMEtFractionMinus_BXm1Filled"]; if(meHFEMF_Minus_BXm1Filled && meHFEMF_Minus_BXm1Filled->getRootObject()) meHFEMF_Minus_BXm1Filled->Fill(pt_sum_HFE_minus/pfmet.sumEt());
1822  mePhotonEtFraction_BXm1Filled = map_of_MEs[DirName+"/"+"PfPhotonEtFraction_BXm1Filled_BXm1Filled"]; if ( mePhotonEtFraction_BXm1Filled && mePhotonEtFraction_BXm1Filled ->getRootObject()) mePhotonEtFraction_BXm1Filled ->Fill(pfmet.photonEtFraction());
1823  meNeutralHadronEtFraction_BXm1Filled = map_of_MEs[DirName+"/"+"PfNeutralHadronEtFraction_BXm1Filled"]; if ( meNeutralHadronEtFraction_BXm1Filled && meNeutralHadronEtFraction_BXm1Filled ->getRootObject()) meNeutralHadronEtFraction_BXm1Filled ->Fill(pfmet.neutralHadronEtFraction());
1824  meChargedHadronEtFraction_BXm1Filled = map_of_MEs[DirName+"/"+"PfChargedHadronEtFraction_BXm1Filled"]; if ( meChargedHadronEtFraction_BXm1Filled && meChargedHadronEtFraction_BXm1Filled ->getRootObject()) meChargedHadronEtFraction_BXm1Filled ->Fill(pfmet.chargedHadronEtFraction());
1825  meMET_BXm1Filled = map_of_MEs[DirName+"/"+"MET_BXm1Filled"]; if ( meMET_BXm1Filled && meMET_BXm1Filled ->getRootObject()) meMET_BXm1Filled ->Fill(pfmet.pt());
1826  meSumET_BXm1Filled = map_of_MEs[DirName+"/"+"SumET_BXm1Filled"]; if ( meSumET_BXm1Filled && meSumET_BXm1Filled ->getRootObject()) meSumET_BXm1Filled ->Fill(pfmet.sumEt());
1827  meMETPhiChargedHadronsBarrel_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsBarrel_BXm1Filled"];if(meMETPhiChargedHadronsBarrel_BXm1Filled && meMETPhiChargedHadronsBarrel_BXm1Filled ->getRootObject())meMETPhiChargedHadronsBarrel_BXm1Filled->Fill(atan2(py_chargedHadronsBarrel,px_chargedHadronsBarrel));
1828  meMETPhiChargedHadronsEndcapPlus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm1Filled"];if(meMETPhiChargedHadronsEndcapPlus_BXm1Filled && meMETPhiChargedHadronsEndcapPlus_BXm1Filled ->getRootObject())meMETPhiChargedHadronsEndcapPlus_BXm1Filled->Fill(atan2(py_chargedHadronsEndcapPlus,px_chargedHadronsEndcapPlus));
1829  meMETPhiChargedHadronsEndcapMinus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm1Filled"];if(meMETPhiChargedHadronsEndcapMinus_BXm1Filled && meMETPhiChargedHadronsEndcapMinus_BXm1Filled ->getRootObject())meMETPhiChargedHadronsEndcapMinus_BXm1Filled->Fill(atan2(py_chargedHadronsEndcapMinus,px_chargedHadronsEndcapMinus));
1830  meMETPhiNeutralHadronsBarrel_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsBarrel_BXm1Filled"];if(meMETPhiNeutralHadronsBarrel_BXm1Filled && meMETPhiNeutralHadronsBarrel_BXm1Filled ->getRootObject())meMETPhiNeutralHadronsBarrel_BXm1Filled->Fill(atan2(py_neutralHadronsBarrel,px_neutralHadronsBarrel));
1831  meMETPhiNeutralHadronsEndcapPlus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm1Filled"];if(meMETPhiNeutralHadronsEndcapPlus_BXm1Filled && meMETPhiNeutralHadronsEndcapPlus_BXm1Filled ->getRootObject())meMETPhiNeutralHadronsEndcapPlus_BXm1Filled->Fill(atan2(py_neutralHadronsEndcapPlus,px_neutralHadronsEndcapPlus));
1832  meMETPhiNeutralHadronsEndcapMinus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm1Filled"];if(meMETPhiNeutralHadronsEndcapMinus_BXm1Filled && meMETPhiNeutralHadronsEndcapMinus_BXm1Filled ->getRootObject())meMETPhiNeutralHadronsEndcapMinus_BXm1Filled->Fill(atan2(py_neutralHadronsEndcapMinus,px_neutralHadronsEndcapMinus));
1833  meMETPhiPhotonsBarrel_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsBarrel_BXm1Filled"];if(meMETPhiPhotonsBarrel_BXm1Filled && meMETPhiPhotonsBarrel_BXm1Filled ->getRootObject())meMETPhiPhotonsBarrel_BXm1Filled->Fill(atan2(py_PhotonsBarrel,px_PhotonsBarrel));
1834  meMETPhiPhotonsEndcapPlus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapPlus_BXm1Filled"];if(meMETPhiPhotonsEndcapPlus_BXm1Filled && meMETPhiPhotonsEndcapPlus_BXm1Filled ->getRootObject())meMETPhiPhotonsEndcapPlus_BXm1Filled->Fill(atan2(py_PhotonsEndcapPlus,px_PhotonsEndcapPlus));
1835  meMETPhiPhotonsEndcapMinus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapMinus_BXm1Filled"];if(meMETPhiPhotonsEndcapMinus_BXm1Filled && meMETPhiPhotonsEndcapMinus_BXm1Filled ->getRootObject())meMETPhiPhotonsEndcapMinus_BXm1Filled->Fill(atan2(py_PhotonsEndcapMinus,px_PhotonsEndcapMinus));
1836  meMETPhiHFHadronsPlus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiHFHadronsPlus_BXm1Filled"];if(meMETPhiHFHadronsPlus_BXm1Filled && meMETPhiHFHadronsPlus_BXm1Filled ->getRootObject())meMETPhiHFHadronsPlus_BXm1Filled->Fill(atan2(py_HFHadronsPlus,px_HFHadronsPlus));
1837  meMETPhiHFHadronsMinus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiHFHadronsMinus_BXm1Filled"];if(meMETPhiHFHadronsMinus_BXm1Filled && meMETPhiHFHadronsMinus_BXm1Filled ->getRootObject())meMETPhiHFHadronsMinus_BXm1Filled->Fill(atan2(py_HFHadronsMinus,px_HFHadronsMinus));
1838  meMETPhiHFEGammasPlus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiHFEGammasPlus_BXm1Filled"];if(meMETPhiHFEGammasPlus_BXm1Filled && meMETPhiHFEGammasPlus_BXm1Filled ->getRootObject())meMETPhiHFEGammasPlus_BXm1Filled->Fill(atan2(py_HFEGammasPlus,px_HFEGammasPlus));
1839  meMETPhiHFEGammasMinus_BXm1Filled = map_of_MEs[DirName+"/"+"METPhiHFEGammasMinus_BXm1Filled"];if(meMETPhiHFEGammasMinus_BXm1Filled && meMETPhiHFEGammasMinus_BXm1Filled ->getRootObject())meMETPhiHFEGammasMinus_BXm1Filled->Fill(atan2(py_HFEGammasMinus,px_HFEGammasMinus));
1840  }
1841  if(techTriggerCase==(-2)){//techTriggerResultBx0 && !techTriggerResultBxM2 && !techTriggerResultBxM1
1842  meCHF_Barrel_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm1BXm2Empty"]; if(meCHF_Barrel_BXm1BXm2Empty && meCHF_Barrel_BXm1BXm2Empty->getRootObject()) meCHF_Barrel_BXm1BXm2Empty->Fill(pt_sum_CHF_Barrel/pfmet.sumEt());
1843  meCHF_EndcapPlus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm1BXm2Empty"]; if(meCHF_EndcapPlus_BXm1BXm2Empty && meCHF_EndcapPlus_BXm1BXm2Empty->getRootObject()) meCHF_EndcapPlus_BXm1BXm2Empty->Fill(pt_sum_CHF_Endcap_plus/pfmet.sumEt());
1844  meCHF_EndcapMinus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm1BXm2Empty"]; if(meCHF_EndcapMinus_BXm1BXm2Empty && meCHF_EndcapMinus_BXm1BXm2Empty->getRootObject()) meCHF_EndcapMinus_BXm1BXm2Empty->Fill(pt_sum_CHF_Endcap_minus/pfmet.sumEt());
1845  meNHF_Barrel_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm1BXm2Empty"]; if(meNHF_Barrel_BXm1BXm2Empty && meNHF_Barrel_BXm1BXm2Empty->getRootObject()) meNHF_Barrel_BXm1BXm2Empty->Fill(pt_sum_NHF_Barrel/pfmet.sumEt());
1846  meNHF_EndcapPlus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm1BXm2Empty"]; if(meNHF_EndcapPlus_BXm1BXm2Empty && meNHF_EndcapPlus_BXm1BXm2Empty->getRootObject()) meNHF_EndcapPlus_BXm1BXm2Empty->Fill(pt_sum_NHF_Endcap_plus/pfmet.sumEt());
1847  meNHF_EndcapMinus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm1BXm2Empty"]; if(meNHF_EndcapMinus_BXm1BXm2Empty && meNHF_EndcapMinus_BXm1BXm2Empty->getRootObject()) meNHF_EndcapMinus_BXm1BXm2Empty->Fill(pt_sum_NHF_Endcap_minus/pfmet.sumEt());
1848  mePhF_Barrel_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionBarrel_BXm1BXm2Empty"]; if(mePhF_Barrel_BXm1BXm2Empty && mePhF_Barrel_BXm1BXm2Empty->getRootObject()) mePhF_Barrel_BXm1BXm2Empty->Fill(pt_sum_PhF_Barrel/pfmet.sumEt());
1849  mePhF_EndcapPlus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm1BXm2Empty"]; if(mePhF_EndcapPlus_BXm1BXm2Empty && mePhF_EndcapPlus_BXm1BXm2Empty->getRootObject()) mePhF_EndcapPlus_BXm1BXm2Empty->Fill(pt_sum_PhF_Endcap_plus/pfmet.sumEt());
1850  mePhF_EndcapMinus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm1BXm2Empty"]; if(mePhF_EndcapMinus_BXm1BXm2Empty && mePhF_EndcapMinus_BXm1BXm2Empty->getRootObject()) mePhF_EndcapMinus_BXm1BXm2Empty->Fill(pt_sum_PhF_Endcap_minus/pfmet.sumEt());
1851  meHFHadF_Plus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionPlus_BXm1BXm2Empty"]; if(meHFHadF_Plus_BXm1BXm2Empty && meHFHadF_Plus_BXm1BXm2Empty->getRootObject()) meHFHadF_Plus_BXm1BXm2Empty->Fill(pt_sum_HFH_plus/pfmet.sumEt());
1852  meHFHadF_Minus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionMinus_BXm1BXm2Empty"]; if(meHFHadF_Minus_BXm1BXm2Empty && meHFHadF_Minus_BXm1BXm2Empty->getRootObject()) meHFHadF_Minus_BXm1BXm2Empty->Fill(pt_sum_HFH_minus/pfmet.sumEt());
1853  meHFEMF_Plus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfHFEMEtFractionPlus_BXm1BXm2Empty"]; if(meHFEMF_Plus_BXm1BXm2Empty && meHFEMF_Plus_BXm1BXm2Empty->getRootObject()) meHFEMF_Plus_BXm1BXm2Empty->Fill(pt_sum_HFE_plus/pfmet.sumEt());
1854  meHFEMF_Minus_BXm1BXm2Empty=map_of_MEs[DirName+"/"+"PfHFEMEtFractionMinus_BXm1BXm2Empty"]; if(meHFEMF_Minus_BXm1BXm2Empty && meHFEMF_Minus_BXm1BXm2Empty->getRootObject()) meHFEMF_Minus_BXm1BXm2Empty->Fill(pt_sum_HFE_minus/pfmet.sumEt());
1855  mePhotonEtFraction_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PfPhotonEtFraction_BXm2BXm1Empty"]; if ( mePhotonEtFraction_BXm2BXm1Empty && mePhotonEtFraction_BXm2BXm1Empty ->getRootObject()) mePhotonEtFraction_BXm2BXm1Empty ->Fill(pfmet.photonEtFraction());
1856  meNeutralHadronEtFraction_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PfNeutralHadronEtFraction_BXm2BXm1Empty"]; if ( meNeutralHadronEtFraction_BXm2BXm1Empty && meNeutralHadronEtFraction_BXm2BXm1Empty ->getRootObject()) meNeutralHadronEtFraction_BXm2BXm1Empty ->Fill(pfmet.neutralHadronEtFraction());
1857  meChargedHadronEtFraction_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PfChargedHadronEtFraction_BXm2BXm1Empty"]; if ( meChargedHadronEtFraction_BXm2BXm1Empty && meChargedHadronEtFraction_BXm2BXm1Empty ->getRootObject()) meChargedHadronEtFraction_BXm2BXm1Empty ->Fill(pfmet.chargedHadronEtFraction());
1858  meMET_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"MET_BXm2BXm1Empty"]; if ( meMET_BXm2BXm1Empty && meMET_BXm2BXm1Empty ->getRootObject()) meMET_BXm2BXm1Empty ->Fill(pfmet.pt());
1859  meSumET_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"SumET_BXm2BXm1Empty"]; if ( meSumET_BXm2BXm1Empty && meSumET_BXm2BXm1Empty ->getRootObject()) meSumET_BXm2BXm1Empty ->Fill(pfmet.sumEt());
1860  meMETPhiChargedHadronsBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsBarrel_BXm2BXm1Empty"];if(meMETPhiChargedHadronsBarrel_BXm2BXm1Empty && meMETPhiChargedHadronsBarrel_BXm2BXm1Empty ->getRootObject())meMETPhiChargedHadronsBarrel_BXm2BXm1Empty->Fill(atan2(py_chargedHadronsBarrel,px_chargedHadronsBarrel));
1861  meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm2BXm1Empty"];if(meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty && meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty ->getRootObject())meMETPhiChargedHadronsEndcapPlus_BXm2BXm1Empty->Fill(atan2(py_chargedHadronsEndcapPlus,px_chargedHadronsEndcapPlus));
1862  meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm2BXm1Empty"];if(meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty && meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty ->getRootObject())meMETPhiChargedHadronsEndcapMinus_BXm2BXm1Empty->Fill(atan2(py_chargedHadronsEndcapMinus,px_chargedHadronsEndcapMinus));
1863  meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsBarrel_BXm2BXm1Empty"];if(meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty && meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty ->getRootObject())meMETPhiNeutralHadronsBarrel_BXm2BXm1Empty->Fill(atan2(py_neutralHadronsBarrel,px_neutralHadronsBarrel));
1864  meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty"];if(meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty && meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty ->getRootObject())meMETPhiNeutralHadronsEndcapPlus_BXm2BXm1Empty->Fill(atan2(py_neutralHadronsEndcapPlus,px_neutralHadronsEndcapPlus));
1865  meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty"];if(meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty && meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty ->getRootObject())meMETPhiNeutralHadronsEndcapMinus_BXm2BXm1Empty->Fill(atan2(py_neutralHadronsEndcapMinus,px_neutralHadronsEndcapMinus));
1866  meMETPhiPhotonsBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsBarrel_BXm2BXm1Empty"];if(meMETPhiPhotonsBarrel_BXm2BXm1Empty && meMETPhiPhotonsBarrel_BXm2BXm1Empty ->getRootObject())meMETPhiPhotonsBarrel_BXm2BXm1Empty->Fill(atan2(py_PhotonsBarrel,px_PhotonsBarrel));
1867  meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapPlus_BXm2BXm1Empty"];if(meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty && meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty ->getRootObject())meMETPhiPhotonsEndcapPlus_BXm2BXm1Empty->Fill(atan2(py_PhotonsEndcapPlus,px_PhotonsEndcapPlus));
1868  meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapMinus_BXm2BXm1Empty"];if(meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty && meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty ->getRootObject())meMETPhiPhotonsEndcapMinus_BXm2BXm1Empty->Fill(atan2(py_PhotonsEndcapMinus,px_PhotonsEndcapMinus));
1869  meMETPhiHFHadronsPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFHadronsPlus_BXm2BXm1Empty"];if(meMETPhiHFHadronsPlus_BXm2BXm1Empty && meMETPhiHFHadronsPlus_BXm2BXm1Empty ->getRootObject())meMETPhiHFHadronsPlus_BXm2BXm1Empty->Fill(atan2(py_HFHadronsPlus,px_HFHadronsPlus));
1870  meMETPhiHFHadronsMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFHadronsMinus_BXm2BXm1Empty"];if(meMETPhiHFHadronsMinus_BXm2BXm1Empty && meMETPhiHFHadronsMinus_BXm2BXm1Empty ->getRootObject())meMETPhiHFHadronsMinus_BXm2BXm1Empty->Fill(atan2(py_HFHadronsMinus,px_HFHadronsMinus));
1871  meMETPhiHFEGammasPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFEGammasPlus_BXm2BXm1Empty"];if(meMETPhiHFEGammasPlus_BXm2BXm1Empty && meMETPhiHFEGammasPlus_BXm2BXm1Empty ->getRootObject())meMETPhiHFEGammasPlus_BXm2BXm1Empty->Fill(atan2(py_HFEGammasPlus,px_HFEGammasPlus));
1872  meMETPhiHFEGammasMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFEGammasMinus_BXm2BXm1Empty"];if(meMETPhiHFEGammasMinus_BXm2BXm1Empty && meMETPhiHFEGammasMinus_BXm2BXm1Empty ->getRootObject())meMETPhiHFEGammasMinus_BXm2BXm1Empty->Fill(atan2(py_HFEGammasMinus,px_HFEGammasMinus));
1873  }
1874  if(techTriggerCase==(-1)){//techTriggerResultBx0 && !techTriggerResultBxM1
1875  meCHF_Barrel_BXm1Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionBarrel_BXm1Empty"]; if(meCHF_Barrel_BXm1Empty && meCHF_Barrel_BXm1Empty->getRootObject()) meCHF_Barrel_BXm1Empty->Fill(pt_sum_CHF_Barrel/pfmet.sumEt());
1876  meCHF_EndcapPlus_BXm1Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapPlus_BXm1Empty"]; if(meCHF_EndcapPlus_BXm1Empty && meCHF_EndcapPlus_BXm1Empty->getRootObject()) meCHF_EndcapPlus_BXm1Empty->Fill(pt_sum_CHF_Endcap_plus/pfmet.sumEt());
1877  meCHF_EndcapMinus_BXm1Empty=map_of_MEs[DirName+"/"+"PfChargedHadronEtFractionEndcapMinus_BXm1Empty"]; if(meCHF_EndcapMinus_BXm1Empty && meCHF_EndcapMinus_BXm1Empty->getRootObject()) meCHF_EndcapMinus_BXm1Empty->Fill(pt_sum_CHF_Endcap_minus/pfmet.sumEt());
1878  meNHF_Barrel_BXm1Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionBarrel_BXm1Empty"]; if(meNHF_Barrel_BXm1Empty && meNHF_Barrel_BXm1Empty->getRootObject()) meNHF_Barrel_BXm1Empty->Fill(pt_sum_NHF_Barrel/pfmet.sumEt());
1879  meNHF_EndcapPlus_BXm1Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapPlus_BXm1Empty"]; if(meNHF_EndcapPlus_BXm1Empty && meNHF_EndcapPlus_BXm1Empty->getRootObject()) meNHF_EndcapPlus_BXm1Empty->Fill(pt_sum_NHF_Endcap_plus/pfmet.sumEt());
1880  meNHF_EndcapMinus_BXm1Empty=map_of_MEs[DirName+"/"+"PfNeutralHadronEtFractionEndcapMinus_BXm1Empty"]; if(meNHF_EndcapMinus_BXm1Empty && meNHF_EndcapMinus_BXm1Empty->getRootObject()) meNHF_EndcapMinus_BXm1Empty->Fill(pt_sum_NHF_Endcap_minus/pfmet.sumEt());
1881  mePhF_Barrel_BXm1Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionBarrel_BXm1Empty"]; if(mePhF_Barrel_BXm1Empty && mePhF_Barrel_BXm1Empty->getRootObject()) mePhF_Barrel_BXm1Empty->Fill(pt_sum_PhF_Barrel/pfmet.sumEt());
1882  mePhF_EndcapPlus_BXm1Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapPlus_BXm1Empty"]; if(mePhF_EndcapPlus_BXm1Empty && mePhF_EndcapPlus_BXm1Empty->getRootObject()) mePhF_EndcapPlus_BXm1Empty->Fill(pt_sum_PhF_Endcap_plus/pfmet.sumEt());
1883  mePhF_EndcapMinus_BXm1Empty=map_of_MEs[DirName+"/"+"PfPhotonEtFractionEndcapMinus_BXm1Empty"]; if(mePhF_EndcapMinus_BXm1Empty && mePhF_EndcapMinus_BXm1Empty->getRootObject()) mePhF_EndcapMinus_BXm1Empty->Fill(pt_sum_PhF_Endcap_minus/pfmet.sumEt());
1884  meHFHadF_Plus_BXm1Empty=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionPlus_BXm1Empty"]; if(meHFHadF_Plus_BXm1Empty && meHFHadF_Plus_BXm1Empty->getRootObject()) meHFHadF_Plus_BXm1Empty->Fill(pt_sum_HFH_plus/pfmet.sumEt());
1885  meHFHadF_Minus_BXm1Empty=map_of_MEs[DirName+"/"+"PfHFHadronEtFractionMinus_BXm1Empty"]; if(meHFHadF_Minus_BXm1Empty && meHFHadF_Minus_BXm1Empty->getRootObject()) meHFHadF_Minus_BXm1Empty->Fill(pt_sum_HFH_minus/pfmet.sumEt());
1886  meHFEMF_Plus_BXm1Empty=map_of_MEs[DirName+"/"+"PfHFEMEtFractionPlus_BXm1Empty"]; if(meHFEMF_Plus_BXm1Empty && meHFEMF_Plus_BXm1Empty->getRootObject()) meHFEMF_Plus_BXm1Empty->Fill(pt_sum_HFE_plus/pfmet.sumEt());
1887  meHFEMF_Minus_BXm1Empty=map_of_MEs[DirName+"/"+"PfHFEMEtFractionMinus_BXm1Empty"]; if(meHFEMF_Minus_BXm1Empty && meHFEMF_Minus_BXm1Empty->getRootObject()) meHFEMF_Minus_BXm1Empty->Fill(pt_sum_HFE_minus/pfmet.sumEt());
1888  mePhotonEtFraction_BXm1Empty = map_of_MEs[DirName+"/"+"PfPhotonEtFraction_BXm1Empty"]; if ( mePhotonEtFraction_BXm1Empty && mePhotonEtFraction_BXm1Empty ->getRootObject()) mePhotonEtFraction_BXm1Empty ->Fill(pfmet.photonEtFraction());
1889  meNeutralHadronEtFraction_BXm1Empty = map_of_MEs[DirName+"/"+"PfNeutralHadronEtFraction_BXm1Empty"]; if ( meNeutralHadronEtFraction_BXm1Empty && meNeutralHadronEtFraction_BXm1Empty ->getRootObject()) meNeutralHadronEtFraction_BXm1Empty ->Fill(pfmet.neutralHadronEtFraction());
1890  meChargedHadronEtFraction_BXm1Empty = map_of_MEs[DirName+"/"+"PfChargedHadronEtFraction_BXm1Empty"]; if ( meChargedHadronEtFraction_BXm1Empty && meChargedHadronEtFraction_BXm1Empty ->getRootObject()) meChargedHadronEtFraction_BXm1Empty ->Fill(pfmet.chargedHadronEtFraction());
1891  meMET_BXm1Empty = map_of_MEs[DirName+"/"+"MET_BXm1Empty"]; if ( meMET_BXm1Empty && meMET_BXm1Empty ->getRootObject()) meMET_BXm1Empty ->Fill(pfmet.pt());
1892  meSumET_BXm1Empty = map_of_MEs[DirName+"/"+"SumET_BXm1Empty"]; if ( meSumET_BXm1Empty && meSumET_BXm1Empty ->getRootObject()) meSumET_BXm1Empty ->Fill(pfmet.sumEt());
1893  meMETPhiChargedHadronsBarrel_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsBarrel_BXm1Empty"];if(meMETPhiChargedHadronsBarrel_BXm1Empty && meMETPhiChargedHadronsBarrel_BXm1Empty ->getRootObject())meMETPhiChargedHadronsBarrel_BXm1Empty->Fill(atan2(py_chargedHadronsBarrel,px_chargedHadronsBarrel));
1894  meMETPhiChargedHadronsEndcapPlus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapPlus_BXm1Empty"];if(meMETPhiChargedHadronsEndcapPlus_BXm1Empty && meMETPhiChargedHadronsEndcapPlus_BXm1Empty ->getRootObject())meMETPhiChargedHadronsEndcapPlus_BXm1Empty->Fill(atan2(py_chargedHadronsEndcapPlus,px_chargedHadronsEndcapPlus));
1895  meMETPhiChargedHadronsEndcapMinus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiChargedHadronsEndcapMinus_BXm1Empty"];if(meMETPhiChargedHadronsEndcapMinus_BXm1Empty && meMETPhiChargedHadronsEndcapMinus_BXm1Empty ->getRootObject())meMETPhiChargedHadronsEndcapMinus_BXm1Empty->Fill(atan2(py_chargedHadronsEndcapMinus,px_chargedHadronsEndcapMinus));
1896  meMETPhiNeutralHadronsBarrel_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsBarrel_BXm1Empty"];if(meMETPhiNeutralHadronsBarrel_BXm1Empty && meMETPhiNeutralHadronsBarrel_BXm1Empty ->getRootObject())meMETPhiNeutralHadronsBarrel_BXm1Empty->Fill(atan2(py_neutralHadronsBarrel,px_neutralHadronsBarrel));
1897  meMETPhiNeutralHadronsEndcapPlus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapPlus_BXm1Empty"];if(meMETPhiNeutralHadronsEndcapPlus_BXm1Empty && meMETPhiNeutralHadronsEndcapPlus_BXm1Empty ->getRootObject())meMETPhiNeutralHadronsEndcapPlus_BXm1Empty->Fill(atan2(py_neutralHadronsEndcapPlus,px_neutralHadronsEndcapPlus));
1898  meMETPhiNeutralHadronsEndcapMinus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiNeutralHadronsEndcapMinus_BXm1Empty"];if(meMETPhiNeutralHadronsEndcapMinus_BXm1Empty && meMETPhiNeutralHadronsEndcapMinus_BXm1Empty ->getRootObject())meMETPhiNeutralHadronsEndcapMinus_BXm1Empty->Fill(atan2(py_neutralHadronsEndcapMinus,px_neutralHadronsEndcapMinus));
1899  meMETPhiPhotonsBarrel_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsBarrel_BXm1Empty"];if(meMETPhiPhotonsBarrel_BXm1Empty && meMETPhiPhotonsBarrel_BXm1Empty ->getRootObject())meMETPhiPhotonsBarrel_BXm1Empty->Fill(atan2(py_PhotonsBarrel,px_PhotonsBarrel));
1900  meMETPhiPhotonsEndcapPlus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapPlus_BXm1Empty"];if(meMETPhiPhotonsEndcapPlus_BXm1Empty && meMETPhiPhotonsEndcapPlus_BXm1Empty ->getRootObject())meMETPhiPhotonsEndcapPlus_BXm1Empty->Fill(atan2(py_PhotonsEndcapPlus,px_PhotonsEndcapPlus));
1901  meMETPhiPhotonsEndcapMinus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiPhotonsEndcapMinus_BXm1Empty"];if(meMETPhiPhotonsEndcapMinus_BXm1Empty && meMETPhiPhotonsEndcapMinus_BXm1Empty ->getRootObject())meMETPhiPhotonsEndcapMinus_BXm1Empty->Fill(atan2(py_PhotonsEndcapMinus,px_PhotonsEndcapMinus));
1902  meMETPhiHFHadronsPlus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFHadronsPlus_BXm1Empty"];if(meMETPhiHFHadronsPlus_BXm1Empty && meMETPhiHFHadronsPlus_BXm1Empty ->getRootObject())meMETPhiHFHadronsPlus_BXm1Empty->Fill(atan2(py_HFHadronsPlus,px_HFHadronsPlus));
1903  meMETPhiHFHadronsMinus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFHadronsMinus_BXm1Empty"];if(meMETPhiHFHadronsMinus_BXm1Empty && meMETPhiHFHadronsMinus_BXm1Empty ->getRootObject())meMETPhiHFHadronsMinus_BXm1Empty->Fill(atan2(py_HFHadronsMinus,px_HFHadronsMinus));
1904  meMETPhiHFEGammasPlus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFEGammasPlus_BXm1Empty"];if(meMETPhiHFEGammasPlus_BXm1Empty && meMETPhiHFEGammasPlus_BXm1Empty ->getRootObject())meMETPhiHFEGammasPlus_BXm1Empty->Fill(atan2(py_HFEGammasPlus,px_HFEGammasPlus));
1905  meMETPhiHFEGammasMinus_BXm1Empty = map_of_MEs[DirName+"/"+"METPhiHFEGammasMinus_BXm1Empty"];if(meMETPhiHFEGammasMinus_BXm1Empty && meMETPhiHFEGammasMinus_BXm1Empty ->getRootObject())meMETPhiHFEGammasMinus_BXm1Empty->Fill(atan2(py_HFEGammasMinus,px_HFEGammasMinus));
1906  }
1907 
1908 
1909 
1910  }//fill candidate plots only then
1911 
1912  // PFMET getters
1913  //----------------------------------------------------------------------------
1914  double pfPhotonEtFraction = pfmet.photonEtFraction();
1915  double pfPhotonEt = pfmet.photonEt();
1916  double pfNeutralHadronEtFraction = pfmet.neutralHadronEtFraction();
1917  double pfNeutralHadronEt = pfmet.neutralHadronEt();
1918  double pfElectronEt = pfmet.electronEt();
1919  double pfChargedHadronEtFraction = pfmet.chargedHadronEtFraction();
1920  double pfChargedHadronEt = pfmet.chargedHadronEt();
1921  double pfMuonEt = pfmet.muonEt();
1922  double pfHFHadronEtFraction = pfmet.HFHadronEtFraction();
1923  double pfHFHadronEt = pfmet.HFHadronEt();
1924  double pfHFEMEtFraction = pfmet.HFEMEtFraction();
1925  double pfHFEMEt = pfmet.HFEMEt();
1926  mePhotonEtFraction = map_of_MEs[DirName + "/PfPhotonEtFraction"];
1927  mePhotonEt = map_of_MEs[DirName + "/PfPhotonEt"];
1928  meNeutralHadronEtFraction = map_of_MEs[DirName + "/PfNeutralHadronEtFraction"];
1929  meNeutralHadronEt = map_of_MEs[DirName + "/PfNeutralHadronEt"];
1930  meElectronEt = map_of_MEs[DirName + "/PfElectronEt"];
1931  meChargedHadronEtFraction = map_of_MEs[DirName + "/PfChargedHadronEtFraction"];
1932  meChargedHadronEt = map_of_MEs[DirName + "/PfChargedHadronEt"];
1933  meMuonEt = map_of_MEs[DirName + "/PfMuonEt"];
1934  meHFHadronEtFraction = map_of_MEs[DirName + "/PfHFHadronEtFraction"];
1935  meHFHadronEt = map_of_MEs[DirName + "/PfHFHadronEt"];
1936  meHFEMEtFraction = map_of_MEs[DirName + "/PfHFEMEtFraction"];
1937  meHFEMEt = map_of_MEs[DirName + "/PfHFEMEt"];
1938 
1939  if (mePhotonEtFraction && mePhotonEtFraction ->getRootObject()) mePhotonEtFraction ->Fill(pfPhotonEtFraction);
1940  if (mePhotonEt && mePhotonEt ->getRootObject()) mePhotonEt ->Fill(pfPhotonEt);
1941  if (meNeutralHadronEtFraction && meNeutralHadronEtFraction->getRootObject()) meNeutralHadronEtFraction->Fill(pfNeutralHadronEtFraction);
1942  if (meNeutralHadronEt && meNeutralHadronEt ->getRootObject()) meNeutralHadronEt ->Fill(pfNeutralHadronEt);
1943  if (meElectronEt && meElectronEt ->getRootObject()) meElectronEt ->Fill(pfElectronEt);
1944  if (meChargedHadronEtFraction && meChargedHadronEtFraction->getRootObject()) meChargedHadronEtFraction->Fill(pfChargedHadronEtFraction);
1945  if (meChargedHadronEt && meChargedHadronEt ->getRootObject()) meChargedHadronEt ->Fill(pfChargedHadronEt);
1946  if (meMuonEt && meMuonEt ->getRootObject()) meMuonEt ->Fill(pfMuonEt);
1947  if (meHFHadronEtFraction && meHFHadronEtFraction ->getRootObject()) meHFHadronEtFraction ->Fill(pfHFHadronEtFraction);
1948  if (meHFHadronEt && meHFHadronEt ->getRootObject()) meHFHadronEt ->Fill(pfHFHadronEt);
1949  if (meHFEMEtFraction && meHFEMEtFraction ->getRootObject()) meHFEMEtFraction ->Fill(pfHFEMEtFraction);
1950  if (meHFEMEt && meHFEMEt ->getRootObject()) meHFEMEt ->Fill(pfHFEMEt);
1951 
1952  //NPV profiles
1953 
1954  mePhotonEtFraction_profile = map_of_MEs[DirName + "/PfPhotonEtFraction_profile"];
1955  mePhotonEt_profile = map_of_MEs[DirName + "/PfPhotonEt_profile"];
1956  meNeutralHadronEtFraction_profile = map_of_MEs[DirName + "/PfNeutralHadronEtFraction_profile"];
1957  meNeutralHadronEt_profile = map_of_MEs[DirName + "/PfNeutralHadronEt_profile"];
1958  meChargedHadronEtFraction_profile = map_of_MEs[DirName + "/PfChargedHadronEtFraction_profile"];
1959  meChargedHadronEt_profile = map_of_MEs[DirName + "/PfChargedHadronEt_profile"];
1960  meHFHadronEtFraction_profile = map_of_MEs[DirName + "/PfHFHadronEtFraction_profile"];
1961  meHFHadronEt_profile = map_of_MEs[DirName + "/PfHFHadronEt_profile"];
1962  meHFEMEtFraction_profile = map_of_MEs[DirName + "/PfHFEMEtFraction_profile"];
1963  meHFEMEt_profile = map_of_MEs[DirName + "/PfHFEMEt_profile"];
1964 
1965  if (mePhotonEtFraction_profile && mePhotonEtFraction_profile ->getRootObject()) mePhotonEtFraction_profile ->Fill(numPV_, pfPhotonEtFraction);
1966  if (mePhotonEt_profile && mePhotonEt_profile ->getRootObject()) mePhotonEt_profile ->Fill(numPV_, pfPhotonEt);
1967  if (meNeutralHadronEtFraction_profile && meNeutralHadronEtFraction_profile->getRootObject()) meNeutralHadronEtFraction_profile->Fill(numPV_, pfNeutralHadronEtFraction);
1968  if (meNeutralHadronEt_profile && meNeutralHadronEt_profile ->getRootObject()) meNeutralHadronEt_profile ->Fill(numPV_, pfNeutralHadronEt);
1969  if (meChargedHadronEtFraction_profile && meChargedHadronEtFraction_profile->getRootObject()) meChargedHadronEtFraction_profile->Fill(numPV_, pfChargedHadronEtFraction);
1970  if (meChargedHadronEt_profile && meChargedHadronEt_profile ->getRootObject()) meChargedHadronEt_profile ->Fill(numPV_, pfChargedHadronEt);
1971  if (meHFHadronEtFraction_profile && meHFHadronEtFraction_profile ->getRootObject()) meHFHadronEtFraction_profile ->Fill(numPV_, pfHFHadronEtFraction);
1972  if (meHFHadronEt_profile && meHFHadronEt_profile ->getRootObject()) meHFHadronEt_profile ->Fill(numPV_, pfHFHadronEt);
1973  if (meHFEMEtFraction_profile && meHFEMEtFraction_profile ->getRootObject()) meHFEMEtFraction_profile ->Fill(numPV_, pfHFEMEtFraction);
1974  if (meHFEMEt_profile && meHFEMEt_profile ->getRootObject()) meHFEMEt_profile ->Fill(numPV_, pfHFEMEt);
1975  }
1976 
1977  if(isMiniAODMet_){
1978  mePhotonEtFraction = map_of_MEs[DirName + "/PfPhotonEtFraction"];
1979  meNeutralHadronEtFraction = map_of_MEs[DirName + "/PfNeutralHadronEtFraction"];
1980  meChargedHadronEtFraction = map_of_MEs[DirName + "/PfChargedHadronEtFraction"];
1981  meHFHadronEtFraction = map_of_MEs[DirName + "/PfHFHadronEtFraction"];
1982  meHFEMEtFraction = map_of_MEs[DirName + "/PfHFEMEtFraction"];
1983 
1984  if (mePhotonEtFraction && mePhotonEtFraction ->getRootObject()) mePhotonEtFraction ->Fill(patmet.NeutralEMFraction());
1985  if (meNeutralHadronEtFraction && meNeutralHadronEtFraction->getRootObject()) meNeutralHadronEtFraction->Fill(patmet.NeutralHadEtFraction());
1986  if (meChargedHadronEtFraction && meChargedHadronEtFraction->getRootObject()) meChargedHadronEtFraction->Fill(patmet.ChargedHadEtFraction());
1987  if (meHFHadronEtFraction && meHFHadronEtFraction ->getRootObject()) meHFHadronEtFraction ->Fill(patmet.Type6EtFraction());//HFHadrons
1988  if (meHFEMEtFraction && meHFEMEtFraction ->getRootObject()) meHFEMEtFraction ->Fill(patmet.Type7EtFraction());
1989 
1990  //NPV profiles
1991  mePhotonEtFraction_profile = map_of_MEs[DirName + "/PfPhotonEtFraction_profile"];
1992  meNeutralHadronEtFraction_profile = map_of_MEs[DirName + "/PfNeutralHadronEtFraction_profile"];
1993  meChargedHadronEtFraction_profile = map_of_MEs[DirName + "/PfChargedHadronEtFraction_profile"];
1994  meHFHadronEtFraction_profile = map_of_MEs[DirName + "/PfHFHadronEtFraction_profile"];
1995  meHFEMEtFraction_profile = map_of_MEs[DirName + "/PfHFEMEtFraction_profile"];
1996 
1997  if (mePhotonEtFraction_profile && mePhotonEtFraction_profile ->getRootObject()) mePhotonEtFraction_profile ->Fill(numPV_, patmet.NeutralEMFraction());
1998  if (meNeutralHadronEtFraction_profile && meNeutralHadronEtFraction_profile->getRootObject()) meNeutralHadronEtFraction_profile->Fill(numPV_, patmet.NeutralHadEtFraction());
1999  if (meChargedHadronEtFraction_profile && meChargedHadronEtFraction_profile->getRootObject()) meChargedHadronEtFraction_profile->Fill(numPV_, patmet.ChargedHadEtFraction());
2000  if (meHFHadronEtFraction_profile && meHFHadronEtFraction_profile ->getRootObject()) meHFHadronEtFraction_profile ->Fill(numPV_, patmet.Type6EtFraction());
2001  if (meHFEMEtFraction_profile && meHFEMEtFraction_profile ->getRootObject()) meHFEMEtFraction_profile ->Fill(numPV_, patmet.Type7EtFraction());
2002  }
2003 
2004  if (isCaloMet_){
2005  //if (bLumiSecPlot){//get from config level
2006  if (fill_met_high_level_histo){
2007  hMExLS = map_of_MEs[DirName+"/"+"MExLS"]; if (hMExLS && hMExLS->getRootObject()) hMExLS->Fill(MEx,myLuminosityBlock);
2008  hMEyLS = map_of_MEs[DirName+"/"+"MEyLS"]; if (hMEyLS && hMEyLS->getRootObject()) hMEyLS->Fill(MEy,myLuminosityBlock);
2009  }
2010  }
2011 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
Analysis-level MET class.
Definition: MET.h:43
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
const reco::TrackRef & trackRef() const
dictionary parameters
Definition: Parameters.py:2
double hadEtInHE() const
Definition: CaloMET.h:51
void setBinContent(int binx, double content)
set content of bin (1-D)
void fillMESet(const edm::Event &, std::string, const reco::MET &, const pat::MET &, const reco::PFMET &, const reco::CaloMET &, std::map< std::string, MonitorElement * > &, int)
double HFEMEtFraction() const
Definition: PFMET.h:47
double rawEcalEnergy() const
return corrected Ecal energy
Definition: PFCandidate.h:224
double hadEtInHF() const
Definition: CaloMET.h:53
double ChargedHadEtFraction() const
Definition: MET.h:131
virtual double et() const
transverse energy
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
const std::string metname
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
double neutralHadronEtFraction() const
Definition: PFMET.h:32
size_type size() const
Definition: OwnVector.h:254
double muonEt() const
Definition: PFMET.h:42
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
list elements
Definition: asciidump.py:414
#define NULL
Definition: scimark2.h:8
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
const PFClusterRef & clusterRef() const
double NeutralEMFraction() const
Definition: MET.h:128
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
double Type6EtFraction() const
Definition: MET.h:133
double Type7EtFraction() const
Definition: MET.h:134
Jet ID object.
Definition: JetID.h:16
int ii
Definition: cuy.py:588
tuple particleFlow
Definition: pfLinker_cff.py:5
double NeutralHadEtFraction() const
Definition: MET.h:129
tuple vertexCollection
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
std::vector< ElementInBlock > ElementsInBlocks
Definition: PFCandidate.h:386
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
triggerResultsToken_(consumes< edm::TriggerResults >(edm::InputTag("TriggerResults")))
void makeRatePlot(std::string, double)
Definition: METAnalyzer.cc:963
double mEtSig() const
Definition: MET.h:58
double HFHadronEtFraction() const
Definition: PFMET.h:44
int iEvent
Definition: GenABIO.cc:230
double sumEt() const
Definition: MET.h:56
double HFHadronEt() const
Definition: PFMET.h:45
void bookMESet(std::string, DQMStore::IBooker &, std::map< std::string, MonitorElement * > &)
Definition: METAnalyzer.cc:190
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: MET.h:42
void endRun(const edm::Run &iRun, const edm::EventSetup &iSetup)
Finish up a run.
Definition: METAnalyzer.cc:906
double photonEtFraction() const
Definition: PFMET.h:29
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int j
Definition: DBlmapReader.cc:9
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
double emEtInEB() const
Definition: CaloMET.h:55
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
Initialize run-based parameters.
Definition: METAnalyzer.cc:855
void fillMonitorElement(const edm::Event &, std::string, std::string, const reco::MET &, const pat::MET &, const reco::PFMET &, const reco::CaloMET &, std::map< std::string, MonitorElement * > &, bool, bool, int)
bool isValid() const
Definition: HandleBase.h:75
#define LogTrace(id)
#define M_PI
double HFEMEt() const
Definition: PFMET.h:48
PF Jet selector for pat::Jets.
double hadEtInHO() const
Definition: CaloMET.h:49
double electronEt() const
Definition: PFMET.h:36
Jet selector for pat::Jets and for CaloJets.
TObject * getRootObject(void) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
double etFractionHadronic() const
Definition: CaloMET.h:42
T const * product() const
Definition: Handle.h:81
virtual double px() const
x coordinate of momentum vector
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
double photonEt() const
Definition: PFMET.h:30
static std::string const triggerResults("TriggerResults")
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
TH1F * getTH1F(void) const
METAnalyzer(const edm::ParameterSet &)
Constructor.
Definition: METAnalyzer.cc:42
double emEtInEE() const
Definition: CaloMET.h:57
double chargedHadronEtFraction() const
Definition: PFMET.h:38
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Inizialize parameters for histo binning.
Definition: METAnalyzer.cc:164
double emEtInHF() const
Definition: CaloMET.h:59
tuple cout
Definition: gather_cfg.py:121
double neutralHadronEt() const
Definition: PFMET.h:33
void bookMonitorElement(std::string, DQMStore::IBooker &, std::map< std::string, MonitorElement * > &, bool, bool)
Definition: METAnalyzer.cc:212
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
Definition: METAnalyzer.cc:991
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
virtual ParticleType particleId() const
Definition: PFCandidate.h:373
virtual ~METAnalyzer()
Destructor.
Definition: METAnalyzer.cc:156
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:682
tuple pfJets
Definition: pfJets_cff.py:8
virtual double phi() const
momentum azimuthal angle
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
double hadEtInHB() const
Definition: CaloMET.h:47
virtual double py() const
y coordinate of momentum vector
double emEtFraction() const
Definition: CaloMET.h:45
double chargedHadronEt() const
Definition: PFMET.h:39
Definition: Run.h:41
double rawHcalEnergy() const
return raw Hcal energy
Definition: PFCandidate.h:234
Definition: DDAxes.h:10