CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalHitValidation.cc
Go to the documentation of this file.
2 
7 
11 
15 
19 
20 #include <fstream>
21 #include <iostream>
22 #include <map>
23 #include <string>
24 #include <vector>
25 
27 public:
29  ~HcalHitValidation() override;
30 
31 protected:
32  void analyze(const edm::Event &e, const edm::EventSetup &c) override;
33  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
34 
35  void analyzeHits(std::vector<PCaloHit> &);
39 
40 private:
49 
61 
62  static const int nLayersMAX = 20, nDepthsMAX = 5;
70 
74 
79 };
80 
82  g4Label = ps.getUntrackedParameter<std::string>("moduleLabel", "g4SimHits");
83  hcalHits = ps.getUntrackedParameter<std::string>("HitCollection", "HcalHits");
84  layerInfo = ps.getUntrackedParameter<std::string>("LayerInfo", "PHcalValidInfoLayer");
85  nxNInfo = ps.getUntrackedParameter<std::string>("NxNInfo", "PHcalValidInfoNxN");
86  jetsInfo = ps.getUntrackedParameter<std::string>("JetsInfo", "PHcalValidInfoJets");
87  outFile_ = ps.getUntrackedParameter<std::string>("outputFile", "hcValid.root");
88  verbose_ = ps.getUntrackedParameter<bool>("Verbose", false);
89  scheme_ = ps.getUntrackedParameter<bool>("TestNumbering", true);
90  checkHit_ = ps.getUntrackedParameter<bool>("CheckHits", true);
91  checkLay_ = ps.getUntrackedParameter<bool>("CheckLayer", true);
92  checkNxN_ = ps.getUntrackedParameter<bool>("CheckNxN", true);
93  checkJet_ = ps.getUntrackedParameter<bool>("CheckJets", true);
94 
95  // register for data access
96  tok_hh_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label, hcalHits));
97  tok_iL_ = consumes<PHcalValidInfoLayer>(edm::InputTag(g4Label, layerInfo));
98  tok_iN_ = consumes<PHcalValidInfoNxN>(edm::InputTag(g4Label, nxNInfo));
99  tok_iJ_ = consumes<PHcalValidInfoJets>(edm::InputTag(g4Label, jetsInfo));
100 
101  edm::LogInfo("HcalHitValid") << "Module Label: " << g4Label << " Hits: " << hcalHits << " / " << checkHit_
102  << " LayerInfo: " << layerInfo << " / " << checkLay_ << " NxNInfo: " << nxNInfo
103  << " / " << checkNxN_ << " jetsInfo: " << jetsInfo << " / " << checkJet_
104  << " Output: " << outFile_ << " Usage of TestNumberingScheme " << scheme_;
105 }
106 
108 
110  ibooker.setCurrentFolder("HcalHitValidation");
111 
112  char title[60], name[20];
113  double my_pi = 3.1415926;
114  // Histograms for Hits
115  if (checkHit_) {
116  meAllNHit_ = ibooker.book1D("Hit01", "Number of Hits in HCal", 1000, 0., 5000.);
117  meBadDetHit_ = ibooker.book1D("Hit02", "Hits with wrong Det", 100, 0., 100.);
118  meBadSubHit_ = ibooker.book1D("Hit03", "Hits with wrong Subdet", 100, 0., 100.);
119  meBadIdHit_ = ibooker.book1D("Hit04", "Hits with wrong ID", 100, 0., 100.);
120  meHBNHit_ = ibooker.book1D("Hit05", "Number of Hits in HB", 1000, 0., 5000.);
121  meHENHit_ = ibooker.book1D("Hit06", "Number of Hits in HE", 1000, 0., 5000.);
122  meHONHit_ = ibooker.book1D("Hit07", "Number of Hits in HO", 1000, 0., 5000.);
123  meHFNHit_ = ibooker.book1D("Hit08", "Number of Hits in HF", 1000, 0., 5000.);
124  meDetectHit_ = ibooker.book1D("Hit09", "Detector ID", 50, 0., 50.);
125  meSubdetHit_ = ibooker.book1D("Hit10", "Subdetectors in HCal", 50, 0., 50.);
126  meDepthHit_ = ibooker.book1D("Hit11", "Depths in HCal", 20, 0., 20.);
127  meEtaHit_ = ibooker.book1D("Hit12", "Eta in HCal", 100, -50., 50.);
128  mePhiHit_ = ibooker.book1D("Hit13", "Phi in HCal", 100, 0., 100.);
129  meEnergyHit_ = ibooker.book1D("Hit14", "Energy in HCal", 100, 0., 1.);
130  meTimeHit_ = ibooker.book1D("Hit15", "Time in HCal", 100, 0., 400.);
131  meTimeWHit_ = ibooker.book1D("Hit16", "Time in HCal (E wtd)", 100, 0., 400.);
132  meHBDepHit_ = ibooker.book1D("Hit17", "Depths in HB", 20, 0., 20.);
133  meHEDepHit_ = ibooker.book1D("Hit18", "Depths in HE", 20, 0., 20.);
134  meHODepHit_ = ibooker.book1D("Hit19", "Depths in HO", 20, 0., 20.);
135  meHFDepHit_ = ibooker.book1D("Hit20", "Depths in HF", 20, 0., 20.);
136  meHBEtaHit_ = ibooker.book1D("Hit21", "Eta in HB", 100, -50., 50.);
137  meHEEtaHit_ = ibooker.book1D("Hit22", "Eta in HE", 100, -50., 50.);
138  meHOEtaHit_ = ibooker.book1D("Hit23", "Eta in HO", 100, -50., 50.);
139  meHFEtaHit_ = ibooker.book1D("Hit24", "Eta in HF", 100, -50., 50.);
140  meHBPhiHit_ = ibooker.book1D("Hit25", "Phi in HB", 100, 0., 100.);
141  meHEPhiHit_ = ibooker.book1D("Hit26", "Phi in HE", 100, 0., 100.);
142  meHOPhiHit_ = ibooker.book1D("Hit27", "Phi in HO", 100, 0., 100.);
143  meHFPhiHit_ = ibooker.book1D("Hit28", "Phi in HF", 100, 0., 100.);
144  meHBEneHit_ = ibooker.book1D("Hit29", "Energy in HB", 100, 0., 1.);
145  meHEEneHit_ = ibooker.book1D("Hit30", "Energy in HE", 100, 0., 1.);
146  meHOEneHit_ = ibooker.book1D("Hit31", "Energy in HO", 100, 0., 1.);
147  meHFEneHit_ = ibooker.book1D("Hit32", "Energy in HF", 100, 0., 100.);
148  meHBTimHit_ = ibooker.book1D("Hit33", "Time in HB", 100, 0., 400.);
149  meHETimHit_ = ibooker.book1D("Hit34", "Time in HE", 100, 0., 400.);
150  meHOTimHit_ = ibooker.book1D("Hit35", "Time in HO", 100, 0., 400.);
151  meHFTimHit_ = ibooker.book1D("Hit36", "Time in HF", 100, 0., 400.);
152  mePMTHit_ = ibooker.book1D("Hit37", "Number of Hit in PMT", 1000, 0., 1000.);
153  mePMTDepHit_ = ibooker.book1D("Hit38", "Depths in HF PMT", 20, 0., 20.);
154  mePMTEtaHit_ = ibooker.book1D("Hit39", "Eta in HF PMT", 100, -50., 50.);
155  mePMTPhiHit_ = ibooker.book1D("Hit40", "Phi in HF PMT", 100, 0., 100.);
156  mePMTEn1Hit_ = ibooker.book1D("Hit41", "Energy (Ceren) in PMT", 100, 0., 100.);
157  mePMTEn2Hit_ = ibooker.book1D("Hit42", "Energy (dE/dx) in PMT", 100, 0., 100.);
158  mePMTTimHit_ = ibooker.book1D("Hit43", "Time in HF PMT", 100, 0., 400.);
159  }
160 
161  // Histograms for Layers
162  if (checkLay_) {
163  meLayerLay_ = ibooker.book1D("Lay01", "Layer # of the Hits", 20, 0., 20.);
164  meEtaHLay_ = ibooker.book1D("Lay02", "Eta of the Hits", 100, -5., 5.);
165  mePhiHLay_ = ibooker.book1D("Lay03", "Phi of the Hits", 100, -my_pi, my_pi);
166  meEneHLay_ = ibooker.book1D("Lay04", "Energy of the Hits", 100, 0., 2.);
167  meDepHlay_ = ibooker.book1D("Lay05", "Depth of the Hits", 10, 0., 10.);
168  meTimHLay_ = ibooker.book1D("Lay06", "Time of the Hits", 100, 0., 400.);
169  meTimWLay_ = ibooker.book1D("Lay07", "Time (wtd) of Hits", 100, 0., 400.);
170  meEtaPhi_ = ibooker.book2D("Lay08", "Phi%Eta of the Hits", 100, -5., 5., 100, -my_pi, my_pi);
171 
172  meHitELay_ = ibooker.book1D("Lay09", "Hit in Ecal", 1000, 0., 2000.);
173  meHitHLay_ = ibooker.book1D("Lay10", "Hit in Hcal", 1000, 0., 2000.);
174  meHitTLay_ = ibooker.book1D("Lay11", "Total Hits", 1000, 0., 2000.);
175  meEneLLay_ = ibooker.book1D("Lay12", "Energy per layer", 100, 0., 1.);
176  int nn = 0;
177  for (int i = 0; i < nLayersMAX; i++) {
178  sprintf(name, "Layl%d", nn);
179  nn++;
180  sprintf(title, "Energy deposit in Layer %d", i);
181  meEneLay_[i] = ibooker.book1D(name, title, 100, 0., 0.4);
182  }
183  meLngLay_ = ibooker.book1D("Lay13", "Lonitudinal Shower Profile", 20, 0, 20.);
184  meEneDLay_ = ibooker.book1D("Lay14", "Energy per depth", 100, 0., 1.);
185  for (int i = 0; i < nDepthsMAX; i++) {
186  sprintf(name, "Layl%d", nn);
187  nn++;
188  sprintf(title, "Energy deposit in Depth %d", i);
189  meDepLay_[i] = ibooker.book1D(name, title, 100, 0., 2.);
190  }
191 
192  meEtotLay_ = ibooker.book1D("Lay15", "Total Energy", 100, 0., 1.);
193  meEHOLay_ = ibooker.book1D("Lay16", "Energy in HO", 100, 0., 2000.);
194  meEHBHELay_ = ibooker.book1D("Lay17", "Energy in HB/HE", 100, 0., 2000.);
195  meEFibLLay_ = ibooker.book1D("Lay18", "Energy in HF (Long)", 100, 0., 100.);
196  meEFibSLay_ = ibooker.book1D("Lay19", "Energy in HF (Short)", 100, 0., 100.);
197  meEHFEmLay_ = ibooker.book1D("Lay20", "EM energy in HF", 100, 0., 200.);
198  meEHFHdLay_ = ibooker.book1D("Lay21", "Had. energy in HF", 100, 0., 200.);
199  }
200 
201  // Histograms for NxN analysis
202  if (checkNxN_) {
203  meEcalRNxN_ = ibooker.book1D("NxN01", "Energy in ECal (NxN)r", 100, 0., 200.);
204  meHcalRNxN_ = ibooker.book1D("NxN02", "Energy in HCal (NxN)r", 100, 0., 200.);
205  meHoRNxN_ = ibooker.book1D("NxN03", "Energy in HO (NxN)r", 100, 0., 200.);
206  meEtotRNxN_ = ibooker.book1D("NxN04", "Energy Total (NxN)r", 100, 0., 200.);
207  meEcalNxN_ = ibooker.book1D("NxN05", "Energy in ECal (NxN)", 100, 0., 200.);
208  meHcalNxN_ = ibooker.book1D("NxN06", "Energy in HCal (NxN)", 100, 0., 200.);
209  meHoNxN_ = ibooker.book1D("NxN07", "Energy in HO (NxN)", 100, 0., 200.);
210  meEtotNxN_ = ibooker.book1D("NxN08", "Energy Total (NxN)", 100, 0., 200.);
211  meEiNxN_ = ibooker.book1D("NxN09", "Energy of Hits in (NxN)", 100, 0., 1.);
212  meTiNxN_ = ibooker.book1D("NxN10", "Time of Hits in (NxN)", 100, 0., 400.);
213  meTrNxN_ = ibooker.book1D("NxN11", "Dist. of Hits in (NxN)", 100, 0., 1.);
214  }
215 
216  // Histograms for Jets
217  if (checkJet_) {
218  meRJet_ = ibooker.book1D("Jet01", "R of Hits", 100, 0., 1.);
219  meTJet_ = ibooker.book1D("Jet02", "T of Hits", 100, 0., 200.);
220  meEJet_ = ibooker.book1D("Jet03", "E of Hits", 100, 0., 200.);
221  meEcalJet_ = ibooker.book1D("Jet04", "Ecal Energy (First Jet)", 100, 0., 200.);
222  meHcalJet_ = ibooker.book1D("Jet05", "Hcal Energy (First Jet)", 100, 0., 200.);
223  meHoJet_ = ibooker.book1D("Jet06", "Ho Energy (First Jet)", 100, 0., 200.);
224  meEtotJet_ = ibooker.book1D("Jet07", "Total Energy(First Jet)", 100, 0., 200.);
225  meEcHcJet_ = ibooker.book2D("Jet08", "Energy in Hcal% Ecal", 100, 0., 200., 100, 0., 200.);
226 
227  meDetaJet_ = ibooker.book1D("Jet09", "Delta Eta", 100, 0., 2.);
228  meDphiJet_ = ibooker.book1D("Jet10", "Delta Phi", 100, 0., 1.);
229  meDrJet_ = ibooker.book1D("Jet11", "Delta R", 100, 0., 2.);
230  meMassJet_ = ibooker.book1D("Jet12", "Di-jet mass", 100, 0., 200.);
231  meEneJet_ = ibooker.book1D("Jet13", "Jet Energy", 100, 0., 200.);
232  meEtaJet_ = ibooker.book1D("Jet14", "Jet Eta", 100, -5., 5.);
233  mePhiJet_ = ibooker.book1D("Jet15", "Jet Phi", 100, -my_pi, my_pi);
234  }
235 }
236 
238  edm::LogVerbatim("HcalHitValid") << "Run = " << e.id().run() << " Event = " << e.id().event();
239 
240  std::vector<PCaloHit> caloHits;
245 
246  bool getHits = false;
247  if (checkHit_) {
248  e.getByToken(tok_hh_, hitsHcal);
249  if (hitsHcal.isValid())
250  getHits = true;
251  }
252 
253  bool getLayer = false;
254  if (checkLay_) {
255  e.getByToken(tok_iL_, infoLayer);
256  if (infoLayer.isValid())
257  getLayer = true;
258  }
259 
260  bool getNxN = false;
261  if (checkNxN_) {
262  e.getByToken(tok_iN_, infoNxN);
263  if (infoNxN.isValid())
264  getNxN = true;
265  }
266 
267  bool getJets = false;
268  if (checkJet_) {
269  e.getByToken(tok_iJ_, infoJets);
270  if (infoJets.isValid())
271  getJets = true;
272  }
273 
274  edm::LogVerbatim("HcalHitValid") << "HcalValidation: Input flags Hits " << getHits << ", Layer " << getLayer
275  << ", NxN " << getNxN << ", Jets " << getJets;
276 
277  if (getHits) {
278  caloHits.insert(caloHits.end(), hitsHcal->begin(), hitsHcal->end());
279  edm::LogVerbatim("HcalHitValid") << "HcalValidation: Hit buffer " << caloHits.size();
280  analyzeHits(caloHits);
281  }
282 
283  if (getLayer)
284  analyzeLayer(infoLayer);
285  if (getNxN)
286  analyzeNxN(infoNxN);
287  if (getJets)
288  analyzeJets(infoJets);
289 }
290 
291 void HcalHitValidation::analyzeHits(std::vector<PCaloHit> &hits) {
292  int nHit = hits.size();
293  int nHB = 0, nHE = 0, nHO = 0, nHF = 0, nPMT = 0, nBad1 = 0, nBad2 = 0, nBad = 0;
294  for (int i = 0; i < nHit; i++) {
295  double energy = hits[i].energy();
296  double time = hits[i].time();
297  unsigned int id_ = hits[i].id();
298  int det, subdet, depth, eta, phi;
299  if (scheme_) {
300  det = 4;
301  subdet = (id_ >> 28) & 15;
302  depth = (id_ >> 26) & 3;
303  depth++;
304  int zside = ((id_ & 0x100000) ? (1) : (-1));
305  eta = zside * ((id_ >> 10) & 1023);
306  phi = (id_ & 1023);
307  } else {
308  HcalDetId id = HcalDetId(id_);
309  det = id.det();
310  subdet = id.subdet();
311  depth = id.depth();
312  eta = id.ieta();
313  phi = id.iphi();
314  }
315  uint16_t depth_ = hits[i].depth();
316  double energyEM = hits[i].energyEM();
317  double energyHad = hits[i].energyHad();
318  edm::LogVerbatim("HcalHitValid") << "Hit[" << i << "] ID " << std::hex << id_ << std::dec << " Det " << det
319  << " Sub " << subdet << " depth " << depth << " " << depth_ << " Eta " << eta
320  << " Phi " << phi << " E " << energy << "(EM " << energyEM << ", Had " << energyHad
321  << ") time " << time;
322  if (det == 4) { // Check DetId.h
323  if (subdet == static_cast<int>(HcalBarrel)) {
324  nHB++;
325  } else if (subdet == static_cast<int>(HcalEndcap)) {
326  nHE++;
327  } else if (subdet == static_cast<int>(HcalOuter)) {
328  nHO++;
329  } else if (subdet == static_cast<int>(HcalForward)) {
330  if (depth_ == 0)
331  nHF++;
332  else
333  nPMT++;
334  } else {
335  nBad++;
336  nBad2++;
337  }
338  } else {
339  nBad++;
340  nBad1++;
341  }
342 
343  meDetectHit_->Fill(double(det));
344  if (det == 4 && depth_ == 0) {
345  meSubdetHit_->Fill(double(subdet));
346  meDepthHit_->Fill(double(depth));
347  meEtaHit_->Fill(double(eta));
348  mePhiHit_->Fill(double(phi));
349  meEnergyHit_->Fill(energy);
350  meTimeHit_->Fill(time);
351  meTimeWHit_->Fill(double(time), energy);
352  if (subdet == static_cast<int>(HcalBarrel)) {
353  meHBDepHit_->Fill(double(depth));
354  meHBEtaHit_->Fill(double(eta));
355  meHBPhiHit_->Fill(double(phi));
356  meHBEneHit_->Fill(energy);
357  meHBTimHit_->Fill(time);
358  } else if (subdet == static_cast<int>(HcalEndcap)) {
359  meHEDepHit_->Fill(double(depth));
360  meHEEtaHit_->Fill(double(eta));
361  meHEPhiHit_->Fill(double(phi));
362  meHEEneHit_->Fill(energy);
363  meHETimHit_->Fill(time);
364  } else if (subdet == static_cast<int>(HcalOuter)) {
365  meHODepHit_->Fill(double(depth));
366  meHOEtaHit_->Fill(double(eta));
367  meHOPhiHit_->Fill(double(phi));
368  meHOEneHit_->Fill(energy);
369  meHOTimHit_->Fill(time);
370  } else if (subdet == static_cast<int>(HcalForward)) {
371  meHFDepHit_->Fill(double(depth));
372  meHFEtaHit_->Fill(double(eta));
373  meHFPhiHit_->Fill(double(phi));
374  meHFEneHit_->Fill(energy);
375  meHFTimHit_->Fill(time);
376  }
377  } else if (det == 0 && subdet == static_cast<int>(HcalForward)) {
378  mePMTDepHit_->Fill(double(depth));
379  mePMTEtaHit_->Fill(double(eta));
380  mePMTPhiHit_->Fill(double(phi));
381  mePMTEn1Hit_->Fill(energyEM);
382  mePMTEn2Hit_->Fill(energyHad);
383  mePMTTimHit_->Fill(time);
384  }
385  }
386  meAllNHit_->Fill(double(nHit));
387  meBadDetHit_->Fill(double(nBad1));
388  meBadSubHit_->Fill(double(nBad2));
389  meBadIdHit_->Fill(double(nBad));
390  meHBNHit_->Fill(double(nHB));
391  meHENHit_->Fill(double(nHE));
392  meHONHit_->Fill(double(nHO));
393  meHFNHit_->Fill(double(nHF));
394  mePMTHit_->Fill(double(nPMT));
395 
396  edm::LogVerbatim("HcalHitValid") << "HcalHitValidation::analyzeHits: HB " << nHB << " HE " << nHE << " HO " << nHO
397  << " HF " << nHF << " PMT " << nPMT << " Bad " << nBad << " All " << nHit;
398 }
399 
401  // CaloHits from PHcalValidInfoLayer
402  int nHits = infoLayer->nHit();
403  std::vector<float> idHits = infoLayer->idHit();
404  std::vector<float> phiHits = infoLayer->phiHit();
405  std::vector<float> etaHits = infoLayer->etaHit();
406  std::vector<float> layerHits = infoLayer->layerHit();
407  std::vector<float> eHits = infoLayer->eHit();
408  std::vector<float> tHits = infoLayer->tHit();
409 
410  int ne = 0, nh = 0;
411  for (int j = 0; j < nHits; j++) {
412  int layer = (int)(layerHits[j]) - 1;
413  int id = (int)(idHits[j]);
414 
415  if (id >= 10) {
416  ne++;
417  } else {
418  nh++;
419  }
420 
421  edm::LogVerbatim("HcalHitValid") << "HcalHitValidation::analyzeLayer:Hit subdet = " << id << " lay = " << layer;
422 
423  meLayerLay_->Fill(double(layer));
424  meEtaHLay_->Fill(etaHits[j]);
425  mePhiHLay_->Fill(phiHits[j]);
426  meEneHLay_->Fill(eHits[j]);
427  meDepHlay_->Fill(idHits[j]);
428  meTimHLay_->Fill(tHits[j]);
429  meTimWLay_->Fill(tHits[j], eHits[j]);
430  if (id < 6) // HCAL only. Depth is needed, not layer !!!
431  {
432  meEtaPhi_->Fill(etaHits[j], phiHits[j]);
433  }
434  }
435 
436  meHitELay_->Fill(double(ne));
437  meHitHLay_->Fill(double(nh));
438  meHitTLay_->Fill(double(nHits));
439 
440  // Layers and depths PHcalValidInfoLayer
441  std::vector<float> eLayer = infoLayer->elayer();
442  std::vector<float> eDepth = infoLayer->edepth();
443  float eTot = 0.;
444 
445  for (int j = 0; j < nLayersMAX; j++) {
446  eTot += eLayer[j];
447  meEneLLay_->Fill(eLayer[j]);
448  meEneLay_[j]->Fill(eLayer[j]);
449  meLngLay_->Fill((double)(j), eLayer[j]); // HCAL SimHits only
450  }
451  for (int j = 0; j < nDepthsMAX; j++) {
452  meEneDLay_->Fill(eDepth[j]);
453  meDepLay_[j]->Fill(eDepth[j]);
454  }
455  meEtotLay_->Fill(eTot);
456 
457  // The rest PHcalValidInfoLayer
458  double eHO = infoLayer->eho();
459  double eHBHE = infoLayer->ehbhe();
460  double elongHF = infoLayer->elonghf();
461  double eshortHF = infoLayer->eshorthf();
462  double eEcalHF = infoLayer->eecalhf();
463  double eHcalHF = infoLayer->ehcalhf();
464 
465  meEHOLay_->Fill(eHO);
466  meEHBHELay_->Fill(eHBHE);
467  meEFibLLay_->Fill(elongHF);
468  meEFibSLay_->Fill(eshortHF);
469  meEHFEmLay_->Fill(eEcalHF);
470  meEHFHdLay_->Fill(eHcalHF);
471 
472  edm::LogVerbatim("HcalHitValid") << "HcalHitValidation::analyzeLayer: eHO " << eHO << " eHBHE = " << eHBHE
473  << " elongHF = " << elongHF << " eshortHF = " << eshortHF
474  << " eEcalHF = " << eEcalHF << " eHcalHF = " << eHcalHF;
475 }
476 
478  // NxN quantities
479  double ecalNxNr = infoNxN->ecalnxnr();
480  double hcalNxNr = infoNxN->hcalnxnr();
481  double hoNxNr = infoNxN->honxnr();
482  double etotNxNr = infoNxN->etotnxnr();
483 
484  double ecalNxN = infoNxN->ecalnxn();
485  double hcalNxN = infoNxN->hcalnxn();
486  double hoNxN = infoNxN->honxn();
487  double etotNxN = infoNxN->etotnxn();
488 
489  meEcalRNxN_->Fill(ecalNxNr);
490  meHcalRNxN_->Fill(hcalNxNr);
491  meHoRNxN_->Fill(hoNxNr);
492  meEtotRNxN_->Fill(etotNxNr);
493 
494  meEcalNxN_->Fill(ecalNxN);
495  meHcalNxN_->Fill(hcalNxN);
496  meHoNxN_->Fill(hoNxN);
497  meEtotNxN_->Fill(etotNxN);
498 
499  int nIxI = infoNxN->nnxn();
500  std::vector<float> idIxI = infoNxN->idnxn();
501  std::vector<float> eIxI = infoNxN->enxn();
502  std::vector<float> tIxI = infoNxN->tnxn();
503 
504  for (int j = 0; j < nIxI; j++) // NB !!! j < nIxI
505  {
506  meEiNxN_->Fill(eIxI[j]);
507  meTiNxN_->Fill(tIxI[j]);
508  meTrNxN_->Fill(idIxI[j], eIxI[j]); // transverse profile
509  }
510 
511  edm::LogVerbatim("HcalHitValid") << "HcalHitValidation::analyzeNxN: " << nIxI
512  << " hits in NxN analysis; Total Energy " << etotNxN << "/" << etotNxNr;
513 }
514 
516  // -- Leading Jet
517  int nJetHits = infoJets->njethit();
518 
519  std::vector<float> rJetHits = infoJets->jethitr();
520  std::vector<float> tJetHits = infoJets->jethitt();
521  std::vector<float> eJetHits = infoJets->jethite();
522 
523  double ecalJet = infoJets->ecaljet();
524  double hcalJet = infoJets->hcaljet();
525  double hoJet = infoJets->hojet();
526  double etotJet = infoJets->etotjet();
527 
528  double detaJet = infoJets->detajet();
529  double dphiJet = infoJets->dphijet();
530  double drJet = infoJets->drjet();
531  double dijetM = infoJets->dijetm();
532 
533  for (int j = 0; j < nJetHits; j++) {
534  meRJet_->Fill(rJetHits[j]);
535  meTJet_->Fill(tJetHits[j]);
536  meEJet_->Fill(eJetHits[j]);
537  }
538 
539  meEcalJet_->Fill(ecalJet);
540  meHcalJet_->Fill(hcalJet);
541  meHoJet_->Fill(hoJet);
542  meEtotJet_->Fill(etotJet);
543  meEcHcJet_->Fill(ecalJet, hcalJet);
544 
545  meDetaJet_->Fill(detaJet);
546  meDphiJet_->Fill(dphiJet);
547  meDrJet_->Fill(drJet);
548  meMassJet_->Fill(dijetM);
549 
550  // All Jets
551  int nJets = infoJets->njet();
552  std::vector<float> jetE = infoJets->jete();
553  std::vector<float> jetEta = infoJets->jeteta();
554  std::vector<float> jetPhi = infoJets->jetphi();
555 
556  for (int j = 0; j < nJets; j++) {
557  meEneJet_->Fill(jetE[j]);
558  meEtaJet_->Fill(jetEta[j]);
559  mePhiJet_->Fill(jetPhi[j]);
560  }
561  edm::LogVerbatim("HcalHitValid") << "HcalHitValidation::analyzeJets: " << nJets << " jets with " << nJetHits
562  << " hits in the leading jet\n"
563  << " d(Eta) = " << detaJet << " d(Phi) = " << dphiJet << " d(R) = " << drJet
564  << " diJet Mass = " << dijetM;
565 }
566 
567 // define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:38
MonitorElement * meHONHit_
MonitorElement * meDetaJet_
Log< level::Info, true > LogVerbatim
MonitorElement * meHODepHit_
EventNumber_t event() const
Definition: EventID.h:40
MonitorElement * meEnergyHit_
T getUntrackedParameter(std::string const &, T const &) const
const edm::EventSetup & c
MonitorElement * meHitHLay_
MonitorElement * meHOEtaHit_
MonitorElement * meAllNHit_
MonitorElement * meHBPhiHit_
MonitorElement * meHoNxN_
MonitorElement * mePMTTimHit_
MonitorElement * mePMTEtaHit_
MonitorElement * meHFEneHit_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * meEcalRNxN_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MonitorElement * meHFDepHit_
MonitorElement * mePMTDepHit_
MonitorElement * meBadDetHit_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MonitorElement * meHcalNxN_
MonitorElement * meBadIdHit_
MonitorElement * meTrNxN_
MonitorElement * meHFEtaHit_
MonitorElement * meEJet_
MonitorElement * meEFibSLay_
MonitorElement * meEtaHLay_
MonitorElement * meEtotNxN_
MonitorElement * mePMTPhiHit_
edm::EDGetTokenT< PHcalValidInfoJets > tok_iJ_
int zside(DetId const &)
MonitorElement * meHOPhiHit_
MonitorElement * meTimeWHit_
MonitorElement * meEneLay_[nLayersMAX]
MonitorElement * meHitELay_
MonitorElement * meEHFEmLay_
~HcalHitValidation() override
constexpr std::array< uint8_t, layerIndexSize > layer
MonitorElement * meHENHit_
void Fill(long long x)
MonitorElement * meHoJet_
MonitorElement * meHOEneHit_
MonitorElement * meEtotJet_
MonitorElement * mePhiHLay_
MonitorElement * meEtaPhi_
edm::EDGetTokenT< PHcalValidInfoLayer > tok_iL_
MonitorElement * meHEEneHit_
MonitorElement * meHFNHit_
MonitorElement * meHFTimHit_
void analyzeLayer(edm::Handle< PHcalValidInfoLayer > &)
MonitorElement * meHBDepHit_
void analyzeNxN(edm::Handle< PHcalValidInfoNxN > &)
MonitorElement * mePMTEn1Hit_
MonitorElement * meTiNxN_
MonitorElement * meDphiJet_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * meRJet_
HcalHitValidation(const edm::ParameterSet &ps)
MonitorElement * meEHBHELay_
MonitorElement * meTJet_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hh_
MonitorElement * meHETimHit_
MonitorElement * meEneHLay_
MonitorElement * mePMTHit_
MonitorElement * meHBEtaHit_
static const int nDepthsMAX
MonitorElement * meTimeHit_
MonitorElement * meBadSubHit_
MonitorElement * meEtotLay_
constexpr uint8_t getLayer(uint32_t detId)
void analyzeHits(std::vector< PCaloHit > &)
MonitorElement * meLngLay_
MonitorElement * meMassJet_
MonitorElement * meTimWLay_
uint32_t nh
MonitorElement * meEHFHdLay_
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * meHitTLay_
MonitorElement * meHEEtaHit_
MonitorElement * meHBNHit_
MonitorElement * mePhiHit_
MonitorElement * meHoRNxN_
MonitorElement * meHOTimHit_
edm::EDGetTokenT< PHcalValidInfoNxN > tok_iN_
Log< level::Info, false > LogInfo
MonitorElement * meEneDLay_
MonitorElement * meLayerLay_
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
MonitorElement * meHcalJet_
MonitorElement * meEtotRNxN_
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
MonitorElement * meEFibLLay_
MonitorElement * meEHOLay_
MonitorElement * meEneLLay_
edm::EventID id() const
Definition: EventBase.h:59
MonitorElement * mePMTEn2Hit_
static const int nLayersMAX
MonitorElement * meEcalNxN_
MonitorElement * meHBEneHit_
MonitorElement * meDepthHit_
MonitorElement * mePhiJet_
int32_t *__restrict__ nn
MonitorElement * meHEPhiHit_
MonitorElement * meEneJet_
MonitorElement * meEtaHit_
MonitorElement * meEcalJet_
MonitorElement * meDepLay_[nDepthsMAX]
void analyzeJets(edm::Handle< PHcalValidInfoJets > &)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * meSubdetHit_
MonitorElement * meDetectHit_
MonitorElement * meHcalRNxN_
MonitorElement * meHEDepHit_
MonitorElement * meEiNxN_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meHFPhiHit_
MonitorElement * meDrJet_
MonitorElement * meEcHcJet_
MonitorElement * meEtaJet_
Definition: Run.h:45
MonitorElement * meTimHLay_
MonitorElement * meDepHlay_
MonitorElement * meHBTimHit_