CMS 3D CMS Logo

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, Mohammed Zakaria (co Author)
5 // Jan 12th 2015
6 // Rutgers University, email: raghav.k.e at CERN dot CH
7 // UIC, email: mzakaria @ CERN dot CH
8 
10 
11 using namespace edm;
12 using namespace reco;
13 using namespace std;
14 
15 // declare the constructors:
16 
18  : mInputCollection(iConfig.getParameter<edm::InputTag>("src")),
19  mInputVtxCollection(iConfig.getUntrackedParameter<edm::InputTag>("srcVtx", edm::InputTag("hiSelectedVertex"))),
20  mInputPFCandCollection(iConfig.getParameter<edm::InputTag>("PFcands")),
21  mInputCsCandCollection(iConfig.exists("CScands") ? iConfig.getParameter<edm::InputTag>("CScands")
22  : edm::InputTag()),
23  mOutputFile(iConfig.getUntrackedParameter<std::string>("OutputFile", "")),
24  JetType(iConfig.getUntrackedParameter<std::string>("JetType")),
25  UEAlgo(iConfig.getUntrackedParameter<std::string>("UEAlgo")),
26  mRecoJetPtThreshold(iConfig.getParameter<double>("recoJetPtThreshold")),
27  mReverseEnergyFractionThreshold(iConfig.getParameter<double>("reverseEnergyFractionThreshold")),
28  mRThreshold(iConfig.getParameter<double>("RThreshold")),
29  JetCorrectionService(iConfig.getParameter<std::string>("JetCorrections")) {
30  std::string inputCollectionLabel(mInputCollection.label());
31 
32  isCaloJet = (std::string("calo") == JetType);
33  isJPTJet = (std::string("jpt") == JetType);
34  isPFJet = (std::string("pf") == JetType);
35 
36  //consumes
37  pvToken_ = consumes<std::vector<reco::Vertex>>(edm::InputTag("offlinePrimaryVertices"));
38  caloTowersToken_ = consumes<CaloTowerCollection>(edm::InputTag("towerMaker"));
39  if (isCaloJet)
40  caloJetsToken_ = consumes<reco::CaloJetCollection>(mInputCollection);
41  if (isJPTJet)
42  jptJetsToken_ = consumes<reco::JPTJetCollection>(mInputCollection);
43  if (isPFJet) {
44  if (std::string("Pu") == UEAlgo)
45  basicJetsToken_ = consumes<reco::BasicJetCollection>(mInputCollection);
46  if (std::string("Cs") == UEAlgo)
47  pfJetsToken_ = consumes<reco::PFJetCollection>(mInputCollection);
48  }
49 
50  pfCandToken_ = consumes<reco::PFCandidateCollection>(mInputPFCandCollection);
51  csCandToken_ = mayConsume<reco::PFCandidateCollection>(mInputCsCandCollection);
52  pfCandViewToken_ = consumes<reco::CandidateView>(mInputPFCandCollection);
53  caloCandViewToken_ = consumes<reco::CandidateView>(edm::InputTag("towerMaker"));
54 
55  centralityTag_ = iConfig.getParameter<InputTag>("centralitycollection");
56  centralityToken = consumes<reco::Centrality>(centralityTag_);
57 
58  centralityBinToken = mayConsume<int>(iConfig.exists("centralitybincollection")
59  ? iConfig.getParameter<edm::InputTag>("centralitybincollection")
60  : edm::InputTag());
61 
62  hiVertexToken_ = consumes<std::vector<reco::Vertex>>(mInputVtxCollection);
63 
64  etaToken_ = mayConsume<std::vector<double>>(iConfig.exists("etaMap") ? iConfig.getParameter<edm::InputTag>("etaMap")
65  : edm::InputTag());
66  rhoToken_ = mayConsume<std::vector<double>>(iConfig.exists("rho") ? iConfig.getParameter<edm::InputTag>("rho")
67  : edm::InputTag());
68  rhomToken_ = mayConsume<std::vector<double>>(iConfig.exists("rhom") ? iConfig.getParameter<edm::InputTag>("rhom")
69  : edm::InputTag());
70 
71  // need to initialize the PF cand histograms : which are also event variables
72  if (isPFJet) {
73  mNPFpart = nullptr;
74  mPFPt = nullptr;
75  mPFEta = nullptr;
76  mPFPhi = nullptr;
77 
78  mSumPFPt = nullptr;
79  mSumPFPt_eta = nullptr;
80  mSumSquaredPFPt = nullptr;
81  mSumSquaredPFPt_eta = nullptr;
82  mSumPFPt_HF = nullptr;
83 
84  mPFDeltaR = nullptr;
85  mPFDeltaR_Scaled_R = nullptr;
86 
87  for (int ieta = 0; ieta < etaBins_; ieta++) {
88  mSumPFPtEtaDep[ieta] = nullptr;
89  }
90 
91  //cs-specific histograms
92  mRhoDist_vsEta = nullptr;
93  mRhoMDist_vsEta = nullptr;
94  mRhoDist_vsPt = nullptr;
95  mRhoMDist_vsPt = nullptr;
96 
97  rhoEtaRange = nullptr;
98  for (int ieta = 0; ieta < etaBins_; ieta++) {
99  mCSCandpT_vsPt[ieta] = nullptr;
100  mRhoDist_vsCent[ieta] = nullptr;
101  mRhoMDist_vsCent[ieta] = nullptr;
102  for (int ipt = 0; ipt < ptBins_; ipt++) {
103  mSubtractedEFrac[ipt][ieta] = nullptr;
104  mSubtractedE[ipt][ieta] = nullptr;
105  }
106  }
107 
108  mPFCandpT_vs_eta_Unknown = nullptr; // pf id 0
109  mPFCandpT_vs_eta_ChargedHadron = nullptr; // pf id - 1
110  mPFCandpT_vs_eta_electron = nullptr; // pf id - 2
111  mPFCandpT_vs_eta_muon = nullptr; // pf id - 3
112  mPFCandpT_vs_eta_photon = nullptr; // pf id - 4
113  mPFCandpT_vs_eta_NeutralHadron = nullptr; // pf id - 5
114  mPFCandpT_vs_eta_HadE_inHF = nullptr; // pf id - 6
115  mPFCandpT_vs_eta_EME_inHF = nullptr; // pf id - 7
116 
117  mPFCandpT_Barrel_Unknown = nullptr; // pf id 0
118  mPFCandpT_Barrel_ChargedHadron = nullptr; // pf id - 1
119  mPFCandpT_Barrel_electron = nullptr; // pf id - 2
120  mPFCandpT_Barrel_muon = nullptr; // pf id - 3
121  mPFCandpT_Barrel_photon = nullptr; // pf id - 4
122  mPFCandpT_Barrel_NeutralHadron = nullptr; // pf id - 5
123  mPFCandpT_Barrel_HadE_inHF = nullptr; // pf id - 6
124  mPFCandpT_Barrel_EME_inHF = nullptr; // pf id - 7
125 
126  mPFCandpT_Endcap_Unknown = nullptr; // pf id 0
127  mPFCandpT_Endcap_ChargedHadron = nullptr; // pf id - 1
128  mPFCandpT_Endcap_electron = nullptr; // pf id - 2
129  mPFCandpT_Endcap_muon = nullptr; // pf id - 3
130  mPFCandpT_Endcap_photon = nullptr; // pf id - 4
131  mPFCandpT_Endcap_NeutralHadron = nullptr; // pf id - 5
132  mPFCandpT_Endcap_HadE_inHF = nullptr; // pf id - 6
133  mPFCandpT_Endcap_EME_inHF = nullptr; // pf id - 7
134 
135  mPFCandpT_Forward_Unknown = nullptr; // pf id 0
136  mPFCandpT_Forward_ChargedHadron = nullptr; // pf id - 1
137  mPFCandpT_Forward_electron = nullptr; // pf id - 2
138  mPFCandpT_Forward_muon = nullptr; // pf id - 3
139  mPFCandpT_Forward_photon = nullptr; // pf id - 4
140  mPFCandpT_Forward_NeutralHadron = nullptr; // pf id - 5
141  mPFCandpT_Forward_HadE_inHF = nullptr; // pf id - 6
142  mPFCandpT_Forward_EME_inHF = nullptr; // pf id - 7
143  }
144  if (isCaloJet) {
145  mNCalopart = nullptr;
146  mCaloPt = nullptr;
147  mCaloEta = nullptr;
148  mCaloPhi = nullptr;
149 
150  mSumCaloPt = nullptr;
151  mSumCaloPt_eta = nullptr;
152  mSumSquaredCaloPt = nullptr;
153  mSumSquaredCaloPt_eta = nullptr;
154  mSumCaloPt_HF = nullptr;
155 
156  for (int ieta = 0; ieta < etaBins_; ieta++) {
157  mSumCaloPtEtaDep[ieta] = nullptr;
158  }
159  }
160 
161  mSumpt = nullptr;
162 
163  // Events variables
164  mNvtx = nullptr;
165  mHF = nullptr;
166 
167  // added Jan 12th 2015
168 
169  // Jet parameters
170  mEta = nullptr;
171  mPhi = nullptr;
172  mEnergy = nullptr;
173  mP = nullptr;
174  mPt = nullptr;
175  mMass = nullptr;
176  mConstituents = nullptr;
177  mJetArea = nullptr;
178  mjetpileup = nullptr;
179  mNJets_40 = nullptr;
180  mNJets = nullptr;
181 }
182 
184  edm::Run const &iRun,
185  edm::EventSetup const &iSetup) {
186  ibooker.setCurrentFolder("JetMET/HIJetValidation/" + mInputCollection.label());
187 
188  TH2F *h2D_etabins_vs_pt2 =
189  new TH2F("h2D_etabins_vs_pt2", ";#eta;sum p_{T}^{2}", etaBins_, edge_pseudorapidity, 10000, 0, 10000);
190  TH2F *h2D_etabins_vs_pt =
191  new TH2F("h2D_etabins_vs_pt", ";#eta;sum p_{T}", etaBins_, edge_pseudorapidity, 500, 0, 500);
192  TH2F *h2D_pfcand_etabins_vs_pt =
193  new TH2F("h2D_etabins_vs_pt", ";#eta;sum p_{T}", etaBins_, edge_pseudorapidity, 300, 0, 300);
194 
195  const int nHihfBins = 100;
196  const double hihfBins[nHihfBins + 1] = {
197  0, 11.282305, 11.82962, 12.344717, 13.029054, 13.698554, 14.36821, 15.140326,
198  15.845786, 16.684441, 17.449186, 18.364939, 19.247023, 20.448898, 21.776642, 22.870239,
199  24.405788, 26.366919, 28.340206, 30.661842, 33.657627, 36.656773, 40.028049, 44.274784,
200  48.583706, 52.981358, 56.860199, 61.559853, 66.663689, 72.768196, 78.265915, 84.744431,
201  92.483459, 100.281021, 108.646576, 117.023911, 125.901093, 135.224899, 147.046875, 159.864258,
202  171.06015, 184.76535, 197.687103, 212.873535, 229.276413, 245.175369, 262.498322, 280.54599,
203  299.570801, 317.188446, 336.99881, 357.960144, 374.725922, 400.638367, 426.062103, 453.07251,
204  483.99704, 517.556396, 549.421143, 578.050781, 608.358643, 640.940979, 680.361755, 719.215027,
205  757.798645, 793.882385, 839.83728, 887.268127, 931.233276, 980.856689, 1023.191833, 1080.281494,
206  1138.363892, 1191.303345, 1251.439453, 1305.288818, 1368.290894, 1433.700684, 1501.597412, 1557.918335,
207  1625.636475, 1695.08374, 1761.771484, 1848.941162, 1938.178345, 2027.55603, 2127.364014, 2226.186523,
208  2315.188965, 2399.225342, 2501.608643, 2611.077881, 2726.316162, 2848.74707, 2972.975342, 3096.565674,
209  3219.530762, 3361.178223, 3568.028564, 3765.690186, 50000};
210 
211  TH2F *h2D_etabins_forRho =
212  new TH2F("etabinsForRho", "#rho vs. #eta;#eta;#rho", etaBins_, edge_pseudorapidity, 500, 0, 300);
213  TH2F *h2D_ptBins_forRho = new TH2F("ptBinsForRho", "#rho vs. p_{T};p_{T};#rho", 300, 0, 300, 500, 0, 300);
214  TH2F *h2D_centBins_forRho = new TH2F("centBinsForRho", "dummy;HIHF;#rho", nHihfBins, hihfBins, 500, 0, 300);
215 
216  TH2F *h2D_etabins_forRhoM =
217  new TH2F("etabinsForRho", "#rho_{M} vs. #eta;#eta;#rho_{M}", etaBins_, edge_pseudorapidity, 100, 0, 1.5);
218  TH2F *h2D_ptBins_forRhoM = new TH2F("ptBinsForRho", "#rho_{M} vs. p_{T};p_{T};#rho_{M}", 300, 0, 300, 100, 0, 1.5);
219  TH2F *h2D_centBins_forRhoM = new TH2F("centBinsForRho", "dummy;HIHF;#rho_{M}", nHihfBins, hihfBins, 100, 0, 1.5);
220 
221  if (isPFJet) {
222  mNPFpart = ibooker.book1D("NPFpart", "No of particle flow candidates", 1000, 0, 1000);
223  mPFPt = ibooker.book1D("PFPt", "PF candidate p_{T}", 10000, -500, 500);
224  mPFEta = ibooker.book1D("PFEta", "PF candidate #eta", 120, -6, 6);
225  mPFPhi = ibooker.book1D("PFPhi", "PF candidate #phi", 70, -3.5, 3.5);
226 
227  mPFDeltaR = ibooker.book1D("PFDeltaR", "PF candidate DeltaR", 100, 0, 4); //MZ
229  ibooker.book1D("PFDeltaR_Scaled_R", "PF candidate DeltaR Divided by DeltaR square", 100, 0, 4); //MZ
230 
231  mSumPFPt = ibooker.book1D("SumPFPt", "Sum of initial PF p_{T}", 1000, -10000, 10000);
232  mSumPFPt_eta = ibooker.book2D("SumPFPt_etaBins", h2D_etabins_vs_pt);
233 
234  mSumSquaredPFPt = ibooker.book1D("SumSquaredPFPt", "Sum of initial PF p_{T} squared", 10000, 0, 10000);
235  mSumSquaredPFPt_eta = ibooker.book2D("SumSquaredPFPt_etaBins", h2D_etabins_vs_pt2);
236 
237  mSumPFPt_HF = ibooker.book2D(
238  "SumPFPt_HF", "HF energy (y axis) vs Sum initial PF p_{T} (x axis)", 1000, -1000, 1000, 1000, 0, 10000);
239 
240  for (int ieta = 0; ieta < etaBins_; ieta++) {
241  int range = 1000;
242  if (ieta < 2 || etaBins_ - ieta <= 2)
243  range = 500;
244  const char *lc = edge_pseudorapidity[ieta] < 0 ? "n" : "p";
245  const char *rc = edge_pseudorapidity[ieta + 1] < 0 ? "n" : "p";
247  Form("mSumCaloPt_%s%.3g_%s%.3g", lc, abs(edge_pseudorapidity[ieta]), rc, abs(edge_pseudorapidity[ieta + 1]));
248  for (int id = 0; id < 2; id++) {
249  if (histoName.find('.') != std::string::npos) {
250  histoName.replace(histoName.find('.'), 1, "p");
251  }
252  }
253  mSumPFPtEtaDep[ieta] = ibooker.book1D(
254  histoName.c_str(),
255  Form("Sum PFPt in the eta range %.3g to %.3g", edge_pseudorapidity[ieta], edge_pseudorapidity[ieta + 1]),
256  500,
257  0,
258  range);
259  }
260 
261  if (std::string("Cs") == UEAlgo) {
262  mRhoDist_vsEta = ibooker.book2D("rhoDist_vsEta", h2D_etabins_forRho);
263  mRhoMDist_vsEta = ibooker.book2D("rhoMDist_vsEta", h2D_etabins_forRhoM);
264  mRhoDist_vsPt = ibooker.book2D("rhoDist_vsPt", h2D_ptBins_forRho);
265  mRhoMDist_vsPt = ibooker.book2D("rhoMDist_vsPt", h2D_ptBins_forRhoM);
266 
267  //this is kind of a janky way to fill the eta since i can't get it from the edm::Event here... - kjung
268  rhoEtaRange = ibooker.book1D("rhoEtaRange", "", 500, -5.5, 5.5);
269  for (int ieta = 0; ieta < etaBins_; ieta++) {
271  ibooker.book1D(Form("csCandPt_etaBin%d", ieta), "CS candidate pt, eta-by-eta", 150, 0, 300);
272 
273  const char *lc = edge_pseudorapidity[ieta] < 0 ? "n" : "p";
274  const char *rc = edge_pseudorapidity[ieta + 1] < 0 ? "n" : "p";
275  std::string histoName = Form(
276  "Dist_vsCent_%s%.3g_%s%.3g", lc, abs(edge_pseudorapidity[ieta]), rc, abs(edge_pseudorapidity[ieta + 1]));
277  for (int id = 0; id < 2; id++) {
278  if (histoName.find('.') != std::string::npos) {
279  histoName.replace(histoName.find('.'), 1, "p");
280  }
281  }
282  std::string rhoName = "rho";
283  rhoName.append(histoName);
284  h2D_centBins_forRho->SetTitle(Form(
285  "#rho vs. HIHF in the range %.3g < #eta < %.3g", edge_pseudorapidity[ieta], edge_pseudorapidity[ieta + 1]));
286  mRhoDist_vsCent[ieta] = ibooker.book2D(rhoName.c_str(), h2D_centBins_forRho);
287  std::string rhoMName = "rhoM";
288  rhoMName.append(histoName);
289  h2D_centBins_forRhoM->SetTitle(Form("#rho_{M} vs. HIHF in the range %.3g < #eta < %.3g",
291  edge_pseudorapidity[ieta + 1]));
292  mRhoMDist_vsCent[ieta] = ibooker.book2D(rhoMName.c_str(), h2D_centBins_forRhoM);
293  for (int ipt = 0; ipt < ptBins_; ipt++) {
294  mSubtractedEFrac[ipt][ieta] =
295  ibooker.book1D(Form("subtractedEFrac_JetPt%d_to_%d_etaBin%d", ptBin[ipt], ptBin[ipt + 1], ieta),
296  "subtracted fraction of CS jet",
297  50,
298  0,
299  1);
300  mSubtractedE[ipt][ieta] =
301  ibooker.book1D(Form("subtractedE_JetPt%d_to_%d_etaBin%d", ptBin[ipt], ptBin[ipt + 1], ieta),
302  "subtracted total of CS jet",
303  300,
304  0,
305  300);
306  }
307  mCSCand_corrPFcand[ieta] = ibooker.book2D(
308  Form("csCandCorrPF%d", ieta), "CS to PF candidate correlation, eta-by-eta", 300, 0, 300, 300, 0, 300);
309  }
310  }
311 
312  mPFCandpT_vs_eta_Unknown = ibooker.book2D("PF_cand_X_unknown", h2D_pfcand_etabins_vs_pt); // pf id 0
313  mPFCandpT_vs_eta_ChargedHadron = ibooker.book2D("PF_cand_chargedHad", h2D_pfcand_etabins_vs_pt); // pf id - 1
314  mPFCandpT_vs_eta_electron = ibooker.book2D("PF_cand_electron", h2D_pfcand_etabins_vs_pt); // pf id - 2
315  mPFCandpT_vs_eta_muon = ibooker.book2D("PF_cand_muon", h2D_pfcand_etabins_vs_pt); // pf id - 3
316  mPFCandpT_vs_eta_photon = ibooker.book2D("PF_cand_photon", h2D_pfcand_etabins_vs_pt); // pf id - 4
317  mPFCandpT_vs_eta_NeutralHadron = ibooker.book2D("PF_cand_neutralHad", h2D_pfcand_etabins_vs_pt); // pf id - 5
318  mPFCandpT_vs_eta_HadE_inHF = ibooker.book2D("PF_cand_HadEner_inHF", h2D_pfcand_etabins_vs_pt); // pf id - 6
319  mPFCandpT_vs_eta_EME_inHF = ibooker.book2D("PF_cand_EMEner_inHF", h2D_pfcand_etabins_vs_pt); // pf id - 7
320 
321  mPFCandpT_Barrel_Unknown = ibooker.book1D("mPFCandpT_Barrel_Unknown",
322  Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
323  300,
324  0,
325  300); // pf id - 0
326  mPFCandpT_Barrel_ChargedHadron = ibooker.book1D("mPFCandpT_Barrel_ChargedHadron",
327  Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
328  300,
329  0,
330  300); // pf id - 1
331  mPFCandpT_Barrel_electron = ibooker.book1D("mPFCandpT_Barrel_electron",
332  Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
333  300,
334  0,
335  300); // pf id - 2
336  mPFCandpT_Barrel_muon = ibooker.book1D("mPFCandpT_Barrel_muon",
337  Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
338  300,
339  0,
340  300); // pf id - 3
341  mPFCandpT_Barrel_photon = ibooker.book1D("mPFCandpT_Barrel_photon",
342  Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
343  300,
344  0,
345  300); // pf id - 4
346  mPFCandpT_Barrel_NeutralHadron = ibooker.book1D("mPFCandpT_Barrel_NeutralHadron",
347  Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
348  300,
349  0,
350  300); // pf id - 5
351  mPFCandpT_Barrel_HadE_inHF = ibooker.book1D("mPFCandpT_Barrel_HadE_inHF",
352  Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
353  300,
354  0,
355  300); // pf id - 6
356  mPFCandpT_Barrel_EME_inHF = ibooker.book1D("mPFCandpT_Barrel_EME_inHF",
357  Form(";PF candidate p_{T}, |#eta|<%2.2f; counts", BarrelEta),
358  300,
359  0,
360  300); // pf id - 7
361 
363  ibooker.book1D("mPFCandpT_Endcap_Unknown",
364  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
365  300,
366  0,
367  300); // pf id - 0
369  ibooker.book1D("mPFCandpT_Endcap_ChargedHadron",
370  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
371  300,
372  0,
373  300); // pf id - 1
375  ibooker.book1D("mPFCandpT_Endcap_electron",
376  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
377  300,
378  0,
379  300); // pf id - 2
381  ibooker.book1D("mPFCandpT_Endcap_muon",
382  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
383  300,
384  0,
385  300); // pf id - 3
387  ibooker.book1D("mPFCandpT_Endcap_photon",
388  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
389  300,
390  0,
391  300); // pf id - 4
393  ibooker.book1D("mPFCandpT_Endcap_NeutralHadron",
394  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
395  300,
396  0,
397  300); // pf id - 5
399  ibooker.book1D("mPFCandpT_Endcap_HadE_inHF",
400  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
401  300,
402  0,
403  300); // pf id - 6
405  ibooker.book1D("mPFCandpT_Endcap_EME_inHF",
406  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", BarrelEta, EndcapEta),
407  300,
408  0,
409  300); // pf id - 7
410 
412  ibooker.book1D("mPFCandpT_Forward_Unknown",
413  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
414  300,
415  0,
416  300); // pf id - 0
418  ibooker.book1D("mPFCandpT_Forward_ChargedHadron",
419  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
420  300,
421  0,
422  300); // pf id - 1
424  ibooker.book1D("mPFCandpT_Forward_electron",
425  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
426  300,
427  0,
428  300); // pf id - 2
430  ibooker.book1D("mPFCandpT_Forward_muon",
431  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
432  300,
433  0,
434  300); // pf id - 3
436  ibooker.book1D("mPFCandpT_Forward_photon",
437  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
438  300,
439  0,
440  300); // pf id - 4
442  ibooker.book1D("mPFCandpT_Forward_NeutralHadron",
443  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
444  300,
445  0,
446  300); // pf id - 5
448  ibooker.book1D("mPFCandpT_Forward_HadE_inHF",
449  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
450  300,
451  0,
452  300); // pf id - 6
454  ibooker.book1D("mPFCandpT_Forward_EME_inHF",
455  Form(";PF candidate p_{T}, %2.2f<|#eta|<%2.2f; counts", EndcapEta, ForwardEta),
456  300,
457  0,
458  300); // pf id - 7
459  }
460 
461  if (isCaloJet) {
462  mNCalopart = ibooker.book1D("NCalopart", "No of particle flow candidates", 1000, 0, 10000);
463  mCaloPt = ibooker.book1D("CaloPt", "Calo candidate p_{T}", 1000, -5000, 5000);
464  mCaloEta = ibooker.book1D("CaloEta", "Calo candidate #eta", 120, -6, 6);
465  mCaloPhi = ibooker.book1D("CaloPhi", "Calo candidate #phi", 70, -3.5, 3.5);
466 
467  mSumCaloPt = ibooker.book1D("SumCaloPt", "Sum Calo p_{T}", 1000, -10000, 10000);
468  mSumCaloPt_eta = ibooker.book2D("SumCaloPt_etaBins", h2D_etabins_vs_pt);
469 
470  mSumSquaredCaloPt = ibooker.book1D("SumSquaredCaloPt", "Sum of initial Calo tower p_{T} squared", 10000, 0, 10000);
471  mSumSquaredCaloPt_eta = ibooker.book2D("SumSquaredCaloPt_etaBins", h2D_etabins_vs_pt2);
472 
473  mSumCaloPt_HF =
474  ibooker.book2D("SumCaloPt_HF", "HF Energy (y axis) vs Sum Calo tower p_{T}", 1000, -1000, 1000, 1000, 0, 10000);
475 
476  for (int ieta = 0; ieta < etaBins_; ieta++) {
477  int range = 1000;
478  if (ieta < 2 || etaBins_ - ieta <= 2)
479  range = 5000;
480  const char *lc = edge_pseudorapidity[ieta] < 0 ? "n" : "p";
481  const char *rc = edge_pseudorapidity[ieta + 1] < 0 ? "n" : "p";
483  Form("mSumCaloPt_%s%.3g_%s%.3g", lc, abs(edge_pseudorapidity[ieta]), rc, abs(edge_pseudorapidity[ieta + 1]));
484  for (int id = 0; id < 2; id++) {
485  if (histoName.find('.') != std::string::npos) {
486  histoName.replace(histoName.find('.'), 1, "p");
487  }
488  }
489  mSumCaloPtEtaDep[ieta] = ibooker.book1D(histoName.c_str(),
490  Form("Sum Calo tower Pt in the eta range %.3g to %.3g",
493  1000,
494  -1 * range,
495  range);
496  }
497  }
498 
499  // particle flow variables histograms
500  mSumpt = ibooker.book1D("SumpT", "Sum p_{T} of all the PF candidates per event", 1000, 0, 10000);
501 
502  // Event variables
503  mNvtx = ibooker.book1D("Nvtx", "number of vertices", 60, 0, 60);
504  mHF = ibooker.book1D("HF", "HF energy distribution", 1000, 0, 10000);
505 
506  // Jet parameters
507  mEta = ibooker.book1D("Eta", "Eta", 120, -6, 6);
508  mPhi = ibooker.book1D("Phi", "Phi", 70, -3.5, 3.5);
509  mPt = ibooker.book1D("Pt", "Pt", 1000, 0, 500);
510  mP = ibooker.book1D("P", "P", 100, 0, 1000);
511  mEnergy = ibooker.book1D("Energy", "Energy", 100, 0, 1000);
512  mMass = ibooker.book1D("Mass", "Mass", 100, 0, 200);
513  mConstituents = ibooker.book1D("Constituents", "Constituents", 100, 0, 100);
514  mJetArea = ibooker.book1D("JetArea", "JetArea", 100, 0, 4);
515  mjetpileup = ibooker.book1D("jetPileUp", "jetPileUp", 100, 0, 150);
516  mNJets_40 = ibooker.book1D("NJets_pt_greater_40", "NJets pT > 40 GeV", 50, 0, 50);
517  mNJets = ibooker.book1D("NJets", "NJets", 100, 0, 100);
518 
519  if (mOutputFile.empty())
520  LogInfo("OutputInfo") << " Histograms will NOT be saved";
521  else
522  LogInfo("OutputInfo") << " Histograms will be saved to file:" << mOutputFile;
523 
524  delete h2D_etabins_vs_pt2;
525  delete h2D_etabins_vs_pt;
526  delete h2D_pfcand_etabins_vs_pt;
527  delete h2D_etabins_forRho;
528  delete h2D_ptBins_forRho;
529  delete h2D_centBins_forRho;
530  delete h2D_centBins_forRhoM;
531 }
532 
533 //------------------------------------------------------------------------------
534 // ~JetAnalyzer_HeavyIons
535 //------------------------------------------------------------------------------
537 
538 //------------------------------------------------------------------------------
539 // analyze
540 //------------------------------------------------------------------------------
542  // switch(mEvent.id().event() == 15296770)
543  // case 1:
544  // break;
545 
546  // Get the primary vertices
548  mEvent.getByToken(pvToken_, pvHandle);
549  reco::Vertex::Point vtx(0, 0, 0);
551 
552  mEvent.getByToken(hiVertexToken_, vtxs);
553  int greatestvtx = 0;
554  int nVertex = vtxs->size();
555 
556  for (unsigned int i = 0; i < vtxs->size(); ++i) {
557  unsigned int daughter = (*vtxs)[i].tracksSize();
558  if (daughter > (*vtxs)[greatestvtx].tracksSize())
559  greatestvtx = i;
560  }
561 
562  if (nVertex <= 0) {
563  vtx = reco::Vertex::Point(0, 0, 0);
564  }
565  vtx = (*vtxs)[greatestvtx].position();
566 
567  int nGoodVertices = 0;
568 
569  if (pvHandle.isValid()) {
570  for (unsigned i = 0; i < pvHandle->size(); i++) {
571  if ((*pvHandle)[i].ndof() > 4 && (fabs((*pvHandle)[i].z()) <= 24) && (fabs((*pvHandle)[i].position().rho()) <= 2))
572  nGoodVertices++;
573  }
574  }
575 
576  mNvtx->Fill(nGoodVertices);
577 
578  // Get the Jet collection
579  //----------------------------------------------------------------------------
580 
581  std::vector<Jet> recoJets;
582  recoJets.clear();
583 
588 
589  // 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 
596  //Get the new CS stuff
600  if (std::string("Cs") == UEAlgo) {
601  mEvent.getByToken(etaToken_, etaRanges);
602  mEvent.getByToken(rhoToken_, rho);
603  mEvent.getByToken(rhomToken_, rhom);
604  const int rhoSize = (int)etaRanges->size();
605  double rhoRange[rhoSize];
606  for (int irho = 0; irho < rhoSize; irho++) {
607  rhoRange[irho] = etaRanges->at(irho);
608  }
609  double yaxisLimits[501];
610  for (int ibin = 0; ibin < 501; ibin++)
611  yaxisLimits[ibin] = ibin * 2;
612  if (mRhoDist_vsEta->getNbinsX() != rhoSize - 1) {
613  mRhoDist_vsEta->getTH2F()->SetBins(
614  rhoSize - 1, const_cast<double *>(rhoRange), 500, const_cast<double *>(yaxisLimits));
615  mRhoMDist_vsEta->getTH2F()->SetBins(
616  rhoSize - 1, const_cast<double *>(rhoRange), 500, const_cast<double *>(yaxisLimits));
617  }
618  }
619 
620  if (isCaloJet)
621  mEvent.getByToken(caloJetsToken_, caloJets);
622  if (isJPTJet)
623  mEvent.getByToken(jptJetsToken_, jptJets);
624  if (isPFJet) {
625  if (std::string("Pu") == UEAlgo)
626  mEvent.getByToken(basicJetsToken_, basicJets);
627  if (std::string("Cs") == UEAlgo)
628  mEvent.getByToken(pfJetsToken_, pfJets);
629  if (std::string("Vs") == UEAlgo)
630  return; //avoid running Vs jets
631  }
632 
633  mEvent.getByToken(pfCandToken_, pfCandidates);
634  mEvent.getByToken(pfCandViewToken_, pfcandidates_);
635  if (std::string("Cs") == UEAlgo)
636  mEvent.getByToken(csCandToken_, csCandidates);
637 
638  mEvent.getByToken(caloTowersToken_, caloCandidates);
639  mEvent.getByToken(caloCandViewToken_, calocandidates_);
640 
641  // get the centrality
643  mEvent.getByToken(centralityToken, cent); //_centralitytag comes from the cfg
644 
645  if (!cent.isValid())
646  return;
647 
648  mHF->Fill(cent->EtHFtowerSum());
649  Float_t HF_energy = cent->EtHFtowerSum();
650 
651  //for later when centrality gets added to RelVal
652  //edm::Handle<int> cbin;
653  //mEvent.getByToken(centralityBinToken, cbin);
654 
655  /*int hibin = -999;
656  if(cbin.isValid()){
657  hibin = *cbin;
658  }*/
659 
660  const reco::PFCandidateCollection *pfCandidateColl = pfCandidates.product();
661 
662  Int_t NPFpart = 0;
663  Int_t NCaloTower = 0;
664  Float_t pfPt = 0;
665  Float_t pfEta = 0;
666  Float_t pfPhi = 0;
667  Int_t pfID = 0;
668  Float_t pfDeltaR = 0;
669  Float_t caloPt = 0;
670  Float_t caloEta = 0;
671  Float_t caloPhi = 0;
672  Float_t SumPt_value = 0;
673 
674  vector<vector<float>> numbers;
675  vector<float> tempVector;
676  numbers.clear();
677  tempVector.clear();
678 
679  if (isCaloJet) {
680  Float_t SumCaloPt[etaBins_];
681  Float_t SumSquaredCaloPt[etaBins_];
682 
683  // Need to set up histograms to get the RMS values for each pT bin
684  TH1F *hSumCaloPt[nedge_pseudorapidity - 1];
685 
686  for (int i = 0; i < etaBins_; ++i) {
687  SumCaloPt[i] = 0;
688  SumSquaredCaloPt[i] = 0;
689  hSumCaloPt[i] = new TH1F(Form("hSumCaloPt_%d", i), "", 10000, -10000, 10000);
690  }
691 
692  for (unsigned icand = 0; icand < caloCandidates->size(); icand++) {
693  const CaloTower &tower = (*caloCandidates)[icand];
694  reco::CandidateViewRef ref(calocandidates_, icand);
695  //10 is tower pT min
696  if (tower.p4(vtx).Et() < 0.1)
697  continue;
698 
699  NCaloTower++;
700 
701  caloPt = tower.p4(vtx).Et();
702  caloEta = tower.p4(vtx).Eta();
703  caloPhi = tower.p4(vtx).Phi();
704 
705  for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
706  if (caloEta >= edge_pseudorapidity[k] && caloEta < edge_pseudorapidity[k + 1]) {
707  SumCaloPt[k] = SumCaloPt[k] + caloPt;
708  SumSquaredCaloPt[k] = SumSquaredCaloPt[k] + caloPt * caloPt;
709  break;
710  } // eta selection statement
711 
712  } // eta bin loop
713 
714  SumPt_value = SumPt_value + caloPt;
715 
716  mCaloPt->Fill(caloPt);
717  mCaloEta->Fill(caloEta);
718  mCaloPhi->Fill(caloPhi);
719 
720  } // calo tower candidate loop
721 
722  for (int k = 0; k < nedge_pseudorapidity - 1; k++) {
723  hSumCaloPt[k]->Fill(SumCaloPt[k]);
724 
725  } // eta bin loop
726 
727  Float_t Evt_SumCaloPt = 0;
728  Float_t Evt_SumSquaredCaloPt = 0;
729 
730  for (int ieta = 0; ieta < etaBins_; ieta++) {
731  mSumCaloPtEtaDep[ieta]->Fill(SumCaloPt[ieta]);
732  }
733 
734  for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
735  Evt_SumCaloPt = Evt_SumCaloPt + SumCaloPt[k];
736  mSumCaloPt_eta->Fill(edge_pseudorapidity[k], SumCaloPt[k]);
737 
738  Evt_SumSquaredCaloPt = Evt_SumSquaredCaloPt + SumSquaredCaloPt[k];
739  mSumSquaredCaloPt_eta->Fill(edge_pseudorapidity[k], hSumCaloPt[k]->GetRMS(1));
740 
741  delete hSumCaloPt[k];
742 
743  } // eta bin loop
744 
745  mSumCaloPt->Fill(Evt_SumCaloPt);
746  mSumCaloPt_HF->Fill(Evt_SumCaloPt, HF_energy);
747 
748  mSumSquaredCaloPt->Fill(Evt_SumSquaredCaloPt);
749 
750  mNCalopart->Fill(NCaloTower);
751  mSumpt->Fill(SumPt_value);
752 
753  } // is calo jet
754 
755  if (isPFJet) {
756  Float_t SumPFPt[etaBins_];
757 
758  Float_t SumSquaredPFPt[etaBins_];
759 
760  // Need to set up histograms to get the RMS values for each pT bin
761  TH1F *hSumPFPt[nedge_pseudorapidity - 1];
762 
763  for (int i = 0; i < etaBins_; i++) {
764  SumPFPt[i] = 0;
765  SumSquaredPFPt[i] = 0;
766 
767  hSumPFPt[i] = new TH1F(Form("hSumPFPt_%d", i), "", 10000, -10000, 10000);
768  }
769 
770  vector<vector<float>> PF_Space(1, vector<float>(3));
771 
772  if (std::string("Cs") == UEAlgo) {
773  const reco::PFCandidateCollection *csCandidateColl = csCandidates.product();
774 
775  for (unsigned iCScand = 0; iCScand < csCandidateColl->size(); iCScand++) {
776  assert(csCandidateColl->size() <= pfCandidateColl->size());
777  const reco::PFCandidate csCandidate = csCandidateColl->at(iCScand);
778  const reco::PFCandidate pfCandidate = pfCandidateColl->at(iCScand);
779  int ieta = 0;
780  while (csCandidate.eta() > edge_pseudorapidity[ieta] && ieta < etaBins_ - 1)
781  ieta++;
782  mCSCandpT_vsPt[ieta]->Fill(csCandidate.pt());
783  mCSCand_corrPFcand[ieta]->Fill(csCandidate.pt(), pfCandidate.pt());
784  }
785  }
786 
787  for (unsigned icand = 0; icand < pfCandidateColl->size(); icand++) {
788  const reco::PFCandidate pfCandidate = pfCandidateColl->at(icand);
789  reco::CandidateViewRef ref(pfcandidates_, icand);
790  if (pfCandidate.pt() < 5)
791  continue;
792 
793  NPFpart++;
794  pfPt = pfCandidate.pt();
795  pfEta = pfCandidate.eta();
796  pfPhi = pfCandidate.phi();
797  pfID = pfCandidate.particleId();
798 
799  bool isBarrel = false;
800  bool isEndcap = false;
801  bool isForward = false;
802 
803  if (fabs(pfEta) < BarrelEta)
804  isBarrel = true;
805  if (fabs(pfEta) >= BarrelEta && fabs(pfEta) < EndcapEta)
806  isEndcap = true;
807  if (fabs(pfEta) >= EndcapEta && fabs(pfEta) < ForwardEta)
808  isForward = true;
809 
810  switch (pfID) {
811  case 0:
812  mPFCandpT_vs_eta_Unknown->Fill(pfPt, pfEta);
813  if (isBarrel)
815  if (isEndcap)
817  if (isForward)
819  break;
820  case 1:
821  mPFCandpT_vs_eta_ChargedHadron->Fill(pfPt, pfEta);
822  if (isBarrel)
824  if (isEndcap)
826  if (isForward)
828  break;
829  case 2:
830  mPFCandpT_vs_eta_electron->Fill(pfPt, pfEta);
831  if (isBarrel)
833  if (isEndcap)
835  if (isForward)
837  break;
838  case 3:
839  mPFCandpT_vs_eta_muon->Fill(pfPt, pfEta);
840  if (isBarrel)
842  if (isEndcap)
844  if (isForward)
846  break;
847  case 4:
848  mPFCandpT_vs_eta_photon->Fill(pfPt, pfEta);
849  if (isBarrel)
851  if (isEndcap)
853  if (isForward)
855  break;
856  case 5:
857  mPFCandpT_vs_eta_NeutralHadron->Fill(pfPt, pfEta);
858  if (isBarrel)
860  if (isEndcap)
862  if (isForward)
864  break;
865  case 6:
866  mPFCandpT_vs_eta_HadE_inHF->Fill(pfPt, pfEta);
867  if (isBarrel)
869  if (isEndcap)
871  if (isForward)
873  break;
874  case 7:
875  mPFCandpT_vs_eta_EME_inHF->Fill(pfPt, pfEta);
876  if (isBarrel)
878  if (isEndcap)
880  if (isForward)
882  break;
883  }
884 
885  //Fill 2d vector matrix
886  tempVector.push_back(pfPt);
887  tempVector.push_back(pfEta);
888  tempVector.push_back(pfPhi);
889 
890  numbers.push_back(tempVector);
891  tempVector.clear();
892 
893  for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
894  if (pfEta >= edge_pseudorapidity[k] && pfEta < edge_pseudorapidity[k + 1]) {
895  SumPFPt[k] = SumPFPt[k] + pfPt;
896  SumSquaredPFPt[k] = SumSquaredPFPt[k] + pfPt * pfPt;
897  break;
898  } // eta selection statement
899 
900  } // eta bin loop
901 
902  SumPt_value = SumPt_value + pfPt;
903 
904  mPFPt->Fill(pfPt);
905  mPFEta->Fill(pfEta);
906  mPFPhi->Fill(pfPhi);
907 
908  } // pf candidate loop
909 
910  for (int k = 0; k < nedge_pseudorapidity - 1; k++) {
911  hSumPFPt[k]->Fill(SumPFPt[k]);
912 
913  } // eta bin loop
914 
915  Float_t Evt_SumPFPt = 0;
916  Float_t Evt_SumSquaredPFPt = 0;
917 
918  for (int ieta = 0; ieta < etaBins_; ieta++) {
919  mSumPFPtEtaDep[ieta]->Fill(SumPFPt[ieta]);
920  }
921 
922  for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
923  Evt_SumPFPt = Evt_SumPFPt + SumPFPt[k];
924  mSumPFPt_eta->Fill(edge_pseudorapidity[k], SumPFPt[k]);
925 
926  Evt_SumSquaredPFPt = Evt_SumSquaredPFPt + SumSquaredPFPt[k];
927  mSumSquaredPFPt_eta->Fill(edge_pseudorapidity[k], hSumPFPt[k]->GetRMS(1));
928 
929  delete hSumPFPt[k];
930 
931  } // eta bin loop
932 
933  mSumPFPt->Fill(Evt_SumPFPt);
934  mSumPFPt_HF->Fill(Evt_SumPFPt, HF_energy);
935 
936  mSumSquaredPFPt->Fill(Evt_SumSquaredPFPt);
937 
938  mNPFpart->Fill(NPFpart);
939  mSumpt->Fill(SumPt_value);
940  }
941 
942  if (isCaloJet) {
943  for (unsigned ijet = 0; ijet < caloJets->size(); ijet++) {
944  recoJets.push_back((*caloJets)[ijet]);
945  }
946  }
947 
948  if (isJPTJet) {
949  for (unsigned ijet = 0; ijet < jptJets->size(); ijet++)
950  recoJets.push_back((*jptJets)[ijet]);
951  }
952 
953  if (isPFJet) {
954  if (std::string("Pu") == UEAlgo) {
955  for (unsigned ijet = 0; ijet < basicJets->size(); ijet++) {
956  recoJets.push_back((*basicJets)[ijet]);
957  }
958  }
959  if (std::string("Cs") == UEAlgo) {
960  for (unsigned ijet = 0; ijet < pfJets->size(); ijet++) {
961  recoJets.push_back((*pfJets)[ijet]);
962  }
963  }
964  }
965 
966  if (isCaloJet && !caloJets.isValid()) {
967  return;
968  }
969  if (isJPTJet && !jptJets.isValid()) {
970  return;
971  }
972  if (isPFJet) {
973  if (std::string("Pu") == UEAlgo) {
974  if (!basicJets.isValid())
975  return;
976  }
977  if (std::string("Cs") == UEAlgo) {
978  if (!pfJets.isValid())
979  return;
980  }
981  if (std::string("Vs") == UEAlgo) {
982  return;
983  }
984  }
985 
986  int nJet_40 = 0;
987 
988  mNJets->Fill(recoJets.size());
989 
990  for (unsigned ijet = 0; ijet < recoJets.size(); ijet++) {
991  if (recoJets[ijet].pt() > mRecoJetPtThreshold) {
992  //counting forward and barrel jets
993  // get an idea of no of jets with pT>40 GeV
994  if (recoJets[ijet].pt() > 40)
995  nJet_40++;
996  if (mEta)
997  mEta->Fill(recoJets[ijet].eta());
998  if (mjetpileup)
999  mjetpileup->Fill(recoJets[ijet].pileup());
1000  if (mJetArea)
1001  mJetArea->Fill(recoJets[ijet].jetArea());
1002  if (mPhi)
1003  mPhi->Fill(recoJets[ijet].phi());
1004  if (mEnergy)
1005  mEnergy->Fill(recoJets[ijet].energy());
1006  if (mP)
1007  mP->Fill(recoJets[ijet].p());
1008  if (mPt)
1009  mPt->Fill(recoJets[ijet].pt());
1010  if (mMass)
1011  mMass->Fill(recoJets[ijet].mass());
1012  if (mConstituents)
1014 
1015  if (std::string("Cs") == UEAlgo) {
1016  int ipt = 0, ieta = 0;
1017  while (recoJets[ijet].pt() > ptBin[ipt + 1] && ipt < ptBins_ - 1)
1018  ipt++;
1019  while (recoJets[ijet].eta() > etaRanges->at(ieta + 1) && ieta < (int)(rho->size() - 1))
1020  ieta++;
1021  mSubtractedEFrac[ipt][ieta]->Fill((double)recoJets[ijet].pileup() / (double)recoJets[ijet].energy());
1022  mSubtractedE[ipt][ieta]->Fill(recoJets[ijet].pileup());
1023 
1024  for (unsigned irho = 0; irho < rho->size(); irho++) {
1025  mRhoDist_vsEta->Fill(recoJets[ijet].eta(), rho->at(irho));
1026  mRhoMDist_vsEta->Fill(recoJets[ijet].eta(), rhom->at(irho));
1027  mRhoDist_vsPt->Fill(recoJets[ijet].pt(), rho->at(irho));
1028  mRhoMDist_vsPt->Fill(recoJets[ijet].pt(), rhom->at(irho));
1029  mRhoDist_vsCent[ieta]->Fill(HF_energy, rho->at(irho));
1030  mRhoMDist_vsCent[ieta]->Fill(HF_energy, rhom->at(irho));
1031  }
1032  }
1033 
1034  for (size_t iii = 0; iii < numbers.size(); iii++) {
1035  pfDeltaR = sqrt((numbers[iii][2] - recoJets[ijet].phi()) * (numbers[iii][2] - recoJets[ijet].phi()) +
1036  (numbers[iii][1] - recoJets[ijet].eta()) * (numbers[iii][1] - recoJets[ijet].eta())); //MZ
1037 
1038  mPFDeltaR->Fill(pfDeltaR); //MZ
1039  mPFDeltaR_Scaled_R->Fill(pfDeltaR, 1. / pow(pfDeltaR, 2)); //MZ
1040  }
1041  }
1042  }
1043  if (mNJets_40)
1044  mNJets_40->Fill(nJet_40);
1045 
1046  numbers.clear();
1047 }
MonitorElement * mPFCandpT_Forward_photon
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken_
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandToken_
edm::InputTag mInputCsCandCollection
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MonitorElement * mSumSquaredPFPt
MonitorElement * mPFCandpT_vs_eta_electron
edm::EDGetTokenT< reco::CandidateView > caloCandViewToken_
MonitorElement * mPFCandpT_Forward_EME_inHF
const Double_t EndcapEta
edm::EDGetTokenT< reco::JPTJetCollection > jptJetsToken_
double pt() const final
transverse momentum
double EtHFtowerSum() const
Definition: Centrality.h:24
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * mPFCandpT_Forward_muon
size_type size() const
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
MonitorElement * mCSCandpT_vsPt[etaBins_]
MonitorElement * mPFCandpT_Endcap_NeutralHadron
bool exists(std::string const &parameterName) const
checks if a parameter exists
T const * product() const
Definition: Handle.h:70
MonitorElement * mPFCandpT_vs_eta_EME_inHF
MonitorElement * mSumSquaredCaloPt
bool isForward(DetId const &)
MonitorElement * mSubtractedEFrac[ptBins_][etaBins_]
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * mSumPFPtEtaDep[etaBins_]
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * mPFCandpT_Forward_electron
MonitorElement * mRhoMDist_vsEta
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
assert(be >=bs)
MonitorElement * mSumCaloPt_eta
MonitorElement * mPFCandpT_vs_eta_muon
MonitorElement * mCSCand_corrPFcand[etaBins_]
void Fill(long long x)
MonitorElement * mPFCandpT_Endcap_HadE_inHF
edm::EDGetTokenT< int > centralityBinToken
MonitorElement * mPFCandpT_Endcap_ChargedHadron
MonitorElement * mRhoMDist_vsPt
MonitorElement * mPFCandpT_vs_eta_NeutralHadron
MonitorElement * mSumCaloPtEtaDep[etaBins_]
MonitorElement * mSumCaloPt_HF
static constexpr int etaBins_
MonitorElement * mRhoDist_vsEta
MonitorElement * mPFCandpT_vs_eta_photon
edm::EDGetTokenT< reco::Centrality > centralityToken
MonitorElement * mPFCandpT_Forward_ChargedHadron
MonitorElement * mSubtractedE[ptBins_][etaBins_]
T sqrt(T t)
Definition: SSEVec.h:23
MonitorElement * mPFCandpT_Endcap_muon
MonitorElement * mPFCandpT_Endcap_photon
MonitorElement * mPFDeltaR_Scaled_R
edm::EDGetTokenT< std::vector< reco::Vertex > > hiVertexToken_
static constexpr int ptBins_
MonitorElement * mRhoDist_vsPt
MonitorElement * mConstituents
MonitorElement * mPFCandpT_Barrel_photon
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
static constexpr int nedge_pseudorapidity
MonitorElement * mSumSquaredCaloPt_eta
MonitorElement * mPFCandpT_Barrel_Unknown
edm::EDGetTokenT< std::vector< double > > rhoToken_
edm::EDGetTokenT< std::vector< double > > rhomToken_
MonitorElement * mPFCandpT_Barrel_NeutralHadron
bool isEndcap(GeomDetEnumerators::SubDetector m)
MonitorElement * mPFCandpT_Endcap_Unknown
const Double_t ForwardEta
Log< level::Info, false > LogInfo
MonitorElement * mPFCandpT_vs_eta_ChargedHadron
MonitorElement * mPFCandpT_Forward_HadE_inHF
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_
MonitorElement * mPFCandpT_Barrel_ChargedHadron
MonitorElement * mPFCandpT_Barrel_HadE_inHF
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< reco::PFCandidateCollection > csCandToken_
const double edge_pseudorapidity[etaBins_+1]
edm::InputTag mInputPFCandCollection
MonitorElement * mSumSquaredPFPt_eta
MonitorElement * mPFCandpT_Endcap_EME_inHF
MonitorElement * mPFCandpT_vs_eta_HadE_inHF
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
edm::EDGetTokenT< reco::CandidateView > pfCandViewToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * mPFCandpT_Forward_Unknown
bool isValid() const
Definition: HandleBase.h:70
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
fixed size matrix
HLT enums.
MonitorElement * mPFCandpT_Barrel_electron
static int position[264][3]
Definition: ReadPGInfo.cc:289
MonitorElement * mPFCandpT_Endcap_electron
edm::EDGetTokenT< std::vector< double > > etaToken_
virtual int getNbinsX() const
get # of bins in X-axis
const Double_t BarrelEta
MonitorElement * mRhoDist_vsCent[etaBins_]
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
JetAnalyzer_HeavyIons(const edm::ParameterSet &)
const int ptBin[ptBins_+1]
MonitorElement * mPFCandpT_Barrel_EME_inHF
MonitorElement * mRhoMDist_vsCent[etaBins_]
double phi() const final
momentum azimuthal angle
MonitorElement * mPFCandpT_vs_eta_Unknown
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
MonitorElement * mPFCandpT_Forward_NeutralHadron
Definition: Run.h:45
virtual ParticleType particleId() const
Definition: PFCandidate.h:392
double eta() const final
momentum pseudorapidity
MonitorElement * mPFCandpT_Barrel_muon