test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetAnalyzer.cc
Go to the documentation of this file.
1 
16 
29 
33 
54 
55 #include <string>
56 
57 #include <cmath>
58 
59 using namespace edm;
60 using namespace reco;
61 using namespace std;
62 
63 // ***********************************************************
65 //: trackPropagator_(new jetAnalysis::TrackPropagatorToCalo)//,
66  //sOverNCalculator_(new jetAnalysis::StripSignalOverNoiseCalculator)
67 {
68 
69  parameters_ = pSet.getParameter<edm::ParameterSet>("jetAnalysis");
70  mInputCollection_ = pSet.getParameter<edm::InputTag> ("jetsrc");
71  m_l1algoname_ = pSet.getParameter<std::string>("l1algoname");
72  m_bitAlgTechTrig_=-1;
73 
74  jetType_ = pSet.getParameter<std::string>("JetType");
75  m_l1algoname_ = pSet.getParameter<std::string>("l1algoname");
76 
77  fill_jet_high_level_histo=pSet.getParameter<bool>("filljetHighLevel"),
78  filljetsubstruc_=pSet.getParameter<bool>("fillsubstructure");
79  pt_min_boosted_=pSet.getParameter<double>("ptMinBoosted");
80 
81  isCaloJet_ = (std::string("calo")==jetType_);
82  //isJPTJet_ = (std::string("jpt") ==jetType_);
83  isPFJet_ = (std::string("pf") ==jetType_);
84  isMiniAODJet_ = (std::string("miniaod") ==jetType_);
85  jetCorrectorTag_=pSet.getParameter<edm::InputTag>("JetCorrections");
86  if(!isMiniAODJet_){//in MiniAOD jet is already corrected
87  jetCorrectorToken_ = consumes<reco::JetCorrector>(jetCorrectorTag_);
88  }
89 
90  if (isCaloJet_){
91  caloJetsToken_ = consumes<reco::CaloJetCollection>(mInputCollection_);
92  // MET information
93  caloMetToken_= consumes<reco::CaloMETCollection>(edm::InputTag(pSet.getParameter<edm::InputTag>("METCollectionLabel")));
94  }
95  //if (isJPTJet_) jptJetsToken_ = consumes<reco::JPTJetCollection>(mInputCollection_);
96  if (isPFJet_){ pfJetsToken_ = consumes<reco::PFJetCollection>(mInputCollection_);
97  MuonsToken_ = consumes<reco::MuonCollection>(pSet.getParameter<edm::InputTag> ("muonsrc"));
98  pfMetToken_= consumes<reco::PFMETCollection>(edm::InputTag(pSet.getParameter<edm::InputTag>("METCollectionLabel")));
99  }
100  if (isMiniAODJet_){
101  patJetsToken_ = consumes<pat::JetCollection>(mInputCollection_);
102  patMetToken_= consumes<pat::METCollection>(edm::InputTag(pSet.getParameter<edm::InputTag>("METCollectionLabel")));
103  }
104  cutBasedPUDiscriminantToken_ = consumes< edm::ValueMap<float> >(pSet.getParameter<edm::InputTag>("InputCutPUIDDiscriminant"));
105  cutBasedPUIDToken_ = consumes< edm::ValueMap<int> >(pSet.getParameter<edm::InputTag>("InputCutPUIDValue"));
106  mvaPUIDToken_ = consumes< edm::ValueMap<int> >(pSet.getParameter<edm::InputTag>("InputMVAPUIDValue"));
107  mvaFullPUDiscriminantToken_ = consumes< edm::ValueMap<float> >(pSet.getParameter<edm::InputTag>("InputMVAPUIDDiscriminant"));
108 
109  qgMultiplicityToken_= consumes< edm::ValueMap<int> >(pSet.getParameter<edm::InputTag>("InputQGMultiplicity"));
110  qgLikelihoodToken_= consumes< edm::ValueMap<float> >(pSet.getParameter<edm::InputTag>("InputQGLikelihood"));
111  qgptDToken_= consumes< edm::ValueMap<float> >(pSet.getParameter<edm::InputTag>("InputQGPtDToken"));
112  qgaxis2Token_= consumes< edm::ValueMap<float> >(pSet.getParameter<edm::InputTag>("InputQGAxis2"));
113 
114  fill_CHS_histos= pSet.getParameter<bool>("fillCHShistos");
115 
116  JetIDQuality_ = pSet.getParameter<string>("JetIDQuality");
117  JetIDVersion_ = pSet.getParameter<string>("JetIDVersion");
118 
119  // JetID definitions for Calo and JPT Jets
120  if(isCaloJet_){
121  inputJetIDValueMap = pSet.getParameter<edm::InputTag>("InputJetIDValueMap");
122  jetID_ValueMapToken_= consumes< edm::ValueMap<reco::JetID> >(inputJetIDValueMap);
123  if(JetIDVersion_== "PURE09"){
124  jetidversion = JetIDSelectionFunctor::PURE09;
125  }else if (JetIDVersion_== "DQM09"){
126  jetidversion = JetIDSelectionFunctor::DQM09;
127  }else if (JetIDVersion_=="CRAFT08"){
128  jetidversion = JetIDSelectionFunctor::CRAFT08;
129  }else{
130  if (verbose_) std::cout<<"no Valid JetID version given"<<std::endl;
131  }
132  if(JetIDQuality_== "MINIMAL"){
133  jetidquality = JetIDSelectionFunctor::MINIMAL;
134  }else if (JetIDQuality_== "LOOSE_AOD"){
135  jetidquality = JetIDSelectionFunctor::LOOSE_AOD;
136  }else if (JetIDQuality_=="LOOSE"){
137  jetidquality = JetIDSelectionFunctor::LOOSE;
138  }else if (JetIDQuality_=="TIGHT"){
139  jetidquality = JetIDSelectionFunctor::TIGHT;
140  }else{
141  if (verbose_) std::cout<<"no Valid JetID quality given"<<std::endl;
142  }
143  jetIDFunctor=JetIDSelectionFunctor( jetidversion, jetidquality);
144 
145  }
146 
147  //Jet ID definitions for PFJets
148  if(isPFJet_ || isMiniAODJet_){
149  if(JetIDVersion_== "FIRSTDATA"){
150  pfjetidversion = PFJetIDSelectionFunctor::FIRSTDATA;
151  }else if(JetIDVersion_== "RUNIISTARTUP"){
152  pfjetidversion = PFJetIDSelectionFunctor::RUNIISTARTUP;
153  }else{
154  if (verbose_) std::cout<<"no valid PF JetID version given"<<std::endl;
155  }
156  if (JetIDQuality_=="LOOSE"){
157  pfjetidquality = PFJetIDSelectionFunctor::LOOSE;
158  }else if (JetIDQuality_=="TIGHT"){
159  pfjetidquality = PFJetIDSelectionFunctor::TIGHT;
160  }else{
161  if (verbose_) std::cout<<"no Valid PFJetID quality given"<<std::endl;
162  }
163  pfjetIDFunctor=PFJetIDSelectionFunctor( pfjetidversion, pfjetidquality);
164  }
165  //check later if some of those are also needed for PFJets
166  leadJetFlag_ = 0;
167  jetLoPass_ = 0;
168  jetHiPass_ = 0;
169  ptThreshold_ = 20.;
170  ptThresholdUnc_ = 20.;
171  asymmetryThirdJetCut_ = 5.;
172  balanceThirdJetCut_ = 0.2;
173 
174  theTriggerResultsLabel_ = pSet.getParameter<edm::InputTag>("TriggerResultsLabel");
175  triggerResultsToken_ = consumes<edm::TriggerResults>(edm::InputTag(theTriggerResultsLabel_));
176  //
177  runcosmics_ = pSet.getUntrackedParameter<bool>("runcosmics", false);
178  jetCleaningFlag_ = pSet.getUntrackedParameter<bool>("JetCleaningFlag", true);
179 
180  if(runcosmics_){
181  jetCleaningFlag_ =false;
182  }
183 
184 
185  // ==========================================================
186  //DCS information
187  // ==========================================================
188  edm::ConsumesCollector iC = consumesCollector();
189  DCSFilterForJetMonitoring_ = new JetMETDQMDCSFilter(pSet.getParameter<ParameterSet>("DCSFilterForJetMonitoring"), iC);
190  DCSFilterForDCSMonitoring_ = new JetMETDQMDCSFilter("ecal:hbhe:hf:ho:pixel:sistrip:es:muon", iC);
191 
192  //Trigger selectoin
193  edm::ParameterSet highptjetparms = pSet.getParameter<edm::ParameterSet>("highPtJetTrigger");
194  edm::ParameterSet lowptjetparms = pSet.getParameter<edm::ParameterSet>("lowPtJetTrigger" );
195 
196  highPtJetEventFlag_ = new GenericTriggerEventFlag( highptjetparms, consumesCollector(), *this );
197  lowPtJetEventFlag_ = new GenericTriggerEventFlag( lowptjetparms , consumesCollector(), *this );
198 
199  highPtJetExpr_ = highptjetparms.getParameter<std::vector<std::string> >("hltPaths");
200  lowPtJetExpr_ = lowptjetparms .getParameter<std::vector<std::string> >("hltPaths");
201 
202  processname_ = pSet.getParameter<std::string>("processname");
203 
204  //jet cleanup parameters
205  cleaningParameters_ = pSet.getParameter<ParameterSet>("CleaningParameters");
206 
207  bypassAllPVChecks_= cleaningParameters_.getParameter<bool>("bypassAllPVChecks");
208  vertexLabel_ = cleaningParameters_.getParameter<edm::InputTag>("vertexCollection");
209  vertexToken_ = consumes<std::vector<reco::Vertex> >(edm::InputTag(vertexLabel_));
210 
211  gtLabel_ = cleaningParameters_.getParameter<edm::InputTag>("gtLabel");
212  gtToken_ = consumes<L1GlobalTriggerReadoutRecord>(edm::InputTag(gtLabel_));
213 
214  std::string inputCollectionLabel(mInputCollection_.label());
215  verbose_= parameters_.getParameter<int>("verbose");
216  // monitoring of eta parameter
217  etaBin_ = parameters_.getParameter<int>("etaBin");
218  etaMin_ = parameters_.getParameter<double>("etaMin");
219  etaMax_ = parameters_.getParameter<double>("etaMax");
220  // monitoring of phi paramater
221  phiBin_ = parameters_.getParameter<int>("phiBin");
222  phiMin_ = parameters_.getParameter<double>("phiMin");
223  phiMax_ = parameters_.getParameter<double>("phiMax");
224  // monitoring of the transverse momentum
225  ptBin_ = parameters_.getParameter<int>("ptBin");
226  ptMin_ = parameters_.getParameter<double>("ptMin");
227  ptMax_ = parameters_.getParameter<double>("ptMax");
228  //
229  eBin_ = parameters_.getParameter<int>("eBin");
230  eMin_ = parameters_.getParameter<double>("eMin");
231  eMax_ = parameters_.getParameter<double>("eMax");
232  //
233  pBin_ = parameters_.getParameter<int>("pBin");
234  pMin_ = parameters_.getParameter<double>("pMin");
235  pMax_ = parameters_.getParameter<double>("pMax");
236  //
237  nbinsPV_ = parameters_.getParameter<int>("pVBin");
238  nPVlow_ = parameters_.getParameter<double>("pVMin");
239  nPVhigh_ = parameters_.getParameter<double>("pVMax");
240  //
241  ptThreshold_ = parameters_.getParameter<double>("ptThreshold");
242  ptThresholdUnc_=parameters_.getParameter<double>("ptThresholdUnc");
243  asymmetryThirdJetCut_ = parameters_.getParameter<double>("asymmetryThirdJetCut");
244  balanceThirdJetCut_ = parameters_.getParameter<double>("balanceThirdJetCut");
245 }
246 
247 
248 // ***********************************************************
250 
251  delete highPtJetEventFlag_;
252  delete lowPtJetEventFlag_;
253 
254  delete DCSFilterForDCSMonitoring_;
255  delete DCSFilterForJetMonitoring_;
256  LogTrace("JetAnalyzer")<<"[JetAnalyzer] Saving the histos";
257 }
258 
259 // ***********************************************************
261  edm::Run const & iRun,
262  edm::EventSetup const & ) {
263 
264  // dbe_ = edm::Service<DQMStore>().operator->();
265  if(jetCleaningFlag_){
266  ibooker.setCurrentFolder("JetMET/Jet/Cleaned"+mInputCollection_.label());
267  DirName = "JetMET/Jet/Cleaned"+mInputCollection_.label();
268  }else{
269  ibooker.setCurrentFolder("JetMET/Jet/Uncleaned"+mInputCollection_.label());
270  DirName = "JetMET/Jet/Uncleaned"+mInputCollection_.label();
271  }
272 
273  jetME = ibooker.book1D("jetReco", "jetReco", 4, 1, 5);
274  jetME->setBinLabel(1,"CaloJets",1);
275  jetME->setBinLabel(2,"PFJets",1);
276  jetME->setBinLabel(3,"JPTJets",1);
277  jetME->setBinLabel(4,"MiniAODJets",1);
278 
279  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"jetReco",jetME));
280 
281 
282  mPt = ibooker.book1D("Pt", "pt", ptBin_, ptMin_, ptMax_);
283  mEta = ibooker.book1D("Eta", "eta", etaBin_, etaMin_, etaMax_);
284  mPhi = ibooker.book1D("Phi", "phi", phiBin_, phiMin_, phiMax_);
285  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt" ,mPt));
286  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta",mEta));
287  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi",mPhi));
288 
289  //if(!isJPTJet_){
290  mConstituents = ibooker.book1D("Constituents", "# of constituents", 50, 0, 100);
291  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents",mConstituents));
292  //}
293  mJetEnergyCorr= ibooker.book1D("JetEnergyCorr", "jet energy correction factor", 50, 0.0,3.0);
294  mJetEnergyCorrVSEta= ibooker.bookProfile("JetEnergyCorrVSEta", "jet energy correction factor VS eta", etaBin_, etaMin_,etaMax_, 0.0,3.0);
295  mJetEnergyCorrVSPt= ibooker.bookProfile("JetEnergyCorrVSPt", "jet energy correction factor VS pt", ptBin_, ptMin_,ptMax_, 0.0,3.0);
296  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorr" ,mJetEnergyCorr));
297  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorrVSEta" ,mJetEnergyCorrVSEta));
298  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorrVSPt" ,mJetEnergyCorrVSPt));
299 
300  mPt_uncor = ibooker.book1D("Pt_uncor", "pt for uncorrected jets", ptBin_, ptThresholdUnc_, ptMax_);
301  mEta_uncor = ibooker.book1D("Eta_uncor", "eta for uncorrected jets", etaBin_, etaMin_, etaMax_);
302  mPhi_uncor = ibooker.book1D("Phi_uncor", "phi for uncorrected jets", phiBin_, phiMin_, phiMax_);
303  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_uncor" ,mPt_uncor));
304  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_uncor",mEta_uncor));
305  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_uncor",mPhi_uncor));
306  //if(!isJPTJet_){
307  mConstituents_uncor = ibooker.book1D("Constituents_uncor", "# of constituents for uncorrected jets", 50, 0, 100);
308  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_uncor",mConstituents_uncor));
309  //}
310 
311  mDPhi = ibooker.book1D("DPhi", "dPhi btw the two leading jets", 100, 0., acos(-1.));
312  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DPhi",mDPhi));
313 
314  // Book NPV profiles
315  //----------------------------------------------------------------------------
316  mPt_profile = ibooker.bookProfile("Pt_profile", "pt", nbinsPV_, nPVlow_, nPVhigh_, ptBin_, ptMin_, ptMax_);
317  mEta_profile = ibooker.bookProfile("Eta_profile", "eta", nbinsPV_, nPVlow_, nPVhigh_, etaBin_, etaMin_, etaMax_);
318  mPhi_profile = ibooker.bookProfile("Phi_profile", "phi", nbinsPV_, nPVlow_, nPVhigh_, phiBin_, phiMin_, phiMax_);
319  //if(!isJPTJet_){
320  mConstituents_profile = ibooker.bookProfile("Constituents_profile", "# of constituents", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
321  //}
322  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_profile" ,mPt_profile));
323  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_profile",mEta_profile));
324  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_profile",mPhi_profile));
325 
326 
327 
328  if(!runcosmics_){//JIDPassFrac_ defines a collection of cleaned jets, for which we will want to fill the cleaning passing fraction
329  mLooseJIDPassFractionVSeta = ibooker.bookProfile("JetIDPassFractionVSeta","JetIDPassFractionVSeta",etaBin_, etaMin_, etaMax_,0.,1.2);
330  mLooseJIDPassFractionVSpt = ibooker.bookProfile("JetIDPassFractionVSpt","JetIDPassFractionVSpt",ptBin_, ptMin_, ptMax_,0.,1.2);
331  mLooseJIDPassFractionVSptNoHF = ibooker.bookProfile("JetIDPassFractionVSptNoHF","JetIDPassFractionVSptNoHF",ptBin_, ptMin_, ptMax_,0.,1.2);
332  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetIDPassFractionVSeta" ,mLooseJIDPassFractionVSeta));
333  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetIDPassFractionVSpt" ,mLooseJIDPassFractionVSpt));
334  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetIDPassFractionVSptNoHF",mLooseJIDPassFractionVSptNoHF));
335  }
336 
337  mNJets_profile = ibooker.bookProfile("NJets_profile", "number of jets", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
338 
339 
340  // Set NPV profiles x-axis title
341  //----------------------------------------------------------------------------
342  mPt_profile ->setAxisTitle("nvtx",1);
343  mEta_profile ->setAxisTitle("nvtx",1);
344  mPhi_profile ->setAxisTitle("nvtx",1);
345  //if(!isJPTJet_){
346  mConstituents_profile->setAxisTitle("nvtx",1);
347  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_profile",mConstituents_profile));
348  //}
349  mNJets_profile->setAxisTitle("nvtx",1);
350 
351  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_profile" ,mPt_profile));
352  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_profile",mEta_profile));
353  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_profile",mPhi_profile));
354  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NJets_profile" ,mNJets_profile));
355 
356 
357  mPhiVSEta = ibooker.book2D("PhiVSEta", "PhiVSEta", 50, etaMin_, etaMax_, 24, phiMin_, phiMax_);
358  mPhiVSEta->getTH2F()->SetOption("colz");
359  mPhiVSEta->setAxisTitle("#eta",1);
360  mPhiVSEta->setAxisTitle("#phi",2);
361  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhiVSEta" ,mPhiVSEta));
362 
363  mPt_1 = ibooker.book1D("Pt_1", "Pt spectrum of jets - range 1", 20, 0, 100);
364  mPt_2 = ibooker.book1D("Pt_2", "Pt spectrum of jets - range 2", 60, 0, 300);
365  mPt_3 = ibooker.book1D("Pt_3", "Pt spectrum of jets - range 3", 100, 0, 5000);
366  // Low and high pt trigger paths
367  mPt_Lo = ibooker.book1D("Pt_Lo", "Pt (Pass Low Pt Jet Trigger)", 20, 0, 100);
368  //mEta_Lo = ibooker.book1D("Eta_Lo", "Eta (Pass Low Pt Jet Trigger)", etaBin_, etaMin_, etaMax_);
369  mPhi_Lo = ibooker.book1D("Phi_Lo", "Phi (Pass Low Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
370 
371  mPt_Hi = ibooker.book1D("Pt_Hi", "Pt (Pass Hi Pt Jet Trigger)", 60, 0, 300);
372  mEta_Hi = ibooker.book1D("Eta_Hi", "Eta (Pass Hi Pt Jet Trigger)", etaBin_, etaMin_, etaMax_);
373  mPhi_Hi = ibooker.book1D("Phi_Hi", "Phi (Pass Hi Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
374  mNJets = ibooker.book1D("NJets", "number of jets", 100, 0, 100);
375 
376  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_1" ,mPt_1));
377  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_2" ,mPt_2));
378  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_3" ,mPt_3));
379  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Lo" ,mPt_Lo));
380  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Lo" ,mPhi_Lo));
381  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Hi" ,mPt_Hi));
382  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_Hi" ,mEta_Hi));
383  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Hi" ,mPhi_Hi));
384  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NJets" ,mNJets));
385 
386  //mPt_Barrel_Lo = ibooker.book1D("Pt_Barrel_Lo", "Pt Barrel (Pass Low Pt Jet Trigger)", 20, 0, 100);
387  //mPhi_Barrel_Lo = ibooker.book1D("Phi_Barrel_Lo", "Phi Barrel (Pass Low Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
388  //if(!isJPTJet_){
389  mConstituents_Barrel = ibooker.book1D("Constituents_Barrel", "Constituents Barrel", 50, 0, 100);
390  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_Barrel",mConstituents_Barrel));
391  //}
392 
393  //mPt_EndCap_Lo = ibooker.book1D("Pt_EndCap_Lo", "Pt EndCap (Pass Low Pt Jet Trigger)", 20, 0, 100);
394  //mPhi_EndCap_Lo = ibooker.book1D("Phi_EndCap_Lo", "Phi EndCap (Pass Low Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
395  //if(!isJPTJet_){
396  mConstituents_EndCap = ibooker.book1D("Constituents_EndCap", "Constituents EndCap", 50, 0, 100);
397  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_EndCap",mConstituents_EndCap));
398  //}
399 
400 
401  //mPt_Forward_Lo = ibooker.book1D("Pt_Forward_Lo", "Pt Forward (Pass Low Pt Jet Trigger)", 20, 0, 100);
402  //mPhi_Forward_Lo = ibooker.book1D("Phi_Forward_Lo", "Phi Forward (Pass Low Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
403  //if(!isJPTJet_){
404  mConstituents_Forward = ibooker.book1D("Constituents_Forward", "Constituents Forward", 50, 0, 100);
405  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_Forward",mConstituents_Forward));
406  //}
407 
408 
409 
410  mPt_Barrel_Hi = ibooker.book1D("Pt_Barrel_Hi", "Pt Barrel (Pass Hi Pt Jet Trigger)", 60, 0, 300);
411  mPhi_Barrel_Hi = ibooker.book1D("Phi_Barrel_Hi", "Phi Barrel (Pass Hi Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
412 
413  mPt_EndCap_Hi = ibooker.book1D("Pt_EndCap_Hi", "Pt EndCap (Pass Hi Pt Jet Trigger)", 60, 0, 300);
414  mPhi_EndCap_Hi = ibooker.book1D("Phi_EndCap_Hi", "Phi EndCap (Pass Hi Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
415 
416  mPt_Forward_Hi = ibooker.book1D("Pt_Forward_Hi", "Pt Forward (Pass Hi Pt Jet Trigger)", 60, 0, 300);
417  mPhi_Forward_Hi = ibooker.book1D("Phi_Forward_Hi", "Phi Forward (Pass Hi Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
418 
419  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Barrel_Hi" ,mPt_Barrel_Hi));
420  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Barrel_Hi",mPhi_Barrel_Hi));
421  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_EndCap_Hi" ,mPt_EndCap_Hi));
422  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_EndCap_Hi",mPhi_EndCap_Hi));
423  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Forward_Hi" ,mPt_Forward_Hi));
424  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Forward_Hi",mPhi_Forward_Hi));
425 
426  mPhi_Barrel = ibooker.book1D("Phi_Barrel", "Phi_Barrel", phiBin_, phiMin_, phiMax_);
427  mPt_Barrel = ibooker.book1D("Pt_Barrel", "Pt_Barrel", ptBin_, ptMin_, ptMax_);
428 
429  mPhi_EndCap = ibooker.book1D("Phi_EndCap", "Phi_EndCap", phiBin_, phiMin_, phiMax_);
430  mPt_EndCap = ibooker.book1D("Pt_EndCap", "Pt_EndCap", ptBin_, ptMin_, ptMax_);
431 
432  mPhi_Forward = ibooker.book1D("Phi_Forward", "Phi_Forward", phiBin_, phiMin_, phiMax_);
433  mPt_Forward = ibooker.book1D("Pt_Forward", "Pt_Forward", ptBin_, ptMin_, ptMax_);
434 
435  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Barrel" ,mPt_Barrel));
436  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Barrel",mPhi_Barrel));
437  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_EndCap" ,mPt_EndCap));
438  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_EndCap",mPhi_EndCap));
439  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Forward" ,mPt_Forward));
440  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Forward",mPhi_Forward));
441 
442  // Leading Jet Parameters
443  mEtaFirst = ibooker.book1D("EtaFirst", "EtaFirst", 50, -5, 5);
444  mPhiFirst = ibooker.book1D("PhiFirst", "PhiFirst", 70, phiMin_, phiMax_);
445  mPtFirst = ibooker.book1D("PtFirst", "PtFirst", ptBin_, ptMin_, ptMax_);
446 
447  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EtaFirst" ,mEtaFirst));
448  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtFirst" ,mPtFirst));
449  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhiFirst" ,mPhiFirst));
450 
451  //--- Calo jet selection only
452  if(isCaloJet_) {
453 
454  // CaloJet specific
455  mHadEnergyInHO = ibooker.book1D("HadEnergyInHO", "HadEnergyInHO", 50, 0, 20);
456  mHadEnergyInHB = ibooker.book1D("HadEnergyInHB", "HadEnergyInHB", 50, 0, 100);
457  mHadEnergyInHF = ibooker.book1D("HadEnergyInHF", "HadEnergyInHF", 50, 0, 100);
458  mHadEnergyInHE = ibooker.book1D("HadEnergyInHE", "HadEnergyInHE", 50, 0, 200);
459  mEmEnergyInEB = ibooker.book1D("EmEnergyInEB", "EmEnergyInEB", 50, 0, 100);
460  mEmEnergyInEE = ibooker.book1D("EmEnergyInEE", "EmEnergyInEE", 50, 0, 100);
461  mEmEnergyInHF = ibooker.book1D("EmEnergyInHF", "EmEnergyInHF", 60, -20, 200);
462  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HadEnergyInHO" ,mHadEnergyInHO));
463  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HadEnergyInHB" ,mHadEnergyInHB));
464  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HadEnergyInHF" ,mHadEnergyInHF));
465  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HadEnergyInHE" ,mHadEnergyInHE));
466  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EmEnergyInEB" ,mEmEnergyInEB));
467  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EmEnergyInEE" ,mEmEnergyInEE));
468  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EmEnergyInHF" ,mEmEnergyInHF));
469 
470  //JetID variables
471  mresEMF = ibooker.book1D("resEMF", "resEMF", 50, 0., 1.);
472  mN90Hits = ibooker.book1D("N90Hits", "N90Hits", 50, 0., 50);
473  mfHPD = ibooker.book1D("fHPD", "fHPD", 50, 0., 1.);
474  mfRBX = ibooker.book1D("fRBX", "fRBX", 50, 0., 1.);
475  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"resEMF" ,mresEMF));
476  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"N90Hits" ,mN90Hits));
477  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fHPD" ,mfHPD));
478  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fRBX" ,mfRBX));
479 
480  mHFrac = ibooker.book1D("HFrac", "HFrac", 70, -0.2, 1.2);
481  mEFrac = ibooker.book1D("EFrac", "EFrac", 52, -0.02, 1.02);
482  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac" ,mHFrac));
483  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac" ,mEFrac));
484  mHFrac_profile = ibooker.bookProfile("HFrac_profile", "HFrac", nbinsPV_, nPVlow_, nPVhigh_, 70, -0.2, 1.2);
485  mEFrac_profile = ibooker.bookProfile("EFrac_profile", "EFrac", nbinsPV_, nPVlow_, nPVhigh_, 52, -0.02, 1.02);
486  mHFrac_profile ->setAxisTitle("nvtx",1);
487  mEFrac_profile ->setAxisTitle("nvtx",1);
488  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_profile",mHFrac_profile));
489  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_profile",mEFrac_profile));
490  mHFrac_Barrel = ibooker.book1D("HFrac_Barrel", "HFrac Barrel", 50, 0, 1);
491  mEFrac_Barrel = ibooker.book1D("EFrac_Barrel", "EFrac Barrel", 52, -0.02, 1.02);
492  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_Barrel" ,mHFrac_Barrel));
493  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_Barrel" ,mEFrac_Barrel));
494  mHFrac_EndCap = ibooker.book1D("HFrac_EndCap", "HFrac EndCap", 50, 0, 1);
495  mEFrac_EndCap = ibooker.book1D("EFrac_EndCap", "EFrac EndCap", 52, -0.02, 1.02);
496  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_EndCap" ,mHFrac_EndCap));
497  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_EndCap" ,mEFrac_EndCap));
498  mHFrac_Forward = ibooker.book1D("HFrac_Forward", "HFrac Forward", 70, -0.2, 1.2);
499  mEFrac_Forward = ibooker.book1D("EFrac_Forward", "EFrac Forward", 52, -0.02, 1.02);
500  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_Forward" ,mHFrac_Forward));
501  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_Forward" ,mEFrac_Forward));
502  }
503 
504  if(isPFJet_) {
505  /* remove quark gluon plots for default jet selection, but select physics signatures which monitor gluon and quark
506  if(jetCleaningFlag_){
507  //gluon quark separation axis
508  if(fill_CHS_histos){
509  mAxis2_lowPt_Barrel = ibooker.book1D("qg_Axis2_lowPt_Barrel","qg Axis2 #sigma_{2} lowPt Barrel",50,0.,0.20);
510  mpTD_lowPt_Barrel= ibooker.book1D("qg_pTD_lowPt_Barrel","qg fragmentation function p_{T}^{D} lowPt Barrel",50,0.15,1.05);
511  mMultiplicityQG_lowPt_Barrel= ibooker.book1D("qg_multiplicity_lowPt_Barrel","qg multiplicity lowPt Barrel",50,0,50);
512  mqgLikelihood_lowPt_Barrel= ibooker.book1D("qg_Likelihood_lowPt_Barrel","qg likelihood lowPt Barrel",50,-1.1,1.1);
513  mAxis2_lowPt_EndCap = ibooker.book1D("qg_Axis2_lowPt_EndCap","qg Axis2 #sigma_{2} lowPt EndCap",50,0.,0.20);
514  mpTD_lowPt_EndCap= ibooker.book1D("qg_pTD_lowPt_EndCap","qg fragmentation function p_{T}^{D} lowPt EndCap",50,0.15,1.05);
515  mMultiplicityQG_lowPt_EndCap= ibooker.book1D("qg_multiplicity_lowPt_EndCap","qg multiplicity lowPt EndCap",50,0,100);
516  mqgLikelihood_lowPt_EndCap= ibooker.book1D("qg_Likelihood_lowPt_EndCap","qg likelihood lowPt EndCap",50,-1.1,1.1);
517  mAxis2_lowPt_Forward = ibooker.book1D("qg_Axis2_lowPt_Forward","qg Axis2 #sigma_{2} lowPt Forward",50,0.,0.20);
518  mpTD_lowPt_Forward= ibooker.book1D("qg_pTD_lowPt_Forward","qg fragmentation function p_{T}^{D} lowPt Forward",50,0.15,1.05);
519  mMultiplicityQG_lowPt_Forward= ibooker.book1D("qg_multiplicity_lowPt_Forward","qg multiplicity lowPt Forward",50,0,100);
520  mqgLikelihood_lowPt_Forward= ibooker.book1D("qg_Likelihood_lowPt_Forward","qg likelihood lowPt Forward",50,-1.1,1.1);
521 
522  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_lowPt_Barrel" ,mAxis2_lowPt_Barrel));
523  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_lowPt_Barrel" ,mpTD_lowPt_Barrel));
524  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_lowPt_Barrel" ,mMultiplicityQG_lowPt_Barrel));
525  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_lowPt_Barrel" ,mqgLikelihood_lowPt_Barrel));
526  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_lowPt_EndCap" ,mAxis2_lowPt_EndCap));
527  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_lowPt_EndCap" ,mpTD_lowPt_EndCap));
528  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_lowPt_EndCap" ,mMultiplicityQG_lowPt_EndCap));
529  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_lowPt_EndCap" ,mqgLikelihood_lowPt_EndCap));
530  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_lowPt_Forward" ,mAxis2_lowPt_Forward));
531  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_lowPt_Forward" ,mpTD_lowPt_Forward));
532  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_lowPt_Forward" ,mMultiplicityQG_lowPt_Forward));
533  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_lowPt_Forward" ,mqgLikelihood_lowPt_Forward));
534 
535  mAxis2_mediumPt_Barrel = ibooker.book1D("qg_Axis2_mediumPt_Barrel","qg Axis2 #sigma_{2} mediumPt Barrel",50,0.,0.20);
536  mpTD_mediumPt_Barrel= ibooker.book1D("qg_pTD_mediumPt_Barrel","qg fragmentation function p_{T}^{D} mediumPt Barrel",50,0.15,1.05);
537  mMultiplicityQG_mediumPt_Barrel= ibooker.book1D("qg_multiplicity_mediumPt_Barrel","qg multiplicity mediumPt Barrel",50,0,100);
538  mqgLikelihood_mediumPt_Barrel= ibooker.book1D("qg_Likelihood_mediumPt_Barrel","qg likelihood mediumPt Barrel",50,-1.1,1.1);
539  mAxis2_mediumPt_EndCap = ibooker.book1D("qg_Axis2_mediumPt_EndCap","qg Axis2 #sigma_{2} mediumPt EndCap",50,0.,0.20);
540  mpTD_mediumPt_EndCap= ibooker.book1D("qg_pTD_mediumPt_EndCap","qg fragmentation function p_{T}^{D} mediumPt EndCap",50,0.15,1.05);
541  mMultiplicityQG_mediumPt_EndCap= ibooker.book1D("qg_multiplicity_mediumPt_EndCap","qg multiplicity mediumPt EndCap",50,0,100);
542  mqgLikelihood_mediumPt_EndCap= ibooker.book1D("qg_Likelihood_mediumPt_EndCap","qg likelihood mediumPt EndCap",50,-1.1,1.1);
543  mAxis2_mediumPt_Forward = ibooker.book1D("qg_Axis2_mediumPt_Forward","qg Axis2 #sigma_{2} mediumPt Forward",50,0.,0.20);
544  mpTD_mediumPt_Forward= ibooker.book1D("qg_pTD_mediumPt_Forward","qg fragmentation function p_{T}^{D} mediumPt Forward",50,0.15,1.05);
545  mMultiplicityQG_mediumPt_Forward= ibooker.book1D("qg_multiplicity_mediumPt_Forward","qg multiplicity mediumPt Forward",50,0,100);
546  mqgLikelihood_mediumPt_Forward= ibooker.book1D("qg_Likelihood_mediumPt_Forward","qg likelihood mediumPt Forward",50,-1.1,1.1);
547 
548  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_mediumPt_Barrel" ,mAxis2_mediumPt_Barrel));
549  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_mediumPt_Barrel" ,mpTD_mediumPt_Barrel));
550  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_mediumPt_Barrel" ,mMultiplicityQG_mediumPt_Barrel));
551  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_mediumPt_Barrel" ,mqgLikelihood_mediumPt_Barrel));
552  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_mediumPt_EndCap" ,mAxis2_mediumPt_EndCap));
553  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_mediumPt_EndCap" ,mpTD_mediumPt_EndCap));
554  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_mediumPt_EndCap" ,mMultiplicityQG_mediumPt_EndCap));
555  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_mediumPt_EndCap" ,mqgLikelihood_mediumPt_EndCap));
556  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_mediumPt_Forward" ,mAxis2_mediumPt_Forward));
557  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_mediumPt_Forward" ,mpTD_mediumPt_Forward));
558  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_mediumPt_Forward" ,mMultiplicityQG_mediumPt_Forward));
559  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_mediumPt_Forward" ,mqgLikelihood_mediumPt_Forward));
560 
561  mAxis2_highPt_Barrel = ibooker.book1D("qg_Axis2_highPt_Barrel","qg Axis2 #sigma_{2} highPt Barrel",50,0.,0.20);
562  mpTD_highPt_Barrel= ibooker.book1D("qg_pTD_highPt_Barrel","qg fragmentation function p_{T}^{D} highPt Barrel",50,0.15,1.05);
563  mMultiplicityQG_highPt_Barrel= ibooker.book1D("qg_multiplicity_highPt_Barrel","qg multiplicity highPt Barrel",50,0,100);
564  mqgLikelihood_highPt_Barrel= ibooker.book1D("qg_Likelihood_highPt_Barrel","qg likelihood highPt Barrel",50,-1.1,1.1);
565  mAxis2_highPt_EndCap = ibooker.book1D("qg_Axis2_highPt_EndCap","qg Axis2 #sigma_{2} highPt EndCap",50,0.,0.20);
566  mpTD_highPt_EndCap= ibooker.book1D("qg_pTD_highPt_EndCap","qg fragmentation function p_{T}^{D} highPt EndCap",50,0.15,1.05);
567  mMultiplicityQG_highPt_EndCap= ibooker.book1D("qg_multiplicity_highPt_EndCap","qg multiplicity highPt EndCap",50,0,100);
568  mqgLikelihood_highPt_EndCap= ibooker.book1D("qg_Likelihood_highPt_EndCap","qg likelihood highPt EndCap",50,-1.1,1.1);
569  mAxis2_highPt_Forward = ibooker.book1D("qg_Axis2_highPt_Forward","qg Axis2 #sigma_{2} highPt Forward",50,0.,0.20);
570  mpTD_highPt_Forward= ibooker.book1D("qg_pTD_highPt_Forward","qg fragmentation function p_{T}^{D} highPt Forward",50,0.15,1.05);
571  mMultiplicityQG_highPt_Forward= ibooker.book1D("qg_multiplicity_highPt_Forward","qg multiplicity highPt Forward",50,0,100);
572  mqgLikelihood_highPt_Forward= ibooker.book1D("qg_Likelihood_highPt_Forward","qg likelihood highPt Forward",50,-1.1,1.1);
573 
574  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_highPt_Barrel" ,mAxis2_highPt_Barrel));
575  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_highPt_Barrel" ,mpTD_highPt_Barrel));
576  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_highPt_Barrel" ,mMultiplicityQG_highPt_Barrel));
577  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_highPt_Barrel" ,mqgLikelihood_highPt_Barrel));
578  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_highPt_EndCap" ,mAxis2_highPt_EndCap));
579  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_highPt_EndCap" ,mpTD_highPt_EndCap));
580  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_highPt_EndCap" ,mMultiplicityQG_highPt_EndCap));
581  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_highPt_EndCap" ,mqgLikelihood_highPt_EndCap));
582  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_highPt_Forward" ,mAxis2_highPt_Forward));
583  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_highPt_Forward" ,mpTD_highPt_Forward));
584  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_highPt_Forward" ,mMultiplicityQG_highPt_Forward));
585  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_highPt_Forward" ,mqgLikelihood_highPt_Forward));
586  }
587  }*/
588  //PFJet specific histograms
589  mCHFracVSeta_lowPt= ibooker.bookProfile("CHFracVSeta_lowPt","CHFracVSeta_lowPt",etaBin_, etaMin_, etaMax_,0.,1.2);
590  mNHFracVSeta_lowPt= ibooker.bookProfile("NHFacVSeta_lowPt","NHFracVSeta_lowPt",etaBin_, etaMin_, etaMax_,0.,1.2);
591  mPhFracVSeta_lowPt= ibooker.bookProfile("PhFracVSeta_lowPt","PhFracVSeta_lowPt",etaBin_, etaMin_, etaMax_,0.,1.2);
592  mCHFracVSeta_mediumPt= ibooker.bookProfile("CHFracVSeta_mediumPt","CHFracVSeta_mediumPt",etaBin_, etaMin_, etaMax_,0.,1.2);
593  mNHFracVSeta_mediumPt= ibooker.bookProfile("NHFracVSeta_mediumPt","NHFracVSeta_mediumPt",etaBin_, etaMin_, etaMax_,0.,1.2);
594  mPhFracVSeta_mediumPt= ibooker.bookProfile("PhFracVSeta_mediumPt","PhFracVSeta_mediumPt",etaBin_, etaMin_, etaMax_,0.,1.2);
595  mCHFracVSeta_highPt= ibooker.bookProfile("CHFracVSeta_highPt","CHFracVSeta_highPt",etaBin_, etaMin_, etaMax_,0.,1.2);
596  mNHFracVSeta_highPt= ibooker.bookProfile("NHFracVSeta_highPt","NHFracVSeta_highPt",etaBin_, etaMin_, etaMax_,0.,1.2);
597  mPhFracVSeta_highPt= ibooker.bookProfile("PhFracVSeta_highPt","PhFracVSeta_highPt",etaBin_, etaMin_, etaMax_,0.,1.2);
598 
599  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSeta_lowPt" ,mCHFracVSeta_lowPt));
600  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSeta_lowPt" ,mNHFracVSeta_lowPt));
601  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSeta_lowPt" ,mPhFracVSeta_lowPt));
602  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSeta_mediumPt" ,mCHFracVSeta_mediumPt));
603  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSeta_mediumPt" ,mNHFracVSeta_mediumPt));
604  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSeta_mediumPt" ,mPhFracVSeta_mediumPt));
605  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSeta_highPt" ,mCHFracVSeta_highPt));
606  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSeta_highPt" ,mNHFracVSeta_highPt));
607  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSeta_highPt" ,mPhFracVSeta_highPt));
608 
609  mLooseMVAPUJIDPassFractionVSeta = ibooker.bookProfile("LooseMVAPUIDPassFractionVSeta","LooseMVAPUIDPassFractionVSeta",etaBin_, etaMin_, etaMax_,0.,1.2);
610  mLooseMVAPUJIDPassFractionVSpt = ibooker.bookProfile("LooseMVAPUIDPassFractionVSpt","LooseMVAPUIDPassFractionVSpt",ptBin_, ptMin_, ptMax_,0.,1.2);
611  mMediumMVAPUJIDPassFractionVSeta = ibooker.bookProfile("MediumMVAPUIDPassFractionVSeta","MediumMVAPUIDPassFractionVSeta",etaBin_, etaMin_, etaMax_,0.,1.2);
612  mMediumMVAPUJIDPassFractionVSpt = ibooker.bookProfile("MediumMVAPUIDPassFractionVSpt","MediumMVAPUIDPassFractionVSpt",ptBin_, ptMin_, ptMax_,0.,1.2);
613  mTightMVAPUJIDPassFractionVSeta = ibooker.bookProfile("TightMVAPUIDPassFractionVSeta","TightMVAPUIDPassFractionVSeta",etaBin_, etaMin_, etaMax_,0.,1.2);
614  mTightMVAPUJIDPassFractionVSpt = ibooker.bookProfile("TightMVAPUIDPassFractionVSpt","TightMVAPUIDPassFractionVSpt",ptBin_, ptMin_, ptMax_,0.,1.2);
615 
616  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"LooseMVAPUIDPassFractionVSeta",mLooseMVAPUJIDPassFractionVSeta));
617  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"LooseMVAPUIDPassFractionVSpt",mLooseMVAPUJIDPassFractionVSpt));
618  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MediumMVAPUIDPassFractionVSeta",mMediumMVAPUJIDPassFractionVSeta));
619  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MediumMVAPUIDPassFractionVSpt",mMediumMVAPUJIDPassFractionVSpt));
620  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"TightMVAPUIDPassFractionVSeta",mTightMVAPUJIDPassFractionVSeta));
621  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"TightMVAPUIDPassFractionVSpt",mTightMVAPUJIDPassFractionVSpt));
622 
623  mLooseCutPUJIDPassFractionVSeta = ibooker.bookProfile("LooseCutPUIDPassFractionVSeta","LooseCutPUIDPassFractionVSeta",etaBin_, etaMin_, etaMax_,0.,1.2);
624  mLooseCutPUJIDPassFractionVSpt = ibooker.bookProfile("LooseCutPUIDPassFractionVSpt","LooseCutPUIDPassFractionVSpt",ptBin_, ptMin_, ptMax_,0.,1.2);
625  mMediumCutPUJIDPassFractionVSeta = ibooker.bookProfile("MediumCutPUIDPassFractionVSeta","MediumCutPUIDPassFractionVSeta",etaBin_, etaMin_, etaMax_,0.,1.2);
626  mMediumCutPUJIDPassFractionVSpt = ibooker.bookProfile("MediumCutPUIDPassFractionVSpt","MediumCutPUIDPassFractionVSpt",ptBin_, ptMin_, ptMax_,0.,1.2);
627  mTightCutPUJIDPassFractionVSeta = ibooker.bookProfile("TightCutPUIDPassFractionVSeta","TightCutPUIDPassFractionVSeta",etaBin_, etaMin_, etaMax_,0.,1.2);
628  mTightCutPUJIDPassFractionVSpt = ibooker.bookProfile("TightCutPUIDPassFractionVSpt","TightCutPUIDPassFractionVSpt",ptBin_, ptMin_, ptMax_,0.,1.2);
629  mCutPUJIDDiscriminant_lowPt_Barrel = ibooker.book1D("CutPUJIDDiscriminant_lowPt_Barrel","CutPUJIDDiscriminant_lowPt_Barrel",50, -1.00, 1.00);
630  mCutPUJIDDiscriminant_lowPt_EndCap = ibooker.book1D("CutPUJIDDiscriminant_lowPt_EndCap","CutPUJIDDiscriminant_lowPt_EndCap",50, -1.00, 1.00);
631  mCutPUJIDDiscriminant_lowPt_Forward = ibooker.book1D("CutPUJIDDiscriminant_lowPt_Forward","CutPUJIDDiscriminant_lowPt_Forward",50, -1.00, 1.00);
632  mCutPUJIDDiscriminant_mediumPt_Barrel = ibooker.book1D("CutPUJIDDiscriminant_mediumPt_Barrel","CutPUJIDDiscriminant_mediumPt_Barrel",50, -1.00, 1.00);
633  mCutPUJIDDiscriminant_mediumPt_EndCap = ibooker.book1D("CutPUJIDDiscriminant_mediumPt_EndCap","CutPUJIDDiscriminant_mediumPt_EndCap",50, -1.00, 1.00);
634  mCutPUJIDDiscriminant_mediumPt_Forward = ibooker.book1D("CutPUJIDDiscriminant_mediumPt_Forward","CutPUJIDDiscriminant_mediumPt_Forward",50, -1.00, 1.00);
635  mCutPUJIDDiscriminant_highPt_Barrel = ibooker.book1D("CutPUJIDDiscriminant_highPt_Barrel","CutPUJIDDiscriminant_highPt_Barrel",50, -1.00, 1.00);
636  mCutPUJIDDiscriminant_highPt_EndCap = ibooker.book1D("CutPUJIDDiscriminant_highPt_EndCap","CutPUJIDDiscriminant_highPt_EndCap",50, -1.00, 1.00);
637  mCutPUJIDDiscriminant_highPt_Forward = ibooker.book1D("CutPUJIDDiscriminant_highPt_Forward","CutPUJIDDiscriminant_highPt_Forward",50, -1.00, 1.00);
638 
639  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"LooseCutPUIDPassFractionVSeta",mLooseCutPUJIDPassFractionVSeta));
640  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"LooseCutPUIDPassFractionVSpt",mLooseCutPUJIDPassFractionVSpt));
641  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MediumCutPUIDPassFractionVSeta",mMediumCutPUJIDPassFractionVSeta));
642  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MediumCutPUIDPassFractionVSpt",mMediumCutPUJIDPassFractionVSpt));
643  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"TightCutPUIDPassFractionVSeta",mTightCutPUJIDPassFractionVSeta));
644  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"TightCutPUIDPassFractionVSpt",mTightCutPUJIDPassFractionVSpt));
645  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_lowPt_Barrel",mCutPUJIDDiscriminant_lowPt_Barrel));
646  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_lowPt_EndCap",mCutPUJIDDiscriminant_lowPt_EndCap));
647  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_lowPt_Forward",mCutPUJIDDiscriminant_lowPt_Forward));
648  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_mediumPt_Barrel",mCutPUJIDDiscriminant_mediumPt_Barrel));
649  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_mediumPt_EndCap",mCutPUJIDDiscriminant_mediumPt_EndCap));
650  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_mediumPt_Forward",mCutPUJIDDiscriminant_mediumPt_Forward));
651  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_highPt_Barrel",mCutPUJIDDiscriminant_highPt_Barrel));
652  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_highPt_EndCap",mCutPUJIDDiscriminant_highPt_EndCap));
653  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CutPUJIDDiscriminant_highPt_Forward",mCutPUJIDDiscriminant_highPt_Forward));
654  //barrel histograms for PFJets
655  // energy fractions
656  mCHFrac_lowPt_Barrel = ibooker.book1D("CHFrac_lowPt_Barrel", "CHFrac_lowPt_Barrel", 120, -0.1, 1.1);
657  mNHFrac_lowPt_Barrel = ibooker.book1D("NHFrac_lowPt_Barrel", "NHFrac_lowPt_Barrel", 120, -0.1, 1.1);
658  mPhFrac_lowPt_Barrel = ibooker.book1D("PhFrac_lowPt_Barrel", "PhFrac_lowPt_Barrel", 120, -0.1, 1.1);
659  mCHFrac_mediumPt_Barrel = ibooker.book1D("CHFrac_mediumPt_Barrel", "CHFrac_mediumPt_Barrel", 120, -0.1, 1.1);
660  mNHFrac_mediumPt_Barrel = ibooker.book1D("NHFrac_mediumPt_Barrel", "NHFrac_mediumPt_Barrel", 120, -0.1, 1.1);
661  mPhFrac_mediumPt_Barrel = ibooker.book1D("PhFrac_mediumPt_Barrel", "PhFrac_mediumPt_Barrel", 120, -0.1, 1.1);
662  mCHFrac_highPt_Barrel = ibooker.book1D("CHFrac_highPt_Barrel", "CHFrac_highPt_Barrel", 120, -0.1, 1.1);
663  mNHFrac_highPt_Barrel = ibooker.book1D("NHFrac_highPt_Barrel", "NHFrac_highPt_Barrel", 120, -0.1, 1.1);
664  mPhFrac_highPt_Barrel = ibooker.book1D("PhFrac_highPt_Barrel", "PhFrac_highPt_Barrel", 120, -0.1, 1.1);
665 
666  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_lowPt_Barrel" ,mCHFrac_lowPt_Barrel));
667  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_lowPt_Barrel" ,mNHFrac_lowPt_Barrel));
668  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_lowPt_Barrel" ,mPhFrac_lowPt_Barrel));
669  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_mediumPt_Barrel" ,mCHFrac_mediumPt_Barrel));
670  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_mediumPt_Barrel" ,mNHFrac_mediumPt_Barrel));
671  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_mediumPt_Barrel" ,mPhFrac_mediumPt_Barrel));
672  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_highPt_Barrel" ,mCHFrac_highPt_Barrel));
673  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_highPt_Barrel" ,mNHFrac_highPt_Barrel));
674  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_highPt_Barrel" ,mPhFrac_highPt_Barrel));
675 
676  mMass_lowPt_Barrel = ibooker.book1D("JetMass_lowPt_Barrel", "JetMass_lowPt_Barrel", 50, 0, 150);
677  mMass_lowPt_EndCap = ibooker.book1D("JetMass_lowPt_EndCap", "JetMass_lowPt_EndCap", 50, 0, 150);
678  mMass_lowPt_Forward = ibooker.book1D("JetMass_lowPt_Forward", "JetMass_lowPt_Forward", 50, 0, 150);
679  mMass_mediumPt_Barrel = ibooker.book1D("JetMass_mediumPt_Barrel", "JetMass_mediumPt_Barrel", 50, 0, 150);
680  mMass_mediumPt_EndCap = ibooker.book1D("JetMass_mediumPt_EndCap", "JetMass_mediumPt_EndCap", 50, 0, 150);
681  mMass_mediumPt_Forward = ibooker.book1D("JetMass_mediumPt_Forward", "JetMass_mediumPt_Forward", 75, 0, 150);
682  mMass_highPt_Barrel = ibooker.book1D("JetMass_highPt_Barrel", "JetMass_highPt_Barrel", 50, 0, 150);
683  mMass_highPt_EndCap = ibooker.book1D("JetMass_highPt_EndCap", "JetMass_highPt_EndCap", 50, 0, 150);
684  mMass_highPt_Forward = ibooker.book1D("JetMass_highPt_Forward", "JetMass_highPt_Forward", 50, 0, 150);
685 
686  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_lowPt_Barrel" , mMass_lowPt_Barrel ));
687  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_lowPt_EndCap" , mMass_lowPt_EndCap ));
688  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_lowPt_Forward" , mMass_lowPt_Forward ));
689  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_mediumPt_Barrel" , mMass_mediumPt_Barrel ));
690  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_mediumPt_EndCap" , mMass_mediumPt_EndCap ));
691  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_mediumPt_Forward" , mMass_mediumPt_Forward ));
692  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_highPt_Barrel" , mMass_highPt_Barrel ));
693  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_highPt_EndCap" , mMass_highPt_EndCap ));
694  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_highPt_Forward" , mMass_highPt_Forward ));
695 
696 
697  //energies
698  mCHEn_lowPt_Barrel = ibooker.book1D("CHEn_lowPt_Barrel", "CHEn_lowPt_Barrel", ptBin_, 0., ptMax_);
699  mNHEn_lowPt_Barrel = ibooker.book1D("NHEn_lowPt_Barrel", "NHEn_lowPt_Barrel", ptBin_, 0., ptMax_);
700  mPhEn_lowPt_Barrel = ibooker.book1D("PhEn_lowPt_Barrel", "PhEn_lowPt_Barrel", ptBin_, 0., ptMax_);
701  mElEn_lowPt_Barrel = ibooker.book1D("ElEn_lowPt_Barrel", "ElEn_lowPt_Barrel", ptBin_, 0., 100);
702  mMuEn_lowPt_Barrel = ibooker.book1D("MuEn_lowPt_Barrel", "MuEn_lowPt_Barrel", ptBin_, 0., 100);
703  mCHEn_mediumPt_Barrel = ibooker.book1D("CHEn_mediumPt_Barrel", "CHEn_mediumPt_Barrel", ptBin_, 0., ptMax_);
704  mNHEn_mediumPt_Barrel = ibooker.book1D("NHEn_mediumPt_Barrel", "NHEn_mediumPt_Barrel", ptBin_, 0., ptMax_);
705  mPhEn_mediumPt_Barrel = ibooker.book1D("PhEn_mediumPt_Barrel", "PhEn_mediumPt_Barrel", ptBin_, 0., ptMax_);
706  mElEn_mediumPt_Barrel = ibooker.book1D("ElEn_mediumPt_Barrel", "ElEn_mediumPt_Barrel", ptBin_, 0., 100);
707  mMuEn_mediumPt_Barrel = ibooker.book1D("MuEn_mediumPt_Barrel", "MuEn_mediumPt_Barrel", ptBin_, 0., 100);
708  mCHEn_highPt_Barrel = ibooker.book1D("CHEn_highPt_Barrel", "CHEn_highPt_Barrel", ptBin_, 0., 1.1*ptMax_);
709  mNHEn_highPt_Barrel = ibooker.book1D("NHEn_highPt_Barrel", "NHEn_highPt_Barrel", ptBin_, 0., ptMax_);
710  mPhEn_highPt_Barrel = ibooker.book1D("PhEn_highPt_Barrel", "PhEn_highPt_Barrel", ptBin_, 0., ptMax_);
711  mElEn_highPt_Barrel = ibooker.book1D("ElEn_highPt_Barrel", "ElEn_highPt_Barrel", ptBin_, 0., 100);
712  mMuEn_highPt_Barrel = ibooker.book1D("MuEn_highPt_Barrel", "MuEn_highPt_Barrel", ptBin_, 0., 100);
713 
714  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_lowPt_Barrel" ,mCHEn_lowPt_Barrel));
715  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_lowPt_Barrel" ,mNHEn_lowPt_Barrel));
716  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_lowPt_Barrel" ,mPhEn_lowPt_Barrel));
717  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_lowPt_Barrel" ,mElEn_lowPt_Barrel));
718  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_lowPt_Barrel" ,mMuEn_lowPt_Barrel));
719  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_mediumPt_Barrel" ,mCHEn_mediumPt_Barrel));
720  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_mediumPt_Barrel" ,mNHEn_mediumPt_Barrel));
721  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_mediumPt_Barrel" ,mPhEn_mediumPt_Barrel));
722  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_mediumPt_Barrel" ,mElEn_mediumPt_Barrel));
723  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_mediumPt_Barrel" ,mMuEn_mediumPt_Barrel));
724  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_highPt_Barrel" ,mCHEn_highPt_Barrel));
725  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_highPt_Barrel" ,mNHEn_highPt_Barrel));
726  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_highPt_Barrel" ,mPhEn_highPt_Barrel));
727  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_highPt_Barrel" ,mElEn_highPt_Barrel));
728  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_highPt_Barrel" ,mMuEn_highPt_Barrel));
729 
730  //multiplicities
731  mChMultiplicity_lowPt_Barrel = ibooker.book1D("ChMultiplicity_lowPt_Barrel", "ChMultiplicity_lowPt_Barrel", 60,0,60);
732  mNeutMultiplicity_lowPt_Barrel = ibooker.book1D("NeutMultiplicity_lowPt_Barrel", "NeutMultiplicity_lowPt_Barrel", 60,0,60);
733  mMuMultiplicity_lowPt_Barrel = ibooker.book1D("MuMultiplicity_lowPt_Barrel", "MuMultiplicity_lowPt_Barrel", 10,0,10);
734  mChMultiplicity_mediumPt_Barrel = ibooker.book1D("ChMultiplicity_mediumPt_Barrel", "ChMultiplicity_mediumPt_Barrel", 60,0,60);
735  mNeutMultiplicity_mediumPt_Barrel = ibooker.book1D("NeutMultiplicity_mediumPt_Barrel", "NeutMultiplicity_mediumPt_Barrel", 60,0,60);
736  mMuMultiplicity_mediumPt_Barrel = ibooker.book1D("MuMultiplicity_mediumPt_Barrel", "MuMultiplicity_mediumPt_Barrel", 10,0,10);
737  mChMultiplicity_highPt_Barrel = ibooker.book1D("ChMultiplicity_highPt_Barrel", "ChMultiplicity_highPt_Barrel", 60,0,60);
738  mNeutMultiplicity_highPt_Barrel = ibooker.book1D("NeutMultiplicity_highPt_Barrel", "NeutMultiplicity_highPt_Barrel", 60,0,60);
739  mMuMultiplicity_highPt_Barrel = ibooker.book1D("MuMultiplicity_highPt_Barrel", "MuMultiplicity_highPt_Barrel", 10,0,10);
740 
741  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_lowPt_Barrel" ,mChMultiplicity_lowPt_Barrel));
742  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_lowPt_Barrel" ,mNeutMultiplicity_lowPt_Barrel));
743  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_lowPt_Barrel" ,mMuMultiplicity_lowPt_Barrel));
744  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_mediumPt_Barrel" ,mChMultiplicity_mediumPt_Barrel));
745  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_mediumPt_Barrel" ,mNeutMultiplicity_mediumPt_Barrel));
746  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_mediumPt_Barrel" ,mMuMultiplicity_mediumPt_Barrel));
747  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_highPt_Barrel" ,mChMultiplicity_highPt_Barrel));
748  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_highPt_Barrel" ,mNeutMultiplicity_highPt_Barrel));
749  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_highPt_Barrel" ,mMuMultiplicity_highPt_Barrel));
750  }
751  //
752  if(isMiniAODJet_ || isPFJet_){
753 
754  if(!filljetsubstruc_){//not available for ak8 -> so just take out
755  mMVAPUJIDDiscriminant_lowPt_Barrel = ibooker.book1D("MVAPUJIDDiscriminant_lowPt_Barrel","MVAPUJIDDiscriminant_lowPt_Barrel",50, -1.00, 1.00);
756  mMVAPUJIDDiscriminant_lowPt_EndCap = ibooker.book1D("MVAPUJIDDiscriminant_lowPt_EndCap","MVAPUJIDDiscriminant_lowPt_EndCap",50, -1.00, 1.00);
757  mMVAPUJIDDiscriminant_lowPt_Forward = ibooker.book1D("MVAPUJIDDiscriminant_lowPt_Forward","MVAPUJIDDiscriminant_lowPt_Forward",50, -1.00, 1.00);
758  mMVAPUJIDDiscriminant_mediumPt_Barrel = ibooker.book1D("MVAPUJIDDiscriminant_mediumPt_Barrel","MVAPUJIDDiscriminant_mediumPt_Barrel",50, -1.00, 1.00);
759  mMVAPUJIDDiscriminant_mediumPt_EndCap = ibooker.book1D("MVAPUJIDDiscriminant_mediumPt_EndCap","MVAPUJIDDiscriminant_mediumPt_EndCap",50, -1.00, 1.00);
760  mMVAPUJIDDiscriminant_mediumPt_Forward = ibooker.book1D("MVAPUJIDDiscriminant_mediumPt_Forward","MVAPUJIDDiscriminant_mediumPt_Forward",50, -1.00, 1.00);
761  mMVAPUJIDDiscriminant_highPt_Barrel = ibooker.book1D("MVAPUJIDDiscriminant_highPt_Barrel","MVAPUJIDDiscriminant_highPt_Barrel",50, -1.00, 1.00);
762  mMVAPUJIDDiscriminant_highPt_EndCap = ibooker.book1D("MVAPUJIDDiscriminant_highPt_EndCap","MVAPUJIDDiscriminant_highPt_EndCap",50, -1.00, 1.00);
763  mMVAPUJIDDiscriminant_highPt_Forward = ibooker.book1D("MVAPUJIDDiscriminant_highPt_Forward","MVAPUJIDDiscriminant_highPt_Forward",50, -1.00, 1.00);
764 
765  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_lowPt_Barrel",mMVAPUJIDDiscriminant_lowPt_Barrel));
766  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_lowPt_EndCap",mMVAPUJIDDiscriminant_lowPt_EndCap));
767  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_lowPt_Forward",mMVAPUJIDDiscriminant_lowPt_Forward));
768  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_Barrel",mMVAPUJIDDiscriminant_mediumPt_Barrel));
769  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_EndCap",mMVAPUJIDDiscriminant_mediumPt_EndCap));
770  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_Forward",mMVAPUJIDDiscriminant_mediumPt_Forward));
771  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_highPt_Barrel",mMVAPUJIDDiscriminant_highPt_Barrel));
772  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_highPt_EndCap",mMVAPUJIDDiscriminant_highPt_EndCap));
773  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MVAPUJIDDiscriminant_highPt_Forward",mMVAPUJIDDiscriminant_highPt_Forward));
774  }
775  mCHFracVSpT_Barrel= ibooker.bookProfile("CHFracVSpT_Barrel","CHFracVSpT_Barrel",ptBin_, ptMin_, ptMax_,0.,1.2);
776  mNHFracVSpT_Barrel= ibooker.bookProfile("NHFracVSpT_Barrel","NHFracVSpT_Barrel",ptBin_, ptMin_, ptMax_,0.,1.2);
777  mPhFracVSpT_Barrel= ibooker.bookProfile("PhFracVSpT_Barrel","PhFracVSpT_Barrel",ptBin_, ptMin_, ptMax_,0.,1.2);
778  mCHFracVSpT_EndCap= ibooker.bookProfile("CHFracVSpT_EndCap","CHFracVSpT_EndCap",ptBin_, ptMin_, ptMax_,0.,1.2);
779  mNHFracVSpT_EndCap= ibooker.bookProfile("NHFracVSpT_EndCap","NHFracVSpT_EndCap",ptBin_, ptMin_, ptMax_,0.,1.2);
780  mPhFracVSpT_EndCap= ibooker.bookProfile("PhFracVSpT_EndCap","PhFracVSpT_EndCap",ptBin_, ptMin_, ptMax_,0.,1.2);
781  mHFHFracVSpT_Forward= ibooker.bookProfile("HFHFracVSpT_Forward","HFHFracVSpT_Forward",ptBin_, ptMin_, ptMax_,-0.2,1.2);
782  mHFEFracVSpT_Forward= ibooker.bookProfile("HFEFracVSpT_Forward","HFEFracVSpT_Forward",ptBin_, ptMin_, ptMax_,-0.2,1.2);
783 
784  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSpT_Barrel" ,mCHFracVSpT_Barrel));
785  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSpT_Barrel" ,mNHFracVSpT_Barrel));
786  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSpT_Barrel" ,mPhFracVSpT_Barrel));
787  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSpT_EndCap" ,mCHFracVSpT_EndCap));
788  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSpT_EndCap" ,mNHFracVSpT_EndCap));
789  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSpT_EndCap" ,mPhFracVSpT_EndCap));
790  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracVSpT_Forward" ,mHFHFracVSpT_Forward));
791  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEFracVSpT_Forward" ,mHFEFracVSpT_Forward));
792  }
793  if(isPFJet_){
794  //endcap monitoring
795  //energy fractions
796  mCHFrac_lowPt_EndCap = ibooker.book1D("CHFrac_lowPt_EndCap", "CHFrac_lowPt_EndCap", 120, -0.1, 1.1);
797  mNHFrac_lowPt_EndCap = ibooker.book1D("NHFrac_lowPt_EndCap", "NHFrac_lowPt_EndCap", 120, -0.1, 1.1);
798  mPhFrac_lowPt_EndCap = ibooker.book1D("PhFrac_lowPt_EndCap", "PhFrac_lowPt_EndCap", 120, -0.1, 1.1);
799  mCHFrac_mediumPt_EndCap = ibooker.book1D("CHFrac_mediumPt_EndCap", "CHFrac_mediumPt_EndCap", 120, -0.1, 1.1);
800  mNHFrac_mediumPt_EndCap = ibooker.book1D("NHFrac_mediumPt_EndCap", "NHFrac_mediumPt_EndCap", 120, -0.1, 1.1);
801  mPhFrac_mediumPt_EndCap = ibooker.book1D("PhFrac_mediumPt_EndCap", "PhFrac_mediumPt_EndCap", 120, -0.1, 1.1);
802  mCHFrac_highPt_EndCap = ibooker.book1D("CHFrac_highPt_EndCap", "CHFrac_highPt_EndCap", 120, -0.1, 1.1);
803  mNHFrac_highPt_EndCap = ibooker.book1D("NHFrac_highPt_EndCap", "NHFrac_highPt_EndCap", 120, -0.1, 1.1);
804  mPhFrac_highPt_EndCap = ibooker.book1D("PhFrac_highPt_EndCap", "PhFrac_highPt_EndCap", 120, -0.1, 1.1);
805 
806  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_lowPt_EndCap" ,mCHFrac_lowPt_EndCap));
807  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_lowPt_EndCap" ,mNHFrac_lowPt_EndCap));
808  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_lowPt_EndCap" ,mPhFrac_lowPt_EndCap));
809  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_mediumPt_EndCap" ,mCHFrac_mediumPt_EndCap));
810  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_mediumPt_EndCap" ,mNHFrac_mediumPt_EndCap));
811  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_mediumPt_EndCap" ,mPhFrac_mediumPt_EndCap));
812  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_highPt_EndCap" ,mCHFrac_highPt_EndCap));
813  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_highPt_EndCap" ,mNHFrac_highPt_EndCap));
814  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_highPt_EndCap" ,mPhFrac_highPt_EndCap));
815 
816  //energies
817  mCHEn_lowPt_EndCap = ibooker.book1D("CHEn_lowPt_EndCap", "CHEn_lowPt_EndCap", ptBin_, 0., ptMax_);
818  mNHEn_lowPt_EndCap = ibooker.book1D("NHEn_lowPt_EndCap", "NHEn_lowPt_EndCap", ptBin_, 0., ptMax_);
819  mPhEn_lowPt_EndCap = ibooker.book1D("PhEn_lowPt_EndCap", "PhEn_lowPt_EndCap", ptBin_, 0., ptMax_);
820  mElEn_lowPt_EndCap = ibooker.book1D("ElEn_lowPt_EndCap", "ElEn_lowPt_EndCap", ptBin_, 0., 100);
821  mMuEn_lowPt_EndCap = ibooker.book1D("MuEn_lowPt_EndCap", "MuEn_lowPt_EndCap", ptBin_, 0., 100);
822  mCHEn_mediumPt_EndCap = ibooker.book1D("CHEn_mediumPt_EndCap", "CHEn_mediumPt_EndCap", ptBin_, 0., ptMax_);
823  mNHEn_mediumPt_EndCap = ibooker.book1D("NHEn_mediumPt_EndCap", "NHEn_mediumPt_EndCap", ptBin_, 0., ptMax_);
824  mPhEn_mediumPt_EndCap = ibooker.book1D("PhEn_mediumPt_EndCap", "PhEn_mediumPt_EndCap", ptBin_, 0., ptMax_);
825  mElEn_mediumPt_EndCap = ibooker.book1D("ElEn_mediumPt_EndCap", "ElEn_mediumPt_EndCap", ptBin_, 0., 100);
826  mMuEn_mediumPt_EndCap = ibooker.book1D("MuEn_mediumPt_EndCap", "MuEn_mediumPt_EndCap", ptBin_, 0., 100);
827  mCHEn_highPt_EndCap = ibooker.book1D("CHEn_highPt_EndCap", "CHEn_highPt_EndCap", ptBin_, 0., 1.5*ptMax_);
828  mNHEn_highPt_EndCap = ibooker.book1D("NHEn_highPt_EndCap", "NHEn_highPt_EndCap", ptBin_, 0., 1.5*ptMax_);
829  mPhEn_highPt_EndCap = ibooker.book1D("PhEn_highPt_EndCap", "PhEn_highPt_EndCap", ptBin_, 0., 1.5*ptMax_);
830  mElEn_highPt_EndCap = ibooker.book1D("ElEn_highPt_EndCap", "ElEn_highPt_EndCap", ptBin_, 0., 100);
831  mMuEn_highPt_EndCap = ibooker.book1D("MuEn_highPt_EndCap", "MuEn_highPt_EndCap", ptBin_, 0., 100);
832 
833  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_lowPt_EndCap" ,mCHEn_lowPt_EndCap));
834  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_lowPt_EndCap" ,mNHEn_lowPt_EndCap));
835  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_lowPt_EndCap" ,mPhEn_lowPt_EndCap));
836  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_lowPt_EndCap" ,mElEn_lowPt_EndCap));
837  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_lowPt_EndCap" ,mMuEn_lowPt_EndCap));
838  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_mediumPt_EndCap" ,mCHEn_mediumPt_EndCap));
839  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_mediumPt_EndCap" ,mNHEn_mediumPt_EndCap));
840  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_mediumPt_EndCap" ,mPhEn_mediumPt_EndCap));
841  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_mediumPt_EndCap" ,mElEn_mediumPt_EndCap));
842  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_mediumPt_EndCap" ,mMuEn_mediumPt_EndCap));
843  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_highPt_EndCap" ,mCHEn_highPt_EndCap));
844  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_highPt_EndCap" ,mNHEn_highPt_EndCap));
845  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_highPt_EndCap" ,mPhEn_highPt_EndCap));
846  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_highPt_EndCap" ,mElEn_highPt_EndCap));
847  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_highPt_EndCap" ,mMuEn_highPt_EndCap));
848  /*
849  //now get handle on OOT PU
850  mePhFracBarrel_BXm2BXm1Empty = ibooker.book1D("PhFracBarrel_BXm2BXm1Empty", "PHFrac prev empty 2 bunches (Barrel)", 50, 0, 1);
851  mePhFracBarrel_BXm2BXm1Filled = ibooker.book1D("PhFracBarrel_BXm2BXm1Filled", "PHFrac prev filled 2 bunches (Barrel)", 50, 0, 1);
852  meNHFracBarrel_BXm2BXm1Empty = ibooker.book1D("NHFracBarrel_BXm2BXm1Empty", "NHFrac prev empty 2 bunches (Barrel)", 50, 0, 1);
853  meNHFracBarrel_BXm2BXm1Filled = ibooker.book1D("NHFracBarrel_BXm2BXm1Filled", "NHFrac prev filled 2 bunches (Barrel)", 50, 0, 1);
854  meCHFracBarrel_BXm2BXm1Empty = ibooker.book1D("CHFracBarrel_BXm2BXm1Empty", "CHFrac prev empty 2 bunches (Barrel)", 50, 0, 1);
855  meCHFracBarrel_BXm2BXm1Filled = ibooker.book1D("CHFracBarrel_BXm2BXm1Filled", "CHFrac prev filled 2 bunches (Barrel)", 50, 0, 1);
856  mePtBarrel_BXm2BXm1Empty = ibooker.book1D("PtBarrel_BXm2BXm1Empty", "pT prev empty 2 bunches (Barrel)", ptBin_, ptMin_, ptMax_);
857  mePtBarrel_BXm2BXm1Filled = ibooker.book1D("PtBarrel_BXm2BXm1Filled", "pT prev filled 2 bunches (Barrel)", ptBin_, ptMin_, ptMax_);
858  mePhFracEndCapPlus_BXm2BXm1Empty = ibooker.book1D("PhFracEndCapPlus_BXm2BXm1Empty", "PHFrac prev empty 2 bunches (EndCapPlus)", 50, 0, 1);
859  mePhFracEndCapPlus_BXm2BXm1Filled = ibooker.book1D("PhFracEndCapPlus_BXm2BXm1Filled", "PHFrac prev filled 2 bunches (EndCapPlus)", 50, 0, 1);
860  meNHFracEndCapPlus_BXm2BXm1Empty = ibooker.book1D("NHFracEndCapPlus_BXm2BXm1Empty", "NHFrac prev empty 2 bunches (EndCapPlus)", 50, 0, 1);
861  meNHFracEndCapPlus_BXm2BXm1Filled = ibooker.book1D("NHFracEndCapPlus_BXm2BXm1Filled", "NHFrac prev filled 2 bunches (EndCapPlus)", 50, 0, 1);
862  meCHFracEndCapPlus_BXm2BXm1Empty = ibooker.book1D("CHFracEndCapPlus_BXm2BXm1Empty", "CHFrac prev empty 2 bunches (EndCapPlus)", 50, 0, 1);
863  meCHFracEndCapPlus_BXm2BXm1Filled = ibooker.book1D("CHFracEndCapPlus_BXm2BXm1Filled", "CHFrac prev filled 2 bunches (EndCapPlus)", 50, 0, 1);
864  mePtEndCapPlus_BXm2BXm1Empty = ibooker.book1D("PtEndCapPlus_BXm2BXm1Empty", "pT prev empty 2 bunches (EndCapPlus)", ptBin_, ptMin_, ptMax_);
865  mePtEndCapPlus_BXm2BXm1Filled = ibooker.book1D("PtEndCapPlus_BXm2BXm1Filled", "pT prev filled 2 bunches (EndCapPlus)", ptBin_, ptMin_, ptMax_);
866  meHFHFracPlus_BXm2BXm1Empty = ibooker.book1D("HFHFracPlus_BXm2BXm1Empty", "HFHFrac prev empty 2 bunches (EndCapPlus)", 50, 0, 1);
867  meHFHFracPlus_BXm2BXm1Filled = ibooker.book1D("HFHFracPlus_BXm2BXm1Filled", "HFHFrac prev filled 2 bunches (EndCapPlus)", 50, 0, 1);
868  meHFEMFracPlus_BXm2BXm1Empty = ibooker.book1D("HFEMFracPlus_BXm2BXm1Empty", "HFEMFrac prev empty 2 bunches (EndCapPlus)", 50, 0, 1);
869  meHFEMFracPlus_BXm2BXm1Filled = ibooker.book1D("HFEMFracPlus_BXm2BXm1Filled", "HFEMFrac prev filled 2 bunches (EndCapPlus)", 50, 0, 1);
870  mePtForwardPlus_BXm2BXm1Empty = ibooker.book1D("PtForwardPlus_BXm2BXm1Empty", "pT prev empty 2 bunches (ForwardPlus)", ptBin_, ptMin_, ptMax_);
871  mePtForwardPlus_BXm2BXm1Filled = ibooker.book1D("PtForwardPlus_BXm2BXm1Filled", "pT prev filled 2 bunches (ForwardPlus)", ptBin_, ptMin_, ptMax_);
872  mePhFracEndCapMinus_BXm2BXm1Empty = ibooker.book1D("PhFracEndCapMinus_BXm2BXm1Empty", "PHFrac prev empty 2 bunches (EndCapMinus)", 50, 0, 1);
873  mePhFracEndCapMinus_BXm2BXm1Filled = ibooker.book1D("PhFracEndCapMinus_BXm2BXm1Filled", "PHFrac prev filled 2 bunches (EndCapMinus)", 50, 0, 1);
874  meNHFracEndCapMinus_BXm2BXm1Empty = ibooker.book1D("NHFracEndCapMinus_BXm2BXm1Empty", "NHFrac prev empty 2 bunches (EndCapMinus)", 50, 0, 1);
875  meNHFracEndCapMinus_BXm2BXm1Filled = ibooker.book1D("NHFracEndCapMinus_BXm2BXm1Filled", "NHFrac prev filled 2 bunches (EndCapMinus)", 50, 0, 1);
876  meCHFracEndCapMinus_BXm2BXm1Empty = ibooker.book1D("CHFracEndCapMinus_BXm2BXm1Empty", "CHFrac prev empty 2 bunches (EndCapMinus)", 50, 0, 1);
877  meCHFracEndCapMinus_BXm2BXm1Filled = ibooker.book1D("CHFracEndCapMinus_BXm2BXm1Filled", "CHFrac prev filled 2 bunches (EndCapMinus)", 50, 0, 1);
878  mePtEndCapMinus_BXm2BXm1Empty = ibooker.book1D("PtEndCapMinus_BXm2BXm1Empty", "pT prev empty 2 bunches (EndCapMinus)", ptBin_, ptMin_, ptMax_);
879  mePtEndCapMinus_BXm2BXm1Filled = ibooker.book1D("PtEndCapMinus_BXm2BXm1Filled", "pT prev filled 2 bunches (EndCapMinus)", ptBin_, ptMin_, ptMax_);
880  meHFHFracMinus_BXm2BXm1Empty = ibooker.book1D("HFHFracMinus_BXm2BXm1Empty", "HFHFrac prev empty 2 bunches (EndCapMinus)", 50, 0, 1);
881  meHFHFracMinus_BXm2BXm1Filled = ibooker.book1D("HFHFracMinus_BXm2BXm1Filled", "HFHFrac prev filled 2 bunches (EndCapMinus)", 50, 0, 1);
882  meHFEMFracMinus_BXm2BXm1Empty = ibooker.book1D("HFEMFracMinus_BXm2BXm1Empty", "HFEMFrac prev empty 2 bunches (EndCapMinus)", 50, 0, 1);
883  meHFEMFracMinus_BXm2BXm1Filled = ibooker.book1D("HFEMFracMinus_BXm2BXm1Filled", "HFEMFrac prev filled 2 bunches (EndCapMinus)", 50, 0, 1);
884  mePtForwardMinus_BXm2BXm1Empty = ibooker.book1D("PtForwardMinus_BXm2BXm1Empty", "pT prev empty 2 bunches (ForwardMinus)", ptBin_, ptMin_, ptMax_);
885  mePtForwardMinus_BXm2BXm1Filled = ibooker.book1D("PtForwardMinus_BXm2BXm1Filled", "pT prev filled 2 bunches (ForwardMinus)", ptBin_, ptMin_, ptMax_);
886  meEta_BXm2BXm1Empty = ibooker.book1D("Eta_BXm2BXm1Empty", "eta prev empty 2 bunches", etaBin_, etaMin_, etaMax_);
887  meEta_BXm2BXm1Filled = ibooker.book1D("Eta_BXm2BXm1Filled", "eta prev filled 2 bunches", etaBin_, etaMin_, etaMax_);
888 
889  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracBarrel_BXm2BXm1Empty" ,mePhFracBarrel_BXm2BXm1Empty));
890  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracBarrel_BXm2BXm1Filled" ,mePhFracBarrel_BXm2BXm1Filled));
891  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracBarrel_BXm2BXm1Empty" ,meNHFracBarrel_BXm2BXm1Empty));
892  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracBarrel_BXm2BXm1Filled" ,meNHFracBarrel_BXm2BXm1Filled));
893  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracBarrel_BXm2BXm1Empty" ,meCHFracBarrel_BXm2BXm1Empty));
894  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracBarrel_BXm2BXm1Filled" ,meCHFracBarrel_BXm2BXm1Filled));
895  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtBarrel_BXm2BXm1Empty" ,mePtBarrel_BXm2BXm1Empty));
896  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtBarrel_BXm2BXm1Filled" ,mePtBarrel_BXm2BXm1Filled));
897  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracEndCapPlus_BXm2BXm1Empty" ,mePhFracEndCapPlus_BXm2BXm1Empty));
898  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracEndCapPlus_BXm2BXm1Filled" ,mePhFracEndCapPlus_BXm2BXm1Filled));
899  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracEndCapPlus_BXm2BXm1Empty" ,meNHFracEndCapPlus_BXm2BXm1Empty));
900  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracEndCapPlus_BXm2BXm1Filled" ,meNHFracEndCapPlus_BXm2BXm1Filled));
901  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracEndCapPlus_BXm2BXm1Empty" ,meCHFracEndCapPlus_BXm2BXm1Empty));
902  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracEndCapPlus_BXm2BXm1Filled" ,meCHFracEndCapPlus_BXm2BXm1Filled));
903  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtEndCapPlus_BXm2BXm1Empty" ,mePtEndCapPlus_BXm2BXm1Empty));
904  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtEndCapPlus_BXm2BXm1Filled" ,mePtEndCapPlus_BXm2BXm1Filled));
905  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracPlus_BXm2BXm1Empty" ,meHFHFracPlus_BXm2BXm1Empty));
906  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracPlus_BXm2BXm1Filled" ,meHFHFracPlus_BXm2BXm1Filled));
907  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFracPlus_BXm2BXm1Empty" ,meHFEMFracPlus_BXm2BXm1Empty));
908  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFracPlus_BXm2BXm1Filled" ,meHFEMFracPlus_BXm2BXm1Filled));
909  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtForwardPlus_BXm2BXm1Empty" ,mePtForwardPlus_BXm2BXm1Empty));
910  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtForwardPlus_BXm2BXm1Filled" ,mePtForwardPlus_BXm2BXm1Filled));
911  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracEndCapMinus_BXm2BXm1Empty" ,mePhFracEndCapMinus_BXm2BXm1Empty));
912  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracEndCapMinus_BXm2BXm1Filled" ,mePhFracEndCapMinus_BXm2BXm1Filled));
913  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracEndCapMinus_BXm2BXm1Empty" ,meNHFracEndCapMinus_BXm2BXm1Empty));
914  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracEndCapMinus_BXm2BXm1Filled" ,meNHFracEndCapMinus_BXm2BXm1Filled));
915  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracEndCapMinus_BXm2BXm1Empty" ,meCHFracEndCapMinus_BXm2BXm1Empty));
916  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracEndCapMinus_BXm2BXm1Filled" ,meCHFracEndCapMinus_BXm2BXm1Filled));
917  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtEndCapMinus_BXm2BXm1Empty" ,mePtEndCapMinus_BXm2BXm1Empty));
918  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtEndCapMinus_BXm2BXm1Filled" ,mePtEndCapMinus_BXm2BXm1Filled));
919  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracMinus_BXm2BXm1Empty" ,meHFHFracMinus_BXm2BXm1Empty));
920  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracMinus_BXm2BXm1Filled" ,meHFHFracMinus_BXm2BXm1Filled));
921  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFracMinus_BXm2BXm1Empty" ,meHFEMFracMinus_BXm2BXm1Empty));
922  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFracMinus_BXm2BXm1Filled" ,meHFEMFracMinus_BXm2BXm1Filled));
923  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtForwardMinus_BXm2BXm1Empty" ,mePtForwardMinus_BXm2BXm1Empty));
924  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtForwardMinus_BXm2BXm1Filled" ,mePtForwardMinus_BXm2BXm1Filled));
925  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_BXm2BXm1Empty" ,meEta_BXm2BXm1Empty));
926  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_BXm2BXm1Filled",meEta_BXm2BXm1Filled));
927  */
928  mePhFracBarrel_BXm1Empty = ibooker.book1D("PhFracBarrel_BXm1Empty", "PHFrac prev empty 1 bunch (Barrel)", 50, 0, 1);
929  mePhFracBarrel_BXm1Filled = ibooker.book1D("PhFracBarrel_BXm1Filled", "PHFrac prev filled 1 bunch (Barrel)", 50, 0, 1);
930  meNHFracBarrel_BXm1Empty = ibooker.book1D("NHFracBarrel_BXm1Empty", "NHFrac prev empty 1 bunch (Barrel)", 50, 0, 1);
931  meNHFracBarrel_BXm1Filled = ibooker.book1D("NHFracBarrel_BXm1Filled", "NHFrac prev filled 1 bunch (Barrel)", 50, 0, 1);
932  meCHFracBarrel_BXm1Empty = ibooker.book1D("CHFracBarrel_BXm1Empty", "CHFrac prev empty 1 bunch (Barrel)", 50, 0, 1);
933  meCHFracBarrel_BXm1Filled = ibooker.book1D("CHFracBarrel_BXm1Filled", "CHFrac prev filled 1 bunch (Barrel)", 50, 0, 1);
934  mePtBarrel_BXm1Empty = ibooker.book1D("PtBarrel_BXm1Empty", "pT prev empty 1 bunch (Barrel)", ptBin_, ptMin_, ptMax_);
935  mePtBarrel_BXm1Filled = ibooker.book1D("PtBarrel_BXm1Filled", "pT prev filled 1 bunch (Barrel)", ptBin_, ptMin_, ptMax_);
936  mePhFracEndCapPlus_BXm1Empty = ibooker.book1D("PhFracEndCapPlus_BXm1Empty", "PHFrac prev empty 1 bunch (EndCapPlus)", 50, 0, 1);
937  mePhFracEndCapPlus_BXm1Filled = ibooker.book1D("PhFracEndCapPlus_BXm1Filled", "PHFrac prev filled 1 bunch (EndCapPlus)", 50, 0, 1);
938  meNHFracEndCapPlus_BXm1Empty = ibooker.book1D("NHFracEndCapPlus_BXm1Empty", "NHFrac prev empty 1 bunch (EndCapPlus)", 50, 0, 1);
939  meNHFracEndCapPlus_BXm1Filled = ibooker.book1D("NHFracEndCapPlus_BXm1Filled", "NHFrac prev filled 1 bunch (EndCapPlus)", 50, 0, 1);
940  meCHFracEndCapPlus_BXm1Empty = ibooker.book1D("CHFracEndCapPlus_BXm1Empty", "CHFrac prev empty 1 bunch (EndCapPlus)", 50, 0, 1);
941  meCHFracEndCapPlus_BXm1Filled = ibooker.book1D("CHFracEndCapPlus_BXm1Filled", "CHFrac prev filled 1 bunch (EndCapPlus)", 50, 0, 1);
942  mePtEndCapPlus_BXm1Empty = ibooker.book1D("PtEndCapPlus_BXm1Empty", "pT prev empty 1 bunch (EndCapPlus)", ptBin_, ptMin_, ptMax_);
943  mePtEndCapPlus_BXm1Filled = ibooker.book1D("PtEndCapPlus_BXm1Filled", "pT prev filled 1 bunch (EndCapPlus)", ptBin_, ptMin_, ptMax_);
944  meHFHFracPlus_BXm1Empty = ibooker.book1D("HFHFracPlus_BXm1Empty", "HFHFrac prev empty 1 bunch (EndCapPlus)", 50, 0, 1);
945  meHFHFracPlus_BXm1Filled = ibooker.book1D("HFHFracPlus_BXm1Filled", "HFHFrac prev filled 1 bunch (EndCapPlus)", 50, 0, 1);
946  meHFEMFracPlus_BXm1Empty = ibooker.book1D("HFEMFracPlus_BXm1Empty", "HFEMFrac prev empty 1 bunch (EndCapPlus)", 50, 0, 1);
947  meHFEMFracPlus_BXm1Filled = ibooker.book1D("HFEMFracPlus_BXm1Filled", "HFEMFrac prev filled 1 bunch (EndCapPlus)", 50, 0, 1);
948  mePtForwardPlus_BXm1Empty = ibooker.book1D("PtForwardPlus_BXm1Empty", "pT prev empty 1 bunch (ForwardPlus)", ptBin_, ptMin_, ptMax_);
949  mePtForwardPlus_BXm1Filled = ibooker.book1D("PtForwardPlus_BXm1Filled", "pT prev filled 1 bunch (ForwardPlus)", ptBin_, ptMin_, ptMax_);
950  mePhFracEndCapMinus_BXm1Empty = ibooker.book1D("PhFracEndCapMinus_BXm1Empty", "PHFrac prev empty 1 bunch (EndCapMinus)", 50, 0, 1);
951  mePhFracEndCapMinus_BXm1Filled = ibooker.book1D("PhFracEndCapMinus_BXm1Filled", "PHFrac prev filled 1 bunch (EndCapMinus)", 50, 0, 1);
952  meNHFracEndCapMinus_BXm1Empty = ibooker.book1D("NHFracEndCapMinus_BXm1Empty", "NHFrac prev empty 1 bunch (EndCapMinus)", 50, 0, 1);
953  meNHFracEndCapMinus_BXm1Filled = ibooker.book1D("NHFracEndCapMinus_BXm1Filled", "NHFrac prev filled 1 bunch (EndCapMinus)", 50, 0, 1);
954  meCHFracEndCapMinus_BXm1Empty = ibooker.book1D("CHFracEndCapMinus_BXm1Empty", "CHFrac prev empty 1 bunch (EndCapMinus)", 50, 0, 1);
955  meCHFracEndCapMinus_BXm1Filled = ibooker.book1D("CHFracEndCapMinus_BXm1Filled", "CHFrac prev filled 1 bunch (EndCapMinus)", 50, 0, 1);
956  mePtEndCapMinus_BXm1Empty = ibooker.book1D("PtEndCapMinus_BXm1Empty", "pT prev empty 1 bunch (EndCapMinus)", ptBin_, ptMin_, ptMax_);
957  mePtEndCapMinus_BXm1Filled = ibooker.book1D("PtEndCapMinus_BXm1Filled", "pT prev filled 1 bunch (EndCapMinus)", ptBin_, ptMin_, ptMax_);
958  meHFHFracMinus_BXm1Empty = ibooker.book1D("HFHFracMinus_BXm1Empty", "HFHFrac prev empty 1 bunch (EndCapMinus)", 50, 0, 1);
959  meHFHFracMinus_BXm1Filled = ibooker.book1D("HFHFracMinus_BXm1Filled", "HFHFrac prev filled 1 bunch (EndCapMinus)", 50, 0, 1);
960  meHFEMFracMinus_BXm1Empty = ibooker.book1D("HFEMFracMinus_BXm1Empty", "HFEMFrac prev empty 1 bunch (EndCapMinus)", 50, 0, 1);
961  meHFEMFracMinus_BXm1Filled = ibooker.book1D("HFEMFracMinus_BXm1Filled", "HFEMFrac prev filled 1 bunch (EndCapMinus)", 50, 0, 1);
962  mePtForwardMinus_BXm1Empty = ibooker.book1D("PtForwardMinus_BXm1Empty", "pT prev empty 1 bunch (ForwardMinus)", ptBin_, ptMin_, ptMax_);
963  mePtForwardMinus_BXm1Filled = ibooker.book1D("PtForwardMinus_BXm1Filled", "pT prev filled 1 bunch (ForwardMinus)", ptBin_, ptMin_, ptMax_);
964  meEta_BXm1Empty = ibooker.book1D("Eta_BXm1Empty", "eta prev empty 1 bunch", etaBin_, etaMin_, etaMax_);
965  meEta_BXm1Filled = ibooker.book1D("Eta_BXm1Filled", "eta prev filled 1 bunch", etaBin_, etaMin_, etaMax_);
966 
967  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracBarrel_BXm1Empty" ,mePhFracBarrel_BXm1Empty));
968  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracBarrel_BXm1Filled" ,mePhFracBarrel_BXm1Filled));
969  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracBarrel_BXm1Empty" ,meNHFracBarrel_BXm1Empty));
970  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracBarrel_BXm1Filled" ,meNHFracBarrel_BXm1Filled));
971  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracBarrel_BXm1Empty" ,meCHFracBarrel_BXm1Empty));
972  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracBarrel_BXm1Filled" ,meCHFracBarrel_BXm1Filled));
973  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtBarrel_BXm1Empty" ,mePtBarrel_BXm1Empty));
974  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtBarrel_BXm1Filled" ,mePtBarrel_BXm1Filled));
975  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracEndCapPlus_BXm1Empty" ,mePhFracEndCapPlus_BXm1Empty));
976  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracEndCapPlus_BXm1Filled" ,mePhFracEndCapPlus_BXm1Filled));
977  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracEndCapPlus_BXm1Empty" ,meNHFracEndCapPlus_BXm1Empty));
978  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracEndCapPlus_BXm1Filled" ,meNHFracEndCapPlus_BXm1Filled));
979  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracEndCapPlus_BXm1Empty" ,meCHFracEndCapPlus_BXm1Empty));
980  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracEndCapPlus_BXm1Filled" ,meCHFracEndCapPlus_BXm1Filled));
981  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtEndCapPlus_BXm1Empty" ,mePtEndCapPlus_BXm1Empty));
982  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtEndCapPlus_BXm1Filled" ,mePtEndCapPlus_BXm1Filled));
983  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracPlus_BXm1Empty" ,meHFHFracPlus_BXm1Empty));
984  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracPlus_BXm1Filled" ,meHFHFracPlus_BXm1Filled));
985  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFracPlus_BXm1Empty" ,meHFEMFracPlus_BXm1Empty));
986  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFracPlus_BXm1Filled" ,meHFEMFracPlus_BXm1Filled));
987  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtForwardPlus_BXm1Empty" ,mePtForwardPlus_BXm1Empty));
988  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtForwardPlus_BXm1Filled" ,mePtForwardPlus_BXm1Filled));
989  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracEndCapMinus_BXm1Empty" ,mePhFracEndCapMinus_BXm1Empty));
990  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracEndCapMinus_BXm1Filled" ,mePhFracEndCapMinus_BXm1Filled));
991  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracEndCapMinus_BXm1Empty" ,meNHFracEndCapMinus_BXm1Empty));
992  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracEndCapMinus_BXm1Filled" ,meNHFracEndCapMinus_BXm1Filled));
993  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracEndCapMinus_BXm1Empty" ,meCHFracEndCapMinus_BXm1Empty));
994  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracEndCapMinus_BXm1Filled" ,meCHFracEndCapMinus_BXm1Filled));
995  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtEndCapMinus_BXm1Empty" ,mePtEndCapMinus_BXm1Empty));
996  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtEndCapMinus_BXm1Filled" ,mePtEndCapMinus_BXm1Filled));
997  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracMinus_BXm1Empty" ,meHFHFracMinus_BXm1Empty));
998  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracMinus_BXm1Filled" ,meHFHFracMinus_BXm1Filled));
999  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFracMinus_BXm1Empty" ,meHFEMFracMinus_BXm1Empty));
1000  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFracMinus_BXm1Filled" ,meHFEMFracMinus_BXm1Filled));
1001  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtForwardMinus_BXm1Empty" ,mePtForwardMinus_BXm1Empty));
1002  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtForwardMinus_BXm1Filled" ,mePtForwardMinus_BXm1Filled));
1003  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_BXm1Empty" ,meEta_BXm1Empty));
1004  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_BXm1Filled",meEta_BXm1Filled));
1005 
1006  //multiplicities
1007  mChMultiplicity_lowPt_EndCap = ibooker.book1D("ChMultiplicity_lowPt_EndCap", "ChMultiplicity_lowPt_EndCap", 60,0,60);
1008  mNeutMultiplicity_lowPt_EndCap = ibooker.book1D("NeutMultiplicity_lowPt_EndCap", "NeutMultiplicity_lowPt_EndCap", 60,0,60);
1009  mMuMultiplicity_lowPt_EndCap = ibooker.book1D("MuMultiplicity_lowPt_EndCap", "MuMultiplicity_lowPt_EndCap", 10,0,10);
1010  mChMultiplicity_mediumPt_EndCap = ibooker.book1D("ChMultiplicity_mediumPt_EndCap", "ChMultiplicity_mediumPt_EndCap", 60,0,60);
1011  mNeutMultiplicity_mediumPt_EndCap = ibooker.book1D("NeutMultiplicity_mediumPt_EndCap", "NeutMultiplicity_mediumPt_EndCap", 60,0,60);
1012  mMuMultiplicity_mediumPt_EndCap = ibooker.book1D("MuMultiplicity_mediumPt_EndCap", "MuMultiplicity_mediumPt_EndCap", 10,0,10);
1013  mChMultiplicity_highPt_EndCap = ibooker.book1D("ChMultiplicity_highPt_EndCap", "ChMultiplicity_highPt_EndCap", 60,0,60);
1014  mNeutMultiplicity_highPt_EndCap = ibooker.book1D("NeutMultiplicity_highPt_EndCap", "NeutMultiplicity_highPt_EndCap", 60,0,60);
1015  mMuMultiplicity_highPt_EndCap = ibooker.book1D("MuMultiplicity_highPt_EndCap", "MuMultiplicity_highPt_EndCap", 10,0,10);
1016 
1017  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_lowPt_EndCap" ,mChMultiplicity_lowPt_EndCap));
1018  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_lowPt_EndCap" ,mNeutMultiplicity_lowPt_EndCap));
1019  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_lowPt_EndCap" ,mMuMultiplicity_lowPt_EndCap));
1020  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_mediumPt_EndCap" ,mChMultiplicity_mediumPt_EndCap));
1021  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_mediumPt_EndCap" ,mNeutMultiplicity_mediumPt_EndCap));
1022  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_mediumPt_EndCap" ,mMuMultiplicity_mediumPt_EndCap));
1023  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_highPt_EndCap" ,mChMultiplicity_highPt_EndCap));
1024  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_highPt_EndCap" ,mNeutMultiplicity_highPt_EndCap));
1025  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_highPt_EndCap" ,mMuMultiplicity_highPt_EndCap));
1026 
1027  //forward monitoring
1028  //energy fraction
1029  mHFEFrac_lowPt_Forward = ibooker.book1D("HFEFrac_lowPt_Forward", "HFEFrac_lowPt_Forward", 70, -0.2, 1.2);
1030  mHFHFrac_lowPt_Forward = ibooker.book1D("HFHFrac_lowPt_Forward", "HFHFrac_lowPt_Forward", 70, -0.2, 1.2);
1031  mHFEFrac_mediumPt_Forward = ibooker.book1D("HFEFrac_mediumPt_Forward", "HFEFrac_mediumPt_Forward", 70, -0.2, 1.2);
1032  mHFHFrac_mediumPt_Forward = ibooker.book1D("HFHFrac_mediumPt_Forward", "HFHFrac_mediumPt_Forward", 70, -0.2, 1.2);
1033  mHFEFrac_highPt_Forward = ibooker.book1D("HFEFrac_highPt_Forward", "HFEFrac_highPt_Forward", 70, -0.2, 1.2);
1034  mHFHFrac_highPt_Forward = ibooker.book1D("HFHFrac_highPt_Forward", "HFHFrac_highPt_Forward", 70, -0.2, 1.2);
1035  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac_lowPt_Forward" ,mHFHFrac_lowPt_Forward));
1036  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEFrac_lowPt_Forward" ,mHFEFrac_lowPt_Forward));
1037  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac_mediumPt_Forward" ,mHFHFrac_mediumPt_Forward));
1038  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEFrac_mediumPt_Forward" ,mHFEFrac_mediumPt_Forward));
1039  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac_highPt_Forward" ,mHFHFrac_highPt_Forward));
1040  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEFrac_highPt_Forward" ,mHFEFrac_highPt_Forward));
1041 
1042  //energies
1043  mHFEEn_lowPt_Forward = ibooker.book1D("HFEEn_lowPt_Forward", "HFEEn_lowPt_Forward", ptBin_, 0., ptMax_);
1044  mHFHEn_lowPt_Forward = ibooker.book1D("HFHEn_lowPt_Forward", "HFHEn_lowPt_Forward", ptBin_, 0., 2.0*ptMax_);
1045  mHFEEn_mediumPt_Forward = ibooker.book1D("HFEEn_mediumPt_Forward", "HFEEn_mediumPt_Forward", ptBin_, 0., 1.5*ptMax_);
1046  mHFHEn_mediumPt_Forward = ibooker.book1D("HFHEn_mediumPt_Forward", "HFHEn_mediumPt_Forward", ptBin_, 0., 2.5*ptMax_);
1047  mHFEEn_highPt_Forward = ibooker.book1D("HFEEn_highPt_Forward", "HFEEn_highPt_Forward", ptBin_, 0., 1.5*ptMax_);
1048  mHFHEn_highPt_Forward = ibooker.book1D("HFHEn_highPt_Forward", "HFHEn_highPt_Forward", ptBin_, 0., 5.0*ptMax_);
1049  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHEn_lowPt_Forward" ,mHFHEn_lowPt_Forward));
1050  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEEn_lowPt_Forward" ,mHFEEn_lowPt_Forward));
1051  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHEn_mediumPt_Forward" ,mHFHEn_mediumPt_Forward));
1052  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEEn_mediumPt_Forward" ,mHFEEn_mediumPt_Forward));
1053  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHEn_highPt_Forward" ,mHFHEn_highPt_Forward));
1054  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEEn_highPt_Forward" ,mHFEEn_highPt_Forward));
1055  //multiplicities
1056  mNeutMultiplicity_lowPt_Forward = ibooker.book1D("NeutMultiplicity_lowPt_Forward", "NeutMultiplicity_lowPt_Forward", 60,0,60);
1057  mNeutMultiplicity_mediumPt_Forward = ibooker.book1D("NeutMultiplicity_mediumPt_Forward", "NeutMultiplicity_mediumPt_Forward", 60,0,60);
1058  mNeutMultiplicity_highPt_Forward = ibooker.book1D("NeutMultiplicity_highPt_Forward", "NeutMultiplicity_highPt_Forward", 60,0,60);
1059 
1060  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_lowPt_Forward" ,mNeutMultiplicity_lowPt_Forward));
1061  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_mediumPt_Forward" ,mNeutMultiplicity_mediumPt_Forward));
1062  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_highPt_Forward" ,mNeutMultiplicity_highPt_Forward));
1063 
1064  mChargedHadronEnergy = ibooker.book1D("ChargedHadronEnergy", "charged HAD energy", 50, 0, 100);
1065  mNeutralHadronEnergy = ibooker.book1D("NeutralHadronEnergy", "neutral HAD energy", 50, 0, 100);
1066  mChargedEmEnergy = ibooker.book1D("ChargedEmEnergy", "charged EM energy ", 50, 0, 100);
1067  mChargedMuEnergy = ibooker.book1D("ChargedMuEnergy", "charged Mu energy", 50, 0, 100);
1068  mNeutralEmEnergy = ibooker.book1D("NeutralEmEnergy", "neutral EM energy", 50, 0, 100);
1069  mChargedMultiplicity = ibooker.book1D("ChargedMultiplicity", "charged multiplicity ", 50, 0, 100);
1070  mNeutralMultiplicity = ibooker.book1D("NeutralMultiplicity", "neutral multiplicity", 50, 0, 100);
1071  mMuonMultiplicity = ibooker.book1D("MuonMultiplicity", "muon multiplicity", 50, 0, 100);
1072  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedHadronEnergy" ,mChargedHadronEnergy));
1073  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralHadronEnergy" ,mNeutralHadronEnergy));
1074  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedEmEnergy" ,mChargedEmEnergy));
1075  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMuEnergy" ,mChargedMuEnergy));
1076  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralEmEnergy" ,mNeutralEmEnergy));
1077  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMultiplicity" ,mChargedMultiplicity));
1078  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralMultiplicity" ,mNeutralMultiplicity));
1079  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuonMultiplicity" ,mMuonMultiplicity));
1080 
1081  // Book NPV profiles
1082  //----------------------------------------------------------------------------
1083  mChargedHadronEnergy_profile = ibooker.bookProfile("ChargedHadronEnergy_profile", "charged HAD energy", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1084  mNeutralHadronEnergy_profile = ibooker.bookProfile("NeutralHadronEnergy_profile", "neutral HAD energy", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1085  mChargedEmEnergy_profile = ibooker.bookProfile("ChargedEmEnergy_profile", "charged EM energy", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1086  mChargedMuEnergy_profile = ibooker.bookProfile("ChargedMuEnergy_profile", "charged Mu energy", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1087  mNeutralEmEnergy_profile = ibooker.bookProfile("NeutralEmEnergy_profile", "neutral EM energy", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1088  mChargedMultiplicity_profile = ibooker.bookProfile("ChargedMultiplicity_profile", "charged multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1089  mNeutralMultiplicity_profile = ibooker.bookProfile("NeutralMultiplicity_profile", "neutral multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1090  mMuonMultiplicity_profile = ibooker.bookProfile("MuonMultiplicity_profile", "muon multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1091 
1092  // Set NPV profiles x-axis title
1093  //----------------------------------------------------------------------------
1094  mChargedHadronEnergy_profile->setAxisTitle("nvtx",1);
1095  mNeutralHadronEnergy_profile->setAxisTitle("nvtx",1);
1096  mChargedEmEnergy_profile ->setAxisTitle("nvtx",1);
1097  mChargedMuEnergy_profile ->setAxisTitle("nvtx",1);
1098  mNeutralEmEnergy_profile ->setAxisTitle("nvtx",1);
1099  mChargedMultiplicity_profile->setAxisTitle("nvtx",1);
1100  mNeutralMultiplicity_profile->setAxisTitle("nvtx",1);
1101  mMuonMultiplicity_profile ->setAxisTitle("nvtx",1);
1102 
1103  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedHadronEnergy_profile" ,mChargedHadronEnergy_profile));
1104  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralHadronEnergy_profile" ,mNeutralHadronEnergy_profile));
1105  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedEmEnergy_profile" ,mChargedEmEnergy_profile));
1106  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMuEnergy_profile" ,mChargedMuEnergy_profile));
1107  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralEmEnergy_profile" ,mNeutralEmEnergy_profile));
1108  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMultiplicity_profile" ,mChargedMultiplicity_profile));
1109  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralMultiplicity_profile" ,mNeutralMultiplicity_profile));
1110  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuonMultiplicity_profile" ,mMuonMultiplicity_profile));
1111 
1112  mNeutralFraction = ibooker.book1D("NeutralConstituentsFraction","Neutral Constituents Fraction",100,0,1);
1113  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralConstituentsFraction" ,mNeutralFraction));
1114 
1115  }
1116 
1117  //
1118  if(isMiniAODJet_){
1119  mMass_Barrel = ibooker.book1D("JetMass_Barrel", "JetMass_Barrel", 50, 0, 250);
1120  mMass_EndCap = ibooker.book1D("JetMass_EndCap", "JetMass_EndCap", 50, 0, 250);
1121  mMass_Forward = ibooker.book1D("JetMass_Forward", "JetMass_Forward", 50, 0, 250);
1122 
1123  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_Barrel" , mMass_Barrel ));
1124  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_EndCap" , mMass_EndCap ));
1125  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetMass_Forward" , mMass_Forward ));
1126  if(!filljetsubstruc_){
1127  //done only for MINIAOD
1128  mPt_CaloJet = ibooker.book1D("Pt_CaloJet", "Pt_CaloJet", ptBin_, 10, ptMax_);
1129  mEMF_CaloJet = ibooker.book1D("EMF_CaloJet", "EMF_CaloJet", 52, -0.02, 1.02);
1130  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_CaloJet" ,mPt_CaloJet));
1131  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EMF_CaloJet" ,mEMF_CaloJet));
1132  }
1133  if(filljetsubstruc_){
1134  //miniaod specific variables, especially for substructure
1135  mSoftDropMass = ibooker.book1D("SoftDropMass", "SoftDropMass", 50, 0, 250);
1136  mPrunedMass = ibooker.book1D("PrunedMass", "PrunedMass", 50, 0, 250);
1137  mTrimmedMass = ibooker.book1D("TrimmedMass", "TrimmedMass", 50, 0, 250);
1138  mFilteredMass = ibooker.book1D("FilteredMass", "FilteredMass", 50, 0, 250);
1139  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SoftDropMass" ,mSoftDropMass));
1140  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PrunedMass" ,mPrunedMass));
1141  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"TrimmedMass" ,mTrimmedMass));
1142  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"FilteredMass" ,mFilteredMass));
1143 
1144  mtau2_over_tau1 = ibooker.book1D("tau2_over_tau1", "tau2_over_tau1", 50, 0, 1);
1145  mtau3_over_tau2 = ibooker.book1D("tau3_over_tau2", "tau3_over_tau2", 50, 0, 1);
1146  mCATopTag_topMass = ibooker.book1D("CATopTag_topMass", "CATopTag_topMass", 50, 50, 250);
1147  mCATopTag_minMass = ibooker.book1D("CATopTag_minMass", "CATopTag_minMass", 50, 0, 250);
1148  mCATopTag_nSubJets = ibooker.book1D("nSubJets_CATopTag", "nSubJets_CATopTag", 10, 0, 10);
1149  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"tau2_over_tau1" ,mtau2_over_tau1));
1150  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"tau3_over_tau2" ,mtau3_over_tau2));
1151  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CATopTag_topMass" ,mCATopTag_topMass));
1152  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CATopTag_minMass" ,mCATopTag_minMass));
1153  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nSubJets_CATopTag" ,mCATopTag_nSubJets));
1154 
1155  mnSubJetsCMSTopTag = ibooker.book1D("nSubJets_CMSTopTag", "nSubJets_CMSTopTag", 10, 0, 10);
1156  mSubJet1_CMSTopTag_pt = ibooker.book1D("SubJet1_CMSTopTag_pt", "SubJet1_CMSTopTag_pt", ptBin_, ptMin_, ptMax_);
1157  mSubJet1_CMSTopTag_eta = ibooker.book1D("SubJet1_CMSTopTag_eta", "SubJet1_CMSTopTag_eta", etaBin_, etaMin_, etaMax_);
1158  mSubJet1_CMSTopTag_phi = ibooker.book1D("SubJet1_CMSTopTag_phi", "SubJet1_CMSTopTag_phi", phiBin_, phiMin_, phiMax_);
1159  mSubJet1_CMSTopTag_mass = ibooker.book1D("SubJet1_CMSTopTag_mass", "SubJet1_CMSTopTag_mass", 50, 0, 250);
1160  mSubJet2_CMSTopTag_pt = ibooker.book1D("SubJet2_CMSTopTag_pt", "SubJet2_CMSTopTag_pt", ptBin_, ptMin_, ptMax_);
1161  mSubJet2_CMSTopTag_eta = ibooker.book1D("SubJet2_CMSTopTag_eta", "SubJet2_CMSTopTag_eta", etaBin_, etaMin_, etaMax_);
1162  mSubJet2_CMSTopTag_phi = ibooker.book1D("SubJet2_CMSTopTag_phi", "SubJet2_CMSTopTag_phi", phiBin_, phiMin_, phiMax_);
1163  mSubJet2_CMSTopTag_mass = ibooker.book1D("SubJet2_CMSTopTag_mass", "SubJet2_CMSTopTag_mass", 50, 0, 250);
1164  mSubJet3_CMSTopTag_pt = ibooker.book1D("SubJet3_CMSTopTag_pt", "SubJet3_CMSTopTag_pt", ptBin_, ptMin_, ptMax_);
1165  mSubJet3_CMSTopTag_eta = ibooker.book1D("SubJet3_CMSTopTag_eta", "SubJet3_CMSTopTag_eta", etaBin_, etaMin_, etaMax_);
1166  mSubJet3_CMSTopTag_phi = ibooker.book1D("SubJet3_CMSTopTag_phi", "SubJet3_CMSTopTag_phi", phiBin_, phiMin_, phiMax_);
1167  mSubJet3_CMSTopTag_mass = ibooker.book1D("SubJet3_CMSTopTag_mass", "SubJet3_CMSTopTag_mass", 50, 0, 250);
1168  mSubJet4_CMSTopTag_pt = ibooker.book1D("SubJet4_CMSTopTag_pt", "SubJet4_CMSTopTag_pt", ptBin_, ptMin_, ptMax_);
1169  mSubJet4_CMSTopTag_eta = ibooker.book1D("SubJet4_CMSTopTag_eta", "SubJet4_CMSTopTag_eta", etaBin_, etaMin_, etaMax_);
1170  mSubJet4_CMSTopTag_phi = ibooker.book1D("SubJet4_CMSTopTag_phi", "SubJet4_CMSTopTag_phi", phiBin_, phiMin_, phiMax_);
1171  mSubJet4_CMSTopTag_mass = ibooker.book1D("SubJet4_CMSTopTag_mass", "SubJet4_CMSTopTag_mass", 50, 0, 250);
1172 
1173  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nSubJets_CMSTopTag" ,mnSubJetsCMSTopTag));
1174  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_CMSTopTag_pt" ,mSubJet1_CMSTopTag_pt));
1175  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_CMSTopTag_eta" ,mSubJet1_CMSTopTag_eta));
1176  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_CMSTopTag_phi" ,mSubJet1_CMSTopTag_phi));
1177  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_CMSTopTag_mass" ,mSubJet1_CMSTopTag_mass));
1178  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_CMSTopTag_pt" ,mSubJet2_CMSTopTag_pt));
1179  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_CMSTopTag_eta" ,mSubJet2_CMSTopTag_eta));
1180  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_CMSTopTag_phi" ,mSubJet2_CMSTopTag_phi));
1181  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_CMSTopTag_mass" ,mSubJet2_CMSTopTag_mass));
1182  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet3_CMSTopTag_pt" ,mSubJet3_CMSTopTag_pt));
1183  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet3_CMSTopTag_eta" ,mSubJet3_CMSTopTag_eta));
1184  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet3_CMSTopTag_phi" ,mSubJet3_CMSTopTag_phi));
1185  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet3_CMSTopTag_mass" ,mSubJet3_CMSTopTag_mass));
1186  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet4_CMSTopTag_pt" ,mSubJet4_CMSTopTag_pt));
1187  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet4_CMSTopTag_eta" ,mSubJet4_CMSTopTag_eta));
1188  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet4_CMSTopTag_phi" ,mSubJet4_CMSTopTag_phi));
1189  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet4_CMSTopTag_mass" ,mSubJet4_CMSTopTag_mass));
1190 
1191  mnSubJetsSoftDrop = ibooker.book1D("nSubJets_SoftDrop", "nSubJets_SoftDrop", 10, 0, 10);
1192  mSubJet1_SoftDrop_pt = ibooker.book1D("SubJet1_SoftDrop_pt", "SubJet1_SoftDrop_pt", ptBin_, ptMin_, ptMax_);
1193  mSubJet1_SoftDrop_eta = ibooker.book1D("SubJet1_SoftDrop_eta", "SubJet1_SoftDrop_eta", etaBin_, etaMin_, etaMax_);
1194  mSubJet1_SoftDrop_phi = ibooker.book1D("SubJet1_SoftDrop_phi", "SubJet1_SoftDrop_phi", phiBin_, phiMin_, phiMax_);
1195  mSubJet1_SoftDrop_mass = ibooker.book1D("SubJet1_SoftDrop_mass", "SubJet1_SoftDrop_mass", 50, 0, 250);
1196  mSubJet2_SoftDrop_pt = ibooker.book1D("SubJet2_SoftDrop_pt", "SubJet2_SoftDrop_pt", ptBin_, ptMin_, ptMax_);
1197  mSubJet2_SoftDrop_eta = ibooker.book1D("SubJet2_SoftDrop_eta", "SubJet2_SoftDrop_eta", etaBin_, etaMin_, etaMax_);
1198  mSubJet2_SoftDrop_phi = ibooker.book1D("SubJet2_SoftDrop_phi", "SubJet2_SoftDrop_phi", phiBin_, phiMin_, phiMax_);
1199  mSubJet2_SoftDrop_mass = ibooker.book1D("SubJet2_SoftDrop_mass", "SubJet2_SoftDrop_mass", 50, 0, 250);
1200 
1201  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nSubJets_SoftDrop" ,mnSubJetsSoftDrop));
1202  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_SoftDrop_pt" ,mSubJet1_SoftDrop_pt));
1203  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_SoftDrop_eta" ,mSubJet1_SoftDrop_eta));
1204  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_SoftDrop_phi" ,mSubJet1_SoftDrop_phi));
1205  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_SoftDrop_mass" ,mSubJet1_SoftDrop_mass));
1206  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_SoftDrop_pt" ,mSubJet2_SoftDrop_pt));
1207  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_SoftDrop_eta" ,mSubJet2_SoftDrop_eta));
1208  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_SoftDrop_phi" ,mSubJet2_SoftDrop_phi));
1209  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_SoftDrop_mass" ,mSubJet2_SoftDrop_mass));
1210  //miniaod specific variables, especially for substructure for boosted stuff
1211  mSoftDropMass_boosted = ibooker.book1D("SoftDropMass_boosted", "SoftDropMass_boosted", 50, 0, 250);
1212  mPrunedMass_boosted = ibooker.book1D("PrunedMass_boosted", "PrunedMass_boosted", 50, 0, 250);
1213  mTrimmedMass_boosted = ibooker.book1D("TrimmedMass_boosted", "TrimmedMass_boosted", 50, 0, 250);
1214  mFilteredMass_boosted = ibooker.book1D("FilteredMass_boosted", "FilteredMass_boosted", 50, 0, 250);
1215  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SoftDropMass_boosted" ,mSoftDropMass_boosted));
1216  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PrunedMass_boosted" ,mPrunedMass_boosted));
1217  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"TrimmedMass_boosted" ,mTrimmedMass_boosted));
1218  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"FilteredMass_boosted" ,mFilteredMass_boosted));
1219 
1220  mtau2_over_tau1_boosted = ibooker.book1D("tau2_over_tau1_boosted", "tau2_over_tau1_boosted", 50, 0, 1);
1221  mtau3_over_tau2_boosted = ibooker.book1D("tau3_over_tau2_boosted", "tau3_over_tau2_boosted", 50, 0, 1);
1222  mCATopTag_topMass_boosted = ibooker.book1D("CATopTag_topMass_boosted", "CATopTag_topMass_boosted", 50, 50, 250);
1223  mCATopTag_minMass_boosted = ibooker.book1D("CATopTag_minMass_boosted", "CATopTag_minMass_boosted", 50, 0, 250);
1224  mCATopTag_nSubJets_boosted = ibooker.book1D("nSubJets_CATopTag_boosted", "nSubJets_CATopTag_boosted", 10, 0, 10);
1225  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"tau2_over_tau1_boosted" ,mtau2_over_tau1_boosted));
1226  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"tau3_over_tau2_boosted" ,mtau3_over_tau2_boosted));
1227  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CATopTag_topMass_boosted" ,mCATopTag_topMass_boosted));
1228  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CATopTag_minMass_boosted" ,mCATopTag_minMass_boosted));
1229  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nSubJets_CATopTag_boosted" ,mCATopTag_nSubJets_boosted));
1230 
1231  mnSubJetsCMSTopTag_boosted = ibooker.book1D("nSubJets_CMSTopTag_boosted", "nSubJets_CMSTopTag_boosted", 10, 0, 10);
1232  mSubJet1_CMSTopTag_pt_boosted = ibooker.book1D("SubJet1_CMSTopTag_pt_boosted", "SubJet1_CMSTopTag_pt_boosted", ptBin_, ptMin_, 2*ptMax_);
1233  mSubJet1_CMSTopTag_eta_boosted = ibooker.book1D("SubJet1_CMSTopTag_eta_boosted", "SubJet1_CMSTopTag_eta_boosted", etaBin_, etaMin_, etaMax_);
1234  mSubJet1_CMSTopTag_phi_boosted = ibooker.book1D("SubJet1_CMSTopTag_phi_boosted", "SubJet1_CMSTopTag_phi_boosted", phiBin_, phiMin_, phiMax_);
1235  mSubJet1_CMSTopTag_mass_boosted = ibooker.book1D("SubJet1_CMSTopTag_mass_boosted", "SubJet1_CMSTopTag_mass_boosted", 50, 0, 250);
1236  mSubJet2_CMSTopTag_pt_boosted = ibooker.book1D("SubJet2_CMSTopTag_pt_boosted", "SubJet2_CMSTopTag_pt_boosted", ptBin_, ptMin_, 2*ptMax_);
1237  mSubJet2_CMSTopTag_eta_boosted = ibooker.book1D("SubJet2_CMSTopTag_eta_boosted", "SubJet2_CMSTopTag_eta_boosted", etaBin_, etaMin_, etaMax_);
1238  mSubJet2_CMSTopTag_phi_boosted = ibooker.book1D("SubJet2_CMSTopTag_phi_boosted", "SubJet2_CMSTopTag_phi_boosted", phiBin_, phiMin_, phiMax_);
1239  mSubJet2_CMSTopTag_mass_boosted = ibooker.book1D("SubJet2_CMSTopTag_mass_boosted", "SubJet2_CMSTopTag_mass_boosted", 50, 0, 250);
1240  mSubJet3_CMSTopTag_pt_boosted = ibooker.book1D("SubJet3_CMSTopTag_pt_boosted", "SubJet3_CMSTopTag_pt_boosted", ptBin_, ptMin_, ptMax_);
1241  mSubJet3_CMSTopTag_eta_boosted = ibooker.book1D("SubJet3_CMSTopTag_eta_boosted", "SubJet3_CMSTopTag_eta_boosted", etaBin_, etaMin_, etaMax_);
1242  mSubJet3_CMSTopTag_phi_boosted = ibooker.book1D("SubJet3_CMSTopTag_phi_boosted", "SubJet3_CMSTopTag_phi_boosted", phiBin_, phiMin_, phiMax_);
1243  mSubJet3_CMSTopTag_mass_boosted = ibooker.book1D("SubJet3_CMSTopTag_mass_boosted", "SubJet3_CMSTopTag_mass_boosted", 50, 0, 250);
1244  mSubJet4_CMSTopTag_pt_boosted = ibooker.book1D("SubJet4_CMSTopTag_pt_boosted", "SubJet4_CMSTopTag_pt_boosted", ptBin_, ptMin_, ptMax_);
1245  mSubJet4_CMSTopTag_eta_boosted = ibooker.book1D("SubJet4_CMSTopTag_eta_boosted", "SubJet4_CMSTopTag_eta_boosted", etaBin_, etaMin_, etaMax_);
1246  mSubJet4_CMSTopTag_phi_boosted = ibooker.book1D("SubJet4_CMSTopTag_phi_boosted", "SubJet4_CMSTopTag_phi_boosted", phiBin_, phiMin_, phiMax_);
1247  mSubJet4_CMSTopTag_mass_boosted = ibooker.book1D("SubJet4_CMSTopTag_mass_boosted", "SubJet4_CMSTopTag_mass_boosted", 50, 0, 250);
1248 
1249  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nSubJets_CMSTopTag_boosted", mnSubJetsCMSTopTag_boosted));
1250  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_CMSTopTag_pt_boosted", mSubJet1_CMSTopTag_pt_boosted));
1251  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_CMSTopTag_eta_boosted", mSubJet1_CMSTopTag_eta_boosted));
1252  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_CMSTopTag_phi_boosted", mSubJet1_CMSTopTag_phi_boosted));
1253  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_CMSTopTag_mass_boosted", mSubJet1_CMSTopTag_mass_boosted));
1254  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_CMSTopTag_pt_boosted", mSubJet2_CMSTopTag_pt_boosted));
1255  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_CMSTopTag_eta_boosted", mSubJet2_CMSTopTag_eta_boosted));
1256  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_CMSTopTag_phi_boosted", mSubJet2_CMSTopTag_phi_boosted));
1257  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_CMSTopTag_mass_boosted", mSubJet2_CMSTopTag_mass_boosted));
1258  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet3_CMSTopTag_pt_boosted", mSubJet3_CMSTopTag_pt_boosted));
1259  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet3_CMSTopTag_eta_boosted", mSubJet3_CMSTopTag_eta_boosted));
1260  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet3_CMSTopTag_phi_boosted", mSubJet3_CMSTopTag_phi_boosted));
1261  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet3_CMSTopTag_mass_boosted", mSubJet3_CMSTopTag_mass_boosted));
1262  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet4_CMSTopTag_pt_boosted", mSubJet4_CMSTopTag_pt_boosted));
1263  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet4_CMSTopTag_eta_boosted", mSubJet4_CMSTopTag_eta_boosted));
1264  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet4_CMSTopTag_phi_boosted", mSubJet4_CMSTopTag_phi_boosted));
1265  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet4_CMSTopTag_mass_boosted", mSubJet4_CMSTopTag_mass_boosted));
1266 
1267  mnSubJetsSoftDrop_boosted = ibooker.book1D("nSubJets_SoftDrop_boosted", "nSubJets_SoftDrop_boosted", 10, 0, 10);
1268  mSubJet1_SoftDrop_pt_boosted = ibooker.book1D("SubJet1_SoftDrop_pt_boosted", "SubJet1_SoftDrop_pt_boosted", ptBin_, ptMin_, 2*ptMax_);
1269  mSubJet1_SoftDrop_eta_boosted = ibooker.book1D("SubJet1_SoftDrop_eta_boosted", "SubJet1_SoftDrop_eta_boosted", etaBin_, etaMin_, etaMax_);
1270  mSubJet1_SoftDrop_phi_boosted = ibooker.book1D("SubJet1_SoftDrop_phi_boosted", "SubJet1_SoftDrop_phi_boosted", phiBin_, phiMin_, phiMax_);
1271  mSubJet1_SoftDrop_mass_boosted = ibooker.book1D("SubJet1_SoftDrop_mass_boosted", "SubJet1_SoftDrop_mass_boosted", 50, 0, 250);
1272  mSubJet2_SoftDrop_pt_boosted = ibooker.book1D("SubJet2_SoftDrop_pt_boosted", "SubJet2_SoftDrop_pt_boosted", ptBin_, ptMin_, 2*ptMax_);
1273  mSubJet2_SoftDrop_eta_boosted = ibooker.book1D("SubJet2_SoftDrop_eta_boosted", "SubJet2_SoftDrop_eta_boosted", etaBin_, etaMin_, etaMax_);
1274  mSubJet2_SoftDrop_phi_boosted = ibooker.book1D("SubJet2_SoftDrop_phi_boosted", "SubJet2_SoftDrop_phi_boosted", phiBin_, phiMin_, phiMax_);
1275  mSubJet2_SoftDrop_mass_boosted = ibooker.book1D("SubJet2_SoftDrop_mass_boosted", "SubJet2_SoftDrop_mass_boosted", 50, 0, 250);
1276 
1277  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nSubJets_SoftDrop_boosted", mnSubJetsSoftDrop_boosted));
1278  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_SoftDrop_pt_boosted", mSubJet1_SoftDrop_pt_boosted));
1279  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_SoftDrop_eta_boosted", mSubJet1_SoftDrop_eta_boosted));
1280  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_SoftDrop_phi_boosted", mSubJet1_SoftDrop_phi_boosted));
1281  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet1_SoftDrop_mass_boosted", mSubJet1_SoftDrop_mass_boosted));
1282  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_SoftDrop_pt_boosted", mSubJet2_SoftDrop_pt_boosted));
1283  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_SoftDrop_eta_boosted", mSubJet2_SoftDrop_eta_boosted));
1284  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_SoftDrop_phi_boosted", mSubJet2_SoftDrop_phi_boosted));
1285  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"SubJet2_SoftDrop_mass_boosted", mSubJet2_SoftDrop_mass_boosted));
1286 
1287  }
1288  }
1289 
1290 
1291  if(jetCleaningFlag_){
1292  //so far we have only one additional selection -> implement to make it expandable
1293  folderNames_.push_back("DiJet");
1294  if(isPFJet_){//check for now only for PFJets
1295  folderNames_.push_back("ZJets");
1296  }
1297  //book for each of these selection default histograms
1298  for (std::vector<std::string>::const_iterator ic = folderNames_.begin();
1299  ic != folderNames_.end(); ic++){
1300  bookMESetSelection(DirName+"/"+*ic, ibooker);
1301  }
1302  }
1303 
1304  ibooker.setCurrentFolder("JetMET");
1305  cleanupME = ibooker.book1D("cleanup", "cleanup", 10, 0., 10.);
1306  cleanupME->setBinLabel(1,"Primary Vertex");
1307  cleanupME->setBinLabel(2,"DCS::Pixel");
1308  cleanupME->setBinLabel(3,"DCS::SiStrip");
1309  cleanupME->setBinLabel(4,"DCS::ECAL");
1310  cleanupME->setBinLabel(5,"DCS::ES");
1311  cleanupME->setBinLabel(6,"DCS::HBHE");
1312  cleanupME->setBinLabel(7,"DCS::HF");
1313  cleanupME->setBinLabel(8,"DCS::HO");
1314  cleanupME->setBinLabel(9,"DCS::Muon");
1315  map_of_MEs.insert(std::pair<std::string,MonitorElement*>("JetMET/cleanup" ,cleanupME));
1316 
1317  verticesME = ibooker.book1D("vertices", "vertices", 100, 0, 100);
1318  map_of_MEs.insert(std::pair<std::string,MonitorElement*>("JetMET/vertices" ,verticesME));
1319 
1320 
1321 
1322 }
1323 
1325 {
1326  ibooker.setCurrentFolder(DirName);
1327  // Generic jet parameters
1328  mPt = ibooker.book1D("Pt", "pt", ptBin_, ptMin_, ptMax_);
1329  mEta = ibooker.book1D("Eta", "eta", etaBin_, etaMin_, etaMax_);
1330  mPhi = ibooker.book1D("Phi", "phi", phiBin_, phiMin_, phiMax_);
1331  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt" ,mPt));
1332  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta" ,mEta));
1333  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi" ,mPhi));
1334  //if(!isJPTJet_){
1335  mConstituents = ibooker.book1D("Constituents", "# of constituents", 50, 0, 100);
1336  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents" ,mConstituents));
1337  //}
1338  mJetEnergyCorr= ibooker.book1D("JetEnergyCorr", "jet energy correction factor", 50, 0.0,3.0);
1339  mJetEnergyCorrVSEta= ibooker.bookProfile("JetEnergyCorrVSEta", "jet energy correction factor VS eta", etaBin_, etaMin_,etaMax_, 0.0,3.0);
1340  mJetEnergyCorrVSPt= ibooker.bookProfile("JetEnergyCorrVSPt", "jet energy correction factor VS pt", ptBin_, ptMin_,ptMax_, 0.0,3.0);
1341 
1342  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorr" ,mJetEnergyCorr));
1343  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorrVSEta" ,mJetEnergyCorrVSEta));
1344  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorrVSPt" ,mJetEnergyCorrVSPt));
1345 
1346  //fill for Dijets: concentrates on gluon jets -> fill leading two jets
1347  //fill for ZJets: concentrates on quark jets -> fill leading jet
1348  if(fill_CHS_histos && isPFJet_){
1349  mAxis2_lowPt_Barrel = ibooker.book1D("qg_Axis2_lowPt_Barrel","qg Axis2 #sigma_{2} lowPt Barrel",50,0.,0.20);
1350  mpTD_lowPt_Barrel= ibooker.book1D("qg_pTD_lowPt_Barrel","qg fragmentation function p_{T}^{D} lowPt Barrel",50,0.15,1.05);
1351  mMultiplicityQG_lowPt_Barrel= ibooker.book1D("qg_multiplicity_lowPt_Barrel","qg multiplicity lowPt Barrel",50,0,50);
1352  mqgLikelihood_lowPt_Barrel= ibooker.book1D("qg_Likelihood_lowPt_Barrel","qg likelihood lowPt Barrel",50,-1.1,1.1);
1353  mAxis2_lowPt_EndCap = ibooker.book1D("qg_Axis2_lowPt_EndCap","qg Axis2 #sigma_{2} lowPt EndCap",50,0.,0.20);
1354  mpTD_lowPt_EndCap= ibooker.book1D("qg_pTD_lowPt_EndCap","qg fragmentation function p_{T}^{D} lowPt EndCap",50,0.15,1.05);
1355  mMultiplicityQG_lowPt_EndCap= ibooker.book1D("qg_multiplicity_lowPt_EndCap","qg multiplicity lowPt EndCap",50,0,100);
1356  mqgLikelihood_lowPt_EndCap= ibooker.book1D("qg_Likelihood_lowPt_EndCap","qg likelihood lowPt EndCap",50,-1.1,1.1);
1357  mAxis2_lowPt_Forward = ibooker.book1D("qg_Axis2_lowPt_Forward","qg Axis2 #sigma_{2} lowPt Forward",50,0.,0.20);
1358  mpTD_lowPt_Forward= ibooker.book1D("qg_pTD_lowPt_Forward","qg fragmentation function p_{T}^{D} lowPt Forward",50,0.15,1.05);
1359  mMultiplicityQG_lowPt_Forward= ibooker.book1D("qg_multiplicity_lowPt_Forward","qg multiplicity lowPt Forward",50,0,100);
1360  mqgLikelihood_lowPt_Forward= ibooker.book1D("qg_Likelihood_lowPt_Forward","qg likelihood lowPt Forward",50,-1.1,1.1);
1361 
1362  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_lowPt_Barrel" ,mAxis2_lowPt_Barrel));
1363  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_lowPt_Barrel" ,mpTD_lowPt_Barrel));
1364  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_lowPt_Barrel" ,mMultiplicityQG_lowPt_Barrel));
1365  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_lowPt_Barrel" ,mqgLikelihood_lowPt_Barrel));
1366  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_lowPt_EndCap" ,mAxis2_lowPt_EndCap));
1367  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_lowPt_EndCap" ,mpTD_lowPt_EndCap));
1368  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_lowPt_EndCap" ,mMultiplicityQG_lowPt_EndCap));
1369  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_lowPt_EndCap" ,mqgLikelihood_lowPt_EndCap));
1370  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_lowPt_Forward" ,mAxis2_lowPt_Forward));
1371  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_lowPt_Forward" ,mpTD_lowPt_Forward));
1372  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_lowPt_Forward" ,mMultiplicityQG_lowPt_Forward));
1373  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_lowPt_Forward" ,mqgLikelihood_lowPt_Forward));
1374 
1375  mAxis2_mediumPt_Barrel = ibooker.book1D("qg_Axis2_mediumPt_Barrel","qg Axis2 #sigma_{2} mediumPt Barrel",50,0.,0.20);
1376  mpTD_mediumPt_Barrel= ibooker.book1D("qg_pTD_mediumPt_Barrel","qg fragmentation function p_{T}^{D} mediumPt Barrel",50,0.15,1.05);
1377  mMultiplicityQG_mediumPt_Barrel= ibooker.book1D("qg_multiplicity_mediumPt_Barrel","qg multiplicity mediumPt Barrel",50,0,100);
1378  mqgLikelihood_mediumPt_Barrel= ibooker.book1D("qg_Likelihood_mediumPt_Barrel","qg likelihood mediumPt Barrel",50,-1.1,1.1);
1379  mAxis2_mediumPt_EndCap = ibooker.book1D("qg_Axis2_mediumPt_EndCap","qg Axis2 #sigma_{2} mediumPt EndCap",50,0.,0.20);
1380  mpTD_mediumPt_EndCap= ibooker.book1D("qg_pTD_mediumPt_EndCap","qg fragmentation function p_{T}^{D} mediumPt EndCap",50,0.15,1.05);
1381  mMultiplicityQG_mediumPt_EndCap= ibooker.book1D("qg_multiplicity_mediumPt_EndCap","qg multiplicity mediumPt EndCap",50,0,100);
1382  mqgLikelihood_mediumPt_EndCap= ibooker.book1D("qg_Likelihood_mediumPt_EndCap","qg likelihood mediumPt EndCap",50,-1.1,1.1);
1383  mAxis2_mediumPt_Forward = ibooker.book1D("qg_Axis2_mediumPt_Forward","qg Axis2 #sigma_{2} mediumPt Forward",50,0.,0.20);
1384  mpTD_mediumPt_Forward= ibooker.book1D("qg_pTD_mediumPt_Forward","qg fragmentation function p_{T}^{D} mediumPt Forward",50,0.15,1.05);
1385  mMultiplicityQG_mediumPt_Forward= ibooker.book1D("qg_multiplicity_mediumPt_Forward","qg multiplicity mediumPt Forward",50,0,100);
1386  mqgLikelihood_mediumPt_Forward= ibooker.book1D("qg_Likelihood_mediumPt_Forward","qg likelihood mediumPt Forward",50,-1.1,1.1);
1387 
1388  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_mediumPt_Barrel" ,mAxis2_mediumPt_Barrel));
1389  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_mediumPt_Barrel" ,mpTD_mediumPt_Barrel));
1390  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_mediumPt_Barrel" ,mMultiplicityQG_mediumPt_Barrel));
1391  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_mediumPt_Barrel" ,mqgLikelihood_mediumPt_Barrel));
1392  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_mediumPt_EndCap" ,mAxis2_mediumPt_EndCap));
1393  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_mediumPt_EndCap" ,mpTD_mediumPt_EndCap));
1394  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_mediumPt_EndCap" ,mMultiplicityQG_mediumPt_EndCap));
1395  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_mediumPt_EndCap" ,mqgLikelihood_mediumPt_EndCap));
1396  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_mediumPt_Forward" ,mAxis2_mediumPt_Forward));
1397  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_mediumPt_Forward" ,mpTD_mediumPt_Forward));
1398  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_mediumPt_Forward" ,mMultiplicityQG_mediumPt_Forward));
1399  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_mediumPt_Forward" ,mqgLikelihood_mediumPt_Forward));
1400 
1401  mAxis2_highPt_Barrel = ibooker.book1D("qg_Axis2_highPt_Barrel","qg Axis2 #sigma_{2} highPt Barrel",50,0.,0.20);
1402  mpTD_highPt_Barrel= ibooker.book1D("qg_pTD_highPt_Barrel","qg fragmentation function p_{T}^{D} highPt Barrel",50,0.15,1.05);
1403  mMultiplicityQG_highPt_Barrel= ibooker.book1D("qg_multiplicity_highPt_Barrel","qg multiplicity highPt Barrel",50,0,100);
1404  mqgLikelihood_highPt_Barrel= ibooker.book1D("qg_Likelihood_highPt_Barrel","qg likelihood highPt Barrel",50,-1.1,1.1);
1405  mAxis2_highPt_EndCap = ibooker.book1D("qg_Axis2_highPt_EndCap","qg Axis2 #sigma_{2} highPt EndCap",50,0.,0.20);
1406  mpTD_highPt_EndCap= ibooker.book1D("qg_pTD_highPt_EndCap","qg fragmentation function p_{T}^{D} highPt EndCap",50,0.15,1.05);
1407  mMultiplicityQG_highPt_EndCap= ibooker.book1D("qg_multiplicity_highPt_EndCap","qg multiplicity highPt EndCap",50,0,100);
1408  mqgLikelihood_highPt_EndCap= ibooker.book1D("qg_Likelihood_highPt_EndCap","qg likelihood highPt EndCap",50,-1.1,1.1);
1409  mAxis2_highPt_Forward = ibooker.book1D("qg_Axis2_highPt_Forward","qg Axis2 #sigma_{2} highPt Forward",50,0.,0.20);
1410  mpTD_highPt_Forward= ibooker.book1D("qg_pTD_highPt_Forward","qg fragmentation function p_{T}^{D} highPt Forward",50,0.15,1.05);
1411  mMultiplicityQG_highPt_Forward= ibooker.book1D("qg_multiplicity_highPt_Forward","qg multiplicity highPt Forward",50,0,100);
1412  mqgLikelihood_highPt_Forward= ibooker.book1D("qg_Likelihood_highPt_Forward","qg likelihood highPt Forward",50,-1.1,1.1);
1413 
1414  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_highPt_Barrel" ,mAxis2_highPt_Barrel));
1415  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_highPt_Barrel" ,mpTD_highPt_Barrel));
1416  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_highPt_Barrel" ,mMultiplicityQG_highPt_Barrel));
1417  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_highPt_Barrel" ,mqgLikelihood_highPt_Barrel));
1418  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_highPt_EndCap" ,mAxis2_highPt_EndCap));
1419  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_highPt_EndCap" ,mpTD_highPt_EndCap));
1420  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_highPt_EndCap" ,mMultiplicityQG_highPt_EndCap));
1421  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_highPt_EndCap" ,mqgLikelihood_highPt_EndCap));
1422  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Axis2_highPt_Forward" ,mAxis2_highPt_Forward));
1423  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_pTD_highPt_Forward" ,mpTD_highPt_Forward));
1424  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_multiplicity_highPt_Forward" ,mMultiplicityQG_highPt_Forward));
1425  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"qg_Likelihood_highPt_Forward" ,mqgLikelihood_highPt_Forward));
1426  }
1427 
1428  if(DirName.find("DiJet")!=std::string::npos){
1429  mDPhi = ibooker.book1D("DPhi", "dPhi btw the two leading jets", 100, 0., acos(-1.));
1430  mDijetAsymmetry = ibooker.book1D("DijetAsymmetry", "DijetAsymmetry", 100, -1., 1.);
1431  mDijetBalance = ibooker.book1D("DijetBalance", "DijetBalance", 100, -2., 2.);
1432  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DPhi" ,mDPhi));
1433  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DijetAsymmetry" ,mDijetAsymmetry));
1434  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DijetBalance" ,mDijetBalance));
1435 
1436  if(isPFJet_|| isMiniAODJet_){
1437  mChargedMultiplicity = ibooker.book1D("ChargedMultiplicity", "charged multiplicity ", 50, 0, 100);
1438  mNeutralMultiplicity = ibooker.book1D("NeutralMultiplicity", "neutral multiplicity", 50, 0, 100);
1439  mMuonMultiplicity = ibooker.book1D("MuonMultiplicity", "muon multiplicity", 50, 0, 100);
1440 
1441  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMultiplicity" ,mChargedMultiplicity));
1442  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralMultiplicity" ,mNeutralMultiplicity));
1443  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuonMultiplicity" ,mMuonMultiplicity));
1444 
1445  mChargedMultiplicity_profile = ibooker.bookProfile("ChargedMultiplicity_profile", "charged multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1446  mNeutralMultiplicity_profile = ibooker.bookProfile("NeutralMultiplicity_profile", "neutral multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1447  mMuonMultiplicity_profile = ibooker.bookProfile("MuonMultiplicity_profile", "muon multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1448  mChargedMultiplicity_profile->setAxisTitle("nvtx",1);
1449  mNeutralMultiplicity_profile->setAxisTitle("nvtx",1);
1450  mMuonMultiplicity_profile ->setAxisTitle("nvtx",1);
1451 
1452  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMultiplicity_profile" ,mChargedMultiplicity_profile));
1453  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralMultiplicity_profile" ,mNeutralMultiplicity_profile));
1454  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuonMultiplicity_profile" ,mMuonMultiplicity_profile));
1455 
1456  mNeutralFraction = ibooker.book1D("NeutralConstituentsFraction","Neutral Constituents Fraction",100,0,1);
1457  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralConstituentsFraction" ,mNeutralFraction));
1458  }
1459  }
1460 
1461 
1462  if(DirName.find("ZJets")!=std::string::npos){
1463  mZMass = ibooker.book1D("DiMuonMass", "DiMuonMass", 50, 71., 111.);
1464  mDPhiZJet = ibooker.book1D("DPhiZJ", "dPhi btw Z and Jet1", 100, 0., acos(-1.));
1465  mZJetAsymmetry = ibooker.book1D("ZJetAsymmetry", "ZJetAsymmetry", 100, -1., 1.);
1466  mJetZBalance_lowZPt_J_Barrel = ibooker.book1D("JZB_lowZPt_J_Barrel", "ZJetBalance (pTJet1-pTZ) (30<pTZ<90), |#eta_{jet}|<1.3", 50, -75.,75);
1467  mJetZBalance_mediumZPt_J_Barrel = ibooker.book1D("JZB_mediumZPt_J_Barrel", "ZJetBalance (90<pTZ<140), |#eta_{jet}|<1.3", 50, -75.,75);
1468  mJetZBalance_highZPt_J_Barrel = ibooker.book1D("JZB_highZPt_J_Barrel", "ZJetBalance (pTZ>140), |#eta_{jet}|<1.3", 50, -75., 75.);
1469  mJetZBalance_lowZPt_J_EndCap = ibooker.book1D("JZB_lowZPt_J_EndCap", "ZJetBalance (30<pTZ<90), 1.3<|#eta_{jet}|<3.0", 50, -75.,75);
1470  mJetZBalance_mediumZPt_J_EndCap = ibooker.book1D("JZB_mediumZPt_J_EndCap", "ZJetBalance (90<pTZ<140), 1.3<|#eta_{jet}|<3.0", 50, -75.,75);
1471  mJetZBalance_highZPt_J_EndCap = ibooker.book1D("JZB_highZPt_J_EndCap", "ZJetBalance (pTZ>140), 1.3<|#eta_{jet}|<3.0", 50, -75., 75.);
1472  mJetZBalance_lowZPt_J_Forward = ibooker.book1D("JZB_lowZPt_J_Forward", "ZJetBalance (30<pTZ<90), |#eta_{jet}|>3.0", 50, -75.,75);
1473  mJetZBalance_mediumZPt_J_Forward = ibooker.book1D("JZB_mediumZPt_J_Forward", "ZJetBalance (90<pTZ<140), |#eta_{jet}|>3.0", 50, -75.,75);
1474  mJetZBalance_highZPt_J_Forward = ibooker.book1D("JZB_highZPt_J_Forward", "ZJetBalance (pTZ>140), |#eta_{jet}|>3.0", 50, -75., 75.);
1475 
1476  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DiMuonMass" ,mZMass));
1477  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DPhiZJ" ,mDPhiZJet ));
1478  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ZJetAsymmetry" ,mZJetAsymmetry ));
1479  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_lowZPt_J_Barrel" ,mJetZBalance_lowZPt_J_Barrel ));
1480  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_mediumZPt_J_Barrel" ,mJetZBalance_mediumZPt_J_Barrel ));
1481  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_highZPt_J_Barrel" ,mJetZBalance_highZPt_J_Barrel ));
1482  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_lowZPt_J_EndCap" ,mJetZBalance_lowZPt_J_EndCap ));
1483  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_mediumZPt_J_EndCap" ,mJetZBalance_mediumZPt_J_EndCap ));
1484  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_highZPt_J_EndCap" ,mJetZBalance_highZPt_J_EndCap ));
1485  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_lowZPt_J_Forward" ,mJetZBalance_lowZPt_J_Forward ));
1486  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_mediumZPt_J_Forward" ,mJetZBalance_mediumZPt_J_Forward ));
1487  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JZB_highZPt_J_Forward" ,mJetZBalance_highZPt_J_Forward ));
1488 
1489  mJ1Pt_over_ZPt_J_Barrel = ibooker.book1D("J1Pt_over_ZPt_J_Barrel", "Jet1_Pt/ZPt, Barrel", 50, 0.,3.0);
1490  mJ1Pt_over_ZPt_J_EndCap = ibooker.book1D("J1Pt_over_ZPt_J_EndCap", "Jet1_Pt/ZPt, EndCap", 50, 0.,3.0);
1491  mJ1Pt_over_ZPt_J_Forward = ibooker.book1D("J1Pt_over_ZPt_J_Forward", "Jet1_Pt/ZPt, Forward", 50, 0.,3.0);
1492 
1493  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_J_Barrel" ,mJ1Pt_over_ZPt_J_Barrel ));
1494  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_J_EndCap" ,mJ1Pt_over_ZPt_J_EndCap ));
1495  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_J_Forward" ,mJ1Pt_over_ZPt_J_Forward ));
1496 
1497  mJ1Pt_over_ZPt_lowZPt_J_Barrel = ibooker.book1D("J1Pt_over_ZPt_lowZPt_J_Barrel", "Jet1_Pt/ZPt (30<pTZ<90), |#eta_{jet}|<1.3", 50, 0.,3.0);
1498  mJ1Pt_over_ZPt_mediumZPt_J_Barrel = ibooker.book1D("J1Pt_over_ZPt_mediumZPt_J_Barrel", "Jet1_Pt/ZPt (90<pTZ<140), |#eta_{jet}|<1.3", 50, 0.,3.0);
1499  mJ1Pt_over_ZPt_highZPt_J_Barrel = ibooker.book1D("J1Pt_over_ZPt_highPt_J_Barrel", "Jet1_Pt/ZPt (pTZ>140), |#eta_{jet}|<1.3", 50, 0.,3.0);
1500  mJ1Pt_over_ZPt_lowZPt_J_EndCap = ibooker.book1D("J1Pt_over_ZPt_lowZPt_J_EndCap", "Jet1_Pt/ZPt (30<pTZ<90), 1.3<|#eta_{jet}|<3.0", 50, 0.,3.0);
1501  mJ1Pt_over_ZPt_mediumZPt_J_EndCap = ibooker.book1D("J1Pt_over_ZPt_mediumZPt_J_EndCap", "Jet1_Pt/ZPt (90<pTZ<140), 1.3<|#eta_{jet}|<3.0", 50, 0.,3.0);
1502  mJ1Pt_over_ZPt_highZPt_J_EndCap = ibooker.book1D("J1Pt_over_ZPt_highZPt_J_EndCap", "Jet1_Pt/ZPt (pTZ>140), 1.3<|#eta_{jet}|<3.0", 50, 0.,3.0);
1503  mJ1Pt_over_ZPt_lowZPt_J_Forward = ibooker.book1D("J1Pt_over_ZPt_lowZPt_J_Forward", "Jet1_Pt/ZPt (30<pTZ<90), |#eta_{jet}|>3.0", 50, 0.,3.0);
1504  mJ1Pt_over_ZPt_mediumZPt_J_Forward = ibooker.book1D("J1Pt_over_ZPt_mediumPt_J_Forward", "Jet1_Pt/ZPt (90<pTZ<140), |#eta_{jet}|>3.0", 50, 0.,3.0);
1505  mJ1Pt_over_ZPt_highZPt_J_Forward = ibooker.book1D("J1Pt_over_ZPt_highZPt_J_Forward", "Jet1_Pt/ZPt (pTZ>140), |#eta_{jet}|>3.0", 50, 0.,3.0);
1506 
1507  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_lowZPt_J_Barrel" ,mJ1Pt_over_ZPt_lowZPt_J_Barrel ));
1508  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_mediumZPt_J_Barrel" ,mJ1Pt_over_ZPt_mediumZPt_J_Barrel ));
1509  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_highZPt_J_Barrel" ,mJ1Pt_over_ZPt_highZPt_J_Barrel ));
1510  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_lowZPt_J_EndCap" ,mJ1Pt_over_ZPt_lowZPt_J_EndCap ));
1511  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_mediumZPt_J_EndCap" ,mJ1Pt_over_ZPt_mediumZPt_J_EndCap ));
1512  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_highZPt_J_EndCap" ,mJ1Pt_over_ZPt_highZPt_J_EndCap ));
1513  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_lowZPt_J_Forward" ,mJ1Pt_over_ZPt_lowZPt_J_Forward ));
1514  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_mediumZPt_J_Forward" ,mJ1Pt_over_ZPt_mediumZPt_J_Forward ));
1515  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"J1Pt_over_ZPt_highZPt_J_Forward" ,mJ1Pt_over_ZPt_highZPt_J_Forward ));
1516 
1517 
1518  mMPF_J_Barrel = ibooker.book1D("MPF_J_Barrel", "Jet1_Pt/ZPt, Barrel", 50, 0.,2.0);
1519  mMPF_J_EndCap = ibooker.book1D("MPF_J_EndCap", "Jet1_Pt/ZPt, EndCap", 50, 0.,2.0);
1520  mMPF_J_Forward = ibooker.book1D("MPF_J_Forward", "Jet1_Pt/ZPt, Forward", 50, 0.,2.0);
1521 
1522  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_J_Barrel" ,mMPF_J_Barrel ));
1523  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_J_EndCap" ,mMPF_J_EndCap ));
1524  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_J_Forward" ,mMPF_J_Forward ));
1525 
1526  mMPF_lowZPt_J_Barrel = ibooker.book1D("MPF_lowZPt_J_Barrel", "Jet1_Pt/ZPt (30<pTZ<90), |#eta_{jet}|<1.3", 50, 0.,2.0);
1527  mMPF_mediumZPt_J_Barrel = ibooker.book1D("MPF_mediumZPt_J_Barrel", "Jet1_Pt/ZPt (90<pTZ<140), |#eta_{jet}|<1.3", 50, 0.,2.0);
1528  mMPF_highZPt_J_Barrel = ibooker.book1D("MPF_highPt_J_Barrel", "Jet1_Pt/ZPt (pTZ>140), |#eta_{jet}|<1.3", 50, 0.,2.0);
1529  mMPF_lowZPt_J_EndCap = ibooker.book1D("MPF_lowZPt_J_EndCap", "Jet1_Pt/ZPt (30<pTZ<90), 1.3<|#eta_{jet}|<3.0", 50, 0.,2.0);
1530  mMPF_mediumZPt_J_EndCap = ibooker.book1D("MPF_mediumZPt_J_EndCap", "Jet1_Pt/ZPt (90<pTZ<140), 1.3<|#eta_{jet}|<3.0", 50, 0.,2.0);
1531  mMPF_highZPt_J_EndCap = ibooker.book1D("MPF_highZPt_J_EndCap", "Jet1_Pt/ZPt (pTZ>140), 1.3<|#eta_{jet}|<3.0", 50, 0.,2.0);
1532  mMPF_lowZPt_J_Forward = ibooker.book1D("MPF_lowZPt_J_Forward", "Jet1_Pt/ZPt (30<pTZ<90), |#eta_{jet}|>3.0", 50, 0.,2.0);
1533  mMPF_mediumZPt_J_Forward = ibooker.book1D("MPF_mediumPt_J_Forward", "Jet1_Pt/ZPt (90<pTZ<140), |#eta_{jet}|>3.0", 50, 0.,2.0);
1534  mMPF_highZPt_J_Forward = ibooker.book1D("MPF_highZPt_J_Forward", "Jet1_Pt/ZPt (pTZ>140), |#eta_{jet}|>3.0", 50, 0.,2.0);
1535 
1536  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_lowZPt_J_Barrel" ,mMPF_lowZPt_J_Barrel ));
1537  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_mediumZPt_J_Barrel" ,mMPF_mediumZPt_J_Barrel ));
1538  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_highZPt_J_Barrel" ,mMPF_highZPt_J_Barrel ));
1539  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_lowZPt_J_EndCap" ,mMPF_lowZPt_J_EndCap ));
1540  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_mediumZPt_J_EndCap" ,mMPF_mediumZPt_J_EndCap ));
1541  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_highZPt_J_EndCap" ,mMPF_highZPt_J_EndCap ));
1542  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_lowZPt_J_Forward" ,mMPF_lowZPt_J_Forward ));
1543  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_mediumZPt_J_Forward" ,mMPF_mediumZPt_J_Forward ));
1544  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MPF_highZPt_J_Forward" ,mMPF_highZPt_J_Forward ));
1545 
1546 
1547  mDeltaPt_Z_j1_over_ZPt_30_55_J_Barrel = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_30_55_J_Barrel", "DeltaPt_Z_j1_over_ZPt_30_55_J_Barrel", 50, -1.00,1.00);
1548  mDeltaPt_Z_j1_over_ZPt_55_75_J_Barrel = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_55_75_J_Barrel", "DeltaPt_Z_j1_over_ZPt_55_75_J_Barrel", 50, -1.00,1.00);
1549  mDeltaPt_Z_j1_over_ZPt_75_150_J_Barrel = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_75_150_J_Barrel", "DeltaPt_Z_j1_over_ZPt_75_150_J_Barrel", 50, -1.00,1.00);
1550  mDeltaPt_Z_j1_over_ZPt_150_290_J_Barrel = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_150_290_J_Barrel", "DeltaPt_Z_j1_over_ZPt_150_290_J_Barrel", 50, -1.00,1.00);
1551  mDeltaPt_Z_j1_over_ZPt_290_J_Barrel = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_290_J_Barrel", "DeltaPt_Z_j1_over_ZPt_290_J_Barrel", 50, -1.00,1.00);
1552  mDeltaPt_Z_j1_over_ZPt_30_55_J_EndCap = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_30_55_J_EndCap", "DeltaPt_Z_j1_over_ZPt_30_55_J_EndCap", 50, -1.00,1.00);
1553  mDeltaPt_Z_j1_over_ZPt_55_75_J_EndCap = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_55_75_J_EndCap", "DeltaPt_Z_j1_over_ZPt_55_75_J_EndCap", 50, -1.00,1.00);
1554  mDeltaPt_Z_j1_over_ZPt_75_150_J_EndCap = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_75_150_J_EndCap", "DeltaPt_Z_j1_over_ZPt_75_150_J_EndCap", 50, -1.00,1.00);
1555  mDeltaPt_Z_j1_over_ZPt_150_290_J_EndCap = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_150_290_J_EndCap", "DeltaPt_Z_j1_over_ZPt_150_290_J_EndCap", 50, -1.00,1.00);
1556  mDeltaPt_Z_j1_over_ZPt_290_J_EndCap = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_290_J_EndCap", "DeltaPt_Z_j1_over_ZPt_290_J_EndCap", 50, -1.00,1.00);
1557  mDeltaPt_Z_j1_over_ZPt_30_55_J_Forward = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_30_55_J_Forward", "DeltaPt_Z_j1_over_ZPt_30_55_J_Forward", 50, -1.00,1.00);
1558  mDeltaPt_Z_j1_over_ZPt_55_100_J_Forward = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_55_100_J_Forward", "DeltaPt_Z_j1_over_ZPt_55_100_J_Forward", 50, -1.00,1.00);
1559  mDeltaPt_Z_j1_over_ZPt_100_J_Forward = ibooker.book1D("DeltaPt_Z_j1_over_ZPt_100_J_Forward", "DeltaPt_Z_j1_over_ZPt_100_J_Forward", 50, -1.00,1.00);
1560 
1561  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_30_55_J_Barrel" ,mDeltaPt_Z_j1_over_ZPt_30_55_J_Barrel ));
1562  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_55_75_J_Barrel" ,mDeltaPt_Z_j1_over_ZPt_55_75_J_Barrel ));
1563  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_75_150_J_Barrel" ,mDeltaPt_Z_j1_over_ZPt_75_150_J_Barrel ));
1564  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_150_290_J_Barrel" ,mDeltaPt_Z_j1_over_ZPt_150_290_J_Barrel ));
1565  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_290_J_Barrel" ,mDeltaPt_Z_j1_over_ZPt_290_J_Barrel ));
1566  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_30_55_J_EndCap" ,mDeltaPt_Z_j1_over_ZPt_30_55_J_EndCap ));
1567  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_55_75_J_EndCap" ,mDeltaPt_Z_j1_over_ZPt_55_75_J_EndCap ));
1568  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_75_150_J_EndCap" ,mDeltaPt_Z_j1_over_ZPt_75_150_J_EndCap ));
1569  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_150_290_J_EndCap" ,mDeltaPt_Z_j1_over_ZPt_150_290_J_EndCap ));
1570  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_290_J_EndCap" ,mDeltaPt_Z_j1_over_ZPt_290_J_EndCap ));
1571  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_30_55_J_Forward" ,mDeltaPt_Z_j1_over_ZPt_30_55_J_Forward ));
1572  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_55_100_J_Forward" ,mDeltaPt_Z_j1_over_ZPt_55_100_J_Forward ));
1573  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DeltaPt_Z_j1_over_ZPt_100_J_Forward" ,mDeltaPt_Z_j1_over_ZPt_100_J_Forward ));
1574  }
1575  // Book NPV profiles
1576  //----------------------------------------------------------------------------
1577  mPt_profile = ibooker.bookProfile("Pt_profile", "pt", nbinsPV_, nPVlow_, nPVhigh_, ptBin_, ptMin_, ptMax_);
1578  mEta_profile = ibooker.bookProfile("Eta_profile", "eta", nbinsPV_, nPVlow_, nPVhigh_, etaBin_, etaMin_, etaMax_);
1579  mPhi_profile = ibooker.bookProfile("Phi_profile", "phi", nbinsPV_, nPVlow_, nPVhigh_, phiBin_, phiMin_, phiMax_);
1580  //if(!isJPTJet_){
1581  mConstituents_profile = ibooker.bookProfile("Constituents_profile", "# of constituents", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1582  //}
1583  // met NPV profiles x-axis title
1584  //----------------------------------------------------------------------------
1585  mPt_profile ->setAxisTitle("nvtx",1);
1586  mEta_profile ->setAxisTitle("nvtx",1);
1587  mPhi_profile ->setAxisTitle("nvtx",1);
1588  //if(!isJPTJet_){
1589  mConstituents_profile->setAxisTitle("nvtx",1);
1590  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_profile",mConstituents_profile));
1591  //}
1592 
1593  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_profile" ,mPt_profile));
1594  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_profile",mEta_profile));
1595  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_profile",mPhi_profile));
1596  //
1597  //--- Calo jet melection only
1598 
1599  if(isCaloJet_) {
1600  mHFrac = ibooker.book1D("HFrac", "HFrac", 140, -0.2, 1.2);
1601  mEFrac = ibooker.book1D("EFrac", "EFrac", 140, -0.2, 1.2);
1602  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac" ,mHFrac));
1603  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac" ,mEFrac));
1604 
1605  mHFrac_profile = ibooker.bookProfile("HFrac_profile", "HFrac", nbinsPV_, nPVlow_, nPVhigh_, 140, -0.2, 1.2);
1606  mEFrac_profile = ibooker.bookProfile("EFrac_profile", "EFrac", nbinsPV_, nPVlow_, nPVhigh_, 140, -0.2, 1.2);
1607  mHFrac_profile ->setAxisTitle("nvtx",1);
1608  mEFrac_profile ->setAxisTitle("nvtx",1);
1609  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_profile",mHFrac_profile));
1610  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_profile",mEFrac_profile));
1611 
1612  // CaloJet specific
1613  //JetID variables
1614  mresEMF = ibooker.book1D("resEMF", "resEMF", 50, 0., 1.);
1615  mN90Hits = ibooker.book1D("N90Hits", "N90Hits", 50, 0., 100);
1616  mfHPD = ibooker.book1D("fHPD", "fHPD", 50, 0., 1.);
1617  mfRBX = ibooker.book1D("fRBX", "fRBX", 50, 0., 1.);
1618 
1619  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"resEMF" ,mresEMF));
1620  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"N90Hits",mN90Hits));
1621  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fHPD" ,mfHPD));
1622  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fRBX" ,mfRBX));
1623 
1624  }
1625 
1626  if(isPFJet_|| isMiniAODJet_){
1627  //barrel histograms for PFJets
1628  // energy fractions
1629  mCHFrac = ibooker.book1D("CHFrac", "CHFrac", 120, -0.1, 1.1);
1630  mNHFrac = ibooker.book1D("NHFrac", "NHFrac", 120, -0.1, 1.1);
1631  mPhFrac = ibooker.book1D("PhFrac", "PhFrac", 120, -0.1, 1.1);
1632  mHFEMFrac = ibooker.book1D("HFEMFrac","HFEMFrac", 120, -0.1, 1.1);
1633  mHFHFrac = ibooker.book1D("HFHFrac", "HFHFrac", 120, -0.1, 1.1);
1634 
1635  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac" ,mCHFrac));
1636  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac" ,mNHFrac));
1637  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac" ,mPhFrac));
1638  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFrac",mHFEMFrac));
1639  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac" ,mHFHFrac));
1640 
1641  // Book NPV profiles
1642  //----------------------------------------------------------------------------
1643  mCHFrac_profile = ibooker.bookProfile("CHFrac_profile", "charged HAD fraction profile", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 1);
1644  mNHFrac_profile = ibooker.bookProfile("NHFrac_profile", "neutral HAD fraction profile", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 1);
1645  mPhFrac_profile = ibooker.bookProfile("PhFrac_profile", "Photon Fraction Profile", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 1);
1646  mHFEMFrac_profile = ibooker.bookProfile("HFEMFrac_profile","HF electomagnetic fraction Profile", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 1);
1647  mHFHFrac_profile = ibooker.bookProfile("HFHFrac_profile", "HF hadronic fraction profile", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 1);
1648 
1649 
1650  // met NPV profiles x-axis title
1651  //----------------------------------------------------------------------------
1652  mCHFrac_profile ->setAxisTitle("nvtx",1);
1653  mNHFrac_profile ->setAxisTitle("nvtx",1);
1654  mPhFrac_profile ->setAxisTitle("nvtx",1);
1655  mHFEMFrac_profile ->setAxisTitle("nvtx",1);
1656  mHFHFrac_profile ->setAxisTitle("nvtx",1);
1657 
1658  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_profile" ,mCHFrac_profile));
1659  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_profile" ,mNHFrac_profile));
1660  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_profile" ,mPhFrac_profile));
1661  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFrac_profile",mHFEMFrac_profile));
1662  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac_profile" ,mHFHFrac_profile));
1663 
1664  }
1665 }
1666 
1667 // ***********************************************************
1668 void JetAnalyzer::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup)
1669 {
1670  //LogDebug("JetAnalyzer") << "beginRun, run " << run.id();
1671  //
1672 
1673  if ( highPtJetEventFlag_->on() ) highPtJetEventFlag_->initRun( iRun, iSetup );
1674  if ( lowPtJetEventFlag_ ->on() ) lowPtJetEventFlag_ ->initRun( iRun, iSetup );
1675 
1676  if (highPtJetEventFlag_->on() && highPtJetEventFlag_->expressionsFromDB(highPtJetEventFlag_->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
1677  highPtJetExpr_ = highPtJetEventFlag_->expressionsFromDB(highPtJetEventFlag_->hltDBKey(), iSetup);
1678  if (lowPtJetEventFlag_->on() && lowPtJetEventFlag_->expressionsFromDB(lowPtJetEventFlag_->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
1679  lowPtJetExpr_ = lowPtJetEventFlag_->expressionsFromDB(lowPtJetEventFlag_->hltDBKey(), iSetup);
1680 // if (!jetCorrectionService_.empty()){
1681 // energycorrected=true;
1682 // }
1683  //--- htlConfig_
1684  //processname_="HLT";
1685  bool changed(true);
1686  hltInitialized_ = hltConfig_.init(iRun,iSetup,processname_,changed);
1687  if (!hltInitialized_) {
1688  //if (!hltConfig_.init(iRun,iSetup,processname_,changed)) {
1689  processname_ = "FU";
1690  hltInitialized_ = hltConfig_.init(iRun,iSetup,processname_,changed);
1691  if(!hltInitialized_){
1692  //if (!hltConfig_.init(iRun,iSetup,processname_,changed)){
1693  LogDebug("JetAnalyzer") << "HLTConfigProvider failed to initialize.";
1694  }
1695  }
1696 
1698  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd) ;
1699  const L1GtTriggerMenu* menu = menuRcd.product();
1700  for (CItAlgo techTrig = menu->gtTechnicalTriggerMap().begin(); techTrig != menu->gtTechnicalTriggerMap().end(); ++techTrig) {
1701  if ((techTrig->second).algoName() == m_l1algoname_) {
1702  m_bitAlgTechTrig_=(techTrig->second).algoBitNumber();
1703  break;
1704  }
1705  }
1706 
1707 }
1708 
1709 // ***********************************************************
1710 void JetAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup& iSetup)
1711 {
1712 }
1713 
1714 // ***********************************************************
1716 
1717 
1718  //set general folders first --> change later on for different folders
1719  if(jetCleaningFlag_){
1720  //dbe_->setCurrentFolder("JetMET/Jet/Cleaned"+mInputCollection_.label());
1721  DirName = "JetMET/Jet/Cleaned"+mInputCollection_.label();
1722  }else{
1723  //dbe_->setCurrentFolder("JetMET/Jet/Uncleaned"+mInputCollection_.label());
1724  DirName = "JetMET/Jet/Uncleaned"+mInputCollection_.label();
1725  }
1726 
1727 
1728  Handle<ValueMap<float> > puJetIdMva;
1729  Handle<ValueMap<int> > puJetIdFlagMva;
1730  Handle<ValueMap<float> > puJetId;
1731  Handle<ValueMap<int> > puJetIdFlag;
1732 
1733  Handle<ValueMap<int> > qgMultiplicity;
1734  Handle<ValueMap<float> > qgLikelihood;
1735  Handle<ValueMap<float> > qgptD;
1736  Handle<ValueMap<float> > qgaxis2;
1737 
1738  //should insure we have a PFJet in with CHS
1739  if(fill_CHS_histos){
1740  iEvent.getByToken(qgMultiplicityToken_,qgMultiplicity);
1741  iEvent.getByToken(qgLikelihoodToken_,qgLikelihood);
1742  iEvent.getByToken(qgptDToken_,qgptD);
1743  iEvent.getByToken(qgaxis2Token_,qgaxis2);
1744  }
1745 
1746  if(!isMiniAODJet_){
1747  iEvent.getByToken(mvaPUIDToken_,puJetIdFlagMva);
1748  iEvent.getByToken(cutBasedPUDiscriminantToken_,puJetId);
1749  iEvent.getByToken(cutBasedPUIDToken_,puJetIdFlag);
1750  iEvent.getByToken(mvaFullPUDiscriminantToken_ ,puJetIdMva);
1751  }
1752 
1753  // **** Get the TriggerResults container
1755  iEvent.getByToken(triggerResultsToken_, triggerResults);
1756 
1757  Int_t JetLoPass = 0;
1758  Int_t JetHiPass = 0;
1759 
1760  if (triggerResults.isValid()){
1761  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
1762 
1763  const unsigned int nTrig(triggerNames.size());
1764  for (unsigned int i=0;i<nTrig;++i)
1765  {
1766  if (triggerNames.triggerName(i).find(highPtJetExpr_[0].substr(0,highPtJetExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults->accept(i))
1767  JetHiPass=1;
1768  else if (triggerNames.triggerName(i).find(lowPtJetExpr_[0].substr(0,lowPtJetExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults->accept(i))
1769  JetLoPass=1;
1770  }
1771 
1772  }
1773 
1774  if (verbose_) std::cout << "trigger label " << theTriggerResultsLabel_ << std::endl;
1775 
1776 
1777  if (verbose_) {
1778  std::cout << ">>> Trigger Lo = " << JetLoPass
1779  << " Hi = " << JetHiPass
1780  << std::endl;
1781  }
1782 
1783  // ==========================================================
1784  //Vertex information
1785  Handle<VertexCollection> vertexHandle;
1786  iEvent.getByToken(vertexToken_, vertexHandle);
1787 
1788  if (!vertexHandle.isValid()) {
1789  LogDebug("") << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
1790  if (verbose_) std::cout << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
1791  }
1792  int numPV = 0;
1793  if ( vertexHandle.isValid() ){
1794  VertexCollection vertexCollection = *(vertexHandle.product());
1795  numPV = vertexCollection.size();
1796  }
1797  bool bPrimaryVertex = (bypassAllPVChecks_ || (numPV>0));
1798  if(fill_jet_high_level_histo){//should be filled for all events, no selection up to this point
1799  verticesME = map_of_MEs["JetMET/vertices"]; if(verticesME && verticesME->getRootObject())verticesME->Fill(numPV);
1800  }
1801  // ==========================================================
1803  iEvent.getByToken(gtToken_, gtReadoutRecord);
1804 
1805  if (!gtReadoutRecord.isValid()) {
1806  LogInfo("JetAnalyzer") << "JetAnalyzer: Could not find GT readout record" << std::endl;
1807  if (verbose_) std::cout << "JetAnalyzer: Could not find GT readout record product" << std::endl;
1808  }
1809 
1810  //bool techTriggerResultBxE = false;
1811  bool techTriggerResultBxF = false;
1812  bool techTriggerResultBx0 = false;
1813 
1814  if (!gtReadoutRecord.isValid()) {
1815  LogDebug("") << "CaloMETAnalyzer: Could not find GT readout record" << std::endl;
1816  if (verbose_) std::cout << "CaloMETAnalyzer: Could not find GT readout record product" << std::endl;
1817  }else{
1818  // trigger results before mask for BxInEvent -2 (E), -1 (F), 0 (L1A), 1, 2
1819  //const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxE = gtReadoutRecord->technicalTriggerWord(-2);
1820  const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxF = gtReadoutRecord->technicalTriggerWord(-1);
1821  const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBx0 = gtReadoutRecord->technicalTriggerWord();
1822  //const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxG = gtReadoutRecord->technicalTriggerWord(1);
1823  //const TechnicalTriggerWord& technicalTriggerWordBeforeMaskBxH = gtReadoutRecord->technicalTriggerWord(2);
1824  if (m_bitAlgTechTrig_ > -1 && technicalTriggerWordBeforeMaskBx0.size() > 0) {
1825  techTriggerResultBx0 = technicalTriggerWordBeforeMaskBx0.at(m_bitAlgTechTrig_);
1826  if(techTriggerResultBx0!=0){
1827  //techTriggerResultBxE = technicalTriggerWordBeforeMaskBxE.at(m_bitAlgTechTrig_);
1828  techTriggerResultBxF = technicalTriggerWordBeforeMaskBxF.at(m_bitAlgTechTrig_);
1829  }
1830  }
1831  }
1832 
1833 
1834  DCSFilterForDCSMonitoring_->filter(iEvent, iSetup);
1835  if(fill_jet_high_level_histo){//should be filled only once
1836  cleanupME = map_of_MEs["JetMET/cleanup"]; if(cleanupME && cleanupME->getRootObject()){
1837  if (bPrimaryVertex) cleanupME->Fill(0.5);
1838  if ( DCSFilterForDCSMonitoring_->passPIX ) cleanupME->Fill(1.5);
1839  if ( DCSFilterForDCSMonitoring_->passSiStrip ) cleanupME->Fill(2.5);
1840  if ( DCSFilterForDCSMonitoring_->passECAL ) cleanupME->Fill(3.5);
1841  if ( DCSFilterForDCSMonitoring_->passES ) cleanupME->Fill(4.5);
1842  if ( DCSFilterForDCSMonitoring_->passHBHE ) cleanupME->Fill(5.5);
1843  if ( DCSFilterForDCSMonitoring_->passHF ) cleanupME->Fill(6.5);
1844  if ( DCSFilterForDCSMonitoring_->passHO ) cleanupME->Fill(7.5);
1845  if ( DCSFilterForDCSMonitoring_->passMuon ) cleanupME->Fill(8.5);
1846  }
1847  }
1852 
1854 
1855  bool pass_Z_selection=false;
1857 
1858  int mu_index0=-1;
1859  int mu_index1=-1;
1860 
1861  if (isCaloJet_) iEvent.getByToken(caloJetsToken_, caloJets);
1862  //if (isJPTJet_) iEvent.getByToken(jptJetsToken_, jptJets);
1863  if (isPFJet_){ iEvent.getByToken(pfJetsToken_, pfJets);
1864  iEvent.getByToken(MuonsToken_, Muons);
1865  double pt0=-1;
1866  double pt1=-1;
1867  //fill it only for cleaned jets
1868  if(jetCleaningFlag_ && Muons.isValid() && Muons->size()>1){
1869  for (unsigned int i=0;i<Muons->size();i++){
1870  bool pass_muon_id=false;
1871  bool pass_muon_iso=false;
1872  double dxy=fabs((*Muons)[i].muonBestTrack()->dxy());
1873  double dz=fabs((*Muons)[i].muonBestTrack()->dz());
1874  if (numPV>0){
1875  dxy=fabs((*Muons)[i].muonBestTrack()->dxy((*vertexHandle)[0].position()));
1876  dz=fabs((*Muons)[i].muonBestTrack()->dz((*vertexHandle)[0].position()));
1877  }
1878  if((*Muons)[i].pt()>20 && fabs((*Muons)[i].eta())<2.3){
1879  if((*Muons)[i].isGlobalMuon() && (*Muons)[i].isPFMuon() && (*Muons)[i].globalTrack()->hitPattern().numberOfValidMuonHits() > 0 && (*Muons)[i].numberOfMatchedStations() > 1 && dxy < 0.2 && (*Muons)[i].numberOfMatchedStations() > 1 && dz<0.5 && (*Muons)[i].innerTrack()->hitPattern().numberOfValidPixelHits() > 0 && (*Muons)[i].innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5){
1880  pass_muon_id=true;
1881  }
1882  // Muon pf isolation DB corrected
1883  float muonIsoPFdb = ((*Muons)[i].pfIsolationR04().sumChargedHadronPt
1884  + std::max(0., (*Muons)[i].pfIsolationR04().sumNeutralHadronEt + (*Muons)[i].pfIsolationR04().sumPhotonEt - 0.5*(*Muons)[i].pfIsolationR04().sumPUPt))/(*Muons)[i].pt();
1885  if(muonIsoPFdb<0.12){
1886  pass_muon_iso=true;
1887  }
1888 
1889  if(pass_muon_id && pass_muon_iso){
1890  if((*Muons)[i].pt()>pt0){
1891  mu_index1=mu_index0;
1892  pt1=pt0;
1893  mu_index0=i;
1894  pt0=(*Muons)[i].pt();
1895  }else if ((*Muons)[i].pt()>pt1){
1896  mu_index1=i;
1897  pt1=(*Muons)[i].pt();
1898  }
1899  }
1900  }
1901  }
1902  if(mu_index0>=0 && mu_index1>=0){
1903  if((*Muons)[mu_index0].charge()*(*Muons)[mu_index1].charge()<0){
1904  zCand=(*Muons)[mu_index0].polarP4()+(*Muons)[mu_index1].polarP4();
1905  if(fabs(zCand.M()-91.)<20 && zCand.Pt()>30){
1906  pass_Z_selection=true;
1907  }
1908  }
1909  }
1910  }
1911  }
1912  if(isMiniAODJet_) iEvent.getByToken(patJetsToken_,patJets);
1913 
1914  edm::Handle< edm::ValueMap<reco::JetID> >jetID_ValueMap_Handle;
1915  if(/*isJPTJet_ || */isCaloJet_){
1916  if(!runcosmics_){
1917  iEvent.getByToken(jetID_ValueMapToken_,jetID_ValueMap_Handle);
1918  }
1919  }
1920 
1921  //check for collections AND DCS filters
1922  bool dcsDecision = DCSFilterForJetMonitoring_->filter(iEvent, iSetup);
1923  bool jetCollectionIsValid = false;
1924  if (isCaloJet_) jetCollectionIsValid = caloJets.isValid();
1925  //if (isJPTJet_) jetCollectionIsValid = jptJets.isValid();
1926  if (isPFJet_) jetCollectionIsValid = pfJets.isValid();
1927  if (isMiniAODJet_) jetCollectionIsValid = patJets.isValid();
1928 
1929 
1930  if (jetCleaningFlag_ && (!jetCollectionIsValid || !bPrimaryVertex || !dcsDecision)) return;
1931 
1932  unsigned int collSize=-1;
1933  if (isCaloJet_) collSize = caloJets->size();
1934  //if (isJPTJet_) {
1935  //collSize=jptJets->size();
1936  //if(collSize>0){
1937  // //update the track propagator and strip noise calculator
1938  // trackPropagator_->update(iSetup);
1939  // //sOverNCalculator_->update(iSetup);
1940  //}
1941  //}
1942  if (isPFJet_) collSize=pfJets->size();
1943  if (isMiniAODJet_) collSize=patJets->size();
1944 
1945  double scale=-1;
1946  //now start changes for jets
1947  std::vector<Jet> corJets;
1948  corJets.clear();
1949 
1950  //maybe not most elegant solution, but works for sure
1951  int ind1=-1;
1952  double pt1=-1;
1953  int ind2=-1;
1954  double pt2=-1;
1955  int ind3=-1;
1956  double pt3=-1;
1957 
1958  bool cleaned_first_jet=false;
1959  bool cleaned_second_jet=false;
1960  //bool cleaned_third_jet=false;
1961  //for ZJets selection check for muon jet overlap
1962  int ind1_mu_vetoed=-1;
1963  double pt1_mu_vetoed=-1;
1964  int ind2_mu_vetoed=-1;
1965  double pt2_mu_vetoed=-1;
1966  bool cleaned_first_jet_mu_vetoed=false;
1967  bool cleaned_second_jet_mu_vetoed=false;
1968 
1969  //now start changes for jets
1970  std::vector<Jet> recoJets;
1971  recoJets.clear();
1972 
1973  int numofjets=0;
1974 
1976  bool pass_correction_flag=false;
1977  if(!isMiniAODJet_ && !jetCorrectorTag_.label().empty()){
1978  iEvent.getByToken(jetCorrectorToken_, jetCorr);
1979  if (jetCorr.isValid()){
1980  pass_correction_flag=true;
1981  }
1982  }
1983  if(isMiniAODJet_){
1984  pass_correction_flag=true;
1985  }
1986 
1987  for (unsigned int ijet=0; ijet<collSize; ijet++) {
1988  //bool thiscleaned=false;
1989  Jet correctedJet;
1990  bool pass_uncorrected=false;
1991  bool pass_corrected=false;
1992  if (isCaloJet_){
1993  correctedJet=(*caloJets)[ijet];
1994  }
1995  //if (isJPTJet_){
1996  //correctedJet=(*jptJets)[ijet];
1997  //}
1998  if (isPFJet_){
1999  correctedJet=(*pfJets)[ijet];
2000  }
2001  if (isMiniAODJet_){
2002  correctedJet=(*patJets)[ijet];
2003  }
2004  if(!isMiniAODJet_ && correctedJet.pt()>ptThresholdUnc_){
2005  pass_uncorrected=true;
2006  }
2007  if(isMiniAODJet_ && (correctedJet.pt()*(*patJets)[ijet].jecFactor("Uncorrected"))>ptThresholdUnc_){
2008  pass_uncorrected=true;
2009  }
2010  if (pass_correction_flag && !isMiniAODJet_) {
2011  if (isCaloJet_){
2012  scale = jetCorr->correction((*caloJets)[ijet]);
2013  }
2014  if (isPFJet_){
2015  scale = jetCorr->correction((*pfJets)[ijet]);
2016  }
2017  correctedJet.scaleEnergy(scale);
2018  }
2019  if(correctedJet.pt()> ptThreshold_){
2020  pass_corrected=true;
2021  }
2022  //if (!pass_corrected && !pass_uncorrected) continue;
2023  //remove the continue line, for physics selections we might losen the pt-thresholds as we care only about leading jets
2024  //fill only corrected jets -> check ID for uncorrected jets
2025  if(pass_corrected){
2026  recoJets.push_back(correctedJet);
2027  }
2028  bool jetpassid=true;
2029  bool Thiscleaned=true;
2030  bool JetIDWPU=true;
2031  //jet ID for calojets
2032  if (isCaloJet_) {
2033  reco::CaloJetRef calojetref(caloJets, ijet);
2034  if(!runcosmics_){
2035  reco::JetID jetID = (*jetID_ValueMap_Handle)[calojetref];
2036  jetpassid = jetIDFunctor((*caloJets)[ijet], jetID);
2037  JetIDWPU=jetpassid;
2038  if(jetCleaningFlag_){
2039  Thiscleaned=jetpassid;
2040  }
2041  if(Thiscleaned && pass_corrected){//if cleaning requested->jet passes a loose ID
2042  mN90Hits = map_of_MEs[DirName+"/"+"N90Hits"]; if (mN90Hits && mN90Hits->getRootObject()) mN90Hits->Fill (jetID.n90Hits);
2043  mfHPD = map_of_MEs[DirName+"/"+"fHPD"]; if (mfHPD && mfHPD->getRootObject()) mfHPD->Fill (jetID.fHPD);
2044  mresEMF = map_of_MEs[DirName+"/"+"resEMF"]; if (mresEMF && mresEMF->getRootObject()) mresEMF->Fill (jetID.restrictedEMF);
2045  mfRBX = map_of_MEs[DirName+"/"+"fRBX"]; if (mfRBX && mfRBX->getRootObject()) mfRBX->Fill (jetID.fRBX);
2046  }
2047  }
2048  if(jetCleaningFlag_){
2049  Thiscleaned=jetpassid;
2050  }
2051  if(Thiscleaned && pass_uncorrected){
2052  mPt_uncor = map_of_MEs[DirName+"/"+"Pt_uncor"]; if (mPt_uncor && mPt_uncor->getRootObject()) mPt_uncor->Fill ((*caloJets)[ijet].pt());
2053  mEta_uncor = map_of_MEs[DirName+"/"+"Eta_uncor"]; if (mEta_uncor && mEta_uncor->getRootObject()) mEta_uncor->Fill ((*caloJets)[ijet].eta());
2054  mPhi_uncor = map_of_MEs[DirName+"/"+"Phi_uncor"]; if (mPhi_uncor && mPhi_uncor->getRootObject()) mPhi_uncor->Fill ((*caloJets)[ijet].phi());
2055  mConstituents_uncor = map_of_MEs[DirName+"/"+"Constituents_uncor"]; if (mConstituents_uncor && mConstituents_uncor->getRootObject()) mConstituents_uncor->Fill ((*caloJets)[ijet].nConstituents());
2056  }
2057  //now do calojet specific fractions and histograms ->H and E fracs
2058  if(Thiscleaned && pass_corrected){//if cleaning requested->jet passes a loose ID
2059  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*caloJets)[ijet].energyFractionHadronic());
2060  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*caloJets)[ijet].emEnergyFraction());
2061  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*caloJets)[ijet].energyFractionHadronic());
2062  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*caloJets)[ijet].emEnergyFraction());
2063  if (fabs((*caloJets)[ijet].eta()) <= 1.3) {
2064  mHFrac_Barrel = map_of_MEs[DirName+"/"+"HFrac_Barrel"]; if (mHFrac_Barrel && mHFrac_Barrel->getRootObject()) mHFrac_Barrel->Fill((*caloJets)[ijet].energyFractionHadronic());
2065  mEFrac_Barrel = map_of_MEs[DirName+"/"+"EFrac_Barrel"]; if (mEFrac_Barrel && mEFrac_Barrel->getRootObject()) mEFrac_Barrel->Fill((*caloJets)[ijet].emEnergyFraction());
2066  }else if(fabs((*caloJets)[ijet].eta()) <3.0){
2067  mHFrac_EndCap = map_of_MEs[DirName+"/"+"HFrac_EndCap"]; if (mHFrac_EndCap && mHFrac_EndCap->getRootObject()) mHFrac_EndCap->Fill((*caloJets)[ijet].energyFractionHadronic());
2068  mEFrac_EndCap = map_of_MEs[DirName+"/"+"EFrac_EndCap"]; if (mEFrac_EndCap && mEFrac_EndCap->getRootObject()) mEFrac_EndCap->Fill((*caloJets)[ijet].emEnergyFraction());
2069  }else{
2070  mHFrac_Forward = map_of_MEs[DirName+"/"+"HFrac_Forward"]; if (mHFrac_Forward && mHFrac_Forward->getRootObject()) mHFrac_Forward->Fill((*caloJets)[ijet].energyFractionHadronic());
2071  mEFrac_Forward = map_of_MEs[DirName+"/"+"EFrac_Forward"]; if (mEFrac_Forward && mEFrac_Forward->getRootObject()) mEFrac_Forward->Fill((*caloJets)[ijet].emEnergyFraction());
2072  }
2073  mHadEnergyInHO = map_of_MEs[DirName+"/"+"HadEnergyInHO"]; if (mHadEnergyInHO && mHadEnergyInHO->getRootObject()) mHadEnergyInHO->Fill ((*caloJets)[ijet].hadEnergyInHO());
2074  mHadEnergyInHB = map_of_MEs[DirName+"/"+"HadEnergyInHB"]; if (mHadEnergyInHB && mHadEnergyInHB->getRootObject()) mHadEnergyInHB->Fill ((*caloJets)[ijet].hadEnergyInHB());
2075  mHadEnergyInHF = map_of_MEs[DirName+"/"+"HadEnergyInHF"]; if (mHadEnergyInHF && mHadEnergyInHF->getRootObject()) mHadEnergyInHF->Fill ((*caloJets)[ijet].hadEnergyInHF());
2076  mHadEnergyInHE = map_of_MEs[DirName+"/"+"HadEnergyInHE"]; if (mHadEnergyInHE && mHadEnergyInHE->getRootObject()) mHadEnergyInHE->Fill ((*caloJets)[ijet].hadEnergyInHE());
2077  mEmEnergyInEB = map_of_MEs[DirName+"/"+"EmEnergyInEB"]; if (mEmEnergyInEB && mEmEnergyInEB->getRootObject()) mEmEnergyInEB->Fill ((*caloJets)[ijet].emEnergyInEB());
2078  mEmEnergyInEE = map_of_MEs[DirName+"/"+"EmEnergyInEE"]; if (mEmEnergyInEE && mEmEnergyInEE->getRootObject()) mEmEnergyInEE->Fill ((*caloJets)[ijet].emEnergyInEE());
2079  mEmEnergyInHF = map_of_MEs[DirName+"/"+"EmEnergyInHF"]; if (mEmEnergyInHF && mEmEnergyInHF->getRootObject()) mEmEnergyInHF->Fill ((*caloJets)[ijet].emEnergyInHF());
2080 
2081  }
2082  }
2083  if(isMiniAODJet_ && (*patJets)[ijet].isPFJet()){
2084  pat::strbitset stringbitset=pfjetIDFunctor.getBitTemplate();
2085  jetpassid = pfjetIDFunctor((*patJets)[ijet],stringbitset);
2086  if(jetCleaningFlag_){
2087  Thiscleaned = jetpassid;
2088  JetIDWPU = jetpassid;
2089  }
2090  if(Thiscleaned && pass_uncorrected){
2091  mPt_uncor = map_of_MEs[DirName+"/"+"Pt_uncor"]; if (mPt_uncor && mPt_uncor->getRootObject()) if (mPt_uncor) mPt_uncor->Fill ((*patJets)[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected"));
2092  mEta_uncor = map_of_MEs[DirName+"/"+"Eta_uncor"]; if (mEta_uncor && mEta_uncor->getRootObject()) if (mEta_uncor) mEta_uncor->Fill ((*patJets)[ijet].eta());
2093  mPhi_uncor = map_of_MEs[DirName+"/"+"Phi_uncor"]; if (mPhi_uncor && mPhi_uncor->getRootObject()) if (mPhi_uncor) mPhi_uncor->Fill ((*patJets)[ijet].phi());
2094  mConstituents_uncor = map_of_MEs[DirName+"/"+"Constituents_uncor"]; if (mConstituents_uncor && mConstituents_uncor->getRootObject()) if (mConstituents_uncor) mConstituents_uncor->Fill ((*patJets)[ijet].nConstituents());
2095  }
2096  if(Thiscleaned && pass_corrected){
2097  mPt_CaloJet = map_of_MEs[DirName+"/"+"Pt_CaloJet"]; if(mPt_CaloJet && mPt_CaloJet->getRootObject()&& (*patJets)[ijet].hasUserFloat("caloJetMap:pt")) mPt_CaloJet->Fill((*patJets)[ijet].userFloat("caloJetMap:pt"));
2098  mEMF_CaloJet = map_of_MEs[DirName+"/"+"EMF_CaloJet"]; if(mEMF_CaloJet && mEMF_CaloJet->getRootObject() && (*patJets)[ijet].hasUserFloat("caloJetMap:emEnergyFraction")) mEMF_CaloJet->Fill((*patJets)[ijet].userFloat("caloJetMap:emEnergyFraction"));
2099  if(fabs(correctedJet.eta()) <= 1.3) {
2100  if(correctedJet.pt()<=50.){
2101  mMVAPUJIDDiscriminant_lowPt_Barrel=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_lowPt_Barrel"]; if(mMVAPUJIDDiscriminant_lowPt_Barrel && mMVAPUJIDDiscriminant_lowPt_Barrel->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_lowPt_Barrel->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant")); }
2102  }
2103  if (correctedJet.pt()>50. && correctedJet.pt()<=140.) {
2104  mMVAPUJIDDiscriminant_mediumPt_Barrel=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_Barrel"]; if(mMVAPUJIDDiscriminant_mediumPt_Barrel && mMVAPUJIDDiscriminant_mediumPt_Barrel->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_mediumPt_Barrel->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant")); }
2105  }
2106  if(correctedJet.pt()>140.){
2107  mMVAPUJIDDiscriminant_highPt_Barrel=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_highPt_Barrel"]; if(mMVAPUJIDDiscriminant_highPt_Barrel && mMVAPUJIDDiscriminant_highPt_Barrel->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_highPt_Barrel->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant")); }
2108  }
2109  mMass_Barrel=map_of_MEs[DirName+"/"+"JetMass_Barrel"]; if(mMass_Barrel && mMass_Barrel->getRootObject())mMass_Barrel->Fill((*patJets)[ijet].mass());
2110  mCHFracVSpT_Barrel = map_of_MEs[DirName+"/"+"CHFracVSpT_Barrel"]; if(mCHFracVSpT_Barrel && mCHFracVSpT_Barrel->getRootObject()) mCHFracVSpT_Barrel->Fill(correctedJet.pt(),(*patJets)[ijet].chargedHadronEnergyFraction());
2111  mNHFracVSpT_Barrel = map_of_MEs[DirName+"/"+"NHFracVSpT_Barrel"];if (mNHFracVSpT_Barrel && mNHFracVSpT_Barrel->getRootObject()) mNHFracVSpT_Barrel->Fill(correctedJet.pt(),(*patJets)[ijet].neutralHadronEnergyFraction());
2112  mPhFracVSpT_Barrel = map_of_MEs[DirName+"/"+"PhFracVSpT_Barrel"];if (mPhFracVSpT_Barrel && mPhFracVSpT_Barrel->getRootObject()) mPhFracVSpT_Barrel->Fill(correctedJet.pt(),(*patJets)[ijet].neutralEmEnergyFraction());
2113  }else if(fabs(correctedJet.eta()) <= 3) {
2114  if(correctedJet.pt()<=50.){
2115  mMVAPUJIDDiscriminant_lowPt_EndCap=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_lowPt_EndCap"]; if(mMVAPUJIDDiscriminant_lowPt_EndCap && mMVAPUJIDDiscriminant_lowPt_EndCap->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_lowPt_EndCap->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant")); }
2116  }
2117  if (correctedJet.pt()>50. && correctedJet.pt()<=140.) {
2118  mMVAPUJIDDiscriminant_mediumPt_EndCap=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_EndCap"]; if(mMVAPUJIDDiscriminant_mediumPt_EndCap && mMVAPUJIDDiscriminant_mediumPt_EndCap->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_mediumPt_EndCap->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant")); }
2119  }
2120  if(correctedJet.pt()>140.){
2121  mMVAPUJIDDiscriminant_highPt_EndCap=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_highPt_EndCap"]; if(mMVAPUJIDDiscriminant_highPt_EndCap && mMVAPUJIDDiscriminant_highPt_EndCap->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_highPt_EndCap->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant")); }
2122  }
2123  mMass_EndCap=map_of_MEs[DirName+"/"+"JetMass_EndCap"]; if(mMass_EndCap && mMass_EndCap->getRootObject())mMass_EndCap->Fill((*patJets)[ijet].mass());
2124  mCHFracVSpT_EndCap = map_of_MEs[DirName+"/"+"CHFracVSpT_EndCap"]; if(mCHFracVSpT_EndCap && mCHFracVSpT_EndCap->getRootObject()) mCHFracVSpT_EndCap->Fill(correctedJet.pt(),(*patJets)[ijet].chargedHadronEnergyFraction());
2125  mNHFracVSpT_EndCap = map_of_MEs[DirName+"/"+"NHFracVSpT_EndCap"];if (mNHFracVSpT_EndCap && mNHFracVSpT_EndCap->getRootObject()) mNHFracVSpT_EndCap->Fill(correctedJet.pt(),(*patJets)[ijet].neutralHadronEnergyFraction());
2126  mPhFracVSpT_EndCap = map_of_MEs[DirName+"/"+"PhFracVSpT_EndCap"];if (mPhFracVSpT_EndCap && mPhFracVSpT_EndCap->getRootObject()) mPhFracVSpT_EndCap->Fill(correctedJet.pt(),(*patJets)[ijet].neutralEmEnergyFraction());
2127  }else if(fabs(correctedJet.eta()) <= 5) {
2128  if(correctedJet.pt()<=50.){
2129  mMVAPUJIDDiscriminant_lowPt_Forward=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_lowPt_Forward"]; if(mMVAPUJIDDiscriminant_lowPt_Forward && mMVAPUJIDDiscriminant_lowPt_Forward->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_lowPt_Forward->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant")); }
2130  }
2131  if (correctedJet.pt()>50. && correctedJet.pt()<=140.) {
2132  mMVAPUJIDDiscriminant_mediumPt_Forward=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_Forward"]; if(mMVAPUJIDDiscriminant_mediumPt_Forward && mMVAPUJIDDiscriminant_mediumPt_Forward->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_mediumPt_Forward->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant"));}
2133  }
2134  if(correctedJet.pt()>140.){
2135  mMVAPUJIDDiscriminant_highPt_Forward=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_highPt_Forward"]; if(mMVAPUJIDDiscriminant_highPt_Forward && mMVAPUJIDDiscriminant_highPt_Forward->getRootObject()){if((*patJets)[ijet].hasUserFloat("pileupJetId:fullDiscriminant")) mMVAPUJIDDiscriminant_highPt_Forward->Fill( (*patJets)[ijet].userFloat("pileupJetId:fullDiscriminant"));}
2136  }
2137  mMass_Forward=map_of_MEs[DirName+"/"+"JetMass_Forward"]; if(mMass_Forward && mMass_Forward->getRootObject())mMass_Forward->Fill((*patJets)[ijet].mass());
2138  mHFHFracVSpT_Forward = map_of_MEs[DirName+"/"+"HFHFracVSpT_Forward"]; if (mHFHFracVSpT_Forward && mHFHFracVSpT_Forward->getRootObject()) mHFHFracVSpT_Forward->Fill(correctedJet.pt(),(*patJets)[ijet].HFHadronEnergyFraction ());
2139  mHFEFracVSpT_Forward = map_of_MEs[DirName+"/"+"HFEFracVSpT_Forward"]; if (mHFEFracVSpT_Forward && mHFEFracVSpT_Forward->getRootObject()) mHFEFracVSpT_Forward->Fill (correctedJet.pt(),(*patJets)[ijet].HFEMEnergyFraction ());
2140  }
2141  }
2142  }
2143  if(isPFJet_){
2144  reco::PFJetRef pfjetref(pfJets, ijet);
2145  float puidmva=-1;
2146  float puidcut=-1;
2147  int puidmvaflag=-10;
2148  int puidcutflag=-10;
2149  puidmva=(*puJetIdMva)[pfjetref];
2150  puidcut=(*puJetId)[pfjetref];
2151  puidmvaflag=(*puJetIdFlagMva)[pfjetref];
2152  puidcutflag=(*puJetIdFlag)[pfjetref];
2153  jetpassid = pfjetIDFunctor((*pfJets)[ijet]);
2154  if(jetCleaningFlag_){
2155  Thiscleaned = jetpassid;
2156  //JetIDWPU= (jetpassid && PileupJetIdentifier::passJetId( puidmvaflag, PileupJetIdentifier::kLoose ));
2157  }
2158  if(Thiscleaned && pass_uncorrected){
2159  mPt_uncor = map_of_MEs[DirName+"/"+"Pt_uncor"]; if (mPt_uncor && mPt_uncor->getRootObject()) mPt_uncor->Fill ((*pfJets)[ijet].pt());
2160  mEta_uncor = map_of_MEs[DirName+"/"+"Eta_uncor"]; if (mEta_uncor && mEta_uncor->getRootObject()) mEta_uncor->Fill ((*pfJets)[ijet].eta());
2161  mPhi_uncor = map_of_MEs[DirName+"/"+"Phi_uncor"]; if (mPhi_uncor && mPhi_uncor->getRootObject()) mPhi_uncor->Fill ((*pfJets)[ijet].phi());
2162  mConstituents_uncor = map_of_MEs[DirName+"/"+"Constituents_uncor"]; if (mConstituents_uncor && mConstituents_uncor->getRootObject()) mConstituents_uncor->Fill ((*pfJets)[ijet].nConstituents());
2163  }
2164  if(Thiscleaned && pass_corrected){
2166  mLooseCutPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"LooseCutPUIDPassFractionVSeta"];if(mLooseCutPUJIDPassFractionVSeta && mLooseCutPUJIDPassFractionVSeta->getRootObject()) mLooseCutPUJIDPassFractionVSeta->Fill(correctedJet.eta(),1.);
2167  mLooseCutPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"LooseCutPUIDPassFractionVSpt"];if(mLooseCutPUJIDPassFractionVSpt && mLooseCutPUJIDPassFractionVSpt->getRootObject()) mLooseCutPUJIDPassFractionVSpt->Fill(correctedJet.pt(),1.);
2168  }else{
2169  mLooseCutPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"LooseCutPUIDPassFractionVSeta"];if(mLooseCutPUJIDPassFractionVSeta && mLooseCutPUJIDPassFractionVSeta->getRootObject()) mLooseCutPUJIDPassFractionVSeta->Fill(correctedJet.eta(),0.);
2170  mLooseCutPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"LooseCutPUIDPassFractionVSpt"];if(mLooseCutPUJIDPassFractionVSpt && mLooseCutPUJIDPassFractionVSpt->getRootObject()) mLooseCutPUJIDPassFractionVSpt->Fill(correctedJet.pt(),0.);
2171  }
2173  mMediumCutPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"MediumCutPUIDPassFractionVSeta"];if(mMediumCutPUJIDPassFractionVSeta && mMediumCutPUJIDPassFractionVSeta->getRootObject()) mMediumCutPUJIDPassFractionVSeta->Fill(correctedJet.eta(),1.);
2174  mMediumCutPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"MediumCutPUIDPassFractionVSpt"];if(mMediumCutPUJIDPassFractionVSpt && mMediumCutPUJIDPassFractionVSpt->getRootObject()) mMediumCutPUJIDPassFractionVSpt->Fill(correctedJet.pt(),1.);
2175  }else{
2176  mMediumCutPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"MediumCutPUIDPassFractionVSeta"];if(mMediumCutPUJIDPassFractionVSeta && mMediumCutPUJIDPassFractionVSeta->getRootObject()) mMediumCutPUJIDPassFractionVSeta->Fill(correctedJet.eta(),0.);
2177  mMediumCutPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"MediumCutPUIDPassFractionVSpt"];if(mMediumCutPUJIDPassFractionVSpt && mMediumCutPUJIDPassFractionVSpt->getRootObject()) mMediumCutPUJIDPassFractionVSpt->Fill(correctedJet.pt(),0.);
2178  }
2180  mTightCutPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"TightCutPUIDPassFractionVSeta"];if(mTightCutPUJIDPassFractionVSeta && mTightCutPUJIDPassFractionVSeta->getRootObject()) mTightCutPUJIDPassFractionVSeta->Fill(correctedJet.eta(),1.);
2181  mTightCutPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"TightCutPUIDPassFractionVSpt"];if(mTightCutPUJIDPassFractionVSpt && mTightCutPUJIDPassFractionVSpt->getRootObject()) mTightCutPUJIDPassFractionVSpt->Fill(correctedJet.pt(),1.);
2182  }else{
2183  mTightCutPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"TightCutPUIDPassFractionVSeta"];if(mTightCutPUJIDPassFractionVSeta && mTightCutPUJIDPassFractionVSeta->getRootObject()) mTightCutPUJIDPassFractionVSeta->Fill(correctedJet.eta(),0.);
2184  mTightCutPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"TightCutPUIDPassFractionVSpt"];if(mTightCutPUJIDPassFractionVSpt && mTightCutPUJIDPassFractionVSpt->getRootObject()) mTightCutPUJIDPassFractionVSpt->Fill(correctedJet.pt(),0.);
2185  }
2187  mLooseMVAPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"LooseMVAPUIDPassFractionVSeta"];if(mLooseMVAPUJIDPassFractionVSeta && mLooseMVAPUJIDPassFractionVSeta->getRootObject()) mLooseMVAPUJIDPassFractionVSeta->Fill(correctedJet.eta(),1.);
2188  mLooseMVAPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"LooseMVAPUIDPassFractionVSpt"];if(mLooseMVAPUJIDPassFractionVSpt && mLooseMVAPUJIDPassFractionVSpt->getRootObject()) mLooseMVAPUJIDPassFractionVSpt->Fill(correctedJet.pt(),1.);
2189  }else{
2190  mLooseMVAPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"LooseMVAPUIDPassFractionVSeta"];if(mLooseMVAPUJIDPassFractionVSeta && mLooseMVAPUJIDPassFractionVSeta->getRootObject()) mLooseMVAPUJIDPassFractionVSeta->Fill(correctedJet.eta(),0.);
2191  mLooseMVAPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"LooseMVAPUIDPassFractionVSpt"];if(mLooseMVAPUJIDPassFractionVSpt && mLooseMVAPUJIDPassFractionVSpt->getRootObject()) mLooseMVAPUJIDPassFractionVSpt->Fill(correctedJet.pt(),0.);
2192  }
2194  mMediumMVAPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"MediumMVAPUIDPassFractionVSeta"];if(mMediumMVAPUJIDPassFractionVSeta && mMediumMVAPUJIDPassFractionVSeta->getRootObject()) mMediumMVAPUJIDPassFractionVSeta->Fill(correctedJet.eta(),1.);
2195  mMediumMVAPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"MediumMVAPUIDPassFractionVSpt"];if(mMediumMVAPUJIDPassFractionVSpt && mMediumMVAPUJIDPassFractionVSpt->getRootObject()) mMediumMVAPUJIDPassFractionVSpt->Fill(correctedJet.pt(),1.);
2196  }else{
2197  mMediumMVAPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"MediumMVAPUIDPassFractionVSeta"];if(mMediumMVAPUJIDPassFractionVSeta && mMediumMVAPUJIDPassFractionVSeta->getRootObject()) mMediumMVAPUJIDPassFractionVSeta->Fill(correctedJet.eta(),0.);
2198  mMediumMVAPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"MediumMVAPUIDPassFractionVSpt"];if(mMediumMVAPUJIDPassFractionVSpt && mMediumMVAPUJIDPassFractionVSpt->getRootObject()) mMediumMVAPUJIDPassFractionVSpt->Fill(correctedJet.pt(),0.);
2199  }
2201  mTightMVAPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"TightMVAPUIDPassFractionVSeta"];if(mTightMVAPUJIDPassFractionVSeta && mTightMVAPUJIDPassFractionVSeta->getRootObject()) mTightMVAPUJIDPassFractionVSeta->Fill(correctedJet.eta(),1.);
2202  mTightMVAPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"TightMVAPUIDPassFractionVSpt"];if(mTightMVAPUJIDPassFractionVSpt && mTightMVAPUJIDPassFractionVSpt->getRootObject()) mTightMVAPUJIDPassFractionVSpt->Fill(correctedJet.pt(),1.);
2203  }else{
2204  mTightMVAPUJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"TightMVAPUIDPassFractionVSeta"];if(mTightMVAPUJIDPassFractionVSeta && mTightMVAPUJIDPassFractionVSeta->getRootObject()) mTightMVAPUJIDPassFractionVSeta->Fill(correctedJet.eta(),0.);
2205  mTightMVAPUJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"TightMVAPUIDPassFractionVSpt"];if(mTightMVAPUJIDPassFractionVSpt && mTightMVAPUJIDPassFractionVSpt->getRootObject()) mTightMVAPUJIDPassFractionVSpt->Fill(correctedJet.pt(),0.);
2206  }
2207  if (correctedJet.pt()<= 50) {
2208  mCHFracVSeta_lowPt = map_of_MEs[DirName+"/"+"CHFracVSeta_lowPt"]; if (mCHFracVSeta_lowPt && mCHFracVSeta_lowPt->getRootObject()) mCHFracVSeta_lowPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedHadronEnergyFraction());
2209  mNHFracVSeta_lowPt = map_of_MEs[DirName+"/"+"NHFracVSeta_lowPt"]; if (mNHFracVSeta_lowPt && mNHFracVSeta_lowPt->getRootObject()) mNHFracVSeta_lowPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralHadronEnergyFraction());
2210  mPhFracVSeta_lowPt = map_of_MEs[DirName+"/"+"PhFracVSeta_lowPt"]; if (mPhFracVSeta_lowPt && mPhFracVSeta_lowPt->getRootObject()) mPhFracVSeta_lowPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralEmEnergyFraction());
2211  }
2212  if (correctedJet.pt()>50. && correctedJet.pt()<=140.) {
2213  mCHFracVSeta_mediumPt = map_of_MEs[DirName+"/"+"CHFracVSeta_mediumPt"]; if (mCHFracVSeta_mediumPt && mCHFracVSeta_mediumPt->getRootObject()) mCHFracVSeta_mediumPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedHadronEnergyFraction());
2214  mNHFracVSeta_mediumPt = map_of_MEs[DirName+"/"+"NHFracVSeta_mediumPt"]; if (mNHFracVSeta_mediumPt && mNHFracVSeta_mediumPt->getRootObject()) mNHFracVSeta_mediumPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralHadronEnergyFraction());
2215  mPhFracVSeta_mediumPt = map_of_MEs[DirName+"/"+"PhFracVSeta_mediumPt"]; if (mPhFracVSeta_mediumPt && mPhFracVSeta_mediumPt->getRootObject()) mPhFracVSeta_mediumPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralEmEnergyFraction());
2216  }
2217  if (correctedJet.pt()>140.) {
2218  mCHFracVSeta_highPt = map_of_MEs[DirName+"/"+"CHFracVSeta_highPt"]; if (mCHFracVSeta_highPt && mCHFracVSeta_highPt->getRootObject()) mCHFracVSeta_highPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedHadronEnergyFraction());
2219  mNHFracVSeta_highPt = map_of_MEs[DirName+"/"+"NHFracVSeta_highPt"]; if (mNHFracVSeta_highPt && mNHFracVSeta_highPt->getRootObject()) mNHFracVSeta_highPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralHadronEnergyFraction());
2220  mPhFracVSeta_highPt = map_of_MEs[DirName+"/"+"PhFracVSeta_highPt"]; if (mPhFracVSeta_highPt && mPhFracVSeta_highPt->getRootObject()) mPhFracVSeta_highPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralEmEnergyFraction());
2221  }
2222  if (fabs(correctedJet.eta()) <= 1.3) {
2223  //fractions for barrel
2224  if (correctedJet.pt()<=50.) {
2225  //mAxis2_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_Barrel"];if(mAxis2_lowPt_Barrel && mAxis2_lowPt_Barrel->getRootObject()) mAxis2_lowPt_Barrel->Fill(QGaxis2);
2226  //mpTD_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_Barrel"]; if(mpTD_lowPt_Barrel && mpTD_lowPt_Barrel->getRootObject()) mpTD_lowPt_Barrel->Fill(QGptD);
2227  //mMultiplicityQG_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_Barrel"]; if(mMultiplicityQG_lowPt_Barrel && mMultiplicityQG_lowPt_Barrel->getRootObject()) mMultiplicityQG_lowPt_Barrel->Fill(QGmulti);
2228  //mqgLikelihood_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_Barrel"]; if(mqgLikelihood_lowPt_Barrel && mqgLikelihood_lowPt_Barrel->getRootObject()) mqgLikelihood_lowPt_Barrel->Fill(QGLikelihood);
2229  mMass_lowPt_Barrel=map_of_MEs[DirName+"/"+"JetMass_lowPt_Barrel"]; if(mMass_lowPt_Barrel && mMass_lowPt_Barrel->getRootObject())mMass_lowPt_Barrel->Fill((*pfJets)[ijet].mass());
2230  mMVAPUJIDDiscriminant_lowPt_Barrel=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_lowPt_Barrel"]; if(mMVAPUJIDDiscriminant_lowPt_Barrel && mMVAPUJIDDiscriminant_lowPt_Barrel->getRootObject()) mMVAPUJIDDiscriminant_lowPt_Barrel->Fill(puidmva);
2231  mCutPUJIDDiscriminant_lowPt_Barrel=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_lowPt_Barrel"]; if(mCutPUJIDDiscriminant_lowPt_Barrel && mCutPUJIDDiscriminant_lowPt_Barrel->getRootObject()) mCutPUJIDDiscriminant_lowPt_Barrel->Fill(puidcut);
2232  mCHFrac_lowPt_Barrel = map_of_MEs[DirName+"/"+"CHFrac_lowPt_Barrel"]; if (mCHFrac_lowPt_Barrel && mCHFrac_lowPt_Barrel->getRootObject()) mCHFrac_lowPt_Barrel->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2233  mNHFrac_lowPt_Barrel = map_of_MEs[DirName+"/"+"NHFrac_lowPt_Barrel"]; if (mNHFrac_lowPt_Barrel && mNHFrac_lowPt_Barrel->getRootObject()) mNHFrac_lowPt_Barrel->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2234  mPhFrac_lowPt_Barrel = map_of_MEs[DirName+"/"+"PhFrac_lowPt_Barrel"]; if (mPhFrac_lowPt_Barrel && mPhFrac_lowPt_Barrel->getRootObject()) mPhFrac_lowPt_Barrel->Fill((*pfJets)[ijet].neutralEmEnergyFraction());
2235  mCHEn_lowPt_Barrel = map_of_MEs[DirName+"/"+"CHEn_lowPt_Barrel"]; if (mCHEn_lowPt_Barrel && mCHEn_lowPt_Barrel->getRootObject()) mCHEn_lowPt_Barrel->Fill((*pfJets)[ijet].chargedHadronEnergy());
2236  mNHEn_lowPt_Barrel = map_of_MEs[DirName+"/"+"NHEn_lowPt_Barrel"]; if (mNHEn_lowPt_Barrel && mNHEn_lowPt_Barrel->getRootObject()) mNHEn_lowPt_Barrel->Fill((*pfJets)[ijet].neutralHadronEnergy());
2237  mPhEn_lowPt_Barrel = map_of_MEs[DirName+"/"+"PhEn_lowPt_Barrel"]; if (mPhEn_lowPt_Barrel && mPhEn_lowPt_Barrel->getRootObject()) mPhEn_lowPt_Barrel->Fill((*pfJets)[ijet].neutralEmEnergy());
2238  mElEn_lowPt_Barrel = map_of_MEs[DirName+"/"+"ElEn_lowPt_Barrel"]; if (mElEn_lowPt_Barrel && mElEn_lowPt_Barrel->getRootObject()) mElEn_lowPt_Barrel->Fill((*pfJets)[ijet].chargedEmEnergy());
2239  mMuEn_lowPt_Barrel = map_of_MEs[DirName+"/"+"MuEn_lowPt_Barrel"]; if (mMuEn_lowPt_Barrel && mMuEn_lowPt_Barrel->getRootObject()) mMuEn_lowPt_Barrel->Fill((*pfJets)[ijet].chargedMuEnergy());
2240  mChMultiplicity_lowPt_Barrel = map_of_MEs[DirName+"/"+"ChMultiplicity_lowPt_Barrel"]; if(mChMultiplicity_lowPt_Barrel && mChMultiplicity_lowPt_Barrel->getRootObject()) mChMultiplicity_lowPt_Barrel->Fill((*pfJets)[ijet].chargedMultiplicity());
2241  mNeutMultiplicity_lowPt_Barrel = map_of_MEs[DirName+"/"+"NeutMultiplicity_lowPt_Barrel"]; if(mNeutMultiplicity_lowPt_Barrel && mNeutMultiplicity_lowPt_Barrel->getRootObject()) mNeutMultiplicity_lowPt_Barrel->Fill((*pfJets)[ijet].neutralMultiplicity());
2242  mMuMultiplicity_lowPt_Barrel = map_of_MEs[DirName+"/"+"MuMultiplicity_lowPt_Barrel"]; if(mMuMultiplicity_lowPt_Barrel && mMuMultiplicity_lowPt_Barrel->getRootObject()) mMuMultiplicity_lowPt_Barrel->Fill((*pfJets)[ijet].muonMultiplicity());
2243  }
2244  if (correctedJet.pt()>50. && correctedJet.pt()<=140.) {
2245  //mAxis2_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_Barrel"];if(mAxis2_mediumPt_Barrel && mAxis2_mediumPt_Barrel->getRootObject()) mAxis2_mediumPt_Barrel->Fill(QGaxis2);
2246  //mpTD_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_Barrel"]; if(mpTD_mediumPt_Barrel && mpTD_mediumPt_Barrel->getRootObject()) mpTD_mediumPt_Barrel->Fill(QGptD);
2247  //mMultiplicityQG_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_Barrel"]; if(mMultiplicityQG_mediumPt_Barrel && mMultiplicityQG_mediumPt_Barrel->getRootObject()) mMultiplicityQG_mediumPt_Barrel->Fill(QGmulti);
2248  //mqgLikelihood_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_Barrel"]; if(mqgLikelihood_mediumPt_Barrel && mqgLikelihood_mediumPt_Barrel->getRootObject()) mqgLikelihood_mediumPt_Barrel->Fill(QGLikelihood);
2249  mMass_mediumPt_Barrel=map_of_MEs[DirName+"/"+"JetMass_mediumPt_Barrel"]; if(mMass_mediumPt_Barrel && mMass_mediumPt_Barrel->getRootObject())mMass_mediumPt_Barrel->Fill((*pfJets)[ijet].mass());
2250  mMVAPUJIDDiscriminant_mediumPt_Barrel=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_Barrel"]; if(mMVAPUJIDDiscriminant_mediumPt_Barrel && mMVAPUJIDDiscriminant_mediumPt_Barrel->getRootObject()) mMVAPUJIDDiscriminant_mediumPt_Barrel->Fill(puidmva);
2251  mCutPUJIDDiscriminant_mediumPt_Barrel=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_mediumPt_Barrel"]; if(mCutPUJIDDiscriminant_mediumPt_Barrel && mCutPUJIDDiscriminant_mediumPt_Barrel->getRootObject()) mCutPUJIDDiscriminant_mediumPt_Barrel->Fill(puidcut);
2252  mCHFrac_mediumPt_Barrel = map_of_MEs[DirName+"/"+"CHFrac_mediumPt_Barrel"]; if (mCHFrac_mediumPt_Barrel && mCHFrac_mediumPt_Barrel->getRootObject()) mCHFrac_mediumPt_Barrel->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2253  mNHFrac_mediumPt_Barrel = map_of_MEs[DirName+"/"+"NHFrac_mediumPt_Barrel"]; if (mNHFrac_mediumPt_Barrel && mNHFrac_mediumPt_Barrel->getRootObject()) mNHFrac_mediumPt_Barrel->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2254  mPhFrac_mediumPt_Barrel = map_of_MEs[DirName+"/"+"PhFrac_mediumPt_Barrel"]; if (mPhFrac_mediumPt_Barrel && mPhFrac_mediumPt_Barrel->getRootObject()) mPhFrac_mediumPt_Barrel->Fill((*pfJets)[ijet].neutralEmEnergyFraction());
2255  mCHEn_mediumPt_Barrel = map_of_MEs[DirName+"/"+"CHEn_mediumPt_Barrel"]; if (mCHEn_mediumPt_Barrel && mCHEn_mediumPt_Barrel->getRootObject()) mCHEn_mediumPt_Barrel->Fill((*pfJets)[ijet].chargedHadronEnergy());
2256  mNHEn_mediumPt_Barrel = map_of_MEs[DirName+"/"+"NHEn_mediumPt_Barrel"]; if (mNHEn_mediumPt_Barrel && mNHEn_mediumPt_Barrel->getRootObject()) mNHEn_mediumPt_Barrel->Fill((*pfJets)[ijet].neutralHadronEnergy());
2257  mPhEn_mediumPt_Barrel = map_of_MEs[DirName+"/"+"PhEn_mediumPt_Barrel"]; if (mPhEn_mediumPt_Barrel && mPhEn_mediumPt_Barrel->getRootObject()) mPhEn_mediumPt_Barrel->Fill((*pfJets)[ijet].neutralEmEnergy());
2258  mElEn_mediumPt_Barrel = map_of_MEs[DirName+"/"+"ElEn_mediumPt_Barrel"]; if (mElEn_mediumPt_Barrel && mElEn_mediumPt_Barrel->getRootObject()) mElEn_mediumPt_Barrel->Fill((*pfJets)[ijet].chargedEmEnergy());
2259  mMuEn_mediumPt_Barrel = map_of_MEs[DirName+"/"+"MuEn_mediumPt_Barrel"]; if (mMuEn_mediumPt_Barrel && mMuEn_mediumPt_Barrel->getRootObject()) mMuEn_mediumPt_Barrel->Fill((*pfJets)[ijet].chargedMuEnergy());
2260  mChMultiplicity_mediumPt_Barrel = map_of_MEs[DirName+"/"+"ChMultiplicity_mediumPt_Barrel"]; if(mChMultiplicity_mediumPt_Barrel && mChMultiplicity_mediumPt_Barrel->getRootObject()) mChMultiplicity_mediumPt_Barrel->Fill((*pfJets)[ijet].chargedMultiplicity());
2261  mNeutMultiplicity_mediumPt_Barrel = map_of_MEs[DirName+"/"+"NeutMultiplicity_mediumPt_Barrel"]; if(mNeutMultiplicity_mediumPt_Barrel && mNeutMultiplicity_mediumPt_Barrel->getRootObject()) mNeutMultiplicity_mediumPt_Barrel->Fill((*pfJets)[ijet].neutralMultiplicity());
2262  mMuMultiplicity_mediumPt_Barrel = map_of_MEs[DirName+"/"+"MuMultiplicity_mediumPt_Barrel"]; if(mMuMultiplicity_mediumPt_Barrel && mMuMultiplicity_mediumPt_Barrel->getRootObject()) mMuMultiplicity_mediumPt_Barrel->Fill((*pfJets)[ijet].muonMultiplicity());
2263  }
2264  if (correctedJet.pt()>140.) {
2265  //mAxis2_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_Barrel"];if(mAxis2_highPt_Barrel && mAxis2_highPt_Barrel->getRootObject()) mAxis2_highPt_Barrel->Fill(QGaxis2);
2266  //mpTD_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_highPt_Barrel"]; if(mpTD_highPt_Barrel && mpTD_highPt_Barrel->getRootObject()) mpTD_highPt_Barrel->Fill(QGptD);
2267  //mMultiplicityQG_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_Barrel"]; if(mMultiplicityQG_highPt_Barrel && mMultiplicityQG_highPt_Barrel->getRootObject()) mMultiplicityQG_highPt_Barrel->Fill(QGmulti);
2268  //mqgLikelihood_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_Barrel"]; if(mqgLikelihood_highPt_Barrel && mqgLikelihood_highPt_Barrel->getRootObject()) mqgLikelihood_highPt_Barrel->Fill(QGLikelihood);
2269  mMass_highPt_Barrel=map_of_MEs[DirName+"/"+"JetMass_highPt_Barrel"]; if(mMass_highPt_Barrel && mMass_highPt_Barrel->getRootObject())mMass_highPt_Barrel->Fill((*pfJets)[ijet].mass());
2270  mMVAPUJIDDiscriminant_highPt_Barrel=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_highPt_Barrel"]; if(mMVAPUJIDDiscriminant_highPt_Barrel && mMVAPUJIDDiscriminant_highPt_Barrel->getRootObject()) mMVAPUJIDDiscriminant_highPt_Barrel->Fill(puidmva);
2271  mCutPUJIDDiscriminant_highPt_Barrel=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_highPt_Barrel"]; if(mCutPUJIDDiscriminant_highPt_Barrel && mCutPUJIDDiscriminant_highPt_Barrel->getRootObject()) mCutPUJIDDiscriminant_highPt_Barrel->Fill(puidcut);
2272  mCHFrac_highPt_Barrel = map_of_MEs[DirName+"/"+"CHFrac_highPt_Barrel"]; if (mCHFrac_highPt_Barrel && mCHFrac_highPt_Barrel->getRootObject()) mCHFrac_highPt_Barrel->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2273  mNHFrac_highPt_Barrel = map_of_MEs[DirName+"/"+"NHFrac_highPt_Barrel"]; if (mNHFrac_highPt_Barrel && mNHFrac_highPt_Barrel->getRootObject()) mNHFrac_highPt_Barrel->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2274  mPhFrac_highPt_Barrel = map_of_MEs[DirName+"/"+"PhFrac_highPt_Barrel"]; if (mPhFrac_highPt_Barrel && mPhFrac_highPt_Barrel->getRootObject()) mPhFrac_highPt_Barrel->Fill((*pfJets)[ijet].neutralEmEnergyFraction());
2275  mCHEn_highPt_Barrel = map_of_MEs[DirName+"/"+"CHEn_highPt_Barrel"]; if (mCHEn_highPt_Barrel && mCHEn_highPt_Barrel->getRootObject()) mCHEn_highPt_Barrel->Fill((*pfJets)[ijet].chargedHadronEnergy());
2276  mNHEn_highPt_Barrel = map_of_MEs[DirName+"/"+"NHEn_highPt_Barrel"]; if (mNHEn_highPt_Barrel && mNHEn_highPt_Barrel->getRootObject()) mNHEn_highPt_Barrel->Fill((*pfJets)[ijet].neutralHadronEnergy());
2277  mPhEn_highPt_Barrel = map_of_MEs[DirName+"/"+"PhEn_highPt_Barrel"]; if (mPhEn_highPt_Barrel && mPhEn_highPt_Barrel->getRootObject()) mPhEn_highPt_Barrel->Fill((*pfJets)[ijet].neutralEmEnergy());
2278  mElEn_highPt_Barrel = map_of_MEs[DirName+"/"+"ElEn_highPt_Barrel"]; if (mElEn_highPt_Barrel && mElEn_highPt_Barrel->getRootObject()) mElEn_highPt_Barrel->Fill((*pfJets)[ijet].chargedEmEnergy());
2279  mMuEn_highPt_Barrel = map_of_MEs[DirName+"/"+"MuEn_highPt_Barrel"]; if (mMuEn_highPt_Barrel && mMuEn_highPt_Barrel->getRootObject()) mMuEn_highPt_Barrel->Fill((*pfJets)[ijet].chargedMuEnergy());
2280  mChMultiplicity_highPt_Barrel = map_of_MEs[DirName+"/"+"ChMultiplicity_highPt_Barrel"]; if(mChMultiplicity_highPt_Barrel && mChMultiplicity_highPt_Barrel->getRootObject()) mChMultiplicity_highPt_Barrel->Fill((*pfJets)[ijet].chargedMultiplicity());
2281  mNeutMultiplicity_highPt_Barrel = map_of_MEs[DirName+"/"+"NeutMultiplicity_highPt_Barrel"]; if(mNeutMultiplicity_highPt_Barrel && mNeutMultiplicity_highPt_Barrel->getRootObject()) mNeutMultiplicity_highPt_Barrel->Fill((*pfJets)[ijet].neutralMultiplicity());
2282  mMuMultiplicity_highPt_Barrel = map_of_MEs[DirName+"/"+"MuMultiplicity_highPt_Barrel"]; if(mMuMultiplicity_highPt_Barrel && mMuMultiplicity_highPt_Barrel->getRootObject()) mMuMultiplicity_highPt_Barrel->Fill((*pfJets)[ijet].muonMultiplicity());
2283  }
2284  mCHFracVSpT_Barrel = map_of_MEs[DirName+"/"+"CHFracVSpT_Barrel"]; if(mCHFracVSpT_Barrel && mCHFracVSpT_Barrel->getRootObject()) mCHFracVSpT_Barrel->Fill(correctedJet.pt(),(*pfJets)[ijet].chargedHadronEnergyFraction());
2285  mNHFracVSpT_Barrel = map_of_MEs[DirName+"/"+"NHFracVSpT_Barrel"];if (mNHFracVSpT_Barrel && mNHFracVSpT_Barrel->getRootObject()) mNHFracVSpT_Barrel->Fill(correctedJet.pt(),(*pfJets)[ijet].neutralHadronEnergyFraction());
2286  mPhFracVSpT_Barrel = map_of_MEs[DirName+"/"+"PhFracVSpT_Barrel"];if (mPhFracVSpT_Barrel && mPhFracVSpT_Barrel->getRootObject()) mPhFracVSpT_Barrel->Fill(correctedJet.pt(),(*pfJets)[ijet].neutralEmEnergyFraction());
2287  }else if(fabs(correctedJet.eta()) <= 3) {
2288  //fractions for endcap
2289  if (correctedJet.pt()<=50.) {
2290  //mAxis2_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_EndCap"];if(mAxis2_lowPt_EndCap && mAxis2_lowPt_EndCap->getRootObject()) mAxis2_lowPt_EndCap->Fill(QGaxis2);
2291  //mpTD_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_EndCap"]; if(mpTD_lowPt_EndCap && mpTD_lowPt_EndCap->getRootObject()) mpTD_lowPt_EndCap->Fill(QGptD);
2292  //mMultiplicityQG_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_EndCap"]; if(mMultiplicityQG_lowPt_EndCap && mMultiplicityQG_lowPt_EndCap->getRootObject()) mMultiplicityQG_lowPt_EndCap->Fill(QGmulti);
2293  //mqgLikelihood_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_EndCap"]; if(mqgLikelihood_lowPt_EndCap && mqgLikelihood_lowPt_EndCap->getRootObject()) mqgLikelihood_lowPt_EndCap->Fill(QGLikelihood);
2294  mMass_lowPt_EndCap=map_of_MEs[DirName+"/"+"JetMass_lowPt_EndCap"]; if(mMass_lowPt_EndCap && mMass_lowPt_EndCap->getRootObject())mMass_lowPt_EndCap->Fill((*pfJets)[ijet].mass());
2295  mMVAPUJIDDiscriminant_lowPt_EndCap=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_lowPt_EndCap"]; if(mMVAPUJIDDiscriminant_lowPt_EndCap && mMVAPUJIDDiscriminant_lowPt_EndCap->getRootObject()) mMVAPUJIDDiscriminant_lowPt_EndCap->Fill(puidmva);
2296  mCutPUJIDDiscriminant_lowPt_EndCap=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_lowPt_EndCap"]; if(mCutPUJIDDiscriminant_lowPt_EndCap && mCutPUJIDDiscriminant_lowPt_EndCap->getRootObject()) mCutPUJIDDiscriminant_lowPt_EndCap->Fill(puidcut);
2297  mCHFrac_lowPt_EndCap = map_of_MEs[DirName+"/"+"CHFrac_lowPt_EndCap"]; if (mCHFrac_lowPt_EndCap && mCHFrac_lowPt_EndCap->getRootObject()) mCHFrac_lowPt_EndCap->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2298  mNHFrac_lowPt_EndCap = map_of_MEs[DirName+"/"+"NHFrac_lowPt_EndCap"]; if (mNHFrac_lowPt_EndCap && mNHFrac_lowPt_EndCap->getRootObject()) mNHFrac_lowPt_EndCap->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2299  mPhFrac_lowPt_EndCap = map_of_MEs[DirName+"/"+"PhFrac_lowPt_EndCap"]; if (mPhFrac_lowPt_EndCap && mPhFrac_lowPt_EndCap->getRootObject()) mPhFrac_lowPt_EndCap->Fill((*pfJets)[ijet].neutralEmEnergyFraction());
2300  mCHEn_lowPt_EndCap = map_of_MEs[DirName+"/"+"CHEn_lowPt_EndCap"]; if (mCHEn_lowPt_EndCap && mCHEn_lowPt_EndCap->getRootObject()) mCHEn_lowPt_EndCap->Fill((*pfJets)[ijet].chargedHadronEnergy());
2301  mNHEn_lowPt_EndCap = map_of_MEs[DirName+"/"+"NHEn_lowPt_EndCap"]; if (mNHEn_lowPt_EndCap && mNHEn_lowPt_EndCap->getRootObject()) mNHEn_lowPt_EndCap->Fill((*pfJets)[ijet].neutralHadronEnergy());
2302  mPhEn_lowPt_EndCap = map_of_MEs[DirName+"/"+"PhEn_lowPt_EndCap"]; if (mPhEn_lowPt_EndCap && mPhEn_lowPt_EndCap->getRootObject()) mPhEn_lowPt_EndCap->Fill((*pfJets)[ijet].neutralEmEnergy());
2303  mElEn_lowPt_EndCap = map_of_MEs[DirName+"/"+"ElEn_lowPt_EndCap"]; if (mElEn_lowPt_EndCap && mElEn_lowPt_EndCap->getRootObject()) mElEn_lowPt_EndCap->Fill((*pfJets)[ijet].chargedEmEnergy());
2304  mMuEn_lowPt_EndCap = map_of_MEs[DirName+"/"+"MuEn_lowPt_EndCap"]; if (mMuEn_lowPt_EndCap && mMuEn_lowPt_EndCap->getRootObject()) mMuEn_lowPt_EndCap->Fill((*pfJets)[ijet].chargedMuEnergy());
2305  mChMultiplicity_lowPt_EndCap = map_of_MEs[DirName+"/"+"ChMultiplicity_lowPt_EndCap"]; if(mChMultiplicity_lowPt_EndCap && mChMultiplicity_lowPt_EndCap->getRootObject()) mChMultiplicity_lowPt_EndCap->Fill((*pfJets)[ijet].chargedMultiplicity());
2306  mNeutMultiplicity_lowPt_EndCap = map_of_MEs[DirName+"/"+"NeutMultiplicity_lowPt_EndCap"]; if(mNeutMultiplicity_lowPt_EndCap && mNeutMultiplicity_lowPt_EndCap->getRootObject()) mNeutMultiplicity_lowPt_EndCap->Fill((*pfJets)[ijet].neutralMultiplicity());
2307  mMuMultiplicity_lowPt_EndCap = map_of_MEs[DirName+"/"+"MuMultiplicity_lowPt_EndCap"]; if(mMuMultiplicity_lowPt_EndCap && mMuMultiplicity_lowPt_EndCap->getRootObject()) mMuMultiplicity_lowPt_EndCap->Fill((*pfJets)[ijet].muonMultiplicity());
2308  }
2309  if (correctedJet.pt()>50. && correctedJet.pt()<=140.) {
2310  //mAxis2_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_EndCap"];if(mAxis2_mediumPt_EndCap && mAxis2_mediumPt_EndCap->getRootObject()) mAxis2_mediumPt_EndCap->Fill(QGaxis2);
2311  //mpTD_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_EndCap"]; if(mpTD_mediumPt_EndCap && mpTD_mediumPt_EndCap->getRootObject()) mpTD_mediumPt_EndCap->Fill(QGptD);
2312  //mMultiplicityQG_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_EndCap"]; if(mMultiplicityQG_mediumPt_EndCap && mMultiplicityQG_mediumPt_EndCap->getRootObject()) mMultiplicityQG_mediumPt_EndCap->Fill(QGmulti);
2313  //mqgLikelihood_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_EndCap"]; if(mqgLikelihood_mediumPt_EndCap && mqgLikelihood_mediumPt_EndCap->getRootObject()) mqgLikelihood_mediumPt_EndCap->Fill(QGLikelihood);
2314  mMass_mediumPt_EndCap=map_of_MEs[DirName+"/"+"JetMass_mediumPt_EndCap"]; if(mMass_mediumPt_EndCap && mMass_mediumPt_EndCap->getRootObject())mMass_mediumPt_EndCap->Fill((*pfJets)[ijet].mass());
2315  mMVAPUJIDDiscriminant_mediumPt_EndCap=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_EndCap"]; if(mMVAPUJIDDiscriminant_mediumPt_EndCap && mMVAPUJIDDiscriminant_mediumPt_EndCap->getRootObject()) mMVAPUJIDDiscriminant_mediumPt_EndCap->Fill(puidmva);
2316  mCutPUJIDDiscriminant_mediumPt_EndCap=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_mediumPt_EndCap"]; if(mCutPUJIDDiscriminant_mediumPt_EndCap && mCutPUJIDDiscriminant_mediumPt_EndCap->getRootObject()) mCutPUJIDDiscriminant_mediumPt_EndCap->Fill(puidcut);
2317  mCHFrac_mediumPt_EndCap = map_of_MEs[DirName+"/"+"CHFrac_mediumPt_EndCap"]; if (mCHFrac_mediumPt_EndCap && mCHFrac_mediumPt_EndCap->getRootObject()) mCHFrac_mediumPt_EndCap->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2318  mNHFrac_mediumPt_EndCap = map_of_MEs[DirName+"/"+"NHFrac_mediumPt_EndCap"]; if (mNHFrac_mediumPt_EndCap && mNHFrac_mediumPt_EndCap->getRootObject()) mNHFrac_mediumPt_EndCap->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2319  mPhFrac_mediumPt_EndCap = map_of_MEs[DirName+"/"+"PhFrac_mediumPt_EndCap"]; if (mPhFrac_mediumPt_EndCap && mPhFrac_mediumPt_EndCap->getRootObject()) mPhFrac_mediumPt_EndCap->Fill((*pfJets)[ijet].neutralEmEnergyFraction());
2320  mCHEn_mediumPt_EndCap = map_of_MEs[DirName+"/"+"CHEn_mediumPt_EndCap"]; if (mCHEn_mediumPt_EndCap && mCHEn_mediumPt_EndCap->getRootObject()) mCHEn_mediumPt_EndCap->Fill((*pfJets)[ijet].chargedHadronEnergy());
2321  mNHEn_mediumPt_EndCap = map_of_MEs[DirName+"/"+"NHEn_mediumPt_EndCap"]; if (mNHEn_mediumPt_EndCap && mNHEn_mediumPt_EndCap->getRootObject()) mNHEn_mediumPt_EndCap->Fill((*pfJets)[ijet].neutralHadronEnergy());
2322  mPhEn_mediumPt_EndCap = map_of_MEs[DirName+"/"+"PhEn_mediumPt_EndCap"]; if (mPhEn_mediumPt_EndCap && mPhEn_mediumPt_EndCap->getRootObject()) mPhEn_mediumPt_EndCap->Fill((*pfJets)[ijet].neutralEmEnergy());
2323  mElEn_mediumPt_EndCap = map_of_MEs[DirName+"/"+"ElEn_mediumPt_EndCap"]; if (mElEn_mediumPt_EndCap && mElEn_mediumPt_EndCap->getRootObject()) mElEn_mediumPt_EndCap->Fill((*pfJets)[ijet].chargedEmEnergy());
2324  mMuEn_mediumPt_EndCap = map_of_MEs[DirName+"/"+"MuEn_mediumPt_EndCap"]; if (mMuEn_mediumPt_EndCap && mMuEn_mediumPt_EndCap->getRootObject()) mMuEn_mediumPt_EndCap->Fill((*pfJets)[ijet].chargedMuEnergy());
2325  mChMultiplicity_mediumPt_EndCap = map_of_MEs[DirName+"/"+"ChMultiplicity_mediumPt_EndCap"]; if(mChMultiplicity_mediumPt_EndCap && mChMultiplicity_mediumPt_EndCap->getRootObject()) mChMultiplicity_mediumPt_EndCap->Fill((*pfJets)[ijet].chargedMultiplicity());
2326  mNeutMultiplicity_mediumPt_EndCap = map_of_MEs[DirName+"/"+"NeutMultiplicity_mediumPt_EndCap"]; if(mNeutMultiplicity_mediumPt_EndCap && mNeutMultiplicity_mediumPt_EndCap->getRootObject()) mNeutMultiplicity_mediumPt_EndCap->Fill((*pfJets)[ijet].neutralMultiplicity());
2327  mMuMultiplicity_mediumPt_EndCap = map_of_MEs[DirName+"/"+"MuMultiplicity_mediumPt_EndCap"]; if(mMuMultiplicity_mediumPt_EndCap && mMuMultiplicity_mediumPt_EndCap->getRootObject()) mMuMultiplicity_mediumPt_EndCap->Fill((*pfJets)[ijet].muonMultiplicity());
2328  }
2329  if (correctedJet.pt()>140.) {
2330  //mAxis2_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_EndCap"];if(mAxis2_highPt_EndCap && mAxis2_highPt_EndCap->getRootObject()) mAxis2_highPt_EndCap->Fill(QGaxis2);
2331  //mpTD_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_highPt_EndCap"]; if(mpTD_highPt_EndCap && mpTD_highPt_EndCap->getRootObject()) mpTD_highPt_EndCap->Fill(QGptD);
2332  //mMultiplicityQG_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_EndCap"]; if(mMultiplicityQG_highPt_EndCap && mMultiplicityQG_highPt_EndCap->getRootObject()) mMultiplicityQG_highPt_EndCap->Fill(QGmulti);
2333  //mqgLikelihood_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_EndCap"]; if(mqgLikelihood_highPt_EndCap && mqgLikelihood_highPt_EndCap->getRootObject()) mqgLikelihood_highPt_EndCap->Fill(QGLikelihood);
2334  mMass_highPt_EndCap=map_of_MEs[DirName+"/"+"JetMass_highPt_EndCap"]; if(mMass_highPt_EndCap && mMass_highPt_EndCap->getRootObject())mMass_highPt_EndCap->Fill((*pfJets)[ijet].mass());
2335  mMVAPUJIDDiscriminant_highPt_EndCap=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_highPt_EndCap"]; if(mMVAPUJIDDiscriminant_highPt_EndCap && mMVAPUJIDDiscriminant_highPt_EndCap->getRootObject()) mMVAPUJIDDiscriminant_highPt_EndCap->Fill(puidmva);
2336  mCutPUJIDDiscriminant_highPt_EndCap=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_highPt_EndCap"]; if(mCutPUJIDDiscriminant_highPt_EndCap && mCutPUJIDDiscriminant_highPt_EndCap->getRootObject()) mCutPUJIDDiscriminant_highPt_EndCap->Fill(puidcut);
2337  mCHFrac_highPt_EndCap = map_of_MEs[DirName+"/"+"CHFrac_highPt_EndCap"]; if (mCHFrac_highPt_EndCap && mCHFrac_highPt_EndCap->getRootObject()) mCHFrac_highPt_EndCap->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2338  mNHFrac_highPt_EndCap = map_of_MEs[DirName+"/"+"NHFrac_highPt_EndCap"]; if (mNHFrac_highPt_EndCap && mNHFrac_highPt_EndCap->getRootObject()) mNHFrac_highPt_EndCap->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2339  mPhFrac_highPt_EndCap = map_of_MEs[DirName+"/"+"PhFrac_highPt_EndCap"]; if (mPhFrac_highPt_EndCap && mPhFrac_highPt_EndCap->getRootObject()) mPhFrac_highPt_EndCap->Fill((*pfJets)[ijet].neutralEmEnergyFraction());
2340  mCHEn_highPt_EndCap = map_of_MEs[DirName+"/"+"CHEn_highPt_EndCap"]; if (mCHEn_highPt_EndCap && mCHEn_highPt_EndCap->getRootObject()) mCHEn_highPt_EndCap->Fill((*pfJets)[ijet].chargedHadronEnergy());
2341  mNHEn_highPt_EndCap = map_of_MEs[DirName+"/"+"NHEn_highPt_EndCap"]; if (mNHEn_highPt_EndCap && mNHEn_highPt_EndCap->getRootObject()) mNHEn_highPt_EndCap->Fill((*pfJets)[ijet].neutralHadronEnergy());
2342  mPhEn_highPt_EndCap = map_of_MEs[DirName+"/"+"PhEn_highPt_EndCap"]; if (mPhEn_highPt_EndCap && mPhEn_highPt_EndCap->getRootObject()) mPhEn_highPt_EndCap->Fill((*pfJets)[ijet].neutralEmEnergy());
2343  mElEn_highPt_EndCap = map_of_MEs[DirName+"/"+"ElEn_highPt_EndCap"]; if (mElEn_highPt_EndCap && mElEn_highPt_EndCap->getRootObject()) mElEn_highPt_EndCap->Fill((*pfJets)[ijet].chargedEmEnergy());
2344  mMuEn_highPt_EndCap = map_of_MEs[DirName+"/"+"MuEn_highPt_EndCap"]; if (mMuEn_highPt_EndCap && mMuEn_highPt_EndCap->getRootObject()) mMuEn_highPt_EndCap->Fill((*pfJets)[ijet].chargedMuEnergy());
2345  mChMultiplicity_highPt_EndCap = map_of_MEs[DirName+"/"+"ChMultiplicity_highPt_EndCap"]; if(mChMultiplicity_highPt_EndCap && mChMultiplicity_highPt_EndCap->getRootObject()) mChMultiplicity_highPt_EndCap->Fill((*pfJets)[ijet].chargedMultiplicity());
2346  mNeutMultiplicity_highPt_EndCap = map_of_MEs[DirName+"/"+"NeutMultiplicity_highPt_EndCap"]; if(mNeutMultiplicity_highPt_EndCap && mNeutMultiplicity_highPt_EndCap->getRootObject()) mNeutMultiplicity_highPt_EndCap->Fill((*pfJets)[ijet].neutralMultiplicity());
2347  mMuMultiplicity_highPt_EndCap = map_of_MEs[DirName+"/"+"MuMultiplicity_highPt_EndCap"]; if(mMuMultiplicity_highPt_EndCap && mMuMultiplicity_highPt_EndCap->getRootObject()) mMuMultiplicity_highPt_EndCap->Fill((*pfJets)[ijet].muonMultiplicity());
2348  }
2349  mCHFracVSpT_EndCap = map_of_MEs[DirName+"/"+"CHFracVSpT_EndCap"]; if(mCHFracVSpT_EndCap && mCHFracVSpT_EndCap->getRootObject()) mCHFracVSpT_EndCap->Fill(correctedJet.pt(),(*pfJets)[ijet].chargedHadronEnergyFraction());
2350  mNHFracVSpT_EndCap = map_of_MEs[DirName+"/"+"NHFracVSpT_EndCap"];if (mNHFracVSpT_EndCap && mNHFracVSpT_EndCap->getRootObject()) mNHFracVSpT_EndCap->Fill(correctedJet.pt(),(*pfJets)[ijet].neutralHadronEnergyFraction());
2351  mPhFracVSpT_EndCap = map_of_MEs[DirName+"/"+"PhFracVSpT_EndCap"];if (mPhFracVSpT_EndCap && mPhFracVSpT_EndCap->getRootObject()) mPhFracVSpT_EndCap->Fill(correctedJet.pt(),(*pfJets)[ijet].neutralEmEnergyFraction());
2352  }else{
2353  mHFHFracVSpT_Forward = map_of_MEs[DirName+"/"+"HFHFracVSpT_Forward"]; if (mHFHFracVSpT_Forward && mHFHFracVSpT_Forward->getRootObject()) mHFHFracVSpT_Forward->Fill(correctedJet.pt(),(*pfJets)[ijet].HFHadronEnergyFraction ());
2354  mHFEFracVSpT_Forward = map_of_MEs[DirName+"/"+"HFEFracVSpT_Forward"]; if (mHFEFracVSpT_Forward && mHFEFracVSpT_Forward->getRootObject()) mHFEFracVSpT_Forward->Fill (correctedJet.pt(),(*pfJets)[ijet].HFEMEnergyFraction ());
2355  //fractions
2356  if (correctedJet.pt()<=50.) {
2357  //mAxis2_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_Forward"];if(mAxis2_lowPt_Forward && mAxis2_lowPt_Forward->getRootObject()) mAxis2_lowPt_Forward->Fill(QGaxis2);
2358  //mpTD_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_Forward"]; if(mpTD_lowPt_Forward && mpTD_lowPt_Forward->getRootObject()) mpTD_lowPt_Forward->Fill(QGptD);
2359  //mMultiplicityQG_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_Forward"]; if(mMultiplicityQG_lowPt_Forward && mMultiplicityQG_lowPt_Forward->getRootObject()) mMultiplicityQG_lowPt_Forward->Fill(QGmulti);
2360  //mqgLikelihood_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_Forward"]; if(mqgLikelihood_lowPt_Forward && mqgLikelihood_lowPt_Forward->getRootObject()) mqgLikelihood_lowPt_Forward->Fill(QGLikelihood);
2361  mMass_lowPt_Forward=map_of_MEs[DirName+"/"+"JetMass_lowPt_Forward"]; if(mMass_lowPt_Forward && mMass_lowPt_Forward->getRootObject())mMass_lowPt_Forward->Fill((*pfJets)[ijet].mass());
2362  mMVAPUJIDDiscriminant_lowPt_Forward=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_lowPt_Forward"]; if(mMVAPUJIDDiscriminant_lowPt_Forward && mMVAPUJIDDiscriminant_lowPt_Forward->getRootObject()) mMVAPUJIDDiscriminant_lowPt_Forward->Fill(puidmva);
2363  mCutPUJIDDiscriminant_lowPt_Forward=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_lowPt_Forward"]; if(mCutPUJIDDiscriminant_lowPt_Forward && mCutPUJIDDiscriminant_lowPt_Forward->getRootObject()) mCutPUJIDDiscriminant_lowPt_Forward->Fill(puidcut);
2364  mHFEFrac_lowPt_Forward = map_of_MEs[DirName+"/"+"HFEFrac_lowPt_Forward"]; if(mHFEFrac_lowPt_Forward && mHFEFrac_lowPt_Forward->getRootObject()) mHFEFrac_lowPt_Forward->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2365  mHFHFrac_lowPt_Forward = map_of_MEs[DirName+"/"+"HFHFrac_lowPt_Forward"]; if(mHFHFrac_lowPt_Forward && mHFHFrac_lowPt_Forward->getRootObject()) mHFHFrac_lowPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2366  mHFEEn_lowPt_Forward = map_of_MEs[DirName+"/"+"HFEEn_lowPt_Forward"]; if(mHFEEn_lowPt_Forward && mHFEEn_lowPt_Forward->getRootObject()) mHFEEn_lowPt_Forward->Fill((*pfJets)[ijet].HFEMEnergy());
2367  mHFHEn_lowPt_Forward = map_of_MEs[DirName+"/"+"HFHEn_lowPt_Forward"]; if(mHFHEn_lowPt_Forward && mHFHEn_lowPt_Forward->getRootObject()) mHFHEn_lowPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergy());
2368  mNeutMultiplicity_lowPt_Forward = map_of_MEs[DirName+"/"+"NeutMultiplicity_lowPt_Forward"]; if(mNeutMultiplicity_lowPt_Forward && mNeutMultiplicity_lowPt_Forward->getRootObject()) mNeutMultiplicity_lowPt_Forward->Fill((*pfJets)[ijet].neutralMultiplicity());
2369  }
2370  if (correctedJet.pt()>50. && correctedJet.pt()<=140.) {
2371  //mAxis2_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_Forward"];if(mAxis2_mediumPt_Forward && mAxis2_mediumPt_Forward->getRootObject()) mAxis2_mediumPt_Forward->Fill(QGaxis2);
2372  //mpTD_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_Forward"]; if(mpTD_mediumPt_Forward && mpTD_mediumPt_Forward->getRootObject()) mpTD_mediumPt_Forward->Fill(QGptD);
2373  //mMultiplicityQG_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_Forward"]; if(mMultiplicityQG_mediumPt_Forward && mMultiplicityQG_mediumPt_Forward->getRootObject()) mMultiplicityQG_mediumPt_Forward->Fill(QGmulti);
2374  //mqgLikelihood_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_Forward"]; if(mqgLikelihood_mediumPt_Forward && mqgLikelihood_mediumPt_Forward->getRootObject()) mqgLikelihood_mediumPt_Forward->Fill(QGLikelihood);
2375  mMass_mediumPt_Forward=map_of_MEs[DirName+"/"+"JetMass_mediumPt_Forward"]; if(mMass_mediumPt_Forward && mMass_mediumPt_Forward->getRootObject())mMass_mediumPt_Forward->Fill((*pfJets)[ijet].mass());
2376  mMVAPUJIDDiscriminant_mediumPt_Forward=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_mediumPt_Forward"]; if(mMVAPUJIDDiscriminant_mediumPt_Forward && mMVAPUJIDDiscriminant_mediumPt_Forward->getRootObject()) mMVAPUJIDDiscriminant_mediumPt_Forward->Fill(puidmva);
2377  mCutPUJIDDiscriminant_mediumPt_Forward=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_mediumPt_Forward"]; if(mCutPUJIDDiscriminant_mediumPt_Forward && mCutPUJIDDiscriminant_mediumPt_Forward->getRootObject()) mCutPUJIDDiscriminant_mediumPt_Forward->Fill(puidcut);
2378  mHFEFrac_mediumPt_Forward = map_of_MEs[DirName+"/"+"HFEFrac_mediumPt_Forward"]; if(mHFEFrac_mediumPt_Forward && mHFEFrac_mediumPt_Forward->getRootObject()) mHFEFrac_mediumPt_Forward->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2379  mHFHFrac_mediumPt_Forward = map_of_MEs[DirName+"/"+"HFHFrac_mediumPt_Forward"]; if(mHFHFrac_mediumPt_Forward && mHFHFrac_mediumPt_Forward->getRootObject()) mHFHFrac_mediumPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2380  mHFEEn_mediumPt_Forward = map_of_MEs[DirName+"/"+"HFEEn_mediumPt_Forward"]; if(mHFEEn_mediumPt_Forward && mHFEEn_mediumPt_Forward->getRootObject()) mHFEEn_mediumPt_Forward->Fill((*pfJets)[ijet].HFEMEnergy());
2381  mHFHEn_mediumPt_Forward = map_of_MEs[DirName+"/"+"HFHEn_mediumPt_Forward"]; if(mHFHEn_mediumPt_Forward && mHFHEn_mediumPt_Forward->getRootObject()) mHFHEn_mediumPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergy());
2382  mNeutMultiplicity_mediumPt_Forward = map_of_MEs[DirName+"/"+"NeutMultiplicity_mediumPt_Forward"]; if(mNeutMultiplicity_mediumPt_Forward && mNeutMultiplicity_mediumPt_Forward->getRootObject()) mNeutMultiplicity_mediumPt_Forward->Fill((*pfJets)[ijet].neutralMultiplicity());
2383  }
2384  if (correctedJet.pt()>140.) {
2385  //mAxis2_highPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_Forward"];if(mAxis2_highPt_Forward && mAxis2_highPt_Forward->getRootObject()) mAxis2_highPt_Forward->Fill(QGaxis2);
2386  //mpTD_highPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_highPt_Forward"]; if(mpTD_highPt_Forward && mpTD_highPt_Forward->getRootObject()) mpTD_highPt_Forward->Fill(QGptD);
2387  //mMultiplicityQG_highPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_Forward"]; if(mMultiplicityQG_highPt_Forward && mMultiplicityQG_highPt_Forward->getRootObject()) mMultiplicityQG_highPt_Forward->Fill(QGmulti);
2388  //mqgLikelihood_highPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_Forward"]; if(mqgLikelihood_highPt_Forward && mqgLikelihood_highPt_Forward->getRootObject()) mqgLikelihood_highPt_Forward->Fill(QGLikelihood);
2389  mMass_highPt_Forward=map_of_MEs[DirName+"/"+"JetMass_highPt_Forward"]; if(mMass_highPt_Forward && mMass_highPt_Forward->getRootObject())mMass_highPt_Forward->Fill((*pfJets)[ijet].mass());
2390  mMVAPUJIDDiscriminant_highPt_Forward=map_of_MEs[DirName+"/"+"MVAPUJIDDiscriminant_highPt_Forward"]; if(mMVAPUJIDDiscriminant_highPt_Forward && mMVAPUJIDDiscriminant_highPt_Forward->getRootObject()) mMVAPUJIDDiscriminant_highPt_Forward->Fill(puidmva);
2391  mCutPUJIDDiscriminant_highPt_Forward=map_of_MEs[DirName+"/"+"CutPUJIDDiscriminant_highPt_Forward"]; if(mCutPUJIDDiscriminant_highPt_Forward && mCutPUJIDDiscriminant_highPt_Forward->getRootObject()) mCutPUJIDDiscriminant_highPt_Forward->Fill(puidcut);
2392  mHFEFrac_highPt_Forward = map_of_MEs[DirName+"/"+"HFEFrac_highPt_Forward"]; if(mHFEFrac_highPt_Forward && mHFEFrac_highPt_Forward->getRootObject()) mHFEFrac_highPt_Forward->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2393  mHFHFrac_highPt_Forward = map_of_MEs[DirName+"/"+"HFHFrac_highPt_Forward"]; if(mHFHFrac_highPt_Forward && mHFHFrac_highPt_Forward->getRootObject()) mHFHFrac_highPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2394  mHFEEn_highPt_Forward = map_of_MEs[DirName+"/"+"HFEEn_highPt_Forward"]; if(mHFEEn_highPt_Forward && mHFEEn_highPt_Forward->getRootObject()) mHFEEn_highPt_Forward->Fill((*pfJets)[ijet].HFEMEnergy());
2395  mHFHEn_highPt_Forward = map_of_MEs[DirName+"/"+"HFHEn_highPt_Forward"]; if(mHFHEn_highPt_Forward && mHFHEn_highPt_Forward->getRootObject()) mHFHEn_highPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergy());
2396  mNeutMultiplicity_highPt_Forward = map_of_MEs[DirName+"/"+"NeutMultiplicity_highPt_Forward"]; if(mNeutMultiplicity_highPt_Forward && mNeutMultiplicity_highPt_Forward->getRootObject()) mNeutMultiplicity_highPt_Forward->Fill((*pfJets)[ijet].neutralMultiplicity());
2397  }
2398  }
2399  //OOT plots
2400  /*
2401  if(techTriggerResultBx0 && techTriggerResultBxE && techTriggerResultBxF){
2402  meEta_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"Eta_BXm2BXm1Filled"]; if ( meEta_BXm2BXm1Filled && meEta_BXm2BXm1Filled ->getRootObject()) meEta_BXm2BXm1Filled ->Fill((*pfJets)[ijet].eta());
2403  if(fabs(correctedJet.eta()) <= 1.3) {
2404  mePhFracBarrel_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PhFracBarrel_BXm2BXm1Filled"]; if ( mePhFracBarrel_BXm2BXm1Filled && mePhFracBarrel_BXm2BXm1Filled ->getRootObject()) mePhFracBarrel_BXm2BXm1Filled ->Fill((*pfJets)[ijet].photonEnergyFraction());
2405  meNHFracBarrel_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"NHFracBarrel_BXm2BXm1Filled"]; if ( meNHFracBarrel_BXm2BXm1Filled && meNHFracBarrel_BXm2BXm1Filled ->getRootObject()) meNHFracBarrel_BXm2BXm1Filled ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2406  meCHFracBarrel_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"CHFracBarrel_BXm2BXm1Filled"]; if ( meCHFracBarrel_BXm2BXm1Filled && meCHFracBarrel_BXm2BXm1Filled ->getRootObject()) meCHFracBarrel_BXm2BXm1Filled ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2407  mePtBarrel_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PtBarrel_BXm2BXm1Filled"]; if ( mePtBarrel_BXm2BXm1Filled && mePtBarrel_BXm2BXm1Filled ->getRootObject()) mePtBarrel_BXm2BXm1Filled ->Fill((*pfJets)[ijet].pt());
2408  }else if (correctedJet.eta() > -3.0 && correctedJet.eta() <= -1.3) {
2409  mePhFracEndCapMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PhFracEndCapMinus_BXm2BXm1Filled"]; if ( mePhFracEndCapMinus_BXm2BXm1Filled && mePhFracEndCapMinus_BXm2BXm1Filled ->getRootObject()) mePhFracEndCapMinus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].photonEnergyFraction());
2410  meNHFracEndCapMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"NHFracEndCapMinus_BXm2BXm1Filled"]; if ( meNHFracEndCapMinus_BXm2BXm1Filled && meNHFracEndCapMinus_BXm2BXm1Filled ->getRootObject()) meNHFracEndCapMinus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2411  meCHFracEndCapMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"CHFracEndCapMinus_BXm2BXm1Filled"]; if ( meCHFracEndCapMinus_BXm2BXm1Filled && meCHFracEndCapMinus_BXm2BXm1Filled ->getRootObject()) meCHFracEndCapMinus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2412  mePtEndCapMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PtEndCapMinus_BXm2BXm1Filled"]; if ( mePtEndCapMinus_BXm2BXm1Filled && mePtEndCapMinus_BXm2BXm1Filled ->getRootObject()) mePtEndCapMinus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].pt());
2413  }else if (correctedJet.eta() >= 1.3 && correctedJet.eta() < 3.0) {
2414  mePhFracEndCapPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PhFracEndCapPlus_BXm2BXm1Filled"]; if ( mePhFracEndCapPlus_BXm2BXm1Filled && mePhFracEndCapPlus_BXm2BXm1Filled ->getRootObject()) mePhFracEndCapPlus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].photonEnergyFraction());
2415  meNHFracEndCapPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"NHFracEndCapPlus_BXm2BXm1Filled"]; if ( meNHFracEndCapPlus_BXm2BXm1Filled && meNHFracEndCapPlus_BXm2BXm1Filled ->getRootObject()) meNHFracEndCapPlus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2416  meCHFracEndCapPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"CHFracEndCapPlus_BXm2BXm1Filled"]; if ( meCHFracEndCapPlus_BXm2BXm1Filled && meCHFracEndCapPlus_BXm2BXm1Filled ->getRootObject()) meCHFracEndCapPlus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2417  mePtEndCapPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PtEndCapPlus_BXm2BXm1Filled"]; if ( mePtEndCapPlus_BXm2BXm1Filled && mePtEndCapPlus_BXm2BXm1Filled ->getRootObject()) mePtEndCapPlus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].pt());
2418  }else if (correctedJet.eta() > -5.0 && correctedJet.eta() <= -3.0) {
2419  mePtForwardMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PtForwardMinus_BXm2BXm1Filled"]; if ( mePtForwardMinus_BXm2BXm1Filled && mePtForwardMinus_BXm2BXm1Filled ->getRootObject()) mePtForwardMinus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].pt());
2420  meHFHFracMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"HFHFracMinus_BXm2BXm1Filled"]; if ( meHFHFracMinus_BXm2BXm1Filled && meHFHFracMinus_BXm2BXm1Filled ->getRootObject()) meHFHFracMinus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2421  meHFEMFracMinus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"HFEMFracMinus_BXm2BXm1Filled"]; if ( meHFEMFracMinus_BXm2BXm1Filled && meHFEMFracMinus_BXm2BXm1Filled ->getRootObject()) meHFEMFracMinus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2422  }else if (correctedJet.eta() >= 3.0 && correctedJet.eta() < 5.0) {
2423  mePtForwardPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"PtForwardPlus_BXm2BXm1Filled"]; if ( mePtForwardPlus_BXm2BXm1Filled && mePtForwardPlus_BXm2BXm1Filled ->getRootObject()) mePtForwardPlus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].pt());
2424  meHFHFracPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"HFHFracPlus_BXm2BXm1Filled"]; if ( meHFHFracPlus_BXm2BXm1Filled && meHFHFracPlus_BXm2BXm1Filled ->getRootObject()) meHFHFracPlus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2425  meHFEMFracPlus_BXm2BXm1Filled = map_of_MEs[DirName+"/"+"HFEMFracPlus_BXm2BXm1Filled"]; if ( meHFEMFracPlus_BXm2BXm1Filled && meHFEMFracPlus_BXm2BXm1Filled ->getRootObject()) meHFEMFracPlus_BXm2BXm1Filled ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2426  }
2427  }*/
2428  if(techTriggerResultBx0 && techTriggerResultBxF){
2429  meEta_BXm1Filled = map_of_MEs[DirName+"/"+"Eta_BXm1Filled"]; if ( meEta_BXm1Filled && meEta_BXm1Filled ->getRootObject()) meEta_BXm1Filled ->Fill((*pfJets)[ijet].eta());
2430  if(fabs(correctedJet.eta()) <= 1.3) {
2431  mePhFracBarrel_BXm1Filled = map_of_MEs[DirName+"/"+"PhFracBarrel_BXm1Filled"]; if ( mePhFracBarrel_BXm1Filled && mePhFracBarrel_BXm1Filled ->getRootObject()) mePhFracBarrel_BXm1Filled ->Fill((*pfJets)[ijet].photonEnergyFraction());
2432  meNHFracBarrel_BXm1Filled = map_of_MEs[DirName+"/"+"NHFracBarrel_BXm1Filled"]; if ( meNHFracBarrel_BXm1Filled && meNHFracBarrel_BXm1Filled ->getRootObject()) meNHFracBarrel_BXm1Filled ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2433  meCHFracBarrel_BXm1Filled = map_of_MEs[DirName+"/"+"CHFracBarrel_BXm1Filled"]; if ( meCHFracBarrel_BXm1Filled && meCHFracBarrel_BXm1Filled ->getRootObject()) meCHFracBarrel_BXm1Filled ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2434  mePtBarrel_BXm1Filled = map_of_MEs[DirName+"/"+"PtBarrel_BXm1Filled"]; if ( mePtBarrel_BXm1Filled && mePtBarrel_BXm1Filled ->getRootObject()) mePtBarrel_BXm1Filled ->Fill((*pfJets)[ijet].pt());
2435  }else if (correctedJet.eta() > -3.0 && correctedJet.eta() <= -1.3) {
2436  mePhFracEndCapMinus_BXm1Filled = map_of_MEs[DirName+"/"+"PhFracEndCapMinus_BXm1Filled"]; if ( mePhFracEndCapMinus_BXm1Filled && mePhFracEndCapMinus_BXm1Filled ->getRootObject()) mePhFracEndCapMinus_BXm1Filled ->Fill((*pfJets)[ijet].photonEnergyFraction());
2437  meNHFracEndCapMinus_BXm1Filled = map_of_MEs[DirName+"/"+"NHFracEndCapMinus_BXm1Filled"]; if ( meNHFracEndCapMinus_BXm1Filled && meNHFracEndCapMinus_BXm1Filled ->getRootObject()) meNHFracEndCapMinus_BXm1Filled ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2438  meCHFracEndCapMinus_BXm1Filled = map_of_MEs[DirName+"/"+"CHFracEndCapMinus_BXm1Filled"]; if ( meCHFracEndCapMinus_BXm1Filled && meCHFracEndCapMinus_BXm1Filled ->getRootObject()) meCHFracEndCapMinus_BXm1Filled ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2439  mePtEndCapMinus_BXm1Filled = map_of_MEs[DirName+"/"+"PtEndCapMinus_BXm1Filled"]; if ( mePtEndCapMinus_BXm1Filled && mePtEndCapMinus_BXm1Filled ->getRootObject()) mePtEndCapMinus_BXm1Filled ->Fill((*pfJets)[ijet].pt());
2440  }else if (correctedJet.eta() >= 1.3 && correctedJet.eta() < 3.0) {
2441  mePhFracEndCapPlus_BXm1Filled = map_of_MEs[DirName+"/"+"PhFracEndCapPlus_BXm1Filled"]; if ( mePhFracEndCapPlus_BXm1Filled && mePhFracEndCapPlus_BXm1Filled ->getRootObject()) mePhFracEndCapPlus_BXm1Filled ->Fill((*pfJets)[ijet].photonEnergyFraction());
2442  meNHFracEndCapPlus_BXm1Filled = map_of_MEs[DirName+"/"+"NHFracEndCapPlus_BXm1Filled"]; if ( meNHFracEndCapPlus_BXm1Filled && meNHFracEndCapPlus_BXm1Filled ->getRootObject()) meNHFracEndCapPlus_BXm1Filled ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2443  meCHFracEndCapPlus_BXm1Filled = map_of_MEs[DirName+"/"+"CHFracEndCapPlus_BXm1Filled"]; if ( meCHFracEndCapPlus_BXm1Filled && meCHFracEndCapPlus_BXm1Filled ->getRootObject()) meCHFracEndCapPlus_BXm1Filled ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2444  mePtEndCapPlus_BXm1Filled = map_of_MEs[DirName+"/"+"PtEndCapPlus_BXm1Filled"]; if ( mePtEndCapPlus_BXm1Filled && mePtEndCapPlus_BXm1Filled ->getRootObject()) mePtEndCapPlus_BXm1Filled ->Fill((*pfJets)[ijet].pt());
2445  }else if (correctedJet.eta() > -5.0 && correctedJet.eta() <= -3.0) {
2446  mePtForwardMinus_BXm1Filled = map_of_MEs[DirName+"/"+"PtForwardMinus_BXm1Filled"]; if ( mePtForwardMinus_BXm1Filled && mePtForwardMinus_BXm1Filled ->getRootObject()) mePtForwardMinus_BXm1Filled ->Fill((*pfJets)[ijet].pt());
2447  meHFHFracMinus_BXm1Filled = map_of_MEs[DirName+"/"+"HFHFracMinus_BXm1Filled"]; if ( meHFHFracMinus_BXm1Filled && meHFHFracMinus_BXm1Filled ->getRootObject()) meHFHFracMinus_BXm1Filled ->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2448  meHFEMFracMinus_BXm1Filled = map_of_MEs[DirName+"/"+"HFEMFracMinus_BXm1Filled"]; if ( meHFEMFracMinus_BXm1Filled && meHFEMFracMinus_BXm1Filled ->getRootObject()) meHFEMFracMinus_BXm1Filled ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2449  }else if (correctedJet.eta() >= 3.0 && correctedJet.eta() < 5.0) {
2450  mePtForwardPlus_BXm1Filled = map_of_MEs[DirName+"/"+"PtForwardPlus_BXm1Filled"]; if ( mePtForwardPlus_BXm1Filled && mePtForwardPlus_BXm1Filled ->getRootObject()) mePtForwardPlus_BXm1Filled ->Fill((*pfJets)[ijet].pt());
2451  meHFHFracPlus_BXm1Filled = map_of_MEs[DirName+"/"+"HFHFracPlus_BXm1Filled"]; if ( meHFHFracPlus_BXm1Filled && meHFHFracPlus_BXm1Filled ->getRootObject()) meHFHFracPlus_BXm1Filled ->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2452  meHFEMFracPlus_BXm1Filled = map_of_MEs[DirName+"/"+"HFEMFracPlus_BXm1Filled"]; if ( meHFEMFracPlus_BXm1Filled && meHFEMFracPlus_BXm1Filled ->getRootObject()) meHFEMFracPlus_BXm1Filled ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2453  }
2454  }/*
2455  if(techTriggerResultBx0 && !techTriggerResultBxE && !techTriggerResultBxF){
2456  meEta_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"Eta_BXm2BXm1Empty"]; if ( meEta_BXm2BXm1Empty && meEta_BXm2BXm1Empty ->getRootObject()) meEta_BXm2BXm1Empty ->Fill((*pfJets)[ijet].eta());
2457  if(fabs(correctedJet.eta()) <= 1.3) {
2458  mePhFracBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PhFracBarrel_BXm2BXm1Empty"]; if ( mePhFracBarrel_BXm2BXm1Empty && mePhFracBarrel_BXm2BXm1Empty ->getRootObject()) mePhFracBarrel_BXm2BXm1Empty ->Fill((*pfJets)[ijet].photonEnergyFraction());
2459  meNHFracBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"NHFracBarrel_BXm2BXm1Empty"]; if ( meNHFracBarrel_BXm2BXm1Empty && meNHFracBarrel_BXm2BXm1Empty ->getRootObject()) meNHFracBarrel_BXm2BXm1Empty ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2460  meCHFracBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"CHFracBarrel_BXm2BXm1Empty"]; if ( meCHFracBarrel_BXm2BXm1Empty && meCHFracBarrel_BXm2BXm1Empty ->getRootObject()) meCHFracBarrel_BXm2BXm1Empty ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2461  mePtBarrel_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PtBarrel_BXm2BXm1Empty"]; if ( mePtBarrel_BXm2BXm1Empty && mePtBarrel_BXm2BXm1Empty ->getRootObject()) mePtBarrel_BXm2BXm1Empty ->Fill((*pfJets)[ijet].pt());
2462  }else if (correctedJet.eta() > -3.0 && correctedJet.eta() <= -1.3) {
2463  mePhFracEndCapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PhFracEndCapMinus_BXm2BXm1Empty"]; if ( mePhFracEndCapMinus_BXm2BXm1Empty && mePhFracEndCapMinus_BXm2BXm1Empty ->getRootObject()) mePhFracEndCapMinus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].photonEnergyFraction());
2464  meNHFracEndCapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"NHFracEndCapMinus_BXm2BXm1Empty"]; if ( meNHFracEndCapMinus_BXm2BXm1Empty && meNHFracEndCapMinus_BXm2BXm1Empty ->getRootObject()) meNHFracEndCapMinus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2465  meCHFracEndCapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"CHFracEndCapMinus_BXm2BXm1Empty"]; if ( meCHFracEndCapMinus_BXm2BXm1Empty && meCHFracEndCapMinus_BXm2BXm1Empty ->getRootObject()) meCHFracEndCapMinus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2466  mePtEndCapMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PtEndCapMinus_BXm2BXm1Empty"]; if ( mePtEndCapMinus_BXm2BXm1Empty && mePtEndCapMinus_BXm2BXm1Empty ->getRootObject()) mePtEndCapMinus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].pt());
2467  }else if (correctedJet.eta() >= 1.3 && correctedJet.eta() < 3.0) {
2468  mePhFracEndCapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PhFracEndCapPlus_BXm2BXm1Empty"]; if ( mePhFracEndCapPlus_BXm2BXm1Empty && mePhFracEndCapPlus_BXm2BXm1Empty ->getRootObject()) mePhFracEndCapPlus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].photonEnergyFraction());
2469  meNHFracEndCapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"NHFracEndCapPlus_BXm2BXm1Empty"]; if ( meNHFracEndCapPlus_BXm2BXm1Empty && meNHFracEndCapPlus_BXm2BXm1Empty ->getRootObject()) meNHFracEndCapPlus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2470  meCHFracEndCapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"CHFracEndCapPlus_BXm2BXm1Empty"]; if ( meCHFracEndCapPlus_BXm2BXm1Empty && meCHFracEndCapPlus_BXm2BXm1Empty ->getRootObject()) meCHFracEndCapPlus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2471  mePtEndCapPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PtEndCapPlus_BXm2BXm1Empty"]; if ( mePtEndCapPlus_BXm2BXm1Empty && mePtEndCapPlus_BXm2BXm1Empty ->getRootObject()) mePtEndCapPlus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].pt());
2472  }else if (correctedJet.eta() > -5.0 && correctedJet.eta() <= -3.0) {
2473  mePtForwardMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PtForwardMinus_BXm2BXm1Empty"]; if ( mePtForwardMinus_BXm2BXm1Empty && mePtForwardMinus_BXm2BXm1Empty ->getRootObject()) mePtForwardMinus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].pt());
2474  meHFHFracMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"HFHFracMinus_BXm2BXm1Empty"]; if ( meHFHFracMinus_BXm2BXm1Empty && meHFHFracMinus_BXm2BXm1Empty ->getRootObject()) meHFHFracMinus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2475  meHFEMFracMinus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"HFEMFracMinus_BXm2BXm1Empty"]; if ( meHFEMFracMinus_BXm2BXm1Empty && meHFEMFracMinus_BXm2BXm1Empty ->getRootObject()) meHFEMFracMinus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2476  }else if (correctedJet.eta() >= 3.0 && correctedJet.eta() < 5.0) {
2477  mePtForwardPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"PtForwardPlus_BXm2BXm1Empty"]; if ( mePtForwardPlus_BXm2BXm1Empty && mePtForwardPlus_BXm2BXm1Empty ->getRootObject()) mePtForwardPlus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].pt());
2478  meHFHFracPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"HFHFracPlus_BXm2BXm1Empty"]; if ( meHFHFracPlus_BXm2BXm1Empty && meHFHFracPlus_BXm2BXm1Empty ->getRootObject()) meHFHFracPlus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2479  meHFEMFracPlus_BXm2BXm1Empty = map_of_MEs[DirName+"/"+"HFEMFracPlus_BXm2BXm1Empty"]; if ( meHFEMFracPlus_BXm2BXm1Empty && meHFEMFracPlus_BXm2BXm1Empty ->getRootObject()) meHFEMFracPlus_BXm2BXm1Empty ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2480  }
2481  }*/
2482  if(techTriggerResultBx0 && !techTriggerResultBxF){
2483  meEta_BXm1Empty = map_of_MEs[DirName+"/"+"Eta_BXm1Empty"]; if ( meEta_BXm1Empty && meEta_BXm1Empty ->getRootObject()) meEta_BXm1Empty ->Fill((*pfJets)[ijet].eta());
2484  if(fabs(correctedJet.eta()) <= 1.3) {
2485  mePhFracBarrel_BXm1Empty = map_of_MEs[DirName+"/"+"PhFracBarrel_BXm1Empty"]; if ( mePhFracBarrel_BXm1Empty && mePhFracBarrel_BXm1Empty ->getRootObject()) mePhFracBarrel_BXm1Empty ->Fill((*pfJets)[ijet].photonEnergyFraction());
2486  meNHFracBarrel_BXm1Empty = map_of_MEs[DirName+"/"+"NHFracBarrel_BXm1Empty"]; if ( meNHFracBarrel_BXm1Empty && meNHFracBarrel_BXm1Empty ->getRootObject()) meNHFracBarrel_BXm1Empty ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2487  meCHFracBarrel_BXm1Empty = map_of_MEs[DirName+"/"+"CHFracBarrel_BXm1Empty"]; if ( meCHFracBarrel_BXm1Empty && meCHFracBarrel_BXm1Empty ->getRootObject()) meCHFracBarrel_BXm1Empty ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2488  mePtBarrel_BXm1Empty = map_of_MEs[DirName+"/"+"PtBarrel_BXm1Empty"]; if ( mePtBarrel_BXm1Empty && mePtBarrel_BXm1Empty ->getRootObject()) mePtBarrel_BXm1Empty ->Fill((*pfJets)[ijet].pt());
2489  }else if (correctedJet.eta() > -3.0 && correctedJet.eta() <= -1.3) {
2490  mePhFracEndCapMinus_BXm1Empty = map_of_MEs[DirName+"/"+"PhFracEndCapMinus_BXm1Empty"]; if ( mePhFracEndCapMinus_BXm1Empty && mePhFracEndCapMinus_BXm1Empty ->getRootObject()) mePhFracEndCapMinus_BXm1Empty ->Fill((*pfJets)[ijet].photonEnergyFraction());
2491  meNHFracEndCapMinus_BXm1Empty = map_of_MEs[DirName+"/"+"NHFracEndCapMinus_BXm1Empty"]; if ( meNHFracEndCapMinus_BXm1Empty && meNHFracEndCapMinus_BXm1Empty ->getRootObject()) meNHFracEndCapMinus_BXm1Empty ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2492  meCHFracEndCapMinus_BXm1Empty = map_of_MEs[DirName+"/"+"CHFracEndCapMinus_BXm1Empty"]; if ( meCHFracEndCapMinus_BXm1Empty && meCHFracEndCapMinus_BXm1Empty ->getRootObject()) meCHFracEndCapMinus_BXm1Empty ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2493  mePtEndCapMinus_BXm1Empty = map_of_MEs[DirName+"/"+"PtEndCapMinus_BXm1Empty"]; if ( mePtEndCapMinus_BXm1Empty && mePtEndCapMinus_BXm1Empty ->getRootObject()) mePtEndCapMinus_BXm1Empty ->Fill((*pfJets)[ijet].pt());
2494  }else if (correctedJet.eta() >= 1.3 && correctedJet.eta() < 3.0) {
2495  mePhFracEndCapPlus_BXm1Empty = map_of_MEs[DirName+"/"+"PhFracEndCapPlus_BXm1Empty"]; if ( mePhFracEndCapPlus_BXm1Empty && mePhFracEndCapPlus_BXm1Empty ->getRootObject()) mePhFracEndCapPlus_BXm1Empty ->Fill((*pfJets)[ijet].photonEnergyFraction());
2496  meNHFracEndCapPlus_BXm1Empty = map_of_MEs[DirName+"/"+"NHFracEndCapPlus_BXm1Empty"]; if ( meNHFracEndCapPlus_BXm1Empty && meNHFracEndCapPlus_BXm1Empty ->getRootObject()) meNHFracEndCapPlus_BXm1Empty ->Fill((*pfJets)[ijet].neutralHadronEnergyFraction());
2497  meCHFracEndCapPlus_BXm1Empty = map_of_MEs[DirName+"/"+"CHFracEndCapPlus_BXm1Empty"]; if ( meCHFracEndCapPlus_BXm1Empty && meCHFracEndCapPlus_BXm1Empty ->getRootObject()) meCHFracEndCapPlus_BXm1Empty ->Fill((*pfJets)[ijet].chargedHadronEnergyFraction());
2498  mePtEndCapPlus_BXm1Empty = map_of_MEs[DirName+"/"+"PtEndCapPlus_BXm1Empty"]; if ( mePtEndCapPlus_BXm1Empty && mePtEndCapPlus_BXm1Empty ->getRootObject()) mePtEndCapPlus_BXm1Empty ->Fill((*pfJets)[ijet].pt());
2499  }else if (correctedJet.eta() > -5.0 && correctedJet.eta() <= -3.0) {
2500  mePtForwardMinus_BXm1Empty = map_of_MEs[DirName+"/"+"PtForwardMinus_BXm1Empty"]; if ( mePtForwardMinus_BXm1Empty && mePtForwardMinus_BXm1Empty ->getRootObject()) mePtForwardMinus_BXm1Empty ->Fill((*pfJets)[ijet].pt());
2501  meHFHFracMinus_BXm1Empty = map_of_MEs[DirName+"/"+"HFHFracMinus_BXm1Empty"]; if ( meHFHFracMinus_BXm1Empty && meHFHFracMinus_BXm1Empty ->getRootObject()) meHFHFracMinus_BXm1Empty ->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2502  meHFEMFracMinus_BXm1Empty = map_of_MEs[DirName+"/"+"HFEMFracMinus_BXm1Empty"]; if ( meHFEMFracMinus_BXm1Empty && meHFEMFracMinus_BXm1Empty ->getRootObject()) meHFEMFracMinus_BXm1Empty ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2503  }else if (correctedJet.eta() >= 3.0 && correctedJet.eta() < 5.0) {
2504  mePtForwardPlus_BXm1Empty = map_of_MEs[DirName+"/"+"PtForwardPlus_BXm1Empty"]; if ( mePtForwardPlus_BXm1Empty && mePtForwardPlus_BXm1Empty ->getRootObject()) mePtForwardPlus_BXm1Empty ->Fill((*pfJets)[ijet].pt());
2505  meHFHFracPlus_BXm1Empty = map_of_MEs[DirName+"/"+"HFHFracPlus_BXm1Empty"]; if ( meHFHFracPlus_BXm1Empty && meHFHFracPlus_BXm1Empty ->getRootObject()) meHFHFracPlus_BXm1Empty ->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
2506  meHFEMFracPlus_BXm1Empty = map_of_MEs[DirName+"/"+"HFEMFracPlus_BXm1Empty"]; if ( meHFEMFracPlus_BXm1Empty && meHFEMFracPlus_BXm1Empty ->getRootObject()) meHFEMFracPlus_BXm1Empty ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
2507  }
2508  }
2509  mChargedHadronEnergy = map_of_MEs[DirName+"/"+"ChargedHadronEnergy"]; if (mChargedHadronEnergy && mChargedHadronEnergy->getRootObject()) mChargedHadronEnergy->Fill ((*pfJets)[ijet].chargedHadronEnergy());
2510  mNeutralHadronEnergy = map_of_MEs[DirName+"/"+"NeutralHadronEnergy"]; if (mNeutralHadronEnergy && mNeutralHadronEnergy->getRootObject()) mNeutralHadronEnergy->Fill ((*pfJets)[ijet].neutralHadronEnergy());
2511  mChargedEmEnergy = map_of_MEs[DirName+"/"+"ChargedEmEnergy"]; if (mChargedEmEnergy && mChargedEmEnergy->getRootObject()) mChargedEmEnergy->Fill((*pfJets)[ijet].chargedEmEnergy());
2512  mChargedMuEnergy = map_of_MEs[DirName+"/"+"ChargedMuEnergy"]; if (mChargedMuEnergy && mChargedMuEnergy->getRootObject()) mChargedMuEnergy->Fill ((*pfJets)[ijet].chargedMuEnergy ());
2513  mNeutralEmEnergy = map_of_MEs[DirName+"/"+"NeutralEmEnergy"]; if (mNeutralEmEnergy && mNeutralEmEnergy->getRootObject()) mNeutralEmEnergy->Fill((*pfJets)[ijet].neutralEmEnergy());
2514  mChargedMultiplicity = map_of_MEs[DirName+"/"+"ChargedMultiplicity"]; if (mChargedMultiplicity && mChargedMultiplicity->getRootObject()) mChargedMultiplicity->Fill((*pfJets)[ijet].chargedMultiplicity());
2515  mNeutralMultiplicity = map_of_MEs[DirName+"/"+"NeutralMultiplicity"]; if (mNeutralMultiplicity && mNeutralMultiplicity->getRootObject()) mNeutralMultiplicity->Fill((*pfJets)[ijet].neutralMultiplicity());
2516  mMuonMultiplicity = map_of_MEs[DirName+"/"+"MuonMultiplicity"]; if (mMuonMultiplicity && mMuonMultiplicity->getRootObject()) mMuonMultiplicity->Fill ((*pfJets)[ijet]. muonMultiplicity());
2517  //_______________________________________________________
2518  mNeutralFraction = map_of_MEs[DirName+"/"+"NeutralConstituentsFraction"];if (mNeutralFraction && mNeutralFraction->getRootObject()) mNeutralFraction->Fill ((double)(*pfJets)[ijet].neutralMultiplicity()/(double)(*pfJets)[ijet].nConstituents());
2519  mChargedHadronEnergy_profile = map_of_MEs[DirName+"/"+"ChargedHadronEnergy_profile"]; if (mChargedHadronEnergy_profile && mChargedHadronEnergy_profile->getRootObject()) mChargedHadronEnergy_profile->Fill(numPV, (*pfJets)[ijet].chargedHadronEnergy());
2520  mNeutralHadronEnergy_profile = map_of_MEs[DirName+"/"+"NeutralHadronEnergy_profile"];if (mNeutralHadronEnergy_profile && mNeutralHadronEnergy_profile->getRootObject()) mNeutralHadronEnergy_profile->Fill(numPV, (*pfJets)[ijet].neutralHadronEnergy());
2521  mChargedEmEnergy_profile = map_of_MEs[DirName+"/"+"ChargedEmEnergy_profile"]; if (mChargedEmEnergy_profile && mChargedEmEnergy_profile->getRootObject()) mChargedEmEnergy_profile ->Fill(numPV, (*pfJets)[ijet].chargedEmEnergy());
2522  mChargedMuEnergy_profile = map_of_MEs[DirName+"/"+"ChargedMuEnergy_profile"];if (mChargedMuEnergy_profile && mChargedMuEnergy_profile->getRootObject()) mChargedMuEnergy_profile ->Fill(numPV, (*pfJets)[ijet].chargedMuEnergy ());
2523  mNeutralEmEnergy_profile = map_of_MEs[DirName+"/"+"NeutralEmEnergy_profile"];if (mNeutralEmEnergy_profile && mNeutralEmEnergy_profile->getRootObject()) mNeutralEmEnergy_profile ->Fill(numPV, (*pfJets)[ijet].neutralEmEnergy());
2524  mChargedMultiplicity_profile = map_of_MEs[DirName+"/"+"ChargedMultiplicity_profile"]; if (mChargedMultiplicity_profile && mChargedMultiplicity_profile->getRootObject()) mChargedMultiplicity_profile->Fill(numPV, (*pfJets)[ijet].chargedMultiplicity());
2525  mNeutralMultiplicity_profile = map_of_MEs[DirName+"/"+"NeutralMultiplicity_profile"];if (mNeutralMultiplicity_profile && mNeutralMultiplicity_profile->getRootObject()) mNeutralMultiplicity_profile->Fill(numPV, (*pfJets)[ijet].neutralMultiplicity());
2526  mMuonMultiplicity_profile = map_of_MEs[DirName+"/"+"MuonMultiplicity_profile"]; if (mMuonMultiplicity_profile && mMuonMultiplicity_profile->getRootObject()) mMuonMultiplicity_profile ->Fill(numPV, (*pfJets)[ijet].muonMultiplicity());
2527  }//cleaned PFJets
2528  }//PFJet specific loop
2529  //IDs have been defined by now
2530  //check here already for ordering of jets -> if we choose later to soften pt-thresholds for physics selections
2531  //compared to the default jet histograms
2532  if(pass_Z_selection){//if Z selection not passed, don't need to find out of muons and Jets are overlapping
2533  if(deltaR((*Muons)[mu_index0].eta(),(*Muons)[mu_index0].phi(),correctedJet.eta(),correctedJet.phi())>0.2 && deltaR((*Muons)[mu_index1].eta(),(*Muons)[mu_index1].phi(),correctedJet.eta(),correctedJet.phi())>0.2 ){
2534  if(correctedJet.pt()>pt1_mu_vetoed){
2535  pt2_mu_vetoed=pt1_mu_vetoed;
2536  ind2_mu_vetoed=ind1_mu_vetoed;
2537  cleaned_second_jet_mu_vetoed=cleaned_first_jet_mu_vetoed;
2538  pt1_mu_vetoed=correctedJet.pt();
2539  ind1_mu_vetoed=ijet;
2540  cleaned_first_jet_mu_vetoed=JetIDWPU;
2541  } else if(correctedJet.pt()>pt2_mu_vetoed){
2542  pt2_mu_vetoed=correctedJet.pt();
2543  ind2_mu_vetoed=ijet;
2544  cleaned_second_jet_mu_vetoed=JetIDWPU;
2545  }
2546  }
2547  }
2548 
2549  if(correctedJet.pt()>pt1){
2550  pt3=pt2;
2551  ind3=ind2;
2552  //cleaned_third_jet=cleaned_second_jet;
2553  pt2=pt1;
2554  ind2=ind1;
2555  cleaned_second_jet=cleaned_first_jet;
2556  pt1=correctedJet.pt();
2557  ind1=ijet;
2558  cleaned_first_jet=JetIDWPU;
2559  } else if(correctedJet.pt()>pt2){
2560  pt3=pt2;
2561  ind3=ind2;
2562  //cleaned_third_jet=cleaned_second_jet;
2563  pt2=correctedJet.pt();
2564  ind2=ijet;
2565  cleaned_second_jet=JetIDWPU;
2566  } else if(correctedJet.pt()>pt3){
2567  pt3=correctedJet.pt();
2568  ind3=ijet;
2569  //cleaned_third_jet=JetIDWPU;
2570  }
2571  if(!pass_corrected){
2572  continue;
2573  }
2574  //after jettype specific variables are filled -> perform histograms for all jets
2575  //fill JetID efficiencies if uncleaned selection is chosen
2576  if(!runcosmics_ && pass_corrected){
2577  if(jetpassid) {
2578  mLooseJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"JetIDPassFractionVSeta"]; if (mLooseJIDPassFractionVSeta && mLooseJIDPassFractionVSeta->getRootObject()) mLooseJIDPassFractionVSeta->Fill(correctedJet.eta(),1.);
2579  mLooseJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"JetIDPassFractionVSpt"]; if (mLooseJIDPassFractionVSpt && mLooseJIDPassFractionVSpt->getRootObject()) mLooseJIDPassFractionVSpt->Fill(correctedJet.pt(),1.);
2580  if(fabs(correctedJet.eta())<3.0){
2581  mLooseJIDPassFractionVSptNoHF= map_of_MEs[DirName+"/"+"JetIDPassFractionVSptNoHF"]; if (mLooseJIDPassFractionVSptNoHF && mLooseJIDPassFractionVSptNoHF->getRootObject()) mLooseJIDPassFractionVSptNoHF->Fill(correctedJet.pt(),1.);
2582  }
2583  } else {
2584  mLooseJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"JetIDPassFractionVSeta"]; if (mLooseJIDPassFractionVSeta && mLooseJIDPassFractionVSeta->getRootObject()) mLooseJIDPassFractionVSeta->Fill(correctedJet.eta(),0.);
2585  mLooseJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"JetIDPassFractionVSpt"]; if (mLooseJIDPassFractionVSpt && mLooseJIDPassFractionVSpt->getRootObject()) mLooseJIDPassFractionVSpt->Fill(correctedJet.pt(),0.);
2586  if(fabs(correctedJet.eta())<3.0){
2587  mLooseJIDPassFractionVSptNoHF= map_of_MEs[DirName+"/"+"JetIDPassFractionVSptNoHF"]; if (mLooseJIDPassFractionVSptNoHF && mLooseJIDPassFractionVSptNoHF->getRootObject()) mLooseJIDPassFractionVSptNoHF->Fill(correctedJet.pt(),0.);
2588  }
2589  }
2590  }
2591  //here we so far consider calojets ->check for PFJets and JPT jets again
2592  if(Thiscleaned && pass_corrected){//might be softer than loose jet ID
2593  numofjets++;
2594  if(isCaloJet_){
2595  jetME = map_of_MEs[DirName+"/"+"jetReco"]; if(jetME && jetME->getRootObject()) jetME->Fill(1);
2596  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(correctedJet.pt()/(*caloJets)[ijet].pt());
2597  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(correctedJet.eta(),correctedJet.pt()/(*caloJets)[ijet].pt());
2598  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(correctedJet.pt(),correctedJet.pt()/(*caloJets)[ijet].pt());
2599  }
2600  if(isPFJet_){
2601  jetME = map_of_MEs[DirName+"/"+"jetReco"]; if(jetME && jetME->getRootObject()) jetME->Fill(2);
2602  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(correctedJet.pt()/(*pfJets)[ijet].pt());
2603  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject())mJetEnergyCorrVSEta->Fill(correctedJet.eta(),correctedJet.pt()/(*pfJets)[ijet].pt());
2604  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(correctedJet.pt(),correctedJet.pt()/(*pfJets)[ijet].pt());
2605  }
2606  if(isMiniAODJet_){
2607  jetME = map_of_MEs[DirName+"/"+"jetReco"]; if(jetME && jetME->getRootObject()) jetME->Fill(4);
2608  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(1./(*patJets)[ijet].jecFactor("Uncorrected"));
2609  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject())mJetEnergyCorrVSEta->Fill(correctedJet.eta(),1./(*patJets)[ijet].jecFactor("Uncorrected"));
2610  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(correctedJet.pt(),1./(*patJets)[ijet].jecFactor("Uncorrected"));
2611  if(filljetsubstruc_){
2612  //miniaod specific variables, especially for substructure
2613  mSoftDropMass = map_of_MEs[DirName+"/"+"SoftDropMass"];if(mSoftDropMass && mSoftDropMass->getRootObject() && (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSSoftDropMass")) mSoftDropMass->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSSoftDropMass"));
2614  mPrunedMass = map_of_MEs[DirName+"/"+"PrunedMass"];if(mPrunedMass && mPrunedMass->getRootObject() && (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSPrunedMass")) mPrunedMass->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSPrunedMass"));
2615  mTrimmedMass = map_of_MEs[DirName+"/"+"TrimmedMass"];if(mTrimmedMass && mTrimmedMass->getRootObject() && (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSTrimmedMass")) mTrimmedMass->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSTrimmedMass"));
2616  mFilteredMass = map_of_MEs[DirName+"/"+"FilteredMass"];if(mFilteredMass && mFilteredMass->getRootObject() && (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSFilteredMass")) mFilteredMass->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSFilteredMass"));
2617  mtau2_over_tau1 = map_of_MEs[DirName+"/"+"tau2_over_tau1"]; if(mtau2_over_tau1 && mtau2_over_tau1->getRootObject() && ((*patJets)[ijet].hasUserFloat("NjettinessAK8:tau1") && (*patJets)[ijet].hasUserFloat("NjettinessAK8:tau2")))mtau2_over_tau1->Fill((*patJets)[ijet].userFloat("NjettinessAK8:tau2")/(*patJets)[ijet].userFloat("NjettinessAK8:tau1"));
2618  mtau3_over_tau2 = map_of_MEs[DirName+"/"+"tau3_over_tau2"]; if(mtau3_over_tau2 && mtau3_over_tau2->getRootObject() && ((*patJets)[ijet].hasUserFloat("NjettinessAK8:tau2") && (*patJets)[ijet].hasUserFloat("NjettinessAK8:tau3")))mtau3_over_tau2->Fill((*patJets)[ijet].userFloat("NjettinessAK8:tau3")/(*patJets)[ijet].userFloat("NjettinessAK8:tau2"));
2619  if((*patJets)[ijet].hasTagInfo("caTop")){
2620  reco::CATopJetTagInfo const * tagInfo= dynamic_cast<reco::CATopJetTagInfo const *>((*patJets)[ijet].tagInfo("caTop"));
2621  if ( tagInfo != 0 ) {
2622  mCATopTag_topMass = map_of_MEs[DirName+"/"+"CATopTag_topMass"];if(mCATopTag_topMass && mCATopTag_topMass->getRootObject() && (*patJets)[ijet].hasTagInfo("caTop")) mCATopTag_topMass->Fill(tagInfo->properties().topMass);
2623  mCATopTag_minMass = map_of_MEs[DirName+"/"+"CATopTag_minMass"];if(mCATopTag_minMass && mCATopTag_minMass->getRootObject() && (*patJets)[ijet].hasTagInfo("caTop")) mCATopTag_minMass->Fill(tagInfo->properties().minMass);
2624  mCATopTag_nSubJets = map_of_MEs[DirName+"/"+"nSubJets_CATopTag"];if(mCATopTag_nSubJets && mCATopTag_nSubJets->getRootObject() && (*patJets)[ijet].hasTagInfo("caTop")) mCATopTag_nSubJets->Fill(tagInfo->properties().nSubJets);
2625  }
2626  }
2627  if((*patJets)[ijet].hasSubjets("CMSTopTag")){
2628  mnSubJetsCMSTopTag=map_of_MEs[DirName+"/"+"nSubJets_CMSTopTag"]; if(mnSubJetsCMSTopTag && mnSubJetsCMSTopTag->getRootObject()) mnSubJetsCMSTopTag->Fill((*patJets)[ijet].subjets("CMSTopTag").size());
2629  }
2630  if((*patJets)[ijet].hasSubjets("CMSTopTag") && (*patJets)[ijet].subjets("CMSTopTag").size()>0){
2631  mSubJet1_CMSTopTag_pt=map_of_MEs[DirName+"/"+"SubJet1_CMSTopTag_pt"]; if(mSubJet1_CMSTopTag_pt && mSubJet1_CMSTopTag_pt->getRootObject()) mSubJet1_CMSTopTag_pt->Fill((*patJets)[ijet].subjets("CMSTopTag")[0]->pt());
2632  mSubJet1_CMSTopTag_eta=map_of_MEs[DirName+"/"+"SubJet1_CMSTopTag_eta"]; if(mSubJet1_CMSTopTag_eta && mSubJet1_CMSTopTag_eta->getRootObject()) mSubJet1_CMSTopTag_eta->Fill((*patJets)[ijet].subjets("CMSTopTag")[0]->eta());
2633  mSubJet1_CMSTopTag_phi=map_of_MEs[DirName+"/"+"SubJet1_CMSTopTag_phi"]; if(mSubJet1_CMSTopTag_phi && mSubJet1_CMSTopTag_phi->getRootObject()) mSubJet1_CMSTopTag_phi->Fill((*patJets)[ijet].subjets("CMSTopTag")[0]->phi());
2634  mSubJet1_CMSTopTag_mass=map_of_MEs[DirName+"/"+"SubJet1_CMSTopTag_mass"]; if(mSubJet1_CMSTopTag_mass && mSubJet1_CMSTopTag_mass->getRootObject()) mSubJet1_CMSTopTag_mass->Fill((*patJets)[ijet].subjets("CMSTopTag")[0]->mass());
2635  if((*patJets)[ijet].subjets("CMSTopTag").size()>1){
2636  mSubJet2_CMSTopTag_pt=map_of_MEs[DirName+"/"+"SubJet2_CMSTopTag_pt"]; if(mSubJet2_CMSTopTag_pt && mSubJet2_CMSTopTag_pt->getRootObject()) mSubJet2_CMSTopTag_pt->Fill((*patJets)[ijet].subjets("CMSTopTag")[1]->pt());
2637  mSubJet2_CMSTopTag_eta=map_of_MEs[DirName+"/"+"SubJet2_CMSTopTag_eta"]; if(mSubJet2_CMSTopTag_eta && mSubJet2_CMSTopTag_eta->getRootObject()) mSubJet2_CMSTopTag_eta->Fill((*patJets)[ijet].subjets("CMSTopTag")[1]->eta());
2638  mSubJet2_CMSTopTag_phi=map_of_MEs[DirName+"/"+"SubJet2_CMSTopTag_phi"]; if(mSubJet2_CMSTopTag_phi && mSubJet2_CMSTopTag_phi->getRootObject()) mSubJet2_CMSTopTag_phi->Fill((*patJets)[ijet].subjets("CMSTopTag")[1]->phi());
2639  mSubJet2_CMSTopTag_mass=map_of_MEs[DirName+"/"+"SubJet2_CMSTopTag_mass"]; if(mSubJet2_CMSTopTag_mass && mSubJet2_CMSTopTag_mass->getRootObject()) mSubJet2_CMSTopTag_mass->Fill((*patJets)[ijet].subjets("CMSTopTag")[1]->mass());
2640  if((*patJets)[ijet].subjets("CMSTopTag").size()>2){
2641  mSubJet3_CMSTopTag_pt=map_of_MEs[DirName+"/"+"SubJet3_CMSTopTag_pt"]; if(mSubJet3_CMSTopTag_pt && mSubJet3_CMSTopTag_pt->getRootObject()) mSubJet3_CMSTopTag_pt->Fill((*patJets)[ijet].subjets("CMSTopTag")[2]->pt());
2642  mSubJet3_CMSTopTag_eta=map_of_MEs[DirName+"/"+"SubJet3_CMSTopTag_eta"]; if(mSubJet3_CMSTopTag_eta && mSubJet3_CMSTopTag_eta->getRootObject()) mSubJet3_CMSTopTag_eta->Fill((*patJets)[ijet].subjets("CMSTopTag")[2]->eta());
2643  mSubJet3_CMSTopTag_phi=map_of_MEs[DirName+"/"+"SubJet3_CMSTopTag_phi"]; if(mSubJet3_CMSTopTag_phi && mSubJet3_CMSTopTag_phi->getRootObject()) mSubJet3_CMSTopTag_phi->Fill((*patJets)[ijet].subjets("CMSTopTag")[2]->phi());
2644  mSubJet3_CMSTopTag_mass=map_of_MEs[DirName+"/"+"SubJet3_CMSTopTag_mass"]; if(mSubJet3_CMSTopTag_mass && mSubJet3_CMSTopTag_mass->getRootObject()) mSubJet3_CMSTopTag_mass->Fill((*patJets)[ijet].subjets("CMSTopTag")[2]->mass());
2645  if((*patJets)[ijet].subjets("CMSTopTag").size()>3){
2646  mSubJet4_CMSTopTag_pt=map_of_MEs[DirName+"/"+"SubJet4_CMSTopTag_pt"]; if(mSubJet4_CMSTopTag_pt && mSubJet4_CMSTopTag_pt->getRootObject()) mSubJet4_CMSTopTag_pt->Fill((*patJets)[ijet].subjets("CMSTopTag")[3]->pt());
2647  mSubJet4_CMSTopTag_eta=map_of_MEs[DirName+"/"+"SubJet4_CMSTopTag_eta"]; if(mSubJet4_CMSTopTag_eta && mSubJet4_CMSTopTag_eta->getRootObject()) mSubJet4_CMSTopTag_eta->Fill((*patJets)[ijet].subjets("CMSTopTag")[3]->eta());
2648  mSubJet4_CMSTopTag_phi=map_of_MEs[DirName+"/"+"SubJet4_CMSTopTag_phi"]; if(mSubJet4_CMSTopTag_phi && mSubJet4_CMSTopTag_phi->getRootObject()) mSubJet4_CMSTopTag_phi->Fill((*patJets)[ijet].subjets("CMSTopTag")[3]->phi());
2649  mSubJet4_CMSTopTag_mass=map_of_MEs[DirName+"/"+"SubJet4_CMSTopTag_mass"]; if(mSubJet4_CMSTopTag_mass && mSubJet4_CMSTopTag_mass->getRootObject()) mSubJet4_CMSTopTag_mass->Fill((*patJets)[ijet].subjets("CMSTopTag")[3]->mass());
2650  }
2651  }
2652  }
2653  }//CMS top tag filling
2654  if((*patJets)[ijet].hasSubjets("SoftDrop")){
2655  mnSubJetsSoftDrop=map_of_MEs[DirName+"/"+"nSubJets_SoftDrop"]; if(mnSubJetsSoftDrop && mnSubJetsSoftDrop->getRootObject()) mnSubJetsSoftDrop->Fill((*patJets)[ijet].subjets("SoftDrop").size());
2656  }
2657  if((*patJets)[ijet].hasSubjets("SoftDrop") && (*patJets)[ijet].subjets("SoftDrop").size()>0){
2658  mSubJet1_SoftDrop_pt=map_of_MEs[DirName+"/"+"SubJet1_SoftDrop_pt"]; if(mSubJet1_SoftDrop_pt && mSubJet1_SoftDrop_pt->getRootObject()) mSubJet1_SoftDrop_pt->Fill((*patJets)[ijet].subjets("SoftDrop")[0]->pt());
2659  mSubJet1_SoftDrop_eta=map_of_MEs[DirName+"/"+"SubJet1_SoftDrop_eta"]; if(mSubJet1_SoftDrop_eta && mSubJet1_SoftDrop_eta->getRootObject()) mSubJet1_SoftDrop_eta->Fill((*patJets)[ijet].subjets("SoftDrop")[0]->eta());
2660  mSubJet1_SoftDrop_phi=map_of_MEs[DirName+"/"+"SubJet1_SoftDrop_phi"]; if(mSubJet1_SoftDrop_phi && mSubJet1_SoftDrop_phi->getRootObject()) mSubJet1_SoftDrop_phi->Fill((*patJets)[ijet].subjets("SoftDrop")[0]->phi());
2661  mSubJet1_SoftDrop_mass=map_of_MEs[DirName+"/"+"SubJet1_SoftDrop_mass"]; if(mSubJet1_SoftDrop_mass && mSubJet1_SoftDrop_mass->getRootObject()) mSubJet1_SoftDrop_mass->Fill((*patJets)[ijet].subjets("SoftDrop")[0]->mass());
2662  if((*patJets)[ijet].subjets("SoftDrop").size()>1){
2663  mSubJet2_SoftDrop_pt=map_of_MEs[DirName+"/"+"SubJet2_SoftDrop_pt"]; if(mSubJet2_SoftDrop_pt && mSubJet2_SoftDrop_pt->getRootObject()) mSubJet2_SoftDrop_pt->Fill((*patJets)[ijet].subjets("SoftDrop")[1]->pt());
2664  mSubJet2_SoftDrop_eta=map_of_MEs[DirName+"/"+"SubJet2_SoftDrop_eta"]; if(mSubJet2_SoftDrop_eta && mSubJet2_SoftDrop_eta->getRootObject()) mSubJet2_SoftDrop_eta->Fill((*patJets)[ijet].subjets("SoftDrop")[1]->eta());
2665  mSubJet2_SoftDrop_phi=map_of_MEs[DirName+"/"+"SubJet2_SoftDrop_phi"]; if(mSubJet2_SoftDrop_phi && mSubJet2_SoftDrop_phi->getRootObject()) mSubJet2_SoftDrop_phi->Fill((*patJets)[ijet].subjets("SoftDrop")[1]->phi());
2666  mSubJet2_SoftDrop_mass=map_of_MEs[DirName+"/"+"SubJet2_SoftDrop_mass"]; if(mSubJet2_SoftDrop_mass && mSubJet2_SoftDrop_mass->getRootObject()) mSubJet2_SoftDrop_mass->Fill((*patJets)[ijet].subjets("SoftDrop")[1]->mass());
2667  }
2668  }//soft drop jets
2669  if((*patJets)[ijet].pt()>pt_min_boosted_){
2670  //miniaod specific variables, especially for boosted substructure
2671  mSoftDropMass_boosted = map_of_MEs[DirName+"/"+"SoftDropMass_boosted"];if(mSoftDropMass_boosted && mSoftDropMass_boosted->getRootObject() && (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSSoftDropMass")) mSoftDropMass_boosted->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSSoftDropMass"));
2672  mPrunedMass_boosted = map_of_MEs[DirName+"/"+"PrunedMass_boosted"];if(mPrunedMass_boosted && mPrunedMass_boosted->getRootObject() && (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSPrunedMass")) mPrunedMass_boosted->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSPrunedMass"));
2673  mTrimmedMass_boosted = map_of_MEs[DirName+"/"+"TrimmedMass_boosted"];if(mTrimmedMass_boosted && mTrimmedMass_boosted->getRootObject() && (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSTrimmedMass")) mTrimmedMass_boosted->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSTrimmedMass"));
2674  mFilteredMass_boosted = map_of_MEs[DirName+"/"+"FilteredMass_boosted"];if(mFilteredMass_boosted && mFilteredMass_boosted->getRootObject() && (*patJets)[ijet].hasUserFloat("ak8PFJetsCHSFilteredMass")) mFilteredMass_boosted->Fill((*patJets)[ijet].userFloat("ak8PFJetsCHSFilteredMass"));
2675  mtau2_over_tau1_boosted = map_of_MEs[DirName+"/"+"tau2_over_tau1_boosted"]; if(mtau2_over_tau1_boosted && mtau2_over_tau1_boosted->getRootObject() && ((*patJets)[ijet].hasUserFloat("NjettinessAK8:tau1") && (*patJets)[ijet].hasUserFloat("NjettinessAK8:tau2")))mtau2_over_tau1_boosted->Fill((*patJets)[ijet].userFloat("NjettinessAK8:tau2")/(*patJets)[ijet].userFloat("NjettinessAK8:tau1"));
2676  mtau3_over_tau2_boosted = map_of_MEs[DirName+"/"+"tau3_over_tau2_boosted"]; if(mtau3_over_tau2_boosted && mtau3_over_tau2_boosted->getRootObject() && ((*patJets)[ijet].hasUserFloat("NjettinessAK8:tau2") && (*patJets)[ijet].hasUserFloat("NjettinessAK8:tau3")))mtau3_over_tau2_boosted->Fill((*patJets)[ijet].userFloat("NjettinessAK8:tau3")/(*patJets)[ijet].userFloat("NjettinessAK8:tau2"));
2677  if((*patJets)[ijet].hasTagInfo("caTop")){
2678  reco::CATopJetTagInfo const * tagInfo_boosted = dynamic_cast<reco::CATopJetTagInfo const *>((*patJets)[ijet].tagInfo("caTop"));
2679  if ( tagInfo_boosted != 0 ) {
2680  mCATopTag_topMass_boosted = map_of_MEs[DirName+"/"+"CATopTag_topMass_boosted"];if(mCATopTag_topMass_boosted && mCATopTag_topMass_boosted->getRootObject() && (*patJets)[ijet].hasTagInfo("caTop")) mCATopTag_topMass_boosted->Fill(tagInfo_boosted->properties().topMass);
2681  mCATopTag_minMass_boosted = map_of_MEs[DirName+"/"+"CATopTag_minMass_boosted"];if(mCATopTag_minMass_boosted && mCATopTag_minMass_boosted->getRootObject() && (*patJets)[ijet].hasTagInfo("caTop")) mCATopTag_minMass_boosted->Fill(tagInfo_boosted->properties().minMass);
2682  mCATopTag_nSubJets_boosted = map_of_MEs[DirName+"/"+"nSubJets_CATopTag_boosted"];if(mCATopTag_nSubJets_boosted && mCATopTag_nSubJets_boosted->getRootObject() && (*patJets)[ijet].hasTagInfo("caTop")) mCATopTag_nSubJets_boosted->Fill(tagInfo_boosted->properties().nSubJets);
2683  }
2684  }
2685  if((*patJets)[ijet].hasSubjets("CMSTopTag")){
2686  mnSubJetsCMSTopTag_boosted=map_of_MEs[DirName+"/"+"nSubJets_CMSTopTag_boosted"]; if(mnSubJetsCMSTopTag_boosted && mnSubJetsCMSTopTag_boosted->getRootObject()) mnSubJetsCMSTopTag_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag").size());
2687  }
2688  if((*patJets)[ijet].hasSubjets("CMSTopTag") && (*patJets)[ijet].subjets("CMSTopTag").size()>0){
2689  mSubJet1_CMSTopTag_pt_boosted=map_of_MEs[DirName+"/"+"SubJet1_CMSTopTag_pt_boosted"]; if(mSubJet1_CMSTopTag_pt_boosted && mSubJet1_CMSTopTag_pt_boosted->getRootObject()) mSubJet1_CMSTopTag_pt_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[0]->pt());
2690  mSubJet1_CMSTopTag_eta_boosted=map_of_MEs[DirName+"/"+"SubJet1_CMSTopTag_eta_boosted"]; if(mSubJet1_CMSTopTag_eta_boosted && mSubJet1_CMSTopTag_eta_boosted->getRootObject()) mSubJet1_CMSTopTag_eta_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[0]->eta());
2691  mSubJet1_CMSTopTag_phi_boosted=map_of_MEs[DirName+"/"+"SubJet1_CMSTopTag_phi_boosted"]; if(mSubJet1_CMSTopTag_phi_boosted && mSubJet1_CMSTopTag_phi_boosted->getRootObject()) mSubJet1_CMSTopTag_phi_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[0]->phi());
2692  mSubJet1_CMSTopTag_mass_boosted=map_of_MEs[DirName+"/"+"SubJet1_CMSTopTag_mass_boosted"]; if(mSubJet1_CMSTopTag_mass_boosted && mSubJet1_CMSTopTag_mass_boosted->getRootObject()) mSubJet1_CMSTopTag_mass_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[0]->mass());
2693  if((*patJets)[ijet].subjets("CMSTopTag").size()>1){
2694  mSubJet2_CMSTopTag_pt_boosted=map_of_MEs[DirName+"/"+"SubJet2_CMSTopTag_pt_boosted"]; if(mSubJet2_CMSTopTag_pt_boosted && mSubJet2_CMSTopTag_pt_boosted->getRootObject()) mSubJet2_CMSTopTag_pt_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[1]->pt());
2695  mSubJet2_CMSTopTag_eta_boosted=map_of_MEs[DirName+"/"+"SubJet2_CMSTopTag_eta_boosted"]; if(mSubJet2_CMSTopTag_eta_boosted && mSubJet2_CMSTopTag_eta_boosted->getRootObject()) mSubJet2_CMSTopTag_eta_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[1]->eta());
2696  mSubJet2_CMSTopTag_phi_boosted=map_of_MEs[DirName+"/"+"SubJet2_CMSTopTag_phi_boosted"]; if(mSubJet2_CMSTopTag_phi_boosted && mSubJet2_CMSTopTag_phi_boosted->getRootObject()) mSubJet2_CMSTopTag_phi_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[1]->phi());
2697  mSubJet2_CMSTopTag_mass_boosted=map_of_MEs[DirName+"/"+"SubJet2_CMSTopTag_mass_boosted"]; if(mSubJet2_CMSTopTag_mass_boosted && mSubJet2_CMSTopTag_mass_boosted->getRootObject()) mSubJet2_CMSTopTag_mass_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[1]->mass());
2698  if((*patJets)[ijet].subjets("CMSTopTag").size()>2){
2699  mSubJet3_CMSTopTag_pt_boosted=map_of_MEs[DirName+"/"+"SubJet3_CMSTopTag_pt_boosted"]; if(mSubJet3_CMSTopTag_pt_boosted && mSubJet3_CMSTopTag_pt_boosted->getRootObject()) mSubJet3_CMSTopTag_pt_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[2]->pt());
2700  mSubJet3_CMSTopTag_eta_boosted=map_of_MEs[DirName+"/"+"SubJet3_CMSTopTag_eta_boosted"]; if(mSubJet3_CMSTopTag_eta_boosted && mSubJet3_CMSTopTag_eta_boosted->getRootObject()) mSubJet3_CMSTopTag_eta_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[2]->eta());
2701  mSubJet3_CMSTopTag_phi_boosted=map_of_MEs[DirName+"/"+"SubJet3_CMSTopTag_phi_boosted"]; if(mSubJet3_CMSTopTag_phi_boosted && mSubJet3_CMSTopTag_phi_boosted->getRootObject()) mSubJet3_CMSTopTag_phi_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[2]->phi());
2702  mSubJet3_CMSTopTag_mass_boosted=map_of_MEs[DirName+"/"+"SubJet3_CMSTopTag_mass_boosted"]; if(mSubJet3_CMSTopTag_mass_boosted && mSubJet3_CMSTopTag_mass_boosted->getRootObject()) mSubJet3_CMSTopTag_mass_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[2]->mass());
2703  if((*patJets)[ijet].subjets("CMSTopTag").size()>3){
2704  mSubJet4_CMSTopTag_pt_boosted=map_of_MEs[DirName+"/"+"SubJet4_CMSTopTag_pt_boosted"]; if(mSubJet4_CMSTopTag_pt_boosted && mSubJet4_CMSTopTag_pt_boosted->getRootObject()) mSubJet4_CMSTopTag_pt_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[3]->pt());
2705  mSubJet4_CMSTopTag_eta_boosted=map_of_MEs[DirName+"/"+"SubJet4_CMSTopTag_eta_boosted"]; if(mSubJet4_CMSTopTag_eta_boosted && mSubJet4_CMSTopTag_eta_boosted->getRootObject()) mSubJet4_CMSTopTag_eta_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[3]->eta());
2706  mSubJet4_CMSTopTag_phi_boosted=map_of_MEs[DirName+"/"+"SubJet4_CMSTopTag_phi_boosted"]; if(mSubJet4_CMSTopTag_phi_boosted && mSubJet4_CMSTopTag_phi_boosted->getRootObject()) mSubJet4_CMSTopTag_phi_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[3]->phi());
2707  mSubJet4_CMSTopTag_mass_boosted=map_of_MEs[DirName+"/"+"SubJet4_CMSTopTag_mass_boosted"]; if(mSubJet4_CMSTopTag_mass_boosted && mSubJet4_CMSTopTag_mass_boosted->getRootObject()) mSubJet4_CMSTopTag_mass_boosted->Fill((*patJets)[ijet].subjets("CMSTopTag")[3]->mass());
2708  }
2709  }
2710  }
2711  }
2712  if((*patJets)[ijet].hasSubjets("SoftDrop")){
2713  mnSubJetsSoftDrop_boosted=map_of_MEs[DirName+"/"+"nSubJets_SoftDrop_boosted"]; if(mnSubJetsSoftDrop_boosted && mnSubJetsSoftDrop_boosted->getRootObject()) mnSubJetsSoftDrop_boosted->Fill((*patJets)[ijet].subjets("SoftDrop").size());
2714  }
2715  if((*patJets)[ijet].hasSubjets("SoftDrop") && (*patJets)[ijet].subjets("SoftDrop").size()>0){
2716  mSubJet1_SoftDrop_pt_boosted=map_of_MEs[DirName+"/"+"SubJet1_SoftDrop_pt_boosted"]; if(mSubJet1_SoftDrop_pt_boosted && mSubJet1_SoftDrop_pt_boosted->getRootObject()) mSubJet1_SoftDrop_pt_boosted->Fill((*patJets)[ijet].subjets("SoftDrop")[0]->pt());
2717  mSubJet1_SoftDrop_eta_boosted=map_of_MEs[DirName+"/"+"SubJet1_SoftDrop_eta_boosted"]; if(mSubJet1_SoftDrop_eta_boosted && mSubJet1_SoftDrop_eta_boosted->getRootObject()) mSubJet1_SoftDrop_eta_boosted->Fill((*patJets)[ijet].subjets("SoftDrop")[0]->eta());
2718  mSubJet1_SoftDrop_phi_boosted=map_of_MEs[DirName+"/"+"SubJet1_SoftDrop_phi_boosted"]; if(mSubJet1_SoftDrop_phi_boosted && mSubJet1_SoftDrop_phi_boosted->getRootObject()) mSubJet1_SoftDrop_phi_boosted->Fill((*patJets)[ijet].subjets("SoftDrop")[0]->phi());
2719  mSubJet1_SoftDrop_mass_boosted=map_of_MEs[DirName+"/"+"SubJet1_SoftDrop_mass_boosted"]; if(mSubJet1_SoftDrop_mass_boosted && mSubJet1_SoftDrop_mass_boosted->getRootObject()) mSubJet1_SoftDrop_mass_boosted->Fill((*patJets)[ijet].subjets("SoftDrop")[0]->mass());
2720  if((*patJets)[ijet].subjets("SoftDrop").size()>1){
2721  mSubJet2_SoftDrop_pt_boosted=map_of_MEs[DirName+"/"+"SubJet2_SoftDrop_pt_boosted"]; if(mSubJet2_SoftDrop_pt_boosted && mSubJet2_SoftDrop_pt_boosted->getRootObject()) mSubJet2_SoftDrop_pt_boosted->Fill((*patJets)[ijet].subjets("SoftDrop")[1]->pt());
2722  mSubJet2_SoftDrop_eta_boosted=map_of_MEs[DirName+"/"+"SubJet2_SoftDrop_eta_boosted"]; if(mSubJet2_SoftDrop_eta_boosted && mSubJet2_SoftDrop_eta_boosted->getRootObject()) mSubJet2_SoftDrop_eta_boosted->Fill((*patJets)[ijet].subjets("SoftDrop")[1]->eta());
2723  mSubJet2_SoftDrop_phi_boosted=map_of_MEs[DirName+"/"+"SubJet2_SoftDrop_phi_boosted"]; if(mSubJet2_SoftDrop_phi_boosted && mSubJet2_SoftDrop_phi_boosted->getRootObject()) mSubJet2_SoftDrop_phi_boosted->Fill((*patJets)[ijet].subjets("SoftDrop")[1]->phi());
2724  mSubJet2_SoftDrop_mass_boosted=map_of_MEs[DirName+"/"+"SubJet2_SoftDrop_mass_boosted"]; if(mSubJet2_SoftDrop_mass_boosted && mSubJet2_SoftDrop_mass_boosted->getRootObject()) mSubJet2_SoftDrop_mass_boosted->Fill((*patJets)[ijet].subjets("SoftDrop")[1]->mass());
2725  }
2726  }
2727  }//substructure filling for boosted
2728  }//substructure filling
2729  }
2730  // --- Event passed the low pt jet trigger
2731  if (jetLoPass_ == 1) {
2732  mPhi_Lo = map_of_MEs[DirName+"/"+"Phi_Lo"]; if (mPhi_Lo && mPhi_Lo->getRootObject()) mPhi_Lo->Fill (correctedJet.phi());
2733  mPt_Lo = map_of_MEs[DirName+"/"+"Pt_Lo"]; if (mPt_Lo && mPt_Lo->getRootObject()) mPt_Lo->Fill (correctedJet.pt());
2734 
2735  }
2736  // --- Event passed the high pt jet trigger
2737  if (jetHiPass_ == 1&& correctedJet.pt()>100. ) {
2738  mEta_Hi = map_of_MEs[DirName+"/"+"Eta_Hi"]; if (mEta_Hi && mEta_Hi->getRootObject()) mEta_Hi->Fill (correctedJet.eta());
2739  mPhi_Hi = map_of_MEs[DirName+"/"+"Phi_Hi"]; if (mPhi_Hi && mPhi_Hi->getRootObject()) mPhi_Hi->Fill (correctedJet.phi());
2740  mPt_Hi = map_of_MEs[DirName+"/"+"Pt_Hi"]; if (mPt_Hi && mPt_Hi->getRootObject()) mPt_Hi->Fill (correctedJet.pt());
2741  }
2742  mPt = map_of_MEs[DirName+"/"+"Pt"]; if (mPt && mPt->getRootObject()) mPt->Fill (correctedJet.pt());
2743  mPt_1 = map_of_MEs[DirName+"/"+"Pt_1"]; if (mPt_1 && mPt_1->getRootObject()) mPt_1->Fill (correctedJet.pt());
2744  mPt_2 = map_of_MEs[DirName+"/"+"Pt_2"]; if (mPt_2 && mPt_2->getRootObject()) mPt_2->Fill (correctedJet.pt());
2745  mPt_3 = map_of_MEs[DirName+"/"+"Pt_3"]; if (mPt_3 && mPt_3->getRootObject()) mPt_3->Fill (correctedJet.pt());
2746  mEta = map_of_MEs[DirName+"/"+"Eta"]; if (mEta && mEta->getRootObject()) mEta->Fill (correctedJet.eta());
2747  mPhi = map_of_MEs[DirName+"/"+"Phi"]; if (mPhi && mPhi->getRootObject()) mPhi->Fill (correctedJet.phi());
2748 
2749  mPhiVSEta = map_of_MEs[DirName+"/"+"PhiVSEta"]; if (mPhiVSEta && mPhiVSEta->getRootObject()) mPhiVSEta->Fill(correctedJet.eta(),correctedJet.phi());
2750  //if(!isJPTJet_){
2751  mConstituents = map_of_MEs[DirName+"/"+"Constituents"]; if (mConstituents && mConstituents->getRootObject()) mConstituents->Fill (correctedJet.nConstituents());
2752  //}
2753  // Fill NPV profiles
2754  //--------------------------------------------------------------------
2755  mPt_profile = map_of_MEs[DirName+"/"+"Pt_profile"]; if (mPt_profile && mPt_profile->getRootObject()) mPt_profile ->Fill(numPV, correctedJet.pt());
2756  mEta_profile = map_of_MEs[DirName+"/"+"Eta_profile"]; if (mEta_profile && mEta_profile->getRootObject()) mEta_profile ->Fill(numPV, correctedJet.eta());
2757  mPhi_profile = map_of_MEs[DirName+"/"+"Phi_profile"]; if (mPhi_profile && mPhi_profile->getRootObject()) mPhi_profile ->Fill(numPV, correctedJet.phi());
2758  //if(!isJPTJet_){
2759  mConstituents_profile = map_of_MEs[DirName+"/"+"Constituents_profile"]; if (mConstituents_profile && mConstituents_profile->getRootObject()) mConstituents_profile->Fill(numPV, correctedJet.nConstituents());
2760  //}
2761  if (fabs(correctedJet.eta()) <= 1.3) {
2762  mPt_Barrel = map_of_MEs[DirName+"/"+"Pt_Barrel"]; if (mPt_Barrel && mPt_Barrel->getRootObject()) mPt_Barrel->Fill (correctedJet.pt());
2763  mPhi_Barrel = map_of_MEs[DirName+"/"+"Phi_Barrel"]; if (mPhi_Barrel && mPhi_Barrel->getRootObject()) mPhi_Barrel->Fill (correctedJet.phi());
2764  //if (mE_Barrel) mE_Barrel->Fill (correctedJet.energy());
2765  //if(!isJPTJet_){
2766  mConstituents_Barrel = map_of_MEs[DirName+"/"+"Constituents_Barrel"]; if (mConstituents_Barrel && mConstituents_Barrel->getRootObject()) mConstituents_Barrel->Fill(correctedJet.nConstituents());
2767  //}
2768  }else if (fabs(correctedJet.eta()) <= 3) {
2769  mPt_EndCap = map_of_MEs[DirName+"/"+"Pt_EndCap"]; if (mPt_EndCap && mPt_EndCap->getRootObject()) mPt_EndCap->Fill (correctedJet.pt());
2770  mPhi_EndCap = map_of_MEs[DirName+"/"+"Phi_EndCap"]; if (mPhi_EndCap && mPhi_EndCap->getRootObject()) mPhi_EndCap->Fill (correctedJet.phi());
2771  //if (mE_EndCap) mE_EndCap->Fill (correctedJet.energy());
2772  //if(!isJPTJet_){
2773  mConstituents_EndCap = map_of_MEs[DirName+"/"+"Constituents_EndCap"]; if (mConstituents_EndCap && mConstituents_EndCap->getRootObject()) mConstituents_EndCap->Fill(correctedJet.nConstituents());
2774  //}
2775  }else{
2776  mPt_Forward = map_of_MEs[DirName+"/"+"Pt_Forward"]; if (mPt_Forward && mPt_Forward->getRootObject()) mPt_Forward->Fill (correctedJet.pt());
2777  mPhi_Forward = map_of_MEs[DirName+"/"+"Phi_Forward"]; if (mPhi_Forward && mPhi_Forward->getRootObject()) mPhi_Forward->Fill (correctedJet.phi());
2778  //if (mE_Forward) mE_Forward->Fill (correctedJet.energy());
2779  //if(!isJPTJet_){
2780  mConstituents_Forward = map_of_MEs[DirName+"/"+"Constituents_Forward"]; if (mConstituents_Forward && mConstituents_Forward->getRootObject()) mConstituents_Forward->Fill(correctedJet.nConstituents());
2781  //}
2782  }
2783  }// pass ID for corrected jets --> inclusive selection
2784  }//loop over uncorrected jets
2785 
2786 
2787  mNJets = map_of_MEs[DirName+"/"+"NJets"]; if (mNJets && mNJets->getRootObject()) mNJets->Fill (numofjets);
2788  mNJets_profile = map_of_MEs[DirName+"/"+"NJets_profile"]; if (mNJets_profile && mNJets_profile->getRootObject()) mNJets_profile->Fill(numPV, numofjets);
2789 
2790  sort(recoJets.begin(),recoJets.end(),jetSortingRule);
2791 
2792  //for non dijet selection, otherwise numofjets==0
2793  if(numofjets>0){//keep threshold for dijet counting at the original one
2794  //check ID of the leading jet
2795 
2796  if(cleaned_first_jet){
2797  mEtaFirst = map_of_MEs[DirName+"/"+"EtaFirst"]; if (mEtaFirst && mEtaFirst->getRootObject()) mEtaFirst->Fill ((recoJets)[0].eta());
2798  mPhiFirst = map_of_MEs[DirName+"/"+"PhiFirst"]; if (mPhiFirst && mPhiFirst->getRootObject()) mPhiFirst->Fill ((recoJets)[0].phi());
2799  mPtFirst = map_of_MEs[DirName+"/"+"PtFirst"]; if (mPtFirst && mPtFirst->getRootObject()) mPtFirst->Fill ((recoJets)[0].pt());
2800  //check ID of second check for DPhi plots
2801  if(numofjets>1 && cleaned_second_jet) {
2802  double dphi=fabs((recoJets)[0].phi()-(recoJets)[1].phi());
2803  if(dphi>acos(-1.)){
2804  dphi=2*acos(-1.)-dphi;
2805  }
2806  mDPhi = map_of_MEs[DirName+"/"+"DPhi"]; if (mDPhi && mDPhi->getRootObject()) mDPhi->Fill (dphi);
2807  }
2808  }
2809  //if(cleaned_second_jet && isJPTJet_){
2810  //mPtSecond = map_of_MEs[DirName+"/"+"PtSecond"]; if (mPtSecond && mPtSecond->getRootObject()) mPtSecond->Fill(recoJets[1].pt());
2811  //}
2812  //if(cleaned_third_jet && isJPTJet_){
2813  //mPtThird = map_of_MEs[DirName+"/"+"PtThird"]; if (mPtThird && mPtThird->getRootObject()) mPtThird->Fill(recoJets[2].pt());
2814  //}
2815  }
2816  //dijet selection -> recoJets are on corrected level, both jets cleaned, fill folder only for cleaned jet selection
2817  if(jetCleaningFlag_ && recoJets.size()>1 && cleaned_first_jet && cleaned_second_jet ){
2818  //pt threshold checked before filling
2819  if(jetCleaningFlag_){
2820  DirName = "JetMET/Jet/Cleaned"+mInputCollection_.label()+"/DiJet";
2821  }
2822  //if(fabs(recoJets[0].eta())<3. && fabs(recoJets[1].eta())<3. ){
2823  //calculate dphi
2824  double dphi=fabs((recoJets)[0].phi()-(recoJets)[1].phi());
2825  if(dphi>acos(-1.)){
2826  dphi=2*acos(-1.)-dphi;
2827  }
2828  mDPhi = map_of_MEs[DirName+"/"+"DPhi"]; if (mDPhi && mDPhi->getRootObject()) if (mDPhi) mDPhi->Fill (dphi);
2829  //dphi cut
2830  if(fabs(dphi)>2.1){
2831  if(isCaloJet_){
2832  if(!runcosmics_){
2833  reco::CaloJetRef calojetref1(caloJets, ind1);
2834  reco::JetID jetID1 = (*jetID_ValueMap_Handle)[calojetref1];
2835  reco::CaloJetRef calojetref2(caloJets, ind2);
2836  reco::JetID jetID2 = (*jetID_ValueMap_Handle)[calojetref2];
2837  mN90Hits = map_of_MEs[DirName+"/"+"N90Hits"]; if (mN90Hits && mN90Hits->getRootObject()) mN90Hits->Fill (jetID1.n90Hits);
2838  mfHPD = map_of_MEs[DirName+"/"+"fHPD"]; if (mfHPD && mfHPD->getRootObject()) mfHPD->Fill (jetID1.fHPD);
2839  mresEMF = map_of_MEs[DirName+"/"+"resEMF"]; if (mresEMF && mresEMF->getRootObject()) mresEMF->Fill (jetID1.restrictedEMF);
2840  mfRBX = map_of_MEs[DirName+"/"+"fRBX"]; if (mfRBX && mfRBX->getRootObject()) mfRBX->Fill (jetID1.fRBX);
2841  mN90Hits = map_of_MEs[DirName+"/"+"N90Hits"]; if (mN90Hits && mN90Hits->getRootObject()) mN90Hits->Fill (jetID2.n90Hits);
2842  mfHPD = map_of_MEs[DirName+"/"+"fHPD"]; if (mfHPD && mfHPD->getRootObject()) mfHPD->Fill (jetID2.fHPD);
2843  mresEMF = map_of_MEs[DirName+"/"+"resEMF"]; if (mresEMF && mresEMF->getRootObject()) mresEMF->Fill (jetID2.restrictedEMF);
2844  mfRBX = map_of_MEs[DirName+"/"+"fRBX"]; if (mfRBX && mfRBX->getRootObject()) mfRBX->Fill (jetID2.fRBX);
2845  }
2846  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*caloJets)[ind1].energyFractionHadronic());
2847  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*caloJets)[ind1].emEnergyFraction());
2848  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*caloJets)[ind2].energyFractionHadronic());
2849  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*caloJets)[ind2].emEnergyFraction());
2850  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*caloJets)[ind1].energyFractionHadronic());
2851  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*caloJets)[ind1].emEnergyFraction());
2852  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*caloJets)[ind2].energyFractionHadronic());
2853  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*caloJets)[ind2].emEnergyFraction());
2854 
2855  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[0].pt()/(*caloJets)[ind1].pt());
2856  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[0].eta(),recoJets[0].pt()/(*caloJets)[ind1].pt());
2857  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[0].pt(),recoJets[0].pt()/(*caloJets)[ind1].pt());
2858  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[1].pt()/(*caloJets)[ind2].pt());
2859  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[1].eta(),recoJets[1].pt()/(*caloJets)[ind2].pt());
2860  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[1].pt(),recoJets[1].pt()/(*caloJets)[ind2].pt());
2861  }
2862  //if(isJPTJet_){
2863  //mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*jptJets)[ind1].chargedHadronEnergyFraction()+(*jptJets)[ind1].neutralHadronEnergyFraction());
2864  //mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill (1.-(*jptJets)[ind1].chargedHadronEnergyFraction()-(*jptJets)[ind1].neutralHadronEnergyFraction());
2865  //mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; mHFrac_profile ->Fill(numPV, (*jptJets)[ind1].chargedHadronEnergyFraction()+(*jptJets)[ind1].neutralHadronEnergyFraction());
2866  //mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; mEFrac_profile ->Fill(numPV, 1.-(*jptJets)[ind1].chargedHadronEnergyFraction()-(*jptJets)[ind1].neutralHadronEnergyFraction());
2867  //mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*jptJets)[ind2].chargedHadronEnergyFraction()+(*jptJets)[ind2].neutralHadronEnergyFraction());
2868  //mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill (1.-(*jptJets)[ind2].chargedHadronEnergyFraction()-(*jptJets)[ind2].neutralHadronEnergyFraction());
2869  //mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; mHFrac_profile ->Fill(numPV, (*jptJets)[ind2].chargedHadronEnergyFraction()+(*jptJets)[ind2].neutralHadronEnergyFraction());
2870  //mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; mEFrac_profile ->Fill(numPV, 1.-(*jptJets)[ind2].chargedHadronEnergyFraction()-(*jptJets)[ind2].neutralHadronEnergyFraction());
2871  //
2872  //mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[0].pt()/(*jptJets)[ind1].pt());
2873  //mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[0].eta(),recoJets[0].pt()/(*jptJets)[ind1].pt());
2874  //mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[0].pt(),recoJets[0].pt()/(*jptJets)[ind1].pt());
2875  //mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[1].pt()/(*jptJets)[ind2].pt());
2876  //mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[1].eta(),recoJets[1].pt()/(*jptJets)[ind2].pt());
2877  //mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[1].pt(),recoJets[1].pt()/(*jptJets)[ind2].pt());
2878  //}
2879  if(isPFJet_){
2880  mCHFrac = map_of_MEs[DirName+"/"+"CHFrac"]; if (mCHFrac && mCHFrac->getRootObject()) mCHFrac ->Fill((*pfJets)[ind1].chargedHadronEnergyFraction());
2881  mNHFrac = map_of_MEs[DirName+"/"+"NHFrac"]; if (mNHFrac && mNHFrac->getRootObject()) mNHFrac ->Fill((*pfJets)[ind1].neutralHadronEnergyFraction());
2882  mPhFrac = map_of_MEs[DirName+"/"+"PhFrac"]; if (mPhFrac && mPhFrac->getRootObject()) mPhFrac ->Fill((*pfJets)[ind1].neutralEmEnergyFraction());
2883  mHFEMFrac = map_of_MEs[DirName+"/"+"HFEMFrac"]; if (mHFEMFrac && mHFEMFrac->getRootObject()) mHFEMFrac ->Fill((*pfJets)[ind1].HFEMEnergyFraction());
2884  mHFHFrac = map_of_MEs[DirName+"/"+"HFHFrac"]; if (mHFHFrac && mHFHFrac->getRootObject()) mHFHFrac ->Fill((*pfJets)[ind1].HFHadronEnergyFraction());
2885 
2886  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[0].pt()/(*pfJets)[ind1].pt());
2887  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[0].eta(),recoJets[0].pt()/(*pfJets)[ind1].pt());
2888  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[0].pt(),recoJets[0].pt()/(*pfJets)[ind1].pt());
2889  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[1].pt()/(*pfJets)[ind2].pt());
2890  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[1].eta(),recoJets[1].pt()/(*pfJets)[ind2].pt());
2891  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[1].pt(),recoJets[1].pt()/(*pfJets)[ind2].pt());
2892 
2893  mChargedMultiplicity = map_of_MEs[DirName+"/"+"ChargedMultiplicity"]; if(mChargedMultiplicity && mChargedMultiplicity->getRootObject()) mChargedMultiplicity->Fill((*pfJets)[ind1].chargedMultiplicity());
2894  mNeutralMultiplicity = map_of_MEs[DirName+"/"+"NeutralMultiplicity"]; if(mNeutralMultiplicity && mNeutralMultiplicity->getRootObject()) mNeutralMultiplicity->Fill((*pfJets)[ind1].neutralMultiplicity());
2895  mMuonMultiplicity = map_of_MEs[DirName+"/"+"MuonMultiplicity"]; if(mMuonMultiplicity && mMuonMultiplicity->getRootObject()) mMuonMultiplicity->Fill((*pfJets)[ind1].muonMultiplicity());
2896  //Filling variables for second jet
2897  mCHFrac = map_of_MEs[DirName+"/"+"CHFrac"]; if (mCHFrac && mCHFrac->getRootObject()) mCHFrac ->Fill((*pfJets)[ind2].chargedHadronEnergyFraction());
2898  mNHFrac = map_of_MEs[DirName+"/"+"NHFrac"]; if (mNHFrac && mNHFrac->getRootObject()) mNHFrac ->Fill((*pfJets)[ind2].neutralHadronEnergyFraction());
2899  mPhFrac = map_of_MEs[DirName+"/"+"PhFrac"]; if (mPhFrac && mPhFrac->getRootObject()) mPhFrac ->Fill((*pfJets)[ind2].neutralEmEnergyFraction());
2900  mHFEMFrac = map_of_MEs[DirName+"/"+"HFEMFrac"]; if (mHFEMFrac && mHFEMFrac->getRootObject()) mHFEMFrac ->Fill((*pfJets)[ind2].HFEMEnergyFraction());
2901  mHFHFrac = map_of_MEs[DirName+"/"+"HFHFrac"]; if (mHFHFrac && mHFHFrac->getRootObject()) mHFHFrac ->Fill((*pfJets)[ind2].HFHadronEnergyFraction());
2902 
2903  mNeutralFraction = map_of_MEs[DirName+"/"+"NeutralConstituentsFraction"];if (mNeutralFraction && mNeutralFraction->getRootObject()) mNeutralFraction->Fill ((double)(*pfJets)[ind1].neutralMultiplicity()/(double)(*pfJets)[ind1].nConstituents());
2904 
2905  mChargedMultiplicity = map_of_MEs[DirName+"/"+"ChargedMultiplicity"]; if(mChargedMultiplicity && mChargedMultiplicity->getRootObject()) mChargedMultiplicity->Fill((*pfJets)[ind2].chargedMultiplicity());
2906  mNeutralMultiplicity = map_of_MEs[DirName+"/"+"NeutralMultiplicity"]; if(mNeutralMultiplicity && mNeutralMultiplicity->getRootObject()) mNeutralMultiplicity->Fill((*pfJets)[ind2].neutralMultiplicity());
2907  mMuonMultiplicity = map_of_MEs[DirName+"/"+"MuonMultiplicity"]; if(mMuonMultiplicity && mMuonMultiplicity->getRootObject()) mMuonMultiplicity->Fill((*pfJets)[ind2].muonMultiplicity());
2908 
2909  //now fill PFJet profiles for leading jet
2910  mCHFrac_profile = map_of_MEs[DirName+"/"+"CHFrac_profile"]; if (mCHFrac_profile && mCHFrac_profile->getRootObject()) mCHFrac_profile ->Fill(numPV, (*pfJets)[ind1].chargedHadronEnergyFraction());
2911  mNHFrac_profile = map_of_MEs[DirName+"/"+"NHFrac_profile"]; if (mNHFrac_profile && mNHFrac_profile->getRootObject()) mNHFrac_profile ->Fill(numPV, (*pfJets)[ind1].neutralHadronEnergyFraction());
2912  mPhFrac_profile = map_of_MEs[DirName+"/"+"PhFrac_profile"]; if (mPhFrac_profile && mPhFrac_profile->getRootObject()) mPhFrac_profile ->Fill(numPV, (*pfJets)[ind1].neutralEmEnergyFraction());
2913  mHFEMFrac_profile = map_of_MEs[DirName+"/"+"HFEMFrac_profile"]; if (mHFEMFrac_profile && mHFEMFrac_profile->getRootObject()) mHFEMFrac_profile ->Fill(numPV, (*pfJets)[ind1].HFEMEnergyFraction());
2914  mHFHFrac_profile = map_of_MEs[DirName+"/"+"HFHFrac_profile"]; if (mHFHFrac_profile && mHFHFrac_profile->getRootObject()) mHFHFrac_profile ->Fill(numPV, (*pfJets)[ind1].HFHadronEnergyFraction());
2915 
2916  mNeutralFraction = map_of_MEs[DirName+"/"+"NeutralConstituentsFraction"];if (mNeutralFraction && mNeutralFraction->getRootObject()) mNeutralFraction->Fill ((double)(*pfJets)[ind2].neutralMultiplicity()/(double)(*pfJets)[ind2].nConstituents());
2917 
2918  mChargedMultiplicity_profile = map_of_MEs[DirName+"/"+"ChargedMultiplicity_profile"]; if(mChargedMultiplicity_profile && mChargedMultiplicity_profile->getRootObject()) mChargedMultiplicity_profile->Fill(numPV, (*pfJets)[ind1].chargedMultiplicity());
2919  mNeutralMultiplicity_profile = map_of_MEs[DirName+"/"+"NeutralMultiplicity_profile"]; if(mNeutralMultiplicity_profile && mNeutralMultiplicity_profile->getRootObject()) mNeutralMultiplicity_profile->Fill(numPV, (*pfJets)[ind1].neutralMultiplicity());
2920  mMuonMultiplicity_profile = map_of_MEs[DirName+"/"+"MuonMultiplicity_profile"]; if(mMuonMultiplicity_profile && mMuonMultiplicity_profile->getRootObject()) mMuonMultiplicity->Fill(numPV, (*pfJets)[ind1].muonMultiplicity());
2921  //now fill PFJet profiles for second leading jet
2922  mCHFrac_profile = map_of_MEs[DirName+"/"+"CHFrac_profile"]; if (mCHFrac_profile && mCHFrac_profile->getRootObject()) mCHFrac_profile ->Fill(numPV, (*pfJets)[ind2].chargedHadronEnergyFraction());
2923  mNHFrac_profile = map_of_MEs[DirName+"/"+"NHFrac_profile"]; if (mNHFrac_profile && mNHFrac_profile->getRootObject()) mNHFrac_profile ->Fill(numPV, (*pfJets)[ind2].neutralHadronEnergyFraction());
2924  mPhFrac_profile = map_of_MEs[DirName+"/"+"PhFrac_profile"]; if (mPhFrac_profile && mPhFrac_profile->getRootObject()) mPhFrac_profile ->Fill(numPV, (*pfJets)[ind2].neutralEmEnergyFraction());
2925  mHFEMFrac_profile = map_of_MEs[DirName+"/"+"HFEMFrac_profile"]; if (mHFEMFrac_profile && mHFEMFrac_profile->getRootObject()) mHFEMFrac_profile ->Fill(numPV, (*pfJets)[ind2].HFEMEnergyFraction());
2926  mHFHFrac_profile = map_of_MEs[DirName+"/"+"HFHFrac_profile"]; if (mHFHFrac_profile && mHFHFrac_profile->getRootObject()) mHFHFrac_profile ->Fill(numPV, (*pfJets)[ind2].HFHadronEnergyFraction());
2927 
2928  mChargedMultiplicity_profile = map_of_MEs[DirName+"/"+"ChargedMultiplicity_profile"]; if(mChargedMultiplicity_profile && mChargedMultiplicity_profile->getRootObject()) mChargedMultiplicity_profile->Fill(numPV, (*pfJets)[ind2].chargedMultiplicity());
2929  mNeutralMultiplicity_profile = map_of_MEs[DirName+"/"+"NeutralMultiplicity_profile"]; if(mNeutralMultiplicity_profile && mNeutralMultiplicity_profile->getRootObject()) mNeutralMultiplicity_profile->Fill(numPV, (*pfJets)[ind2].neutralMultiplicity());
2930  mMuonMultiplicity_profile = map_of_MEs[DirName+"/"+"MuonMultiplicity_profile"]; if(mMuonMultiplicity_profile && mMuonMultiplicity_profile->getRootObject()) mMuonMultiplicity_profile->Fill(numPV, (*pfJets)[ind2].muonMultiplicity());
2931 
2932 
2933  int QGmulti=-1;
2934  float QGLikelihood=-10;
2935  float QGptD=-10;
2936  float QGaxis2=-10;
2937  if(fill_CHS_histos){
2938  reco::PFJetRef pfjetref(pfJets,ind1);
2939  QGmulti=(*qgMultiplicity)[pfjetref];
2940  QGLikelihood=(*qgLikelihood)[pfjetref];
2941  QGptD=(*qgptD)[pfjetref];
2942  QGaxis2=(*qgaxis2)[pfjetref];
2943  if(fabs(recoJets[0].eta())<1.3){//barrel jets
2944  //fractions for barrel
2945  if (recoJets[0].pt()>=20. && recoJets[0].pt()<=50.) {
2946  mAxis2_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_Barrel"];if(mAxis2_lowPt_Barrel && mAxis2_lowPt_Barrel->getRootObject()) mAxis2_lowPt_Barrel->Fill(QGaxis2);
2947  mpTD_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_Barrel"]; if(mpTD_lowPt_Barrel && mpTD_lowPt_Barrel->getRootObject()) mpTD_lowPt_Barrel->Fill(QGptD);
2948  mMultiplicityQG_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_Barrel"]; if(mMultiplicityQG_lowPt_Barrel && mMultiplicityQG_lowPt_Barrel->getRootObject()) mMultiplicityQG_lowPt_Barrel->Fill(QGmulti);
2949  mqgLikelihood_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_Barrel"]; if(mqgLikelihood_lowPt_Barrel && mqgLikelihood_lowPt_Barrel->getRootObject()) mqgLikelihood_lowPt_Barrel->Fill(QGLikelihood);
2950  }
2951  if (recoJets[0].pt()>50. && recoJets[0].pt()<=140.) {
2952  mAxis2_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_Barrel"];if(mAxis2_mediumPt_Barrel && mAxis2_mediumPt_Barrel->getRootObject()) mAxis2_mediumPt_Barrel->Fill(QGaxis2);
2953  mpTD_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_Barrel"]; if(mpTD_mediumPt_Barrel && mpTD_mediumPt_Barrel->getRootObject()) mpTD_mediumPt_Barrel->Fill(QGptD);
2954  mMultiplicityQG_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_Barrel"]; if(mMultiplicityQG_mediumPt_Barrel && mMultiplicityQG_mediumPt_Barrel->getRootObject()) mMultiplicityQG_mediumPt_Barrel->Fill(QGmulti);
2955  mqgLikelihood_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_Barrel"]; if(mqgLikelihood_mediumPt_Barrel && mqgLikelihood_mediumPt_Barrel->getRootObject()) mqgLikelihood_mediumPt_Barrel->Fill(QGLikelihood);
2956  }
2957  if (recoJets[0].pt()>140.) {
2958  mAxis2_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_Barrel"];if(mAxis2_highPt_Barrel && mAxis2_highPt_Barrel->getRootObject()) mAxis2_highPt_Barrel->Fill(QGaxis2);
2959  mpTD_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_highPt_Barrel"]; if(mpTD_highPt_Barrel && mpTD_highPt_Barrel->getRootObject()) mpTD_highPt_Barrel->Fill(QGptD);
2960  mMultiplicityQG_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_Barrel"]; if(mMultiplicityQG_highPt_Barrel && mMultiplicityQG_highPt_Barrel->getRootObject()) mMultiplicityQG_highPt_Barrel->Fill(QGmulti);
2961  mqgLikelihood_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_Barrel"]; if(mqgLikelihood_highPt_Barrel && mqgLikelihood_highPt_Barrel->getRootObject()) mqgLikelihood_highPt_Barrel->Fill(QGLikelihood);
2962  }
2963  }else if(fabs(recoJets[0].eta())<3.0){//endcap jets
2964  if (recoJets[0].pt()>20. && recoJets[0].pt()<=50.) {
2965  mAxis2_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_EndCap"];if(mAxis2_lowPt_EndCap && mAxis2_lowPt_EndCap->getRootObject()) mAxis2_lowPt_EndCap->Fill(QGaxis2);
2966  mpTD_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_EndCap"]; if(mpTD_lowPt_EndCap && mpTD_lowPt_EndCap->getRootObject()) mpTD_lowPt_EndCap->Fill(QGptD);
2967  mMultiplicityQG_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_EndCap"]; if(mMultiplicityQG_lowPt_EndCap && mMultiplicityQG_lowPt_EndCap->getRootObject()) mMultiplicityQG_lowPt_EndCap->Fill(QGmulti);
2968  mqgLikelihood_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_EndCap"]; if(mqgLikelihood_lowPt_EndCap && mqgLikelihood_lowPt_EndCap->getRootObject()) mqgLikelihood_lowPt_EndCap->Fill(QGLikelihood);
2969  }
2970  if (recoJets[0].pt()>50. && recoJets[0].pt()<=140.) {
2971  mAxis2_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_EndCap"];if(mAxis2_mediumPt_EndCap && mAxis2_mediumPt_EndCap->getRootObject()) mAxis2_mediumPt_EndCap->Fill(QGaxis2);
2972  mpTD_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_EndCap"]; if(mpTD_mediumPt_EndCap && mpTD_mediumPt_EndCap->getRootObject()) mpTD_mediumPt_EndCap->Fill(QGptD);
2973  mMultiplicityQG_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_EndCap"]; if(mMultiplicityQG_mediumPt_EndCap && mMultiplicityQG_mediumPt_EndCap->getRootObject()) mMultiplicityQG_mediumPt_EndCap->Fill(QGmulti);
2974  mqgLikelihood_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_EndCap"]; if(mqgLikelihood_mediumPt_EndCap && mqgLikelihood_mediumPt_EndCap->getRootObject()) mqgLikelihood_mediumPt_EndCap->Fill(QGLikelihood);
2975  }
2976  if (recoJets[0].pt()>140.) {
2977  mAxis2_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_EndCap"];if(mAxis2_highPt_EndCap && mAxis2_highPt_EndCap->getRootObject()) mAxis2_highPt_EndCap->Fill(QGaxis2);
2978  mpTD_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_highPt_EndCap"]; if(mpTD_highPt_EndCap && mpTD_highPt_EndCap->getRootObject()) mpTD_highPt_EndCap->Fill(QGptD);
2979  mMultiplicityQG_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_EndCap"]; if(mMultiplicityQG_highPt_EndCap && mMultiplicityQG_highPt_EndCap->getRootObject()) mMultiplicityQG_highPt_EndCap->Fill(QGmulti);
2980  mqgLikelihood_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_EndCap"]; if(mqgLikelihood_highPt_EndCap && mqgLikelihood_highPt_EndCap->getRootObject()) mqgLikelihood_highPt_EndCap->Fill(QGLikelihood);
2981  }
2982  }else{
2983  if (recoJets[0].pt()>20. && recoJets[0].pt()<=50.) {
2984  mAxis2_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_Forward"];if(mAxis2_lowPt_Forward && mAxis2_lowPt_Forward->getRootObject()) mAxis2_lowPt_Forward->Fill(QGaxis2);
2985  mpTD_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_Forward"]; if(mpTD_lowPt_Forward && mpTD_lowPt_Forward->getRootObject()) mpTD_lowPt_Forward->Fill(QGptD);
2986  mMultiplicityQG_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_Forward"]; if(mMultiplicityQG_lowPt_Forward && mMultiplicityQG_lowPt_Forward->getRootObject()) mMultiplicityQG_lowPt_Forward->Fill(QGmulti);
2987  mqgLikelihood_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_Forward"]; if(mqgLikelihood_lowPt_Forward && mqgLikelihood_lowPt_Forward->getRootObject()) mqgLikelihood_lowPt_Forward->Fill(QGLikelihood);
2988  }
2989  if (recoJets[0].pt()>50. && recoJets[0].pt()<=140.) {
2990  mAxis2_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_Forward"];if(mAxis2_mediumPt_Forward && mAxis2_mediumPt_Forward->getRootObject()) mAxis2_mediumPt_Forward->Fill(QGaxis2);
2991  mpTD_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_Forward"]; if(mpTD_mediumPt_Forward && mpTD_mediumPt_Forward->getRootObject()) mpTD_mediumPt_Forward->Fill(QGptD);
2992  mMultiplicityQG_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_Forward"]; if(mMultiplicityQG_mediumPt_Forward && mMultiplicityQG_mediumPt_Forward->getRootObject()) mMultiplicityQG_mediumPt_Forward->Fill(QGmulti);
2993  mqgLikelihood_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_Forward"]; if(mqgLikelihood_mediumPt_Forward && mqgLikelihood_mediumPt_Forward->getRootObject()) mqgLikelihood_mediumPt_Forward->Fill(QGLikelihood);
2994  }
2995  if (recoJets[0].pt()>140.) {
2996  mAxis2_highPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_Forward"];if(mAxis2_highPt_Forward && mAxis2_highPt_Forward->getRootObject()) mAxis2_highPt_Forward->Fill(QGaxis2);
2997  mpTD_highPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_highPt_Forward"]; if(mpTD_highPt_Forward && mpTD_highPt_Forward->getRootObject()) mpTD_highPt_Forward->Fill(QGptD);
2998  mMultiplicityQG_highPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_Forward"]; if(mMultiplicityQG_highPt_Forward && mMultiplicityQG_highPt_Forward->getRootObject()) mMultiplicityQG_highPt_Forward->Fill(QGmulti);
2999  mqgLikelihood_highPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_Forward"]; if(mqgLikelihood_highPt_Forward && mqgLikelihood_highPt_Forward->getRootObject()) mqgLikelihood_highPt_Forward->Fill(QGLikelihood);
3000  }
3001  }//done for first jet
3002  reco::PFJetRef pfjetref1(pfJets,ind2);
3003  QGmulti=(*qgMultiplicity)[pfjetref1];
3004  QGLikelihood=(*qgLikelihood)[pfjetref1];
3005  QGptD=(*qgptD)[pfjetref1];
3006  QGaxis2=(*qgaxis2)[pfjetref1];
3007  if(fabs(recoJets[1].eta())<1.3){//barrel jets
3008  //fractions for barrel
3009  if (recoJets[1].pt()>=20. && recoJets[1].pt()<=50.) {
3010  mAxis2_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_Barrel"];if(mAxis2_lowPt_Barrel && mAxis2_lowPt_Barrel->getRootObject()) mAxis2_lowPt_Barrel->Fill(QGaxis2);
3011  mpTD_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_Barrel"]; if(mpTD_lowPt_Barrel && mpTD_lowPt_Barrel->getRootObject()) mpTD_lowPt_Barrel->Fill(QGptD);
3012  mMultiplicityQG_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_Barrel"]; if(mMultiplicityQG_lowPt_Barrel && mMultiplicityQG_lowPt_Barrel->getRootObject()) mMultiplicityQG_lowPt_Barrel->Fill(QGmulti);
3013  mqgLikelihood_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_Barrel"]; if(mqgLikelihood_lowPt_Barrel && mqgLikelihood_lowPt_Barrel->getRootObject()) mqgLikelihood_lowPt_Barrel->Fill(QGLikelihood);
3014  }
3015  if (recoJets[1].pt()>50. && recoJets[1].pt()<=140.) {
3016  mAxis2_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_Barrel"];if(mAxis2_mediumPt_Barrel && mAxis2_mediumPt_Barrel->getRootObject()) mAxis2_mediumPt_Barrel->Fill(QGaxis2);
3017  mpTD_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_Barrel"]; if(mpTD_mediumPt_Barrel && mpTD_mediumPt_Barrel->getRootObject()) mpTD_mediumPt_Barrel->Fill(QGptD);
3018  mMultiplicityQG_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_Barrel"]; if(mMultiplicityQG_mediumPt_Barrel && mMultiplicityQG_mediumPt_Barrel->getRootObject()) mMultiplicityQG_mediumPt_Barrel->Fill(QGmulti);
3019  mqgLikelihood_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_Barrel"]; if(mqgLikelihood_mediumPt_Barrel && mqgLikelihood_mediumPt_Barrel->getRootObject()) mqgLikelihood_mediumPt_Barrel->Fill(QGLikelihood);
3020  }
3021  if (recoJets[1].pt()>140.) {
3022  mAxis2_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_Barrel"];if(mAxis2_highPt_Barrel && mAxis2_highPt_Barrel->getRootObject()) mAxis2_highPt_Barrel->Fill(QGaxis2);
3023  mpTD_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_highPt_Barrel"]; if(mpTD_highPt_Barrel && mpTD_highPt_Barrel->getRootObject()) mpTD_highPt_Barrel->Fill(QGptD);
3024  mMultiplicityQG_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_Barrel"]; if(mMultiplicityQG_highPt_Barrel && mMultiplicityQG_highPt_Barrel->getRootObject()) mMultiplicityQG_highPt_Barrel->Fill(QGmulti);
3025  mqgLikelihood_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_Barrel"]; if(mqgLikelihood_highPt_Barrel && mqgLikelihood_highPt_Barrel->getRootObject()) mqgLikelihood_highPt_Barrel->Fill(QGLikelihood);
3026  }
3027  }else if(fabs(recoJets[1].eta())<3.0){//endcap jets
3028  if (recoJets[1].pt()>20. && recoJets[1].pt()<=50.) {
3029  mAxis2_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_EndCap"];if(mAxis2_lowPt_EndCap && mAxis2_lowPt_EndCap->getRootObject()) mAxis2_lowPt_EndCap->Fill(QGaxis2);
3030  mpTD_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_EndCap"]; if(mpTD_lowPt_EndCap && mpTD_lowPt_EndCap->getRootObject()) mpTD_lowPt_EndCap->Fill(QGptD);
3031  mMultiplicityQG_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_EndCap"]; if(mMultiplicityQG_lowPt_EndCap && mMultiplicityQG_lowPt_EndCap->getRootObject()) mMultiplicityQG_lowPt_EndCap->Fill(QGmulti);
3032  mqgLikelihood_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_EndCap"]; if(mqgLikelihood_lowPt_EndCap && mqgLikelihood_lowPt_EndCap->getRootObject()) mqgLikelihood_lowPt_EndCap->Fill(QGLikelihood);
3033  }
3034  if (recoJets[1].pt()>50. && recoJets[1].pt()<=140.) {
3035  mAxis2_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_EndCap"];if(mAxis2_mediumPt_EndCap && mAxis2_mediumPt_EndCap->getRootObject()) mAxis2_mediumPt_EndCap->Fill(QGaxis2);
3036  mpTD_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_EndCap"]; if(mpTD_mediumPt_EndCap && mpTD_mediumPt_EndCap->getRootObject()) mpTD_mediumPt_EndCap->Fill(QGptD);
3037  mMultiplicityQG_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_EndCap"]; if(mMultiplicityQG_mediumPt_EndCap && mMultiplicityQG_mediumPt_EndCap->getRootObject()) mMultiplicityQG_mediumPt_EndCap->Fill(QGmulti);
3038  mqgLikelihood_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_EndCap"]; if(mqgLikelihood_mediumPt_EndCap && mqgLikelihood_mediumPt_EndCap->getRootObject()) mqgLikelihood_mediumPt_EndCap->Fill(QGLikelihood);
3039  }
3040  if (recoJets[1].pt()>140.) {
3041  mAxis2_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_EndCap"];if(mAxis2_highPt_EndCap && mAxis2_highPt_EndCap->getRootObject()) mAxis2_highPt_EndCap->Fill(QGaxis2);
3042  mpTD_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_highPt_EndCap"]; if(mpTD_highPt_EndCap && mpTD_highPt_EndCap->getRootObject()) mpTD_highPt_EndCap->Fill(QGptD);
3043  mMultiplicityQG_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_EndCap"]; if(mMultiplicityQG_highPt_EndCap && mMultiplicityQG_highPt_EndCap->getRootObject()) mMultiplicityQG_highPt_EndCap->Fill(QGmulti);
3044  mqgLikelihood_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_EndCap"]; if(mqgLikelihood_highPt_EndCap && mqgLikelihood_highPt_EndCap->getRootObject()) mqgLikelihood_highPt_EndCap->Fill(QGLikelihood);
3045  }
3046  }else{
3047  if (recoJets[1].pt()>20. && recoJets[1].pt()<=50.) {
3048  mAxis2_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_Forward"];if(mAxis2_lowPt_Forward && mAxis2_lowPt_Forward->getRootObject()) mAxis2_lowPt_Forward->Fill(QGaxis2);
3049  mpTD_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_Forward"]; if(mpTD_lowPt_Forward && mpTD_lowPt_Forward->getRootObject()) mpTD_lowPt_Forward->Fill(QGptD);
3050  mMultiplicityQG_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_Forward"]; if(mMultiplicityQG_lowPt_Forward && mMultiplicityQG_lowPt_Forward->getRootObject()) mMultiplicityQG_lowPt_Forward->Fill(QGmulti);
3051  mqgLikelihood_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_Forward"]; if(mqgLikelihood_lowPt_Forward && mqgLikelihood_lowPt_Forward->getRootObject()) mqgLikelihood_lowPt_Forward->Fill(QGLikelihood);
3052  }
3053  if (recoJets[1].pt()>50. && recoJets[1].pt()<=140.) {
3054  mAxis2_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_Forward"];if(mAxis2_mediumPt_Forward && mAxis2_mediumPt_Forward->getRootObject()) mAxis2_mediumPt_Forward->Fill(QGaxis2);
3055  mpTD_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_Forward"]; if(mpTD_mediumPt_Forward && mpTD_mediumPt_Forward->getRootObject()) mpTD_mediumPt_Forward->Fill(QGptD);
3056  mMultiplicityQG_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_Forward"]; if(mMultiplicityQG_mediumPt_Forward && mMultiplicityQG_mediumPt_Forward->getRootObject()) mMultiplicityQG_mediumPt_Forward->Fill(QGmulti);
3057  mqgLikelihood_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_Forward"]; if(mqgLikelihood_mediumPt_Forward && mqgLikelihood_mediumPt_Forward->getRootObject()) mqgLikelihood_mediumPt_Forward->Fill(QGLikelihood);
3058  }
3059  if (recoJets[1].pt()>140.) {
3060  mAxis2_highPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_Forward"];if(mAxis2_highPt_Forward && mAxis2_highPt_Forward->getRootObject()) mAxis2_highPt_Forward->Fill(QGaxis2);
3061  mpTD_highPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_highPt_Forward"]; if(mpTD_highPt_Forward && mpTD_highPt_Forward->getRootObject()) mpTD_highPt_Forward->Fill(QGptD);
3062  mMultiplicityQG_highPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_Forward"]; if(mMultiplicityQG_highPt_Forward && mMultiplicityQG_highPt_Forward->getRootObject()) mMultiplicityQG_highPt_Forward->Fill(QGmulti);
3063  mqgLikelihood_highPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_Forward"]; if(mqgLikelihood_highPt_Forward && mqgLikelihood_highPt_Forward->getRootObject()) mqgLikelihood_highPt_Forward->Fill(QGLikelihood);
3064  }
3065  }//deal with second jet
3066  }//fill quark gluon tagged variables
3067  }//pfjet
3068  if(isMiniAODJet_){
3069  mCHFrac = map_of_MEs[DirName+"/"+"CHFrac"]; if (mCHFrac && mCHFrac->getRootObject()) mCHFrac ->Fill((*patJets)[ind1].chargedHadronEnergyFraction());
3070  mNHFrac = map_of_MEs[DirName+"/"+"NHFrac"]; if (mNHFrac && mNHFrac->getRootObject()) mNHFrac ->Fill((*patJets)[ind1].neutralHadronEnergyFraction());
3071  mPhFrac = map_of_MEs[DirName+"/"+"PhFrac"]; if (mPhFrac && mPhFrac->getRootObject()) mPhFrac ->Fill((*patJets)[ind1].neutralEmEnergyFraction());
3072  mHFEMFrac = map_of_MEs[DirName+"/"+"HFEMFrac"]; if (mHFEMFrac && mHFEMFrac->getRootObject()) mHFEMFrac ->Fill((*patJets)[ind1].HFEMEnergyFraction());
3073  mHFHFrac = map_of_MEs[DirName+"/"+"HFHFrac"]; if (mHFHFrac && mHFHFrac->getRootObject()) mHFHFrac ->Fill((*patJets)[ind1].HFHadronEnergyFraction());
3074 
3075  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(1./(*patJets)[ind1].jecFactor("Uncorrected"));
3076  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[0].eta(),1./(*patJets)[ind1].jecFactor("Uncorrected"));
3077  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[0].pt(),1./(*patJets)[ind1].jecFactor("Uncorrected"));
3078  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(1./(*patJets)[ind2].jecFactor("Uncorrected"));
3079  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[0].eta(),1./(*patJets)[ind2].jecFactor("Uncorrected"));
3080  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[0].pt(),1./(*patJets)[ind2].jecFactor("Uncorrected"));
3081 
3082  mChargedMultiplicity = map_of_MEs[DirName+"/"+"ChargedMultiplicity"]; if(mChargedMultiplicity && mChargedMultiplicity->getRootObject()) mChargedMultiplicity->Fill((*patJets)[ind1].chargedMultiplicity());
3083  mNeutralMultiplicity = map_of_MEs[DirName+"/"+"NeutralMultiplicity"]; if(mNeutralMultiplicity && mNeutralMultiplicity->getRootObject()) mNeutralMultiplicity->Fill((*patJets)[ind1].neutralMultiplicity());
3084  mMuonMultiplicity = map_of_MEs[DirName+"/"+"MuonMultiplicity"]; if(mMuonMultiplicity && mMuonMultiplicity->getRootObject()) mMuonMultiplicity->Fill((*patJets)[ind1].muonMultiplicity());
3085  //Filling variables for second jet
3086  mCHFrac = map_of_MEs[DirName+"/"+"CHFrac"]; if (mCHFrac && mCHFrac->getRootObject()) mCHFrac ->Fill((*patJets)[ind2].chargedHadronEnergyFraction());
3087  mNHFrac = map_of_MEs[DirName+"/"+"NHFrac"]; if (mNHFrac && mNHFrac->getRootObject()) mNHFrac ->Fill((*patJets)[ind2].neutralHadronEnergyFraction());
3088  mPhFrac = map_of_MEs[DirName+"/"+"PhFrac"]; if (mPhFrac && mPhFrac->getRootObject()) mPhFrac ->Fill((*patJets)[ind2].neutralEmEnergyFraction());
3089  mHFEMFrac = map_of_MEs[DirName+"/"+"HFEMFrac"]; if (mHFEMFrac && mHFEMFrac->getRootObject()) mHFEMFrac ->Fill((*patJets)[ind2].HFEMEnergyFraction());
3090  mHFHFrac = map_of_MEs[DirName+"/"+"HFHFrac"]; if (mHFHFrac && mHFHFrac->getRootObject()) mHFHFrac ->Fill((*patJets)[ind2].HFHadronEnergyFraction());
3091 
3092  mNeutralFraction = map_of_MEs[DirName+"/"+"NeutralConstituentsFraction"];if (mNeutralFraction && mNeutralFraction->getRootObject()) mNeutralFraction->Fill ((double)(*patJets)[ind1].neutralMultiplicity()/(double)(*patJets)[ind1].nConstituents());
3093 
3094  mChargedMultiplicity = map_of_MEs[DirName+"/"+"ChargedMultiplicity"]; if(mChargedMultiplicity && mChargedMultiplicity->getRootObject()) mChargedMultiplicity->Fill((*patJets)[ind2].chargedMultiplicity());
3095  mNeutralMultiplicity = map_of_MEs[DirName+"/"+"NeutralMultiplicity"]; if(mNeutralMultiplicity && mNeutralMultiplicity->getRootObject()) mNeutralMultiplicity->Fill((*patJets)[ind2].neutralMultiplicity());
3096  mMuonMultiplicity = map_of_MEs[DirName+"/"+"MuonMultiplicity"]; if(mMuonMultiplicity && mMuonMultiplicity->getRootObject()) mMuonMultiplicity->Fill((*patJets)[ind2].muonMultiplicity());
3097 
3098  //now fill PATJet profiles for leading jet
3099  mCHFrac_profile = map_of_MEs[DirName+"/"+"CHFrac_profile"]; if (mCHFrac_profile && mCHFrac_profile->getRootObject()) mCHFrac_profile ->Fill(numPV, (*patJets)[ind1].chargedHadronEnergyFraction());
3100  mNHFrac_profile = map_of_MEs[DirName+"/"+"NHFrac_profile"]; if (mNHFrac_profile && mNHFrac_profile->getRootObject()) mNHFrac_profile ->Fill(numPV, (*patJets)[ind1].neutralHadronEnergyFraction());
3101  mPhFrac_profile = map_of_MEs[DirName+"/"+"PhFrac_profile"]; if (mPhFrac_profile && mPhFrac_profile->getRootObject()) mPhFrac_profile ->Fill(numPV, (*patJets)[ind1].neutralEmEnergyFraction());
3102  mHFEMFrac_profile = map_of_MEs[DirName+"/"+"HFEMFrac_profile"]; if (mHFEMFrac_profile && mHFEMFrac_profile->getRootObject()) mHFEMFrac_profile ->Fill(numPV, (*patJets)[ind1].HFEMEnergyFraction());
3103  mHFHFrac_profile = map_of_MEs[DirName+"/"+"HFHFrac_profile"]; if (mHFHFrac_profile && mHFHFrac_profile->getRootObject()) mHFHFrac_profile ->Fill(numPV, (*patJets)[ind1].HFHadronEnergyFraction());
3104 
3105  mNeutralFraction = map_of_MEs[DirName+"/"+"NeutralConstituentsFraction"];if (mNeutralFraction && mNeutralFraction->getRootObject()) mNeutralFraction->Fill ((double)(*patJets)[ind2].neutralMultiplicity()/(double)(*patJets)[ind2].nConstituents());
3106 
3107  mChargedMultiplicity_profile = map_of_MEs[DirName+"/"+"ChargedMultiplicity_profile"]; if(mChargedMultiplicity_profile && mChargedMultiplicity_profile->getRootObject()) mChargedMultiplicity_profile->Fill(numPV, (*patJets)[ind1].chargedMultiplicity());
3108  mNeutralMultiplicity_profile = map_of_MEs[DirName+"/"+"NeutralMultiplicity_profile"]; if(mNeutralMultiplicity_profile && mNeutralMultiplicity_profile->getRootObject()) mNeutralMultiplicity_profile->Fill(numPV, (*patJets)[ind1].neutralMultiplicity());
3109  mMuonMultiplicity_profile = map_of_MEs[DirName+"/"+"MuonMultiplicity_profile"]; if(mMuonMultiplicity_profile && mMuonMultiplicity_profile->getRootObject()) mMuonMultiplicity->Fill(numPV, (*patJets)[ind1].muonMultiplicity());
3110  //now fill PATJet profiles for second leading jet
3111  mCHFrac_profile = map_of_MEs[DirName+"/"+"CHFrac_profile"]; if (mCHFrac_profile && mCHFrac_profile->getRootObject()) mCHFrac_profile ->Fill(numPV, (*patJets)[ind2].chargedHadronEnergyFraction());
3112  mNHFrac_profile = map_of_MEs[DirName+"/"+"NHFrac_profile"]; if (mNHFrac_profile && mNHFrac_profile->getRootObject()) mNHFrac_profile ->Fill(numPV, (*patJets)[ind2].neutralHadronEnergyFraction());
3113  mPhFrac_profile = map_of_MEs[DirName+"/"+"PhFrac_profile"]; if (mPhFrac_profile && mPhFrac_profile->getRootObject()) mPhFrac_profile ->Fill(numPV, (*patJets)[ind2].neutralEmEnergyFraction());
3114  mHFEMFrac_profile = map_of_MEs[DirName+"/"+"HFEMFrac_profile"]; if (mHFEMFrac_profile && mHFEMFrac_profile->getRootObject()) mHFEMFrac_profile ->Fill(numPV, (*patJets)[ind2].HFEMEnergyFraction());
3115  mHFHFrac_profile = map_of_MEs[DirName+"/"+"HFHFrac_profile"]; if (mHFHFrac_profile && mHFHFrac_profile->getRootObject()) mHFHFrac_profile ->Fill(numPV, (*patJets)[ind2].HFHadronEnergyFraction());
3116 
3117  mChargedMultiplicity_profile = map_of_MEs[DirName+"/"+"ChargedMultiplicity_profile"]; if(mChargedMultiplicity_profile && mChargedMultiplicity_profile->getRootObject()) mChargedMultiplicity_profile->Fill(numPV, (*patJets)[ind2].chargedMultiplicity());
3118  mNeutralMultiplicity_profile = map_of_MEs[DirName+"/"+"NeutralMultiplicity_profile"]; if(mNeutralMultiplicity_profile && mNeutralMultiplicity_profile->getRootObject()) mNeutralMultiplicity_profile->Fill(numPV, (*patJets)[ind2].neutralMultiplicity());
3119  mMuonMultiplicity_profile = map_of_MEs[DirName+"/"+"MuonMultiplicity_profile"]; if(mMuonMultiplicity_profile && mMuonMultiplicity_profile->getRootObject()) mMuonMultiplicity_profile->Fill(numPV, (*patJets)[ind2].muonMultiplicity());
3120  }
3121 
3122 
3123  //fill histos for first jet
3124  mPt = map_of_MEs[DirName+"/"+"Pt"]; if (mPt && mPt->getRootObject()) mPt->Fill (recoJets[0].pt());
3125  mEta = map_of_MEs[DirName+"/"+"Eta"]; if (mEta && mEta->getRootObject()) mEta->Fill (recoJets[0].eta());
3126  mPhi = map_of_MEs[DirName+"/"+"Phi"]; if (mPhi && mPhi->getRootObject()) mPhi->Fill (recoJets[0].phi());
3127  mPhiVSEta = map_of_MEs[DirName+"/"+"PhiVSEta"]; if (mPhiVSEta && mPhiVSEta->getRootObject()) mPhiVSEta->Fill(recoJets[0].eta(),recoJets[0].phi());
3128  //if(!isJPTJet_){
3129  mConstituents = map_of_MEs[DirName+"/"+"Constituents"]; if (mConstituents && mConstituents->getRootObject()) mConstituents->Fill (recoJets[0].nConstituents());
3130  //}
3131  mPt = map_of_MEs[DirName+"/"+"Pt"]; if (mPt && mPt->getRootObject()) mPt->Fill (recoJets[1].pt());
3132  mEta = map_of_MEs[DirName+"/"+"Eta"]; if (mEta && mEta->getRootObject()) mEta->Fill (recoJets[1].eta());
3133  mPhi = map_of_MEs[DirName+"/"+"Phi"]; if (mPhi && mPhi->getRootObject()) mPhi->Fill (recoJets[1].phi());
3134  mPhiVSEta = map_of_MEs[DirName+"/"+"PhiVSEta"]; if (mPhiVSEta && mPhiVSEta->getRootObject()) mPhiVSEta->Fill(recoJets[1].eta(),recoJets[1].phi());
3135  //if(!isJPTJet_){
3136  mConstituents = map_of_MEs[DirName+"/"+"Constituents"]; if (mConstituents && mConstituents->getRootObject()) mConstituents->Fill (recoJets[1].nConstituents());
3137  //}
3138  //PV profiles
3139  mPt_profile = map_of_MEs[DirName+"/"+"Pt_profile"]; if (mPt_profile && mPt_profile->getRootObject()) mPt_profile ->Fill(numPV, recoJets[0].pt());
3140  mEta_profile = map_of_MEs[DirName+"/"+"Eta_profile"]; if (mEta_profile && mEta_profile->getRootObject()) mEta_profile ->Fill(numPV, recoJets[0].eta());
3141  mPhi_profile = map_of_MEs[DirName+"/"+"Phi_profile"]; if (mPhi_profile && mPhi_profile->getRootObject()) mPhi_profile ->Fill(numPV, recoJets[0].phi());
3142  //if(!isJPTJet_){
3143  mConstituents_profile = map_of_MEs[DirName+"/"+"Constituents_profile"]; if (mConstituents_profile && mConstituents_profile->getRootObject()) mConstituents_profile->Fill(numPV, recoJets[0].nConstituents());
3144  //}
3145  mPt_profile = map_of_MEs[DirName+"/"+"Pt_profile"]; if (mPt_profile && mPt_profile->getRootObject()) mPt_profile ->Fill(numPV, recoJets[1].pt());
3146  mEta_profile = map_of_MEs[DirName+"/"+"Eta_profile"]; if (mEta_profile && mEta_profile->getRootObject()) mEta_profile ->Fill(numPV, recoJets[1].eta());
3147  mPhi_profile = map_of_MEs[DirName+"/"+"Phi_profile"]; if (mPhi_profile && mPhi_profile->getRootObject()) mPhi_profile ->Fill(numPV, recoJets[1].phi());
3148  //if(!isJPTJet_){
3149  mConstituents_profile = map_of_MEs[DirName+"/"+"Constituents_profile"]; if (mConstituents_profile && mConstituents_profile->getRootObject()) mConstituents_profile->Fill(numPV, recoJets[1].nConstituents());
3150  //}
3151  if (fabs(recoJets[0].eta() < 1.4)) {
3152  double pt_dijet = (recoJets[0].pt() + recoJets[1].pt())/2;
3153  if (dphi > 2.7) {//cut even toughter on dijet balance
3154  double pt_probe;
3155  double pt_barrel;
3156  int jet1, jet2;
3157  //int randJet = rand() % 2;
3158  int randJet =iEvent.id().event()%2;
3159  if (fabs(recoJets[1].eta() < 1.4)) {
3160  if (randJet) {
3161  jet1 = 0;
3162  jet2 = 1;
3163  }
3164  else {
3165  jet1 = 1;
3166  jet2 = 0;
3167  }
3168  // ***Di-Jet Asymmetry****
3169  // * leading jets eta < 1.4
3170  // * leading jets dphi > 2.7
3171  // * pt_third jet < threshold
3172  // * A = (pt_1 - pt_2)/(pt_1 + pt_2)
3173  // * jets 1 and two are randomly ordered
3174  // **
3175  bool thirdJetCut = true;
3176  //that doesn't make any sense -> imagine you have 5 jets,
3177  //jet 3 is quite hard (almost as hard as the second jet, i.e. 200/80/79/20/15, cutoff is 30
3178  //the 4th and 5th jet are soft enough -> then you would fill the asymmetry twice,
3179  //although jet 2 and 3 are basically identical
3180  //do third jet relative to second jet
3181  //JME-10-014 suggests pt3/pt_dijet<0.15
3182  if(ind3>0){
3183  if (pt3 > asymmetryThirdJetCut_){
3184  thirdJetCut=false;
3185  }
3186  }
3187  if(thirdJetCut){
3188  double dijetAsymmetry =(recoJets[jet1].pt() - recoJets[jet2].pt()) / (recoJets[jet1].pt() + recoJets[jet2].pt());
3189  mDijetAsymmetry = map_of_MEs[DirName+"/"+"DijetAsymmetry"]; if (mDijetAsymmetry && mDijetAsymmetry->getRootObject()) mDijetAsymmetry->Fill(dijetAsymmetry);
3190  }// end restriction on third jet pt in asymmetry calculation
3191 
3192  }
3193  else {
3194  jet1 = 0;
3195  jet2 = 1;
3196  }
3197 
3198  pt_barrel = recoJets[jet1].pt();
3199  pt_probe = recoJets[jet2].pt();
3200 
3201  //dijet balance cuts
3202  // ***Di-Jet Balance****
3203  // * pt_dijet = (pt_probe+pt_barrel)/2
3204  // * leading jets dphi > 2.7
3205  // * reject evnets where pt_third/pt_dijet > 0.2
3206  // * pv selection
3207  // * B = (pt_probe - pt_barrel)/pt_dijet
3208  // * select probe randomly from 2 jets if both leading jets are in the barrel
3209  bool thirdJetCut = true;
3210  if(ind3>0){
3211  if (pt3/pt_dijet > balanceThirdJetCut_){
3212  thirdJetCut = false;
3213  }
3214  }
3215  if (thirdJetCut) {
3216  double dijetBalance = (pt_probe - pt_barrel) / pt_dijet;
3217  mDijetBalance = map_of_MEs[DirName+"/"+"DijetBalance"]; if (mDijetBalance && mDijetBalance->getRootObject()) mDijetBalance->Fill(dijetBalance);
3218  }// end restriction on third jet pt ratio in balance calculation
3219 
3220  }// dPhi > 2.7 for dijetbalance and asymmetrie
3221  }//leading jet in barrel
3222  }//DPhi cut of 2.1
3223  }//dijet selection, check if both leading jets are IDed
3224  //now do the ZJets selection -> pass_Z_selection cuts already on the Z-pt>30 GeV
3225  if(pass_Z_selection && ind1_mu_vetoed>=0 && pt1_mu_vetoed>12 && cleaned_first_jet_mu_vetoed && isPFJet_){
3226  bool pass_second_jet_mu_vetoed=false;
3227  if(cleaned_second_jet_mu_vetoed){
3228  if(ind2_mu_vetoed>=0 && pt2_mu_vetoed/zCand.Pt()<0.2){
3229  pass_second_jet_mu_vetoed=true;
3230  }
3231  }
3232  if(pass_second_jet_mu_vetoed){
3233  Jet recoJet1;
3234  if(isPFJet_){
3235  recoJet1=(*pfJets)[ind1_mu_vetoed];
3236  }
3237  if (pass_correction_flag && !isMiniAODJet_) {
3238  double scale=1;
3239  if (isCaloJet_){
3240  scale = jetCorr->correction((*caloJets)[ind1_mu_vetoed]);
3241  }
3242  if (isPFJet_){
3243  scale = jetCorr->correction((*pfJets)[ind1_mu_vetoed]);
3244  }
3245  recoJet1.scaleEnergy(scale);
3246  }
3247  double dphi=fabs(recoJet1.phi()-zCand.Phi());
3248  if(dphi>acos(-1.)){
3249  dphi=2*acos(-1.)-dphi;
3250  }
3251  if(jetCleaningFlag_){
3252  DirName = "JetMET/Jet/Cleaned"+mInputCollection_.label()+"/ZJets";
3253  }
3254  mDPhiZJet = map_of_MEs[DirName+"/"+"DPhiZJ"]; if (mDPhiZJet && mDPhiZJet->getRootObject()) mDPhiZJet ->Fill(dphi);
3255  if(fabs(dphi-acos(-1.))<0.34){
3256  //get now MET collections for MPF studies
3259  //edm::Handle<pat::METCollection> patmetcoll;
3260  const MET *met=NULL;
3261  if(isCaloJet_){
3262  iEvent.getByToken(caloMetToken_, calometcoll);
3263  if(!calometcoll.isValid()) return;
3264  met=&(calometcoll->front());
3265  }
3266  if(isPFJet_){
3267  iEvent.getByToken(pfMetToken_, pfmetcoll);
3268  if(!pfmetcoll.isValid()) return;
3269  met=&(pfmetcoll->front());
3270  }
3271  //if(isMiniAODJet_){
3272  //iEvent.getByToken(patMetToken_, patmetcoll);
3273  //if(!patmetcoll.isValid()) return;
3274  //met=&(patmetcoll->front());
3275  //}
3276  mZMass = map_of_MEs[DirName+"/"+"DiMuonMass"]; if(mZMass && mZMass->getRootObject()) mZMass->Fill(zCand.M());
3277  mZJetAsymmetry = map_of_MEs[DirName+"/"+"ZJetAsymmetry"]; if(mZJetAsymmetry && mZJetAsymmetry->getRootObject()) mZJetAsymmetry->Fill((zCand.Pt()-recoJet1.pt())/(zCand.Pt()+recoJet1.pt()));
3278  if(recoJet1.pt()>20){
3279  mPt = map_of_MEs[DirName+"/"+"Pt"]; if (mPt && mPt->getRootObject()) mPt->Fill (recoJet1.pt());
3280  mEta = map_of_MEs[DirName+"/"+"Eta"]; if (mEta && mEta->getRootObject()) mEta->Fill (recoJet1.eta());
3281  mPhi = map_of_MEs[DirName+"/"+"Phi"]; if (mPhi && mPhi->getRootObject()) mPhi->Fill (recoJet1.phi());
3282  //PV profiles
3283  mPt_profile = map_of_MEs[DirName+"/"+"Pt_profile"]; if (mPt_profile && mPt_profile->getRootObject()) mPt_profile ->Fill(numPV, recoJet1.pt());
3284  mEta_profile = map_of_MEs[DirName+"/"+"Eta_profile"]; if (mEta_profile && mEta_profile->getRootObject()) mEta_profile ->Fill(numPV, recoJet1.eta());
3285  mPhi_profile = map_of_MEs[DirName+"/"+"Phi_profile"]; if (mPhi_profile && mPhi_profile->getRootObject()) mPhi_profile ->Fill(numPV, recoJet1.phi());
3286  mConstituents = map_of_MEs[DirName+"/"+"Constituents"]; if (mConstituents && mConstituents->getRootObject()) mConstituents->Fill(recoJet1.nConstituents());
3287  mConstituents_profile = map_of_MEs[DirName+"/"+"Constituents_profile"]; if (mConstituents_profile && mConstituents_profile->getRootObject()) mConstituents_profile->Fill(numPV, recoJet1.nConstituents());
3288  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJet1.pt()/(*pfJets)[ind1_mu_vetoed].pt());
3289  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJet1.eta(),recoJet1.pt()/(*pfJets)[ind1_mu_vetoed].pt());
3290  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJet1.pt(),recoJet1.pt()/(*pfJets)[ind1_mu_vetoed].pt());
3291  mCHFrac = map_of_MEs[DirName+"/"+"CHFrac"]; if (mCHFrac && mCHFrac->getRootObject()) mCHFrac ->Fill((*pfJets)[ind1_mu_vetoed].chargedHadronEnergyFraction());
3292  mNHFrac = map_of_MEs[DirName+"/"+"NHFrac"]; if (mNHFrac && mNHFrac->getRootObject()) mNHFrac ->Fill((*pfJets)[ind1_mu_vetoed].neutralHadronEnergyFraction());
3293  mPhFrac = map_of_MEs[DirName+"/"+"PhFrac"]; if (mPhFrac && mPhFrac->getRootObject()) mPhFrac ->Fill((*pfJets)[ind1_mu_vetoed].neutralEmEnergyFraction());
3294  mHFEMFrac = map_of_MEs[DirName+"/"+"HFEMFrac"]; if (mHFEMFrac && mHFEMFrac->getRootObject()) mHFEMFrac ->Fill((*pfJets)[ind1_mu_vetoed].HFEMEnergyFraction());
3295  mHFHFrac = map_of_MEs[DirName+"/"+"HFHFrac"]; if (mHFHFrac && mHFHFrac->getRootObject()) mHFHFrac ->Fill((*pfJets)[ind1_mu_vetoed].HFHadronEnergyFraction());
3296  //now fill PFJet profiles for second leading jet
3297  mCHFrac_profile = map_of_MEs[DirName+"/"+"CHFrac_profile"]; if (mCHFrac_profile && mCHFrac_profile->getRootObject()) mCHFrac_profile ->Fill(numPV, (*pfJets)[ind1_mu_vetoed].chargedHadronEnergyFraction());
3298  mNHFrac_profile = map_of_MEs[DirName+"/"+"NHFrac_profile"]; if (mNHFrac_profile && mNHFrac_profile->getRootObject()) mNHFrac_profile ->Fill(numPV, (*pfJets)[ind1_mu_vetoed].neutralHadronEnergyFraction());
3299  mPhFrac_profile = map_of_MEs[DirName+"/"+"PhFrac_profile"]; if (mPhFrac_profile && mPhFrac_profile->getRootObject()) mPhFrac_profile ->Fill(numPV, (*pfJets)[ind1_mu_vetoed].neutralEmEnergyFraction());
3300  mHFEMFrac_profile = map_of_MEs[DirName+"/"+"HFEMFrac_profile"]; if (mHFEMFrac_profile && mHFEMFrac_profile->getRootObject()) mHFEMFrac_profile ->Fill(numPV, (*pfJets)[ind1_mu_vetoed].HFEMEnergyFraction());
3301  mHFHFrac_profile = map_of_MEs[DirName+"/"+"HFHFrac_profile"]; if (mHFHFrac_profile && mHFHFrac_profile->getRootObject()) mHFHFrac_profile ->Fill(numPV, (*pfJets)[ind1_mu_vetoed].HFHadronEnergyFraction());
3302  }
3303  double MPF=1.+(met->px()*zCand.Px()+met->py()*zCand.Py())/(zCand.Pt()*zCand.Pt());
3304  if(fabs(recoJet1.eta())<1.3){//barrel jets
3305  mJ1Pt_over_ZPt_J_Barrel = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_J_Barrel"]; if(mJ1Pt_over_ZPt_J_Barrel && mJ1Pt_over_ZPt_J_Barrel->getRootObject())mJ1Pt_over_ZPt_J_Barrel->Fill(recoJet1.pt()/zCand.Pt());
3306  mMPF_J_Barrel = map_of_MEs[DirName+"/"+"MPF_J_Barrel"]; if(mMPF_J_Barrel && mMPF_J_Barrel->getRootObject())mMPF_J_Barrel->Fill(MPF);
3307  if(zCand.Pt()<90){//lower cut on 30 already right from the start
3308  mJetZBalance_lowZPt_J_Barrel = map_of_MEs[DirName+"/"+"JZB_lowZPt_J_Barrel"]; if(mJetZBalance_lowZPt_J_Barrel && mJetZBalance_lowZPt_J_Barrel->getRootObject())mJetZBalance_lowZPt_J_Barrel->Fill(recoJet1.pt()-zCand.Pt());
3309  mJ1Pt_over_ZPt_lowZPt_J_Barrel = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_lowZPt_J_Barrel"]; if(mJ1Pt_over_ZPt_lowZPt_J_Barrel && mJ1Pt_over_ZPt_lowZPt_J_Barrel->getRootObject())mJ1Pt_over_ZPt_lowZPt_J_Barrel->Fill(recoJet1.pt()/zCand.Pt());
3310  mMPF_lowZPt_J_Barrel = map_of_MEs[DirName+"/"+"MPF_lowZPt_J_Barrel"]; if(mMPF_lowZPt_J_Barrel && mMPF_lowZPt_J_Barrel->getRootObject())mMPF_lowZPt_J_Barrel->Fill(MPF);
3311  //mMPF_J_Barrel = map_of_MEs[DirName+"/"+"MPF_J_Barrel"]; if(mMPF_J_Barrel && mMPF_J_Barrel->getRootObject())mMPF_J_Barrel->Fill(MPF);
3312  }else if (zCand.Pt()<140){
3313  mJetZBalance_mediumZPt_J_Barrel = map_of_MEs[DirName+"/"+"JZB_mediumZPt_J_Barrel"]; if(mJetZBalance_mediumZPt_J_Barrel && mJetZBalance_mediumZPt_J_Barrel->getRootObject())mJetZBalance_mediumZPt_J_Barrel->Fill(recoJet1.pt()-zCand.Pt());
3314  mJ1Pt_over_ZPt_mediumZPt_J_Barrel = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_mediumZPt_J_Barrel"]; if(mJ1Pt_over_ZPt_mediumZPt_J_Barrel && mJ1Pt_over_ZPt_mediumZPt_J_Barrel->getRootObject())mJ1Pt_over_ZPt_mediumZPt_J_Barrel->Fill(recoJet1.pt()/zCand.Pt());
3315  mMPF_mediumZPt_J_Barrel = map_of_MEs[DirName+"/"+"MPF_mediumZPt_J_Barrel"]; if(mMPF_mediumZPt_J_Barrel && mMPF_mediumZPt_J_Barrel->getRootObject())mMPF_mediumZPt_J_Barrel->Fill(MPF);
3316  }else{
3317  mJetZBalance_highZPt_J_Barrel = map_of_MEs[DirName+"/"+"JZB_highZPt_J_Barrel"]; if(mJetZBalance_highZPt_J_Barrel && mJetZBalance_highZPt_J_Barrel->getRootObject())mJetZBalance_highZPt_J_Barrel->Fill(recoJet1.pt()-zCand.Pt());
3318  mJ1Pt_over_ZPt_highZPt_J_Barrel = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_highZPt_J_Barrel"]; if(mJ1Pt_over_ZPt_highZPt_J_Barrel && mJ1Pt_over_ZPt_highZPt_J_Barrel->getRootObject())mJ1Pt_over_ZPt_highZPt_J_Barrel->Fill(recoJet1.pt()/zCand.Pt());
3319  mMPF_highZPt_J_Barrel = map_of_MEs[DirName+"/"+"MPF_highZPt_J_Barrel"]; if(mMPF_highZPt_J_Barrel && mMPF_highZPt_J_Barrel->getRootObject())mMPF_highZPt_J_Barrel->Fill(MPF);
3320  }
3321  if(zCand.Pt()>30){
3322  if(zCand.Pt()<55){
3323  mDeltaPt_Z_j1_over_ZPt_30_55_J_Barrel = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_30_55_J_Barrel"];if(mDeltaPt_Z_j1_over_ZPt_30_55_J_Barrel && mDeltaPt_Z_j1_over_ZPt_30_55_J_Barrel->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_30_55_J_Barrel->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3324  }else if (zCand.Pt()<75){
3325  mDeltaPt_Z_j1_over_ZPt_55_75_J_Barrel = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_55_75_J_Barrel"];if(mDeltaPt_Z_j1_over_ZPt_55_75_J_Barrel && mDeltaPt_Z_j1_over_ZPt_55_75_J_Barrel->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_55_75_J_Barrel->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3326  }else if (zCand.Pt()<150){
3327  mDeltaPt_Z_j1_over_ZPt_75_150_J_Barrel = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_75_150_J_Barrel"];if(mDeltaPt_Z_j1_over_ZPt_75_150_J_Barrel && mDeltaPt_Z_j1_over_ZPt_75_150_J_Barrel->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_75_150_J_Barrel->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3328  }else if (zCand.Pt()<290){
3329  mDeltaPt_Z_j1_over_ZPt_150_290_J_Barrel = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_150_290_J_Barrel"];if(mDeltaPt_Z_j1_over_ZPt_150_290_J_Barrel && mDeltaPt_Z_j1_over_ZPt_150_290_J_Barrel->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_150_290_J_Barrel->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3330  }else{
3331  mDeltaPt_Z_j1_over_ZPt_290_J_Barrel = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_290_J_Barrel"];if(mDeltaPt_Z_j1_over_ZPt_290_J_Barrel && mDeltaPt_Z_j1_over_ZPt_290_J_Barrel->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_290_J_Barrel->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3332  }
3333  }
3334  }else if(fabs(recoJet1.eta())<3.0){//endcap jets
3335  mJ1Pt_over_ZPt_J_EndCap = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_J_EndCap"]; if(mJ1Pt_over_ZPt_J_EndCap && mJ1Pt_over_ZPt_J_EndCap->getRootObject())mJ1Pt_over_ZPt_J_EndCap->Fill(recoJet1.pt()/zCand.Pt());
3336  mMPF_J_EndCap = map_of_MEs[DirName+"/"+"MPF_J_EndCap"]; if(mMPF_J_EndCap && mMPF_J_EndCap->getRootObject())mMPF_J_EndCap->Fill(MPF);
3337  if(zCand.Pt()<90){//lower cut on 30 already right from the start
3338  mJetZBalance_lowZPt_J_EndCap = map_of_MEs[DirName+"/"+"JZB_lowZPt_J_EndCap"]; if(mJetZBalance_lowZPt_J_EndCap && mJetZBalance_lowZPt_J_EndCap->getRootObject())mJetZBalance_lowZPt_J_EndCap->Fill(recoJet1.pt()-zCand.Pt());
3339  mJ1Pt_over_ZPt_lowZPt_J_EndCap = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_lowZPt_J_EndCap"]; if(mJ1Pt_over_ZPt_lowZPt_J_EndCap && mJ1Pt_over_ZPt_lowZPt_J_EndCap->getRootObject())mJ1Pt_over_ZPt_lowZPt_J_EndCap->Fill(recoJet1.pt()/zCand.Pt());
3340  mMPF_lowZPt_J_EndCap = map_of_MEs[DirName+"/"+"MPF_lowZPt_J_EndCap"]; if(mMPF_lowZPt_J_EndCap && mMPF_lowZPt_J_EndCap->getRootObject())mMPF_lowZPt_J_EndCap->Fill(MPF);
3341  }else if (zCand.Pt()<140){
3342  mJetZBalance_mediumZPt_J_EndCap = map_of_MEs[DirName+"/"+"JZB_mediumZPt_J_EndCap"]; if(mJetZBalance_mediumZPt_J_EndCap && mJetZBalance_mediumZPt_J_EndCap->getRootObject())mJetZBalance_mediumZPt_J_EndCap->Fill(recoJet1.pt()-zCand.Pt());
3343  mJ1Pt_over_ZPt_mediumZPt_J_EndCap = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_mediumZPt_J_EndCap"]; if(mJ1Pt_over_ZPt_mediumZPt_J_EndCap && mJ1Pt_over_ZPt_mediumZPt_J_EndCap->getRootObject())mJ1Pt_over_ZPt_mediumZPt_J_EndCap->Fill(recoJet1.pt()/zCand.Pt());
3344  mMPF_mediumZPt_J_EndCap = map_of_MEs[DirName+"/"+"MPF_mediumZPt_J_EndCap"]; if(mMPF_mediumZPt_J_EndCap && mMPF_mediumZPt_J_EndCap->getRootObject())mMPF_mediumZPt_J_EndCap->Fill(MPF);
3345  }else{
3346  mJetZBalance_highZPt_J_EndCap = map_of_MEs[DirName+"/"+"JZB_highZPt_J_EndCap"]; if(mJetZBalance_highZPt_J_EndCap && mJetZBalance_highZPt_J_EndCap->getRootObject())mJetZBalance_highZPt_J_EndCap->Fill(recoJet1.pt()-zCand.Pt());
3347  mJ1Pt_over_ZPt_highZPt_J_EndCap = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_highZPt_J_EndCap"]; if(mJ1Pt_over_ZPt_highZPt_J_EndCap && mJ1Pt_over_ZPt_highZPt_J_EndCap->getRootObject())mJ1Pt_over_ZPt_highZPt_J_EndCap->Fill(recoJet1.pt()/zCand.Pt());
3348  mMPF_highZPt_J_EndCap = map_of_MEs[DirName+"/"+"MPF_highZPt_J_EndCap"]; if(mMPF_highZPt_J_EndCap && mMPF_highZPt_J_EndCap->getRootObject())mMPF_highZPt_J_EndCap->Fill(MPF);
3349  }
3350  if(zCand.Pt()>30){
3351  if(zCand.Pt()<55){
3352  mDeltaPt_Z_j1_over_ZPt_30_55_J_EndCap = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_30_55_J_EndCap"];if(mDeltaPt_Z_j1_over_ZPt_30_55_J_EndCap && mDeltaPt_Z_j1_over_ZPt_30_55_J_EndCap->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_30_55_J_EndCap->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3353  }else if (zCand.Pt()<75){
3354  mDeltaPt_Z_j1_over_ZPt_55_75_J_EndCap = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_55_75_J_EndCap"];if(mDeltaPt_Z_j1_over_ZPt_55_75_J_EndCap && mDeltaPt_Z_j1_over_ZPt_55_75_J_EndCap->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_55_75_J_EndCap->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3355  }else if (zCand.Pt()<150){
3356  mDeltaPt_Z_j1_over_ZPt_75_150_J_EndCap = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_75_150_J_EndCap"];if(mDeltaPt_Z_j1_over_ZPt_75_150_J_EndCap && mDeltaPt_Z_j1_over_ZPt_75_150_J_EndCap->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_75_150_J_EndCap->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3357  }else if (zCand.Pt()<290){
3358  mDeltaPt_Z_j1_over_ZPt_150_290_J_EndCap = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_150_290_J_EndCap"];if(mDeltaPt_Z_j1_over_ZPt_150_290_J_EndCap && mDeltaPt_Z_j1_over_ZPt_150_290_J_EndCap->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_150_290_J_EndCap->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3359  }else{
3360  mDeltaPt_Z_j1_over_ZPt_290_J_EndCap = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_290_J_EndCap"];if(mDeltaPt_Z_j1_over_ZPt_290_J_EndCap && mDeltaPt_Z_j1_over_ZPt_290_J_EndCap->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_290_J_EndCap->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3361  }
3362  }
3363  }else{//forward jets
3364  mJ1Pt_over_ZPt_J_Forward = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_J_Forward"]; if(mJ1Pt_over_ZPt_J_Forward && mJ1Pt_over_ZPt_J_Forward->getRootObject())mJ1Pt_over_ZPt_J_Forward->Fill(recoJet1.pt()/zCand.Pt());
3365  mMPF_J_Forward = map_of_MEs[DirName+"/"+"MPF_J_Forward"]; if(mMPF_J_Forward && mMPF_J_Forward->getRootObject())mMPF_J_Forward->Fill(MPF);
3366  if(zCand.Pt()<90){//lower cut on 30 already right from the start
3367  mJetZBalance_lowZPt_J_Forward = map_of_MEs[DirName+"/"+"JZB_lowZPt_J_Forward"]; if(mJetZBalance_lowZPt_J_Forward && mJetZBalance_lowZPt_J_Forward->getRootObject())mJetZBalance_lowZPt_J_Forward->Fill(recoJet1.pt()-zCand.Pt());
3368  mJ1Pt_over_ZPt_lowZPt_J_Forward = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_lowZPt_J_Forward"]; if(mJ1Pt_over_ZPt_lowZPt_J_Forward && mJ1Pt_over_ZPt_lowZPt_J_Forward->getRootObject())mJ1Pt_over_ZPt_lowZPt_J_Forward->Fill(recoJet1.pt()/zCand.Pt());
3369  mMPF_lowZPt_J_Forward = map_of_MEs[DirName+"/"+"MPF_lowZPt_J_Forward"]; if(mMPF_lowZPt_J_Forward && mMPF_lowZPt_J_Forward->getRootObject())mMPF_lowZPt_J_Forward->Fill(MPF);
3370  }else if (zCand.Pt()<140){
3371  mJetZBalance_mediumZPt_J_Forward = map_of_MEs[DirName+"/"+"JZB_mediumZPt_J_Forward"]; if(mJetZBalance_mediumZPt_J_Forward && mJetZBalance_mediumZPt_J_Forward->getRootObject())mJetZBalance_mediumZPt_J_Forward->Fill(recoJet1.pt()-zCand.Pt());
3372  mJ1Pt_over_ZPt_mediumZPt_J_Forward = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_mediumZPt_J_Forward"]; if(mJ1Pt_over_ZPt_mediumZPt_J_Forward && mJ1Pt_over_ZPt_mediumZPt_J_Forward->getRootObject())mJ1Pt_over_ZPt_mediumZPt_J_Forward->Fill(recoJet1.pt()/zCand.Pt());
3373  mMPF_mediumZPt_J_Forward = map_of_MEs[DirName+"/"+"MPF_mediumZPt_J_Forward"]; if(mMPF_mediumZPt_J_Forward && mMPF_mediumZPt_J_Forward->getRootObject())mMPF_mediumZPt_J_Forward->Fill(MPF);
3374  }else{
3375  mJetZBalance_highZPt_J_Forward = map_of_MEs[DirName+"/"+"JZB_highZPt_J_Forward"]; if(mJetZBalance_highZPt_J_Forward && mJetZBalance_highZPt_J_Forward->getRootObject())mJetZBalance_highZPt_J_Forward->Fill(recoJet1.pt()-zCand.Pt());
3376  mJ1Pt_over_ZPt_highZPt_J_Forward = map_of_MEs[DirName+"/"+"J1Pt_over_ZPt_highZPt_J_Forward"]; if(mJ1Pt_over_ZPt_highZPt_J_Forward && mJ1Pt_over_ZPt_highZPt_J_Forward->getRootObject())mJ1Pt_over_ZPt_highZPt_J_Forward->Fill(recoJet1.pt()/zCand.Pt());
3377  mMPF_highZPt_J_Forward = map_of_MEs[DirName+"/"+"MPF_highZPt_J_Forward"]; if(mMPF_highZPt_J_Forward && mMPF_highZPt_J_Forward->getRootObject())mMPF_highZPt_J_Forward->Fill(MPF);
3378  }
3379  if(zCand.Pt()>30){
3380  if(zCand.Pt()<55){
3381  mDeltaPt_Z_j1_over_ZPt_30_55_J_Forward = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_30_55_J_Forward"];if(mDeltaPt_Z_j1_over_ZPt_30_55_J_Forward && mDeltaPt_Z_j1_over_ZPt_30_55_J_Forward->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_30_55_J_Forward->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3382  }else if (zCand.Pt()<100){
3383  mDeltaPt_Z_j1_over_ZPt_55_100_J_Forward = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_55_100_J_Forward"];if(mDeltaPt_Z_j1_over_ZPt_55_100_J_Forward && mDeltaPt_Z_j1_over_ZPt_55_100_J_Forward->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_55_100_J_Forward->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3384  }else{
3385  mDeltaPt_Z_j1_over_ZPt_100_J_Forward = map_of_MEs[DirName+"/"+"DeltaPt_Z_j1_over_ZPt_100_J_Forward"];if(mDeltaPt_Z_j1_over_ZPt_100_J_Forward && mDeltaPt_Z_j1_over_ZPt_100_J_Forward->getRootObject() ) mDeltaPt_Z_j1_over_ZPt_100_J_Forward->Fill((zCand.Pt()-recoJet1.pt())/zCand.Pt());
3386  }
3387  }
3388  }
3389  int QGmulti=-1;
3390  float QGLikelihood=-10;
3391  float QGptD=-10;
3392  float QGaxis2=-10;
3393  if(fill_CHS_histos){
3394  reco::PFJetRef pfjetref(pfJets, ind1_mu_vetoed);
3395  QGmulti=(*qgMultiplicity)[pfjetref];
3396  QGLikelihood=(*qgLikelihood)[pfjetref];
3397  QGptD=(*qgptD)[pfjetref];
3398  QGaxis2=(*qgaxis2)[pfjetref];
3399  if(fabs(recoJet1.eta())<1.3){//barrel jets
3400  //fractions for barrel
3401  if (recoJet1.pt()>=20. && recoJet1.pt()<=50.) {
3402  mAxis2_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_Barrel"];if(mAxis2_lowPt_Barrel && mAxis2_lowPt_Barrel->getRootObject()) mAxis2_lowPt_Barrel->Fill(QGaxis2);
3403  mpTD_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_Barrel"]; if(mpTD_lowPt_Barrel && mpTD_lowPt_Barrel->getRootObject()) mpTD_lowPt_Barrel->Fill(QGptD);
3404  mMultiplicityQG_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_Barrel"]; if(mMultiplicityQG_lowPt_Barrel && mMultiplicityQG_lowPt_Barrel->getRootObject()) mMultiplicityQG_lowPt_Barrel->Fill(QGmulti);
3405  mqgLikelihood_lowPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_Barrel"]; if(mqgLikelihood_lowPt_Barrel && mqgLikelihood_lowPt_Barrel->getRootObject()) mqgLikelihood_lowPt_Barrel->Fill(QGLikelihood);
3406  }
3407  if (recoJet1.pt()>50. && recoJet1.pt()<=140.) {
3408  mAxis2_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_Barrel"];if(mAxis2_mediumPt_Barrel && mAxis2_mediumPt_Barrel->getRootObject()) mAxis2_mediumPt_Barrel->Fill(QGaxis2);
3409  mpTD_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_Barrel"]; if(mpTD_mediumPt_Barrel && mpTD_mediumPt_Barrel->getRootObject()) mpTD_mediumPt_Barrel->Fill(QGptD);
3410  mMultiplicityQG_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_Barrel"]; if(mMultiplicityQG_mediumPt_Barrel && mMultiplicityQG_mediumPt_Barrel->getRootObject()) mMultiplicityQG_mediumPt_Barrel->Fill(QGmulti);
3411  mqgLikelihood_mediumPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_Barrel"]; if(mqgLikelihood_mediumPt_Barrel && mqgLikelihood_mediumPt_Barrel->getRootObject()) mqgLikelihood_mediumPt_Barrel->Fill(QGLikelihood);
3412  }
3413  if (recoJet1.pt()>140.) {
3414  mAxis2_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_Barrel"];if(mAxis2_highPt_Barrel && mAxis2_highPt_Barrel->getRootObject()) mAxis2_highPt_Barrel->Fill(QGaxis2);
3415  mpTD_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_pTD_highPt_Barrel"]; if(mpTD_highPt_Barrel && mpTD_highPt_Barrel->getRootObject()) mpTD_highPt_Barrel->Fill(QGptD);
3416  mMultiplicityQG_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_Barrel"]; if(mMultiplicityQG_highPt_Barrel && mMultiplicityQG_highPt_Barrel->getRootObject()) mMultiplicityQG_highPt_Barrel->Fill(QGmulti);
3417  mqgLikelihood_highPt_Barrel = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_Barrel"]; if(mqgLikelihood_highPt_Barrel && mqgLikelihood_highPt_Barrel->getRootObject()) mqgLikelihood_highPt_Barrel->Fill(QGLikelihood);
3418  }
3419  }else if(fabs(recoJet1.eta())<3.0){//endcap jets
3420  if (recoJet1.pt()>20. && recoJet1.pt()<=50.) {
3421  mAxis2_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_EndCap"];if(mAxis2_lowPt_EndCap && mAxis2_lowPt_EndCap->getRootObject()) mAxis2_lowPt_EndCap->Fill(QGaxis2);
3422  mpTD_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_EndCap"]; if(mpTD_lowPt_EndCap && mpTD_lowPt_EndCap->getRootObject()) mpTD_lowPt_EndCap->Fill(QGptD);
3423  mMultiplicityQG_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_EndCap"]; if(mMultiplicityQG_lowPt_EndCap && mMultiplicityQG_lowPt_EndCap->getRootObject()) mMultiplicityQG_lowPt_EndCap->Fill(QGmulti);
3424  mqgLikelihood_lowPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_EndCap"]; if(mqgLikelihood_lowPt_EndCap && mqgLikelihood_lowPt_EndCap->getRootObject()) mqgLikelihood_lowPt_EndCap->Fill(QGLikelihood);
3425  }
3426  if (recoJet1.pt()>50. && recoJet1.pt()<=140.) {
3427  mAxis2_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_EndCap"];if(mAxis2_mediumPt_EndCap && mAxis2_mediumPt_EndCap->getRootObject()) mAxis2_mediumPt_EndCap->Fill(QGaxis2);
3428  mpTD_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_EndCap"]; if(mpTD_mediumPt_EndCap && mpTD_mediumPt_EndCap->getRootObject()) mpTD_mediumPt_EndCap->Fill(QGptD);
3429  mMultiplicityQG_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_EndCap"]; if(mMultiplicityQG_mediumPt_EndCap && mMultiplicityQG_mediumPt_EndCap->getRootObject()) mMultiplicityQG_mediumPt_EndCap->Fill(QGmulti);
3430  mqgLikelihood_mediumPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_EndCap"]; if(mqgLikelihood_mediumPt_EndCap && mqgLikelihood_mediumPt_EndCap->getRootObject()) mqgLikelihood_mediumPt_EndCap->Fill(QGLikelihood);
3431  }
3432  if (recoJet1.pt()>140.) {
3433  mAxis2_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_EndCap"];if(mAxis2_highPt_EndCap && mAxis2_highPt_EndCap->getRootObject()) mAxis2_highPt_EndCap->Fill(QGaxis2);
3434  mpTD_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_pTD_highPt_EndCap"]; if(mpTD_highPt_EndCap && mpTD_highPt_EndCap->getRootObject()) mpTD_highPt_EndCap->Fill(QGptD);
3435  mMultiplicityQG_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_EndCap"]; if(mMultiplicityQG_highPt_EndCap && mMultiplicityQG_highPt_EndCap->getRootObject()) mMultiplicityQG_highPt_EndCap->Fill(QGmulti);
3436  mqgLikelihood_highPt_EndCap = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_EndCap"]; if(mqgLikelihood_highPt_EndCap && mqgLikelihood_highPt_EndCap->getRootObject()) mqgLikelihood_highPt_EndCap->Fill(QGLikelihood);
3437  }
3438  }else{
3439  if (recoJet1.pt()>20. && recoJet1.pt()<=50.) {
3440  mAxis2_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_lowPt_Forward"];if(mAxis2_lowPt_Forward && mAxis2_lowPt_Forward->getRootObject()) mAxis2_lowPt_Forward->Fill(QGaxis2);
3441  mpTD_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_lowPt_Forward"]; if(mpTD_lowPt_Forward && mpTD_lowPt_Forward->getRootObject()) mpTD_lowPt_Forward->Fill(QGptD);
3442  mMultiplicityQG_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_lowPt_Forward"]; if(mMultiplicityQG_lowPt_Forward && mMultiplicityQG_lowPt_Forward->getRootObject()) mMultiplicityQG_lowPt_Forward->Fill(QGmulti);
3443  mqgLikelihood_lowPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_lowPt_Forward"]; if(mqgLikelihood_lowPt_Forward && mqgLikelihood_lowPt_Forward->getRootObject()) mqgLikelihood_lowPt_Forward->Fill(QGLikelihood);
3444  }
3445  if (recoJet1.pt()>50. && recoJet1.pt()<=140.) {
3446  mAxis2_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_mediumPt_Forward"];if(mAxis2_mediumPt_Forward && mAxis2_mediumPt_Forward->getRootObject()) mAxis2_mediumPt_Forward->Fill(QGaxis2);
3447  mpTD_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_mediumPt_Forward"]; if(mpTD_mediumPt_Forward && mpTD_mediumPt_Forward->getRootObject()) mpTD_mediumPt_Forward->Fill(QGptD);
3448  mMultiplicityQG_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_mediumPt_Forward"]; if(mMultiplicityQG_mediumPt_Forward && mMultiplicityQG_mediumPt_Forward->getRootObject()) mMultiplicityQG_mediumPt_Forward->Fill(QGmulti);
3449  mqgLikelihood_mediumPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_mediumPt_Forward"]; if(mqgLikelihood_mediumPt_Forward && mqgLikelihood_mediumPt_Forward->getRootObject()) mqgLikelihood_mediumPt_Forward->Fill(QGLikelihood);
3450  }
3451  if (recoJet1.pt()>140.) {
3452  mAxis2_highPt_Forward = map_of_MEs[DirName+"/"+"qg_Axis2_highPt_Forward"];if(mAxis2_highPt_Forward && mAxis2_highPt_Forward->getRootObject()) mAxis2_highPt_Forward->Fill(QGaxis2);
3453  mpTD_highPt_Forward = map_of_MEs[DirName+"/"+"qg_pTD_highPt_Forward"]; if(mpTD_highPt_Forward && mpTD_highPt_Forward->getRootObject()) mpTD_highPt_Forward->Fill(QGptD);
3454  mMultiplicityQG_highPt_Forward = map_of_MEs[DirName+"/"+"qg_multiplicity_highPt_Forward"]; if(mMultiplicityQG_highPt_Forward && mMultiplicityQG_highPt_Forward->getRootObject()) mMultiplicityQG_highPt_Forward->Fill(QGmulti);
3455  mqgLikelihood_highPt_Forward = map_of_MEs[DirName+"/"+"qg_Likelihood_highPt_Forward"]; if(mqgLikelihood_highPt_Forward && mqgLikelihood_highPt_Forward->getRootObject()) mqgLikelihood_highPt_Forward->Fill(QGLikelihood);
3456  }
3457  }
3458  }//fill quark gluon tagged variables
3459  }//jet back to back to Z
3460  }//2nd jet veto
3461  }//Z selection + hard leading jet
3462 }
#define LogDebug(id)
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
const properties_type & properties() const
virtual void scaleEnergy(double fScale)
scale energy of the jet
JetAnalyzer(const edm::ParameterSet &)
Constructor.
Definition: JetAnalyzer.cc:64
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
float fHPD
Definition: JetID.h:45
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
Base class for all types of Jets.
Definition: Jet.h:20
float restrictedEMF
Definition: JetID.h:52
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)
virtual double phi() const final
momentum azimuthal angle
float fRBX
Definition: JetID.h:46
#define NULL
Definition: scimark2.h:8
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Strings::size_type size() const
Definition: TriggerNames.cc:39
Jet ID object.
Definition: JetID.h:16
tuple vertexCollection
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
triggerResultsToken_(consumes< edm::TriggerResults >(edm::InputTag("TriggerResults")))
static bool passJetId(int flag, Id level)
int iEvent
Definition: GenABIO.cc:230
void endRun(const edm::Run &, const edm::EventSetup &)
Finish up a run.
virtual ~JetAnalyzer()
Destructor.
Definition: JetAnalyzer.cc:249
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: MET.h:42
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
virtual double py() const final
y coordinate of momentum vector
bool isValid() const
Definition: HandleBase.h:75
#define LogTrace(id)
PF Jet selector for pat::Jets.
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
Jet selector for pat::Jets and for CaloJets.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
Initialize run-based parameters.
T const * product() const
Definition: Handle.h:81
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
static std::string const triggerResults("TriggerResults")
const T & get() const
Definition: EventSetup.h:56
tuple recoJets
Definition: RecoJets_cff.py:56
T const * product() const
Definition: ESHandle.h:86
Geom::Phi< T > phi() const
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
edm::EventID id() const
Definition: EventBase.h:59
virtual int nConstituents() const
of constituents
Definition: Jet.h:65
static int position[264][3]
Definition: ReadPGInfo.cc:509
void bookMESetSelection(std::string, DQMStore::IBooker &)
virtual double px() const final
x coordinate of momentum vector
tuple cout
Definition: gather_cfg.py:145
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
virtual double eta() const final
momentum pseudorapidity
TH2F * getTH2F(void) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Inizialize parameters for histo binning.
Definition: JetAnalyzer.cc:260
tuple pfJets
Definition: pfJets_cff.py:8
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
short n90Hits
Definition: JetID.h:47
Definition: Run.h:43
virtual double pt() const final
transverse momentum
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39