CMS 3D CMS Logo

HCALRecHitAnalyzer.cc
Go to the documentation of this file.
2 // author: Bobby Scurlock, University of Florida
3 // first version 12/7/2006
4 // modified: Mike Schmitt
5 // date: 03.05.2007
6 // note: 1) code rewrite. 2.) changed to loop over all hcal detids;
7 // not only those within calotowers.
8 
12 
13 //#include "PluginManager/ModuleDef.h"
18 //#include "FWCore/Framework/interface/Handle.h"
21 
22 //#include "Geometry/Vector/interface/GlobalPoint.h"
29 
33 
34 #include <memory>
35 #include <vector>
36 #include <utility>
37 #include <ostream>
38 #include <fstream>
39 #include <string>
40 #include <algorithm>
41 #include <cmath>
42 #include <TLorentzVector.h>
44 
45 #define DEBUG(X) { if (debug_) { std::cout << X << std::endl; } }
46 
48 {
49 
50  // Retrieve Information from the Configuration File
51  hBHERecHitsLabel_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("HBHERecHitsLabel"));
52  hORecHitsLabel_ = consumes<HORecHitCollection>(iConfig.getParameter<edm::InputTag>("HORecHitsLabel"));
53  hFRecHitsLabel_ = consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("HFRecHitsLabel"));
54 
55  debug_ = iConfig.getParameter<bool>("Debug");
56  finebinning_ = iConfig.getUntrackedParameter<bool>("FineBinning");
57  FolderName_ = iConfig.getUntrackedParameter<std::string>("FolderName");
58 
59 }
60 
62 {
63  Nevents = 0;
64  FillGeometry(iSetup);
65 }
66 
68  edm::Run const & iRun,
69  edm::EventSetup const & ) {
70  // get ahold of back-end interface
71  // dbe_ = edm::Service<DQMStore>().operator->();
72 
73  ibooker.setCurrentFolder(FolderName_+"/geometry");
74  hHCAL_ieta_iphi_HBMap = ibooker.book2D("METTask_HCAL_ieta_iphi_HBMap","",83,-41,42,72,1,73);
75  hHCAL_ieta_iphi_HEMap = ibooker.book2D("METTask_HCAL_ieta_iphi_HEMap","",83,-41,42,72,1,73);
76  hHCAL_ieta_iphi_HFMap = ibooker.book2D("METTask_HCAL_ieta_iphi_HFMap","",83,-41,42,72,1,73);
77  hHCAL_ieta_iphi_HOMap = ibooker.book2D("METTask_HCAL_ieta_iphi_HOMap","",83,-41,42,72,1,73);
78  hHCAL_ieta_iphi_etaMap = ibooker.book2D("METTask_HCAL_ieta_iphi_etaMap","",83,-41,42,72,1,73);
79  hHCAL_ieta_iphi_phiMap = ibooker.book2D("METTask_HCAL_ieta_iphi_phiMap","",83,-41,42,72,1,73);
80  hHCAL_ieta_detaMap = ibooker.book1D("METTask_HCAL_ieta_detaMap","",83,-41,42);
81  hHCAL_ieta_dphiMap = ibooker.book1D("METTask_HCAL_ieta_dphiMap","",83,-41,42);
82 
83  // Initialize bins for geometry to -999 because z = 0 is a valid entry
84  for (int i = 1; i <= 83; i++) {
85 
88 
89  for (int j = 1; j <= 72; j++) {
90 
97 
98  }
99 
100  }
101 
102  // ibooker.setCurrentFolder("RecoMETV/MET_HCAL/data");
103  ibooker.setCurrentFolder(FolderName_);
104  //--Store number of events used
105  hHCAL_Nevents = ibooker.book1D("METTask_HCAL_Nevents","",1,0,1);
106  //--Data integrated over all events and stored by HCAL(ieta,iphi)
107 
108  hHCAL_D1_energy_ieta_iphi = ibooker.book2D("METTask_HCAL_D1_energy_ieta_iphi","",83,-41,42,72,1,73);
109  hHCAL_D2_energy_ieta_iphi = ibooker.book2D("METTask_HCAL_D2_energy_ieta_iphi","",83,-41,42,72,1,73);
110  hHCAL_D3_energy_ieta_iphi = ibooker.book2D("METTask_HCAL_D3_energy_ieta_iphi","",83,-41,42,72,1,73);
111  hHCAL_D4_energy_ieta_iphi = ibooker.book2D("METTask_HCAL_D4_energy_ieta_iphi","",83,-41,42,72,1,73);
112 
113  hHCAL_D1_Minenergy_ieta_iphi = ibooker.book2D("METTask_HCAL_D1_Minenergy_ieta_iphi","",83,-41,42,72,1,73);
114  hHCAL_D2_Minenergy_ieta_iphi = ibooker.book2D("METTask_HCAL_D2_Minenergy_ieta_iphi","",83,-41,42,72,1,73);
115  hHCAL_D3_Minenergy_ieta_iphi = ibooker.book2D("METTask_HCAL_D3_Minenergy_ieta_iphi","",83,-41,42,72,1,73);
116  hHCAL_D4_Minenergy_ieta_iphi = ibooker.book2D("METTask_HCAL_D4_Minenergy_ieta_iphi","",83,-41,42,72,1,73);
117 
118  hHCAL_D1_Maxenergy_ieta_iphi = ibooker.book2D("METTask_HCAL_D1_Maxenergy_ieta_iphi","",83,-41,42,72,1,73);
119  hHCAL_D2_Maxenergy_ieta_iphi = ibooker.book2D("METTask_HCAL_D2_Maxenergy_ieta_iphi","",83,-41,42,72,1,73);
120  hHCAL_D3_Maxenergy_ieta_iphi = ibooker.book2D("METTask_HCAL_D3_Maxenergy_ieta_iphi","",83,-41,42,72,1,73);
121  hHCAL_D4_Maxenergy_ieta_iphi = ibooker.book2D("METTask_HCAL_D4_Maxenergy_ieta_iphi","",83,-41,42,72,1,73);
122 
123  // need to initialize those
124  for (int i=1; i<=83; i++)
125  for (int j=1; j<=73; j++)
126  {
131 
136  }
137 
138  hHCAL_D1_Occ_ieta_iphi = ibooker.book2D("METTask_HCAL_D1_Occ_ieta_iphi","",83,-41,42,72,1,73);
139  hHCAL_D2_Occ_ieta_iphi = ibooker.book2D("METTask_HCAL_D2_Occ_ieta_iphi","",83,-41,42,72,1,73);
140  hHCAL_D3_Occ_ieta_iphi = ibooker.book2D("METTask_HCAL_D3_Occ_ieta_iphi","",83,-41,42,72,1,73);
141  hHCAL_D4_Occ_ieta_iphi = ibooker.book2D("METTask_HCAL_D4_Occ_ieta_iphi","",83,-41,42,72,1,73);
142  //--Data over eta-rings
143 
144 
145  // CaloTower values
146 
147  if(finebinning_)
148  {
149  hHCAL_D1_energyvsieta = ibooker.book2D("METTask_HCAL_D1_energyvsieta","",83,-41,42,20101,-100,2001);
150  hHCAL_D2_energyvsieta = ibooker.book2D("METTask_HCAL_D2_energyvsieta","",83,-41,42,20101,-100,2001);
151  hHCAL_D3_energyvsieta = ibooker.book2D("METTask_HCAL_D3_energyvsieta","",83,-41,42,20101,-100,2001);
152  hHCAL_D4_energyvsieta = ibooker.book2D("METTask_HCAL_D4_energyvsieta","",83,-41,42,20101,-100,2001);
153 
154  hHCAL_D1_Minenergyvsieta = ibooker.book2D("METTask_HCAL_D1_Minenergyvsieta","",83,-41,42,20101,-100,2001);
155  hHCAL_D2_Minenergyvsieta = ibooker.book2D("METTask_HCAL_D2_Minenergyvsieta","",83,-41,42,20101,-100,2001);
156  hHCAL_D3_Minenergyvsieta = ibooker.book2D("METTask_HCAL_D3_Minenergyvsieta","",83,-41,42,20101,-100,2001);
157  hHCAL_D4_Minenergyvsieta = ibooker.book2D("METTask_HCAL_D4_Minenergyvsieta","",83,-41,42,20101,-100,2001);
158 
159  hHCAL_D1_Maxenergyvsieta = ibooker.book2D("METTask_HCAL_D1_Maxenergyvsieta","",83,-41,42,20101,-100,2001);
160  hHCAL_D2_Maxenergyvsieta = ibooker.book2D("METTask_HCAL_D2_Maxenergyvsieta","",83,-41,42,20101,-100,2001);
161  hHCAL_D3_Maxenergyvsieta = ibooker.book2D("METTask_HCAL_D3_Maxenergyvsieta","",83,-41,42,20101,-100,2001);
162  hHCAL_D4_Maxenergyvsieta = ibooker.book2D("METTask_HCAL_D4_Maxenergyvsieta","",83,-41,42,20101,-100,2001);
163 
164  // Integrated over phi
165  hHCAL_D1_Occvsieta = ibooker.book2D("METTask_HCAL_D1_Occvsieta","",83,-41,42,73,0,73);
166  hHCAL_D2_Occvsieta = ibooker.book2D("METTask_HCAL_D2_Occvsieta","",83,-41,42,73,0,73);
167  hHCAL_D3_Occvsieta = ibooker.book2D("METTask_HCAL_D3_Occvsieta","",83,-41,42,73,0,73);
168  hHCAL_D4_Occvsieta = ibooker.book2D("METTask_HCAL_D4_Occvsieta","",83,-41,42,73,0,73);
169 
170  hHCAL_D1_SETvsieta = ibooker.book2D("METTask_HCAL_D1_SETvsieta","",83,-41,42,20001,0,2001);
171  hHCAL_D2_SETvsieta = ibooker.book2D("METTask_HCAL_D2_SETvsieta","",83,-41,42,20001,0,2001);
172  hHCAL_D3_SETvsieta = ibooker.book2D("METTask_HCAL_D3_SETvsieta","",83,-41,42,20001,0,2001);
173  hHCAL_D4_SETvsieta = ibooker.book2D("METTask_HCAL_D4_SETvsieta","",83,-41,42,20001,0,2001);
174 
175  hHCAL_D1_METvsieta = ibooker.book2D("METTask_HCAL_D1_METvsieta","",83,-41,42,20001,0,2001);
176  hHCAL_D2_METvsieta = ibooker.book2D("METTask_HCAL_D2_METvsieta","",83,-41,42,20001,0,2001);
177  hHCAL_D3_METvsieta = ibooker.book2D("METTask_HCAL_D3_METvsieta","",83,-41,42,20001,0,2001);
178  hHCAL_D4_METvsieta = ibooker.book2D("METTask_HCAL_D4_METvsieta","",83,-41,42,20001,0,2001);
179 
180  hHCAL_D1_METPhivsieta = ibooker.book2D("METTask_HCAL_D1_METPhivsieta","",83,-41,42, 80, -4,4);
181  hHCAL_D2_METPhivsieta = ibooker.book2D("METTask_HCAL_D2_METPhivsieta","",83,-41,42, 80, -4,4);
182  hHCAL_D3_METPhivsieta = ibooker.book2D("METTask_HCAL_D3_METPhivsieta","",83,-41,42, 80, -4,4);
183  hHCAL_D4_METPhivsieta = ibooker.book2D("METTask_HCAL_D4_METPhivsieta","",83,-41,42, 80, -4,4);
184 
185  hHCAL_D1_MExvsieta = ibooker.book2D("METTask_HCAL_D1_MExvsieta","",83,-41,42, 10001,-500,501);
186  hHCAL_D2_MExvsieta = ibooker.book2D("METTask_HCAL_D2_MExvsieta","",83,-41,42, 10001,-500,501);
187  hHCAL_D3_MExvsieta = ibooker.book2D("METTask_HCAL_D3_MExvsieta","",83,-41,42, 10001,-500,501);
188  hHCAL_D4_MExvsieta = ibooker.book2D("METTask_HCAL_D4_MExvsieta","",83,-41,42, 10001,-500,501);
189 
190  hHCAL_D1_MEyvsieta = ibooker.book2D("METTask_HCAL_D1_MEyvsieta","",83,-41,42, 10001,-500,501);
191  hHCAL_D2_MEyvsieta = ibooker.book2D("METTask_HCAL_D2_MEyvsieta","",83,-41,42, 10001,-500,501);
192  hHCAL_D3_MEyvsieta = ibooker.book2D("METTask_HCAL_D3_MEyvsieta","",83,-41,42, 10001,-500,501);
193  hHCAL_D4_MEyvsieta = ibooker.book2D("METTask_HCAL_D4_MEyvsieta","",83,-41,42, 10001,-500,501);
194  }
195  else
196  {
197  hHCAL_D1_energyvsieta = ibooker.book2D("METTask_HCAL_D1_energyvsieta","",83,-41,42,1000,-10,1990);
198  hHCAL_D2_energyvsieta = ibooker.book2D("METTask_HCAL_D2_energyvsieta","",83,-41,42,1000,-10,1990);
199  hHCAL_D3_energyvsieta = ibooker.book2D("METTask_HCAL_D3_energyvsieta","",83,-41,42,1000,-10,1990);
200  hHCAL_D4_energyvsieta = ibooker.book2D("METTask_HCAL_D4_energyvsieta","",83,-41,42,1000,-10,1990);
201 
202  hHCAL_D1_Minenergyvsieta = ibooker.book2D("METTask_HCAL_D1_Minenergyvsieta","",83,-41,42,1000,-10,1990);
203  hHCAL_D2_Minenergyvsieta = ibooker.book2D("METTask_HCAL_D2_Minenergyvsieta","",83,-41,42,1000,-10,1990);
204  hHCAL_D3_Minenergyvsieta = ibooker.book2D("METTask_HCAL_D3_Minenergyvsieta","",83,-41,42,1000,-10,1990);
205  hHCAL_D4_Minenergyvsieta = ibooker.book2D("METTask_HCAL_D4_Minenergyvsieta","",83,-41,42,1000,-10,1990);
206 
207  hHCAL_D1_Maxenergyvsieta = ibooker.book2D("METTask_HCAL_D1_Maxenergyvsieta","",83,-41,42,1000,-10,1990);
208  hHCAL_D2_Maxenergyvsieta = ibooker.book2D("METTask_HCAL_D2_Maxenergyvsieta","",83,-41,42,1000,-10,1990);
209  hHCAL_D3_Maxenergyvsieta = ibooker.book2D("METTask_HCAL_D3_Maxenergyvsieta","",83,-41,42,1000,-10,1990);
210  hHCAL_D4_Maxenergyvsieta = ibooker.book2D("METTask_HCAL_D4_Maxenergyvsieta","",83,-41,42,1000,-10,1990);
211 
212  // Integrated over phi
213  hHCAL_D1_Occvsieta = ibooker.book2D("METTask_HCAL_D1_Occvsieta","",83,-41,42,73,0,73);
214  hHCAL_D2_Occvsieta = ibooker.book2D("METTask_HCAL_D2_Occvsieta","",83,-41,42,73,0,73);
215  hHCAL_D3_Occvsieta = ibooker.book2D("METTask_HCAL_D3_Occvsieta","",83,-41,42,73,0,73);
216  hHCAL_D4_Occvsieta = ibooker.book2D("METTask_HCAL_D4_Occvsieta","",83,-41,42,73,0,73);
217 
218  hHCAL_D1_SETvsieta = ibooker.book2D("METTask_HCAL_D1_SETvsieta","",83,-41,42,1000,0,2000);
219  hHCAL_D2_SETvsieta = ibooker.book2D("METTask_HCAL_D2_SETvsieta","",83,-41,42,1000,0,2000);
220  hHCAL_D3_SETvsieta = ibooker.book2D("METTask_HCAL_D3_SETvsieta","",83,-41,42,1000,0,2000);
221  hHCAL_D4_SETvsieta = ibooker.book2D("METTask_HCAL_D4_SETvsieta","",83,-41,42,1000,0,2000);
222 
223  hHCAL_D1_METvsieta = ibooker.book2D("METTask_HCAL_D1_METvsieta","",83,-41,42,1000,0,2000);
224  hHCAL_D2_METvsieta = ibooker.book2D("METTask_HCAL_D2_METvsieta","",83,-41,42,1000,0,2000);
225  hHCAL_D3_METvsieta = ibooker.book2D("METTask_HCAL_D3_METvsieta","",83,-41,42,1000,0,2000);
226  hHCAL_D4_METvsieta = ibooker.book2D("METTask_HCAL_D4_METvsieta","",83,-41,42,1000,0,2000);
227 
228  hHCAL_D1_METPhivsieta = ibooker.book2D("METTask_HCAL_D1_METPhivsieta","",83,-41,42, 80, -4,4);
229  hHCAL_D2_METPhivsieta = ibooker.book2D("METTask_HCAL_D2_METPhivsieta","",83,-41,42, 80, -4,4);
230  hHCAL_D3_METPhivsieta = ibooker.book2D("METTask_HCAL_D3_METPhivsieta","",83,-41,42, 80, -4,4);
231  hHCAL_D4_METPhivsieta = ibooker.book2D("METTask_HCAL_D4_METPhivsieta","",83,-41,42, 80, -4,4);
232 
233  hHCAL_D1_MExvsieta = ibooker.book2D("METTask_HCAL_D1_MExvsieta","",83,-41,42, 500,-500,500);
234  hHCAL_D2_MExvsieta = ibooker.book2D("METTask_HCAL_D2_MExvsieta","",83,-41,42, 500,-500,500);
235  hHCAL_D3_MExvsieta = ibooker.book2D("METTask_HCAL_D3_MExvsieta","",83,-41,42, 500,-500,500);
236  hHCAL_D4_MExvsieta = ibooker.book2D("METTask_HCAL_D4_MExvsieta","",83,-41,42, 500,-500,500);
237 
238  hHCAL_D1_MEyvsieta = ibooker.book2D("METTask_HCAL_D1_MEyvsieta","",83,-41,42, 500,-500,500);
239  hHCAL_D2_MEyvsieta = ibooker.book2D("METTask_HCAL_D2_MEyvsieta","",83,-41,42, 500,-500,500);
240  hHCAL_D3_MEyvsieta = ibooker.book2D("METTask_HCAL_D3_MEyvsieta","",83,-41,42, 500,-500,500);
241  hHCAL_D4_MEyvsieta = ibooker.book2D("METTask_HCAL_D4_MEyvsieta","",83,-41,42, 500,-500,500);
242 
243  }
244  // Inspect Setup for CaloTower Geometry
245  // FillGeometry(iSetup);
246 }
247 
249 {
250 
251  // ==========================================================
252  // Retrieve!
253  // ==========================================================
254 
256  iSetup.get<CaloGeometryRecord>().get(pG);
257 
258  if (!pG.isValid() )
259  {
260  edm::LogInfo("OutputInfo") << "Failed to retrieve an Event Setup Handle, Aborting Task "
261  << "HCALRecHitAnalyzer::FillGeometry!\n";
262  return;
263  }
264 
265  const CaloGeometry cG = *pG;
266 
267  const HcalGeometry* HBgeom = dynamic_cast<const HcalGeometry*>(cG.getSubdetectorGeometry(DetId::Hcal,HcalBarrel));
268  const HcalGeometry* HEgeom = dynamic_cast<const HcalGeometry*>(cG.getSubdetectorGeometry(DetId::Hcal,HcalEndcap));
271 
272 
273  // ==========================================================
274  // Fill Histograms!
275  // ==========================================================
276 
277  std::vector<DetId>::iterator i;
278 
279  int HBmin_ieta = 99, HBmax_ieta = -99;
280  int HBmin_iphi = 99, HBmax_iphi = -99;
281 
282  // Loop Over all Hcal Barrel DetId's
283  int nHBdetid = 0;
284  std::vector<DetId> HBids = HBgeom->getValidDetIds(DetId::Hcal,HcalBarrel);
285 
286  for (i = HBids.begin(); i != HBids.end(); i++) {
287 
288  nHBdetid++;
289 
290  HcalDetId HcalID(*i);
291 
292  int Calo_ieta = 42 + HcalID.ieta();
293  int Calo_iphi = HcalID.iphi();
294  double Calo_eta = HBgeom->getPosition(HcalID).eta();
295  double Calo_phi = HBgeom->getPosition(HcalID).phi();
296 
297  if (hHCAL_ieta_iphi_etaMap->getBinContent(Calo_ieta,Calo_iphi) == -999) {
298 
299  hHCAL_ieta_iphi_etaMap->setBinContent(Calo_ieta,Calo_iphi,Calo_eta);
300  hHCAL_ieta_iphi_phiMap->setBinContent(Calo_ieta,Calo_iphi,Calo_phi*180.0/M_PI);
301 
302  }
303 
304  if (Calo_ieta > HBmax_ieta) HBmax_ieta = Calo_ieta;
305  if (Calo_ieta < HBmin_ieta) HBmin_ieta = Calo_ieta;
306  if (Calo_iphi > HBmax_iphi) HBmax_iphi = Calo_iphi;
307  if (Calo_iphi > HBmax_iphi) HBmin_iphi = Calo_iphi;
308 
309  }
310 
311  int HEmin_ieta = 99, HEmax_ieta = -99;
312  int HEmin_iphi = 99, HEmax_iphi = -99;
313 
314  // Loop Over all Hcal Endcap DetId's
315  int nHEdetid = 0;
316  std::vector<DetId> HEids = HEgeom->getValidDetIds(DetId::Hcal,HcalEndcap);
317 
318  for (i = HEids.begin(); i != HEids.end(); i++) {
319 
320  nHEdetid++;
321 
322  HcalDetId HcalID(*i);
323 
324  int Calo_ieta = 42 + HcalID.ieta();
325  int Calo_iphi = HcalID.iphi();
326  double Calo_eta = HEgeom->getPosition(HcalID).eta();
327  double Calo_phi = HEgeom->getPosition(HcalID).phi();
328 
329  // HCAL to HE eta, phi map comparison
330  if (hHCAL_ieta_iphi_etaMap->getBinContent(Calo_ieta,Calo_iphi) == -999) {
331  hHCAL_ieta_iphi_etaMap->setBinContent(Calo_ieta,Calo_iphi,Calo_eta);
332  hHCAL_ieta_iphi_phiMap->setBinContent(Calo_ieta,Calo_iphi,Calo_phi*180.0/M_PI);
333  }
334 
335  if (Calo_ieta > HEmax_ieta) HEmax_ieta = Calo_ieta;
336  if (Calo_ieta < HEmin_ieta) HEmin_ieta = Calo_ieta;
337  if (Calo_iphi > HEmax_iphi) HEmax_iphi = Calo_iphi;
338  if (Calo_iphi > HEmax_iphi) HEmin_iphi = Calo_iphi;
339 
340  }
341 
342  int HFmin_ieta = 99, HFmax_ieta = -99;
343  int HFmin_iphi = 99, HFmax_iphi = -99;
344 
345  // Loop Over all Hcal Forward DetId's
346  int nHFdetid = 0;
347  std::vector<DetId> HFids = HFgeom->getValidDetIds(DetId::Hcal,HcalForward);
348 
349  for (i = HFids.begin(); i != HFids.end(); i++) {
350 
351  nHFdetid++;
352 
353  auto cell = HFgeom->getGeometry(*i);
354  HcalDetId HcalID(i->rawId());
355  //GlobalPoint p = cell->getPosition();
356 
357  int Calo_ieta = 42 + HcalID.ieta();
358  int Calo_iphi = HcalID.iphi();
359  double Calo_eta = cell->getPosition().eta();
360  double Calo_phi = cell->getPosition().phi();
361 
362  // HCAL to HF eta, phi map comparison
363  if (hHCAL_ieta_iphi_etaMap->getBinContent(Calo_ieta,Calo_iphi) == -999) {
364  hHCAL_ieta_iphi_etaMap->setBinContent(Calo_ieta,Calo_iphi,Calo_eta);
365  hHCAL_ieta_iphi_phiMap->setBinContent(Calo_ieta,Calo_iphi,Calo_phi*180.0/M_PI);
366  }
367 
368  if (Calo_ieta > HFmax_ieta) HFmax_ieta = Calo_ieta;
369  if (Calo_ieta < HFmin_ieta) HFmin_ieta = Calo_ieta;
370  if (Calo_iphi > HFmax_iphi) HFmax_iphi = Calo_iphi;
371  if (Calo_iphi > HFmax_iphi) HFmin_iphi = Calo_iphi;
372 
373  }
374 
375  int HOmin_ieta = 99, HOmax_ieta = -99;
376  int HOmin_iphi = 99, HOmax_iphi = -99;
377 
378  // Loop Over all Hcal Outer DetId's
379  int nHOdetid = 0;
380  std::vector<DetId> HOids = HOgeom->getValidDetIds(DetId::Hcal,HcalOuter);
381 
382  for (i = HOids.begin(); i != HOids.end(); i++) {
383 
384  nHOdetid++;
385 
386  auto cell = HOgeom->getGeometry(*i);
387  HcalDetId HcalID(i->rawId());
388  //GlobalPoint p = cell->getPosition();
389 
390  int Calo_ieta = 42 + HcalID.ieta();
391  int Calo_iphi = HcalID.iphi();
392  double Calo_eta = cell->getPosition().eta();
393  double Calo_phi = cell->getPosition().phi();
394 
395  // HCAL to HO eta, phi map comparison
396  if (hHCAL_ieta_iphi_etaMap->getBinContent(Calo_ieta,Calo_iphi) == -999) {
397  hHCAL_ieta_iphi_etaMap->setBinContent(Calo_ieta,Calo_iphi,Calo_eta);
398  hHCAL_ieta_iphi_phiMap->setBinContent(Calo_ieta,Calo_iphi,Calo_phi*180.0/M_PI);
399  }
400 
401  if (Calo_ieta > HOmax_ieta) HOmax_ieta = Calo_ieta;
402  if (Calo_ieta < HOmin_ieta) HOmin_ieta = Calo_ieta;
403  if (Calo_iphi > HOmax_iphi) HOmax_iphi = Calo_iphi;
404  if (Calo_iphi > HOmax_iphi) HOmin_iphi = Calo_iphi;
405 
406  }
407 
408  // Set the Cell Size for each (ieta, iphi) Bin
409  double currentLowEdge_eta = 0; //double currentHighEdge_eta = 0;
410  for (int ieta = 1; ieta < 42 ; ieta++) {
411 
412  int ieta_ = 42 + ieta;
413  double eta = hHCAL_ieta_iphi_etaMap->getBinContent(ieta_,3);
414  double phi = hHCAL_ieta_iphi_phiMap->getBinContent(ieta_,3);
415  double deta = 2.0*(eta-currentLowEdge_eta);
416  deta = ((float)((int)(1.0E3*deta + 0.5)))/1.0E3;
417  double dphi = 2.0*phi;
418  if (ieta==40 || ieta==41) dphi = 20;
419  if (ieta<=39 && ieta>=21) dphi = 10;
420  if (ieta<=20) dphi = 5;
421  // BS: This is WRONG...need to correct overlap
422  if (ieta == 28) deta = 0.218;
423  if (ieta == 29) deta= 0.096;
424  currentLowEdge_eta += deta;
425 
426  // BS: This is WRONG...need to correct overlap
427  if (ieta == 29) currentLowEdge_eta = 2.964;
428 
429  hHCAL_ieta_detaMap->setBinContent(ieta_,deta); // positive rings
430  hHCAL_ieta_dphiMap->setBinContent(ieta_,dphi); // positive rings
431  hHCAL_ieta_detaMap->setBinContent(42-ieta,deta); // negative rings
432  hHCAL_ieta_dphiMap->setBinContent(42-ieta,dphi); // negative rings
433 
434  } // end loop over ieta
435 
436  edm::LogInfo("OutputInfo") << "HB ieta range: " << HBmin_ieta << " " << HBmax_ieta;
437  edm::LogInfo("OutputInfo") << "HB iphi range: " << HBmin_iphi << " " << HBmax_iphi;
438  edm::LogInfo("OutputInfo") << "HE ieta range: " << HEmin_ieta << " " << HEmax_ieta;
439  edm::LogInfo("OutputInfo") << "HE iphi range: " << HEmin_iphi << " " << HEmax_iphi;
440  edm::LogInfo("OutputInfo") << "HF ieta range: " << HFmin_ieta << " " << HFmax_ieta;
441  edm::LogInfo("OutputInfo") << "HF iphi range: " << HFmin_iphi << " " << HFmax_iphi;
442  edm::LogInfo("OutputInfo") << "HO ieta range: " << HOmin_ieta << " " << HOmax_ieta;
443  edm::LogInfo("OutputInfo") << "HO iphi range: " << HOmin_iphi << " " << HOmax_iphi;
444 
445 }
446 
448 {
449  Nevents++;
450  hHCAL_Nevents->Fill(0);
451  // ==========================================================
452  // Retrieve!
453  // ==========================================================
454 
456  const HORecHitCollection *HORecHits;
458 
459  edm::Handle<HBHERecHitCollection> HBHERecHitsHandle;
460  iEvent.getByToken(hBHERecHitsLabel_,HBHERecHitsHandle);
461  if (!HBHERecHitsHandle.isValid()) {
462  edm::LogInfo("OutputInfo") << "Failed to retrieve an Event Handle, Aborting Task "
463  << "HCALRecHitAnalyzer::analyze!\n"; return;
464  } else {
465  HBHERecHits = HBHERecHitsHandle.product();
466  }
467  edm::Handle<HORecHitCollection> HORecHitsHandle;
468  iEvent.getByToken(hORecHitsLabel_,HORecHitsHandle);
469  if (!HORecHitsHandle.isValid()) {
470  edm::LogInfo("OutputInfo") << "Failed to retrieve an Event Handle, Aborting Task "
471  << "HCALRecHitAnalyzer::analyze!\n"; return;
472  } else {
473  HORecHits = HORecHitsHandle.product();
474  }
475  edm::Handle<HFRecHitCollection> HFRecHitsHandle;
476  iEvent.getByToken(hFRecHitsLabel_,HFRecHitsHandle);
477  if (!HFRecHitsHandle.isValid()) {
478  edm::LogInfo("OutputInfo") << "Failed to retrieve an Event Handle, Aborting Task "
479  << "HCALRecHitAnalyzer::analyze!\n"; return;
480  } else {
481  HFRecHits = HFRecHitsHandle.product();
482  }
483 
484  // ==========================================================
485  // Fill Histograms!
486  // ==========================================================
487 
488  TLorentzVector vHBHEMET_EtaRing[83][4];
489  int HBHEActiveRing[83][4];
490  int HBHENActiveCells[83][4];
491  double HBHESET_EtaRing[83][4];
492  double HBHEMinEnergy_EtaRing[83][4];
493  double HBHEMaxEnergy_EtaRing[83][4];
494 
495  for (int i = 0; i < 83; i++) {
496  for (int j = 0; j < 4; j++) {
497 
498  HBHEActiveRing[i][j] = 0;
499  HBHENActiveCells[i][j] = 0;
500  HBHESET_EtaRing[i][j] = 0;
501  HBHEMinEnergy_EtaRing[i][j] = 14E3;
502  HBHEMaxEnergy_EtaRing[i][j] = -999;
503  }
504  }
505 
506  // Loop over HBHERecHit's
508  int nHBrechit = 0, nHErechit = 0;
509 
510  for (hbherechit = HBHERecHits->begin(); hbherechit != HBHERecHits->end(); hbherechit++) {
511 
512  HcalDetId det = hbherechit->id();
513  double Energy = hbherechit->energy();
514  Int_t depth = det.depth();
515  Int_t ieta = det.ieta();
516  Int_t iphi = det.iphi();
517  int EtaRing = 41 + ieta; // this counts from 0
518  double eta = hHCAL_ieta_iphi_etaMap->getBinContent(EtaRing+1,iphi);
519  double phi = hHCAL_ieta_iphi_phiMap->getBinContent(EtaRing+1,iphi);
520  double theta = 2*TMath::ATan(exp(-1*eta));
521  double ET = Energy*TMath::Sin(theta);
522  HcalSubdetector HcalNum = det.subdet();
523  TLorentzVector v_;
524 
525 
526 
527  if (Energy>0) // zero suppress
528  {
529  HBHEActiveRing[EtaRing][depth-1] = 1;
530  HBHENActiveCells[EtaRing][depth-1]++;
531  HBHESET_EtaRing[EtaRing][depth-1]+=ET;
532  v_.SetPtEtaPhiE(ET, 0, phi, ET);
533  vHBHEMET_EtaRing[EtaRing][depth-1]-=v_;
534 
535 
536  DEBUG( EtaRing << " " << Energy << " " << ET << " " << theta << " " << eta << " " << phi << " : " << vHBHEMET_EtaRing[EtaRing][depth-1].Phi() << " " << vHBHEMET_EtaRing[EtaRing][depth-1].Pt() );
537 
538  switch (depth) {
539  case 1:
540  hHCAL_D1_Occ_ieta_iphi->Fill(ieta,iphi);
541  break;
542  case 2:
543  hHCAL_D2_Occ_ieta_iphi->Fill(ieta,iphi);
544  break;
545  case 3:
546  hHCAL_D3_Occ_ieta_iphi->Fill(ieta,iphi);
547  break;
548  } // end switch
549  }
550 
551  if (Energy > HBHEMaxEnergy_EtaRing[EtaRing][depth-1])
552  HBHEMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
553  if (Energy < HBHEMinEnergy_EtaRing[EtaRing][depth-1])
554  HBHEMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
555 
556  switch (depth) {
557  case 1:
558  hHCAL_D1_energy_ieta_iphi->Fill(ieta,iphi,Energy);
559  hHCAL_D1_energyvsieta->Fill(ieta,Energy);
560  if (Energy>hHCAL_D1_Maxenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
561  hHCAL_D1_Maxenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
562  if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
563  hHCAL_D1_Minenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
564 
565  break;
566  case 2:
567  hHCAL_D2_energy_ieta_iphi->Fill(ieta,iphi,Energy);
568 
569  hHCAL_D2_energyvsieta->Fill(ieta,Energy);
570  if (Energy>hHCAL_D2_Maxenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
571  hHCAL_D2_Maxenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
572  if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
573  hHCAL_D2_Minenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
574  break;
575  case 3:
576  hHCAL_D3_energy_ieta_iphi->Fill(ieta,iphi,Energy);
577 
578  hHCAL_D3_energyvsieta->Fill(ieta,Energy);
579  if (Energy>hHCAL_D3_Maxenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
580  hHCAL_D3_Maxenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
581  if (Energy<hHCAL_D3_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
582  hHCAL_D3_Minenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
583  break;
584  } // end switch
585 
586 
587  if (HcalNum == HcalBarrel) {
588  nHBrechit++;
589  } else { // HcalEndcap
590  nHErechit++;
591  }
592  } // end loop over HBHERecHit's
593 
594  // Fill eta-ring MET quantities
595  for (int iEtaRing=0; iEtaRing < 83; iEtaRing++) {
596  for (int jDepth=0; jDepth < 3; jDepth++) {
597 
598  switch (jDepth+1) {
599  case 1:
600  hHCAL_D1_Maxenergyvsieta->Fill(iEtaRing-41, HBHEMaxEnergy_EtaRing[iEtaRing][jDepth]);
601  hHCAL_D1_Minenergyvsieta->Fill(iEtaRing-41, HBHEMinEnergy_EtaRing[iEtaRing][jDepth]);
602  break;
603  case 2:
604  hHCAL_D2_Maxenergyvsieta->Fill(iEtaRing-41, HBHEMaxEnergy_EtaRing[iEtaRing][jDepth]);
605  hHCAL_D2_Minenergyvsieta->Fill(iEtaRing-41, HBHEMinEnergy_EtaRing[iEtaRing][jDepth]);
606  break;
607  case 3:
608  hHCAL_D3_Maxenergyvsieta->Fill(iEtaRing-41, HBHEMaxEnergy_EtaRing[iEtaRing][jDepth]);
609  hHCAL_D3_Minenergyvsieta->Fill(iEtaRing-41, HBHEMinEnergy_EtaRing[iEtaRing][jDepth]);
610  break;
611  }
612 
613  if (HBHEActiveRing[iEtaRing][jDepth]) {
614 
615  switch (jDepth+1) {
616  case 1:
617  hHCAL_D1_METPhivsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Phi());
618  hHCAL_D1_MExvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Px());
619  hHCAL_D1_MEyvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Py());
620  hHCAL_D1_METvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Pt());
621  hHCAL_D1_SETvsieta->Fill(iEtaRing-41, HBHESET_EtaRing[iEtaRing][jDepth]);
622  hHCAL_D1_Occvsieta->Fill(iEtaRing-41, HBHENActiveCells[iEtaRing][jDepth]);
623  break;
624  case 2:
625  hHCAL_D2_METPhivsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Phi());
626  hHCAL_D2_MExvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Px());
627  hHCAL_D2_MEyvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Py());
628  hHCAL_D2_METvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Pt());
629  hHCAL_D2_SETvsieta->Fill(iEtaRing-41, HBHESET_EtaRing[iEtaRing][jDepth]);
630  hHCAL_D2_Occvsieta->Fill(iEtaRing-41, HBHENActiveCells[iEtaRing][jDepth]);
631  break;
632  case 3:
633  hHCAL_D3_METPhivsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Phi());
634  hHCAL_D3_MExvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Px());
635  hHCAL_D3_MEyvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Py());
636  hHCAL_D3_METvsieta->Fill(iEtaRing-41, vHBHEMET_EtaRing[iEtaRing][jDepth].Pt());
637  hHCAL_D3_SETvsieta->Fill(iEtaRing-41, HBHESET_EtaRing[iEtaRing][jDepth]);
638  hHCAL_D3_Occvsieta->Fill(iEtaRing-41, HBHENActiveCells[iEtaRing][jDepth]);
639  break;
640  } //switch
641  } //activering
642  }//depth
643  } //etaring
644 
645 
646  //-------------------------------------------------HO
647  TLorentzVector vHOMET_EtaRing[83];
648  int HOActiveRing[83];
649  int HONActiveCells[83];
650  double HOSET_EtaRing[83];
651  double HOMinEnergy_EtaRing[83];
652  double HOMaxEnergy_EtaRing[83];
653 
654  for (int i=0;i<83; i++) {
655 
656  HOActiveRing[i] = 0;
657  HONActiveCells[i] = 0;
658  HOSET_EtaRing[i] = 0;
659  HOMinEnergy_EtaRing[i] = 14E3;
660  HOMaxEnergy_EtaRing[i] = -999;
661  }
662 
663  // Loop over HORecHit's
665  int nHOrechit = 0;
666 
667  for (horechit = HORecHits->begin(); horechit != HORecHits->end(); horechit++) {
668 
669  nHOrechit++;
670 
671  HcalDetId det = horechit->id();
672  double Energy = horechit->energy();
674  Int_t ieta = det.ieta();
675  Int_t iphi = det.iphi();
676  int EtaRing = 41+ieta; // this counts from 0
677  double eta = hHCAL_ieta_iphi_etaMap->getBinContent(EtaRing+1,iphi);
678  double phi = hHCAL_ieta_iphi_phiMap->getBinContent(EtaRing+1,iphi);
679  double theta = 2*TMath::ATan(exp(-1*eta));
680  double ET = Energy*TMath::Sin(theta);
681  TLorentzVector v_;
682 
683 
684  if (Energy>0) // zero suppress
685  {
686  HOActiveRing[EtaRing] = 1;
687  HONActiveCells[EtaRing]++;
688  HOSET_EtaRing[EtaRing]+=ET;
689  v_.SetPtEtaPhiE(ET, 0, phi, ET);
690  vHOMET_EtaRing[EtaRing]-=v_;
691 
692  hHCAL_D4_Occ_ieta_iphi->Fill(ieta,iphi);
693  }
694 
695  if (Energy > HOMaxEnergy_EtaRing[EtaRing])
696  HOMaxEnergy_EtaRing[EtaRing] = Energy;
697  if (Energy < HOMinEnergy_EtaRing[EtaRing])
698  HOMinEnergy_EtaRing[EtaRing] = Energy;
699 
700  hHCAL_D4_energy_ieta_iphi->Fill(ieta,iphi,Energy);
701 
702  hHCAL_D4_energyvsieta->Fill(ieta,Energy);
703  if (Energy>hHCAL_D4_Maxenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
704  hHCAL_D4_Maxenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
705  if (Energy<hHCAL_D4_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
706  hHCAL_D4_Minenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
707 
708  } // end loop over HORecHit's
709 
710  // Fill eta-ring MET quantities
711  for (int iEtaRing=0; iEtaRing<83; iEtaRing++) {
712  hHCAL_D4_Maxenergyvsieta->Fill(iEtaRing-41, HOMaxEnergy_EtaRing[iEtaRing]);
713  hHCAL_D4_Minenergyvsieta->Fill(iEtaRing-41, HOMinEnergy_EtaRing[iEtaRing]);
714 
715  if (HOActiveRing[iEtaRing]) {
716 
717  hHCAL_D4_METPhivsieta->Fill(iEtaRing-41, vHOMET_EtaRing[iEtaRing].Phi());
718  hHCAL_D4_MExvsieta->Fill(iEtaRing-41, vHOMET_EtaRing[iEtaRing].Px());
719  hHCAL_D4_MEyvsieta->Fill(iEtaRing-41, vHOMET_EtaRing[iEtaRing].Py());
720  hHCAL_D4_METvsieta->Fill(iEtaRing-41, vHOMET_EtaRing[iEtaRing].Pt());
721  hHCAL_D4_SETvsieta->Fill(iEtaRing-41, HOSET_EtaRing[iEtaRing]);
722  hHCAL_D4_Occvsieta->Fill(iEtaRing-41, HONActiveCells[iEtaRing]);
723 
724  }
725 
726  }
727 
728  //------------------------------------------------HF
729 
730  TLorentzVector vHFMET_EtaRing[83][2];
731  int HFActiveRing[83][2];
732  int HFNActiveCells[83][2];
733  double HFSET_EtaRing[83][2];
734  double HFMinEnergy_EtaRing[83][2];
735  double HFMaxEnergy_EtaRing[83][2];
736 
737  for (int i=0;i<83; i++) {
738  for (int j=0;j<2; j++) {
739 
740  HFActiveRing[i][j] = 0;
741  HFNActiveCells[i][j] = 0;
742  HFSET_EtaRing[i][j] = 0;
743  HFMinEnergy_EtaRing[i][j] = 14E3;
744  HFMaxEnergy_EtaRing[i][j] = -999;
745 
746  }
747  }
748 
749  // Loop over HFRecHit's
751  int nHFrechit = 0;
752 
753  for (hfrechit = HFRecHits->begin(); hfrechit != HFRecHits->end(); hfrechit++) {
754 
755  nHFrechit++;
756 
757  HcalDetId det = hfrechit->id();
758  double Energy = hfrechit->energy();
759  Int_t depth = det.depth();
760  Int_t ieta = det.ieta();
761  Int_t iphi = det.iphi();
762  int EtaRing = 41+ieta; // this counts from 0
763  double eta = hHCAL_ieta_iphi_etaMap->getBinContent(EtaRing+1,iphi);
764  double phi = hHCAL_ieta_iphi_phiMap->getBinContent(EtaRing+1,iphi);
765  double theta = 2*TMath::ATan(exp(-1*eta));
766  double ET = Energy*TMath::Sin(theta);
767 
768  TLorentzVector v_;
769  if (Energy>0) // zero suppress
770  {
771  HFActiveRing[EtaRing][depth-1] = 1;
772  HFNActiveCells[EtaRing][depth-1]++;
773  HFSET_EtaRing[EtaRing][depth-1]+=ET;
774  v_.SetPtEtaPhiE(ET, 0, phi, ET);
775  vHFMET_EtaRing[EtaRing][depth-1]-=v_;
776 
777  switch (depth) {
778  case 1:
779  hHCAL_D1_Occ_ieta_iphi->Fill(ieta,iphi);
780  break;
781  case 2:
782  hHCAL_D2_Occ_ieta_iphi->Fill(ieta,iphi);
783  break;
784 
785  }
786  }
787 
788  if (Energy > HFMaxEnergy_EtaRing[EtaRing][depth-1])
789  HFMaxEnergy_EtaRing[EtaRing][depth-1] = Energy;
790  if (Energy < HFMinEnergy_EtaRing[EtaRing][depth-1])
791  HFMinEnergy_EtaRing[EtaRing][depth-1] = Energy;
792 
793 
794  switch (depth) {
795  case 1:
796  hHCAL_D1_energy_ieta_iphi->Fill(ieta,iphi,Energy);
797 
798  hHCAL_D1_energyvsieta->Fill(ieta,Energy);
799  if (Energy>hHCAL_D1_Maxenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
800  hHCAL_D1_Maxenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
801  if (Energy<hHCAL_D1_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
802  hHCAL_D1_Minenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
803  break;
804  case 2:
805  hHCAL_D2_energy_ieta_iphi->Fill(ieta,iphi,Energy);
806 
807  hHCAL_D2_energyvsieta->Fill(ieta,Energy);
808  if (Energy>hHCAL_D2_Maxenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
809  hHCAL_D2_Maxenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
810  if (Energy<hHCAL_D2_Minenergy_ieta_iphi->getBinContent(EtaRing+1, iphi))
811  hHCAL_D2_Minenergy_ieta_iphi->setBinContent(EtaRing+1, iphi, Energy);
812  break;
813  }
814 
815  } // end loop over HFRecHit's
816 
817  // Fill eta-ring MET quantities
818  for (int iEtaRing=0; iEtaRing<83; iEtaRing++) {
819  for (int jDepth=0; jDepth<2; jDepth++) {
820  switch (jDepth+1) {
821  case 1:
822  hHCAL_D1_Maxenergyvsieta->Fill(iEtaRing-41, HFMaxEnergy_EtaRing[iEtaRing][jDepth]);
823  hHCAL_D1_Minenergyvsieta->Fill(iEtaRing-41, HFMinEnergy_EtaRing[iEtaRing][jDepth]);
824  break;
825  case 2:
826  hHCAL_D2_Maxenergyvsieta->Fill(iEtaRing-41, HFMaxEnergy_EtaRing[iEtaRing][jDepth]);
827  hHCAL_D2_Minenergyvsieta->Fill(iEtaRing-41, HFMinEnergy_EtaRing[iEtaRing][jDepth]);
828  break;
829  }
830 
831 
832  if (HFActiveRing[iEtaRing][jDepth]) {
833 
834  switch (jDepth+1) {
835  case 1:
836 
837  hHCAL_D1_METPhivsieta->Fill(iEtaRing-41, vHFMET_EtaRing[iEtaRing][jDepth].Phi());
838  hHCAL_D1_MExvsieta->Fill(iEtaRing-41, vHFMET_EtaRing[iEtaRing][jDepth].Px());
839  hHCAL_D1_MEyvsieta->Fill(iEtaRing-41, vHFMET_EtaRing[iEtaRing][jDepth].Py());
840  hHCAL_D1_METvsieta->Fill(iEtaRing-41, vHFMET_EtaRing[iEtaRing][jDepth].Pt());
841  hHCAL_D1_SETvsieta->Fill(iEtaRing-41, HFSET_EtaRing[iEtaRing][jDepth]);
842  hHCAL_D1_Occvsieta->Fill(iEtaRing-41, HFNActiveCells[iEtaRing][jDepth]);
843  break;
844 
845  case 2:
846 
847  hHCAL_D2_METPhivsieta->Fill(iEtaRing-41, vHFMET_EtaRing[iEtaRing][jDepth].Phi());
848  hHCAL_D2_MExvsieta->Fill(iEtaRing-41, vHFMET_EtaRing[iEtaRing][jDepth].Px());
849  hHCAL_D2_MEyvsieta->Fill(iEtaRing-41, vHFMET_EtaRing[iEtaRing][jDepth].Py());
850  hHCAL_D2_METvsieta->Fill(iEtaRing-41, vHFMET_EtaRing[iEtaRing][jDepth].Pt());
851  hHCAL_D2_SETvsieta->Fill(iEtaRing-41, HFSET_EtaRing[iEtaRing][jDepth]);
852  hHCAL_D2_Occvsieta->Fill(iEtaRing-41, HFNActiveCells[iEtaRing][jDepth]);
853  break;
854 
855  }
856  }
857  }
858  }
859 
860 
861 
862 }
863 
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
T getUntrackedParameter(std::string const &, T const &) const
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * hHCAL_D4_Maxenergy_ieta_iphi
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * hHCAL_ieta_iphi_HFMap
MonitorElement * hHCAL_D3_Maxenergy_ieta_iphi
MonitorElement * hHCAL_D3_Maxenergyvsieta
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
MonitorElement * hHCAL_ieta_iphi_phiMap
MonitorElement * hHCAL_D1_SETvsieta
MonitorElement * hHCAL_D3_Occvsieta
HCALRecHitAnalyzer(const edm::ParameterSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
MonitorElement * hHCAL_D2_Minenergy_ieta_iphi
MonitorElement * hHCAL_D4_METvsieta
MonitorElement * hHCAL_D4_energyvsieta
MonitorElement * hHCAL_D4_Maxenergyvsieta
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
Definition: HcalGeometry.cc:76
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
MonitorElement * hHCAL_D1_Minenergy_ieta_iphi
std::vector< HBHERecHit >::const_iterator const_iterator
Geom::Theta< T > theta() const
MonitorElement * hHCAL_D4_Occvsieta
void FillGeometry(const edm::EventSetup &)
MonitorElement * hHCAL_D3_Minenergyvsieta
MonitorElement * hHCAL_D3_Occ_ieta_iphi
MonitorElement * hHCAL_D4_Occ_ieta_iphi
MonitorElement * hHCAL_D2_Minenergyvsieta
MonitorElement * hHCAL_ieta_iphi_etaMap
MonitorElement * hHCAL_D4_MEyvsieta
MonitorElement * hHCAL_D4_SETvsieta
MonitorElement * hHCAL_ieta_iphi_HBMap
MonitorElement * hHCAL_D3_METvsieta
MonitorElement * hHCAL_ieta_iphi_HOMap
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
MonitorElement * hHCAL_D3_MExvsieta
void Fill(long long x)
MonitorElement * hHCAL_D1_Maxenergy_ieta_iphi
MonitorElement * hHCAL_D1_Occ_ieta_iphi
MonitorElement * hHCAL_D4_METPhivsieta
int depth() const
get the tower depth
Definition: HcalDetId.h:166
MonitorElement * hHCAL_D4_Minenergyvsieta
int iEvent
Definition: GenABIO.cc:230
MonitorElement * hHCAL_D2_METvsieta
MonitorElement * hHCAL_D1_Occvsieta
MonitorElement * hHCAL_D1_Minenergyvsieta
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * hHCAL_D1_METPhivsieta
MonitorElement * hHCAL_D1_METvsieta
MonitorElement * hHCAL_D1_Maxenergyvsieta
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * hHCAL_D3_energyvsieta
MonitorElement * hHCAL_D2_Maxenergyvsieta
MonitorElement * hHCAL_D2_energyvsieta
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
HcalSubdetector
Definition: HcalAssistant.h:31
edm::EDGetTokenT< HFRecHitCollection > hFRecHitsLabel_
MonitorElement * hHCAL_D2_METPhivsieta
MonitorElement * hHCAL_D2_Occvsieta
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * hHCAL_D2_Maxenergy_ieta_iphi
MonitorElement * hHCAL_D3_METPhivsieta
MonitorElement * hHCAL_D1_energyvsieta
MonitorElement * hHCAL_ieta_detaMap
MonitorElement * hHCAL_D2_energy_ieta_iphi
GlobalPoint getPosition(const DetId &id) const
#define M_PI
const_iterator end() const
MonitorElement * hHCAL_D1_energy_ieta_iphi
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
MonitorElement * hHCAL_D4_Minenergy_ieta_iphi
MonitorElement * hHCAL_D3_SETvsieta
edm::EDGetTokenT< HORecHitCollection > hORecHitsLabel_
MonitorElement * hHCAL_D1_MExvsieta
MonitorElement * hHCAL_D4_MExvsieta
MonitorElement * hHCAL_D2_MEyvsieta
T const * product() const
Definition: Handle.h:81
#define DEBUG(X)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
MonitorElement * hHCAL_D1_MEyvsieta
edm::EDGetTokenT< HBHERecHitCollection > hBHERecHitsLabel_
T eta() const
Definition: PV3DBase.h:76
MonitorElement * hHCAL_D4_energy_ieta_iphi
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * hHCAL_D3_energy_ieta_iphi
T get() const
Definition: EventSetup.h:68
MonitorElement * hHCAL_D2_Occ_ieta_iphi
MonitorElement * hHCAL_Nevents
MonitorElement * hHCAL_D3_Minenergy_ieta_iphi
MonitorElement * hHCAL_D2_SETvsieta
#define ET
MonitorElement * hHCAL_D2_MExvsieta
bool isValid() const
Definition: ESHandle.h:45
MonitorElement * hHCAL_D3_MEyvsieta
MonitorElement * hHCAL_ieta_iphi_HEMap
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const_iterator begin() const
Definition: Run.h:44
MonitorElement * hHCAL_ieta_dphiMap