CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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, 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";
246  std::string histoName =
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++) {
270  mCSCandpT_vsPt[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",
290  edge_pseudorapidity[ieta],
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";
482  std::string histoName =
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",
491  edge_pseudorapidity[ieta],
492  edge_pseudorapidity[ieta + 1]),
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 // beginJob
540 //------------------------------------------------------------------------------
541 //void JetAnalyzer_HeavyIons::beginJob() {
542 //}
543 
544 //------------------------------------------------------------------------------
545 // endJob
546 //------------------------------------------------------------------------------
547 //void JetAnalyzer_HeavyIons::endJob()
548 //{
549 // if (!mOutputFile.empty() && &*edm::Service<DQMStore>())
550 // {
551 // edm::Service<DQMStore>()->save(mOutputFile);
552 // }
553 //}
554 
555 //------------------------------------------------------------------------------
556 // analyze
557 //------------------------------------------------------------------------------
558 void JetAnalyzer_HeavyIons::analyze(const edm::Event &mEvent, const edm::EventSetup &mSetup) {
559  // switch(mEvent.id().event() == 15296770)
560  // case 1:
561  // break;
562 
563  // Get the primary vertices
565  mEvent.getByToken(pvToken_, pvHandle);
566  reco::Vertex::Point vtx(0, 0, 0);
568 
569  mEvent.getByToken(hiVertexToken_, vtxs);
570  int greatestvtx = 0;
571  int nVertex = vtxs->size();
572 
573  for (unsigned int i = 0; i < vtxs->size(); ++i) {
574  unsigned int daughter = (*vtxs)[i].tracksSize();
575  if (daughter > (*vtxs)[greatestvtx].tracksSize())
576  greatestvtx = i;
577  }
578 
579  if (nVertex <= 0) {
580  vtx = reco::Vertex::Point(0, 0, 0);
581  }
582  vtx = (*vtxs)[greatestvtx].position();
583 
584  int nGoodVertices = 0;
585 
586  if (pvHandle.isValid()) {
587  for (unsigned i = 0; i < pvHandle->size(); i++) {
588  if ((*pvHandle)[i].ndof() > 4 && (fabs((*pvHandle)[i].z()) <= 24) && (fabs((*pvHandle)[i].position().rho()) <= 2))
589  nGoodVertices++;
590  }
591  }
592 
593  mNvtx->Fill(nGoodVertices);
594 
595  // Get the Jet collection
596  //----------------------------------------------------------------------------
597 
598  std::vector<Jet> recoJets;
599  recoJets.clear();
600 
605 
606  // Get the Particle flow candidates and the Voronoi variables
609  edm::Handle<CaloTowerCollection> caloCandidates;
610  edm::Handle<reco::CandidateView> pfcandidates_;
611  edm::Handle<reco::CandidateView> calocandidates_;
612 
613  //Get the new CS stuff
617  if (std::string("Cs") == UEAlgo) {
618  mEvent.getByToken(etaToken_, etaRanges);
619  mEvent.getByToken(rhoToken_, rho);
620  mEvent.getByToken(rhomToken_, rhom);
621  const int rhoSize = (int)etaRanges->size();
622  double rhoRange[rhoSize];
623  for (int irho = 0; irho < rhoSize; irho++) {
624  rhoRange[irho] = etaRanges->at(irho);
625  }
626  double yaxisLimits[501];
627  for (int ibin = 0; ibin < 501; ibin++)
628  yaxisLimits[ibin] = ibin * 2;
629  if (mRhoDist_vsEta->getNbinsX() != rhoSize - 1) {
630  mRhoDist_vsEta->getTH2F()->SetBins(
631  rhoSize - 1, const_cast<double *>(rhoRange), 500, const_cast<double *>(yaxisLimits));
632  mRhoMDist_vsEta->getTH2F()->SetBins(
633  rhoSize - 1, const_cast<double *>(rhoRange), 500, const_cast<double *>(yaxisLimits));
634  }
635  }
636 
637  if (isCaloJet)
638  mEvent.getByToken(caloJetsToken_, caloJets);
639  if (isJPTJet)
640  mEvent.getByToken(jptJetsToken_, jptJets);
641  if (isPFJet) {
642  if (std::string("Pu") == UEAlgo)
643  mEvent.getByToken(basicJetsToken_, basicJets);
644  if (std::string("Cs") == UEAlgo)
645  mEvent.getByToken(pfJetsToken_, pfJets);
646  if (std::string("Vs") == UEAlgo)
647  return; //avoid running Vs jets
648  }
649 
650  mEvent.getByToken(pfCandToken_, pfCandidates);
651  mEvent.getByToken(pfCandViewToken_, pfcandidates_);
652  if (std::string("Cs") == UEAlgo)
653  mEvent.getByToken(csCandToken_, csCandidates);
654 
655  mEvent.getByToken(caloTowersToken_, caloCandidates);
656  mEvent.getByToken(caloCandViewToken_, calocandidates_);
657 
658  // get the centrality
660  mEvent.getByToken(centralityToken, cent); //_centralitytag comes from the cfg
661 
662  mHF->Fill(cent->EtHFtowerSum());
663  Float_t HF_energy = cent->EtHFtowerSum();
664 
665  //for later when centrality gets added to RelVal
666  //edm::Handle<int> cbin;
667  //mEvent.getByToken(centralityBinToken, cbin);
668 
669  if (!cent.isValid())
670  return;
671 
672  /*int hibin = -999;
673  if(cbin.isValid()){
674  hibin = *cbin;
675  }*/
676 
677  const reco::PFCandidateCollection *pfCandidateColl = pfCandidates.product();
678 
679  Int_t NPFpart = 0;
680  Int_t NCaloTower = 0;
681  Float_t pfPt = 0;
682  Float_t pfEta = 0;
683  Float_t pfPhi = 0;
684  Int_t pfID = 0;
685  Float_t pfDeltaR = 0;
686  Float_t caloPt = 0;
687  Float_t caloEta = 0;
688  Float_t caloPhi = 0;
689  Float_t SumPt_value = 0;
690 
691  vector<vector<float>> numbers;
692  vector<float> tempVector;
693  numbers.clear();
694  tempVector.clear();
695 
696  if (isCaloJet) {
697  Float_t SumCaloPt[etaBins_];
698  Float_t SumSquaredCaloPt[etaBins_];
699 
700  // Need to set up histograms to get the RMS values for each pT bin
701  TH1F *hSumCaloPt[nedge_pseudorapidity - 1];
702 
703  for (int i = 0; i < etaBins_; ++i) {
704  SumCaloPt[i] = 0;
705  SumSquaredCaloPt[i] = 0;
706  hSumCaloPt[i] = new TH1F(Form("hSumCaloPt_%d", i), "", 10000, -10000, 10000);
707  }
708 
709  for (unsigned icand = 0; icand < caloCandidates->size(); icand++) {
710  const CaloTower &tower = (*caloCandidates)[icand];
711  reco::CandidateViewRef ref(calocandidates_, icand);
712  //10 is tower pT min
713  if (tower.p4(vtx).Et() < 0.1)
714  continue;
715 
716  NCaloTower++;
717 
718  caloPt = tower.p4(vtx).Et();
719  caloEta = tower.p4(vtx).Eta();
720  caloPhi = tower.p4(vtx).Phi();
721 
722  for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
723  if (caloEta >= edge_pseudorapidity[k] && caloEta < edge_pseudorapidity[k + 1]) {
724  SumCaloPt[k] = SumCaloPt[k] + caloPt;
725  SumSquaredCaloPt[k] = SumSquaredCaloPt[k] + caloPt * caloPt;
726  break;
727  } // eta selection statement
728 
729  } // eta bin loop
730 
731  SumPt_value = SumPt_value + caloPt;
732 
733  mCaloPt->Fill(caloPt);
734  mCaloEta->Fill(caloEta);
735  mCaloPhi->Fill(caloPhi);
736 
737  } // calo tower candidate loop
738 
739  for (int k = 0; k < nedge_pseudorapidity - 1; k++) {
740  hSumCaloPt[k]->Fill(SumCaloPt[k]);
741 
742  } // eta bin loop
743 
744  Float_t Evt_SumCaloPt = 0;
745  Float_t Evt_SumSquaredCaloPt = 0;
746 
747  for (int ieta = 0; ieta < etaBins_; ieta++) {
748  mSumCaloPtEtaDep[ieta]->Fill(SumCaloPt[ieta]);
749  }
750 
751  for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
752  Evt_SumCaloPt = Evt_SumCaloPt + SumCaloPt[k];
753  mSumCaloPt_eta->Fill(edge_pseudorapidity[k], SumCaloPt[k]);
754 
755  Evt_SumSquaredCaloPt = Evt_SumSquaredCaloPt + SumSquaredCaloPt[k];
756  mSumSquaredCaloPt_eta->Fill(edge_pseudorapidity[k], hSumCaloPt[k]->GetRMS(1));
757 
758  delete hSumCaloPt[k];
759 
760  } // eta bin loop
761 
762  mSumCaloPt->Fill(Evt_SumCaloPt);
763  mSumCaloPt_HF->Fill(Evt_SumCaloPt, HF_energy);
764 
765  mSumSquaredCaloPt->Fill(Evt_SumSquaredCaloPt);
766 
767  mNCalopart->Fill(NCaloTower);
768  mSumpt->Fill(SumPt_value);
769 
770  } // is calo jet
771 
772  if (isPFJet) {
773  Float_t SumPFPt[etaBins_];
774 
775  Float_t SumSquaredPFPt[etaBins_];
776 
777  // Need to set up histograms to get the RMS values for each pT bin
778  TH1F *hSumPFPt[nedge_pseudorapidity - 1];
779 
780  for (int i = 0; i < etaBins_; i++) {
781  SumPFPt[i] = 0;
782  SumSquaredPFPt[i] = 0;
783 
784  hSumPFPt[i] = new TH1F(Form("hSumPFPt_%d", i), "", 10000, -10000, 10000);
785  }
786 
787  vector<vector<float>> PF_Space(1, vector<float>(3));
788 
789  if (std::string("Cs") == UEAlgo) {
790  const reco::PFCandidateCollection *csCandidateColl = csCandidates.product();
791 
792  for (unsigned iCScand = 0; iCScand < csCandidateColl->size(); iCScand++) {
793  assert(csCandidateColl->size() <= pfCandidateColl->size());
794  const reco::PFCandidate csCandidate = csCandidateColl->at(iCScand);
795  const reco::PFCandidate pfCandidate = pfCandidateColl->at(iCScand);
796  int ieta = 0;
797  while (csCandidate.eta() > edge_pseudorapidity[ieta] && ieta < etaBins_ - 1)
798  ieta++;
799  mCSCandpT_vsPt[ieta]->Fill(csCandidate.pt());
800  mCSCand_corrPFcand[ieta]->Fill(csCandidate.pt(), pfCandidate.pt());
801  }
802  }
803 
804  for (unsigned icand = 0; icand < pfCandidateColl->size(); icand++) {
805  const reco::PFCandidate pfCandidate = pfCandidateColl->at(icand);
806  reco::CandidateViewRef ref(pfcandidates_, icand);
807  if (pfCandidate.pt() < 5)
808  continue;
809 
810  NPFpart++;
811  pfPt = pfCandidate.pt();
812  pfEta = pfCandidate.eta();
813  pfPhi = pfCandidate.phi();
814  pfID = pfCandidate.particleId();
815 
816  bool isBarrel = false;
817  bool isEndcap = false;
818  bool isForward = false;
819 
820  if (fabs(pfEta) < BarrelEta)
821  isBarrel = true;
822  if (fabs(pfEta) >= BarrelEta && fabs(pfEta) < EndcapEta)
823  isEndcap = true;
824  if (fabs(pfEta) >= EndcapEta && fabs(pfEta) < ForwardEta)
825  isForward = true;
826 
827  switch (pfID) {
828  case 0:
829  mPFCandpT_vs_eta_Unknown->Fill(pfPt, pfEta);
830  if (isBarrel)
832  if (isEndcap)
834  if (isForward)
836  break;
837  case 1:
838  mPFCandpT_vs_eta_ChargedHadron->Fill(pfPt, pfEta);
839  if (isBarrel)
841  if (isEndcap)
843  if (isForward)
845  break;
846  case 2:
847  mPFCandpT_vs_eta_electron->Fill(pfPt, pfEta);
848  if (isBarrel)
850  if (isEndcap)
852  if (isForward)
854  break;
855  case 3:
856  mPFCandpT_vs_eta_muon->Fill(pfPt, pfEta);
857  if (isBarrel)
859  if (isEndcap)
861  if (isForward)
863  break;
864  case 4:
865  mPFCandpT_vs_eta_photon->Fill(pfPt, pfEta);
866  if (isBarrel)
868  if (isEndcap)
870  if (isForward)
872  break;
873  case 5:
874  mPFCandpT_vs_eta_NeutralHadron->Fill(pfPt, pfEta);
875  if (isBarrel)
877  if (isEndcap)
879  if (isForward)
881  break;
882  case 6:
883  mPFCandpT_vs_eta_HadE_inHF->Fill(pfPt, pfEta);
884  if (isBarrel)
886  if (isEndcap)
888  if (isForward)
890  break;
891  case 7:
892  mPFCandpT_vs_eta_EME_inHF->Fill(pfPt, pfEta);
893  if (isBarrel)
895  if (isEndcap)
897  if (isForward)
899  break;
900  }
901 
902  //Fill 2d vector matrix
903  tempVector.push_back(pfPt);
904  tempVector.push_back(pfEta);
905  tempVector.push_back(pfPhi);
906 
907  numbers.push_back(tempVector);
908  tempVector.clear();
909 
910  for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
911  if (pfEta >= edge_pseudorapidity[k] && pfEta < edge_pseudorapidity[k + 1]) {
912  SumPFPt[k] = SumPFPt[k] + pfPt;
913  SumSquaredPFPt[k] = SumSquaredPFPt[k] + pfPt * pfPt;
914  break;
915  } // eta selection statement
916 
917  } // eta bin loop
918 
919  SumPt_value = SumPt_value + pfPt;
920 
921  mPFPt->Fill(pfPt);
922  mPFEta->Fill(pfEta);
923  mPFPhi->Fill(pfPhi);
924 
925  } // pf candidate loop
926 
927  for (int k = 0; k < nedge_pseudorapidity - 1; k++) {
928  hSumPFPt[k]->Fill(SumPFPt[k]);
929 
930  } // eta bin loop
931 
932  Float_t Evt_SumPFPt = 0;
933  Float_t Evt_SumSquaredPFPt = 0;
934 
935  for (int ieta = 0; ieta < etaBins_; ieta++) {
936  mSumPFPtEtaDep[ieta]->Fill(SumPFPt[ieta]);
937  }
938 
939  for (size_t k = 0; k < nedge_pseudorapidity - 1; k++) {
940  Evt_SumPFPt = Evt_SumPFPt + SumPFPt[k];
941  mSumPFPt_eta->Fill(edge_pseudorapidity[k], SumPFPt[k]);
942 
943  Evt_SumSquaredPFPt = Evt_SumSquaredPFPt + SumSquaredPFPt[k];
944  mSumSquaredPFPt_eta->Fill(edge_pseudorapidity[k], hSumPFPt[k]->GetRMS(1));
945 
946  delete hSumPFPt[k];
947 
948  } // eta bin loop
949 
950  mSumPFPt->Fill(Evt_SumPFPt);
951  mSumPFPt_HF->Fill(Evt_SumPFPt, HF_energy);
952 
953  mSumSquaredPFPt->Fill(Evt_SumSquaredPFPt);
954 
955  mNPFpart->Fill(NPFpart);
956  mSumpt->Fill(SumPt_value);
957  }
958 
959  if (isCaloJet) {
960  for (unsigned ijet = 0; ijet < caloJets->size(); ijet++) {
961  recoJets.push_back((*caloJets)[ijet]);
962  }
963  }
964 
965  if (isJPTJet) {
966  for (unsigned ijet = 0; ijet < jptJets->size(); ijet++)
967  recoJets.push_back((*jptJets)[ijet]);
968  }
969 
970  if (isPFJet) {
971  if (std::string("Pu") == UEAlgo) {
972  for (unsigned ijet = 0; ijet < basicJets->size(); ijet++) {
973  recoJets.push_back((*basicJets)[ijet]);
974  }
975  }
976  if (std::string("Cs") == UEAlgo) {
977  for (unsigned ijet = 0; ijet < pfJets->size(); ijet++) {
978  recoJets.push_back((*pfJets)[ijet]);
979  }
980  }
981  }
982 
983  if (isCaloJet && !caloJets.isValid()) {
984  return;
985  }
986  if (isJPTJet && !jptJets.isValid()) {
987  return;
988  }
989  if (isPFJet) {
990  if (std::string("Pu") == UEAlgo) {
991  if (!basicJets.isValid())
992  return;
993  }
994  if (std::string("Cs") == UEAlgo) {
995  if (!pfJets.isValid())
996  return;
997  }
998  if (std::string("Vs") == UEAlgo) {
999  return;
1000  }
1001  }
1002 
1003  int nJet_40 = 0;
1004 
1005  mNJets->Fill(recoJets.size());
1006 
1007  for (unsigned ijet = 0; ijet < recoJets.size(); ijet++) {
1008  if (recoJets[ijet].pt() > mRecoJetPtThreshold) {
1009  //counting forward and barrel jets
1010  // get an idea of no of jets with pT>40 GeV
1011  if (recoJets[ijet].pt() > 40)
1012  nJet_40++;
1013  if (mEta)
1014  mEta->Fill(recoJets[ijet].eta());
1015  if (mjetpileup)
1016  mjetpileup->Fill(recoJets[ijet].pileup());
1017  if (mJetArea)
1018  mJetArea->Fill(recoJets[ijet].jetArea());
1019  if (mPhi)
1020  mPhi->Fill(recoJets[ijet].phi());
1021  if (mEnergy)
1022  mEnergy->Fill(recoJets[ijet].energy());
1023  if (mP)
1024  mP->Fill(recoJets[ijet].p());
1025  if (mPt)
1026  mPt->Fill(recoJets[ijet].pt());
1027  if (mMass)
1028  mMass->Fill(recoJets[ijet].mass());
1029  if (mConstituents)
1030  mConstituents->Fill(recoJets[ijet].nConstituents());
1031 
1032  if (std::string("Cs") == UEAlgo) {
1033  int ipt = 0, ieta = 0;
1034  while (recoJets[ijet].pt() > ptBin[ipt + 1] && ipt < ptBins_ - 1)
1035  ipt++;
1036  while (recoJets[ijet].eta() > etaRanges->at(ieta + 1) && ieta < (int)(rho->size() - 1))
1037  ieta++;
1038  mSubtractedEFrac[ipt][ieta]->Fill((double)recoJets[ijet].pileup() / (double)recoJets[ijet].energy());
1039  mSubtractedE[ipt][ieta]->Fill(recoJets[ijet].pileup());
1040 
1041  for (unsigned irho = 0; irho < rho->size(); irho++) {
1042  mRhoDist_vsEta->Fill(recoJets[ijet].eta(), rho->at(irho));
1043  mRhoMDist_vsEta->Fill(recoJets[ijet].eta(), rhom->at(irho));
1044  mRhoDist_vsPt->Fill(recoJets[ijet].pt(), rho->at(irho));
1045  mRhoMDist_vsPt->Fill(recoJets[ijet].pt(), rhom->at(irho));
1046  mRhoDist_vsCent[ieta]->Fill(HF_energy, rho->at(irho));
1047  mRhoMDist_vsCent[ieta]->Fill(HF_energy, rhom->at(irho));
1048  }
1049  }
1050 
1051  for (size_t iii = 0; iii < numbers.size(); iii++) {
1052  pfDeltaR = sqrt((numbers[iii][2] - recoJets[ijet].phi()) * (numbers[iii][2] - recoJets[ijet].phi()) +
1053  (numbers[iii][1] - recoJets[ijet].eta()) * (numbers[iii][1] - recoJets[ijet].eta())); //MZ
1054 
1055  mPFDeltaR->Fill(pfDeltaR); //MZ
1056  mPFDeltaR_Scaled_R->Fill(pfDeltaR, 1. / pow(pfDeltaR, 2)); //MZ
1057  }
1058  }
1059  }
1060  if (mNJets_40)
1061  mNJets_40->Fill(nJet_40);
1062 
1063  numbers.clear();
1064 }
MonitorElement * mPFCandpT_Forward_photon
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken_
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandToken_
edm::InputTag mInputCsCandCollection
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
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken_
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
Definition: CaloTower.cc:155
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MonitorElement * mPFCandpT_Forward_muon
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
MonitorElement * mCSCandpT_vsPt[etaBins_]
MonitorElement * mPFCandpT_Endcap_NeutralHadron
MonitorElement * mPFCandpT_vs_eta_EME_inHF
MonitorElement * mSumSquaredCaloPt
bool isForward(DetId const &)
bool exists(std::string const &parameterName) const
checks if a parameter exists
MonitorElement * mSubtractedEFrac[ptBins_][etaBins_]
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * mSumPFPtEtaDep[etaBins_]
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
const uint16_t range(const Frame &aFrame)
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
virtual int getNbinsX() const
get # of bins in X-axis
edm::EDGetTokenT< reco::Centrality > centralityToken
MonitorElement * mPFCandpT_Forward_ChargedHadron
MonitorElement * mSubtractedE[ptBins_][etaBins_]
T sqrt(T t)
Definition: SSEVec.h:19
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
bool isValid() const
Definition: HandleBase.h:70
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
T const * product() const
Definition: Handle.h:70
MonitorElement * mSumSquaredPFPt_eta
MonitorElement * mPFCandpT_Endcap_EME_inHF
MonitorElement * mPFCandpT_vs_eta_HadE_inHF
tuple recoJets
Definition: RecoJets_cff.py:19
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:177
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::CandidateView > pfCandViewToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * mPFCandpT_Forward_Unknown
std::string const & label() const
Definition: InputTag.h:36
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
MonitorElement * mPFCandpT_Barrel_electron
static int position[264][3]
Definition: ReadPGInfo.cc:289
MonitorElement * mPFCandpT_Endcap_electron
edm::EDGetTokenT< std::vector< double > > etaToken_
const Double_t BarrelEta
MonitorElement * mRhoDist_vsCent[etaBins_]
virtual ParticleType particleId() const
Definition: PFCandidate.h:392
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
tuple pfJets
Definition: pfJets_cff.py:8
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
double eta() const final
momentum pseudorapidity
MonitorElement * mPFCandpT_Barrel_muon