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 
27 
31 
52 
53 #include <string>
54 
55 using namespace edm;
56 using namespace reco;
57 using namespace std;
58 
59 //namespace jetAnalysis {
60 
61  // Helper class to propagate tracks to the calo surface using the same implementation as the JetTrackAssociator
62  //class TrackPropagatorToCalo
63  //{
64  //public:
65  //TrackPropagatorToCalo();
66  // void update(const edm::EventSetup& eventSetup);
67  //math::XYZPoint impactPoint(const reco::Track& track) const;
68  //private:
69  //const MagneticField* magneticField_;
70  //const Propagator* propagator_;
71  //uint32_t magneticFieldCacheId_;
72  //uint32_t propagatorCacheId_;
73  //};
74  /*
75  // Helper class to calculate strip signal to noise and manage the necessary ES objects
76  class StripSignalOverNoiseCalculator
77  {
78  public:
79  StripSignalOverNoiseCalculator(const std::string& theQualityLabel = std::string(""));
80  void update(const edm::EventSetup& eventSetup);
81  double signalOverNoise(const SiStripCluster& cluster,
82  const uint32_t& id) const;
83  double operator () (const SiStripCluster& cluster,
84  const uint32_t& id) const
85  { return signalOverNoise(cluster,id); }
86  private:
87  const std::string qualityLabel_;
88  const SiStripQuality* quality_;
89  const SiStripNoises* noise_;
90  const SiStripGain* gain_;
91  uint32_t qualityCacheId_;
92  uint32_t noiseCacheId_;
93  uint32_t gainCacheId_;
94  };
95  */
96 //}
97 
98 // ***********************************************************
100 //: trackPropagator_(new jetAnalysis::TrackPropagatorToCalo)//,
101  //sOverNCalculator_(new jetAnalysis::StripSignalOverNoiseCalculator)
102 {
103  parameters_ = pSet.getParameter<edm::ParameterSet>("jetAnalysis");
104  outputMEsInRootFile = pSet.getParameter<bool>("OutputMEsInRootFile");
105  mInputCollection_ = pSet.getParameter<edm::InputTag> ("jetsrc");
106 
107  mOutputFile_ = pSet.getParameter<std::string>("OutputFile");
108 
109  jetType_ = pSet.getParameter<std::string>("JetType");
110  jetCorrectionService_ = pSet.getParameter<std::string> ("JetCorrections");
111 
112  fill_jet_high_level_histo=pSet.getParameter<bool>("filljetHighLevel"),
113 
114  isCaloJet_ = (std::string("calo")==jetType_);
115  //isJPTJet_ = (std::string("jpt") ==jetType_);
116  isPFJet_ = (std::string("pf") ==jetType_);
117 
118  if (isCaloJet_) caloJetsToken_ = consumes<reco::CaloJetCollection>(mInputCollection_);
119  //if (isJPTJet_) jptJetsToken_ = consumes<reco::JPTJetCollection>(mInputCollection_);
120  if (isPFJet_) pfJetsToken_ = consumes<reco::PFJetCollection>(mInputCollection_);
121 
122  JetIDQuality_ = pSet.getParameter<string>("JetIDQuality");
123  JetIDVersion_ = pSet.getParameter<string>("JetIDVersion");
124 
125  // JetID definitions for Calo and JPT Jets
126  if(/*isJPTJet_ || */isCaloJet_){
127  inputJetIDValueMap = pSet.getParameter<edm::InputTag>("InputJetIDValueMap");
128  jetID_ValueMapToken_= consumes< edm::ValueMap<reco::JetID> >(inputJetIDValueMap);
129  if(JetIDVersion_== "PURE09"){
130  jetidversion = JetIDSelectionFunctor::PURE09;
131  }else if (JetIDVersion_== "DQM09"){
132  jetidversion = JetIDSelectionFunctor::DQM09;
133  }else if (JetIDVersion_=="CRAFT08"){
134  jetidversion = JetIDSelectionFunctor::CRAFT08;
135  }else{
136  if (verbose_) std::cout<<"no Valid JetID version given"<<std::endl;
137  }
138  if(JetIDQuality_== "MINIMAL"){
139  jetidquality = JetIDSelectionFunctor::MINIMAL;
140  }else if (JetIDQuality_== "LOOSE_AOD"){
141  jetidquality = JetIDSelectionFunctor::LOOSE_AOD;
142  }else if (JetIDQuality_=="LOOSE"){
143  jetidquality = JetIDSelectionFunctor::LOOSE;
144  }else if (JetIDQuality_=="TIGHT"){
145  jetidquality = JetIDSelectionFunctor::TIGHT;
146  }else{
147  if (verbose_) std::cout<<"no Valid JetID quality given"<<std::endl;
148  }
149  jetIDFunctor=JetIDSelectionFunctor( jetidversion, jetidquality);
150 
151  }
152 
153  //Jet ID definitions for PFJets
154  if(isPFJet_){
155  if(JetIDVersion_== "FIRSTDATA"){
156  pfjetidversion = PFJetIDSelectionFunctor::FIRSTDATA;
157  }else{
158  if (verbose_) std::cout<<"no valid PF JetID version given"<<std::endl;
159  }
160  if (JetIDQuality_=="LOOSE"){
161  pfjetidquality = PFJetIDSelectionFunctor::LOOSE;
162  }else if (JetIDQuality_=="TIGHT"){
163  pfjetidquality = PFJetIDSelectionFunctor::TIGHT;
164  }else{
165  if (verbose_) std::cout<<"no Valid PFJetID quality given"<<std::endl;
166  }
167  pfjetIDFunctor=PFJetIDSelectionFunctor( pfjetidversion, pfjetidquality);
168  }
169  //check later if some of those are also needed for PFJets
170  leadJetFlag_ = 0;
171  jetLoPass_ = 0;
172  jetHiPass_ = 0;
173  ptThreshold_ = 20.;
174  ptThresholdUnc_ = 20.;
175  asymmetryThirdJetCut_ = 5.;
176  balanceThirdJetCut_ = 0.2;
177 
178  theTriggerResultsLabel_ = pSet.getParameter<edm::InputTag>("TriggerResultsLabel");
179  triggerResultsToken_ = consumes<edm::TriggerResults>(edm::InputTag(theTriggerResultsLabel_));
180  //
181  runcosmics_ = pSet.getUntrackedParameter<bool>("runcosmics", false);
182  jetCleaningFlag_ = pSet.getUntrackedParameter<bool>("JetCleaningFlag", true);
183 
184  if(runcosmics_){
185  jetCleaningFlag_ =false;
186  }
187 
188 
189  // ==========================================================
190  //DCS information
191  // ==========================================================
192  edm::ConsumesCollector iC = consumesCollector();
193  DCSFilterForJetMonitoring_ = new JetMETDQMDCSFilter(pSet.getParameter<ParameterSet>("DCSFilterForJetMonitoring"), iC);
194  DCSFilterForDCSMonitoring_ = new JetMETDQMDCSFilter("ecal:hbhe:hf:ho:pixel:sistrip:es:muon", iC);
195 
196  //Trigger selectoin
197  edm::ParameterSet highptjetparms = pSet.getParameter<edm::ParameterSet>("highPtJetTrigger");
198  edm::ParameterSet lowptjetparms = pSet.getParameter<edm::ParameterSet>("lowPtJetTrigger" );
199 
200  highPtJetEventFlag_ = new GenericTriggerEventFlag( highptjetparms, consumesCollector() );
201  lowPtJetEventFlag_ = new GenericTriggerEventFlag( lowptjetparms , consumesCollector() );
202 
203  highPtJetExpr_ = highptjetparms.getParameter<std::vector<std::string> >("hltPaths");
204  lowPtJetExpr_ = lowptjetparms .getParameter<std::vector<std::string> >("hltPaths");
205 
206  processname_ = pSet.getParameter<std::string>("processname");
207 
208  //jet cleanup parameters
209  cleaningParameters_ = pSet.getParameter<ParameterSet>("CleaningParameters");
210 
211  bypassAllPVChecks_= cleaningParameters_.getParameter<bool>("bypassAllPVChecks");
212  vertexLabel_ = cleaningParameters_.getParameter<edm::InputTag>("vertexCollection");
213  vertexToken_ = consumes<std::vector<reco::Vertex> >(edm::InputTag(vertexLabel_));
214 
215  gtLabel_ = cleaningParameters_.getParameter<edm::InputTag>("gtLabel");
216  gtToken_ = consumes<L1GlobalTriggerReadoutRecord>(edm::InputTag(gtLabel_));
217 
218  std::string inputCollectionLabel(mInputCollection_.label());
219  verbose_= parameters_.getParameter<int>("verbose");
220  // monitoring of eta parameter
221  etaBin_ = parameters_.getParameter<int>("etaBin");
222  etaMin_ = parameters_.getParameter<double>("etaMin");
223  etaMax_ = parameters_.getParameter<double>("etaMax");
224  // monitoring of phi paramater
225  phiBin_ = parameters_.getParameter<int>("phiBin");
226  phiMin_ = parameters_.getParameter<double>("phiMin");
227  phiMax_ = parameters_.getParameter<double>("phiMax");
228  // monitoring of the transverse momentum
229  ptBin_ = parameters_.getParameter<int>("ptBin");
230  ptMin_ = parameters_.getParameter<double>("ptMin");
231  ptMax_ = parameters_.getParameter<double>("ptMax");
232  //
233  eBin_ = parameters_.getParameter<int>("eBin");
234  eMin_ = parameters_.getParameter<double>("eMin");
235  eMax_ = parameters_.getParameter<double>("eMax");
236  //
237  pBin_ = parameters_.getParameter<int>("pBin");
238  pMin_ = parameters_.getParameter<double>("pMin");
239  pMax_ = parameters_.getParameter<double>("pMax");
240  //
241  nbinsPV_ = parameters_.getParameter<int>("pVBin");
242  nPVlow_ = parameters_.getParameter<double>("pVMin");
243  nPVhigh_ = parameters_.getParameter<double>("pVMax");
244  //
245  ptThreshold_ = parameters_.getParameter<double>("ptThreshold");
246  ptThresholdUnc_=parameters_.getParameter<double>("ptThresholdUnc");
247  asymmetryThirdJetCut_ = parameters_.getParameter<double>("asymmetryThirdJetCut");
248  balanceThirdJetCut_ = parameters_.getParameter<double>("balanceThirdJetCut");
249 }
250 
251 
252 // ***********************************************************
254 
255  delete highPtJetEventFlag_;
256  delete lowPtJetEventFlag_;
257 
258  delete DCSFilterForDCSMonitoring_;
259  delete DCSFilterForJetMonitoring_;
260  LogTrace(metname)<<"[JetAnalyzer] Saving the histos";
261 }
262 
263 // ***********************************************************
265  edm::Run const & iRun,
266  edm::EventSetup const & ) {
267 
268  // dbe_ = edm::Service<DQMStore>().operator->();
269  if(jetCleaningFlag_){
270  ibooker.setCurrentFolder("JetMET/Jet/Cleaned"+mInputCollection_.label());
271  DirName = "JetMET/Jet/Cleaned"+mInputCollection_.label();
272  }else{
273  ibooker.setCurrentFolder("JetMET/Jet/Uncleaned"+mInputCollection_.label());
274  DirName = "JetMET/Jet/Uncleaned"+mInputCollection_.label();
275  }
276 
277  jetME = ibooker.book1D("jetReco", "jetReco", 3, 1, 4);
278  jetME->setBinLabel(1,"CaloJets",1);
279  jetME->setBinLabel(2,"PFJets",1);
280  jetME->setBinLabel(3,"JPTJets",1);
281 
282  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"jetReco",jetME));
283 
284 
285  mPt = ibooker.book1D("Pt", "pt", ptBin_, ptMin_, ptMax_);
286  mEta = ibooker.book1D("Eta", "eta", etaBin_, etaMin_, etaMax_);
287  mPhi = ibooker.book1D("Phi", "phi", phiBin_, phiMin_, phiMax_);
288  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt" ,mPt));
289  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta",mEta));
290  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi",mPhi));
291 
292  //if(!isJPTJet_){
293  mConstituents = ibooker.book1D("Constituents", "# of constituents", 50, 0, 100);
294  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents",mConstituents));
295  //}
296  mJetEnergyCorr= ibooker.book1D("JetEnergyCorr", "jet energy correction factor", 50, 0.0,3.0);
297  mJetEnergyCorrVSEta= ibooker.bookProfile("JetEnergyCorrVSEta", "jet energy correction factor VS eta", etaBin_, etaMin_,etaMax_, 0.0,3.0);
298  mJetEnergyCorrVSPt= ibooker.bookProfile("JetEnergyCorrVSPt", "jet energy correction factor VS pt", ptBin_, ptMin_,ptMax_, 0.0,3.0);
299  mHFrac = ibooker.book1D("HFrac", "HFrac", 140, -0.2, 1.2);
300  mEFrac = ibooker.book1D("EFrac", "EFrac", 52, -0.02, 1.02);
301  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorr" ,mJetEnergyCorr));
302  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorrVSEta" ,mJetEnergyCorrVSEta));
303  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorrVSPt" ,mJetEnergyCorrVSPt));
304  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac" ,mHFrac));
305  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac" ,mEFrac));
306 
307  mPt_uncor = ibooker.book1D("Pt_uncor", "pt for uncorrected jets", ptBin_, ptThresholdUnc_, ptMax_);
308  mEta_uncor = ibooker.book1D("Eta_uncor", "eta for uncorrected jets", etaBin_, etaMin_, etaMax_);
309  mPhi_uncor = ibooker.book1D("Phi_uncor", "phi for uncorrected jets", phiBin_, phiMin_, phiMax_);
310  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_uncor" ,mPt_uncor));
311  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_uncor",mEta_uncor));
312  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_uncor",mPhi_uncor));
313  //if(!isJPTJet_){
314  mConstituents_uncor = ibooker.book1D("Constituents_uncor", "# of constituents for uncorrected jets", 50, 0, 100);
315  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_uncor",mConstituents_uncor));
316  //}
317 
318  mDPhi = ibooker.book1D("DPhi", "dPhi btw the two leading jets", 100, 0., acos(-1.));
319  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DPhi",mDPhi));
320 
321  // Book NPV profiles
322  //----------------------------------------------------------------------------
323  mPt_profile = ibooker.bookProfile("Pt_profile", "pt", nbinsPV_, nPVlow_, nPVhigh_, ptBin_, ptMin_, ptMax_);
324  mEta_profile = ibooker.bookProfile("Eta_profile", "eta", nbinsPV_, nPVlow_, nPVhigh_, etaBin_, etaMin_, etaMax_);
325  mPhi_profile = ibooker.bookProfile("Phi_profile", "phi", nbinsPV_, nPVlow_, nPVhigh_, phiBin_, phiMin_, phiMax_);
326  //if(!isJPTJet_){
327  mConstituents_profile = ibooker.bookProfile("Constituents_profile", "# of constituents", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
328  //}
329  mHFrac_profile = ibooker.bookProfile("HFrac_profile", "HFrac", nbinsPV_, nPVlow_, nPVhigh_, 140, -0.2, 1.2);
330  mEFrac_profile = ibooker.bookProfile("EFrac_profile", "EFrac", nbinsPV_, nPVlow_, nPVhigh_, 52, -0.02, 1.02);
331  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_profile" ,mPt_profile));
332  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_profile",mEta_profile));
333  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_profile",mPhi_profile));
334  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_profile",mHFrac_profile));
335  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_profile",mEFrac_profile));
336 
337 
338  if(!jetCleaningFlag_){//JIDPassFrac_ defines a collection of cleaned jets, for which we will want to fill the cleaning passing fraction
339  mLooseJIDPassFractionVSeta = ibooker.bookProfile("JetIDPassFractionVSeta","JetIDPassFractionVSeta",etaBin_, etaMin_, etaMax_,0.,1.2);
340  mLooseJIDPassFractionVSpt = ibooker.bookProfile("JetIDPassFractionVSpt","JetIDPassFractionVSpt",ptBin_, ptMin_, ptMax_,0.,1.2);
341  mLooseJIDPassFractionVSptNoHF = ibooker.bookProfile("JetIDPassFractionVSptNoHF","JetIDPassFractionVSptNoHF",ptBin_, ptMin_, ptMax_,0.,1.2);
342  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetIDPassFractionVSeta" ,mLooseJIDPassFractionVSeta));
343  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetIDPassFractionVSpt" ,mLooseJIDPassFractionVSpt));
344  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetIDPassFractionVSptNoHF",mLooseJIDPassFractionVSptNoHF));
345  }
346 
347  mNJets_profile = ibooker.bookProfile("NJets_profile", "number of jets", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
348 
349 
350  // Set NPV profiles x-axis title
351  //----------------------------------------------------------------------------
352  mPt_profile ->setAxisTitle("nvtx",1);
353  mEta_profile ->setAxisTitle("nvtx",1);
354  mPhi_profile ->setAxisTitle("nvtx",1);
355  //if(!isJPTJet_){
356  mConstituents_profile->setAxisTitle("nvtx",1);
357  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_profile",mConstituents_profile));
358  //}
359  mHFrac_profile ->setAxisTitle("nvtx",1);
360  mEFrac_profile ->setAxisTitle("nvtx",1);
361 
362  mNJets_profile->setAxisTitle("nvtx",1);
363 
364  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_profile" ,mPt_profile));
365  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_profile",mEta_profile));
366  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_profile",mPhi_profile));
367  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_profile" ,mHFrac_profile));
368  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_profile" ,mEFrac_profile));
369  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NJets_profile" ,mNJets_profile));
370 
371 
372  mPhiVSEta = ibooker.book2D("PhiVSEta", "PhiVSEta", 50, etaMin_, etaMax_, 24, phiMin_, phiMax_);
373  mPhiVSEta->getTH2F()->SetOption("colz");
374  mPhiVSEta->setAxisTitle("#eta",1);
375  mPhiVSEta->setAxisTitle("#phi",2);
376  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhiVSEta" ,mPhiVSEta));
377 
378  mPt_1 = ibooker.book1D("Pt_1", "Pt spectrum of jets - range 1", 20, 0, 100);
379  mPt_2 = ibooker.book1D("Pt_2", "Pt spectrum of jets - range 2", 60, 0, 300);
380  mPt_3 = ibooker.book1D("Pt_3", "Pt spectrum of jets - range 3", 100, 0, 5000);
381  // Low and high pt trigger paths
382  mPt_Lo = ibooker.book1D("Pt_Lo", "Pt (Pass Low Pt Jet Trigger)", 20, 0, 100);
383  //mEta_Lo = ibooker.book1D("Eta_Lo", "Eta (Pass Low Pt Jet Trigger)", etaBin_, etaMin_, etaMax_);
384  mPhi_Lo = ibooker.book1D("Phi_Lo", "Phi (Pass Low Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
385 
386  mPt_Hi = ibooker.book1D("Pt_Hi", "Pt (Pass Hi Pt Jet Trigger)", 60, 0, 300);
387  mEta_Hi = ibooker.book1D("Eta_Hi", "Eta (Pass Hi Pt Jet Trigger)", etaBin_, etaMin_, etaMax_);
388  mPhi_Hi = ibooker.book1D("Phi_Hi", "Phi (Pass Hi Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
389  mNJets = ibooker.book1D("NJets", "number of jets", 100, 0, 100);
390 
391  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_1" ,mPt_1));
392  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_2" ,mPt_2));
393  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_3" ,mPt_3));
394  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Lo" ,mPt_Lo));
395  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Lo" ,mPhi_Lo));
396  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Hi" ,mPt_Hi));
397  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_Hi" ,mEta_Hi));
398  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Hi" ,mPhi_Hi));
399  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NJets" ,mNJets));
400 
401  //mPt_Barrel_Lo = ibooker.book1D("Pt_Barrel_Lo", "Pt Barrel (Pass Low Pt Jet Trigger)", 20, 0, 100);
402  //mPhi_Barrel_Lo = ibooker.book1D("Phi_Barrel_Lo", "Phi Barrel (Pass Low Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
403  //if(!isJPTJet_){
404  mConstituents_Barrel = ibooker.book1D("Constituents_Barrel", "Constituents Barrel", 50, 0, 100);
405  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_Barrel",mConstituents_Barrel));
406  //}
407  mHFrac_Barrel = ibooker.book1D("HFrac_Barrel", "HFrac Barrel", 100, 0, 1);
408  mEFrac_Barrel = ibooker.book1D("EFrac_Barrel", "EFrac Barrel", 52, -0.02, 1.02);
409  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_Barrel" ,mHFrac_Barrel));
410  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_Barrel" ,mEFrac_Barrel));
411 
412  //mPt_EndCap_Lo = ibooker.book1D("Pt_EndCap_Lo", "Pt EndCap (Pass Low Pt Jet Trigger)", 20, 0, 100);
413  //mPhi_EndCap_Lo = ibooker.book1D("Phi_EndCap_Lo", "Phi EndCap (Pass Low Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
414  //if(!isJPTJet_){
415  mConstituents_EndCap = ibooker.book1D("Constituents_EndCap", "Constituents EndCap", 50, 0, 100);
416  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_EndCap",mConstituents_EndCap));
417  //}
418  mHFrac_EndCap = ibooker.book1D("HFrac_EndCap", "HFrac EndCap", 100, 0, 1);
419  mEFrac_EndCap = ibooker.book1D("EFrac_EndCap", "EFrac EndCap", 52, -0.02, 1.02);
420  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_EndCap" ,mHFrac_EndCap));
421  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_EndCap" ,mEFrac_EndCap));
422 
423  //mPt_Forward_Lo = ibooker.book1D("Pt_Forward_Lo", "Pt Forward (Pass Low Pt Jet Trigger)", 20, 0, 100);
424  //mPhi_Forward_Lo = ibooker.book1D("Phi_Forward_Lo", "Phi Forward (Pass Low Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
425  //if(!isJPTJet_){
426  mConstituents_Forward = ibooker.book1D("Constituents_Forward", "Constituents Forward", 50, 0, 100);
427  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_Forward",mConstituents_Forward));
428  //}
429  mHFrac_Forward = ibooker.book1D("HFrac_Forward", "HFrac Forward", 140, -0.2, 1.2);
430  mEFrac_Forward = ibooker.book1D("EFrac_Forward", "EFrac Forward", 52, -0.02, 1.02);
431  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_Forward" ,mHFrac_Forward));
432  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_Forward" ,mEFrac_Forward));
433 
434 
435  mPt_Barrel_Hi = ibooker.book1D("Pt_Barrel_Hi", "Pt Barrel (Pass Hi Pt Jet Trigger)", 60, 0, 300);
436  mPhi_Barrel_Hi = ibooker.book1D("Phi_Barrel_Hi", "Phi Barrel (Pass Hi Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
437 
438  mPt_EndCap_Hi = ibooker.book1D("Pt_EndCap_Hi", "Pt EndCap (Pass Hi Pt Jet Trigger)", 60, 0, 300);
439  mPhi_EndCap_Hi = ibooker.book1D("Phi_EndCap_Hi", "Phi EndCap (Pass Hi Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
440 
441  mPt_Forward_Hi = ibooker.book1D("Pt_Forward_Hi", "Pt Forward (Pass Hi Pt Jet Trigger)", 60, 0, 300);
442  mPhi_Forward_Hi = ibooker.book1D("Phi_Forward_Hi", "Phi Forward (Pass Hi Pt Jet Trigger)", phiBin_, phiMin_, phiMax_);
443 
444  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Barrel_Hi" ,mPt_Barrel_Hi));
445  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Barrel_Hi",mPhi_Barrel_Hi));
446  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_EndCap_Hi" ,mPt_EndCap_Hi));
447  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_EndCap_Hi",mPhi_EndCap_Hi));
448  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Forward_Hi" ,mPt_Forward_Hi));
449  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Forward_Hi",mPhi_Forward_Hi));
450 
451  mPhi_Barrel = ibooker.book1D("Phi_Barrel", "Phi_Barrel", phiBin_, phiMin_, phiMax_);
452  mPt_Barrel = ibooker.book1D("Pt_Barrel", "Pt_Barrel", ptBin_, ptMin_, ptMax_);
453 
454  mPhi_EndCap = ibooker.book1D("Phi_EndCap", "Phi_EndCap", phiBin_, phiMin_, phiMax_);
455  mPt_EndCap = ibooker.book1D("Pt_EndCap", "Pt_EndCap", ptBin_, ptMin_, ptMax_);
456 
457  mPhi_Forward = ibooker.book1D("Phi_Forward", "Phi_Forward", phiBin_, phiMin_, phiMax_);
458  mPt_Forward = ibooker.book1D("Pt_Forward", "Pt_Forward", ptBin_, ptMin_, ptMax_);
459 
460  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Barrel" ,mPt_Barrel));
461  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Barrel",mPhi_Barrel));
462  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_EndCap" ,mPt_EndCap));
463  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_EndCap",mPhi_EndCap));
464  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_Forward" ,mPt_Forward));
465  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_Forward",mPhi_Forward));
466 
467  // Leading Jet Parameters
468  mEtaFirst = ibooker.book1D("EtaFirst", "EtaFirst", 100, -5, 5);
469  mPhiFirst = ibooker.book1D("PhiFirst", "PhiFirst", 70, -3.5, 3.5);
470  mPtFirst = ibooker.book1D("PtFirst", "PtFirst", ptBin_, ptMin_, ptMax_);
471 
472  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EtaFirst" ,mEtaFirst));
473  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtFirst" ,mPtFirst));
474  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhiFirst" ,mPhiFirst));
475 
476  //--- Calo jet selection only
477  if(isCaloJet_) {
478 
479  // CaloJet specific
480  mMaxEInEmTowers = ibooker.book1D("MaxEInEmTowers", "MaxEInEmTowers", 150, 0, 150);
481  mMaxEInHadTowers = ibooker.book1D("MaxEInHadTowers", "MaxEInHadTowers", 150, 0, 150);
482 
483  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MaxEInEmTowers" ,mMaxEInEmTowers));
484  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MaxEInHadTowers" ,mMaxEInHadTowers));
485 
486  mHadEnergyInHO = ibooker.book1D("HadEnergyInHO", "HadEnergyInHO", 100, 0, 20);
487  mHadEnergyInHB = ibooker.book1D("HadEnergyInHB", "HadEnergyInHB", 100, 0, 100);
488  mHadEnergyInHF = ibooker.book1D("HadEnergyInHF", "HadEnergyInHF", 100, 0, 100);
489  mHadEnergyInHE = ibooker.book1D("HadEnergyInHE", "HadEnergyInHE", 100, 0, 200);
490  mEmEnergyInEB = ibooker.book1D("EmEnergyInEB", "EmEnergyInEB", 100, 0, 100);
491  mEmEnergyInEE = ibooker.book1D("EmEnergyInEE", "EmEnergyInEE", 100, 0, 100);
492  mEmEnergyInHF = ibooker.book1D("EmEnergyInHF", "EmEnergyInHF", 120, -20, 200);
493  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HadEnergyInHO" ,mHadEnergyInHO));
494  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HadEnergyInHB" ,mHadEnergyInHB));
495  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HadEnergyInHF" ,mHadEnergyInHF));
496  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HadEnergyInHE" ,mHadEnergyInHE));
497  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EmEnergyInEB" ,mEmEnergyInEB));
498  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EmEnergyInEE" ,mEmEnergyInEE));
499  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EmEnergyInHF" ,mEmEnergyInHF));
500 
501  //JetID variables
502  mresEMF = ibooker.book1D("resEMF", "resEMF", 50, 0., 1.);
503  mN90Hits = ibooker.book1D("N90Hits", "N90Hits", 100, 0., 100);
504  mfHPD = ibooker.book1D("fHPD", "fHPD", 50, 0., 1.);
505  mfRBX = ibooker.book1D("fRBX", "fRBX", 50, 0., 1.);
506  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"resEMF" ,mresEMF));
507  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"N90Hits" ,mN90Hits));
508  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fHPD" ,mfHPD));
509  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fRBX" ,mfRBX));
510  }
511 
512  //remove JPT related histograms due to anticipated removal in RECO in 7_1_X
513  //if(isJPTJet_) {
514  //jpt histograms
515  //mE = ibooker.book1D("E", "E", eBin_, eMin_, eMax_);
516  //mEt = ibooker.book1D("Et", "Et", ptBin_, ptMin_, ptMax_);
517  //mP = ibooker.book1D("P", "P", eBin_, eMin_, eMax_);
518  //mPtSecond = ibooker.book1D("PtSecond", "PtSecond", ptBin_, ptMin_, ptMax_);
519  //mPtThird = ibooker.book1D("PtThird", "PtThird", ptBin_, ptMin_, ptMax_);
520  //mPx = ibooker.book1D("Px", "Px", ptBin_, -ptMax_, ptMax_);
521  //mPy = ibooker.book1D("Py", "Py", ptBin_, -ptMax_, ptMax_);
522  //mPz = ibooker.book1D("Pz", "Pz", ptBin_, -ptMax_, ptMax_);
523  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"E" ,mE));
524  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Et" ,mEt));
525  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"P" ,mP));
526  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtSecond" ,mPtSecond));
527  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PtThird" ,mPtThird));
528  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Px" ,mPx));
529  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Py" ,mPy));
530  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pz" ,mPz));
531 
532  //JetID variables
533  //mresEMF = ibooker.book1D("resEMF", "resEMF", 50, 0., 1.);
534  //mN90Hits = ibooker.book1D("N90Hits", "N90Hits", 100, 0., 100);
535  //mfHPD = ibooker.book1D("fHPD", "fHPD", 50, 0., 1.);
536  //mfRBX = ibooker.book1D("fRBX", "fRBX", 50, 0., 1.);
537  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"resEMF" ,mresEMF));
538  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"N90Hits" ,mN90Hits));
539  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fHPD" ,mfHPD));
540  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fRBX" ,mfRBX));
541 
542  //mnTracks = ibooker.book1D("nTracks", "number of tracks for correction per jet", 100, 0, 100);
543  //mnTracksVSJetPt= ibooker.bookProfile("nTracksVSJetPt","number of tracks for correction per jet vs raw jet p_{T}",ptBin_, ptMin_, ptMax_,100,0,100);
544  //mnTracksVSJetEta= ibooker.bookProfile("nTracksVSJetEta","number of tracks for correction per jet vs jet #eta",etaBin_, etaMin_, etaMax_,100,0,100);
545  //mnTracksVSJetPt ->setAxisTitle("raw JetPt",1);
546  //mnTracksVSJetEta ->setAxisTitle("raw JetEta",1);
547  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nTracks" ,mnTracks));
548  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nTracksVSJetPt" ,mnTracksVSJetPt));
549  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nTracksVSJetEta" ,mnTracksVSJetEta));
550 
551  //mnallPionTracksPerJet=ibooker.book1D("nallPionTracks", "number of pion tracks for correction per jet", 100, 0, 100);
552  //mallPionTracksPt=ibooker.book1D("allPionTracksPt", "pion track p_{T}", 100, 0., 50.);
553  //mallPionTracksEta=ibooker.book1D("allPionTracksEta", "pion track #eta", 50, -2.5, 2.5);
554  //mallPionTracksPhi=ibooker.book1D("allPionTracksPhi", "pion track #phi", phiBin_,phiMin_, phiMax_);
555  //mallPionTracksPtVSEta=ibooker.bookProfile("allPionTracksPtVSEta", "pion track p_{T} vs track #eta", 50, -2.5, 2.5,100,0.,50.);
556  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nallPionTracks" ,mnallPionTracksPerJet));
557  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allPionTracksPt" ,mallPionTracksPt));
558  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allPionTracksEta" ,mallPionTracksEta));
559  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allPionTracksPhi" ,mallPionTracksPhi));
560  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allPionTracksPtVSEta" ,mallPionTracksPtVSEta));
561 
562  //mnInVertexInCaloPionTracksPerJet=ibooker.book1D("nInVertexInCaloPionTracks", "number of pion in cone at calo and vertexs for correction per jet", 100, 0, 100);
563  //mInVertexInCaloPionTracksPt=ibooker.book1D("InVertexInCaloPionTracksPt", "pion in cone at calo and vertex p_{T}", 100, 0., 50.);
564  //mInVertexInCaloPionTracksEta=ibooker.book1D("InVertexInCaloPionTracksEta", "pion in cone at calo and vertex #eta", 50, -2.5, 2.5);
565  //mInVertexInCaloPionTracksPhi=ibooker.book1D("InVertexInCaloPionTracksPhi", "pion in cone at calo and vertex #phi", phiBin_,phiMin_, phiMax_);
566  //mInVertexInCaloPionTracksPtVSEta=ibooker.bookProfile("InVertexInCaloPionTracksPtVSEta", "pion in cone at calo and vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
567  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nInVertexInCaloPionTracks" ,mnInVertexInCaloPionTracksPerJet));
568  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloPionTracksPt" ,mInVertexInCaloPionTracksPt));
569  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloPionTracksEta" ,mInVertexInCaloPionTracksEta));
570  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloPionTracksPhi" ,mInVertexInCaloPionTracksPhi));
571  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloPionTracksPtVSEta" ,mInVertexInCaloPionTracksPtVSEta));
572 
573  //mnOutVertexInCaloPionTracksPerJet=ibooker.book1D("nOutVertexInCaloPionTracks", "number of pion in cone at calo and out at vertex for correction per jet", 100, 0, 100);
574  //mOutVertexInCaloPionTracksPt=ibooker.book1D("OutVertexInCaloPionTracksPt", "pion in cone at calo and out at vertex p_{T}", 100, 0., 50.);
575  //mOutVertexInCaloPionTracksEta=ibooker.book1D("OutVertexInCaloPionTracksEta", "pion in cone at calo and out at vertex #eta", 50, -2.5, 2.5);
576  //mOutVertexInCaloPionTracksPhi=ibooker.book1D("OutVertexInCaloPionTracksPhi", "pion in cone at calo and out at vertex #phi", phiBin_,phiMin_, phiMax_);
577  //mOutVertexInCaloPionTracksPtVSEta=ibooker.bookProfile("OutVertexInCaloPionTracksPtVSEta", "pion in cone at calo and out at vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
578 
579  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nOutVertexInCaloPionTracks" ,mnOutVertexInCaloPionTracksPerJet));
580  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloPionTracksPt" ,mOutVertexInCaloPionTracksPt));
581  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloPionTracksEta" ,mOutVertexInCaloPionTracksEta));
582  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloPionTracksPhi" ,mOutVertexInCaloPionTracksPhi));
583  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloPionTracksPtVSEta" ,mOutVertexInCaloPionTracksPtVSEta));
584 
585  //mnInVertexOutCaloPionTracksPerJet=ibooker.book1D("nInVertexOutCaloPionTracks", "number of pions out cone at calo and and in cone at vertex for correction per jet", 100, 0, 100);
586  //mInVertexOutCaloPionTracksPt=ibooker.book1D("InVertexOutCaloPionTracksPt", "pion out cone at calo and in cone at vertex p_{T}", 100, 0., 50.);
587  //mInVertexOutCaloPionTracksEta=ibooker.book1D("InVertexOutCaloPionTracksEta", "pion out cone at calo and in cone at vertex #eta", 50, -2.5, 2.5);
588  //mInVertexOutCaloPionTracksPhi=ibooker.book1D("InVertexOutCaloPionTracksPhi", "pion out cone at calo and in cone at vertex #phi", phiBin_,phiMin_, phiMax_);
589  //mInVertexOutCaloPionTracksPtVSEta=ibooker.bookProfile("InVertexOutCaloPionTracksPtVSEta", "pion out cone at calo and in cone at vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
590  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nInVertexOutCaloPionTracks" ,mnInVertexOutCaloPionTracksPerJet));
591  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloPionTracksPt" ,mInVertexOutCaloPionTracksPt));
592  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloPionTracksEta" ,mInVertexOutCaloPionTracksEta));
593  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloPionTracksPhi" ,mInVertexOutCaloPionTracksPhi));
594  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloPionTracksPtVSEta" ,mInVertexOutCaloPionTracksPtVSEta));
595 
596  //mnallMuonTracksPerJet=ibooker.book1D("nallMuonTracks", "number of//muon tracks for correction per jet", 10, 0, 10);
597  //mallMuonTracksPt=ibooker.book1D("allMuonTracksPt", "muon track p_{T}", 100, 0., 50.);
598  //mallMuonTracksEta=ibooker.book1D("allMuonTracksEta", "muon track #eta", 50, -2.5, 2.5);
599  //mallMuonTracksPhi=ibooker.book1D("allMuonTracksPhi", "muon track #phi", phiBin_,phiMin_, phiMax_);
600  //mallMuonTracksPtVSEta=ibooker.bookProfile("allMuonTracksPtVSEta", "muon track p_{T} vs track #eta", 50, -2.5, 2.5,100,0.,50.);
601  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nallMuonTracks" ,mnallMuonTracksPerJet));
602  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allMuonTracksPt" ,mallMuonTracksPt));
603  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allMuonTracksEta" ,mallMuonTracksEta));
604  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allMuonTracksPhi" ,mallMuonTracksPhi));
605  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allMuonTracksPtVSEta" ,mallMuonTracksPtVSEta));
606 
607  //mnInVertexInCaloMuonTracksPerJet=ibooker.book1D("nInVertexInCaloMuonTracks", "number of//muons in cone at calo and vertex for correction per jet", 10, 0, 10);
608  //mInVertexInCaloMuonTracksPt=ibooker.book1D("InVertexInCaloMuonTracksPt", "muon in cone at calo and vertex p_{T}", 100, 0., 50.);
609  //mInVertexInCaloMuonTracksEta=ibooker.book1D("InVertexInCaloMuonTracksEta", "muon in cone at calo and vertex #eta", 50, -2.5, 2.5);
610  //mInVertexInCaloMuonTracksPhi=ibooker.book1D("InVertexInCaloMuonTracksPhi", "muon in cone at calo and vertex #phi", phiBin_,phiMin_, phiMax_);
611  //mInVertexInCaloMuonTracksPtVSEta=ibooker.bookProfile("InVertexInCaloMuonTracksPtVSEta", "muon in cone at calo and vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
612  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nInVertexInCaloMuonTracks" ,mnInVertexInCaloMuonTracksPerJet));
613  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloMuonTracksPt" ,mInVertexInCaloMuonTracksPt));
614  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloMuonTracksEta" ,mInVertexInCaloMuonTracksEta));
615  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloMuonTracksPhi" ,mInVertexInCaloMuonTracksPhi));
616  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloMuonTracksPtVSEta" ,mInVertexInCaloMuonTracksPtVSEta));
617 
618  //mnOutVertexInCaloMuonTracksPerJet=ibooker.book1D("nOutVertexInCaloMuonTracks", "number of//muons in cone at calo and out cone at vertex for correction per jet", 10, 0, 10);
619  //mOutVertexInCaloMuonTracksPt=ibooker.book1D("OutVertexInCaloMuonTracksPt", "muon in cone at calo and out cone at vertex p_{T}", 100, 0., 50.);
620  //mOutVertexInCaloMuonTracksEta=ibooker.book1D("OutVertexInCaloMuonTracksEta", "muon in cone at calo and out cone at vertex #eta", 50, -2.5, 2.5);
621  //mOutVertexInCaloMuonTracksPhi=ibooker.book1D("OutVertexInCaloMuonTracksPhi", "muon in cone at calo and out cone at vertex #phi", phiBin_,phiMin_, phiMax_);
622  //mOutVertexInCaloMuonTracksPtVSEta=ibooker.bookProfile("OutVertexInCaloMuonTracksPtVSEta", "muon oin cone at calo and out cone at vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
623 
624  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nOutVertexInCaloMuonTracks" ,mnOutVertexInCaloMuonTracksPerJet));
625  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloMuonTracksPt" ,mOutVertexInCaloMuonTracksPt));
626  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloMuonTracksEta" ,mOutVertexInCaloMuonTracksEta));
627  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloMuonTracksPhi" ,mOutVertexInCaloMuonTracksPhi));
628  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloMuonTracksPtVSEta" ,mOutVertexInCaloMuonTracksPtVSEta));
629 
630  //mnInVertexOutCaloMuonTracksPerJet=ibooker.book1D("nInVertexOutCaloMuonTracks", "number of//muons out cone at calo and in cone at vertex for correction per jet", 10, 0, 10);
631  //mInVertexOutCaloMuonTracksPt=ibooker.book1D("InVertexOutCaloMuonTracksPt", "muon out cone at calo and in cone at vertex p_{T}", 100, 0., 50.);
632  //mInVertexOutCaloMuonTracksEta=ibooker.book1D("InVertexOutCaloMuonTracksEta", "muon out cone at calo and in cone at vertex #eta", 50, -2.5, 2.5);
633  //mInVertexOutCaloMuonTracksPhi=ibooker.book1D("InVertexOutCaloMuonTracksPhi", "muon out cone at calo and in cone at vertex #phi", phiBin_,phiMin_, phiMax_);
634  //mInVertexOutCaloMuonTracksPtVSEta=ibooker.bookProfile("InVertexOutCaloMuonTracksPtVSEta", "muon out cone at calo and in cone at vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
635 
636  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nInVertexOutCaloMuonTracks" ,mnInVertexOutCaloMuonTracksPerJet));
637  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloMuonTracksPt" ,mInVertexOutCaloMuonTracksPt));
638  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloMuonTracksEta" ,mInVertexOutCaloMuonTracksEta));
639  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloMuonTracksPhi" ,mInVertexOutCaloMuonTracksPhi));
640  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloMuonTracksPtVSEta" ,mInVertexOutCaloMuonTracksPtVSEta));
641 
642  //mnallElectronTracksPerJet=ibooker.book1D("nallElectronTracks", "number of electron tracks for correction per jet", 10, 0, 10);
643  //mallElectronTracksPt=ibooker.book1D("allElectronTracksPt", "electron track p_{T}", 100, 0., 50.);
644  //mallElectronTracksEta=ibooker.book1D("allElectronTracksEta", "electron track #eta", 50, -2.5, 2.5);
645  //mallElectronTracksPhi=ibooker.book1D("allElectronTracksPhi", "electron track #phi", phiBin_,phiMin_, phiMax_);
646  //mallElectronTracksPtVSEta=ibooker.bookProfile("allElectronTracksPtVSEta", "electron track p_{T} vs track #eta", 50, -2.5, 2.5,100,0.,50.);
647  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nallElectronTracks" ,mnallElectronTracksPerJet));
648  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allElectronTracksPt" ,mallElectronTracksPt));
649  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allElectronTracksEta" ,mallElectronTracksEta));
650  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allElectronTracksPhi" ,mallElectronTracksPhi));
651  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"allElectronTracksPtVSEta" ,mallElectronTracksPtVSEta));
652 
653  //mnInVertexInCaloElectronTracksPerJet=ibooker.book1D("nInVertexInCaloElectronTracks", "number of electrons in cone at calo and vertex for correction per jet", 10, 0, 10);
654  //mInVertexInCaloElectronTracksPt=ibooker.book1D("InVertexInCaloElectronTracksPt", "electron in cone at calo and vertex p_{T}", 100, 0., 50.);
655  //mInVertexInCaloElectronTracksEta=ibooker.book1D("InVertexInCaloElectronTracksEta", "electron in cone at calo and vertex #eta", 50, -2.5, 2.5);
656  //mInVertexInCaloElectronTracksPhi=ibooker.book1D("InVertexInCaloElectronTracksPhi", "electron in cone at calo and vertex #phi", phiBin_,phiMin_, phiMax_);
657  //mInVertexInCaloElectronTracksPtVSEta=ibooker.bookProfile("InVertexInCaloElectronTracksPtVSEta", "electron in cone at calo and vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
658  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nInVertexInCaloElectronTracks" ,mnInVertexInCaloElectronTracksPerJet));
659  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloElectronTracksPt" ,mInVertexInCaloElectronTracksPt));
660  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloElectronTracksEta" ,mInVertexInCaloElectronTracksEta));
661  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloElectronTracksPhi" ,mInVertexInCaloElectronTracksPhi));
662  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexInCaloElectronTracksPtVSEta" ,mInVertexInCaloElectronTracksPtVSEta));
663 
664  //mnOutVertexInCaloElectronTracksPerJet=ibooker.book1D("nOutVertexInCaloElectronTracks", "number of electrons in cone at calo and out cone at vertex for correction per jet", 10, 0, 10);
665  //mOutVertexInCaloElectronTracksPt=ibooker.book1D("OutVertexInCaloElectronTracksPt", "electron in cone at calo and out cone at vertex p_{T}", 100, 0., 50.);
666  //mOutVertexInCaloElectronTracksEta=ibooker.book1D("OutVertexInCaloElectronTracksEta", "electron in cone at calo and out cone at vertex #eta", 50, -2.5, 2.5);
667  //mOutVertexInCaloElectronTracksPhi=ibooker.book1D("OutVertexInCaloElectronTracksPhi", "electron in cone at calo and out cone at vertex #phi", phiBin_,phiMin_, phiMax_);
668  //mOutVertexInCaloElectronTracksPtVSEta=ibooker.bookProfile("OutVertexInCaloElectronTracksPtVSEta", "electron in cone at calo and out cone at vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
669  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nOutVertexInCaloElectronTracks" ,mnOutVertexInCaloElectronTracksPerJet));
670  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloElectronTracksPt" ,mOutVertexInCaloElectronTracksPt));
671  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloElectronTracksEta" ,mOutVertexInCaloElectronTracksEta));
672  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloElectronTracksPhi" ,mOutVertexInCaloElectronTracksPhi));
673  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexInCaloElectronTracksPtVSEta" ,mOutVertexInCaloElectronTracksPtVSEta));
674 
675  //mnInVertexOutCaloElectronTracksPerJet=ibooker.book1D("nInVertexOutCaloElectronTracks", "number of electrons out cone at calo and in cone at vertex for correction per jet", 10, 0, 10);
676  //mInVertexOutCaloElectronTracksPt=ibooker.book1D("InVertexOutCaloElectronTracksPt", "electron out cone at calo and in cone at vertex p_{T}", 100, 0., 50.);
677  //mInVertexOutCaloElectronTracksEta=ibooker.book1D("InVertexOutCaloElectronTracksEta", "electron out cone at calo and in cone at vertex #eta", 50, -2.5, 2.5);
678  //mInVertexOutCaloElectronTracksPhi=ibooker.book1D("InVertexOutCaloElectronTracksPhi", "electron out cone at calo and in cone at vertex #phi", phiBin_,phiMin_, phiMax_);
679  //mInVertexOutCaloElectronTracksPtVSEta=ibooker.bookProfile("InVertexOutCaloElectronTracksPtVSEta", "electron out cone at calo and in cone at vertex p_{T} vs #eta", 50, -2.5, 2.5,100,0.,50.);
680  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"nInVertexOutCaloElectronTracks" ,mnInVertexOutCaloElectronTracksPerJet));
681  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloElectronTracksPt" ,mInVertexOutCaloElectronTracksPt));
682  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloElectronTracksEta" ,mInVertexOutCaloElectronTracksEta));
683  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloElectronTracksPhi" ,mInVertexOutCaloElectronTracksPhi));
684  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexOutCaloElectronTracksPtVSEta" ,mInVertexOutCaloElectronTracksPtVSEta));
685 
686  //mInCaloTrackDirectionJetDRHisto_ = ibooker.book1D("InCaloTrackDirectionJetDR", "#Delta R between track direction at vertex and jet axis (track in cone at calo)",50,0.,1.0);
687  //mOutCaloTrackDirectionJetDRHisto_ = ibooker.book1D("OutCaloTrackDirectionJetDR","#Delta R between track direction at vertex and jet axis (track out cone at calo)",50,0.,1.0);
688  //mInVertexTrackImpactPointJetDRHisto_ = ibooker.book1D("InVertexTrackImpactPointJetDR", "#Delta R between track impact point on calo and jet axis (track in cone at vertex)",50,0.,1.0);
689  //mOutVertexTrackImpactPointJetDRHisto_ = ibooker.book1D("OutVertexTrackImpactPointJetDR", "#Delta R between track impact point on calo and jet axis (track out of cone at vertex)",50,0.,1.0);
690  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InCaloTrackDirectionJetDR" ,mInCaloTrackDirectionJetDRHisto_));
691  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutCaloTrackDirectionJetDR" ,mOutCaloTrackDirectionJetDRHisto_));
692  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"InVertexTrackImpactPointJetDR" ,mInVertexTrackImpactPointJetDRHisto_));
693  //map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"OutVertexTrackImpactPointJetDR" ,mOutVertexTrackImpactPointJetDRHisto_));
694  //}
695 
696  if(isPFJet_) {
697  //PFJet specific histograms
698  mCHFracVSeta_lowPt= ibooker.bookProfile("CHFracVSeta_lowPt","CHFracVSeta_lowPt",etaBin_, etaMin_, etaMax_,0.,1.2);
699  mNHFracVSeta_lowPt= ibooker.bookProfile("NHFracVSeta_lowPt","NHFracVSeta_lowPt",etaBin_, etaMin_, etaMax_,0.,1.2);
700  mPhFracVSeta_lowPt= ibooker.bookProfile("PhFracVSeta_lowPt","PhFracVSeta_lowPt",etaBin_, etaMin_, etaMax_,0.,1.2);
701  mElFracVSeta_lowPt= ibooker.bookProfile("ElFracVSeta_lowPt","ElFracVSeta_lowPt",etaBin_, etaMin_, etaMax_,0.,1.2);
702  mMuFracVSeta_lowPt= ibooker.bookProfile("MuFracVSeta_lowPt","MuFracVSeta_lowPt",etaBin_, etaMin_, etaMax_,0.,1.2);
703  mCHFracVSeta_mediumPt= ibooker.bookProfile("CHFracVSeta_mediumPt","CHFracVSeta_mediumPt",etaBin_, etaMin_, etaMax_,0.,1.2);
704  mNHFracVSeta_mediumPt= ibooker.bookProfile("NHFracVSeta_mediumPt","NHFracVSeta_mediumPt",etaBin_, etaMin_, etaMax_,0.,1.2);
705  mPhFracVSeta_mediumPt= ibooker.bookProfile("PhFracVSeta_mediumPt","PhFracVSeta_mediumPt",etaBin_, etaMin_, etaMax_,0.,1.2);
706  mElFracVSeta_mediumPt= ibooker.bookProfile("ElFracVSeta_mediumPt","ElFracVSeta_mediumPt",etaBin_, etaMin_, etaMax_,0.,1.2);
707  mMuFracVSeta_mediumPt= ibooker.bookProfile("MuFracVSeta_mediumPt","MuFracVSeta_mediumPt",etaBin_, etaMin_, etaMax_,0.,1.2);
708  mCHFracVSeta_highPt= ibooker.bookProfile("CHFracVSeta_highPt","CHFracVSeta_highPt",etaBin_, etaMin_, etaMax_,0.,1.2);
709  mNHFracVSeta_highPt= ibooker.bookProfile("NHFracVSeta_highPt","NHFracVSeta_highPt",etaBin_, etaMin_, etaMax_,0.,1.2);
710  mPhFracVSeta_highPt= ibooker.bookProfile("PhFracVSeta_highPt","PhFracVSeta_highPt",etaBin_, etaMin_, etaMax_,0.,1.2);
711  mElFracVSeta_highPt= ibooker.bookProfile("ElFracVSeta_highPt","ElFracVSeta_highPt",etaBin_, etaMin_, etaMax_,0.,1.2);
712  mMuFracVSeta_highPt= ibooker.bookProfile("MuFracVSeta_highPt","MuFracVSeta_highPt",etaBin_, etaMin_, etaMax_,0.,1.2);
713 
714  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSeta_lowPt" ,mCHFracVSeta_lowPt));
715  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSeta_lowPt" ,mNHFracVSeta_lowPt));
716  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSeta_lowPt" ,mPhFracVSeta_lowPt));
717  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFracVSeta_lowPt" ,mElFracVSeta_lowPt));
718  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFracVSeta_lowPt" ,mMuFracVSeta_lowPt));
719  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSeta_mediumPt" ,mCHFracVSeta_mediumPt));
720  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSeta_mediumPt" ,mNHFracVSeta_mediumPt));
721  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSeta_mediumPt" ,mPhFracVSeta_mediumPt));
722  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFracVSeta_mediumPt" ,mElFracVSeta_mediumPt));
723  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFracVSeta_mediumPt" ,mMuFracVSeta_mediumPt));
724  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSeta_highPt" ,mCHFracVSeta_highPt));
725  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSeta_highPt" ,mNHFracVSeta_highPt));
726  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSeta_highPt" ,mPhFracVSeta_highPt));
727  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFracVSeta_highPt" ,mElFracVSeta_highPt));
728  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFracVSeta_highPt" ,mMuFracVSeta_highPt));
729 
730  //barrel histograms for PFJets
731  // energy fractions
732  mCHFrac_lowPt_Barrel = ibooker.book1D("CHFrac_lowPt_Barrel", "CHFrac_lowPt_Barrel", 120, -0.1, 1.1);
733  mNHFrac_lowPt_Barrel = ibooker.book1D("NHFrac_lowPt_Barrel", "NHFrac_lowPt_Barrel", 120, -0.1, 1.1);
734  mPhFrac_lowPt_Barrel = ibooker.book1D("PhFrac_lowPt_Barrel", "PhFrac_lowPt_Barrel", 120, -0.1, 1.1);
735  mElFrac_lowPt_Barrel = ibooker.book1D("ElFrac_lowPt_Barrel", "ElFrac_lowPt_Barrel", 120, -0.1, 1.1);
736  mMuFrac_lowPt_Barrel = ibooker.book1D("MuFrac_lowPt_Barrel", "MuFrac_lowPt_Barrel", 120, -0.1, 1.1);
737  mCHFrac_mediumPt_Barrel = ibooker.book1D("CHFrac_mediumPt_Barrel", "CHFrac_mediumPt_Barrel", 120, -0.1, 1.1);
738  mNHFrac_mediumPt_Barrel = ibooker.book1D("NHFrac_mediumPt_Barrel", "NHFrac_mediumPt_Barrel", 120, -0.1, 1.1);
739  mPhFrac_mediumPt_Barrel = ibooker.book1D("PhFrac_mediumPt_Barrel", "PhFrac_mediumPt_Barrel", 120, -0.1, 1.1);
740  mElFrac_mediumPt_Barrel = ibooker.book1D("ElFrac_mediumPt_Barrel", "ElFrac_mediumPt_Barrel", 120, -0.1, 1.1);
741  mMuFrac_mediumPt_Barrel = ibooker.book1D("MuFrac_mediumPt_Barrel", "MuFrac_mediumPt_Barrel", 120, -0.1, 1.1);
742  mCHFrac_highPt_Barrel = ibooker.book1D("CHFrac_highPt_Barrel", "CHFrac_highPt_Barrel", 120, -0.1, 1.1);
743  mNHFrac_highPt_Barrel = ibooker.book1D("NHFrac_highPt_Barrel", "NHFrac_highPt_Barrel", 120, -0.1, 1.1);
744  mPhFrac_highPt_Barrel = ibooker.book1D("PhFrac_highPt_Barrel", "PhFrac_highPt_Barrel", 120, -0.1, 1.1);
745  mElFrac_highPt_Barrel = ibooker.book1D("ElFrac_highPt_Barrel", "ElFrac_highPt_Barrel", 120, -0.1, 1.1);
746  mMuFrac_highPt_Barrel = ibooker.book1D("MuFrac_highPt_Barrel", "MuFrac_highPt_Barrel", 120, -0.1, 1.1);
747 
748  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_lowPt_Barrel" ,mCHFrac_lowPt_Barrel));
749  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_lowPt_Barrel" ,mNHFrac_lowPt_Barrel));
750  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_lowPt_Barrel" ,mPhFrac_lowPt_Barrel));
751  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFrac_lowPt_Barrel" ,mElFrac_lowPt_Barrel));
752  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFrac_lowPt_Barrel" ,mMuFrac_lowPt_Barrel));
753  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_mediumPt_Barrel" ,mCHFrac_mediumPt_Barrel));
754  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_mediumPt_Barrel" ,mNHFrac_mediumPt_Barrel));
755  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_mediumPt_Barrel" ,mPhFrac_mediumPt_Barrel));
756  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFrac_mediumPt_Barrel" ,mElFrac_mediumPt_Barrel));
757  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFrac_mediumPt_Barrel" ,mMuFrac_mediumPt_Barrel));
758  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_highPt_Barrel" ,mCHFrac_highPt_Barrel));
759  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_highPt_Barrel" ,mNHFrac_highPt_Barrel));
760  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_highPt_Barrel" ,mPhFrac_highPt_Barrel));
761  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFrac_highPt_Barrel" ,mElFrac_highPt_Barrel));
762  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFrac_highPt_Barrel" ,mMuFrac_highPt_Barrel));
763 
764  //energies
765  mCHEn_lowPt_Barrel = ibooker.book1D("CHEn_lowPt_Barrel", "CHEn_lowPt_Barrel", ptBin_, 0., ptMax_);
766  mNHEn_lowPt_Barrel = ibooker.book1D("NHEn_lowPt_Barrel", "NHEn_lowPt_Barrel", ptBin_, 0., ptMax_);
767  mPhEn_lowPt_Barrel = ibooker.book1D("PhEn_lowPt_Barrel", "PhEn_lowPt_Barrel", ptBin_, 0., ptMax_);
768  mElEn_lowPt_Barrel = ibooker.book1D("ElEn_lowPt_Barrel", "ElEn_lowPt_Barrel", ptBin_, 0., ptMax_);
769  mMuEn_lowPt_Barrel = ibooker.book1D("MuEn_lowPt_Barrel", "MuEn_lowPt_Barrel", ptBin_, 0., ptMax_);
770  mCHEn_mediumPt_Barrel = ibooker.book1D("CHEn_mediumPt_Barrel", "CHEn_mediumPt_Barrel", ptBin_, 0., ptMax_);
771  mNHEn_mediumPt_Barrel = ibooker.book1D("NHEn_mediumPt_Barrel", "NHEn_mediumPt_Barrel", ptBin_, 0., ptMax_);
772  mPhEn_mediumPt_Barrel = ibooker.book1D("PhEn_mediumPt_Barrel", "PhEn_mediumPt_Barrel", ptBin_, 0., ptMax_);
773  mElEn_mediumPt_Barrel = ibooker.book1D("ElEn_mediumPt_Barrel", "ElEn_mediumPt_Barrel", ptBin_, 0., ptMax_);
774  mMuEn_mediumPt_Barrel = ibooker.book1D("MuEn_mediumPt_Barrel", "MuEn_mediumPt_Barrel", ptBin_, 0., ptMax_);
775  mCHEn_highPt_Barrel = ibooker.book1D("CHEn_highPt_Barrel", "CHEn_highPt_Barrel", ptBin_, 0., 1.1*ptMax_);
776  mNHEn_highPt_Barrel = ibooker.book1D("NHEn_highPt_Barrel", "NHEn_highPt_Barrel", ptBin_, 0., ptMax_);
777  mPhEn_highPt_Barrel = ibooker.book1D("PhEn_highPt_Barrel", "PhEn_highPt_Barrel", ptBin_, 0., ptMax_);
778  mElEn_highPt_Barrel = ibooker.book1D("ElEn_highPt_Barrel", "ElEn_highPt_Barrel", ptBin_, 0., ptMax_);
779  mMuEn_highPt_Barrel = ibooker.book1D("MuEn_highPt_Barrel", "MuEn_highPt_Barrel", ptBin_, 0., ptMax_);
780 
781  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_lowPt_Barrel" ,mCHEn_lowPt_Barrel));
782  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_lowPt_Barrel" ,mNHEn_lowPt_Barrel));
783  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_lowPt_Barrel" ,mPhEn_lowPt_Barrel));
784  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_lowPt_Barrel" ,mElEn_lowPt_Barrel));
785  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_lowPt_Barrel" ,mMuEn_lowPt_Barrel));
786  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_mediumPt_Barrel" ,mCHEn_mediumPt_Barrel));
787  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_mediumPt_Barrel" ,mNHEn_mediumPt_Barrel));
788  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_mediumPt_Barrel" ,mPhEn_mediumPt_Barrel));
789  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_mediumPt_Barrel" ,mElEn_mediumPt_Barrel));
790  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_mediumPt_Barrel" ,mMuEn_mediumPt_Barrel));
791  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_highPt_Barrel" ,mCHEn_highPt_Barrel));
792  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_highPt_Barrel" ,mNHEn_highPt_Barrel));
793  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_highPt_Barrel" ,mPhEn_highPt_Barrel));
794  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_highPt_Barrel" ,mElEn_highPt_Barrel));
795  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_highPt_Barrel" ,mMuEn_highPt_Barrel));
796 
797  //multiplicities
798  mChMultiplicity_lowPt_Barrel = ibooker.book1D("ChMultiplicity_lowPt_Barrel", "ChMultiplicity_lowPt_Barrel", 60,0,60);
799  mNeutMultiplicity_lowPt_Barrel = ibooker.book1D("NeutMultiplicity_lowPt_Barrel", "NeutMultiplicity_lowPt_Barrel", 60,0,60);
800  mMuMultiplicity_lowPt_Barrel = ibooker.book1D("MuMultiplicity_lowPt_Barrel", "MuMultiplicity_lowPt_Barrel", 10,0,10);
801  mChMultiplicity_mediumPt_Barrel = ibooker.book1D("ChMultiplicity_mediumPt_Barrel", "ChMultiplicity_mediumPt_Barrel", 60,0,60);
802  mNeutMultiplicity_mediumPt_Barrel = ibooker.book1D("NeutMultiplicity_mediumPt_Barrel", "NeutMultiplicity_mediumPt_Barrel", 60,0,60);
803  mMuMultiplicity_mediumPt_Barrel = ibooker.book1D("MuMultiplicity_mediumPt_Barrel", "MuMultiplicity_mediumPt_Barrel", 10,0,10);
804  mChMultiplicity_highPt_Barrel = ibooker.book1D("ChMultiplicity_highPt_Barrel", "ChMultiplicity_highPt_Barrel", 60,0,60);
805  mNeutMultiplicity_highPt_Barrel = ibooker.book1D("NeutMultiplicity_highPt_Barrel", "NeutMultiplicity_highPt_Barrel", 60,0,60);
806  mMuMultiplicity_highPt_Barrel = ibooker.book1D("MuMultiplicity_highPt_Barrel", "MuMultiplicity_highPt_Barrel", 10,0,10);
807 
808  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_lowPt_Barrel" ,mChMultiplicity_lowPt_Barrel));
809  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_lowPt_Barrel" ,mNeutMultiplicity_lowPt_Barrel));
810  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_lowPt_Barrel" ,mMuMultiplicity_lowPt_Barrel));
811  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_mediumPt_Barrel" ,mChMultiplicity_mediumPt_Barrel));
812  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_mediumPt_Barrel" ,mNeutMultiplicity_mediumPt_Barrel));
813  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_mediumPt_Barrel" ,mMuMultiplicity_mediumPt_Barrel));
814  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_highPt_Barrel" ,mChMultiplicity_highPt_Barrel));
815  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_highPt_Barrel" ,mNeutMultiplicity_highPt_Barrel));
816  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_highPt_Barrel" ,mMuMultiplicity_highPt_Barrel));
817 
818  //
819  mCHFracVSpT_Barrel= ibooker.bookProfile("CHFracVSpT_Barrel","CHFracVSpT_Barrel",ptBin_, ptMin_, ptMax_,0.,1.2);
820  mNHFracVSpT_Barrel= ibooker.bookProfile("NHFracVSpT_Barrel","NHFracVSpT_Barrel",ptBin_, ptMin_, ptMax_,0.,1.2);
821  mPhFracVSpT_Barrel= ibooker.bookProfile("PhFracVSpT_Barrel","PhFracVSpT_Barrel",ptBin_, ptMin_, ptMax_,0.,1.2);
822  mElFracVSpT_Barrel= ibooker.bookProfile("ElFracVSpT_Barrel","ElFracVSpT_Barrel",ptBin_, ptMin_, ptMax_,0.,1.2);
823  mMuFracVSpT_Barrel= ibooker.bookProfile("MuFracVSpT_Barrel","MuFracVSpT_Barrel",ptBin_, ptMin_, ptMax_,0.,1.2);
824  mCHFracVSpT_EndCap= ibooker.bookProfile("CHFracVSpT_EndCap","CHFracVSpT_EndCap",ptBin_, ptMin_, ptMax_,0.,1.2);
825  mNHFracVSpT_EndCap= ibooker.bookProfile("NHFracVSpT_EndCap","NHFracVSpT_EndCap",ptBin_, ptMin_, ptMax_,0.,1.2);
826  mPhFracVSpT_EndCap= ibooker.bookProfile("PhFracVSpT_EndCap","PhFracVSpT_EndCap",ptBin_, ptMin_, ptMax_,0.,1.2);
827  mElFracVSpT_EndCap= ibooker.bookProfile("ElFracVSpT_EndCap","ElFracVSpT_EndCap",ptBin_, ptMin_, ptMax_,0.,1.2);
828  mMuFracVSpT_EndCap= ibooker.bookProfile("MuFracVSpT_EndCap","MuFracVSpT_EndCap",ptBin_, ptMin_, ptMax_,0.,1.2);
829  mHFHFracVSpT_Forward= ibooker.bookProfile("HFHFracVSpT_Forward","HFHFracVSpT_Forward",ptBin_, ptMin_, ptMax_,-0.2,1.2);
830  mHFEFracVSpT_Forward= ibooker.bookProfile("HFEFracVSpT_Forward","HFEFracVSpT_Forward",ptBin_, ptMin_, ptMax_,-0.2,1.2);
831 
832  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSpT_Barrel" ,mCHFracVSpT_Barrel));
833  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSpT_Barrel" ,mNHFracVSpT_Barrel));
834  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSpT_Barrel" ,mPhFracVSpT_Barrel));
835  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFracVSpT_Barrel" ,mElFracVSpT_Barrel));
836  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFracVSpT_Barrel" ,mMuFracVSpT_Barrel));
837  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFracVSpT_EndCap" ,mCHFracVSpT_EndCap));
838  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFracVSpT_EndCap" ,mNHFracVSpT_EndCap));
839  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFracVSpT_EndCap" ,mPhFracVSpT_EndCap));
840  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFracVSpT_EndCap" ,mElFracVSpT_EndCap));
841  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFracVSpT_Forward" ,mHFHFracVSpT_Forward));
842  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEFracVSpT_Forward" ,mHFEFracVSpT_Forward));
843 
844  //endcap monitoring
845  //energy fractions
846  mCHFrac_lowPt_EndCap = ibooker.book1D("CHFrac_lowPt_EndCap", "CHFrac_lowPt_EndCap", 120, -0.1, 1.1);
847  mNHFrac_lowPt_EndCap = ibooker.book1D("NHFrac_lowPt_EndCap", "NHFrac_lowPt_EndCap", 120, -0.1, 1.1);
848  mPhFrac_lowPt_EndCap = ibooker.book1D("PhFrac_lowPt_EndCap", "PhFrac_lowPt_EndCap", 120, -0.1, 1.1);
849  mElFrac_lowPt_EndCap = ibooker.book1D("ElFrac_lowPt_EndCap", "ElFrac_lowPt_EndCap", 120, -0.1, 1.1);
850  mMuFrac_lowPt_EndCap = ibooker.book1D("MuFrac_lowPt_EndCap", "MuFrac_lowPt_EndCap", 120, -0.1, 1.1);
851  mCHFrac_mediumPt_EndCap = ibooker.book1D("CHFrac_mediumPt_EndCap", "CHFrac_mediumPt_EndCap", 120, -0.1, 1.1);
852  mNHFrac_mediumPt_EndCap = ibooker.book1D("NHFrac_mediumPt_EndCap", "NHFrac_mediumPt_EndCap", 120, -0.1, 1.1);
853  mPhFrac_mediumPt_EndCap = ibooker.book1D("PhFrac_mediumPt_EndCap", "PhFrac_mediumPt_EndCap", 120, -0.1, 1.1);
854  mElFrac_mediumPt_EndCap = ibooker.book1D("ElFrac_mediumPt_EndCap", "ElFrac_mediumPt_EndCap", 120, -0.1, 1.1);
855  mMuFrac_mediumPt_EndCap = ibooker.book1D("MuFrac_mediumPt_EndCap", "MuFrac_mediumPt_EndCap", 120, -0.1, 1.1);
856  mCHFrac_highPt_EndCap = ibooker.book1D("CHFrac_highPt_EndCap", "CHFrac_highPt_EndCap", 120, -0.1, 1.1);
857  mNHFrac_highPt_EndCap = ibooker.book1D("NHFrac_highPt_EndCap", "NHFrac_highPt_EndCap", 120, -0.1, 1.1);
858  mPhFrac_highPt_EndCap = ibooker.book1D("PhFrac_highPt_EndCap", "PhFrac_highPt_EndCap", 120, -0.1, 1.1);
859  mElFrac_highPt_EndCap = ibooker.book1D("ElFrac_highPt_EndCap", "ElFrac_highPt_EndCap", 120, -0.1, 1.1);
860  mMuFrac_highPt_EndCap = ibooker.book1D("MuFrac_highPt_EndCap", "MuFrac_highPt_EndCap", 120, -0.1, 1.1);
861 
862  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_lowPt_EndCap" ,mCHFrac_lowPt_EndCap));
863  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_lowPt_EndCap" ,mNHFrac_lowPt_EndCap));
864  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_lowPt_EndCap" ,mPhFrac_lowPt_EndCap));
865  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFrac_lowPt_EndCap" ,mElFrac_lowPt_EndCap));
866  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFrac_lowPt_EndCap" ,mMuFrac_lowPt_EndCap));
867  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_mediumPt_EndCap" ,mCHFrac_mediumPt_EndCap));
868  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_mediumPt_EndCap" ,mNHFrac_mediumPt_EndCap));
869  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_mediumPt_EndCap" ,mPhFrac_mediumPt_EndCap));
870  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFrac_mediumPt_EndCap" ,mElFrac_mediumPt_EndCap));
871  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFrac_mediumPt_EndCap" ,mMuFrac_mediumPt_EndCap));
872  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_highPt_EndCap" ,mCHFrac_highPt_EndCap));
873  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_highPt_EndCap" ,mNHFrac_highPt_EndCap));
874  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_highPt_EndCap" ,mPhFrac_highPt_EndCap));
875  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFrac_highPt_EndCap" ,mElFrac_highPt_EndCap));
876  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFrac_highPt_EndCap" ,mMuFrac_highPt_EndCap));
877 
878  //energies
879  mCHEn_lowPt_EndCap = ibooker.book1D("CHEn_lowPt_EndCap", "CHEn_lowPt_EndCap", ptBin_, 0., ptMax_);
880  mNHEn_lowPt_EndCap = ibooker.book1D("NHEn_lowPt_EndCap", "NHEn_lowPt_EndCap", ptBin_, 0., ptMax_);
881  mPhEn_lowPt_EndCap = ibooker.book1D("PhEn_lowPt_EndCap", "PhEn_lowPt_EndCap", ptBin_, 0., ptMax_);
882  mElEn_lowPt_EndCap = ibooker.book1D("ElEn_lowPt_EndCap", "ElEn_lowPt_EndCap", ptBin_, 0., ptMax_);
883  mMuEn_lowPt_EndCap = ibooker.book1D("MuEn_lowPt_EndCap", "MuEn_lowPt_EndCap", ptBin_, 0., ptMax_);
884  mCHEn_mediumPt_EndCap = ibooker.book1D("CHEn_mediumPt_EndCap", "CHEn_mediumPt_EndCap", ptBin_, 0., ptMax_);
885  mNHEn_mediumPt_EndCap = ibooker.book1D("NHEn_mediumPt_EndCap", "NHEn_mediumPt_EndCap", ptBin_, 0., ptMax_);
886  mPhEn_mediumPt_EndCap = ibooker.book1D("PhEn_mediumPt_EndCap", "PhEn_mediumPt_EndCap", ptBin_, 0., ptMax_);
887  mElEn_mediumPt_EndCap = ibooker.book1D("ElEn_mediumPt_EndCap", "ElEn_mediumPt_EndCap", ptBin_, 0., ptMax_);
888  mMuEn_mediumPt_EndCap = ibooker.book1D("MuEn_mediumPt_EndCap", "MuEn_mediumPt_EndCap", ptBin_, 0., ptMax_);
889  mCHEn_highPt_EndCap = ibooker.book1D("CHEn_highPt_EndCap", "CHEn_highPt_EndCap", ptBin_, 0., 1.5*ptMax_);
890  mNHEn_highPt_EndCap = ibooker.book1D("NHEn_highPt_EndCap", "NHEn_highPt_EndCap", ptBin_, 0., 1.5*ptMax_);
891  mPhEn_highPt_EndCap = ibooker.book1D("PhEn_highPt_EndCap", "PhEn_highPt_EndCap", ptBin_, 0., 1.5*ptMax_);
892  mElEn_highPt_EndCap = ibooker.book1D("ElEn_highPt_EndCap", "ElEn_highPt_EndCap", ptBin_, 0., ptMax_);
893  mMuEn_highPt_EndCap = ibooker.book1D("MuEn_highPt_EndCap", "MuEn_highPt_EndCap", ptBin_, 0., ptMax_);
894 
895  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_lowPt_EndCap" ,mCHEn_lowPt_EndCap));
896  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_lowPt_EndCap" ,mNHEn_lowPt_EndCap));
897  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_lowPt_EndCap" ,mPhEn_lowPt_EndCap));
898  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_lowPt_EndCap" ,mElEn_lowPt_EndCap));
899  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_lowPt_EndCap" ,mMuEn_lowPt_EndCap));
900  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_mediumPt_EndCap" ,mCHEn_mediumPt_EndCap));
901  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_mediumPt_EndCap" ,mNHEn_mediumPt_EndCap));
902  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_mediumPt_EndCap" ,mPhEn_mediumPt_EndCap));
903  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_mediumPt_EndCap" ,mElEn_mediumPt_EndCap));
904  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_mediumPt_EndCap" ,mMuEn_mediumPt_EndCap));
905  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHEn_highPt_EndCap" ,mCHEn_highPt_EndCap));
906  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHEn_highPt_EndCap" ,mNHEn_highPt_EndCap));
907  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhEn_highPt_EndCap" ,mPhEn_highPt_EndCap));
908  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElEn_highPt_EndCap" ,mElEn_highPt_EndCap));
909  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuEn_highPt_EndCap" ,mMuEn_highPt_EndCap));
910 
911  //multiplicities
912  mChMultiplicity_lowPt_EndCap = ibooker.book1D("ChMultiplicity_lowPt_EndCap", "ChMultiplicity_lowPt_EndCap", 60,0,60);
913  mNeutMultiplicity_lowPt_EndCap = ibooker.book1D("NeutMultiplicity_lowPt_EndCap", "NeutMultiplicity_lowPt_EndCap", 60,0,60);
914  mMuMultiplicity_lowPt_EndCap = ibooker.book1D("MuMultiplicity_lowPt_EndCap", "MuMultiplicity_lowPt_EndCap", 10,0,10);
915  mChMultiplicity_mediumPt_EndCap = ibooker.book1D("ChMultiplicity_mediumPt_EndCap", "ChMultiplicity_mediumPt_EndCap", 60,0,60);
916  mNeutMultiplicity_mediumPt_EndCap = ibooker.book1D("NeutMultiplicity_mediumPt_EndCap", "NeutMultiplicity_mediumPt_EndCap", 60,0,60);
917  mMuMultiplicity_mediumPt_EndCap = ibooker.book1D("MuMultiplicity_mediumPt_EndCap", "MuMultiplicity_mediumPt_EndCap", 10,0,10);
918  mChMultiplicity_highPt_EndCap = ibooker.book1D("ChMultiplicity_highPt_EndCap", "ChMultiplicity_highPt_EndCap", 60,0,60);
919  mNeutMultiplicity_highPt_EndCap = ibooker.book1D("NeutMultiplicity_highPt_EndCap", "NeutMultiplicity_highPt_EndCap", 60,0,60);
920  mMuMultiplicity_highPt_EndCap = ibooker.book1D("MuMultiplicity_highPt_EndCap", "MuMultiplicity_highPt_EndCap", 10,0,10);
921 
922  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_lowPt_EndCap" ,mChMultiplicity_lowPt_EndCap));
923  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_lowPt_EndCap" ,mNeutMultiplicity_lowPt_EndCap));
924  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_lowPt_EndCap" ,mMuMultiplicity_lowPt_EndCap));
925  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_mediumPt_EndCap" ,mChMultiplicity_mediumPt_EndCap));
926  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_mediumPt_EndCap" ,mNeutMultiplicity_mediumPt_EndCap));
927  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_mediumPt_EndCap" ,mMuMultiplicity_mediumPt_EndCap));
928  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_highPt_EndCap" ,mChMultiplicity_highPt_EndCap));
929  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_highPt_EndCap" ,mNeutMultiplicity_highPt_EndCap));
930  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuMultiplicity_highPt_EndCap" ,mMuMultiplicity_highPt_EndCap));
931 
932  //forward monitoring
933  //energy fraction
934  mHFEFrac_lowPt_Forward = ibooker.book1D("HFEFrac_lowPt_Forward", "HFEFrac_lowPt_Forward", 140, -0.2, 1.2);
935  mHFHFrac_lowPt_Forward = ibooker.book1D("HFHFrac_lowPt_Forward", "HFHFrac_lowPt_Forward", 140, -0.2, 1.2);
936  mHFEFrac_mediumPt_Forward = ibooker.book1D("HFEFrac_mediumPt_Forward", "HFEFrac_mediumPt_Forward", 140, -0.2, 1.2);
937  mHFHFrac_mediumPt_Forward = ibooker.book1D("HFHFrac_mediumPt_Forward", "HFHFrac_mediumPt_Forward", 140, -0.2, 1.2);
938  mHFEFrac_highPt_Forward = ibooker.book1D("HFEFrac_highPt_Forward", "HFEFrac_highPt_Forward", 140, -0.2, 1.2);
939  mHFHFrac_highPt_Forward = ibooker.book1D("HFHFrac_highPt_Forward", "HFHFrac_highPt_Forward", 140, -0.2, 1.2);
940  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac_lowPt_Forward" ,mHFHFrac_lowPt_Forward));
941  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEFrac_lowPt_Forward" ,mHFEFrac_lowPt_Forward));
942  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac_mediumPt_Forward" ,mHFHFrac_mediumPt_Forward));
943  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEFrac_mediumPt_Forward" ,mHFEFrac_mediumPt_Forward));
944  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac_highPt_Forward" ,mHFHFrac_highPt_Forward));
945  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEFrac_highPt_Forward" ,mHFEFrac_highPt_Forward));
946 
947  //energies
948  mHFEEn_lowPt_Forward = ibooker.book1D("HFEEn_lowPt_Forward", "HFEEn_lowPt_Forward", ptBin_, 0., ptMax_);
949  mHFHEn_lowPt_Forward = ibooker.book1D("HFHEn_lowPt_Forward", "HFHEn_lowPt_Forward", ptBin_, 0., 2.0*ptMax_);
950  mHFEEn_mediumPt_Forward = ibooker.book1D("HFEEn_mediumPt_Forward", "HFEEn_mediumPt_Forward", ptBin_, 0., 1.5*ptMax_);
951  mHFHEn_mediumPt_Forward = ibooker.book1D("HFHEn_mediumPt_Forward", "HFHEn_mediumPt_Forward", ptBin_, 0., 2.5*ptMax_);
952  mHFEEn_highPt_Forward = ibooker.book1D("HFEEn_highPt_Forward", "HFEEn_highPt_Forward", ptBin_, 0., 1.5*ptMax_);
953  mHFHEn_highPt_Forward = ibooker.book1D("HFHEn_highPt_Forward", "HFHEn_highPt_Forward", ptBin_, 0., 5.0*ptMax_);
954  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHEn_lowPt_Forward" ,mHFHEn_lowPt_Forward));
955  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEEn_lowPt_Forward" ,mHFEEn_lowPt_Forward));
956  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHEn_mediumPt_Forward" ,mHFHEn_mediumPt_Forward));
957  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEEn_mediumPt_Forward" ,mHFEEn_mediumPt_Forward));
958  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHEn_highPt_Forward" ,mHFHEn_highPt_Forward));
959  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEEn_highPt_Forward" ,mHFEEn_highPt_Forward));
960  //multiplicities
961  mChMultiplicity_lowPt_Forward = ibooker.book1D("ChMultiplicity_lowPt_Forward", "ChMultiplicity_lowPt_Forward", 60,0,60);
962  mNeutMultiplicity_lowPt_Forward = ibooker.book1D("NeutMultiplicity_lowPt_Forward", "NeutMultiplicity_lowPt_Forward", 60,0,60);
963  mChMultiplicity_mediumPt_Forward = ibooker.book1D("ChMultiplicity_mediumPt_Forward", "ChMultiplicity_mediumPt_Forward", 60,0,60);
964  mNeutMultiplicity_mediumPt_Forward = ibooker.book1D("NeutMultiplicity_mediumPt_Forward", "NeutMultiplicity_mediumPt_Forward", 60,0,60);
965  mChMultiplicity_highPt_Forward = ibooker.book1D("ChMultiplicity_highPt_Forward", "ChMultiplicity_highPt_Forward", 60,0,60);
966  mNeutMultiplicity_highPt_Forward = ibooker.book1D("NeutMultiplicity_highPt_Forward", "NeutMultiplicity_highPt_Forward", 60,0,60);
967 
968  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_lowPt_Forward" ,mChMultiplicity_lowPt_Forward));
969  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_lowPt_Forward" ,mNeutMultiplicity_lowPt_Forward));
970  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_mediumPt_Forward" ,mChMultiplicity_mediumPt_Forward));
971  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_mediumPt_Forward" ,mNeutMultiplicity_mediumPt_Forward));
972  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChMultiplicity_highPt_Forward" ,mChMultiplicity_highPt_Forward));
973  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutMultiplicity_highPt_Forward" ,mNeutMultiplicity_highPt_Forward));
974 
975  mChargedHadronEnergy = ibooker.book1D("ChargedHadronEnergy", "charged HAD energy", 100, 0, 100);
976  mNeutralHadronEnergy = ibooker.book1D("NeutralHadronEnergy", "neutral HAD energy", 100, 0, 100);
977  mChargedEmEnergy = ibooker.book1D("ChargedEmEnergy", "charged EM energy ", 100, 0, 100);
978  mChargedMuEnergy = ibooker.book1D("ChargedMuEnergy", "charged Mu energy", 100, 0, 100);
979  mNeutralEmEnergy = ibooker.book1D("NeutralEmEnergy", "neutral EM energy", 100, 0, 100);
980  mChargedMultiplicity = ibooker.book1D("ChargedMultiplicity", "charged multiplicity ", 100, 0, 100);
981  mNeutralMultiplicity = ibooker.book1D("NeutralMultiplicity", "neutral multiplicity", 100, 0, 100);
982  mMuonMultiplicity = ibooker.book1D("MuonMultiplicity", "muon multiplicity", 100, 0, 100);
983  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedHadronEnergy" ,mChargedHadronEnergy));
984  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralHadronEnergy" ,mNeutralHadronEnergy));
985  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedEmEnergy" ,mChargedEmEnergy));
986  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMuEnergy" ,mChargedMuEnergy));
987  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralEmEnergy" ,mNeutralEmEnergy));
988  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMultiplicity" ,mChargedMultiplicity));
989  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralMultiplicity" ,mNeutralMultiplicity));
990  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuonMultiplicity" ,mMuonMultiplicity));
991 
992  // Book NPV profiles
993  //----------------------------------------------------------------------------
994  mChargedHadronEnergy_profile = ibooker.bookProfile("ChargedHadronEnergy_profile", "charged HAD energy", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
995  mNeutralHadronEnergy_profile = ibooker.bookProfile("NeutralHadronEnergy_profile", "neutral HAD energy", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
996  mChargedEmEnergy_profile = ibooker.bookProfile("ChargedEmEnergy_profile", "charged EM energy", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
997  mChargedMuEnergy_profile = ibooker.bookProfile("ChargedMuEnergy_profile", "charged Mu energy", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
998  mNeutralEmEnergy_profile = ibooker.bookProfile("NeutralEmEnergy_profile", "neutral EM energy", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
999  mChargedMultiplicity_profile = ibooker.bookProfile("ChargedMultiplicity_profile", "charged multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
1000  mNeutralMultiplicity_profile = ibooker.bookProfile("NeutralMultiplicity_profile", "neutral multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
1001  mMuonMultiplicity_profile = ibooker.bookProfile("MuonMultiplicity_profile", "muon multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
1002 
1003  // Set NPV profiles x-axis title
1004  //----------------------------------------------------------------------------
1005  mChargedHadronEnergy_profile->setAxisTitle("nvtx",1);
1006  mNeutralHadronEnergy_profile->setAxisTitle("nvtx",1);
1007  mChargedEmEnergy_profile ->setAxisTitle("nvtx",1);
1008  mChargedMuEnergy_profile ->setAxisTitle("nvtx",1);
1009  mNeutralEmEnergy_profile ->setAxisTitle("nvtx",1);
1010  mChargedMultiplicity_profile->setAxisTitle("nvtx",1);
1011  mNeutralMultiplicity_profile->setAxisTitle("nvtx",1);
1012  mMuonMultiplicity_profile ->setAxisTitle("nvtx",1);
1013 
1014  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedHadronEnergy_profile" ,mChargedHadronEnergy_profile));
1015  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralHadronEnergy_profile" ,mNeutralHadronEnergy_profile));
1016  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedEmEnergy_profile" ,mChargedEmEnergy_profile));
1017  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMuEnergy_profile" ,mChargedMuEnergy_profile));
1018  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralEmEnergy_profile" ,mNeutralEmEnergy_profile));
1019  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMultiplicity_profile" ,mChargedMultiplicity_profile));
1020  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralMultiplicity_profile" ,mNeutralMultiplicity_profile));
1021  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuonMultiplicity_profile" ,mMuonMultiplicity_profile));
1022 
1023  mNeutralFraction = ibooker.book1D("NeutralConstituentsFraction","Neutral Constituents Fraction",100,0,1);
1024  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralConstituentsFraction" ,mNeutralFraction));
1025 
1026  }
1027 
1028  if(jetCleaningFlag_){
1029  //so far we have only one additional selection -> implement to make it expandable
1030  folderNames_.push_back("DiJet");
1031  //book for each of these selection default histograms
1032  for (std::vector<std::string>::const_iterator ic = folderNames_.begin();
1033  ic != folderNames_.end(); ic++){
1034  bookMESetSelection(DirName+"/"+*ic, ibooker);
1035  }
1036  }
1037 
1038  ibooker.setCurrentFolder("JetMET");
1039  cleanupME = ibooker.book1D("cleanup", "cleanup", 10, 0., 10.);
1040  cleanupME->setBinLabel(1,"Primary Vertex");
1041  cleanupME->setBinLabel(2,"DCS::Pixel");
1042  cleanupME->setBinLabel(3,"DCS::SiStrip");
1043  cleanupME->setBinLabel(4,"DCS::ECAL");
1044  cleanupME->setBinLabel(5,"DCS::ES");
1045  cleanupME->setBinLabel(6,"DCS::HBHE");
1046  cleanupME->setBinLabel(7,"DCS::HF");
1047  cleanupME->setBinLabel(8,"DCS::HO");
1048  cleanupME->setBinLabel(9,"DCS::Muon");
1049  map_of_MEs.insert(std::pair<std::string,MonitorElement*>("JetMET/cleanup" ,cleanupME));
1050 
1051  verticesME = ibooker.book1D("vertices", "vertices", 100, 0, 100);
1052  map_of_MEs.insert(std::pair<std::string,MonitorElement*>("JetMET/vertices" ,verticesME));
1053 
1054 
1055 
1056 }
1057 
1059 {
1060  ibooker.setCurrentFolder(DirName);
1061  // Generic jet parameters
1062  mPt = ibooker.book1D("Pt", "pt", ptBin_, ptMin_, ptMax_);
1063  mEta = ibooker.book1D("Eta", "eta", etaBin_, etaMin_, etaMax_);
1064  mPhi = ibooker.book1D("Phi", "phi", phiBin_, phiMin_, phiMax_);
1065  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt" ,mPt));
1066  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta" ,mEta));
1067  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi" ,mPhi));
1068  //if(!isJPTJet_){
1069  mConstituents = ibooker.book1D("Constituents", "# of constituents", 50, 0, 100);
1070  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents" ,mConstituents));
1071  //}
1072  mJetEnergyCorr= ibooker.book1D("JetEnergyCorr", "jet energy correction factor", 50, 0.0,3.0);
1073  mJetEnergyCorrVSEta= ibooker.bookProfile("JetEnergyCorrVSEta", "jet energy correction factor VS eta", etaBin_, etaMin_,etaMax_, 0.0,3.0);
1074  mJetEnergyCorrVSPt= ibooker.bookProfile("JetEnergyCorrVSPt", "jet energy correction factor VS pt", ptBin_, ptMin_,ptMax_, 0.0,3.0);
1075  mHFrac = ibooker.book1D("HFrac", "HFrac", 140, -0.2, 1.2);
1076  mEFrac = ibooker.book1D("EFrac", "EFrac", 140, -0.2, 1.2);
1077  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorr" ,mJetEnergyCorr));
1078  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorrVSEta" ,mJetEnergyCorrVSEta));
1079  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"JetEnergyCorrVSPt" ,mJetEnergyCorrVSPt));
1080  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac" ,mHFrac));
1081  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac" ,mEFrac));
1082 
1083  mDPhi = ibooker.book1D("DPhi", "dPhi btw the two leading jets", 100, 0., acos(-1.));
1084  mDijetAsymmetry = ibooker.book1D("DijetAsymmetry", "DijetAsymmetry", 100, -1., 1.);
1085  mDijetBalance = ibooker.book1D("DijetBalance", "DijetBalance", 100, -2., 2.);
1086  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DPhi" ,mDPhi));
1087  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DijetAsymmetry" ,mDijetAsymmetry));
1088  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"DijetBalance" ,mDijetBalance));
1089 
1090  // Book NPV profiles
1091  //----------------------------------------------------------------------------
1092  mPt_profile = ibooker.bookProfile("Pt_profile", "pt", nbinsPV_, nPVlow_, nPVhigh_, ptBin_, ptMin_, ptMax_);
1093  mEta_profile = ibooker.bookProfile("Eta_profile", "eta", nbinsPV_, nPVlow_, nPVhigh_, etaBin_, etaMin_, etaMax_);
1094  mPhi_profile = ibooker.bookProfile("Phi_profile", "phi", nbinsPV_, nPVlow_, nPVhigh_, phiBin_, phiMin_, phiMax_);
1095  //if(!isJPTJet_){
1096  mConstituents_profile = ibooker.bookProfile("Constituents_profile", "# of constituents", nbinsPV_, nPVlow_, nPVhigh_, 50, 0, 100);
1097  //}
1098  mHFrac_profile = ibooker.bookProfile("HFrac_profile", "HFrac", nbinsPV_, nPVlow_, nPVhigh_, 140, -0.2, 1.2);
1099  mEFrac_profile = ibooker.bookProfile("EFrac_profile", "EFrac", nbinsPV_, nPVlow_, nPVhigh_, 140, -0.2, 1.2);
1100  // met NPV profiles x-axis title
1101  //----------------------------------------------------------------------------
1102  mPt_profile ->setAxisTitle("nvtx",1);
1103  mEta_profile ->setAxisTitle("nvtx",1);
1104  mPhi_profile ->setAxisTitle("nvtx",1);
1105  //if(!isJPTJet_){
1106  mConstituents_profile->setAxisTitle("nvtx",1);
1107  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Constituents_profile",mConstituents_profile));
1108  //}
1109  mHFrac_profile ->setAxisTitle("nvtx",1);
1110  mEFrac_profile ->setAxisTitle("nvtx",1);
1111 
1112  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Pt_profile" ,mPt_profile));
1113  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Eta_profile",mEta_profile));
1114  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"Phi_profile",mPhi_profile));
1115  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFrac_profile",mHFrac_profile));
1116  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"EFrac_profile",mEFrac_profile));
1117 
1118  //
1119  //--- Calo jet melection only
1120  if(isCaloJet_) {
1121  // CaloJet mpecific
1122  mMaxEInEmTowers = ibooker.book1D("MaxEInEmTowers", "MaxEInEmTowers", 150, 0, 150);
1123  mMaxEInHadTowers = ibooker.book1D("MaxEInHadTowers", "MaxEInHadTowers", 150, 0, 150);
1124  //JetID variables
1125  mresEMF = ibooker.book1D("resEMF", "resEMF", 50, 0., 1.);
1126  mN90Hits = ibooker.book1D("N90Hits", "N90Hits", 100, 0., 100);
1127  mfHPD = ibooker.book1D("fHPD", "fHPD", 50, 0., 1.);
1128  mfRBX = ibooker.book1D("fRBX", "fRBX", 50, 0., 1.);
1129 
1130  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MaxEInEmTowers" ,mMaxEInEmTowers));
1131  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MaxEInHadTowers" ,mMaxEInHadTowers));
1132  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"resEMF" ,mresEMF));
1133  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"N90Hits",mN90Hits));
1134  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fHPD" ,mfHPD));
1135  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"fRBX" ,mfRBX));
1136 
1137  }
1138 
1139  if(isPFJet_){
1140  //barrel histograms for PFJets
1141  // energy fractions
1142  mCHFrac = ibooker.book1D("CHFrac", "CHFrac", 120, -0.1, 1.1);
1143  mNHFrac = ibooker.book1D("NHFrac", "NHFrac", 120, -0.1, 1.1);
1144  mPhFrac = ibooker.book1D("PhFrac", "PhFrac", 120, -0.1, 1.1);
1145  mElFrac = ibooker.book1D("ElFrac", "ElFrac", 120, -0.1, 1.1);
1146  mMuFrac = ibooker.book1D("MuFrac", "MuFrac", 120, -0.1, 1.1);
1147  mHFEMFrac = ibooker.book1D("HFEMFrac","HFEMFrac", 120, -0.1, 1.1);
1148  mHFHFrac = ibooker.book1D("HFHFrac", "HFHFrac", 120, -0.1, 1.1);
1149 
1150  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac" ,mCHFrac));
1151  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac" ,mNHFrac));
1152  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac" ,mPhFrac));
1153  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFrac" ,mElFrac));
1154  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFrac" ,mMuFrac));
1155  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFrac",mHFEMFrac));
1156  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac" ,mHFHFrac));
1157 
1158  mChargedMultiplicity = ibooker.book1D("ChargedMultiplicity", "charged multiplicity ", 100, 0, 100);
1159  mNeutralMultiplicity = ibooker.book1D("NeutralMultiplicity", "neutral multiplicity", 100, 0, 100);
1160  mMuonMultiplicity = ibooker.book1D("MuonMultiplicity", "muon multiplicity", 100, 0, 100);
1161 
1162  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMultiplicity" ,mChargedMultiplicity));
1163  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralMultiplicity" ,mNeutralMultiplicity));
1164  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuonMultiplicity" ,mMuonMultiplicity));
1165 
1166  // Book NPV profiles
1167  //----------------------------------------------------------------------------
1168  mCHFrac_profile = ibooker.bookProfile("CHFrac_profile", "charged HAD fraction profile", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 1);
1169  mNHFrac_profile = ibooker.bookProfile("NHFrac_profile", "neutral HAD fraction profile", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 1);
1170  mElFrac_profile = ibooker.bookProfile("ElFrac_profile", "Electron Fraction Profile", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 1);
1171  mMuFrac_profile = ibooker.bookProfile("MuFrac_profile", "Muon Fraction Profile", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 1);
1172  mPhFrac_profile = ibooker.bookProfile("PhFrac_profile", "Photon Fraction Profile", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 1);
1173  mHFEMFrac_profile = ibooker.bookProfile("HFEMFrac_profile","HF electomagnetic fraction Profile", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 1);
1174  mHFHFrac_profile = ibooker.bookProfile("HFHFrac_profile", "HF hadronic fraction profile", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 1);
1175  mChargedMultiplicity_profile = ibooker.bookProfile("ChargedMultiplicity_profile", "charged multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
1176  mNeutralMultiplicity_profile = ibooker.bookProfile("NeutralMultiplicity_profile", "neutral multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
1177  mMuonMultiplicity_profile = ibooker.bookProfile("MuonMultiplicity_profile", "muon multiplicity", nbinsPV_, nPVlow_, nPVhigh_, 100, 0, 100);
1178 
1179  // met NPV profiles x-axis title
1180  //----------------------------------------------------------------------------
1181  mCHFrac_profile ->setAxisTitle("nvtx",1);
1182  mNHFrac_profile ->setAxisTitle("nvtx",1);
1183  mElFrac_profile ->setAxisTitle("nvtx",1);
1184  mMuFrac_profile ->setAxisTitle("nvtx",1);
1185  mPhFrac_profile ->setAxisTitle("nvtx",1);
1186  mHFEMFrac_profile ->setAxisTitle("nvtx",1);
1187  mHFHFrac_profile ->setAxisTitle("nvtx",1);
1188  mChargedMultiplicity_profile->setAxisTitle("nvtx",1);
1189  mNeutralMultiplicity_profile->setAxisTitle("nvtx",1);
1190  mMuonMultiplicity_profile ->setAxisTitle("nvtx",1);
1191 
1192  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"CHFrac_profile" ,mCHFrac_profile));
1193  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NHFrac_profile" ,mNHFrac_profile));
1194  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"PhFrac_profile" ,mPhFrac_profile));
1195  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ElFrac_profile" ,mElFrac_profile));
1196  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuFrac_profile" ,mMuFrac_profile));
1197  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFEMFrac_profile",mHFEMFrac_profile));
1198  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"HFHFrac_profile" ,mHFHFrac_profile));
1199  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"ChargedMultiplicity_profile" ,mChargedMultiplicity_profile));
1200  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralMultiplicity_profile" ,mNeutralMultiplicity_profile));
1201  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"MuonMultiplicity_profile" ,mMuonMultiplicity_profile));
1202 
1203  mNeutralFraction = ibooker.book1D("NeutralConstituentsFraction","Neutral Constituents Fraction",100,0,1);
1204  map_of_MEs.insert(std::pair<std::string,MonitorElement*>(DirName+"/"+"NeutralConstituentsFraction" ,mNeutralFraction));
1205  }
1206 
1207 }
1208 
1209 // ***********************************************************
1210 void JetAnalyzer::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup)
1211 {
1212  //LogDebug("JetAnalyzer") << "beginRun, run " << run.id();
1213  //
1214 
1215  if ( highPtJetEventFlag_->on() ) highPtJetEventFlag_->initRun( iRun, iSetup );
1216  if ( lowPtJetEventFlag_ ->on() ) lowPtJetEventFlag_ ->initRun( iRun, iSetup );
1217 
1218  if (highPtJetEventFlag_->on() && highPtJetEventFlag_->expressionsFromDB(highPtJetEventFlag_->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
1219  highPtJetExpr_ = highPtJetEventFlag_->expressionsFromDB(highPtJetEventFlag_->hltDBKey(), iSetup);
1220  if (lowPtJetEventFlag_->on() && lowPtJetEventFlag_->expressionsFromDB(lowPtJetEventFlag_->hltDBKey(), iSetup)[0] != "CONFIG_ERROR")
1221  lowPtJetExpr_ = lowPtJetEventFlag_->expressionsFromDB(lowPtJetEventFlag_->hltDBKey(), iSetup);
1222 // if (!jetCorrectionService_.empty()){
1223 // energycorrected=true;
1224 // }
1225  //--- htlConfig_
1226  //processname_="HLT";
1227  bool changed(true);
1228  hltInitialized_ = hltConfig_.init(iRun,iSetup,processname_,changed);
1229  if (!hltInitialized_) {
1230  //if (!hltConfig_.init(iRun,iSetup,processname_,changed)) {
1231  processname_ = "FU";
1232  hltInitialized_ = hltConfig_.init(iRun,iSetup,processname_,changed);
1233  if(!hltInitialized_){
1234  //if (!hltConfig_.init(iRun,iSetup,processname_,changed)){
1235  LogDebug("JetAnalyzer") << "HLTConfigProvider failed to initialize.";
1236  }
1237  }
1238 
1239 }
1240 
1241 // ***********************************************************
1242 void JetAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup& iSetup)
1243 {
1244 }
1245 
1246 // ***********************************************************
1248 
1249 
1250  //set general folders first --> change later on for different folders
1251  if(jetCleaningFlag_){
1252  //dbe_->setCurrentFolder("JetMET/Jet/Cleaned"+mInputCollection_.label());
1253  DirName = "JetMET/Jet/Cleaned"+mInputCollection_.label();
1254  }else{
1255  //dbe_->setCurrentFolder("JetMET/Jet/Uncleaned"+mInputCollection_.label());
1256  DirName = "JetMET/Jet/Uncleaned"+mInputCollection_.label();
1257  }
1258 
1259 
1260  // **** Get the TriggerResults container
1262  iEvent.getByToken(triggerResultsToken_, triggerResults);
1263 
1264  Int_t JetLoPass = 0;
1265  Int_t JetHiPass = 0;
1266 
1267  if (triggerResults.isValid()){
1268  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
1269 
1270  const unsigned int nTrig(triggerNames.size());
1271  for (unsigned int i=0;i<nTrig;++i)
1272  {
1273  if (triggerNames.triggerName(i).find(highPtJetExpr_[0].substr(0,highPtJetExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults->accept(i))
1274  JetHiPass=1;
1275  else if (triggerNames.triggerName(i).find(lowPtJetExpr_[0].substr(0,lowPtJetExpr_[0].rfind("_v")+2))!=std::string::npos && triggerResults->accept(i))
1276  JetLoPass=1;
1277  }
1278 
1279  }
1280 
1281  if (verbose_) std::cout << "trigger label " << theTriggerResultsLabel_ << std::endl;
1282 
1283 
1284  if (verbose_) {
1285  std::cout << ">>> Trigger Lo = " << JetLoPass
1286  << " Hi = " << JetHiPass
1287  << std::endl;
1288  }
1289 
1290  // ==========================================================
1291  //Vertex information
1292  Handle<VertexCollection> vertexHandle;
1293  iEvent.getByToken(vertexToken_, vertexHandle);
1294 
1295  if (!vertexHandle.isValid()) {
1296  LogDebug("") << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
1297  if (verbose_) std::cout << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
1298  }
1299  int numPV = 0;
1300  if ( vertexHandle.isValid() ){
1301  VertexCollection vertexCollection = *(vertexHandle.product());
1302  numPV = vertexCollection.size();
1303  }
1304  bool bPrimaryVertex = (bypassAllPVChecks_ || (numPV>0));
1305  if(fill_jet_high_level_histo){//should be filled for all events, no selection up to this point
1306  verticesME = map_of_MEs["JetMET/vertices"]; if(verticesME && verticesME->getRootObject())verticesME->Fill(numPV);
1307  }
1308  // ==========================================================
1309 
1311  iEvent.getByToken(gtToken_, gtReadoutRecord);
1312 
1313 
1314  if (!gtReadoutRecord.isValid()) {
1315  LogInfo("JetAnalyzer") << "JetAnalyzer: Could not find GT readout record" << std::endl;
1316  if (verbose_) std::cout << "JetAnalyzer: Could not find GT readout record product" << std::endl;
1317  }
1318  DCSFilterForDCSMonitoring_->filter(iEvent, iSetup);
1319  if(fill_jet_high_level_histo){//should be filled only once
1320  cleanupME = map_of_MEs["JetMET/cleanup"]; if(cleanupME && cleanupME->getRootObject()){
1321  if (bPrimaryVertex) cleanupME->Fill(0.5);
1322  if ( DCSFilterForDCSMonitoring_->passPIX ) cleanupME->Fill(1.5);
1323  if ( DCSFilterForDCSMonitoring_->passSiStrip ) cleanupME->Fill(2.5);
1324  if ( DCSFilterForDCSMonitoring_->passECAL ) cleanupME->Fill(3.5);
1325  if ( DCSFilterForDCSMonitoring_->passES ) cleanupME->Fill(4.5);
1326  if ( DCSFilterForDCSMonitoring_->passHBHE ) cleanupME->Fill(5.5);
1327  if ( DCSFilterForDCSMonitoring_->passHF ) cleanupME->Fill(6.5);
1328  if ( DCSFilterForDCSMonitoring_->passHO ) cleanupME->Fill(7.5);
1329  if ( DCSFilterForDCSMonitoring_->passMuon ) cleanupME->Fill(8.5);
1330  }
1331  }
1335 
1336  if (isCaloJet_) iEvent.getByToken(caloJetsToken_, caloJets);
1337  //if (isJPTJet_) iEvent.getByToken(jptJetsToken_, jptJets);
1338  if (isPFJet_) iEvent.getByToken(pfJetsToken_, pfJets);
1339 
1340  edm::Handle< edm::ValueMap<reco::JetID> >jetID_ValueMap_Handle;
1341  if(/*isJPTJet_ || */isCaloJet_){
1342  if(!runcosmics_){
1343  iEvent.getByToken(jetID_ValueMapToken_,jetID_ValueMap_Handle);
1344  }
1345  }
1346 
1347  //check for collections AND DCS filters
1348  bool dcsDecision = DCSFilterForJetMonitoring_->filter(iEvent, iSetup);
1349  bool jetCollectionIsValid = false;
1350  if (isCaloJet_) jetCollectionIsValid = caloJets.isValid();
1351  //if (isJPTJet_) jetCollectionIsValid = jptJets.isValid();
1352  if (isPFJet_) jetCollectionIsValid = pfJets.isValid();
1353 
1354 
1355  if (jetCleaningFlag_ && (!jetCollectionIsValid || !bPrimaryVertex || !dcsDecision)) return;
1356 
1357  unsigned int collSize=-1;
1358  if (isCaloJet_) collSize = caloJets->size();
1359  //if (isJPTJet_) {
1360  //collSize=jptJets->size();
1361  //if(collSize>0){
1362  // //update the track propagator and strip noise calculator
1363  // trackPropagator_->update(iSetup);
1364  // //sOverNCalculator_->update(iSetup);
1365  //}
1366  //}
1367  if (isPFJet_) collSize=pfJets->size();
1368 
1369  double scale=-1;
1370  //now start changes for jets
1371  std::vector<Jet> corJets;
1372  corJets.clear();
1373 
1374  //maybe not most elegant solution, but works for sure
1375  unsigned int ind1=-1;
1376  double pt1=-1;
1377  unsigned int ind2=-1;
1378  double pt2=-1;
1379  unsigned int ind3=-1;
1380  double pt3=-1;
1381 
1382  bool cleaned_first_jet=false;
1383  bool cleaned_second_jet=false;
1384  bool cleaned_third_jet=false;
1385 
1386  //now start changes for jets
1387  std::vector<Jet> recoJets;
1388  recoJets.clear();
1389 
1390  int numofjets=0;
1391 
1392 
1393  for (unsigned int ijet=0; ijet<collSize; ijet++) {
1394  //bool thiscleaned=false;
1395  Jet correctedJet;
1396  bool pass_uncorrected=false;
1397  bool pass_corrected=false;
1398  if (isCaloJet_){
1399  correctedJet=(*caloJets)[ijet];
1400  }
1401  //if (isJPTJet_){
1402  //correctedJet=(*jptJets)[ijet];
1403  //}
1404  if (isPFJet_){
1405  correctedJet=(*pfJets)[ijet];
1406  }
1407  if(correctedJet.pt()>ptThresholdUnc_){
1408  pass_uncorrected=true;
1409  }
1410  if (!jetCorrectionService_.empty()) {
1411  const JetCorrector* corrector = JetCorrector::getJetCorrector(jetCorrectionService_, iSetup);
1412  //for (unsigned ijet=0; ijet<recoJets.size(); ijet++) {
1413 
1414  if (isCaloJet_){
1415  scale = corrector->correction((*caloJets)[ijet], iEvent, iSetup);
1416  }
1417  //if (isJPTJet_){
1418  //scale = corrector->correction((*jptJets)[ijet], iEvent, iSetup);
1419  //}
1420  if (isPFJet_){
1421  scale = corrector->correction((*pfJets)[ijet], iEvent, iSetup);
1422  }
1423  correctedJet.scaleEnergy(scale);
1424  }
1425 
1426  if(correctedJet.pt()> ptThreshold_){
1427  pass_corrected=true;
1428  }
1429 
1430  if (!pass_corrected && !pass_uncorrected) continue;
1431  //fill only corrected jets -> check ID for uncorrected jets
1432  if(pass_corrected){
1433  recoJets.push_back(correctedJet);
1434  }
1435 
1436  bool jetpassid=true;
1437  bool Thiscleaned=true;
1438  //jet ID for calojets
1439  if (isCaloJet_) {
1440  reco::CaloJetRef calojetref(caloJets, ijet);
1441  if(!runcosmics_){
1442  reco::JetID jetID = (*jetID_ValueMap_Handle)[calojetref];
1443  jetpassid = jetIDFunctor((*caloJets)[ijet], jetID);
1444  if(jetCleaningFlag_){
1445  Thiscleaned=jetpassid;
1446  }
1447  if(Thiscleaned && pass_corrected){//if cleaning requested->jet passes a loose ID
1448  mN90Hits = map_of_MEs[DirName+"/"+"N90Hits"]; if (mN90Hits && mN90Hits->getRootObject()) mN90Hits->Fill (jetID.n90Hits);
1449  mfHPD = map_of_MEs[DirName+"/"+"fHPD"]; if (mfHPD && mfHPD->getRootObject()) mfHPD->Fill (jetID.fHPD);
1450  mresEMF = map_of_MEs[DirName+"/"+"resEMF"]; if (mresEMF && mresEMF->getRootObject()) mresEMF->Fill (jetID.restrictedEMF);
1451  mfRBX = map_of_MEs[DirName+"/"+"fRBX"]; if (mfRBX && mfRBX->getRootObject()) mfRBX->Fill (jetID.fRBX);
1452  }
1453  }
1454  if(jetCleaningFlag_){
1455  Thiscleaned=jetpassid;
1456  }
1457  if(Thiscleaned && pass_uncorrected){
1458  mPt_uncor = map_of_MEs[DirName+"/"+"Pt_uncor"]; if (mPt_uncor && mPt_uncor->getRootObject()) mPt_uncor->Fill ((*caloJets)[ijet].pt());
1459  mEta_uncor = map_of_MEs[DirName+"/"+"Eta_uncor"]; if (mEta_uncor && mEta_uncor->getRootObject()) mEta_uncor->Fill ((*caloJets)[ijet].eta());
1460  mPhi_uncor = map_of_MEs[DirName+"/"+"Phi_uncor"]; if (mPhi_uncor && mPhi_uncor->getRootObject()) mPhi_uncor->Fill ((*caloJets)[ijet].phi());
1461  //if(!isJPTJet_){
1462  mConstituents_uncor = map_of_MEs[DirName+"/"+"Constituents_uncor"]; if (mConstituents_uncor && mConstituents_uncor->getRootObject()) mConstituents_uncor->Fill ((*caloJets)[ijet].nConstituents());
1463  //}
1464  }
1465  //now do calojet specific fractions and histograms ->H and E fracs
1466  if(Thiscleaned && pass_corrected){//if cleaning requested->jet passes a loose ID
1467  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*caloJets)[ijet].energyFractionHadronic());
1468  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*caloJets)[ijet].emEnergyFraction());
1469  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*caloJets)[ijet].energyFractionHadronic());
1470  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*caloJets)[ijet].emEnergyFraction());
1471  if (fabs((*caloJets)[ijet].eta()) <= 1.3) {
1472  mHFrac_Barrel = map_of_MEs[DirName+"/"+"HFrac_Barrel"]; if (mHFrac_Barrel && mHFrac_Barrel->getRootObject()) mHFrac_Barrel->Fill((*caloJets)[ijet].energyFractionHadronic());
1473  mEFrac_Barrel = map_of_MEs[DirName+"/"+"EFrac_Barrel"]; if (mEFrac_Barrel && mEFrac_Barrel->getRootObject()) mEFrac_Barrel->Fill((*caloJets)[ijet].emEnergyFraction());
1474  }else if(fabs((*caloJets)[ijet].eta()) <3.0){
1475  mHFrac_EndCap = map_of_MEs[DirName+"/"+"HFrac_EndCap"]; if (mHFrac_EndCap && mHFrac_EndCap->getRootObject()) mHFrac_EndCap->Fill((*caloJets)[ijet].energyFractionHadronic());
1476  mEFrac_EndCap = map_of_MEs[DirName+"/"+"EFrac_EndCap"]; if (mEFrac_EndCap && mEFrac_EndCap->getRootObject()) mEFrac_EndCap->Fill((*caloJets)[ijet].emEnergyFraction());
1477  }else{
1478  mHFrac_Forward = map_of_MEs[DirName+"/"+"HFrac_Forward"]; if (mHFrac_Forward && mHFrac_Forward->getRootObject()) mHFrac_Forward->Fill((*caloJets)[ijet].energyFractionHadronic());
1479  mEFrac_Forward = map_of_MEs[DirName+"/"+"EFrac_Forward"]; if (mEFrac_Forward && mEFrac_Forward->getRootObject()) mEFrac_Forward->Fill((*caloJets)[ijet].emEnergyFraction());
1480  }
1481  mMaxEInEmTowers = map_of_MEs[DirName+"/"+"MaxEInEmTowers"]; if (mMaxEInEmTowers && mMaxEInEmTowers->getRootObject()) mMaxEInEmTowers->Fill ((*caloJets)[ijet].maxEInEmTowers());
1482  mMaxEInHadTowers = map_of_MEs[DirName+"/"+"MaxEInHadTowers"]; if (mMaxEInHadTowers && mMaxEInHadTowers->getRootObject()) mMaxEInHadTowers->Fill ((*caloJets)[ijet].maxEInHadTowers());
1483 
1484  mHadEnergyInHO = map_of_MEs[DirName+"/"+"HadEnergyInHO"]; if (mHadEnergyInHO && mHadEnergyInHO->getRootObject()) mHadEnergyInHO->Fill ((*caloJets)[ijet].hadEnergyInHO());
1485  mHadEnergyInHB = map_of_MEs[DirName+"/"+"HadEnergyInHB"]; if (mHadEnergyInHB && mHadEnergyInHB->getRootObject()) mHadEnergyInHB->Fill ((*caloJets)[ijet].hadEnergyInHB());
1486  mHadEnergyInHF = map_of_MEs[DirName+"/"+"HadEnergyInHF"]; if (mHadEnergyInHF && mHadEnergyInHF->getRootObject()) mHadEnergyInHF->Fill ((*caloJets)[ijet].hadEnergyInHF());
1487  mHadEnergyInHE = map_of_MEs[DirName+"/"+"HadEnergyInHE"]; if (mHadEnergyInHE && mHadEnergyInHE->getRootObject()) mHadEnergyInHE->Fill ((*caloJets)[ijet].hadEnergyInHE());
1488  mEmEnergyInEB = map_of_MEs[DirName+"/"+"EmEnergyInEB"]; if (mEmEnergyInEB && mEmEnergyInEB->getRootObject()) mEmEnergyInEB->Fill ((*caloJets)[ijet].emEnergyInEB());
1489  mEmEnergyInEE = map_of_MEs[DirName+"/"+"EmEnergyInEE"]; if (mEmEnergyInEE && mEmEnergyInEE->getRootObject()) mEmEnergyInEE->Fill ((*caloJets)[ijet].emEnergyInEE());
1490  mEmEnergyInHF = map_of_MEs[DirName+"/"+"EmEnergyInHF"]; if (mEmEnergyInHF && mEmEnergyInHF->getRootObject()) mEmEnergyInHF->Fill ((*caloJets)[ijet].emEnergyInHF());
1491 
1492  }
1493  }
1494  //if(isJPTJet_){
1495  //const edm::RefToBase<reco::Jet>& rawJet = (*jptJets)[ijet].getCaloJetRef();
1499 
1500  //try {
1501  // const reco::CaloJet *rawCaloJet = dynamic_cast<const reco::CaloJet*>(&*rawJet);
1502  // reco::CaloJetRef const theCaloJetRef = (rawJet).castTo<reco::CaloJetRef>();
1503  // if(!runcosmics_){
1504  // reco::JetID jetID = (*jetID_ValueMap_Handle)[theCaloJetRef];
1505  // jetpassid = jetIDFunctor(*rawCaloJet, jetID);
1506  // if(jetCleaningFlag_){
1507  // Thiscleaned = jetpassid;
1508  // }
1509  // if(Thiscleaned /*&& ( fabs(rawJet->eta()) < 2.1)*/ && pass_corrected){
1510  // mN90Hits = map_of_MEs[DirName+"/"+"N90Hits"]; if (mN90Hits && mN90Hits->getRootObject()) mN90Hits->Fill (jetID.n90Hits);
1511  // mfHPD = map_of_MEs[DirName+"/"+"fHPD"]; if (mfHPD && mfHPD->getRootObject()) mfHPD->Fill (jetID.fHPD);
1512  // mresEMF = map_of_MEs[DirName+"/"+"resEMF"]; if (mresEMF && mresEMF->getRootObject()) mresEMF->Fill (jetID.restrictedEMF);
1513  // mfRBX = map_of_MEs[DirName+"/"+"fRBX"]; if (mfRBX && mfRBX->getRootObject()) mfRBX->Fill (jetID.fRBX);
1514  // }
1515  // }
1516  //} catch (const std::bad_cast&) {
1517  // edm::LogError("JetPlusTrackDQM") << "Failed to cast raw jet to CaloJet. JPT Jet does not appear to have been built from a CaloJet. "
1518  // << "Histograms not filled. ";
1519  // return;
1520  //}
1522  //if(Thiscleaned && pass_uncorrected /*&& ( fabs(rawJet->eta()) < 2.1)*/ ){
1523  //mPt_uncor = map_of_MEs[DirName+"/"+"Pt_uncor"]; if (mPt_uncor && mPt_uncor->getRootObject()) if (mPt_uncor) mPt_uncor->Fill ((*jptJets)[ijet].pt());
1524  // mEta_uncor = map_of_MEs[DirName+"/"+"Eta_uncor"]; if (mEta_uncor && mEta_uncor->getRootObject()) mEta_uncor->Fill ((*jptJets)[ijet].eta());
1525  // mPhi_uncor = map_of_MEs[DirName+"/"+"Phi_uncor"]; if (mPhi_uncor && mPhi_uncor->getRootObject()) mPhi_uncor->Fill ((*jptJets)[ijet].phi());
1526  // if(!isJPTJet_){
1527  // mConstituents_uncor = map_of_MEs[DirName+"/"+"Constituents_uncor"]; if (mConstituents_uncor && mConstituents_uncor->getRootObject()) mConstituents_uncor->Fill ((*jptJets)[ijet].nConstituents());
1528  // }
1529  //}
1530  //if(Thiscleaned && /*( fabs(rawJet->eta()) < 2.1) && */pass_corrected){
1531  // mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*jptJets)[ijet].chargedHadronEnergyFraction()+(*jptJets)[ijet].neutralHadronEnergyFraction());
1532  // //if (mEFrac) mEFrac->Fill ((*jptJets)[ijet].chargedEmEnergyFraction() +(*jptJets)[ijet].neutralEmEnergyFraction());
1533  // mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill (1.-(*jptJets)[ijet].chargedHadronEnergyFraction()-(*jptJets)[ijet].neutralHadronEnergyFraction());
1534  // mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*jptJets)[ijet].chargedHadronEnergyFraction()+(*jptJets)[ijet].neutralHadronEnergyFraction());
1535  // mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, 1.-(*jptJets)[ijet].chargedHadronEnergyFraction()-(*jptJets)[ijet].neutralHadronEnergyFraction());
1536  // if (fabs((*jptJets)[ijet].eta()) <= 1.3) {
1537  // mHFrac_Barrel = map_of_MEs[DirName+"/"+"HFrac_Barrel"]; if (mHFrac_Barrel && mHFrac_Barrel->getRootObject()) mHFrac_Barrel->Fill((*jptJets)[ijet].chargedHadronEnergyFraction()+(*jptJets)[ijet].neutralHadronEnergyFraction());
1538  // mEFrac_Barrel = map_of_MEs[DirName+"/"+"EFrac_Barrel"]; if (mEFrac_Barrel && mEFrac_Barrel->getRootObject()) mEFrac_Barrel->Fill(1.-(*jptJets)[ijet].chargedHadronEnergyFraction()-(*jptJets)[ijet].neutralHadronEnergyFraction());
1539  // }else if(fabs((*jptJets)[ijet].eta()) <3.0){
1540  // mHFrac_EndCap = map_of_MEs[DirName+"/"+"HFrac_EndCap"]; if (mHFrac_EndCap && mHFrac_EndCap->getRootObject()) mHFrac_EndCap->Fill((*jptJets)[ijet].chargedHadronEnergyFraction()+(*jptJets)[ijet].neutralHadronEnergyFraction());
1541  // mEFrac_EndCap = map_of_MEs[DirName+"/"+"EFrac_EndCap"]; if (mEFrac_EndCap && mEFrac_EndCap->getRootObject()) mEFrac_EndCap->Fill(1.-(*jptJets)[ijet].chargedHadronEnergyFraction()-(*jptJets)[ijet].neutralHadronEnergyFraction());
1542  // }else{
1543  // mHFrac_Forward = map_of_MEs[DirName+"/"+"HFrac_Forward"]; if (mHFrac_Forward && mHFrac_Forward->getRootObject()) mHFrac_Forward->Fill((*jptJets)[ijet].chargedHadronEnergyFraction()+(*jptJets)[ijet].neutralHadronEnergyFraction());
1544  // mEFrac_Forward = map_of_MEs[DirName+"/"+"EFrac_Forward"]; if (mEFrac_Forward && mEFrac_Forward->getRootObject()) mEFrac_Forward->Fill(1.-(*jptJets)[ijet].chargedHadronEnergyFraction()-(*jptJets)[ijet].neutralHadronEnergyFraction());
1545  // }
1546  // mE = map_of_MEs[DirName+"/"+"E"]; if (mE && mE->getRootObject()) mE->Fill ((*jptJets)[ijet].energy());
1547  // mPx = map_of_MEs[DirName+"/"+"Px"]; if (mPx && mPx->getRootObject()) mPx->Fill ((*jptJets)[ijet].px());
1548  // mPy = map_of_MEs[DirName+"/"+"Py"]; if (mPy && mPy->getRootObject()) mPy->Fill ((*jptJets)[ijet].py());
1549  // mPz = map_of_MEs[DirName+"/"+"Pz"]; if (mPz && mPz->getRootObject()) mPz->Fill ((*jptJets)[ijet].pz());
1550  // mP = map_of_MEs[DirName+"/"+"P"]; if (mP && mP->getRootObject()) mP->Fill ((*jptJets)[ijet].p());
1551  // mEt = map_of_MEs[DirName+"/"+"Et"]; if (mEt && mEt->getRootObject()) mEt->Fill ((*jptJets)[ijet].et());
1552  // mnTracks = map_of_MEs[DirName+"/"+"nTracks"]; if (mnTracks && mnTracks->getRootObject()) mnTracks->Fill((*jptJets)[ijet].chargedMultiplicity());
1553  // mnTracksVSJetPt = map_of_MEs[DirName+"/"+"nTracksVSJetPt"]; if (mnTracksVSJetPt && mEt->getRootObject()) mnTracksVSJetPt->Fill(rawJet->pt(),(*jptJets)[ijet].chargedMultiplicity());
1554  // mnTracksVSJetEta = map_of_MEs[DirName+"/"+"nTracksVSJetEta"]; if (mnTracksVSJetEta && mnTracksVSJetEta->getRootObject()) mnTracksVSJetEta->Fill(rawJet->eta(),(*jptJets)[ijet].chargedMultiplicity());
1555  // const reco::TrackRefVector& pionsInVertexInCalo = (*jptJets)[ijet].getPionsInVertexInCalo();
1556  // const reco::TrackRefVector& pionsInVertexOutCalo = (*jptJets)[ijet].getPionsInVertexOutCalo();
1557  // const reco::TrackRefVector& pionsOutVertexInCalo = (*jptJets)[ijet].getPionsOutVertexInCalo();
1558  // const reco::TrackRefVector& muonsInVertexInCalo = (*jptJets)[ijet].getMuonsInVertexInCalo();
1559  // const reco::TrackRefVector& muonsInVertexOutCalo = (*jptJets)[ijet].getMuonsInVertexOutCalo();
1560  // const reco::TrackRefVector& muonsOutVertexInCalo = (*jptJets)[ijet].getMuonsOutVertexInCalo();
1561  // const reco::TrackRefVector& electronsInVertexInCalo = (*jptJets)[ijet].getElecsInVertexInCalo();
1562  // const reco::TrackRefVector& electronsInVertexOutCalo = (*jptJets)[ijet].getElecsInVertexOutCalo();
1563  // const reco::TrackRefVector& electronsOutVertexInCalo = (*jptJets)[ijet].getElecsOutVertexInCalo();
1564  //
1565  // mnallPionTracksPerJet = map_of_MEs[DirName+"/"+"nallPionTracks"]; if(mnallPionTracksPerJet && mnallPionTracksPerJet->getRootObject()) mnallPionTracksPerJet->Fill(pionsInVertexInCalo.size()+pionsInVertexOutCalo.size()+pionsOutVertexInCalo.size());
1566  // mnInVertexInCaloPionTracksPerJet = map_of_MEs[DirName+"/"+"nInVertexInCaloPionTracks"]; if(mnInVertexInCaloPionTracksPerJet && mnInVertexInCaloPionTracksPerJet->getRootObject()) mnInVertexInCaloPionTracksPerJet->Fill(pionsInVertexInCalo.size());
1567  // mnOutVertexInCaloPionTracksPerJet = map_of_MEs[DirName+"/"+"nOutVertexInCaloPionTracks"]; if(mnOutVertexInCaloPionTracksPerJet && mnOutVertexInCaloPionTracksPerJet->getRootObject()) mnOutVertexInCaloPionTracksPerJet->Fill(pionsOutVertexInCalo.size());
1568  // mnInVertexOutCaloPionTracksPerJet = map_of_MEs[DirName+"/"+"nInVertexOutCaloPionTracks"]; if(mnInVertexOutCaloPionTracksPerJet && mnInVertexOutCaloPionTracksPerJet->getRootObject()) mnInVertexOutCaloPionTracksPerJet->Fill(pionsInVertexOutCalo.size());
1569  //
1570  // for (reco::TrackRefVector::const_iterator iTrack = pionsInVertexInCalo.begin(); iTrack != pionsInVertexInCalo.end(); ++iTrack) {
1571  // mallPionTracksPt = map_of_MEs[DirName+"/"+"allPionTracksPt"]; if(mallPionTracksPt && mallPionTracksPt->getRootObject()) mallPionTracksPt->Fill((*iTrack)->pt());
1572  // mallPionTracksEta = map_of_MEs[DirName+"/"+"allPionTracksEta"]; if(mallPionTracksEta && mallPionTracksEta->getRootObject()) mallPionTracksEta->Fill((*iTrack)->eta());
1573  // mallPionTracksPhi = map_of_MEs[DirName+"/"+"allPionTracksPhi"]; if(mallPionTracksPhi && mallPionTracksPhi->getRootObject()) mallPionTracksPhi->Fill((*iTrack)->phi());
1574  // mallPionTracksPtVSEta = map_of_MEs[DirName+"/"+"allPionTracksPtVSEta"]; if(mallPionTracksPtVSEta && mallPionTracksPtVSEta->getRootObject()) mallPionTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1575  // mInVertexInCaloPionTracksPt = map_of_MEs[DirName+"/"+"InVertexInCaloPionTracksPt"]; if(mInVertexInCaloPionTracksPt && mInVertexInCaloPionTracksPt->getRootObject()) mInVertexInCaloPionTracksPt->Fill((*iTrack)->pt());
1576  // mInVertexInCaloPionTracksEta = map_of_MEs[DirName+"/"+"InVertexInCaloPionTracksEta"]; if(mInVertexInCaloPionTracksEta && mInVertexInCaloPionTracksEta->getRootObject()) mInVertexInCaloPionTracksEta->Fill((*iTrack)->eta());
1577  // mInVertexInCaloPionTracksPhi = map_of_MEs[DirName+"/"+"InVertexInCaloPionTracksPhi"]; if(mInVertexInCaloPionTracksPhi && mInVertexInCaloPionTracksPhi->getRootObject()) mInVertexInCaloPionTracksPhi->Fill((*iTrack)->phi());
1578  // mInVertexInCaloPionTracksPtVSEta = map_of_MEs[DirName+"/"+"InVertexInCaloPionTracksPtVSEta"]; if(mInVertexInCaloPionTracksPtVSEta && mInVertexInCaloPionTracksPtVSEta->getRootObject()) mInVertexInCaloPionTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1579  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1580  // mInCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"InCaloTrackDirectionJetDR"]; if(mInCaloTrackDirectionJetDRHisto_ && mInCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mInCaloTrackDirectionJetDRHisto_)mInCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1581  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1582  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1583  // mInVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"InVertexTrackImpactPointJetDR"]; if( mInVertexTrackImpactPointJetDRHisto_ && mInVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mInVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1584  // }
1585  // for (reco::TrackRefVector::const_iterator iTrack = pionsInVertexOutCalo.begin(); iTrack != pionsInVertexOutCalo.end(); ++iTrack) {
1586  // mallPionTracksPt = map_of_MEs[DirName+"/"+"allPionTracksPt"]; if(mallPionTracksPt && mallPionTracksPt->getRootObject()) mallPionTracksPt->Fill((*iTrack)->pt());
1587  // mallPionTracksEta = map_of_MEs[DirName+"/"+"allPionTracksEta"]; if(mallPionTracksEta && mallPionTracksEta->getRootObject()) mallPionTracksEta->Fill((*iTrack)->eta());
1588  // mallPionTracksPhi = map_of_MEs[DirName+"/"+"allPionTracksPhi"]; if(mallPionTracksPhi && mallPionTracksPhi->getRootObject()) mallPionTracksPhi->Fill((*iTrack)->phi());
1589  // mallPionTracksPtVSEta = map_of_MEs[DirName+"/"+"allPionTracksPtVSEta"]; if(mallPionTracksPtVSEta && mallPionTracksPtVSEta->getRootObject()) mallPionTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1590  // mInVertexOutCaloPionTracksPt = map_of_MEs[DirName+"/"+"InVertexOutCaloPionTracksPt"]; if(mInVertexOutCaloPionTracksPt && mInVertexOutCaloPionTracksPt->getRootObject()) mInVertexOutCaloPionTracksPt->Fill((*iTrack)->pt());
1591  // mInVertexOutCaloPionTracksEta = map_of_MEs[DirName+"/"+"InVertexOutCaloPionTracksEta"]; if(mInVertexOutCaloPionTracksEta && mInVertexOutCaloPionTracksEta->getRootObject()) mInVertexOutCaloPionTracksEta->Fill((*iTrack)->eta());
1592  // mInVertexOutCaloPionTracksPhi = map_of_MEs[DirName+"/"+"InVertexOutCaloPionTracksPhi"]; if(mInVertexOutCaloPionTracksPhi && mInVertexOutCaloPionTracksPhi->getRootObject()) mInVertexOutCaloPionTracksPhi->Fill((*iTrack)->phi());
1593  // mInVertexOutCaloPionTracksPtVSEta = map_of_MEs[DirName+"/"+"InVertexOutCaloPionTracksPtVSEta"]; if(mInVertexOutCaloPionTracksPtVSEta && mInVertexOutCaloPionTracksPtVSEta->getRootObject()) mInVertexOutCaloPionTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1594  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1595  // mOutCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"OutCaloTrackDirectionJetDR"]; if(mOutCaloTrackDirectionJetDRHisto_ && mOutCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mOutCaloTrackDirectionJetDRHisto_)mOutCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1596  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1597  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1598  // mInVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"InVertexTrackImpactPointJetDR"]; if( mInVertexTrackImpactPointJetDRHisto_ && mInVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mInVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1599  // }
1600  // for (reco::TrackRefVector::const_iterator iTrack = pionsOutVertexInCalo.begin(); iTrack != pionsOutVertexInCalo.end(); ++iTrack) {
1601  // mallPionTracksPt = map_of_MEs[DirName+"/"+"allPionTracksPt"]; if(mallPionTracksPt && mallPionTracksPt->getRootObject()) mallPionTracksPt->Fill((*iTrack)->pt());
1602  // mallPionTracksEta = map_of_MEs[DirName+"/"+"allPionTracksEta"]; if(mallPionTracksEta && mallPionTracksEta->getRootObject()) mallPionTracksEta->Fill((*iTrack)->eta());
1603  // mallPionTracksPhi = map_of_MEs[DirName+"/"+"allPionTracksPhi"]; if(mallPionTracksPhi && mallPionTracksPhi->getRootObject()) mallPionTracksPhi->Fill((*iTrack)->phi());
1604  // mallPionTracksPtVSEta = map_of_MEs[DirName+"/"+"allPionTracksPtVSEta"]; if(mallPionTracksPtVSEta && mallPionTracksPtVSEta->getRootObject()) mallPionTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1605  // mOutVertexInCaloPionTracksPt = map_of_MEs[DirName+"/"+"OutVertexInCaloPionTracksPt"]; if(mOutVertexInCaloPionTracksPt && mOutVertexInCaloPionTracksPt->getRootObject()) mOutVertexInCaloPionTracksPt->Fill((*iTrack)->pt());
1606  // mOutVertexInCaloPionTracksEta = map_of_MEs[DirName+"/"+"OutVertexInCaloPionTracksEta"]; if(mOutVertexInCaloPionTracksEta && mOutVertexInCaloPionTracksEta->getRootObject()) mOutVertexInCaloPionTracksEta->Fill((*iTrack)->eta());
1607  // mOutVertexInCaloPionTracksPhi = map_of_MEs[DirName+"/"+"OutVertexInCaloPionTracksPhi"]; if(mOutVertexInCaloPionTracksPhi && mOutVertexInCaloPionTracksPhi->getRootObject()) mOutVertexInCaloPionTracksPhi->Fill((*iTrack)->phi());
1608  // mOutVertexInCaloPionTracksPtVSEta = map_of_MEs[DirName+"/"+"OutVertexInCaloPionTracksPtVSEta"]; if(mOutVertexInCaloPionTracksPtVSEta && mOutVertexInCaloPionTracksPtVSEta->getRootObject()) mOutVertexInCaloPionTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1609  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1610  // mInCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"InCaloTrackDirectionJetDR"]; if(mInCaloTrackDirectionJetDRHisto_ && mInCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mInCaloTrackDirectionJetDRHisto_)mInCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1611  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1612  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1613  // mOutVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"OutVertexTrackImpactPointJetDR"]; if( mOutVertexTrackImpactPointJetDRHisto_ && mOutVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mOutVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1614  // }
1615  // //muon track histos
1616  // mnallMuonTracksPerJet = map_of_MEs[DirName+"/"+"nallMuonTracks"]; if(mnallMuonTracksPerJet && mnallMuonTracksPerJet->getRootObject()) mnallMuonTracksPerJet->Fill(muonsInVertexInCalo.size()+muonsInVertexOutCalo.size()+muonsOutVertexInCalo.size());
1617  // mnInVertexInCaloMuonTracksPerJet = map_of_MEs[DirName+"/"+"nInVertexInCaloMuonTracks"]; if(mnInVertexInCaloMuonTracksPerJet && mnInVertexInCaloMuonTracksPerJet->getRootObject()) mnInVertexInCaloMuonTracksPerJet->Fill(muonsInVertexInCalo.size());
1618  // mnOutVertexInCaloMuonTracksPerJet = map_of_MEs[DirName+"/"+"nOutVertexInCaloMuonTracks"]; if(mnOutVertexInCaloMuonTracksPerJet && mnOutVertexInCaloMuonTracksPerJet->getRootObject()) mnOutVertexInCaloMuonTracksPerJet->Fill(muonsOutVertexInCalo.size());
1619  // mnInVertexOutCaloMuonTracksPerJet = map_of_MEs[DirName+"/"+"nInVertexOutCaloMuonTracks"]; if(mnInVertexOutCaloMuonTracksPerJet && mnInVertexOutCaloMuonTracksPerJet->getRootObject()) mnInVertexOutCaloMuonTracksPerJet->Fill(muonsInVertexOutCalo.size());
1620  // for (reco::TrackRefVector::const_iterator iTrack = muonsInVertexInCalo.begin(); iTrack != muonsInVertexInCalo.end(); ++iTrack) {
1621  // mallMuonTracksPt = map_of_MEs[DirName+"/"+"allMuonTracksPt"]; if(mallMuonTracksPt && mallMuonTracksPt->getRootObject()) mallMuonTracksPt->Fill((*iTrack)->pt());
1622  // mallMuonTracksEta = map_of_MEs[DirName+"/"+"allMuonTracksEta"]; if(mallMuonTracksEta && mallMuonTracksEta->getRootObject()) mallMuonTracksEta->Fill((*iTrack)->eta());
1623  // mallMuonTracksPhi = map_of_MEs[DirName+"/"+"allMuonTracksPhi"]; if(mallMuonTracksPhi && mallMuonTracksPhi->getRootObject()) mallMuonTracksPhi->Fill((*iTrack)->phi());
1624  // mallMuonTracksPtVSEta = map_of_MEs[DirName+"/"+"allMuonTracksPtVSEta"]; if(mallMuonTracksPtVSEta && mallMuonTracksPtVSEta->getRootObject()) mallMuonTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1625  // mInVertexInCaloMuonTracksPt = map_of_MEs[DirName+"/"+"InVertexInCaloMuonTracksPt"]; if(mInVertexInCaloMuonTracksPt && mInVertexInCaloMuonTracksPt->getRootObject()) mInVertexInCaloMuonTracksPt->Fill((*iTrack)->pt());
1626  // mInVertexInCaloMuonTracksEta = map_of_MEs[DirName+"/"+"InVertexInCaloMuonTracksEta"]; if(mInVertexInCaloMuonTracksEta && mInVertexInCaloMuonTracksEta->getRootObject()) mInVertexInCaloMuonTracksEta->Fill((*iTrack)->eta());
1627  // mInVertexInCaloMuonTracksPhi = map_of_MEs[DirName+"/"+"InVertexInCaloMuonTracksPhi"]; if(mInVertexInCaloMuonTracksPhi && mInVertexInCaloMuonTracksPhi->getRootObject()) mInVertexInCaloMuonTracksPhi->Fill((*iTrack)->phi());
1628  // mInVertexInCaloMuonTracksPtVSEta = map_of_MEs[DirName+"/"+"InVertexInCaloMuonTracksPtVSEta"]; if(mInVertexInCaloMuonTracksPtVSEta && mInVertexInCaloMuonTracksPtVSEta->getRootObject()) mInVertexInCaloMuonTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1629  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1630  // mInCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"InCaloTrackDirectionJetDR"]; if(mInCaloTrackDirectionJetDRHisto_ && mInCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mInCaloTrackDirectionJetDRHisto_)mInCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1631  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1632  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1633  // mInVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"InVertexTrackImpactPointJetDR"]; if( mInVertexTrackImpactPointJetDRHisto_ && mInVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mInVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1634  // }
1635  // for (reco::TrackRefVector::const_iterator iTrack = muonsInVertexOutCalo.begin(); iTrack != muonsInVertexOutCalo.end(); ++iTrack) {
1636  // mallMuonTracksPt = map_of_MEs[DirName+"/"+"allMuonTracksPt"]; if(mallMuonTracksPt && mallMuonTracksPt->getRootObject()) mallMuonTracksPt->Fill((*iTrack)->pt());
1637  // mallMuonTracksEta = map_of_MEs[DirName+"/"+"allMuonTracksEta"]; if(mallMuonTracksEta && mallMuonTracksEta->getRootObject()) mallMuonTracksEta->Fill((*iTrack)->eta());
1638  // mallMuonTracksPhi = map_of_MEs[DirName+"/"+"allMuonTracksPhi"]; if(mallMuonTracksPhi && mallMuonTracksPhi->getRootObject()) mallMuonTracksPhi->Fill((*iTrack)->phi());
1639  // mallMuonTracksPtVSEta = map_of_MEs[DirName+"/"+"allMuonTracksPtVSEta"]; if(mallMuonTracksPtVSEta && mallMuonTracksPtVSEta->getRootObject()) mallMuonTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1640  // mInVertexOutCaloMuonTracksPt = map_of_MEs[DirName+"/"+"InVertexOutCaloMuonTracksPt"]; if(mInVertexOutCaloMuonTracksPt && mInVertexOutCaloMuonTracksPt->getRootObject()) mInVertexOutCaloMuonTracksPt->Fill((*iTrack)->pt());
1641  // mInVertexOutCaloMuonTracksEta = map_of_MEs[DirName+"/"+"InVertexOutCaloMuonTracksEta"]; if(mInVertexOutCaloMuonTracksEta && mInVertexOutCaloMuonTracksEta->getRootObject()) mInVertexOutCaloMuonTracksEta->Fill((*iTrack)->eta());
1642  // mInVertexOutCaloMuonTracksPhi = map_of_MEs[DirName+"/"+"InVertexOutCaloMuonTracksPhi"]; if(mInVertexOutCaloMuonTracksPhi && mInVertexOutCaloMuonTracksPhi->getRootObject()) mInVertexOutCaloMuonTracksPhi->Fill((*iTrack)->phi());
1643  // mInVertexOutCaloMuonTracksPtVSEta = map_of_MEs[DirName+"/"+"InVertexOutCaloMuonTracksPtVSEta"]; if(mInVertexOutCaloMuonTracksPtVSEta && mInVertexOutCaloMuonTracksPtVSEta->getRootObject()) mInVertexOutCaloMuonTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1644  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1645  // mOutCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"OutCaloTrackDirectionJetDR"]; if(mOutCaloTrackDirectionJetDRHisto_ && mOutCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mOutCaloTrackDirectionJetDRHisto_)mOutCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1646  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1647  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1648  // mInVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"InVertexTrackImpactPointJetDR"]; if( mInVertexTrackImpactPointJetDRHisto_ && mInVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mInVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1649  // }
1650  // for (reco::TrackRefVector::const_iterator iTrack = muonsOutVertexInCalo.begin(); iTrack != muonsOutVertexInCalo.end(); ++iTrack) {
1651  // mallMuonTracksPt = map_of_MEs[DirName+"/"+"allMuonTracksPt"]; if(mallMuonTracksPt && mallMuonTracksPt->getRootObject()) mallMuonTracksPt->Fill((*iTrack)->pt());
1652  // mallMuonTracksEta = map_of_MEs[DirName+"/"+"allMuonTracksEta"]; if(mallMuonTracksEta && mallMuonTracksEta->getRootObject()) mallMuonTracksEta->Fill((*iTrack)->eta());
1653  // mallMuonTracksPhi = map_of_MEs[DirName+"/"+"allMuonTracksPhi"]; if(mallMuonTracksPhi && mallMuonTracksPhi->getRootObject()) mallMuonTracksPhi->Fill((*iTrack)->phi());
1654  // mallMuonTracksPtVSEta = map_of_MEs[DirName+"/"+"allMuonTracksPtVSEta"]; if(mallMuonTracksPtVSEta && mallMuonTracksPtVSEta->getRootObject()) mallMuonTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1655  // mOutVertexInCaloMuonTracksPt = map_of_MEs[DirName+"/"+"OutVertexInCaloMuonTracksPt"]; if(mOutVertexInCaloMuonTracksPt && mOutVertexInCaloMuonTracksPt->getRootObject()) mOutVertexInCaloMuonTracksPt->Fill((*iTrack)->pt());
1656  // mOutVertexInCaloMuonTracksEta = map_of_MEs[DirName+"/"+"OutVertexInCaloMuonTracksEta"]; if(mOutVertexInCaloMuonTracksEta && mOutVertexInCaloMuonTracksEta->getRootObject()) mOutVertexInCaloMuonTracksEta->Fill((*iTrack)->eta());
1657  // mOutVertexInCaloMuonTracksPhi = map_of_MEs[DirName+"/"+"OutVertexInCaloMuonTracksPhi"]; if(mOutVertexInCaloMuonTracksPhi && mOutVertexInCaloMuonTracksPhi->getRootObject()) mOutVertexInCaloMuonTracksPhi->Fill((*iTrack)->phi());
1658  // mOutVertexInCaloMuonTracksPtVSEta = map_of_MEs[DirName+"/"+"OutVertexInCaloMuonTracksPtVSEta"]; if(mOutVertexInCaloMuonTracksPtVSEta && mOutVertexInCaloMuonTracksPtVSEta->getRootObject()) mOutVertexInCaloMuonTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1659  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1660  // mInCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"InCaloTrackDirectionJetDR"]; if(mInCaloTrackDirectionJetDRHisto_ && mInCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mInCaloTrackDirectionJetDRHisto_)mInCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1661  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1662  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1663  // mOutVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"OutVertexTrackImpactPointJetDR"]; if( mOutVertexTrackImpactPointJetDRHisto_ && mOutVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mOutVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1664  // }
1665  // //electron track histos
1666  // mnallElectronTracksPerJet = map_of_MEs[DirName+"/"+"nallElectronTracks"]; if(mnallElectronTracksPerJet && mnallElectronTracksPerJet->getRootObject()) mnallElectronTracksPerJet->Fill(electronsInVertexInCalo.size()+electronsInVertexOutCalo.size()+electronsOutVertexInCalo.size());
1667  // mnInVertexInCaloElectronTracksPerJet = map_of_MEs[DirName+"/"+"nInVertexInCaloElectronTracks"]; if(mnInVertexInCaloElectronTracksPerJet && mnInVertexInCaloElectronTracksPerJet->getRootObject()) mnInVertexInCaloElectronTracksPerJet->Fill(electronsInVertexInCalo.size());
1668  // mnOutVertexInCaloElectronTracksPerJet = map_of_MEs[DirName+"/"+"nOutVertexInCaloElectronTracks"]; if(mnOutVertexInCaloElectronTracksPerJet && mnOutVertexInCaloElectronTracksPerJet->getRootObject()) mnOutVertexInCaloElectronTracksPerJet->Fill(electronsOutVertexInCalo.size());
1669  // mnInVertexOutCaloElectronTracksPerJet = map_of_MEs[DirName+"/"+"nInVertexOutCaloElectronTracks"]; if(mnInVertexOutCaloElectronTracksPerJet && mnInVertexOutCaloElectronTracksPerJet->getRootObject()) mnInVertexOutCaloElectronTracksPerJet->Fill(electronsInVertexOutCalo.size());
1670  // for (reco::TrackRefVector::const_iterator iTrack = electronsInVertexInCalo.begin(); iTrack != electronsInVertexInCalo.end(); ++iTrack) {
1671  // mallElectronTracksPt = map_of_MEs[DirName+"/"+"allElectronTracksPt"]; if(mallElectronTracksPt && mallElectronTracksPt->getRootObject()) mallElectronTracksPt->Fill((*iTrack)->pt());
1672  // mallElectronTracksEta = map_of_MEs[DirName+"/"+"allElectronTracksEta"]; if(mallElectronTracksEta && mallElectronTracksPhi->getRootObject()) mallElectronTracksEta->Fill((*iTrack)->eta());
1673  // mallElectronTracksPhi = map_of_MEs[DirName+"/"+"allElectronTracksPhi"]; if(mallElectronTracksPhi && mallElectronTracksEta->getRootObject()) mallElectronTracksPhi->Fill((*iTrack)->phi());
1674  // mallElectronTracksPtVSEta = map_of_MEs[DirName+"/"+"allElectronTracksPtVSEta"]; if(mallElectronTracksPtVSEta && mallElectronTracksPtVSEta->getRootObject()) mallElectronTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1675  // mInVertexInCaloElectronTracksPt = map_of_MEs[DirName+"/"+"InVertexInCaloElectronTracksPt"]; if(mInVertexInCaloElectronTracksPt && mInVertexInCaloElectronTracksPt->getRootObject()) mInVertexInCaloElectronTracksPt->Fill((*iTrack)->pt());
1676  // mInVertexInCaloElectronTracksEta = map_of_MEs[DirName+"/"+"InVertexInCaloElectronTracksEta"]; if(mInVertexInCaloElectronTracksEta && mInVertexInCaloElectronTracksEta->getRootObject()) mInVertexInCaloElectronTracksEta->Fill((*iTrack)->eta());
1677  // mInVertexInCaloElectronTracksPhi = map_of_MEs[DirName+"/"+"InVertexInCaloElectronTracksPhi"]; if(mInVertexInCaloElectronTracksPhi && mInVertexInCaloElectronTracksPhi->getRootObject()) mInVertexInCaloElectronTracksPhi->Fill((*iTrack)->phi());
1678  // mInVertexInCaloElectronTracksPtVSEta = map_of_MEs[DirName+"/"+"InVertexInCaloElectronTracksPtVSEta"]; if(mInVertexInCaloElectronTracksPtVSEta && mInVertexInCaloElectronTracksPtVSEta->getRootObject()) mInVertexInCaloElectronTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1679  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1680  // mInCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"InCaloTrackDirectionJetDR"]; if(mInCaloTrackDirectionJetDRHisto_ && mInCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mInCaloTrackDirectionJetDRHisto_)mInCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1681  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1682  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1683  // mInVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"InVertexTrackImpactPointJetDR"]; if( mInVertexTrackImpactPointJetDRHisto_ && mInVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mInVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1684  // }
1685  // for (reco::TrackRefVector::const_iterator iTrack = electronsInVertexOutCalo.begin(); iTrack != electronsInVertexOutCalo.end(); ++iTrack) {
1686  // mallElectronTracksPt = map_of_MEs[DirName+"/"+"allElectronTracksPt"]; if(mallElectronTracksPt && mallElectronTracksPt->getRootObject()) mallElectronTracksPt->Fill((*iTrack)->pt());
1687  // mallElectronTracksEta = map_of_MEs[DirName+"/"+"allElectronTracksEta"]; if(mallElectronTracksEta && mallElectronTracksEta->getRootObject()) mallElectronTracksEta->Fill((*iTrack)->eta());
1688  // mallElectronTracksPhi = map_of_MEs[DirName+"/"+"allElectronTracksPhi"]; if(mallElectronTracksPhi && mallElectronTracksPhi->getRootObject()) mallElectronTracksPhi->Fill((*iTrack)->phi());
1689  // mallElectronTracksPtVSEta = map_of_MEs[DirName+"/"+"allElectronTracksPtVSEta"]; if(mallElectronTracksPtVSEta && mallElectronTracksPtVSEta->getRootObject()) mallElectronTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1690  // mInVertexOutCaloElectronTracksPt = map_of_MEs[DirName+"/"+"InVertexOutCaloElectronTracksPt"]; if(mInVertexOutCaloElectronTracksPt && mInVertexOutCaloElectronTracksPt->getRootObject()) mInVertexOutCaloElectronTracksPt->Fill((*iTrack)->pt());
1691  // mInVertexOutCaloElectronTracksEta = map_of_MEs[DirName+"/"+"InVertexOutCaloElectronTracksEta"]; if(mInVertexOutCaloElectronTracksEta && mInVertexOutCaloElectronTracksEta->getRootObject()) mInVertexOutCaloElectronTracksEta->Fill((*iTrack)->eta());
1692  // mInVertexOutCaloElectronTracksPhi = map_of_MEs[DirName+"/"+"InVertexOutCaloElectronTracksPhi"]; if(mInVertexOutCaloElectronTracksPhi && mInVertexOutCaloElectronTracksPhi->getRootObject()) mInVertexOutCaloElectronTracksPhi->Fill((*iTrack)->phi());
1693  // mInVertexOutCaloElectronTracksPtVSEta = map_of_MEs[DirName+"/"+"InVertexOutCaloElectronTracksPtVSEta"]; if(mInVertexOutCaloElectronTracksPtVSEta && mInVertexOutCaloElectronTracksPtVSEta->getRootObject()) mInVertexOutCaloElectronTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1694  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1695  // mOutCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"OutCaloTrackDirectionJetDR"]; if(mOutCaloTrackDirectionJetDRHisto_ && mOutCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mOutCaloTrackDirectionJetDRHisto_)mOutCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1696  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1697  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1698  // mInVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"InVertexTrackImpactPointJetDR"]; if( mInVertexTrackImpactPointJetDRHisto_ && mInVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mInVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1699  // }
1700  // for (reco::TrackRefVector::const_iterator iTrack = electronsOutVertexInCalo.begin(); iTrack != electronsOutVertexInCalo.end(); ++iTrack) {
1701  // mallElectronTracksPt = map_of_MEs[DirName+"/"+"allElectronTracksPt"]; if(mallElectronTracksPt && mallElectronTracksPt->getRootObject()) mallElectronTracksPt->Fill((*iTrack)->pt());
1702  // mallElectronTracksEta = map_of_MEs[DirName+"/"+"allElectronTracksEta"]; if(mallElectronTracksEta && mallElectronTracksEta->getRootObject()) mallElectronTracksEta->Fill((*iTrack)->eta());
1703  // mallElectronTracksPhi = map_of_MEs[DirName+"/"+"allElectronTracksPhi"]; if(mallElectronTracksPhi && mallElectronTracksPhi->getRootObject()) mallElectronTracksPhi->Fill((*iTrack)->phi());
1704  // mallElectronTracksPtVSEta = map_of_MEs[DirName+"/"+"allElectronTracksPtVSEta"]; if(mallElectronTracksPtVSEta && mallElectronTracksPtVSEta->getRootObject()) mallElectronTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1705  // mOutVertexInCaloElectronTracksPt = map_of_MEs[DirName+"/"+"OutVertexInCaloElectronTracksPt"]; if(mOutVertexInCaloElectronTracksPt && mOutVertexInCaloElectronTracksPt->getRootObject()) mOutVertexInCaloElectronTracksPt->Fill((*iTrack)->pt());
1706  // mOutVertexInCaloElectronTracksEta = map_of_MEs[DirName+"/"+"OutVertexInCaloElectronTracksEta"]; if(mOutVertexInCaloElectronTracksEta && mOutVertexInCaloElectronTracksEta->getRootObject()) mOutVertexInCaloElectronTracksEta->Fill((*iTrack)->eta());
1707  // mOutVertexInCaloElectronTracksPhi = map_of_MEs[DirName+"/"+"OutVertexInCaloElectronTracksPhi"]; if(mOutVertexInCaloElectronTracksPhi && mOutVertexInCaloElectronTracksPhi->getRootObject()) mOutVertexInCaloElectronTracksPhi->Fill((*iTrack)->phi());
1708  // mOutVertexInCaloElectronTracksPtVSEta = map_of_MEs[DirName+"/"+"OutVertexInCaloElectronTracksPtVSEta"]; if(mOutVertexInCaloElectronTracksPtVSEta && mOutVertexInCaloElectronTracksPtVSEta->getRootObject()) mOutVertexInCaloElectronTracksPtVSEta->Fill((*iTrack)->eta(),(*iTrack)->pt());
1709  // const double trackDirectionJetDR = deltaR(rawJet->eta(),rawJet->phi(),(*iTrack)->eta(),(*iTrack)->phi());
1710  // mInCaloTrackDirectionJetDRHisto_= map_of_MEs[DirName+"/"+"InCaloTrackDirectionJetDR"]; if(mInCaloTrackDirectionJetDRHisto_ && mInCaloTrackDirectionJetDRHisto_ ->getRootObject()) if(mInCaloTrackDirectionJetDRHisto_)mInCaloTrackDirectionJetDRHisto_->Fill(trackDirectionJetDR);
1711  // math::XYZPoint point =trackPropagator_->impactPoint(**iTrack);
1712  // const double impactPointJetDR = deltaR(rawJet->eta(),rawJet->phi(), point.Eta(),point.Phi());
1713  // mOutVertexTrackImpactPointJetDRHisto_= map_of_MEs[DirName+"/"+"OutVertexTrackImpactPointJetDR"]; if( mOutVertexTrackImpactPointJetDRHisto_ && mOutVertexTrackImpactPointJetDRHisto_ ->getRootObject()) mOutVertexTrackImpactPointJetDRHisto_->Fill(impactPointJetDR);
1714  // }
1715  //}
1716  //}
1717  if(isPFJet_){
1718  jetpassid = pfjetIDFunctor((*pfJets)[ijet]);
1719  if(jetCleaningFlag_){
1720  Thiscleaned = jetpassid;
1721  }
1722  if(Thiscleaned && pass_uncorrected){
1723  mPt_uncor = map_of_MEs[DirName+"/"+"Pt_uncor"]; if (mPt_uncor && mPt_uncor->getRootObject()) if (mPt_uncor) mPt_uncor->Fill ((*pfJets)[ijet].pt());
1724  mEta_uncor = map_of_MEs[DirName+"/"+"Eta_uncor"]; if (mEta_uncor && mEta_uncor->getRootObject()) if (mEta_uncor) mEta_uncor->Fill ((*pfJets)[ijet].eta());
1725  mPhi_uncor = map_of_MEs[DirName+"/"+"Phi_uncor"]; if (mPhi_uncor && mPhi_uncor->getRootObject()) if (mPhi_uncor) mPhi_uncor->Fill ((*pfJets)[ijet].phi());
1726  //if(!isJPTJet_){
1727  mConstituents_uncor = map_of_MEs[DirName+"/"+"Constituents_uncor"]; if (mConstituents_uncor && mConstituents_uncor->getRootObject()) if (mConstituents_uncor) mConstituents_uncor->Fill ((*pfJets)[ijet].nConstituents());
1728  //}
1729  }
1730  if(Thiscleaned && pass_corrected){
1731  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*pfJets)[ijet].chargedHadronEnergyFraction()+(*pfJets)[ijet].neutralHadronEnergyFraction()+(*pfJets)[ijet].HFHadronEnergyFraction ());
1732  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*pfJets)[ijet].chargedEmEnergyFraction() +(*pfJets)[ijet].neutralEmEnergyFraction()+(*pfJets)[ijet].HFEMEnergyFraction ());
1733  if ((*pfJets)[ijet].pt()<= 50) {
1734  mCHFracVSeta_lowPt = map_of_MEs[DirName+"/"+"CHFracVSeta_lowPt"]; if (mCHFracVSeta_lowPt && mCHFracVSeta_lowPt->getRootObject()) mCHFracVSeta_lowPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedHadronEnergyFraction());
1735  mNHFracVSeta_lowPt = map_of_MEs[DirName+"/"+"NHFracVSeta_lowPt"]; if (mNHFracVSeta_lowPt && mNHFracVSeta_lowPt->getRootObject()) mNHFracVSeta_lowPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralHadronEnergyFraction());
1736  mPhFracVSeta_lowPt = map_of_MEs[DirName+"/"+"PhFracVSeta_lowPt"]; if (mPhFracVSeta_lowPt && mPhFracVSeta_lowPt->getRootObject()) mPhFracVSeta_lowPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralEmEnergyFraction());
1737  mElFracVSeta_lowPt = map_of_MEs[DirName+"/"+"ElFracVSeta_lowPt"]; if (mElFracVSeta_lowPt && mElFracVSeta_lowPt->getRootObject()) mElFracVSeta_lowPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedEmEnergyFraction());
1738  mMuFracVSeta_lowPt = map_of_MEs[DirName+"/"+"MuFracVSeta_lowPt"]; if (mMuFracVSeta_lowPt && mMuFracVSeta_lowPt->getRootObject()) mMuFracVSeta_lowPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedMuEnergyFraction());
1739  }
1740  if ((*pfJets)[ijet].pt()>50. && (*pfJets)[ijet].pt()<=140.) {
1741  mCHFracVSeta_mediumPt = map_of_MEs[DirName+"/"+"CHFracVSeta_mediumPt"]; if (mCHFracVSeta_mediumPt && mCHFracVSeta_mediumPt->getRootObject()) mCHFracVSeta_mediumPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedHadronEnergyFraction());
1742  mNHFracVSeta_mediumPt = map_of_MEs[DirName+"/"+"NHFracVSeta_mediumPt"]; if (mNHFracVSeta_mediumPt && mNHFracVSeta_mediumPt->getRootObject()) mNHFracVSeta_mediumPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralHadronEnergyFraction());
1743  mPhFracVSeta_mediumPt = map_of_MEs[DirName+"/"+"PhFracVSeta_mediumPt"]; if (mPhFracVSeta_mediumPt && mPhFracVSeta_mediumPt->getRootObject()) mPhFracVSeta_mediumPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralEmEnergyFraction());
1744  mElFracVSeta_mediumPt = map_of_MEs[DirName+"/"+"ElFracVSeta_mediumPt"]; if (mElFracVSeta_mediumPt && mElFracVSeta_mediumPt->getRootObject()) mElFracVSeta_mediumPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedEmEnergyFraction());
1745  mMuFracVSeta_mediumPt = map_of_MEs[DirName+"/"+"MuFracVSeta_mediumPt"]; if (mMuFracVSeta_mediumPt && mMuFracVSeta_mediumPt->getRootObject()) mMuFracVSeta_mediumPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedMuEnergyFraction());
1746  }
1747  if ((*pfJets)[ijet].pt()>140.) {
1748  mCHFracVSeta_highPt = map_of_MEs[DirName+"/"+"CHFracVSeta_highPt"]; if (mCHFracVSeta_highPt && mCHFracVSeta_highPt->getRootObject()) mCHFracVSeta_highPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedHadronEnergyFraction());
1749  mNHFracVSeta_highPt = map_of_MEs[DirName+"/"+"NHFracVSeta_highPt"]; if (mNHFracVSeta_highPt && mNHFracVSeta_highPt->getRootObject()) mNHFracVSeta_highPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralHadronEnergyFraction());
1750  mPhFracVSeta_highPt = map_of_MEs[DirName+"/"+"PhFracVSeta_highPt"]; if (mPhFracVSeta_highPt && mPhFracVSeta_highPt->getRootObject()) mPhFracVSeta_highPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].neutralEmEnergyFraction());
1751  mElFracVSeta_highPt = map_of_MEs[DirName+"/"+"ElFracVSeta_highPt"]; if (mElFracVSeta_highPt && mElFracVSeta_highPt->getRootObject()) mElFracVSeta_highPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedEmEnergyFraction());
1752  mMuFracVSeta_highPt = map_of_MEs[DirName+"/"+"MuFracVSeta_highPt"]; if (mMuFracVSeta_highPt && mMuFracVSeta_highPt->getRootObject()) mMuFracVSeta_highPt->Fill((*pfJets)[ijet].eta(),(*pfJets)[ijet].chargedMuEnergyFraction());
1753  }
1754  if (fabs((*pfJets)[ijet].eta()) <= 1.3) {
1755  mHFrac_Barrel = map_of_MEs[DirName+"/"+"HFrac_Barrel"]; if (mHFrac_Barrel && mHFrac_Barrel->getRootObject()) mHFrac_Barrel->Fill((*pfJets)[ijet].chargedHadronEnergyFraction() + (*pfJets)[ijet].neutralHadronEnergyFraction() );
1756  mEFrac_Barrel = map_of_MEs[DirName+"/"+"EFrac_Barrel"]; if (mEFrac_Barrel && mEFrac_Barrel->getRootObject()) mEFrac_Barrel->Fill ((*pfJets)[ijet].chargedEmEnergyFraction() + (*pfJets)[ijet].neutralEmEnergyFraction());
1757  //fractions for barrel
1758  if ((*pfJets)[ijet].pt()<=50.) {
1759  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());
1760  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());
1761  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());
1762  mElFrac_lowPt_Barrel = map_of_MEs[DirName+"/"+"ElFrac_lowPt_Barrel"]; if (mElFrac_lowPt_Barrel && mElFrac_lowPt_Barrel->getRootObject()) mElFrac_lowPt_Barrel->Fill((*pfJets)[ijet].chargedEmEnergyFraction());
1763  mMuFrac_lowPt_Barrel = map_of_MEs[DirName+"/"+"MuFrac_lowPt_Barrel"]; if (mMuFrac_lowPt_Barrel && mMuFrac_lowPt_Barrel->getRootObject()) mMuFrac_lowPt_Barrel->Fill((*pfJets)[ijet].chargedMuEnergyFraction());
1764  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());
1765  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());
1766  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());
1767  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());
1768  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());
1769  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());
1770  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());
1771  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());
1772  }
1773  if ((*pfJets)[ijet].pt()>50. && (*pfJets)[ijet].pt()<=140.) {
1774  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());
1775  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());
1776  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());
1777  mElFrac_mediumPt_Barrel = map_of_MEs[DirName+"/"+"ElFrac_mediumPt_Barrel"]; if (mElFrac_mediumPt_Barrel && mElFrac_mediumPt_Barrel->getRootObject()) mElFrac_mediumPt_Barrel->Fill((*pfJets)[ijet].chargedEmEnergyFraction());
1778  mMuFrac_mediumPt_Barrel = map_of_MEs[DirName+"/"+"MuFrac_mediumPt_Barrel"]; if (mMuFrac_mediumPt_Barrel && mMuFrac_mediumPt_Barrel->getRootObject()) mMuFrac_mediumPt_Barrel->Fill((*pfJets)[ijet].chargedMuEnergyFraction());
1779  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());
1780  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());
1781  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());
1782  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());
1783  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());
1784  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());
1785  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());
1786  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());
1787  }
1788  if ((*pfJets)[ijet].pt()>140.) {
1789  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());
1790  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());
1791  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());
1792  mElFrac_highPt_Barrel = map_of_MEs[DirName+"/"+"ElFrac_highPt_Barrel"]; if (mElFrac_highPt_Barrel && mElFrac_highPt_Barrel->getRootObject()) mElFrac_highPt_Barrel->Fill((*pfJets)[ijet].chargedEmEnergyFraction());
1793  mMuFrac_highPt_Barrel = map_of_MEs[DirName+"/"+"MuFrac_highPt_Barrel"]; if (mMuFrac_highPt_Barrel && mMuFrac_highPt_Barrel->getRootObject()) mMuFrac_highPt_Barrel->Fill((*pfJets)[ijet].chargedMuEnergyFraction());
1794  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());
1795  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());
1796  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());
1797  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());
1798  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());
1799  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());
1800  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());
1801  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());
1802  }
1803  mCHFracVSpT_Barrel = map_of_MEs[DirName+"/"+"CHFracVSpT_Barrel"]; if(mCHFracVSpT_Barrel && mCHFracVSpT_Barrel->getRootObject()) mCHFracVSpT_Barrel->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].chargedHadronEnergyFraction());
1804  mNHFracVSpT_Barrel = map_of_MEs[DirName+"/"+"NHFracVSpT_Barrel"];if (mNHFracVSpT_Barrel && mNHFracVSpT_Barrel->getRootObject()) mNHFracVSpT_Barrel->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].neutralHadronEnergyFraction());
1805  mPhFracVSpT_Barrel = map_of_MEs[DirName+"/"+"PhFracVSpT_Barrel"];if (mPhFracVSpT_Barrel && mPhFracVSpT_Barrel->getRootObject()) mPhFracVSpT_Barrel->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].neutralEmEnergyFraction());
1806  mElFracVSpT_Barrel = map_of_MEs[DirName+"/"+"ElFracVSpT_Barrel"];if (mElFracVSpT_Barrel && mElFracVSpT_Barrel->getRootObject()) mElFracVSpT_Barrel->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].chargedEmEnergyFraction());
1807  mMuFracVSpT_Barrel = map_of_MEs[DirName+"/"+"MuFracVSpT_Barrel"];if (mMuFracVSpT_Barrel && mMuFracVSpT_Barrel->getRootObject()) mMuFracVSpT_Barrel->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].chargedMuEnergyFraction());
1808  }else if(fabs((*pfJets)[ijet].eta()) <= 3) {
1809  mHFrac_EndCap = map_of_MEs[DirName+"/"+"HFrac_EndCap"]; if (mHFrac_EndCap && mHFrac_EndCap->getRootObject()) mHFrac_EndCap->Fill((*pfJets)[ijet].chargedHadronEnergyFraction() + (*pfJets)[ijet].neutralHadronEnergyFraction()+(*pfJets)[ijet].HFHadronEnergyFraction ());
1810  mEFrac_EndCap = map_of_MEs[DirName+"/"+"EFrac_EndCap"]; if (mEFrac_EndCap && mEFrac_EndCap->getRootObject()) mEFrac_EndCap->Fill ((*pfJets)[ijet].chargedEmEnergyFraction() + (*pfJets)[ijet].neutralEmEnergyFraction()+(*pfJets)[ijet].HFEMEnergyFraction ());
1811  //fractions for endcap
1812  if ((*pfJets)[ijet].pt()<=50.) {
1813  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());
1814  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());
1815  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());
1816  mElFrac_lowPt_EndCap = map_of_MEs[DirName+"/"+"ElFrac_lowPt_EndCap"]; if (mElFrac_lowPt_EndCap && mElFrac_lowPt_EndCap->getRootObject()) mElFrac_lowPt_EndCap->Fill((*pfJets)[ijet].chargedEmEnergyFraction());
1817  mMuFrac_lowPt_EndCap = map_of_MEs[DirName+"/"+"MuFrac_lowPt_EndCap"]; if (mMuFrac_lowPt_EndCap && mMuFrac_lowPt_EndCap->getRootObject()) mMuFrac_lowPt_EndCap->Fill((*pfJets)[ijet].chargedMuEnergyFraction());
1818  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());
1819  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());
1820  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());
1821  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());
1822  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());
1823  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());
1824  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());
1825  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());
1826  }
1827  if ((*pfJets)[ijet].pt()>50. && (*pfJets)[ijet].pt()<=140.) {
1828  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());
1829  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());
1830  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());
1831  mElFrac_mediumPt_EndCap = map_of_MEs[DirName+"/"+"ElFrac_mediumPt_EndCap"]; if (mElFrac_mediumPt_EndCap && mElFrac_mediumPt_EndCap->getRootObject()) mElFrac_mediumPt_EndCap->Fill((*pfJets)[ijet].chargedEmEnergyFraction());
1832  mMuFrac_mediumPt_EndCap = map_of_MEs[DirName+"/"+"MuFrac_mediumPt_EndCap"]; if (mMuFrac_mediumPt_EndCap && mMuFrac_mediumPt_EndCap->getRootObject()) mMuFrac_mediumPt_EndCap->Fill((*pfJets)[ijet].chargedMuEnergyFraction());
1833  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());
1834  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());
1835  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());
1836  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());
1837  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());
1838  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());
1839  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());
1840  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());
1841  }
1842  if ((*pfJets)[ijet].pt()>140.) {
1843  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());
1844  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());
1845  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());
1846  mElFrac_highPt_EndCap = map_of_MEs[DirName+"/"+"ElFrac_highPt_EndCap"]; if (mElFrac_highPt_EndCap && mElFrac_highPt_EndCap->getRootObject()) mElFrac_highPt_EndCap->Fill((*pfJets)[ijet].chargedEmEnergyFraction());
1847  mMuFrac_highPt_EndCap = map_of_MEs[DirName+"/"+"MuFrac_highPt_EndCap"]; if (mMuFrac_highPt_EndCap && mMuFrac_highPt_EndCap->getRootObject()) mMuFrac_highPt_EndCap->Fill((*pfJets)[ijet].chargedMuEnergyFraction());
1848  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());
1849  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());
1850  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());
1851  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());
1852  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());
1853  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());
1854  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());
1855  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());
1856  }
1857  mCHFracVSpT_EndCap = map_of_MEs[DirName+"/"+"CHFracVSpT_EndCap"]; if(mCHFracVSpT_EndCap && mCHFracVSpT_EndCap->getRootObject()) mCHFracVSpT_EndCap->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].chargedHadronEnergyFraction());
1858  mNHFracVSpT_EndCap = map_of_MEs[DirName+"/"+"NHFracVSpT_EndCap"];if (mNHFracVSpT_EndCap && mNHFracVSpT_EndCap->getRootObject()) mNHFracVSpT_EndCap->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].neutralHadronEnergyFraction());
1859  mPhFracVSpT_EndCap = map_of_MEs[DirName+"/"+"PhFracVSpT_EndCap"];if (mPhFracVSpT_EndCap && mPhFracVSpT_EndCap->getRootObject()) mPhFracVSpT_EndCap->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].neutralEmEnergyFraction());
1860  mElFracVSpT_EndCap = map_of_MEs[DirName+"/"+"ElFracVSpT_EndCap"];if (mElFracVSpT_EndCap && mElFracVSpT_EndCap->getRootObject()) mElFracVSpT_EndCap->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].chargedEmEnergyFraction());
1861  mMuFracVSpT_EndCap = map_of_MEs[DirName+"/"+"MuFracVSpT_EndCap"];if (mMuFracVSpT_EndCap && mMuFracVSpT_EndCap->getRootObject()) mMuFracVSpT_EndCap->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].chargedMuEnergyFraction());
1862  }else{
1863  mHFrac_Forward = map_of_MEs[DirName+"/"+"HFrac_Forward"]; if (mHFrac_Forward && mHFrac_Forward->getRootObject()) mHFrac_Forward->Fill((*pfJets)[ijet].chargedHadronEnergyFraction() + (*pfJets)[ijet].neutralHadronEnergyFraction()+(*pfJets)[ijet].HFHadronEnergyFraction ());
1864  mEFrac_Forward = map_of_MEs[DirName+"/"+"EFrac_Forward"]; if (mEFrac_Forward && mEFrac_Forward->getRootObject()) mEFrac_Forward->Fill ((*pfJets)[ijet].chargedEmEnergyFraction() + (*pfJets)[ijet].neutralEmEnergyFraction()+(*pfJets)[ijet].HFEMEnergyFraction ());
1865  mHFHFracVSpT_Forward = map_of_MEs[DirName+"/"+"HFHFracVSpT_Forward"]; if (mHFHFracVSpT_Forward && mHFHFracVSpT_Forward->getRootObject()) mHFHFracVSpT_Forward->Fill((*pfJets)[ijet].pt(),(*pfJets)[ijet].chargedHadronEnergyFraction() + (*pfJets)[ijet].neutralHadronEnergyFraction()+(*pfJets)[ijet].HFHadronEnergyFraction ());
1866  mHFEFracVSpT_Forward = map_of_MEs[DirName+"/"+"HFEFracVSpT_Forward"]; if (mHFEFracVSpT_Forward && mHFEFracVSpT_Forward->getRootObject()) mHFEFracVSpT_Forward->Fill ((*pfJets)[ijet].pt(),(*pfJets)[ijet].chargedEmEnergyFraction() + (*pfJets)[ijet].neutralEmEnergyFraction()+(*pfJets)[ijet].HFEMEnergyFraction ());
1867  //fractions
1868  if ((*pfJets)[ijet].pt()<=50.) {
1869  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());
1870  mHFEFrac_lowPt_Forward = map_of_MEs[DirName+"/"+"HFEFrac_lowPt_Forward"]; if(mHFHFrac_lowPt_Forward && mHFHFrac_lowPt_Forward->getRootObject()) mHFHFrac_lowPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
1871  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());
1872  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());
1873  mChMultiplicity_lowPt_Barrel = map_of_MEs[DirName+"/"+"ChMultiplicity_lowPt_Barrel"]; if(mChMultiplicity_lowPt_Forward && mChMultiplicity_lowPt_Forward->getRootObject()) mChMultiplicity_lowPt_Forward->Fill((*pfJets)[ijet].chargedMultiplicity());
1874  mNeutMultiplicity_lowPt_Barrel = map_of_MEs[DirName+"/"+"NeutMultiplicity_lowPt_Barrel"]; if(mNeutMultiplicity_lowPt_Forward && mNeutMultiplicity_lowPt_Forward->getRootObject()) mNeutMultiplicity_lowPt_Forward->Fill((*pfJets)[ijet].neutralMultiplicity());
1875  }
1876  if ((*pfJets)[ijet].pt()>50. && (*pfJets)[ijet].pt()<=140.) {
1877  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());
1878  mHFEFrac_mediumPt_Forward = map_of_MEs[DirName+"/"+"HFEFrac_mediumPt_Forward"]; if(mHFHFrac_mediumPt_Forward && mHFHFrac_mediumPt_Forward->getRootObject()) mHFHFrac_mediumPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
1879  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());
1880  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());
1881  mChMultiplicity_mediumPt_Barrel = map_of_MEs[DirName+"/"+"ChMultiplicity_mediumPt_Barrel"]; if(mChMultiplicity_mediumPt_Forward && mChMultiplicity_mediumPt_Forward->getRootObject()) mChMultiplicity_mediumPt_Forward->Fill((*pfJets)[ijet].chargedMultiplicity());
1882  mNeutMultiplicity_mediumPt_Barrel = map_of_MEs[DirName+"/"+"NeutMultiplicity_mediumPt_Barrel"]; if(mNeutMultiplicity_mediumPt_Forward && mNeutMultiplicity_mediumPt_Forward->getRootObject()) mNeutMultiplicity_mediumPt_Forward->Fill((*pfJets)[ijet].neutralMultiplicity());
1883  }
1884  if ((*pfJets)[ijet].pt()>140.) {
1885  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());
1886  mHFEFrac_highPt_Forward = map_of_MEs[DirName+"/"+"HFEFrac_highPt_Forward"]; if(mHFHFrac_highPt_Forward && mHFHFrac_highPt_Forward->getRootObject()) mHFHFrac_highPt_Forward->Fill((*pfJets)[ijet].HFHadronEnergyFraction());
1887  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());
1888  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());
1889  mChMultiplicity_highPt_Barrel = map_of_MEs[DirName+"/"+"ChMultiplicity_highPt_Barrel"]; if(mChMultiplicity_highPt_Forward && mChMultiplicity_highPt_Forward->getRootObject()) mChMultiplicity_highPt_Forward->Fill((*pfJets)[ijet].chargedMultiplicity());
1890  mNeutMultiplicity_highPt_Barrel = map_of_MEs[DirName+"/"+"NeutMultiplicity_highPt_Barrel"]; if(mNeutMultiplicity_highPt_Forward && mNeutMultiplicity_highPt_Forward->getRootObject()) mNeutMultiplicity_highPt_Forward->Fill((*pfJets)[ijet].neutralMultiplicity());
1891  }
1892  }
1893  mChargedHadronEnergy = map_of_MEs[DirName+"/"+"ChargedHadronEnergy"]; if (mChargedHadronEnergy && mChargedHadronEnergy->getRootObject()) mChargedHadronEnergy->Fill ((*pfJets)[ijet].chargedHadronEnergy());
1894  mNeutralHadronEnergy = map_of_MEs[DirName+"/"+"NeutralHadronEnergy"]; if (mNeutralHadronEnergy && mNeutralHadronEnergy->getRootObject()) mNeutralHadronEnergy->Fill ((*pfJets)[ijet].neutralHadronEnergy());
1895  mChargedEmEnergy = map_of_MEs[DirName+"/"+"ChargedEmEnergy"]; if (mChargedEmEnergy && mChargedEmEnergy->getRootObject()) mChargedEmEnergy->Fill((*pfJets)[ijet].chargedEmEnergy());
1896  mChargedMuEnergy = map_of_MEs[DirName+"/"+"ChargedMuEnergy"]; if (mChargedMuEnergy && mChargedMuEnergy->getRootObject()) mChargedMuEnergy->Fill ((*pfJets)[ijet].chargedMuEnergy ());
1897  mNeutralEmEnergy = map_of_MEs[DirName+"/"+"NeutralEmEnergy"]; if (mNeutralEmEnergy && mNeutralEmEnergy->getRootObject()) mNeutralEmEnergy->Fill((*pfJets)[ijet].neutralEmEnergy());
1898  mChargedMultiplicity = map_of_MEs[DirName+"/"+"ChargedMultiplicity"]; if (mChargedMultiplicity && mChargedMultiplicity->getRootObject()) mChargedMultiplicity->Fill((*pfJets)[ijet].chargedMultiplicity());
1899  mNeutralMultiplicity = map_of_MEs[DirName+"/"+"NeutralMultiplicity"]; if (mNeutralMultiplicity && mNeutralMultiplicity->getRootObject()) mNeutralMultiplicity->Fill((*pfJets)[ijet].neutralMultiplicity());
1900  mMuonMultiplicity = map_of_MEs[DirName+"/"+"MuonMultiplicity"]; if (mMuonMultiplicity && mMuonMultiplicity->getRootObject()) mMuonMultiplicity->Fill ((*pfJets)[ijet]. muonMultiplicity());
1901  //_______________________________________________________
1902  mNeutralFraction = map_of_MEs[DirName+"/"+"NeutralConstituentsFraction"];if (mNeutralFraction && mNeutralFraction->getRootObject()) mNeutralFraction->Fill ((double)(*pfJets)[ijet].neutralMultiplicity()/(double)(*pfJets)[ijet].nConstituents());
1903 
1904  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*pfJets)[ijet].chargedHadronEnergyFraction() + (*pfJets)[ijet].neutralHadronEnergyFraction());
1905  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*pfJets)[ijet].chargedEmEnergyFraction() + (*pfJets)[ijet].neutralEmEnergyFraction());
1906 
1907  mChargedHadronEnergy_profile = map_of_MEs[DirName+"/"+"ChargedHadronEnergy_profile"]; if (mChargedHadronEnergy_profile && mChargedHadronEnergy_profile->getRootObject()) mChargedHadronEnergy_profile->Fill(numPV, (*pfJets)[ijet].chargedHadronEnergy());
1908  mNeutralHadronEnergy_profile = map_of_MEs[DirName+"/"+"NeutralHadronEnergy_profile"];if (mNeutralHadronEnergy_profile && mNeutralHadronEnergy_profile->getRootObject()) mNeutralHadronEnergy_profile->Fill(numPV, (*pfJets)[ijet].neutralHadronEnergy());
1909  mChargedEmEnergy_profile = map_of_MEs[DirName+"/"+"ChargedEmEnergy_profile"]; if (mChargedEmEnergy_profile && mChargedEmEnergy_profile->getRootObject()) mChargedEmEnergy_profile ->Fill(numPV, (*pfJets)[ijet].chargedEmEnergy());
1910  mChargedMuEnergy_profile = map_of_MEs[DirName+"/"+"ChargedMuEnergy_profile"];if (mChargedMuEnergy_profile && mChargedMuEnergy_profile->getRootObject()) mChargedMuEnergy_profile ->Fill(numPV, (*pfJets)[ijet].chargedMuEnergy ());
1911  mNeutralEmEnergy_profile = map_of_MEs[DirName+"/"+"NeutralEmEnergy_profile"];if (mNeutralEmEnergy_profile && mNeutralEmEnergy_profile->getRootObject()) mNeutralEmEnergy_profile ->Fill(numPV, (*pfJets)[ijet].neutralEmEnergy());
1912  mChargedMultiplicity_profile = map_of_MEs[DirName+"/"+"ChargedMultiplicity_profile"]; if (mChargedMultiplicity_profile && mChargedMultiplicity_profile->getRootObject()) mChargedMultiplicity_profile->Fill(numPV, (*pfJets)[ijet].chargedMultiplicity());
1913  mNeutralMultiplicity_profile = map_of_MEs[DirName+"/"+"NeutralMultiplicity_profile"];if (mNeutralMultiplicity_profile && mNeutralMultiplicity_profile->getRootObject()) mNeutralMultiplicity_profile->Fill(numPV, (*pfJets)[ijet].neutralMultiplicity());
1914  mMuonMultiplicity_profile = map_of_MEs[DirName+"/"+"MuonMultiplicity_profile"]; if (mMuonMultiplicity_profile && mMuonMultiplicity_profile->getRootObject()) mMuonMultiplicity_profile ->Fill(numPV, (*pfJets)[ijet].muonMultiplicity());
1915 
1916  }//cleaned PFJets
1917  }//PFJet specific loop
1918  //IDs have been defined by now
1919 
1920  //if only uncorrected jets but no corrected jets over threshold pass on
1921  if(!pass_corrected){
1922  continue;
1923  }
1924  if(correctedJet.pt()>pt1){
1925  pt3=pt2;
1926  ind3=ind2;
1927  cleaned_third_jet=cleaned_second_jet;
1928  pt2=pt1;
1929  ind2=ind1;
1930  cleaned_second_jet=cleaned_first_jet;
1931  pt1=correctedJet.pt();
1932  ind1=ijet;
1933  cleaned_first_jet=jetpassid;
1934  } else if(correctedJet.pt()>pt2){
1935  pt3=pt2;
1936  ind3=ind2;
1937  cleaned_third_jet=cleaned_second_jet;
1938  pt2=correctedJet.pt();
1939  ind2=ijet;
1940  cleaned_second_jet=jetpassid;
1941  } else if(correctedJet.pt()>pt3){
1942  pt3=correctedJet.pt();
1943  ind3=ijet;
1944  cleaned_third_jet=jetpassid;
1945  }
1946  if(cleaned_third_jet){
1947  }
1948  //after jettype specific variables are filled -> perform histograms for all jets
1949  //fill JetID efficiencies if uncleaned selection is chosen
1950  if(!jetCleaningFlag_){
1951  if(jetpassid) {
1952  mLooseJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"JetIDPassFractionVSeta"]; if (mLooseJIDPassFractionVSeta && mLooseJIDPassFractionVSeta->getRootObject()) mLooseJIDPassFractionVSeta->Fill(correctedJet.eta(),1.);
1953  mLooseJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"JetIDPassFractionVSpt"]; if (mLooseJIDPassFractionVSpt && mLooseJIDPassFractionVSpt->getRootObject()) mLooseJIDPassFractionVSpt->Fill(correctedJet.pt(),1.);
1954  if(correctedJet.eta()<3.0){
1955  mLooseJIDPassFractionVSptNoHF= map_of_MEs[DirName+"/"+"JetIDPassFractionVSptNoHF"]; if (mLooseJIDPassFractionVSptNoHF && mLooseJIDPassFractionVSptNoHF->getRootObject()) mLooseJIDPassFractionVSptNoHF->Fill(correctedJet.pt(),1.);
1956  }
1957  } else {
1958  mLooseJIDPassFractionVSeta = map_of_MEs[DirName+"/"+"JetIDPassFractionVSeta"]; if (mLooseJIDPassFractionVSeta && mLooseJIDPassFractionVSeta->getRootObject()) mLooseJIDPassFractionVSeta->Fill(correctedJet.eta(),0.);
1959  mLooseJIDPassFractionVSpt = map_of_MEs[DirName+"/"+"JetIDPassFractionVSpt"]; if (mLooseJIDPassFractionVSpt && mLooseJIDPassFractionVSpt->getRootObject()) mLooseJIDPassFractionVSpt->Fill(correctedJet.pt(),0.);
1960  if(correctedJet.eta()<3.0){
1961  mLooseJIDPassFractionVSptNoHF= map_of_MEs[DirName+"/"+"JetIDPassFractionVSptNoHF"]; if (mLooseJIDPassFractionVSptNoHF && mLooseJIDPassFractionVSptNoHF->getRootObject()) mLooseJIDPassFractionVSptNoHF->Fill(correctedJet.pt(),0.);
1962  }
1963  }
1964  }
1965  //here we so far consider calojets ->check for PFJets and JPT jets again
1966  if(Thiscleaned && pass_corrected){//might be softer than loose jet ID
1967  numofjets++;
1968 
1969  if(isCaloJet_){
1970  jetME = map_of_MEs[DirName+"/"+"jetReco"]; if(jetME && jetME->getRootObject()) jetME->Fill(1);
1971  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(correctedJet.pt()/(*caloJets)[ijet].pt());
1972  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(correctedJet.eta(),correctedJet.pt()/(*caloJets)[ijet].pt());
1973  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(correctedJet.pt(),correctedJet.pt()/(*caloJets)[ijet].pt());
1974  }
1975  if(isPFJet_){
1976  jetME = map_of_MEs[DirName+"/"+"jetReco"]; if(jetME && jetME->getRootObject()) jetME->Fill(2);
1977  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(correctedJet.pt()/(*pfJets)[ijet].pt());
1978  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject())mJetEnergyCorrVSEta->Fill(correctedJet.eta(),correctedJet.pt()/(*pfJets)[ijet].pt());
1979  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(correctedJet.pt(),correctedJet.pt()/(*pfJets)[ijet].pt());
1980  }
1981  //if(isJPTJet_){
1982  //jetME = map_of_MEs[DirName+"/"+"jetReco"]; if(jetME && jetME->getRootObject()) jetME->Fill(3);
1983  //mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(correctedJet.pt()/(*jptJets)[ijet].pt());
1984  //mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject())mJetEnergyCorrVSEta->Fill(correctedJet.eta(),correctedJet.pt()/(*jptJets)[ijet].pt());
1985  //mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(correctedJet.pt(),correctedJet.pt()/(*jptJets)[ijet].pt());
1986  //}
1987  // --- Event passed the low pt jet trigger
1988  if (jetLoPass_ == 1) {
1989  mPhi_Lo = map_of_MEs[DirName+"/"+"Phi_Lo"]; if (mPhi_Lo && mPhi_Lo->getRootObject()) mPhi_Lo->Fill (correctedJet.phi());
1990  mPt_Lo = map_of_MEs[DirName+"/"+"Pt_Lo"]; if (mPt_Lo && mPt_Lo->getRootObject()) mPt_Lo->Fill (correctedJet.pt());
1991 
1992  }
1993  // --- Event passed the high pt jet trigger
1994  if (jetHiPass_ == 1&& correctedJet.pt()>100. ) {
1995  mEta_Hi = map_of_MEs[DirName+"/"+"Eta_Hi"]; if (mEta_Hi && mEta_Hi->getRootObject()) mEta_Hi->Fill (correctedJet.eta());
1996  mPhi_Hi = map_of_MEs[DirName+"/"+"Phi_Hi"]; if (mPhi_Hi && mPhi_Hi->getRootObject()) mPhi_Hi->Fill (correctedJet.phi());
1997  mPt_Hi = map_of_MEs[DirName+"/"+"Pt_Hi"]; if (mPt_Hi && mPt_Hi->getRootObject()) mPt_Hi->Fill (correctedJet.pt());
1998  }
1999  mPt = map_of_MEs[DirName+"/"+"Pt"]; if (mPt && mPt->getRootObject()) mPt->Fill (correctedJet.pt());
2000  mPt_1 = map_of_MEs[DirName+"/"+"Pt_1"]; if (mPt_1 && mPt_1->getRootObject()) mPt_1->Fill (correctedJet.pt());
2001  mPt_2 = map_of_MEs[DirName+"/"+"Pt_2"]; if (mPt_2 && mPt_2->getRootObject()) mPt_2->Fill (correctedJet.pt());
2002  mPt_3 = map_of_MEs[DirName+"/"+"Pt_3"]; if (mPt_3 && mPt_3->getRootObject()) mPt_3->Fill (correctedJet.pt());
2003  mEta = map_of_MEs[DirName+"/"+"Eta"]; if (mEta && mEta->getRootObject()) mEta->Fill (correctedJet.eta());
2004  mPhi = map_of_MEs[DirName+"/"+"Phi"]; if (mPhi && mPhi->getRootObject()) mPhi->Fill (correctedJet.phi());
2005 
2006  mPhiVSEta = map_of_MEs[DirName+"/"+"PhiVSEta"]; if (mPhiVSEta && mPhiVSEta->getRootObject()) mPhiVSEta->Fill(correctedJet.eta(),correctedJet.phi());
2007  //if(!isJPTJet_){
2008  mConstituents = map_of_MEs[DirName+"/"+"Constituents"]; if (mConstituents && mConstituents->getRootObject()) mConstituents->Fill (correctedJet.nConstituents());
2009  //}
2010  // Fill NPV profiles
2011  //--------------------------------------------------------------------
2012  mPt_profile = map_of_MEs[DirName+"/"+"Pt_profile"]; if (mPt_profile && mPt_profile->getRootObject()) mPt_profile ->Fill(numPV, correctedJet.pt());
2013  mEta_profile = map_of_MEs[DirName+"/"+"Eta_profile"]; if (mEta_profile && mEta_profile->getRootObject()) mEta_profile ->Fill(numPV, correctedJet.eta());
2014  mPhi_profile = map_of_MEs[DirName+"/"+"Phi_profile"]; if (mPhi_profile && mPhi_profile->getRootObject()) mPhi_profile ->Fill(numPV, correctedJet.phi());
2015  //if(!isJPTJet_){
2016  mConstituents_profile = map_of_MEs[DirName+"/"+"Constituents_profile"]; if (mConstituents_profile && mConstituents_profile->getRootObject()) mConstituents_profile->Fill(numPV, correctedJet.nConstituents());
2017  //}
2018  if (fabs(correctedJet.eta()) <= 1.3) {
2019  mPt_Barrel = map_of_MEs[DirName+"/"+"Pt_Barrel"]; if (mPt_Barrel && mPt_Barrel->getRootObject()) mPt_Barrel->Fill (correctedJet.pt());
2020  mPhi_Barrel = map_of_MEs[DirName+"/"+"Phi_Barrel"]; if (mPhi_Barrel && mPhi_Barrel->getRootObject()) mPhi_Barrel->Fill (correctedJet.phi());
2021  //if (mE_Barrel) mE_Barrel->Fill (correctedJet.energy());
2022  //if(!isJPTJet_){
2023  mConstituents_Barrel = map_of_MEs[DirName+"/"+"Constituents_Barrel"]; if (mConstituents_Barrel && mConstituents_Barrel->getRootObject()) mConstituents_Barrel->Fill(correctedJet.nConstituents());
2024  //}
2025  }else if (fabs(correctedJet.eta()) <= 3) {
2026  mPt_EndCap = map_of_MEs[DirName+"/"+"Pt_EndCap"]; if (mPt_EndCap && mPt_EndCap->getRootObject()) mPt_EndCap->Fill (correctedJet.pt());
2027  mPhi_EndCap = map_of_MEs[DirName+"/"+"Phi_EndCap"]; if (mPhi_EndCap && mPhi_EndCap->getRootObject()) mPhi_EndCap->Fill (correctedJet.phi());
2028  //if (mE_EndCap) mE_EndCap->Fill (correctedJet.energy());
2029  //if(!isJPTJet_){
2030  mConstituents_EndCap = map_of_MEs[DirName+"/"+"Constituents_EndCap"]; if (mConstituents_EndCap && mConstituents_EndCap->getRootObject()) mConstituents_EndCap->Fill(correctedJet.nConstituents());
2031  //}
2032  }else{
2033  mPt_Forward = map_of_MEs[DirName+"/"+"Pt_Forward"]; if (mPt_Forward && mPt_Forward->getRootObject()) mPt_Forward->Fill (correctedJet.pt());
2034  mPhi_Forward = map_of_MEs[DirName+"/"+"Phi_Forward"]; if (mPhi_Forward && mPhi_Forward->getRootObject()) mPhi_Forward->Fill (correctedJet.phi());
2035  //if (mE_Forward) mE_Forward->Fill (correctedJet.energy());
2036  //if(!isJPTJet_){
2037  mConstituents_Forward = map_of_MEs[DirName+"/"+"Constituents_Forward"]; if (mConstituents_Forward && mConstituents_Forward->getRootObject()) mConstituents_Forward->Fill(correctedJet.nConstituents());
2038  //}
2039  }
2040  }// pass ID for corrected jets --> inclusive selection
2041  }//loop over uncorrected jets
2042 
2043 
2044  mNJets = map_of_MEs[DirName+"/"+"NJets"]; if (mNJets && mNJets->getRootObject()) mNJets->Fill (numofjets);
2045  mNJets_profile = map_of_MEs[DirName+"/"+"NJets_profile"]; if (mNJets_profile && mNJets_profile->getRootObject()) mNJets_profile->Fill(numPV, numofjets);
2046 
2047  sort(recoJets.begin(),recoJets.end(),jetSortingRule);
2048 
2049  //for non dijet selection, otherwise numofjets==0
2050  if(numofjets>0){
2051  //check ID of the leading jet
2052 
2053  if(cleaned_first_jet){
2054  mEtaFirst = map_of_MEs[DirName+"/"+"EtaFirst"]; if (mEtaFirst && mEtaFirst->getRootObject()) mEtaFirst->Fill ((recoJets)[0].eta());
2055  mPhiFirst = map_of_MEs[DirName+"/"+"PhiFirst"]; if (mPhiFirst && mPhiFirst->getRootObject()) mPhiFirst->Fill ((recoJets)[0].phi());
2056  mPtFirst = map_of_MEs[DirName+"/"+"PtFirst"]; if (mPtFirst && mPtFirst->getRootObject()) mPtFirst->Fill ((recoJets)[0].pt());
2057  //check ID of second check for DPhi plots
2058  if(numofjets>1 && cleaned_second_jet) {
2059  double dphi=fabs((recoJets)[0].phi()-(recoJets)[1].phi());
2060  if(dphi>acos(-1.)){
2061  dphi=2*acos(-1.)-dphi;
2062  }
2063  mDPhi = map_of_MEs[DirName+"/"+"DPhi"]; if (mDPhi && mDPhi->getRootObject()) mDPhi->Fill (dphi);
2064  }
2065  }
2066  //if(cleaned_second_jet && isJPTJet_){
2067  //mPtSecond = map_of_MEs[DirName+"/"+"PtSecond"]; if (mPtSecond && mPtSecond->getRootObject()) mPtSecond->Fill(recoJets[1].pt());
2068  //}
2069  //if(cleaned_third_jet && isJPTJet_){
2070  //mPtThird = map_of_MEs[DirName+"/"+"PtThird"]; if (mPtThird && mPtThird->getRootObject()) mPtThird->Fill(recoJets[2].pt());
2071  //}
2072  }
2073  //dijet selection -> recoJets are on corrected level, both jets cleaned, fill folder only for cleaned jet selection
2074  if(jetCleaningFlag_ && recoJets.size()>1 && cleaned_first_jet && cleaned_second_jet ){
2075  //pt threshold checked before filling
2076  if(jetCleaningFlag_){
2077  DirName = "JetMET/Jet/Cleaned"+mInputCollection_.label()+"/DiJet";
2078  }
2079 
2080  //if(fabs(recoJets[0].eta())<3. && fabs(recoJets[1].eta())<3. ){
2081  //calculate dphi
2082  double dphi=fabs((recoJets)[0].phi()-(recoJets)[1].phi());
2083  if(dphi>acos(-1.)){
2084  dphi=2*acos(-1.)-dphi;
2085  }
2086  mDPhi = map_of_MEs[DirName+"/"+"DPhi"]; if (mDPhi && mDPhi->getRootObject()) if (mDPhi) mDPhi->Fill (dphi);
2087  //dphi cut
2088  if(fabs(dphi)>2.1){
2089  if(isCaloJet_){
2090  if(!runcosmics_){
2091  reco::CaloJetRef calojetref1(caloJets, ind1);
2092  reco::JetID jetID1 = (*jetID_ValueMap_Handle)[calojetref1];
2093  reco::CaloJetRef calojetref2(caloJets, ind2);
2094  reco::JetID jetID2 = (*jetID_ValueMap_Handle)[calojetref2];
2095  mN90Hits = map_of_MEs[DirName+"/"+"N90Hits"]; if (mN90Hits && mN90Hits->getRootObject()) mN90Hits->Fill (jetID1.n90Hits);
2096  mfHPD = map_of_MEs[DirName+"/"+"fHPD"]; if (mfHPD && mfHPD->getRootObject()) mfHPD->Fill (jetID1.fHPD);
2097  mresEMF = map_of_MEs[DirName+"/"+"resEMF"]; if (mresEMF && mresEMF->getRootObject()) mresEMF->Fill (jetID1.restrictedEMF);
2098  mfRBX = map_of_MEs[DirName+"/"+"fRBX"]; if (mfRBX && mfRBX->getRootObject()) mfRBX->Fill (jetID1.fRBX);
2099  mN90Hits = map_of_MEs[DirName+"/"+"N90Hits"]; if (mN90Hits && mN90Hits->getRootObject()) mN90Hits->Fill (jetID2.n90Hits);
2100  mfHPD = map_of_MEs[DirName+"/"+"fHPD"]; if (mfHPD && mfHPD->getRootObject()) mfHPD->Fill (jetID2.fHPD);
2101  mresEMF = map_of_MEs[DirName+"/"+"resEMF"]; if (mresEMF && mresEMF->getRootObject()) mresEMF->Fill (jetID2.restrictedEMF);
2102  mfRBX = map_of_MEs[DirName+"/"+"fRBX"]; if (mfRBX && mfRBX->getRootObject()) mfRBX->Fill (jetID2.fRBX);
2103  }
2104  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*caloJets)[ind1].energyFractionHadronic());
2105  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*caloJets)[ind1].emEnergyFraction());
2106  mMaxEInEmTowers = map_of_MEs[DirName+"/"+"MaxEInEmTowers"]; if (mMaxEInEmTowers && mMaxEInEmTowers->getRootObject()) mMaxEInEmTowers->Fill ((*caloJets)[ind1].maxEInEmTowers());
2107  mMaxEInHadTowers = map_of_MEs[DirName+"/"+"MaxEInHadTowers"]; if (mMaxEInHadTowers && mMaxEInHadTowers->getRootObject()) mMaxEInHadTowers->Fill ((*caloJets)[ind1].maxEInHadTowers());
2108  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*caloJets)[ind2].energyFractionHadronic());
2109  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*caloJets)[ind2].emEnergyFraction());
2110  mMaxEInEmTowers = map_of_MEs[DirName+"/"+"MaxEInEmTowers"]; if (mMaxEInEmTowers && mMaxEInEmTowers->getRootObject()) mMaxEInEmTowers->Fill ((*caloJets)[ind2].maxEInEmTowers());
2111  mMaxEInHadTowers = map_of_MEs[DirName+"/"+"MaxEInHadTowers"]; if (mMaxEInHadTowers && mMaxEInHadTowers->getRootObject()) mMaxEInHadTowers->Fill ((*caloJets)[ind2].maxEInHadTowers());
2112  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*caloJets)[ind1].energyFractionHadronic());
2113  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*caloJets)[ind1].emEnergyFraction());
2114  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*caloJets)[ind2].energyFractionHadronic());
2115  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*caloJets)[ind2].emEnergyFraction());
2116 
2117  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[0].pt()/(*caloJets)[ind1].pt());
2118  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[0].eta(),recoJets[0].pt()/(*caloJets)[ind1].pt());
2119  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[0].pt(),recoJets[0].pt()/(*caloJets)[ind1].pt());
2120  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[1].pt()/(*caloJets)[ind2].pt());
2121  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[1].eta(),recoJets[1].pt()/(*caloJets)[ind2].pt());
2122  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[1].pt(),recoJets[1].pt()/(*caloJets)[ind2].pt());
2123  }
2124  //if(isJPTJet_){
2125  //mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*jptJets)[ind1].chargedHadronEnergyFraction()+(*jptJets)[ind1].neutralHadronEnergyFraction());
2126  //mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill (1.-(*jptJets)[ind1].chargedHadronEnergyFraction()-(*jptJets)[ind1].neutralHadronEnergyFraction());
2127  //mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; mHFrac_profile ->Fill(numPV, (*jptJets)[ind1].chargedHadronEnergyFraction()+(*jptJets)[ind1].neutralHadronEnergyFraction());
2128  //mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; mEFrac_profile ->Fill(numPV, 1.-(*jptJets)[ind1].chargedHadronEnergyFraction()-(*jptJets)[ind1].neutralHadronEnergyFraction());
2129  //mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*jptJets)[ind2].chargedHadronEnergyFraction()+(*jptJets)[ind2].neutralHadronEnergyFraction());
2130  //mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill (1.-(*jptJets)[ind2].chargedHadronEnergyFraction()-(*jptJets)[ind2].neutralHadronEnergyFraction());
2131  //mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; mHFrac_profile ->Fill(numPV, (*jptJets)[ind2].chargedHadronEnergyFraction()+(*jptJets)[ind2].neutralHadronEnergyFraction());
2132  //mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; mEFrac_profile ->Fill(numPV, 1.-(*jptJets)[ind2].chargedHadronEnergyFraction()-(*jptJets)[ind2].neutralHadronEnergyFraction());
2133  //
2134  //mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[0].pt()/(*jptJets)[ind1].pt());
2135  //mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[0].eta(),recoJets[0].pt()/(*jptJets)[ind1].pt());
2136  //mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[0].pt(),recoJets[0].pt()/(*jptJets)[ind1].pt());
2137  //mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[1].pt()/(*jptJets)[ind2].pt());
2138  //mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[1].eta(),recoJets[1].pt()/(*jptJets)[ind2].pt());
2139  //mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[1].pt(),recoJets[1].pt()/(*jptJets)[ind2].pt());
2140  //}
2141  if(isPFJet_){
2142  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*pfJets)[ind1].chargedHadronEnergyFraction()+(*pfJets)[ind1].neutralHadronEnergyFraction()+(*pfJets)[ind1].HFHadronEnergyFraction());
2143  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*pfJets)[ind1].chargedEmEnergyFraction() +(*pfJets)[ind1].neutralEmEnergyFraction()+(*pfJets)[ind1].HFEMEnergyFraction());
2144 
2145  mCHFrac = map_of_MEs[DirName+"/"+"CHFrac"]; if (mCHFrac && mCHFrac->getRootObject()) mCHFrac ->Fill((*pfJets)[ind1].chargedHadronEnergyFraction());
2146  mNHFrac = map_of_MEs[DirName+"/"+"NHFrac"]; if (mNHFrac && mNHFrac->getRootObject()) mNHFrac ->Fill((*pfJets)[ind1].neutralHadronEnergyFraction());
2147  mPhFrac = map_of_MEs[DirName+"/"+"PhFrac"]; if (mPhFrac && mPhFrac->getRootObject()) mPhFrac ->Fill((*pfJets)[ind1].neutralEmEnergyFraction());
2148  mElFrac = map_of_MEs[DirName+"/"+"ElFrac"]; if (mElFrac && mElFrac->getRootObject()) mElFrac ->Fill((*pfJets)[ind1].chargedEmEnergyFraction());
2149  mMuFrac = map_of_MEs[DirName+"/"+"MuFrac"]; if (mMuFrac && mMuFrac->getRootObject()) mMuFrac ->Fill((*pfJets)[ind1].chargedMuEnergyFraction());
2150  mHFEMFrac = map_of_MEs[DirName+"/"+"HFEMFrac"]; if (mHFEMFrac && mHFEMFrac->getRootObject()) mHFEMFrac ->Fill((*pfJets)[ind1].HFEMEnergyFraction());
2151  mHFHFrac = map_of_MEs[DirName+"/"+"HFHFrac"]; if (mHFHFrac && mHFHFrac->getRootObject()) mHFHFrac ->Fill((*pfJets)[ind1].HFHadronEnergyFraction());
2152 
2153  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[0].pt()/(*pfJets)[ind1].pt());
2154  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[0].eta(),recoJets[0].pt()/(*pfJets)[ind1].pt());
2155  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[0].pt(),recoJets[0].pt()/(*pfJets)[ind1].pt());
2156  mJetEnergyCorr = map_of_MEs[DirName+"/"+"JetEnergyCorr"]; if(mJetEnergyCorr && mJetEnergyCorr->getRootObject()) mJetEnergyCorr->Fill(recoJets[1].pt()/(*pfJets)[ind2].pt());
2157  mJetEnergyCorrVSEta = map_of_MEs[DirName+"/"+"JetEnergyCorrVSEta"]; if(mJetEnergyCorrVSEta && mJetEnergyCorrVSEta->getRootObject()) mJetEnergyCorrVSEta->Fill(recoJets[1].eta(),recoJets[1].pt()/(*pfJets)[ind2].pt());
2158  mJetEnergyCorrVSPt = map_of_MEs[DirName+"/"+"JetEnergyCorrVSPt"]; if(mJetEnergyCorrVSPt && mJetEnergyCorrVSPt->getRootObject()) mJetEnergyCorrVSPt->Fill(recoJets[1].pt(),recoJets[1].pt()/(*pfJets)[ind2].pt());
2159 
2160  mChargedMultiplicity = map_of_MEs[DirName+"/"+"ChargedMultiplicity"]; if(mChargedMultiplicity && mChargedMultiplicity->getRootObject()) mChargedMultiplicity->Fill((*pfJets)[ind1].chargedMultiplicity());
2161  mNeutralMultiplicity = map_of_MEs[DirName+"/"+"NeutralMultiplicity"]; if(mNeutralMultiplicity && mNeutralMultiplicity->getRootObject()) mNeutralMultiplicity->Fill((*pfJets)[ind1].neutralMultiplicity());
2162  mMuonMultiplicity = map_of_MEs[DirName+"/"+"MuonMultiplicity"]; if(mMuonMultiplicity && mMuonMultiplicity->getRootObject()) mMuonMultiplicity->Fill((*pfJets)[ind1].muonMultiplicity());
2163  //Filling variables for second jet
2164  mHFrac = map_of_MEs[DirName+"/"+"HFrac"]; if (mHFrac && mHFrac->getRootObject()) mHFrac->Fill ((*pfJets)[ind2].chargedHadronEnergyFraction()+(*pfJets)[ind2].neutralHadronEnergyFraction()+(*pfJets)[ind2].HFHadronEnergyFraction());
2165  mEFrac = map_of_MEs[DirName+"/"+"EFrac"]; if (mEFrac && mHFrac->getRootObject()) mEFrac->Fill ((*pfJets)[ind2].chargedEmEnergyFraction() +(*pfJets)[ind2].neutralEmEnergyFraction()+(*pfJets)[ind2].HFEMEnergyFraction());
2166 
2167  mCHFrac = map_of_MEs[DirName+"/"+"CHFrac"]; if (mCHFrac && mCHFrac->getRootObject()) mCHFrac ->Fill((*pfJets)[ind2].chargedHadronEnergyFraction());
2168  mNHFrac = map_of_MEs[DirName+"/"+"NHFrac"]; if (mNHFrac && mNHFrac->getRootObject()) mNHFrac ->Fill((*pfJets)[ind2].neutralHadronEnergyFraction());
2169  mPhFrac = map_of_MEs[DirName+"/"+"PhFrac"]; if (mPhFrac && mPhFrac->getRootObject()) mPhFrac ->Fill((*pfJets)[ind2].neutralEmEnergyFraction());
2170  mElFrac = map_of_MEs[DirName+"/"+"ElFrac"]; if (mElFrac && mElFrac->getRootObject()) mElFrac ->Fill((*pfJets)[ind2].chargedEmEnergyFraction());
2171  mMuFrac = map_of_MEs[DirName+"/"+"MuFrac"]; if (mMuFrac && mMuFrac->getRootObject()) mMuFrac ->Fill((*pfJets)[ind2].chargedMuEnergyFraction());
2172  mHFEMFrac = map_of_MEs[DirName+"/"+"HFEMFrac"]; if (mHFEMFrac && mHFEMFrac->getRootObject()) mHFEMFrac ->Fill((*pfJets)[ind2].HFEMEnergyFraction());
2173  mHFHFrac = map_of_MEs[DirName+"/"+"HFHFrac"]; if (mHFHFrac && mHFHFrac->getRootObject()) mHFHFrac ->Fill((*pfJets)[ind2].HFHadronEnergyFraction());
2174 
2175  mNeutralFraction = map_of_MEs[DirName+"/"+"NeutralConstituentsFraction"];if (mNeutralFraction && mNeutralFraction->getRootObject()) mNeutralFraction->Fill ((double)(*pfJets)[ind1].neutralMultiplicity()/(double)(*pfJets)[ind1].nConstituents());
2176 
2177  mChargedMultiplicity = map_of_MEs[DirName+"/"+"ChargedMultiplicity"]; if(mChargedMultiplicity && mChargedMultiplicity->getRootObject()) mChargedMultiplicity->Fill((*pfJets)[ind2].chargedMultiplicity());
2178  mNeutralMultiplicity = map_of_MEs[DirName+"/"+"NeutralMultiplicity"]; if(mNeutralMultiplicity && mNeutralMultiplicity->getRootObject()) mNeutralMultiplicity->Fill((*pfJets)[ind2].neutralMultiplicity());
2179  mMuonMultiplicity = map_of_MEs[DirName+"/"+"MuonMultiplicity"]; if(mMuonMultiplicity && mMuonMultiplicity->getRootObject()) mMuonMultiplicity->Fill((*pfJets)[ind2].muonMultiplicity());
2180 
2181  //now fill PFJet profiles for leading jet
2182  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*pfJets)[ind1].chargedHadronEnergyFraction() + (*pfJets)[ind1].neutralHadronEnergyFraction());
2183  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*pfJets)[ind1].chargedEmEnergyFraction() + (*pfJets)[ind1].neutralEmEnergyFraction());
2184  mCHFrac_profile = map_of_MEs[DirName+"/"+"CHFrac_profile"]; if (mCHFrac_profile && mCHFrac_profile->getRootObject()) mCHFrac_profile ->Fill(numPV, (*pfJets)[ind1].chargedHadronEnergyFraction());
2185  mNHFrac_profile = map_of_MEs[DirName+"/"+"NHFrac_profile"]; if (mNHFrac_profile && mNHFrac_profile->getRootObject()) mNHFrac_profile ->Fill(numPV, (*pfJets)[ind1].neutralHadronEnergyFraction());
2186  mPhFrac_profile = map_of_MEs[DirName+"/"+"PhFrac_profile"]; if (mPhFrac_profile && mPhFrac_profile->getRootObject()) mPhFrac_profile ->Fill(numPV, (*pfJets)[ind1].neutralEmEnergyFraction());
2187  mElFrac_profile = map_of_MEs[DirName+"/"+"ElFrac_profile"]; if (mElFrac_profile && mElFrac_profile->getRootObject()) mElFrac_profile ->Fill(numPV, (*pfJets)[ind1].chargedEmEnergyFraction());
2188  mMuFrac_profile = map_of_MEs[DirName+"/"+"MuFrac_profile"]; if (mMuFrac_profile && mMuFrac_profile->getRootObject()) mMuFrac_profile ->Fill(numPV, (*pfJets)[ind1].chargedMuEnergyFraction());
2189  mHFEMFrac_profile = map_of_MEs[DirName+"/"+"HFEMFrac_profile"]; if (mHFEMFrac_profile && mHFEMFrac_profile->getRootObject()) mHFEMFrac_profile ->Fill(numPV, (*pfJets)[ind1].HFEMEnergyFraction());
2190  mHFHFrac_profile = map_of_MEs[DirName+"/"+"HFHFrac_profile"]; if (mHFHFrac_profile && mHFHFrac_profile->getRootObject()) mHFHFrac_profile ->Fill(numPV, (*pfJets)[ind1].HFHadronEnergyFraction());
2191 
2192  mNeutralFraction = map_of_MEs[DirName+"/"+"NeutralConstituentsFraction"];if (mNeutralFraction && mNeutralFraction->getRootObject()) mNeutralFraction->Fill ((double)(*pfJets)[ind2].neutralMultiplicity()/(double)(*pfJets)[ind2].nConstituents());
2193 
2194  mChargedMultiplicity_profile = map_of_MEs[DirName+"/"+"ChargedMultiplicity_profile"]; if(mChargedMultiplicity_profile && mChargedMultiplicity_profile->getRootObject()) mChargedMultiplicity_profile->Fill(numPV, (*pfJets)[ind1].chargedMultiplicity());
2195  mNeutralMultiplicity_profile = map_of_MEs[DirName+"/"+"NeutralMultiplicity_profile"]; if(mNeutralMultiplicity_profile && mNeutralMultiplicity_profile->getRootObject()) mNeutralMultiplicity_profile->Fill(numPV, (*pfJets)[ind1].neutralMultiplicity());
2196  mMuonMultiplicity_profile = map_of_MEs[DirName+"/"+"MuonMultiplicity_profile"]; if(mMuonMultiplicity_profile && mMuonMultiplicity_profile->getRootObject()) mMuonMultiplicity->Fill(numPV, (*pfJets)[ind1].muonMultiplicity());
2197  //now fill PFJet profiles for second leading jet
2198  mHFrac_profile = map_of_MEs[DirName+"/"+"HFrac_profile"]; if (mHFrac_profile && mHFrac_profile->getRootObject()) mHFrac_profile ->Fill(numPV, (*pfJets)[ind2].chargedHadronEnergyFraction() + (*pfJets)[ind1].neutralHadronEnergyFraction());
2199  mEFrac_profile = map_of_MEs[DirName+"/"+"EFrac_profile"]; if (mEFrac_profile && mEFrac_profile->getRootObject()) mEFrac_profile ->Fill(numPV, (*pfJets)[ind2].chargedEmEnergyFraction() + (*pfJets)[ind1].neutralEmEnergyFraction());
2200  mCHFrac_profile = map_of_MEs[DirName+"/"+"CHFrac_profile"]; if (mCHFrac_profile && mCHFrac_profile->getRootObject()) mCHFrac_profile ->Fill(numPV, (*pfJets)[ind2].chargedHadronEnergyFraction());
2201  mNHFrac_profile = map_of_MEs[DirName+"/"+"NHFrac_profile"]; if (mNHFrac_profile && mNHFrac_profile->getRootObject()) mNHFrac_profile ->Fill(numPV, (*pfJets)[ind2].neutralHadronEnergyFraction());
2202  mPhFrac_profile = map_of_MEs[DirName+"/"+"PhFrac_profile"]; if (mPhFrac_profile && mPhFrac_profile->getRootObject()) mPhFrac_profile ->Fill(numPV, (*pfJets)[ind2].neutralEmEnergyFraction());
2203  mElFrac_profile = map_of_MEs[DirName+"/"+"ElFrac_profile"]; if (mElFrac_profile && mElFrac_profile->getRootObject()) mElFrac_profile ->Fill(numPV, (*pfJets)[ind2].chargedEmEnergyFraction());
2204  mMuFrac_profile = map_of_MEs[DirName+"/"+"MuFrac_profile"]; if (mMuFrac_profile && mMuFrac_profile->getRootObject()) mMuFrac_profile ->Fill(numPV, (*pfJets)[ind2].chargedMuEnergyFraction());
2205  mHFEMFrac_profile = map_of_MEs[DirName+"/"+"HFEMFrac_profile"]; if (mHFEMFrac_profile && mHFEMFrac_profile->getRootObject()) mHFEMFrac_profile ->Fill(numPV, (*pfJets)[ind2].HFEMEnergyFraction());
2206  mHFHFrac_profile = map_of_MEs[DirName+"/"+"HFHFrac_profile"]; if (mHFHFrac_profile && mHFHFrac_profile->getRootObject()) mHFHFrac_profile ->Fill(numPV, (*pfJets)[ind2].HFHadronEnergyFraction());
2207 
2208  mChargedMultiplicity_profile = map_of_MEs[DirName+"/"+"ChargedMultiplicity_profile"]; if(mChargedMultiplicity_profile && mChargedMultiplicity_profile->getRootObject()) mChargedMultiplicity_profile->Fill(numPV, (*pfJets)[ind2].chargedMultiplicity());
2209  mNeutralMultiplicity_profile = map_of_MEs[DirName+"/"+"NeutralMultiplicity_profile"]; if(mNeutralMultiplicity_profile && mNeutralMultiplicity_profile->getRootObject()) mNeutralMultiplicity_profile->Fill(numPV, (*pfJets)[ind2].neutralMultiplicity());
2210  mMuonMultiplicity_profile = map_of_MEs[DirName+"/"+"MuonMultiplicity_profile"]; if(mMuonMultiplicity_profile && mMuonMultiplicity_profile->getRootObject()) mMuonMultiplicity_profile->Fill(numPV, (*pfJets)[ind2].muonMultiplicity());
2211  }
2212  //fill histos for first jet
2213  mPt = map_of_MEs[DirName+"/"+"Pt"]; if (mPt && mPt->getRootObject()) mPt->Fill (recoJets[0].pt());
2214  mEta = map_of_MEs[DirName+"/"+"Eta"]; if (mEta && mEta->getRootObject()) mEta->Fill (recoJets[0].eta());
2215  mPhi = map_of_MEs[DirName+"/"+"Phi"]; if (mPhi && mPhi->getRootObject()) mPhi->Fill (recoJets[0].phi());
2216  mPhiVSEta = map_of_MEs[DirName+"/"+"PhiVSEta"]; if (mPhiVSEta && mPhiVSEta->getRootObject()) mPhiVSEta->Fill(recoJets[0].eta(),recoJets[0].phi());
2217  //if(!isJPTJet_){
2218  mConstituents = map_of_MEs[DirName+"/"+"Constituents"]; if (mConstituents && mConstituents->getRootObject()) mConstituents->Fill (recoJets[0].nConstituents());
2219  //}
2220  mPt = map_of_MEs[DirName+"/"+"Pt"]; if (mPt && mPt->getRootObject()) mPt->Fill (recoJets[1].pt());
2221  mEta = map_of_MEs[DirName+"/"+"Eta"]; if (mEta && mEta->getRootObject()) mEta->Fill (recoJets[1].eta());
2222  mPhi = map_of_MEs[DirName+"/"+"Phi"]; if (mPhi && mPhi->getRootObject()) mPhi->Fill (recoJets[1].phi());
2223  mPhiVSEta = map_of_MEs[DirName+"/"+"PhiVSEta"]; if (mPhiVSEta && mPhiVSEta->getRootObject()) mPhiVSEta->Fill(recoJets[1].eta(),recoJets[1].phi());
2224  //if(!isJPTJet_){
2225  mConstituents = map_of_MEs[DirName+"/"+"Constituents"]; if (mConstituents && mConstituents->getRootObject()) mConstituents->Fill (recoJets[1].nConstituents());
2226  //}
2227  //PV profiles
2228  mPt_profile = map_of_MEs[DirName+"/"+"Pt_profile"]; if (mPt_profile && mPt_profile->getRootObject()) mPt_profile ->Fill(numPV, recoJets[0].pt());
2229  mEta_profile = map_of_MEs[DirName+"/"+"Eta_profile"]; if (mEta_profile && mEta_profile->getRootObject()) mEta_profile ->Fill(numPV, recoJets[0].eta());
2230  mPhi_profile = map_of_MEs[DirName+"/"+"Phi_profile"]; if (mPhi_profile && mPhi_profile->getRootObject()) mPhi_profile ->Fill(numPV, recoJets[0].phi());
2231  //if(!isJPTJet_){
2232  mConstituents_profile = map_of_MEs[DirName+"/"+"Constituents_profile"]; if (mConstituents_profile && mConstituents_profile->getRootObject()) mConstituents_profile->Fill(numPV, recoJets[0].nConstituents());
2233  //}
2234  mPt_profile = map_of_MEs[DirName+"/"+"Pt_profile"]; if (mPt_profile && mPt_profile->getRootObject()) mPt_profile ->Fill(numPV, recoJets[1].pt());
2235  mEta_profile = map_of_MEs[DirName+"/"+"Eta_profile"]; if (mEta_profile && mEta_profile->getRootObject()) mEta_profile ->Fill(numPV, recoJets[1].eta());
2236  mPhi_profile = map_of_MEs[DirName+"/"+"Phi_profile"]; if (mPhi_profile && mPhi_profile->getRootObject()) mPhi_profile ->Fill(numPV, recoJets[1].phi());
2237  //if(!isJPTJet_){
2238  mConstituents_profile = map_of_MEs[DirName+"/"+"Constituents_profile"]; if (mConstituents_profile && mConstituents_profile->getRootObject()) mConstituents_profile->Fill(numPV, recoJets[1].nConstituents());
2239  //}
2240  if (fabs(recoJets[0].eta() < 1.4)) {
2241  double pt_dijet = (recoJets[0].pt() + recoJets[1].pt())/2;
2242  if (dphi > 2.7) {//cut even toughter on dijet balance
2243  double pt_probe;
2244  double pt_barrel;
2245  int jet1, jet2;
2246  //int randJet = rand() % 2;
2247  int randJet =iEvent.id().event()%2;
2248  if (fabs(recoJets[1].eta() < 1.4)) {
2249  if (randJet) {
2250  jet1 = 0;
2251  jet2 = 1;
2252  }
2253  else {
2254  jet1 = 1;
2255  jet2 = 0;
2256  }
2257  // ***Di-Jet Asymmetry****
2258  // * leading jets eta < 1.4
2259  // * leading jets dphi > 2.7
2260  // * pt_third jet < threshold
2261  // * A = (pt_1 - pt_2)/(pt_1 + pt_2)
2262  // * jets 1 and two are randomly ordered
2263  // **
2264  bool thirdJetCut = true;
2265  //that doesn't make any sense -> imagine you have 5 jets,
2266  //jet 3 is quite hard (almost as hard as the second jet, i.e. 200/80/79/20/15, cutoff is 30
2267  //the 4th and 5th jet are soft enough -> then you would fill the asymmetry twice,
2268  //although jet 2 and 3 are basically identical
2269  //do third jet relative to second jet
2270  //JME-10-014 suggests pt3/pt_dijet<0.15
2271  if(ind3>0){
2272  if (pt3 > asymmetryThirdJetCut_){
2273  thirdJetCut=false;
2274  }
2275  }
2276  if(thirdJetCut){
2277  double dijetAsymmetry =(recoJets[jet1].pt() - recoJets[jet2].pt()) / (recoJets[jet1].pt() + recoJets[jet2].pt());
2278  mDijetAsymmetry = map_of_MEs[DirName+"/"+"DijetAsymmetry"]; if (mDijetAsymmetry && mDijetAsymmetry->getRootObject()) mDijetAsymmetry->Fill(dijetAsymmetry);
2279  }// end restriction on third jet pt in asymmetry calculation
2280 
2281  }
2282  else {
2283  jet1 = 0;
2284  jet2 = 1;
2285  }
2286 
2287  pt_barrel = recoJets[jet1].pt();
2288  pt_probe = recoJets[jet2].pt();
2289 
2290  //dijet balance cuts
2291  // ***Di-Jet Balance****
2292  // * pt_dijet = (pt_probe+pt_barrel)/2
2293  // * leading jets dphi > 2.7
2294  // * reject evnets where pt_third/pt_dijet > 0.2
2295  // * pv selection
2296  // * B = (pt_probe - pt_barrel)/pt_dijet
2297  // * select probe randomly from 2 jets if both leading jets are in the barrel
2298  bool thirdJetCut = true;
2299  if(ind3>0){
2300  if (pt3/pt_dijet > balanceThirdJetCut_){
2301  thirdJetCut = false;
2302  }
2303  }
2304  if (thirdJetCut) {
2305  double dijetBalance = (pt_probe - pt_barrel) / pt_dijet;
2306  mDijetBalance = map_of_MEs[DirName+"/"+"DijetBalance"]; if (mDijetBalance && mDijetBalance->getRootObject()) mDijetBalance->Fill(dijetBalance);
2307  }// end restriction on third jet pt ratio in balance calculation
2308 
2309  }// dPhi > 2.7 for dijetbalance and asymmetrie
2310  }//leading jet in barrel
2311  }//DPhi cut of 2.1
2312  }//dijet selection, check if both leading jets are IDed
2313 
2314 }
2315 
2316 
2317 //namespace jetAnalysis {
2318 //
2319 // TrackPropagatorToCalo::TrackPropagatorToCalo()
2320 // : magneticField_(NULL),
2321 // propagator_(NULL),
2322 // magneticFieldCacheId_(0),
2323 // propagatorCacheId_(0)
2324 // {}
2325 //
2326 // void TrackPropagatorToCalo::update(const edm::EventSetup& eventSetup)
2327 // {
2328 // //update magnetic filed if necessary
2329 // const IdealMagneticFieldRecord& magneticFieldRecord = eventSetup.get<IdealMagneticFieldRecord>();
2330 // const uint32_t newMagneticFieldCacheId = magneticFieldRecord.cacheIdentifier();
2331 // if ((newMagneticFieldCacheId != magneticFieldCacheId_) || !magneticField_) {
2332 // edm::ESHandle<MagneticField> magneticFieldHandle;
2333 // magneticFieldRecord.get(magneticFieldHandle);
2334 // magneticField_ = magneticFieldHandle.product();
2335 // magneticFieldCacheId_ = newMagneticFieldCacheId;
2336 // }
2337  //update propagator if necessary
2338 // const TrackingComponentsRecord& trackingComponentsRecord = eventSetup.get<TrackingComponentsRecord>();
2339 // const uint32_t newPropagatorCacheId = trackingComponentsRecord.cacheIdentifier();
2340 // if ((propagatorCacheId_ != newPropagatorCacheId) || !propagator_) {
2341 // edm::ESHandle<Propagator> propagatorHandle;
2342 // trackingComponentsRecord.get("SteppingHelixPropagatorAlong",propagatorHandle);
2343 // propagator_ = propagatorHandle.product();
2344 // propagatorCacheId_ = newPropagatorCacheId;
2345 // }
2346 //}
2347 
2348 //inline math::XYZPoint TrackPropagatorToCalo::impactPoint(const reco::Track& track) const
2349 //{
2350 // return JetTracksAssociationDRCalo::propagateTrackToCalorimeter(track,*magneticField_,*propagator_);
2351 //}
2352  /*
2353  StripSignalOverNoiseCalculator::StripSignalOverNoiseCalculator(const std::string& theQualityLabel)
2354  : qualityLabel_(theQualityLabel),
2355  quality_(NULL),
2356  noise_(NULL),
2357  gain_(NULL),
2358  qualityCacheId_(0),
2359  noiseCacheId_(0),
2360  gainCacheId_(0)
2361  {}
2362 
2363  void StripSignalOverNoiseCalculator::update(const edm::EventSetup& eventSetup)
2364  {
2365  //update the quality if necessary
2366  const SiStripQualityRcd& qualityRecord = eventSetup.get<SiStripQualityRcd>();
2367  const uint32_t newQualityCacheId = qualityRecord.cacheIdentifier();
2368  if ((newQualityCacheId != qualityCacheId_) || !quality_) {
2369  edm::ESHandle<SiStripQuality> qualityHandle;
2370  qualityRecord.get(qualityLabel_,qualityHandle);
2371  quality_ = qualityHandle.product();
2372  qualityCacheId_ = newQualityCacheId;
2373  }
2374  //update the noise if necessary
2375  const SiStripNoisesRcd& noiseRecord = eventSetup.get<SiStripNoisesRcd>();
2376  const uint32_t newNoiseCacheId = noiseRecord.cacheIdentifier();
2377  if ((newNoiseCacheId != noiseCacheId_) || !noise_) {
2378  edm::ESHandle<SiStripNoises> noiseHandle;
2379  noiseRecord.get(noiseHandle);
2380  noise_ = noiseHandle.product();
2381  noiseCacheId_ = newNoiseCacheId;
2382  }
2383  //update the gain if necessary
2384  const SiStripGainRcd& gainRecord = eventSetup.get<SiStripGainRcd>();
2385  const uint32_t newGainCacheId = gainRecord.cacheIdentifier();
2386  if ((newGainCacheId != gainCacheId_) || !gain_) {
2387  edm::ESHandle<SiStripGain> gainHandle;
2388  gainRecord.get(gainHandle);
2389  gain_ = gainHandle.product();
2390  gainCacheId_ = newGainCacheId;
2391  }
2392  }*/
2393  /*
2394  double StripSignalOverNoiseCalculator::signalOverNoise(const SiStripCluster& cluster,
2395  const uint32_t& detId) const
2396  {
2397  //const uint32_t detId = cluster.geographicalId();
2398 
2399  const uint16_t firstStrip = cluster.firstStrip();
2400  const SiStripQuality::Range& qualityRange = quality_->getRange(detId);
2401  const SiStripNoises::Range& noiseRange = noise_->getRange(detId);
2402  const SiStripApvGain::Range& gainRange = gain_->getRange(detId);
2403  double signal = 0;
2404  double noise2 = 0;
2405  unsigned int nNonZeroStrips = 0;
2406  const std::vector<uint8_t>& clusterAmplitudes = cluster.amplitudes();
2407  const std::vector<uint8_t>::const_iterator clusterAmplitudesEnd = clusterAmplitudes.end();
2408  const std::vector<uint8_t>::const_iterator clusterAmplitudesBegin = clusterAmplitudes.begin();
2409  for (std::vector<uint8_t>::const_iterator iAmp = clusterAmplitudesBegin; iAmp != clusterAmplitudesEnd; ++iAmp) {
2410  const uint8_t adc = *iAmp;
2411  const uint16_t strip = iAmp-clusterAmplitudesBegin+firstStrip;
2412  const bool stripBad = quality_->IsStripBad(qualityRange,strip);
2413  const double noise = noise_->getNoise(strip,noiseRange);
2414  const double gain = gain_->getStripGain(strip,gainRange);
2415  signal += adc;
2416  if (adc) ++nNonZeroStrips;
2417  const double noiseContrib = (stripBad ? 0 : noise/gain);
2418  noise2 += noiseContrib*noiseContrib;
2419  }
2420  const double noise = sqrt(noise2/nNonZeroStrips);
2421  if (noise) return signal/noise;
2422  else return 0;
2423  }
2424  */
2425 //}
2426 
#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:199
virtual void scaleEnergy(double fScale)
scale energy of the jet
virtual float pt() const
transverse momentum
JetAnalyzer(const edm::ParameterSet &)
Constructor.
Definition: JetAnalyzer.cc:99
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:446
const std::string metname
virtual float phi() const
momentum azimuthal angle
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)
float fRBX
Definition: JetID.h:46
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:47
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
T eta() const
Jet ID object.
Definition: JetID.h:16
tuple vertexCollection
triggerResultsToken_(consumes< edm::TriggerResults >(edm::InputTag("TriggerResults")))
int iEvent
Definition: GenABIO.cc:230
void endRun(const edm::Run &, const edm::EventSetup &)
Finish up a run.
virtual ~JetAnalyzer()
Destructor.
Definition: JetAnalyzer.cc:253
tuple corrector
Definition: mvaPFMET_cff.py:50
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
virtual float eta() const
momentum pseudorapidity
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
bool isValid() const
Definition: HandleBase.h:76
#define LogTrace(id)
PF Jet selector for pat::Jets.
Jet selector for pat::Jets and for CaloJets.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
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")
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
Definition: JetCorrector.cc:50
tuple recoJets
Definition: RecoJets_cff.py:56
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
edm::EventID id() const
Definition: EventBase.h:56
virtual int nConstituents() const
of constituents
Definition: Jet.h:65
void bookMESetSelection(std::string, DQMStore::IBooker &)
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Inizialize parameters for histo binning.
Definition: JetAnalyzer.cc:264
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:41
Definition: DDAxes.h:10