CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetAnalyzer_HeavyIons.cc
Go to the documentation of this file.
1 //
2 // Jet Analyzer class for heavy ion jets. for DQM jet analysis monitoring
3 // For CMSSW_7_4_X, especially reading background subtracted jets
4 // author: Raghav Kunnawalkam Elayavalli,
5 // Jan 12th 2015
6 // Rutgers University, email: raghav.k.e at CERN dot CH
7 //
8 
9 
11 
12 using namespace edm;
13 using namespace reco;
14 using namespace std;
15 
16 // declare the constructors:
17 
19  mInputCollection (iConfig.getParameter<edm::InputTag> ("src")),
20  mInputPFCandCollection (iConfig.getParameter<edm::InputTag> ("PFcands")),
21 // rhoTag (iConfig.getParameter<edm::InputTag> ("srcRho")),
22  centrality (iConfig.getParameter<edm::InputTag> ("centrality")),
23  mOutputFile (iConfig.getUntrackedParameter<std::string>("OutputFile","")),
24  JetType (iConfig.getUntrackedParameter<std::string>("JetType")),
25  UEAlgo (iConfig.getUntrackedParameter<std::string>("UEAlgo")),
26  Background (iConfig.getParameter<edm::InputTag> ("Background")),
27  mRecoJetPtThreshold (iConfig.getParameter<double> ("recoJetPtThreshold")),
28  mReverseEnergyFractionThreshold(iConfig.getParameter<double> ("reverseEnergyFractionThreshold")),
29  mRThreshold (iConfig.getParameter<double> ("RThreshold")),
30  JetCorrectionService (iConfig.getParameter<std::string> ("JetCorrections"))
31 {
32  std::string inputCollectionLabel(mInputCollection.label());
33 
34  // std::size_t foundCaloCollection = inputCollectionLabel.find("Calo");
35  // std::size_t foundJPTCollection = inputCollectionLabel.find("JetPlusTrack");
36  // std::size_t foundPFCollection = inputCollectionLabel.find("PF");
37 
38  isCaloJet = (std::string("calo")==JetType);
39  isJPTJet = (std::string("jpt") ==JetType);
40  isPFJet = (std::string("pf") ==JetType);
41 
42  //consumes
43  pvToken_ = consumes<std::vector<reco::Vertex> >(edm::InputTag("offlinePrimaryVertices"));
44  caloTowersToken_ = consumes<CaloTowerCollection>(edm::InputTag("towerMaker"));
45  if (isCaloJet) caloJetsToken_ = consumes<reco::CaloJetCollection>(mInputCollection);
46  if (isJPTJet) jptJetsToken_ = consumes<reco::JPTJetCollection>(mInputCollection);
47  if (isPFJet) {
48  if(std::string("Pu")==UEAlgo) basicJetsToken_ = consumes<reco::BasicJetCollection>(mInputCollection);
49  if(std::string("Vs")==UEAlgo) pfJetsToken_ = consumes<reco::PFJetCollection>(mInputCollection);
50  }
51 
52  pfCandToken_ = consumes<reco::PFCandidateCollection>(mInputPFCandCollection);
53  pfCandViewToken_ = consumes<reco::CandidateView>(mInputPFCandCollection);
54  caloCandViewToken_ = consumes<reco::CandidateView>(edm::InputTag("towerMaker"));
55  backgrounds_ = consumes<edm::ValueMap<reco::VoronoiBackground> >(Background);
56  backgrounds_value_ = consumes<std::vector<float> >(Background);
57  centralityToken_ = consumes<reco::Centrality>(centrality);
58  hiVertexToken_ = consumes<std::vector<reco::Vertex> >(edm::InputTag("hiSelectedVertex"));
59 
60  // need to initialize the PF cand histograms : which are also event variables
61  if(isPFJet){
62  mNPFpart = 0;
63  mPFPt = 0;
64  mPFEta = 0;
65  mPFPhi = 0;
66  mPFVsPt = 0;
67  mPFVsPtInitial = 0;
68  mPFArea = 0;
69  mSumPFVsPt = 0;
71  mSumPFPt = 0;
73  mSumPFVsPt_eta = 0;
74  mSumPFPt_eta = 0;
77  mSumSquaredPFPt = 0;
82  mSumPFVsPt_HF = 0;
83  mSumPFPt_HF = 0;
85  mPFVsPt_eta_phi = 0;
86  mPFPt_eta_phi = 0;
87 
103 
119 
135 
136  }
137  if(isCaloJet){
138  mNCalopart = 0;
139  mCaloPt = 0;
140  mCaloEta = 0;
141  mCaloPhi = 0;
142  mCaloVsPt = 0;
143  mCaloVsPtInitial = 0;
144  mCaloArea = 0;
145 
146  mSumCaloVsPt = 0;
148  mSumCaloPt = 0;
150  mSumCaloVsPt_eta = 0;
151  mSumCaloPt_eta = 0;
154  mSumSquaredCaloPt = 0;
159  mSumCaloVsPt_HF = 0;
160  mSumCaloPt_HF = 0;
162  mCaloVsPt_eta_phi = 0;
163  mCaloPt_eta_phi = 0;
164 
180 
196 
212 
213  }
214  mSumpt = 0;
215  mvn = 0;
216  mpsin = 0;
217 
218 
219 
220  // Events variables
221  mNvtx = 0;
222  mHF = 0;
223 
224  // added Jan 12th 2015
225 
226  mDeltapT = 0;
227  //mDeltapT_HF = 0;
228  mDeltapT_eta = 0;
229  //mDeltapT_phiMinusPsi2 = 0;
230  mDeltapT_eta_phi = 0;
231 
232  // Jet parameters
233  mEta = 0;
234  mPhi = 0;
235  mEnergy = 0;
236  mP = 0;
237  mPt = 0;
238  mMass = 0;
239  mConstituents = 0;
240  mJetArea = 0;
241  mjetpileup = 0;
242  mNJets_40 = 0;
243  mNJets = 0;
244 
245  mVs_0_x = 0;
246  mVs_0_y = 0;
247  mVs_1_x = 0;
248  mVs_1_y = 0;
249  mVs_2_x = 0;
250  mVs_2_y = 0;
251  mVs_0_x_versus_HF = 0;
252  mVs_0_y_versus_HF = 0;
253  mVs_1_x_versus_HF = 0;
254  mVs_1_y_versus_HF = 0;
255  mVs_2_x_versus_HF = 0;
256  mVs_2_y_versus_HF = 0;
257 
258 }
259 
261  {
262 
263  ibooker.setCurrentFolder("JetMET/JetValidation/"+mInputCollection.label());
264 
265  static const size_t ncms_hcal_edge_pseudorapidity = 82 + 1;
266  static const double cms_hcal_edge_pseudorapidity[ncms_hcal_edge_pseudorapidity] = {
267  -5.191, -4.889, -4.716, -4.538, -4.363, -4.191, -4.013,
268  -3.839, -3.664, -3.489, -3.314, -3.139, -2.964, -2.853,
269  -2.650, -2.500, -2.322, -2.172, -2.043, -1.930, -1.830,
270  -1.740, -1.653, -1.566, -1.479, -1.392, -1.305, -1.218,
271  -1.131, -1.044, -0.957, -0.879, -0.783, -0.696, -0.609,
272  -0.522, -0.435, -0.348, -0.261, -0.174, -0.087,
273  0.000,
274  0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609,
275  0.696, 0.783, 0.879, 0.957, 1.044, 1.131, 1.218,
276  1.305, 1.392, 1.479, 1.566, 1.653, 1.740, 1.830,
277  1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.853,
278  2.964, 3.139, 3.314, 3.489, 3.664, 3.839, 4.013,
279  4.191, 4.363, 4.538, 4.716, 4.889, 5.191
280  };
281 
282  //cout<<"inside the book histograms function"<<endl;
283 
284  double edge_pseudorapidity[etaBins_ +1] = {-5.191, -2.650, -2.043, -1.740, -1.479, -1.131, -0.783, -0.522, 0.522, 0.783, 1.131, 1.479, 1.740, 2.043, 2.650, 5.191 };
285 
286  TH2F *h2D_etabins_vs_pt2 = new TH2F("h2D_etabins_vs_pt2","etaBins (x axis), sum pt^{2} (y axis)",etaBins_,edge_pseudorapidity,10000,0,10000);
287  TH2F *h2D_etabins_vs_pt = new TH2F("h2D_etabins_vs_pt","etaBins (x axis), sum pt (y axis)",etaBins_,edge_pseudorapidity,10000,-1000,1000);
288  TH2F *h2D_etabins_vs_phi = new TH2F("h2D_etabins_vs_phi","candidate map, eta(x axis), phi (y axis), pt (z axis)",ncms_hcal_edge_pseudorapidity-1,cms_hcal_edge_pseudorapidity,36,-TMath::Pi(),TMath::Pi());
289 
290  if(isPFJet){
291 
292  mNPFpart = ibooker.book1D("NPFpart","No of particle flow candidates",1000,0,10000);
293  mPFPt = ibooker.book1D("PFPt","PF candidate p_{T}",1000,-5000,5000);
294  mPFEta = ibooker.book1D("PFEta","PF candidate #eta",120,-6,6);
295  mPFPhi = ibooker.book1D("PFPhi","PF candidate #phi",70,-3.5,3.5);
296  mPFVsPt = ibooker.book1D("PFVsPt","Vs PF candidate p_{T}",1000,-5000,5000);
297  mPFVsPtInitial = ibooker.book1D("PFVsPtInitial","Vs background subtracted PF candidate p_{T}",1000,-5000,5000);
298  mPFArea = ibooker.book1D("PFArea","VS PF candidate area",100,0,4);
299 
300  mSumPFVsPt = ibooker.book1D("SumPFVsPt","Sum of final PF VS p_{T}",1000,-10000,10000);
301  mSumPFVsPtInitial= ibooker.book1D("SumPFVsPtInitial","Sum PF VS p_{T} after subtraction",1000,-10000,10000);
302  mSumPFPt = ibooker.book1D("SumPFPt","Sum of initial PF p_{T}",1000,-10000,10000);
303  mSumPFVsPt_eta = ibooker.book2D("SumPFVsPt_etaBins",h2D_etabins_vs_pt);
304  mSumPFVsPtInitial_eta = ibooker.book2D("SumPFVsPtInitial_etaBins",h2D_etabins_vs_pt);
305  mSumPFPt_eta = ibooker.book2D("SumPFPt_etaBins",h2D_etabins_vs_pt);
306 
307  mSumSquaredPFVsPt = ibooker.book1D("SumSquaredPFVsPt","Sum PF Vs p_{T} square",10000,0,10000);
308  mSumSquaredPFVsPtInitial= ibooker.book1D("SumSquaredPFVsPtInitial","Sum PF Vs p_{T} square after subtraction ",10000,0,10000);
309  mSumSquaredPFPt = ibooker.book1D("SumSquaredPFPt","Sum of initial PF p_{T} squared",10000,0,10000);
310  mSumSquaredPFVsPt_eta = ibooker.book2D("SumSquaredPFVsPt_etaBins",h2D_etabins_vs_pt2);
311  mSumSquaredPFVsPtInitial_eta = ibooker.book2D("SumSquaredPFVsPtInitial_etaBins",h2D_etabins_vs_pt2);
312  mSumSquaredPFPt_eta = ibooker.book2D("SumSquaredPFPt_etaBins",h2D_etabins_vs_pt2);
313 
314  mSumPFVsPtInitial_HF = ibooker.book2D("SumPFVsPtInitial_HF","HF Energy (y axis) vs Sum PF Vs p_{T} before subtraction (x axis)",1000,-1000,1000,1000,0,10000);
315  mSumPFVsPt_HF = ibooker.book2D("SumPFVsPt_HF","HF energy (y axis) vs Sum PF Vs p_{T} final (x axis)",1000,-1000,1000,1000,0,10000);
316  mSumPFPt_HF = ibooker.book2D("SumPFPt_HF","HF energy (y axis) vs Sum initial PF p_{T} (x axis)",1000,-1000,1000,1000,0,10000);
317  mPFVsPtInitial_eta_phi = ibooker.book2D("PFVsPtInitial_eta_phi",h2D_etabins_vs_phi);
318  mPFVsPt_eta_phi = ibooker.book2D("PFVsPt_eta_phi",h2D_etabins_vs_phi);
319  mPFPt_eta_phi = ibooker.book2D("PFPt_eta_phi",h2D_etabins_vs_phi);
320 
321  mSumPFVsPtInitial_n5p191_n2p650 = ibooker.book1D("mSumPFVsPtInitial_n5p191_n2p650","Sum PFVsPt Initial variable in the eta range -5.191 to -2.650",1000,-5000,5000);
322  mSumPFVsPtInitial_n2p650_n2p043 = ibooker.book1D("mSumPFVsPtInitial_n2p650_n2p043","Sum PFVsPt Initial variable in the eta range -2.650 to -2.043 ",1000,-5000,5000);
323  mSumPFVsPtInitial_n2p043_n1p740 = ibooker.book1D("mSumPFVsPtInitial_n2p043_n1p740","Sum PFVsPt Initial variable in the eta range -2.043 to -1.740",1000,-1000,1000);
324  mSumPFVsPtInitial_n1p740_n1p479 = ibooker.book1D("mSumPFVsPtInitial_n1p740_n1p479","Sum PFVsPt Initial variable in the eta range -1.740 to -1.479",1000,-1000,1000);
325  mSumPFVsPtInitial_n1p479_n1p131 = ibooker.book1D("mSumPFVsPtInitial_n1p479_n1p131","Sum PFVsPt Initial variable in the eta range -1.479 to -1.131",1000,-1000,1000);
326  mSumPFVsPtInitial_n1p131_n0p783 = ibooker.book1D("mSumPFVsPtInitial_n1p131_n0p783","Sum PFVsPt Initial variable in the eta range -1.131 to -0.783",1000,-1000,1000);
327  mSumPFVsPtInitial_n0p783_n0p522 = ibooker.book1D("mSumPFVsPtInitial_n0p783_n0p522","Sum PFVsPt Initial variable in the eta range -0.783 to -0.522",1000,-1000,1000);
328  mSumPFVsPtInitial_n0p522_0p522 = ibooker.book1D("mSumPFVsPtInitial_n0p522_0p522","Sum PFVsPt Initial variable in the eta range -0.522 to 0.522",1000,-1000,1000);
329  mSumPFVsPtInitial_0p522_0p783 = ibooker.book1D("mSumPFVsPtInitial_0p522_0p783","Sum PFVsPt Initial variable in the eta range 0.522 to 0.783",1000,-1000,1000);
330  mSumPFVsPtInitial_0p783_1p131 = ibooker.book1D("mSumPFVsPtInitial_0p783_1p131","Sum PFVsPt Initial variable in the eta range 0.783 to 1.131",1000,-1000,1000);
331  mSumPFVsPtInitial_1p131_1p479 = ibooker.book1D("mSumPFVsPtInitial_1p131_1p479","Sum PFVsPt Initial variable in the eta range 1.131 to 1.479",1000,-1000,1000);
332  mSumPFVsPtInitial_1p479_1p740 = ibooker.book1D("mSumPFVsPtInitial_1p479_1p740","Sum PFVsPt Initial variable in the eta range 1.479 to 1.740",1000,-1000,1000);
333  mSumPFVsPtInitial_1p740_2p043 = ibooker.book1D("mSumPFVsPtInitial_1p740_2p043","Sum PFVsPt Initial variable in the eta range 1.740 to 2.043",1000,-1000,1000);
334  mSumPFVsPtInitial_2p043_2p650 = ibooker.book1D("mSumPFVsPtInitial_2p043_2p650","Sum PFVsPt Initial variable in the eta range 2.043 to 2.650",1000,-5000,5000);
335  mSumPFVsPtInitial_2p650_5p191 = ibooker.book1D("mSumPFVsPtInitial_2p650_5p191","Sum PFVsPt Initial variable in the eta range 2.650 to 5.191",1000,-5000,5000);
336 
337  mSumPFVsPt_n5p191_n2p650 = ibooker.book1D("mSumPFVsPt_n5p191_n2p650","Sum PFVsPt variable in the eta range -5.191 to -2.650",1000,-5000,5000);
338  mSumPFVsPt_n2p650_n2p043 = ibooker.book1D("mSumPFVsPt_n2p650_n2p043","Sum PFVsPt variable in the eta range -2.650 to -2.043 ",1000,-5000,5000);
339  mSumPFVsPt_n2p043_n1p740 = ibooker.book1D("mSumPFVsPt_n2p043_n1p740","Sum PFVsPt variable in the eta range -2.043 to -1.740",1000,-1000,1000);
340  mSumPFVsPt_n1p740_n1p479 = ibooker.book1D("mSumPFVsPt_n1p740_n1p479","Sum PFVsPt variable in the eta range -1.740 to -1.479",1000,-1000,1000);
341  mSumPFVsPt_n1p479_n1p131 = ibooker.book1D("mSumPFVsPt_n1p479_n1p131","Sum PFVsPt variable in the eta range -1.479 to -1.131",1000,-1000,1000);
342  mSumPFVsPt_n1p131_n0p783 = ibooker.book1D("mSumPFVsPt_n1p131_n0p783","Sum PFVsPt variable in the eta range -1.131 to -0.783",1000,-1000,1000);
343  mSumPFVsPt_n0p783_n0p522 = ibooker.book1D("mSumPFVsPt_n0p783_n0p522","Sum PFVsPt variable in the eta range -0.783 to -0.522",1000,-1000,1000);
344  mSumPFVsPt_n0p522_0p522 = ibooker.book1D("mSumPFVsPt_n0p522_0p522","Sum PFVsPt variable in the eta range -0.522 to 0.522",1000,-1000,1000);
345  mSumPFVsPt_0p522_0p783 = ibooker.book1D("mSumPFVsPt_0p522_0p783","Sum PFVsPt variable in the eta range 0.522 to 0.783",1000,-1000,1000);
346  mSumPFVsPt_0p783_1p131 = ibooker.book1D("mSumPFVsPt_0p783_1p131","Sum PFVsPt variable in the eta range 0.783 to 1.131",1000,-1000,1000);
347  mSumPFVsPt_1p131_1p479 = ibooker.book1D("mSumPFVsPt_1p131_1p479","Sum PFVsPt variable in the eta range 1.131 to 1.479",1000,-1000,1000);
348  mSumPFVsPt_1p479_1p740 = ibooker.book1D("mSumPFVsPt_1p479_1p740","Sum PFVsPt variable in the eta range 1.479 to 1.740",1000,-1000,1000);
349  mSumPFVsPt_1p740_2p043 = ibooker.book1D("mSumPFVsPt_1p740_2p043","Sum PFVsPt variable in the eta range 1.740 to 2.043",1000,-1000,1000);
350  mSumPFVsPt_2p043_2p650 = ibooker.book1D("mSumPFVsPt_2p043_2p650","Sum PFVsPt variable in the eta range 2.043 to 2.650",1000,-5000,5000);
351  mSumPFVsPt_2p650_5p191 = ibooker.book1D("mSumPFVsPt_2p650_5p191","Sum PFVsPt variable in the eta range 2.650 to 5.191",1000,-5000,5000);
352 
353  mSumPFPt_n5p191_n2p650 = ibooker.book1D("mSumPFPt_n5p191_n2p650","Sum PFPt in the eta range -5.191 to -2.650",1000,-5000,5000);
354  mSumPFPt_n2p650_n2p043 = ibooker.book1D("mSumPFPt_n2p650_n2p043","Sum PFPt in the eta range -2.650 to -2.043 ",1000,-5000,5000);
355  mSumPFPt_n2p043_n1p740 = ibooker.book1D("mSumPFPt_n2p043_n1p740","Sum PFPt in the eta range -2.043 to -1.740",1000,-1000,1000);
356  mSumPFPt_n1p740_n1p479 = ibooker.book1D("mSumPFPt_n1p740_n1p479","Sum PFPt in the eta range -1.740 to -1.479",1000,-1000,1000);
357  mSumPFPt_n1p479_n1p131 = ibooker.book1D("mSumPFPt_n1p479_n1p131","Sum PFPt in the eta range -1.479 to -1.131",1000,-1000,1000);
358  mSumPFPt_n1p131_n0p783 = ibooker.book1D("mSumPFPt_n1p131_n0p783","Sum PFPt in the eta range -1.131 to -0.783",1000,-1000,1000);
359  mSumPFPt_n0p783_n0p522 = ibooker.book1D("mSumPFPt_n0p783_n0p522","Sum PFPt in the eta range -0.783 to -0.522",1000,-1000,1000);
360  mSumPFPt_n0p522_0p522 = ibooker.book1D("mSumPFPt_n0p522_0p522","Sum PFPt in the eta range -0.522 to 0.522",1000,-1000,1000);
361  mSumPFPt_0p522_0p783 = ibooker.book1D("mSumPFPt_0p522_0p783","Sum PFPt in the eta range 0.522 to 0.783",1000,-1000,1000);
362  mSumPFPt_0p783_1p131 = ibooker.book1D("mSumPFPt_0p783_1p131","Sum PFPt in the eta range 0.783 to 1.131",1000,-1000,1000);
363  mSumPFPt_1p131_1p479 = ibooker.book1D("mSumPFPt_1p131_1p479","Sum PFPt in the eta range 1.131 to 1.479",1000,-1000,1000);
364  mSumPFPt_1p479_1p740 = ibooker.book1D("mSumPFPt_1p479_1p740","Sum PFPt in the eta range 1.479 to 1.740",1000,-1000,1000);
365  mSumPFPt_1p740_2p043 = ibooker.book1D("mSumPFPt_1p740_2p043","Sum PFPt in the eta range 1.740 to 2.043",1000,-1000,1000);
366  mSumPFPt_2p043_2p650 = ibooker.book1D("mSumPFPt_2p043_2p650","Sum PFPt in the eta range 2.043 to 2.650",1000,-5000,5000);
367  mSumPFPt_2p650_5p191 = ibooker.book1D("mSumPFPt_2p650_5p191","Sum PFPt in the eta range 2.650 to 5.191",1000,-5000,5000);
368 
369 
370  }
371 
372  if(isCaloJet){
373 
374  mNCalopart = ibooker.book1D("NCalopart","No of particle flow candidates",1000,0,10000);
375  mCaloPt = ibooker.book1D("CaloPt","Calo candidate p_{T}",1000,-5000,5000);
376  mCaloEta = ibooker.book1D("CaloEta","Calo candidate #eta",120,-6,6);
377  mCaloPhi = ibooker.book1D("CaloPhi","Calo candidate #phi",70,-3.5,3.5);
378  mCaloVsPt = ibooker.book1D("CaloVsPt","Vs Calo candidate p_{T}",1000,-5000,5000);
379  mCaloVsPtInitial = ibooker.book1D("CaloVsPtInitial","Vs background subtracted Calo candidate p_{T}",1000,-5000,5000);
380  mCaloArea = ibooker.book1D("CaloArea","VS Calo candidate area",100,0,4);
381 
382  mSumCaloVsPt = ibooker.book1D("SumCaloVsPt","Sum of final Calo VS p_{T} ",1000,-10000,10000);
383  mSumCaloVsPtInitial= ibooker.book1D("SumCaloVsPtInitial","Sum Calo VS p_{T} after subtraction",1000,-10000,10000);
384  mSumCaloPt = ibooker.book1D("SumCaloPt","Sum Calo p_{T}",1000,-10000,10000);
385  mSumCaloVsPt_eta = ibooker.book2D("SumCaloVsPt_etaBins",h2D_etabins_vs_pt);
386  mSumCaloVsPtInitial_eta = ibooker.book2D("SumCaloVsPtInitial_etaBins",h2D_etabins_vs_pt);
387  mSumCaloPt_eta = ibooker.book2D("SumCaloPt_etaBins",h2D_etabins_vs_pt);
388 
389  mSumSquaredCaloVsPt = ibooker.book1D("SumSquaredCaloVsPt","Sum of final Calo VS p_{T} squared",10000,0,10000);
390  mSumSquaredCaloVsPtInitial= ibooker.book1D("SumSquaredCaloVsPtInitial","Sum of subtracted Calo VS p_{T} squared",10000,0,10000);
391  mSumSquaredCaloPt = ibooker.book1D("SumSquaredCaloPt","Sum of initial Calo tower p_{T} squared",10000,0,10000);
392  mSumSquaredCaloVsPt_eta = ibooker.book2D("SumSquaredCaloVsPt_etaBins",h2D_etabins_vs_pt2);
393  mSumSquaredCaloVsPtInitial_eta = ibooker.book2D("SumSquaredCaloVsPtInitial_etaBins",h2D_etabins_vs_pt2);
394  mSumSquaredCaloPt_eta = ibooker.book2D("SumSquaredCaloPt_etaBins",h2D_etabins_vs_pt2);
395 
396  mSumCaloVsPtInitial_HF = ibooker.book2D("SumCaloVsPtInitial_HF","HF Energy (y axis) vs Sum Calo Vs p_{T} before subtraction (x axis)",1000,-1000,1000,1000,0,10000);
397  mSumCaloVsPt_HF = ibooker.book2D("SumCaloVsPt_HF","HF Energy (y axis) vs Sum Calo Vs p_{T} (x axis)",1000,-1000,1000,1000,0,10000);
398  mSumCaloPt_HF = ibooker.book2D("SumCaloPt_HF","HF Energy (y axis) vs Sum Calo tower p_{T}",1000,-1000,1000,1000,0,10000);
399  mCaloVsPtInitial_eta_phi = ibooker.book2D("CaloVsPtInitial_eta_phi",h2D_etabins_vs_phi);
400  mCaloVsPt_eta_phi = ibooker.book2D("CaloVsPt_eta_phi",h2D_etabins_vs_phi);
401  mCaloPt_eta_phi = ibooker.book2D("CaloPt_eta_phi",h2D_etabins_vs_phi);
402 
403  mSumCaloVsPtInitial_n5p191_n2p650 = ibooker.book1D("mSumCaloVsPtInitial_n5p191_n2p650","Sum CaloVsPt Initial variable in the eta range -5.191 to -2.650",1000,-5000,5000);
404  mSumCaloVsPtInitial_n2p650_n2p043 = ibooker.book1D("mSumCaloVsPtInitial_n2p650_n2p043","Sum CaloVsPt Initial variable in the eta range -2.650 to -2.043 ",1000,-5000,5000);
405  mSumCaloVsPtInitial_n2p043_n1p740 = ibooker.book1D("mSumCaloVsPtInitial_n2p043_n1p740","Sum CaloVsPt Initial variable in the eta range -2.043 to -1.740",1000,-1000,1000);
406  mSumCaloVsPtInitial_n1p740_n1p479 = ibooker.book1D("mSumCaloVsPtInitial_n1p740_n1p479","Sum CaloVsPt Initial variable in the eta range -1.740 to -1.479",1000,-1000,1000);
407  mSumCaloVsPtInitial_n1p479_n1p131 = ibooker.book1D("mSumCaloVsPtInitial_n1p479_n1p131","Sum CaloVsPt Initial variable in the eta range -1.479 to -1.131",1000,-1000,1000);
408  mSumCaloVsPtInitial_n1p131_n0p783 = ibooker.book1D("mSumCaloVsPtInitial_n1p131_n0p783","Sum CaloVsPt Initial variable in the eta range -1.131 to -0.783",1000,-1000,1000);
409  mSumCaloVsPtInitial_n0p783_n0p522 = ibooker.book1D("mSumCaloVsPtInitial_n0p783_n0p522","Sum CaloVsPt Initial variable in the eta range -0.783 to -0.522",1000,-1000,1000);
410  mSumCaloVsPtInitial_n0p522_0p522 = ibooker.book1D("mSumCaloVsPtInitial_n0p522_0p522","Sum CaloVsPt Initial variable in the eta range -0.522 to 0.522",1000,-1000,1000);
411  mSumCaloVsPtInitial_0p522_0p783 = ibooker.book1D("mSumCaloVsPtInitial_0p522_0p783","Sum CaloVsPt Initial variable in the eta range 0.522 to 0.783",1000,-1000,1000);
412  mSumCaloVsPtInitial_0p783_1p131 = ibooker.book1D("mSumCaloVsPtInitial_0p783_1p131","Sum CaloVsPt Initial variable in the eta range 0.783 to 1.131",1000,-1000,1000);
413  mSumCaloVsPtInitial_1p131_1p479 = ibooker.book1D("mSumCaloVsPtInitial_1p131_1p479","Sum CaloVsPt Initial variable in the eta range 1.131 to 1.479",1000,-1000,1000);
414  mSumCaloVsPtInitial_1p479_1p740 = ibooker.book1D("mSumCaloVsPtInitial_1p479_1p740","Sum CaloVsPt Initial variable in the eta range 1.479 to 1.740",1000,-1000,1000);
415  mSumCaloVsPtInitial_1p740_2p043 = ibooker.book1D("mSumCaloVsPtInitial_1p740_2p043","Sum CaloVsPt Initial variable in the eta range 1.740 to 2.043",1000,-1000,1000);
416  mSumCaloVsPtInitial_2p043_2p650 = ibooker.book1D("mSumCaloVsPtInitial_2p043_2p650","Sum CaloVsPt Initial variable in the eta range 2.043 to 2.650",1000,-5000,5000);
417  mSumCaloVsPtInitial_2p650_5p191 = ibooker.book1D("mSumCaloVsPtInitial_2p650_5p191","Sum CaloVsPt Initial variable in the eta range 2.650 to 5.191",1000,-5000,5000);
418 
419  mSumCaloVsPt_n5p191_n2p650 = ibooker.book1D("mSumCaloVsPt_n5p191_n2p650","Sum CaloVsPt variable in the eta range -5.191 to -2.650",1000,-5000,5000);
420  mSumCaloVsPt_n2p650_n2p043 = ibooker.book1D("mSumCaloVsPt_n2p650_n2p043","Sum CaloVsPt variable in the eta range -2.650 to -2.043",1000,-5000,5000);
421  mSumCaloVsPt_n2p043_n1p740 = ibooker.book1D("mSumCaloVsPt_n2p043_n1p740","Sum CaloVsPt variable in the eta range -2.043 to -1.740",1000,-1000,1000);
422  mSumCaloVsPt_n1p740_n1p479 = ibooker.book1D("mSumCaloVsPt_n1p740_n1p479","Sum CaloVsPt variable in the eta range -1.740 to -1.479",1000,-1000,1000);
423  mSumCaloVsPt_n1p479_n1p131 = ibooker.book1D("mSumCaloVsPt_n1p479_n1p131","Sum CaloVsPt variable in the eta range -1.479 to -1.131",1000,-1000,1000);
424  mSumCaloVsPt_n1p131_n0p783 = ibooker.book1D("mSumCaloVsPt_n1p131_n0p783","Sum CaloVsPt variable in the eta range -1.131 to -0.783",1000,-1000,1000);
425  mSumCaloVsPt_n0p783_n0p522 = ibooker.book1D("mSumCaloVsPt_n0p783_n0p522","Sum CaloVsPt variable in the eta range -0.783 to -0.522",1000,-1000,1000);
426  mSumCaloVsPt_n0p522_0p522 = ibooker.book1D("mSumCaloVsPt_n0p522_0p522","Sum CaloVsPt variable in the eta range -0.522 to 0.522",1000,-1000,1000);
427  mSumCaloVsPt_0p522_0p783 = ibooker.book1D("mSumCaloVsPt_0p522_0p783","Sum CaloVsPt variable in the eta range 0.522 to 0.783",1000,-1000,1000);
428  mSumCaloVsPt_0p783_1p131 = ibooker.book1D("mSumCaloVsPt_0p783_1p131","Sum CaloVsPt variable in the eta range 0.783 to 1.131",1000,-1000,1000);
429  mSumCaloVsPt_1p131_1p479 = ibooker.book1D("mSumCaloVsPt_1p131_1p479","Sum CaloVsPt variable in the eta range 1.131 to 1.479",1000,-1000,1000);
430  mSumCaloVsPt_1p479_1p740 = ibooker.book1D("mSumCaloVsPt_1p479_1p740","Sum CaloVsPt variable in the eta range 1.479 to 1.740",1000,-1000,1000);
431  mSumCaloVsPt_1p740_2p043 = ibooker.book1D("mSumCaloVsPt_1p740_2p043","Sum CaloVsPt variable in the eta range 1.740 to 2.043",1000,-1000,1000);
432  mSumCaloVsPt_2p043_2p650 = ibooker.book1D("mSumCaloVsPt_2p043_2p650","Sum CaloVsPt variable in the eta range 2.043 to 2.650",1000,-5000,5000);
433  mSumCaloVsPt_2p650_5p191 = ibooker.book1D("mSumCaloVsPt_2p650_5p191","Sum CaloVsPt variable in the eta range 2.650 to 5.191",1000,-5000,5000);
434 
435  mSumCaloPt_n5p191_n2p650 = ibooker.book1D("mSumCaloPt_n5p191_n2p650","Sum Calo tower pT variable in the eta range -5.191 to -2.650",1000,-5000,5000);
436  mSumCaloPt_n2p650_n2p043 = ibooker.book1D("mSumCaloPt_n2p650_n2p043","Sum Calo tower pT variable in the eta range -2.650 to -2.043",1000,-5000,5000);
437  mSumCaloPt_n2p043_n1p740 = ibooker.book1D("mSumCaloPt_n2p043_n1p740","Sum Calo tower pT variable in the eta range -2.043 to -1.740",1000,-1000,1000);
438  mSumCaloPt_n1p740_n1p479 = ibooker.book1D("mSumCaloPt_n1p740_n1p479","Sum Calo tower pT variable in the eta range -1.740 to -1.479",1000,-1000,1000);
439  mSumCaloPt_n1p479_n1p131 = ibooker.book1D("mSumCaloPt_n1p479_n1p131","Sum Calo tower pT variable in the eta range -1.479 to -1.131",1000,-1000,1000);
440  mSumCaloPt_n1p131_n0p783 = ibooker.book1D("mSumCaloPt_n1p131_n0p783","Sum Calo tower pT variable in the eta range -1.131 to -0.783",1000,-1000,1000);
441  mSumCaloPt_n0p783_n0p522 = ibooker.book1D("mSumCaloPt_n0p783_n0p522","Sum Calo tower pT variable in the eta range -0.783 to -0.522",1000,-1000,1000);
442  mSumCaloPt_n0p522_0p522 = ibooker.book1D("mSumCaloPt_n0p522_0p522","Sum Calo tower pT variable in the eta range -0.522 to 0.522",1000,-1000,1000);
443  mSumCaloPt_0p522_0p783 = ibooker.book1D("mSumCaloPt_0p522_0p783","Sum Calo tower pT variable in the eta range 0.522 to 0.783",1000,-1000,1000);
444  mSumCaloPt_0p783_1p131 = ibooker.book1D("mSumCaloPt_0p783_1p131","Sum Calo tower pT variable in the eta range 0.783 to 1.131",1000,-1000,1000);
445  mSumCaloPt_1p131_1p479 = ibooker.book1D("mSumCaloPt_1p131_1p479","Sum Calo tower pT variable in the eta range 1.131 to 1.479",1000,-1000,1000);
446  mSumCaloPt_1p479_1p740 = ibooker.book1D("mSumCaloPt_1p479_1p740","Sum Calo tower pT variable in the eta range 1.479 to 1.740",1000,-1000,1000);
447  mSumCaloPt_1p740_2p043 = ibooker.book1D("mSumCaloPt_1p740_2p043","Sum Calo tower pT variable in the eta range 1.740 to 2.043",1000,-1000,1000);
448  mSumCaloPt_2p043_2p650 = ibooker.book1D("mSumCaloPt_2p043_2p650","Sum Calo tower pT variable in the eta range 2.043 to 2.650",1000,-5000,5000);
449  mSumCaloPt_2p650_5p191 = ibooker.book1D("mSumCaloPt_2p650_5p191","Sum Calo tower pT variable in the eta range 2.650 to 5.191",1000,-5000,5000);
450 
451 
452  }
453 
454  // particle flow variables histograms
455  mSumpt = ibooker.book1D("SumpT","Sum p_{T} of all the PF candidates per event",1000,0,10000);
456  mvn = ibooker.book1D("vn","vn",100,0,10);
457  mpsin = ibooker.book1D("mpsin","psin",100,0,10);
458 
459  // Event variables
460  mNvtx = ibooker.book1D("Nvtx", "number of vertices", 60, 0, 60);
461  mHF = ibooker.book1D("HF", "HF energy distribution",1000,0,10000);
462 
463  // added Jan 12th 2015
464  mDeltapT = ibooker.book1D("DeltapT","",400,-200,200);
465  //mDeltapT_HF = ibooker.book2D("DeltapT_HF","",400,-200,200,1000,0,10000);
466  mDeltapT_eta = ibooker.book2D("DeltapT_eta","",60,-6,+6,400,-200,200);
467  //mDeltapT_phiMinusPsi2 = ibooker.book2D("DeltapT_phiMinusPsi2","",400,-200,200,35,-1.75,1.75);
468  mDeltapT_eta_phi = ibooker.book2D("DeltapT_eta_phi",h2D_etabins_vs_phi);
469 
470  // Jet parameters
471  mEta = ibooker.book1D("Eta", "Eta", 120, -6, 6);
472  mPhi = ibooker.book1D("Phi", "Phi", 70, -3.5, 3.5);
473  mPt = ibooker.book1D("Pt", "Pt", 100, 0, 1000);
474  mP = ibooker.book1D("P", "P", 100, 0, 1000);
475  mEnergy = ibooker.book1D("Energy", "Energy", 100, 0, 1000);
476  mMass = ibooker.book1D("Mass", "Mass", 100, 0, 200);
477  mConstituents = ibooker.book1D("Constituents", "Constituents", 100, 0, 100);
478  mJetArea = ibooker.book1D("JetArea", "JetArea", 100, 0, 4);
479  mjetpileup = ibooker.book1D("jetPileUp","jetPileUp",100,0,150);
480  mNJets_40 = ibooker.book1D("NJets_pt_greater_40", "NJets pT > 40 GeV", 50, 0, 100);
481  mNJets = ibooker.book1D("NJets", "NJets", 50, 0, 100);
482 
483  mVs_0_x = ibooker.book1D("Vs_0_x","flow modulated sumpT from both HF (+ and -) with cos, vn = 0",1000,-10000,10000);
484  mVs_0_y = ibooker.book1D("Vs_0_y","flow modulated sumpT from both HF (+ and -) with sin, vn = 0",1000,-10000,10000);
485  mVs_1_x = ibooker.book1D("Vs_1_x","flow modulated sumpT from both HF (+ and -) with cos, vn = 1",1000,-10000,10000);
486  mVs_1_y = ibooker.book1D("Vs_1_y","flow modulated sumpT from both HF (+ and -) with sin, vn = 1",1000,-10000,10000);
487  mVs_2_x = ibooker.book1D("Vs_2_x","flow modulated sumpT from both HF (+ and -) with cos, vn = 2",1000,-10000,10000);
488  mVs_2_y = ibooker.book1D("Vs_2_y","flow modulated sumpT from both HF (+ and -) with sin, vn = 2",1000,-10000,10000);
489 
490  mVs_0_x_versus_HF = ibooker.book2D("Vs_0_x_versus_HF","flow modulated sumpT (y axis) from both HF (+ and -) with cos, vn = 0 versus HF energy (x axis)",1000,0,10000,1000,-10000,10000);
491  mVs_0_y_versus_HF = ibooker.book2D("Vs_0_y_versus_HF","flow modulated sumpT (y axis) from both HF (+ and -) with sin, vn = 0 versus HF energy (x axis)",1000,0,10000,1000,-10000,10000);
492  mVs_1_x_versus_HF = ibooker.book2D("Vs_1_x_versus_HF","flow modulated sumpT (y axis) from both HF (+ and -) with cos, vn = 1 versus HF energy (x axis)",1000,0,10000,1000,-10000,10000);
493  mVs_1_y_versus_HF = ibooker.book2D("Vs_1_y_versus_HF","flow modulated sumpT (y axis) from both HF (+ and -) with sin, vn = 1 versus HF energy (x axis)",1000,0,10000,1000,-10000,10000);
494  mVs_2_x_versus_HF = ibooker.book2D("Vs_2_x_versus_HF","flow modulated sumpT (y axis) from both HF (+ and -) with cos, vn = 2 versus HF energy (x axis)",1000,0,10000,1000,-10000,10000);
495  mVs_2_y_versus_HF = ibooker.book2D("Vs_2_y_versus_HF","flow modulated sumpT (y axis) from both HF (+ and -) with sin, vn = 2 versus HF energy (x axis)",1000,0,10000,1000,-10000,10000);
496 
497  if (mOutputFile.empty ())
498  LogInfo("OutputInfo") << " Histograms will NOT be saved";
499  else
500  LogInfo("OutputInfo") << " Histograms will be saved to file:" << mOutputFile;
501 
502  delete h2D_etabins_vs_pt2;
503  delete h2D_etabins_vs_pt;
504  delete h2D_etabins_vs_phi;
505 
506  }
507 
508 
509 
510 //------------------------------------------------------------------------------
511 // ~JetAnalyzer_HeavyIons
512 //------------------------------------------------------------------------------
514 
515 
516 //------------------------------------------------------------------------------
517 // beginJob
518 //------------------------------------------------------------------------------
519 //void JetAnalyzer_HeavyIons::beginJob() {
520 // std::cout<<"inside the begin job function"<<endl;
521 //}
522 
523 
524 //------------------------------------------------------------------------------
525 // endJob
526 //------------------------------------------------------------------------------
527 //void JetAnalyzer_HeavyIons::endJob()
528 //{
529 // if (!mOutputFile.empty() && &*edm::Service<DQMStore>())
530 // {
531 // edm::Service<DQMStore>()->save(mOutputFile);
532 // }
533 //}
534 
535 
536 //------------------------------------------------------------------------------
537 // analyze
538 //------------------------------------------------------------------------------
540 {
541  // Get the primary vertices
542  //----------------------------------------------------------------------------
544  mEvent.getByToken(pvToken_, pvHandle);
545  reco::Vertex::Point vtx(0,0,0);
547  //vtx = getVtx(mEvent);
548 
549  mEvent.getByToken(hiVertexToken_, vtxs);
550  int greatestvtx = 0;
551  int nVertex = vtxs->size();
552 
553  for (unsigned int i = 0 ; i< vtxs->size(); ++i){
554  unsigned int daughter = (*vtxs)[i].tracksSize();
555  if( daughter > (*vtxs)[greatestvtx].tracksSize()) greatestvtx = i;
556  }
557 
558  if(nVertex<=0){
559  vtx = reco::Vertex::Point(0,0,0);
560  }
561  vtx = (*vtxs)[greatestvtx].position();
562 
563  int nGoodVertices = 0;
564 
565  if (pvHandle.isValid())
566  {
567  for (unsigned i=0; i<pvHandle->size(); i++)
568  {
569  if ((*pvHandle)[i].ndof() > 4 &&
570  (fabs((*pvHandle)[i].z()) <= 24) &&
571  (fabs((*pvHandle)[i].position().rho()) <= 2))
572  nGoodVertices++;
573  }
574  }
575 
576  mNvtx->Fill(nGoodVertices);
577 
578 
579  // Get the Jet collection
580  //----------------------------------------------------------------------------
581 
582  std::vector<Jet> recoJets;
583  recoJets.clear();
584 
589 
590  // Get the Particle flow candidates and the Voronoi variables
592  edm::Handle<CaloTowerCollection> caloCandidates;
593  edm::Handle<reco::CandidateView> pfcandidates_;
594  edm::Handle<reco::CandidateView> calocandidates_;
595 
598 
600 
601 
602  if (isCaloJet) mEvent.getByToken(caloJetsToken_, caloJets);
603  if (isJPTJet) mEvent.getByToken(jptJetsToken_, jptJets);
604  if (isPFJet) {
605  if(std::string("Pu")==UEAlgo) mEvent.getByToken(basicJetsToken_, basicJets);
606  if(std::string("Vs")==UEAlgo) mEvent.getByToken(pfJetsToken_, pfJets);
607  }
608 
609  mEvent.getByToken(pfCandToken_, pfCandidates);
610  mEvent.getByToken(pfCandViewToken_, pfcandidates_);
611 
612  mEvent.getByToken(caloTowersToken_, caloCandidates);
613  mEvent.getByToken(caloCandViewToken_, calocandidates_);
614 
615  mEvent.getByToken(backgrounds_, VsBackgrounds);
616  mEvent.getByToken(backgrounds_value_, vn_);
617 
618  // get the centrality
619  mEvent.getByToken(centralityToken_, cent);
620 
621  mHF->Fill(cent->EtHFtowerSum());
622  Float_t HF_energy = cent->EtHFtowerSum();
623 
624  const reco::PFCandidateCollection *pfCandidateColl = pfCandidates.product();
625 
626  Float_t vsPt=0;
627  Float_t vsPtInitial = 0;
628  Float_t vsArea = 0;
629  Int_t NPFpart = 0;
630  Int_t NCaloTower = 0;
631  Float_t pfPt = 0;
632  Float_t pfEta = 0;
633  Float_t pfPhi = 0;
634  Float_t caloPt = 0;
635  Float_t caloEta = 0;
636  Float_t caloPhi = 0;
637  Float_t SumPt_value = 0;
638  Float_t vn_value[200];
639  Float_t psin_value[200];
640 
641  Float_t vn[fourierOrder_][etaBins_];
642  Float_t psin[fourierOrder_][etaBins_];
643  Float_t sumpT[etaBins_];
644 
645  double edge_pseudorapidity[etaBins_ +1] = {-5.191, -2.650, -2.043, -1.740, -1.479, -1.131, -0.783, -0.522, 0.522, 0.783, 1.131, 1.479, 1.740, 2.043, 2.650, 5.191 };
646 
648 
649  for(int ieta = 0;ieta<etaBins_;++ieta){
650  sumpT[ieta] = vnUE.get_sum_pt(ieta);
651  for(int ifour = 0;ifour<fourierOrder_; ++ifour){
652  vn[ifour][ieta] = vnUE.get_vn(ifour,ieta);
653  vn_value[ifour * etaBins_ + ieta]= vnUE.get_vn(ifour,ieta);
654  mvn->Fill(vn_value[ifour * etaBins_ + ieta]);
655 
656  psin[ifour][ieta] = vnUE.get_psin(ifour,ieta);
657  psin_value[ifour * etaBins_ + ieta] = vnUE.get_psin(ifour,ieta);
658  mpsin->Fill(psin_value[ifour * etaBins_ + ieta]);
659 
660  if(0>1)std::cout<<vn[ifour][ieta]<<" "<<psin[ifour][ieta]<<" "<<sumpT[ieta]<<std::endl;
661 
662  }
663  }
664 
665 
666  //lets start making the necessary plots
667  Float_t Vs_0_x_minus = sumpT[0]*vn[0][0]*TMath::Cos(0*psin[0][0]);
668  Float_t Vs_0_x_plus = sumpT[14]*vn[0][14]*TMath::Cos(0*psin[0][14]);
669  Float_t Vs_0_y_minus = sumpT[0]*vn[0][0]*TMath::Sin(0*psin[0][0]);
670  Float_t Vs_0_y_plus = sumpT[14]*vn[0][14]*TMath::Sin(0*psin[0][14]);
671  Float_t Vs_0_x = Vs_0_x_minus + Vs_0_x_plus;
672  Float_t Vs_0_y = Vs_0_y_minus + Vs_0_y_plus;
673 
674  Float_t Vs_1_x_minus = sumpT[0]*vn[1][0]*TMath::Cos(1*psin[1][0]);
675  Float_t Vs_1_x_plus = sumpT[14]*vn[1][14]*TMath::Cos(1*psin[1][14]);
676  Float_t Vs_1_y_minus = sumpT[0]*vn[1][0]*TMath::Sin(1*psin[1][0]);
677  Float_t Vs_1_y_plus = sumpT[14]*vn[1][14]*TMath::Sin(1*psin[1][14]);
678  Float_t Vs_1_x = Vs_1_x_minus + Vs_1_x_plus;
679  Float_t Vs_1_y = Vs_1_y_minus + Vs_1_y_plus;
680 
681  Float_t Vs_2_x_minus = sumpT[0]*vn[2][0]*TMath::Cos(2*psin[2][0]);
682  Float_t Vs_2_x_plus = sumpT[14]*vn[2][14]*TMath::Cos(2*psin[2][14]);
683  Float_t Vs_2_y_minus = sumpT[0]*vn[2][0]*TMath::Sin(2*psin[2][0]);
684  Float_t Vs_2_y_plus = sumpT[14]*vn[2][14]*TMath::Sin(2*psin[2][14]);
685  Float_t Vs_2_x = Vs_2_x_minus + Vs_2_x_plus;
686  Float_t Vs_2_y = Vs_2_y_minus + Vs_2_y_plus;
687 
688  // Float_t Vs_3_x_minus = sumpT[0]*vn[3][0]*TMath::Cos(3*psin[3][0]);
689  // Float_t Vs_3_x_plus = sumpT[14]*vn[3][14]*TMath::Cos(3*psin[3][14]);
690  // Float_t Vs_3_y_minus = sumpT[0]*vn[3][0]*TMath::Sin(3*psin[3][0]);
691  // Float_t Vs_3_y_plus = sumpT[14]*vn[3][14]*TMath::Sin(3*psin[3][14]);
692  // Float_t Vs_3_x = Vs_3_x_minus + Vs_3_x_plus;
693  // Float_t Vs_3_y = Vs_3_y_minus + Vs_3_y_plus;
694 
695  // Float_t Vs_4_x_minus = sumpT[0]*vn[4][0]*TMath::Cos(4*psin[4][0]);
696  // Float_t Vs_4_x_plus = sumpT[14]*vn[4][14]*TMath::Cos(4*psin[4][14]);
697  // Float_t Vs_4_y_minus = sumpT[0]*vn[4][0]*TMath::Sin(4*psin[4][0]);
698  // Float_t Vs_4_y_plus = sumpT[14]*vn[4][14]*TMath::Sin(4*psin[4][14]);
699  // Float_t Vs_4_x = Vs_4_x_minus + Vs_4_x_plus;
700  // Float_t Vs_4_y = Vs_4_y_minus + Vs_4_y_plus;
701 
702  mVs_0_x->Fill(Vs_0_x);
703  mVs_0_y->Fill(Vs_0_y);
704  mVs_1_x->Fill(Vs_1_x);
705  mVs_1_y->Fill(Vs_1_y);
706  mVs_2_x->Fill(Vs_2_x);
707  mVs_2_y->Fill(Vs_2_y);
708 
709  mVs_0_x_versus_HF->Fill(HF_energy,Vs_0_x);
710  mVs_0_y_versus_HF->Fill(HF_energy,Vs_0_y);
711  mVs_1_x_versus_HF->Fill(HF_energy,Vs_1_x);
712  mVs_1_y_versus_HF->Fill(HF_energy,Vs_1_y);
713  mVs_2_x_versus_HF->Fill(HF_energy,Vs_2_x);
714  mVs_2_y_versus_HF->Fill(HF_energy,Vs_2_y);
715 
716  Float_t DeltapT = 0;
717 
718  if(isCaloJet){
719 
720  Float_t SumCaloVsPtInitial[etaBins_];
721  Float_t SumCaloVsPt[etaBins_];
722  Float_t SumCaloPt[etaBins_];
723 
724  Float_t SumSquaredCaloVsPtInitial[etaBins_];
725  Float_t SumSquaredCaloVsPt[etaBins_];
726  Float_t SumSquaredCaloPt[etaBins_];
727 
728  for(int i = 0;i<etaBins_;i++){
729 
730  SumCaloVsPtInitial[i] = 0;
731  SumCaloVsPt[i] = 0;
732  SumCaloPt[i] = 0;
733  SumSquaredCaloVsPtInitial[i] = 0;
734  SumSquaredCaloVsPt[i] = 0;
735  SumSquaredCaloPt[i] = 0;
736 
737  }
738 
739  for(unsigned icand = 0;icand<caloCandidates->size(); icand++){
740 
741  const CaloTower & tower = (*caloCandidates)[icand];
742  reco::CandidateViewRef ref(calocandidates_,icand);
743  //10 is tower pT min
744  //if(getEt(caloCandidates.id(),caloCandidates.energy())<10) continue;
745  if(tower.p4(vtx).Et() < 0.1) continue;
746 
747  DeltapT = 0;
748  vsPt = 0;
749  vsPtInitial = 0;
750  vsArea = 0;
751 
752  if(std::string("Vs")==UEAlgo) {
753  const reco::VoronoiBackground& voronoi = (*VsBackgrounds)[ref];
754  vsPt = voronoi.pt();
755  vsPtInitial = voronoi.pt_subtracted();
756  vsArea = voronoi.area();
757  }
758 
759  NCaloTower++;
760 
761  caloPt = tower.p4(vtx).Et();
762  caloEta = tower.p4(vtx).Eta();
763  caloPhi = tower.p4(vtx).Phi();
764 
765  mCaloVsPtInitial_eta_phi->Fill(caloEta,caloPhi,vsPtInitial);
766  mCaloVsPt_eta_phi->Fill(caloEta,caloPhi,vsPt);
767  mCaloPt_eta_phi->Fill(caloEta,caloPhi,caloPt);
768 
769  DeltapT = caloPt - vsPtInitial;
770  mDeltapT->Fill(DeltapT);
771  mDeltapT_eta->Fill(caloEta,DeltapT);
772  mDeltapT_eta_phi->Fill(caloEta,caloPhi,DeltapT);
773 
774  for(size_t k = 0;k<nedge_pseudorapidity-1; k++){
775  if(caloEta >= edge_pseudorapidity[k] && caloEta < edge_pseudorapidity[k+1]){
776  SumCaloVsPtInitial[k] = SumCaloVsPtInitial[k] + vsPtInitial;
777  SumCaloVsPt[k] = SumCaloVsPt[k] + vsPt;
778  SumCaloPt[k] = SumCaloPt[k] + caloPt;
779  SumSquaredCaloVsPtInitial[k] = SumSquaredCaloVsPtInitial[k] + vsPtInitial*vsPtInitial;
780  SumSquaredCaloVsPt[k] = SumSquaredCaloVsPt[k] + vsPt*vsPt;
781  SumSquaredCaloPt[k] = SumSquaredCaloPt[k] + caloPt*caloPt;
782  break;
783  }// eta selection statement
784 
785  }// eta bin loop
786 
787  SumPt_value = SumPt_value + caloPt;
788 
789  mCaloPt->Fill(caloPt);
790  mCaloEta->Fill(caloEta);
791  mCaloPhi->Fill(caloPhi);
792  mCaloVsPt->Fill(vsPt);
793  mCaloVsPtInitial->Fill(vsPtInitial);
794  //mCaloVsPtEqualized
795  mCaloArea->Fill(vsArea);
796 
797  }// calo tower candidate loop
798 
799  Float_t Evt_SumCaloVsPt = 0;
800  Float_t Evt_SumCaloVsPtInitial = 0;
801  Float_t Evt_SumCaloPt = 0;
802 
803  Float_t Evt_SumSquaredCaloVsPt = 0;
804  Float_t Evt_SumSquaredCaloVsPtInitial = 0;
805  Float_t Evt_SumSquaredCaloPt = 0;
806 
807 
808  mSumCaloVsPtInitial_n5p191_n2p650->Fill(SumCaloVsPtInitial[0]);
809  mSumCaloVsPtInitial_n2p650_n2p043->Fill(SumCaloVsPtInitial[1]);
810  mSumCaloVsPtInitial_n2p043_n1p740->Fill(SumCaloVsPtInitial[2]);
811  mSumCaloVsPtInitial_n1p740_n1p479->Fill(SumCaloVsPtInitial[3]);
812  mSumCaloVsPtInitial_n1p479_n1p131->Fill(SumCaloVsPtInitial[4]);
813  mSumCaloVsPtInitial_n1p131_n0p783->Fill(SumCaloVsPtInitial[5]);
814  mSumCaloVsPtInitial_n0p783_n0p522->Fill(SumCaloVsPtInitial[6]);
815  mSumCaloVsPtInitial_n0p522_0p522->Fill(SumCaloVsPtInitial[7]);
816  mSumCaloVsPtInitial_0p522_0p783->Fill(SumCaloVsPtInitial[8]);
817  mSumCaloVsPtInitial_0p783_1p131->Fill(SumCaloVsPtInitial[9]);
818  mSumCaloVsPtInitial_1p131_1p479->Fill(SumCaloVsPtInitial[10]);
819  mSumCaloVsPtInitial_1p479_1p740->Fill(SumCaloVsPtInitial[11]);
820  mSumCaloVsPtInitial_1p740_2p043->Fill(SumCaloVsPtInitial[12]);
821  mSumCaloVsPtInitial_2p043_2p650->Fill(SumCaloVsPtInitial[13]);
822  mSumCaloVsPtInitial_2p650_5p191->Fill(SumCaloVsPtInitial[14]);
823 
824  mSumCaloVsPt_n5p191_n2p650->Fill(SumCaloVsPt[0]);
825  mSumCaloVsPt_n2p650_n2p043->Fill(SumCaloVsPt[1]);
826  mSumCaloVsPt_n2p043_n1p740->Fill(SumCaloVsPt[2]);
827  mSumCaloVsPt_n1p740_n1p479->Fill(SumCaloVsPt[3]);
828  mSumCaloVsPt_n1p479_n1p131->Fill(SumCaloVsPt[4]);
829  mSumCaloVsPt_n1p131_n0p783->Fill(SumCaloVsPt[5]);
830  mSumCaloVsPt_n0p783_n0p522->Fill(SumCaloVsPt[6]);
831  mSumCaloVsPt_n0p522_0p522->Fill(SumCaloVsPt[7]);
832  mSumCaloVsPt_0p522_0p783->Fill(SumCaloVsPt[8]);
833  mSumCaloVsPt_0p783_1p131->Fill(SumCaloVsPt[9]);
834  mSumCaloVsPt_1p131_1p479->Fill(SumCaloVsPt[10]);
835  mSumCaloVsPt_1p479_1p740->Fill(SumCaloVsPt[11]);
836  mSumCaloVsPt_1p740_2p043->Fill(SumCaloVsPt[12]);
837  mSumCaloVsPt_2p043_2p650->Fill(SumCaloVsPt[13]);
838  mSumCaloVsPt_2p650_5p191->Fill(SumCaloVsPt[14]);
839 
840  mSumCaloPt_n5p191_n2p650->Fill(SumCaloPt[0]);
841  mSumCaloPt_n2p650_n2p043->Fill(SumCaloPt[1]);
842  mSumCaloPt_n2p043_n1p740->Fill(SumCaloPt[2]);
843  mSumCaloPt_n1p740_n1p479->Fill(SumCaloPt[3]);
844  mSumCaloPt_n1p479_n1p131->Fill(SumCaloPt[4]);
845  mSumCaloPt_n1p131_n0p783->Fill(SumCaloPt[5]);
846  mSumCaloPt_n0p783_n0p522->Fill(SumCaloPt[6]);
847  mSumCaloPt_n0p522_0p522->Fill(SumCaloPt[7]);
848  mSumCaloPt_0p522_0p783->Fill(SumCaloPt[8]);
849  mSumCaloPt_0p783_1p131->Fill(SumCaloPt[9]);
850  mSumCaloPt_1p131_1p479->Fill(SumCaloPt[10]);
851  mSumCaloPt_1p479_1p740->Fill(SumCaloPt[11]);
852  mSumCaloPt_1p740_2p043->Fill(SumCaloPt[12]);
853  mSumCaloPt_2p043_2p650->Fill(SumCaloPt[13]);
854  mSumCaloPt_2p650_5p191->Fill(SumCaloPt[14]);
855 
856 
857  for(size_t k = 0;k<nedge_pseudorapidity-1;k++){
858 
859  //mSumCaloVsPtInitial->Fill(SumCaloVsPtInitial[k]);
860  Evt_SumCaloVsPtInitial = Evt_SumCaloVsPtInitial + SumCaloVsPtInitial[k];
861  //mSumCaloVsPt->Fill(SumCaloVsPt[k]);
862  Evt_SumCaloVsPt = Evt_SumCaloVsPt + SumCaloVsPt[k];
863  //mSumCaloPt->Fill(SumCaloPt[k]);
864  Evt_SumCaloPt = Evt_SumCaloPt + SumCaloPt[k];
865 
866  mSumCaloVsPtInitial_eta->Fill(edge_pseudorapidity[k],SumCaloVsPtInitial[k]);
867  mSumCaloVsPt_eta->Fill(edge_pseudorapidity[k],SumCaloVsPt[k]);
868  mSumCaloPt_eta->Fill(edge_pseudorapidity[k],SumCaloPt[k]);
869 
870 
871  //mSumSquaredCaloVsPtInitial->Fill(SumSquaredCaloVsPtInitial[k]);
872  Evt_SumSquaredCaloVsPtInitial = Evt_SumSquaredCaloVsPtInitial + SumSquaredCaloVsPtInitial[k];
873  //mSumSquaredCaloVsPt->Fill(SumSquaredCaloVsPt[k]);
874  Evt_SumSquaredCaloVsPt = Evt_SumSquaredCaloVsPt + SumSquaredCaloVsPt[k];
875  //mSumSquaredCaloPt->Fill(SumSquaredCaloPt[k]);
876  Evt_SumSquaredCaloPt = Evt_SumSquaredCaloPt + SumSquaredCaloPt[k];
877 
878  mSumSquaredCaloVsPtInitial_eta->Fill(edge_pseudorapidity[k],SumSquaredCaloVsPtInitial[k]);
879  mSumSquaredCaloVsPt_eta->Fill(edge_pseudorapidity[k],SumSquaredCaloVsPt[k]);
880  mSumSquaredCaloPt_eta->Fill(edge_pseudorapidity[k],SumSquaredCaloPt[k]);
881 
882 
883  }// eta bin loop
884 
885  mSumCaloVsPtInitial->Fill(Evt_SumCaloVsPtInitial);
886  mSumCaloVsPt->Fill(Evt_SumCaloVsPt);
887  mSumCaloPt->Fill(Evt_SumCaloPt);
888  mSumCaloVsPtInitial_HF->Fill(Evt_SumCaloVsPtInitial,HF_energy);
889  mSumCaloVsPt_HF->Fill(Evt_SumCaloVsPt,HF_energy);
890  mSumCaloPt_HF->Fill(Evt_SumCaloPt,HF_energy);
891 
892  mSumSquaredCaloVsPtInitial->Fill(Evt_SumSquaredCaloVsPtInitial);
893  mSumSquaredCaloVsPt->Fill(Evt_SumSquaredCaloVsPt);
894  mSumSquaredCaloPt->Fill(Evt_SumSquaredCaloPt);
895 
896  mNCalopart->Fill(NCaloTower);
897  mSumpt->Fill(SumPt_value);
898 
899  }// is calo jet
900 
901  if(isPFJet){
902 
903  Float_t SumPFVsPtInitial[etaBins_];
904  Float_t SumPFVsPt[etaBins_];
905  Float_t SumPFPt[etaBins_];
906 
907  Float_t SumSquaredPFVsPtInitial[etaBins_];
908  Float_t SumSquaredPFVsPt[etaBins_];
909  Float_t SumSquaredPFPt[etaBins_];
910 
911  for(int i = 0;i<etaBins_;i++){
912 
913  SumPFVsPtInitial[i] = 0;
914  SumPFVsPt[i] = 0;
915  SumPFPt[i] = 0;
916  SumSquaredPFVsPtInitial[i] = 0;
917  SumSquaredPFVsPt[i] = 0;
918  SumSquaredPFPt[i] = 0;
919 
920  }
921 
922  for(unsigned icand=0;icand<pfCandidateColl->size(); icand++){
923 
924  const reco::PFCandidate pfCandidate = pfCandidateColl->at(icand);
925  reco::CandidateViewRef ref(pfcandidates_,icand);
926 
927  if(pfCandidate.pt() < 5) continue;
928 
929  if(std::string("Vs")==UEAlgo) {
930 
931  const reco::VoronoiBackground& voronoi = (*VsBackgrounds)[ref];
932  vsPt = voronoi.pt();
933  vsPtInitial = voronoi.pt_subtracted();
934  vsArea = voronoi.area();
935 
936  }
937 
938  NPFpart++;
939  pfPt = pfCandidate.pt();
940  pfEta = pfCandidate.eta();
941  pfPhi = pfCandidate.phi();
942 
943  mPFVsPtInitial_eta_phi->Fill(pfEta,pfPhi,vsPtInitial);
944  mPFVsPt_eta_phi->Fill(pfEta,pfPhi,vsPt);
945  mPFPt_eta_phi->Fill(pfEta,pfPhi,pfPt);
946 
947  DeltapT = pfPt - vsPtInitial;
948  mDeltapT->Fill(DeltapT);
949  mDeltapT_eta->Fill(pfEta,DeltapT);
950  mDeltapT_eta_phi->Fill(pfEta,pfPhi,DeltapT);
951 
952 
953  for(size_t k = 0;k<nedge_pseudorapidity-1; k++){
954  if(pfEta >= edge_pseudorapidity[k] && pfEta < edge_pseudorapidity[k+1]){
955  SumPFVsPtInitial[k] = SumPFVsPtInitial[k] + vsPtInitial;
956  SumPFVsPt[k] = SumPFVsPt[k] + vsPt;
957  SumPFPt[k] = SumPFPt[k] + pfPt;
958 
959  SumSquaredPFVsPtInitial[k] = SumSquaredPFVsPtInitial[k] + vsPtInitial*vsPtInitial;
960  SumSquaredPFVsPt[k] = SumSquaredPFVsPt[k] + vsPt*vsPt;
961  SumSquaredPFPt[k] = SumSquaredPFPt[k] + pfPt*pfPt;
962  break;
963  }// eta selection statement
964 
965  }// eta bin loop
966 
967  SumPt_value = SumPt_value + pfPt;
968 
969  mPFPt->Fill(pfPt);
970  mPFEta->Fill(pfEta);
971  mPFPhi->Fill(pfPhi);
972  mPFVsPt->Fill(vsPt);
973  mPFVsPtInitial->Fill(vsPtInitial);
974  //mPFVsPtEqualized
975  mPFArea->Fill(vsArea);
976 
977  }// pf candidate loop
978 
979  Float_t Evt_SumPFVsPt = 0;
980  Float_t Evt_SumPFVsPtInitial = 0;
981  Float_t Evt_SumPFPt = 0;
982  Float_t Evt_SumSquaredPFVsPt = 0;
983  Float_t Evt_SumSquaredPFVsPtInitial = 0;
984  Float_t Evt_SumSquaredPFPt = 0;
985 
986  mSumPFVsPtInitial_n5p191_n2p650->Fill(SumPFVsPtInitial[0]);
987  mSumPFVsPtInitial_n2p650_n2p043->Fill(SumPFVsPtInitial[1]);
988  mSumPFVsPtInitial_n2p043_n1p740->Fill(SumPFVsPtInitial[2]);
989  mSumPFVsPtInitial_n1p740_n1p479->Fill(SumPFVsPtInitial[3]);
990  mSumPFVsPtInitial_n1p479_n1p131->Fill(SumPFVsPtInitial[4]);
991  mSumPFVsPtInitial_n1p131_n0p783->Fill(SumPFVsPtInitial[5]);
992  mSumPFVsPtInitial_n0p783_n0p522->Fill(SumPFVsPtInitial[6]);
993  mSumPFVsPtInitial_n0p522_0p522->Fill(SumPFVsPtInitial[7]);
994  mSumPFVsPtInitial_0p522_0p783->Fill(SumPFVsPtInitial[8]);
995  mSumPFVsPtInitial_0p783_1p131->Fill(SumPFVsPtInitial[9]);
996  mSumPFVsPtInitial_1p131_1p479->Fill(SumPFVsPtInitial[10]);
997  mSumPFVsPtInitial_1p479_1p740->Fill(SumPFVsPtInitial[11]);
998  mSumPFVsPtInitial_1p740_2p043->Fill(SumPFVsPtInitial[12]);
999  mSumPFVsPtInitial_2p043_2p650->Fill(SumPFVsPtInitial[13]);
1000  mSumPFVsPtInitial_2p650_5p191->Fill(SumPFVsPtInitial[14]);
1001 
1002  mSumPFVsPt_n5p191_n2p650->Fill(SumPFVsPt[0]);
1003  mSumPFVsPt_n2p650_n2p043->Fill(SumPFVsPt[1]);
1004  mSumPFVsPt_n2p043_n1p740->Fill(SumPFVsPt[2]);
1005  mSumPFVsPt_n1p740_n1p479->Fill(SumPFVsPt[3]);
1006  mSumPFVsPt_n1p479_n1p131->Fill(SumPFVsPt[4]);
1007  mSumPFVsPt_n1p131_n0p783->Fill(SumPFVsPt[5]);
1008  mSumPFVsPt_n0p783_n0p522->Fill(SumPFVsPt[6]);
1009  mSumPFVsPt_n0p522_0p522->Fill(SumPFVsPt[7]);
1010  mSumPFVsPt_0p522_0p783->Fill(SumPFVsPt[8]);
1011  mSumPFVsPt_0p783_1p131->Fill(SumPFVsPt[9]);
1012  mSumPFVsPt_1p131_1p479->Fill(SumPFVsPt[10]);
1013  mSumPFVsPt_1p479_1p740->Fill(SumPFVsPt[11]);
1014  mSumPFVsPt_1p740_2p043->Fill(SumPFVsPt[12]);
1015  mSumPFVsPt_2p043_2p650->Fill(SumPFVsPt[13]);
1016  mSumPFVsPt_2p650_5p191->Fill(SumPFVsPt[14]);
1017 
1018  mSumPFPt_n5p191_n2p650->Fill(SumPFPt[0]);
1019  mSumPFPt_n2p650_n2p043->Fill(SumPFPt[1]);
1020  mSumPFPt_n2p043_n1p740->Fill(SumPFPt[2]);
1021  mSumPFPt_n1p740_n1p479->Fill(SumPFPt[3]);
1022  mSumPFPt_n1p479_n1p131->Fill(SumPFPt[4]);
1023  mSumPFPt_n1p131_n0p783->Fill(SumPFPt[5]);
1024  mSumPFPt_n0p783_n0p522->Fill(SumPFPt[6]);
1025  mSumPFPt_n0p522_0p522->Fill(SumPFPt[7]);
1026  mSumPFPt_0p522_0p783->Fill(SumPFPt[8]);
1027  mSumPFPt_0p783_1p131->Fill(SumPFPt[9]);
1028  mSumPFPt_1p131_1p479->Fill(SumPFPt[10]);
1029  mSumPFPt_1p479_1p740->Fill(SumPFPt[11]);
1030  mSumPFPt_1p740_2p043->Fill(SumPFPt[12]);
1031  mSumPFPt_2p043_2p650->Fill(SumPFPt[13]);
1032  mSumPFPt_2p650_5p191->Fill(SumPFPt[14]);
1033 
1034  for(size_t k = 0;k<nedge_pseudorapidity-1;k++){
1035 
1036  //mSumPFVsPtInitial->Fill(SumPFVsPtInitial[k]);
1037  Evt_SumPFVsPtInitial = Evt_SumPFVsPtInitial + SumPFVsPtInitial[k];
1038  //mSumPFVsPt->Fill(SumPFVsPt[k]);
1039  Evt_SumPFVsPt = Evt_SumPFVsPt + SumPFVsPt[k];
1040  //mSumPFPt->Fill(SumPFPt[k]);
1041  Evt_SumPFPt = Evt_SumPFPt + SumPFPt[k];
1042 
1043  mSumPFVsPtInitial_eta->Fill(edge_pseudorapidity[k],SumPFVsPtInitial[k]);
1044  mSumPFVsPt_eta->Fill(edge_pseudorapidity[k],SumPFVsPt[k]);
1045  mSumPFPt_eta->Fill(edge_pseudorapidity[k],SumPFPt[k]);
1046 
1047  //mSumSquaredPFVsPtInitial->Fill(SumSquaredPFVsPtInitial[k]);
1048  Evt_SumSquaredPFVsPtInitial = Evt_SumSquaredPFVsPtInitial + SumSquaredPFVsPtInitial[k];
1049  //mSumSquaredPFVsPt->Fill(SumSquaredPFVsPt[k]);
1050  Evt_SumSquaredPFVsPt = Evt_SumSquaredPFVsPt + SumSquaredPFVsPt[k];
1051  //mSumSquaredPFPt->Fill(SumSquaredPFPt[k]);
1052  Evt_SumSquaredPFPt = Evt_SumSquaredPFPt + SumSquaredPFPt[k];
1053 
1054  mSumSquaredPFVsPtInitial_eta->Fill(edge_pseudorapidity[k],SumSquaredPFVsPtInitial[k]);
1055  mSumSquaredPFVsPt_eta->Fill(edge_pseudorapidity[k],SumSquaredPFVsPt[k]);
1056  mSumSquaredPFPt_eta->Fill(edge_pseudorapidity[k],SumSquaredPFPt[k]);
1057 
1058  }// eta bin loop
1059 
1060  mSumPFVsPtInitial->Fill(Evt_SumPFVsPtInitial);
1061  mSumPFVsPt->Fill(Evt_SumPFVsPt);
1062  mSumPFPt->Fill(Evt_SumPFPt);
1063  mSumPFVsPtInitial_HF->Fill(Evt_SumPFVsPtInitial,HF_energy);
1064  mSumPFVsPt_HF->Fill(Evt_SumPFVsPt,HF_energy);
1065  mSumPFPt_HF->Fill(Evt_SumPFPt,HF_energy);
1066 
1067  mSumSquaredPFVsPtInitial->Fill(Evt_SumSquaredPFVsPtInitial);
1068  mSumSquaredPFVsPt->Fill(Evt_SumSquaredPFVsPt);
1069  mSumSquaredPFPt->Fill(Evt_SumSquaredPFPt);
1070 
1071  mNPFpart->Fill(NPFpart);
1072  mSumpt->Fill(SumPt_value);
1073 
1074  }
1075 
1076 
1077  if (isCaloJet)
1078  {
1079  for (unsigned ijet=0; ijet<caloJets->size(); ijet++) recoJets.push_back((*caloJets)[ijet]);
1080  }
1081 
1082  if (isJPTJet)
1083  {
1084  for (unsigned ijet=0; ijet<jptJets->size(); ijet++) recoJets.push_back((*jptJets)[ijet]);
1085  }
1086 
1087  if (isPFJet) {
1088  if(std::string("Pu")==UEAlgo){
1089  for (unsigned ijet=0; ijet<basicJets->size();ijet++) recoJets.push_back((*basicJets)[ijet]);
1090  }
1091  if(std::string("Vs")==UEAlgo){
1092  for (unsigned ijet=0; ijet<pfJets->size(); ijet++) recoJets.push_back((*pfJets)[ijet]);
1093  }
1094  }
1095 
1096 
1097 
1098  if (isCaloJet && !caloJets.isValid()) return;
1099  if (isJPTJet && !jptJets.isValid()) return;
1100  if (isPFJet){
1101  if(std::string("Pu")==UEAlgo){if(!basicJets.isValid()) return;}
1102  if(std::string("Vs")==UEAlgo){if(!pfJets.isValid()) return;}
1103  }
1104 
1105 
1106  // int nJet_E_20_40 = 0;
1107  // int nJet_B_20_40 = 0;
1108  // int nJet_E_40 = 0;
1109  // int nJet_B_40 = 0;
1110  int nJet_40 = 0;
1111 
1112  mNJets->Fill(recoJets.size());
1113 
1114  for (unsigned ijet=0; ijet<recoJets.size(); ijet++) {
1115 
1116 
1117  if (recoJets[ijet].pt() > mRecoJetPtThreshold) {
1118  //counting forward and barrel jets
1119 
1120  // get an idea of no of jets with pT>40 GeV
1121  if(recoJets[ijet].pt() > 40)
1122  nJet_40++;
1123 
1124  if (mEta) mEta->Fill(recoJets[ijet].eta());
1125  if (mjetpileup) mjetpileup->Fill(recoJets[ijet].pileup());
1126  if (mJetArea) mJetArea ->Fill(recoJets[ijet].jetArea());
1127  if (mPhi) mPhi ->Fill(recoJets[ijet].phi());
1128  if (mEnergy) mEnergy ->Fill(recoJets[ijet].energy());
1129  if (mP) mP ->Fill(recoJets[ijet].p());
1130  if (mPt) mPt ->Fill(recoJets[ijet].pt());
1131  if (mMass) mMass ->Fill(recoJets[ijet].mass());
1132  if (mConstituents) mConstituents->Fill(recoJets[ijet].nConstituents());
1133 
1134  }
1135  }
1136 
1137  if (mNJets_40) mNJets_40->Fill(nJet_40);
1138 
1139 }
1140 
static const Int_t etaBins_
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken_
const double Pi
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandToken_
MonitorElement * mSumPFVsPt_2p650_5p191
int i
Definition: DBlmapReader.cc:9
MonitorElement * mSumCaloVsPt_HF
MonitorElement * mSumCaloVsPtInitial_n2p043_n1p740
MonitorElement * mSumCaloVsPt_n5p191_n2p650
MonitorElement * mSumCaloVsPt_n1p131_n0p783
MonitorElement * mSumSquaredPFPt
MonitorElement * mSumPFVsPtInitial
edm::EDGetTokenT< reco::CandidateView > caloCandViewToken_
MonitorElement * mSumCaloPt_n2p043_n1p740
MonitorElement * mPFVsPtInitial_eta_phi
edm::EDGetTokenT< reco::JPTJetCollection > jptJetsToken_
MonitorElement * mSumCaloVsPtInitial_HF
MonitorElement * mSumPFVsPtInitial_1p131_1p479
MonitorElement * mSumSquaredCaloVsPt_eta
MonitorElement * mSumPFVsPt_n5p191_n2p650
MonitorElement * mSumCaloVsPtInitial_n2p650_n2p043
MonitorElement * mCaloVsPtInitial
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
Definition: CaloTower.cc:129
MonitorElement * mSumCaloVsPt_1p479_1p740
MonitorElement * mSumCaloVsPt_n2p650_n2p043
MonitorElement * mSumCaloVsPt_n0p783_n0p522
MonitorElement * mSumSquaredCaloVsPtInitial_eta
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
MonitorElement * mSumCaloVsPtInitial_1p479_1p740
MonitorElement * mSumPFVsPt_n2p043_n1p740
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
MonitorElement * mSumCaloVsPtInitial_1p131_1p479
MonitorElement * mPFVsPt_eta_phi
MonitorElement * mSumCaloPt_0p783_1p131
Definition: DDAxes.h:10
edm::EDGetTokenT< std::vector< float > > backgrounds_value_
MonitorElement * mSumCaloVsPtInitial_n1p479_n1p131
MonitorElement * mSumPFPt_n0p522_0p522
MonitorElement * mSumSquaredCaloPt
MonitorElement * mSumPFPt_2p043_2p650
MonitorElement * mSumPFVsPt_0p522_0p783
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * mSumSquaredCaloVsPtInitial
MonitorElement * mSumCaloPt_1p131_1p479
MonitorElement * mSumSquaredPFVsPt_eta
MonitorElement * mSumPFVsPt_eta
MonitorElement * mSumPFVsPtInitial_2p650_5p191
MonitorElement * mSumCaloVsPt_1p131_1p479
MonitorElement * mSumPFPt_n1p740_n1p479
MonitorElement * mDeltapT_eta_phi
MonitorElement * mSumPFVsPtInitial_n2p650_n2p043
MonitorElement * mCaloVsPtInitial_eta_phi
T eta() const
MonitorElement * mSumPFPt_2p650_5p191
MonitorElement * mSumPFVsPtInitial_0p783_1p131
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
MonitorElement * mSumPFVsPtInitial_n0p783_n0p522
MonitorElement * mVs_1_y_versus_HF
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
float float float z
MonitorElement * mSumCaloPt_eta
MonitorElement * mSumPFPt_0p522_0p783
MonitorElement * mSumPFPt_n2p650_n2p043
static const size_t nedge_pseudorapidity
MonitorElement * mSumCaloPt_n1p740_n1p479
void Fill(long long x)
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
MonitorElement * mSumPFVsPt_1p740_2p043
MonitorElement * mCaloPt_eta_phi
MonitorElement * mSumCaloPt_0p522_0p783
MonitorElement * mSumCaloVsPt_n1p479_n1p131
MonitorElement * mSumCaloPt_n2p650_n2p043
MonitorElement * mSumPFPt_0p783_1p131
static const Int_t fourierOrder_
MonitorElement * mSumCaloPt_1p479_1p740
MonitorElement * mSumPFVsPt_1p479_1p740
MonitorElement * mSumPFVsPt_HF
MonitorElement * mSumCaloVsPtInitial_0p522_0p783
MonitorElement * mSumCaloPt_HF
MonitorElement * mPFVsPtInitial
MonitorElement * mSumCaloVsPtInitial_n0p522_0p522
MonitorElement * mSumPFVsPtInitial_n1p479_n1p131
MonitorElement * mSumPFVsPt_n2p650_n2p043
MonitorElement * mSumPFVsPt_n0p522_0p522
MonitorElement * mVs_0_y_versus_HF
MonitorElement * mSumSquaredPFVsPtInitial
MonitorElement * mSumCaloVsPtInitial_n1p131_n0p783
MonitorElement * mSumSquaredCaloVsPt
MonitorElement * mSumPFVsPt_1p131_1p479
MonitorElement * mSumPFPt_1p131_1p479
MonitorElement * mSumPFVsPtInitial_1p479_1p740
MonitorElement * mSumPFVsPt_n0p783_n0p522
MonitorElement * mVs_1_x_versus_HF
MonitorElement * mSumPFPt_n1p479_n1p131
edm::EDGetTokenT< std::vector< reco::Vertex > > hiVertexToken_
MonitorElement * mConstituents
const reco::GenParticle * daughter(const reco::GenParticle &p, unsigned int idau)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * mSumPFVsPt_n1p479_n1p131
MonitorElement * mSumSquaredPFVsPt
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
MonitorElement * mSumCaloVsPt_n1p740_n1p479
MonitorElement * mSumCaloVsPtInitial_1p740_2p043
MonitorElement * mSumCaloPt_n0p783_n0p522
MonitorElement * mSumSquaredCaloPt_eta
edm::EDGetTokenT< reco::Centrality > centralityToken_
MonitorElement * mSumCaloVsPtInitial_2p043_2p650
bool isValid() const
Definition: HandleBase.h:75
MonitorElement * mSumCaloPt_n0p522_0p522
MonitorElement * mSumPFVsPtInitial_n2p043_n1p740
MonitorElement * mSumCaloVsPt_n2p043_n1p740
MonitorElement * mSumPFPt_n5p191_n2p650
MonitorElement * mSumPFVsPt_2p043_2p650
MonitorElement * mSumCaloVsPt_1p740_2p043
MonitorElement * mSumCaloVsPt_n0p522_0p522
MonitorElement * mSumCaloVsPt_2p650_5p191
MonitorElement * mSumPFVsPtInitial_n5p191_n2p650
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_
MonitorElement * mSumPFVsPtInitial_HF
MonitorElement * mSumCaloVsPtInitial_n1p740_n1p479
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
MonitorElement * mSumPFPt_1p479_1p740
MonitorElement * mSumCaloPt_2p650_5p191
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
edm::InputTag mInputPFCandCollection
MonitorElement * mSumPFVsPtInitial_n1p131_n0p783
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< edm::ValueMap< reco::VoronoiBackground > > backgrounds_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * mSumSquaredPFPt_eta
MonitorElement * mSumPFPt_n1p131_n0p783
MonitorElement * mVs_0_x_versus_HF
MonitorElement * mSumCaloVsPtInitial_n5p191_n2p650
tuple recoJets
Definition: RecoJets_cff.py:56
MonitorElement * mSumCaloVsPtInitial
edm::EDGetTokenT< reco::CandidateView > pfCandViewToken_
MonitorElement * mSumCaloVsPtInitial_eta
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken_
MonitorElement * mSumCaloVsPtInitial_0p783_1p131
MonitorElement * mSumPFPt_1p740_2p043
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * mSumCaloPt_n5p191_n2p650
MonitorElement * mSumPFPt_n0p783_n0p522
MonitorElement * mSumCaloPt_2p043_2p650
std::string const & label() const
Definition: InputTag.h:42
MonitorElement * mSumCaloPt_n1p131_n0p783
MonitorElement * mPFPt_eta_phi
MonitorElement * mSumPFPt_n2p043_n1p740
double pt_subtracted() const
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:39
static int position[264][3]
Definition: ReadPGInfo.cc:509
MonitorElement * mSumCaloVsPtInitial_n0p783_n0p522
MonitorElement * mSumCaloVsPtInitial_2p650_5p191
tuple cout
Definition: gather_cfg.py:121
double get_sum_pt(int eta, int type=-1) const
Definition: UEParameters.cc:24
MonitorElement * mSumPFVsPtInitial_0p522_0p783
MonitorElement * mSumPFVsPt_0p783_1p131
MonitorElement * mVs_2_y_versus_HF
MonitorElement * mSumCaloPt_n1p479_n1p131
MonitorElement * mSumPFVsPtInitial_n1p740_n1p479
JetAnalyzer_HeavyIons(const edm::ParameterSet &)
MonitorElement * mVs_2_x_versus_HF
MonitorElement * mSumPFVsPtInitial_1p740_2p043
MonitorElement * mCaloVsPt_eta_phi
tuple pfJets
Definition: pfJets_cff.py:8
virtual double phi() const
momentum azimuthal angle
MonitorElement * mSumPFVsPt_n1p740_n1p479
MonitorElement * mSumSquaredPFVsPtInitial_eta
MonitorElement * mSumPFVsPt_n1p131_n0p783
MonitorElement * mSumPFVsPtInitial_2p043_2p650
MonitorElement * mSumCaloVsPt_eta
MonitorElement * mSumCaloVsPt_0p522_0p783
MonitorElement * mSumPFVsPtInitial_eta
Definition: Run.h:41
MonitorElement * mSumCaloVsPt_0p783_1p131
MonitorElement * mSumCaloPt_1p740_2p043
MonitorElement * mSumPFVsPtInitial_n0p522_0p522
Definition: DDAxes.h:10
MonitorElement * mSumCaloVsPt_2p043_2p650