CMS 3D CMS Logo

HGCalSimHitValidation.cc
Go to the documentation of this file.
1 // system include files
2 #include <cmath>
3 #include <iostream>
4 #include <fstream>
5 #include <vector>
6 #include <map>
7 #include <string>
8 
14 
22 
25 
36 
43 
48 
49 #include "CLHEP/Geometry/Point3D.h"
50 #include "CLHEP/Geometry/Transform3D.h"
51 #include "CLHEP/Geometry/Vector3D.h"
52 #include "CLHEP/Units/GlobalSystemOfUnits.h"
53 #include "CLHEP/Units/GlobalPhysicalConstants.h"
54 
56 public:
57  struct energysum {
59  etotal = 0;
60  for (int i = 0; i < 6; ++i)
61  eTime[i] = 0.;
62  }
63  double eTime[6], etotal;
64  };
65 
66  struct hitsinfo {
68  x = y = z = phi = eta = 0.0;
69  cell = cell2 = sector = sector2 = type = layer = 0;
70  }
71  double x, y, z, phi, eta;
73  };
74 
76  ~HGCalSimHitValidation() override {}
77 
78  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
79 
80 protected:
81  void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
82  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
83  void analyze(const edm::Event&, const edm::EventSetup&) override;
84 
85 private:
86  void analyzeHits(std::vector<PCaloHit>& hits);
87  void fillOccupancyMap(std::map<int, int>& OccupancyMap, int layer);
88  void fillHitsInfo(std::pair<hitsinfo, energysum> hit_, unsigned int itimeslice, double esum);
91 
92  // ----------member data ---------------------------
96  std::vector<double> times_;
101  unsigned int layers_;
103  std::map<uint32_t, HepGeom::Transform3D> transMap_;
104 
105  std::vector<MonitorElement*> HitOccupancy_Plus_, HitOccupancy_Minus_;
106  std::vector<MonitorElement*> EtaPhi_Plus_, EtaPhi_Minus_;
108  static const unsigned int maxTime_ = 6;
109  std::vector<MonitorElement*> energy_[maxTime_];
110  unsigned int nTimes_;
111 };
112 
114  : nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
115  caloHitSource_(iConfig.getParameter<std::string>("CaloHitSource")),
116  times_(iConfig.getParameter<std::vector<double> >("TimeSlices")),
117  verbosity_(iConfig.getUntrackedParameter<int>("Verbosity", 0)),
118  testNumber_(iConfig.getUntrackedParameter<bool>("TestNumber", true)),
119  symmDet_(true),
120  fromDDD_(iConfig.getUntrackedParameter<bool>("fromDDD", true)),
121  firstLayer_(1) {
122  heRebuild_ = (nameDetector_ == "HCal") ? true : false;
123  tok_hepMC_ = consumes<edm::HepMCProduct>(edm::InputTag("generatorSmeared"));
124  tok_hits_ = consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", caloHitSource_));
125  nTimes_ = (times_.size() > maxTime_) ? maxTime_ : times_.size();
126 }
127 
130  std::vector<double> times = {25.0, 1000.0};
131  desc.add<std::string>("DetectorName", "HGCalEESensitive");
132  desc.add<std::string>("CaloHitSource", "HGCHitsEE");
133  desc.add<std::vector<double> >("TimeSlices", times);
134  desc.addUntracked<int>("Verbosity", 0);
135  desc.addUntracked<bool>("TestNumber", true);
136  desc.addUntracked<bool>("fromDDD", true);
137  descriptions.add("hgcalSimHitValidationEE", desc);
138 }
139 
141  //Generator input
142  if (verbosity_ > 0) {
144  iEvent.getByToken(tok_hepMC_, evtMC);
145  if (!evtMC.isValid()) {
146  edm::LogVerbatim("HGCalValidation") << "no HepMCProduct found";
147  } else {
148  const HepMC::GenEvent* myGenEvent = evtMC->GetEvent();
149  unsigned int k(0);
150  for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end();
151  ++p, ++k) {
152  edm::LogVerbatim("HGCalValidation") << "Particle[" << k << "] with pt " << (*p)->momentum().perp() << " eta "
153  << (*p)->momentum().eta() << " phi " << (*p)->momentum().phi();
154  }
155  }
156  }
157 
158  //Now the hits
159  edm::Handle<edm::PCaloHitContainer> theCaloHitContainers;
160  iEvent.getByToken(tok_hits_, theCaloHitContainers);
161  if (theCaloHitContainers.isValid()) {
162  if (verbosity_ > 0)
163  edm::LogVerbatim("HGCalValidation") << " PcalohitItr = " << theCaloHitContainers->size();
164  std::vector<PCaloHit> caloHits;
165  caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
166  if (heRebuild_ && testNumber_) {
167  for (unsigned int i = 0; i < caloHits.size(); ++i) {
168  unsigned int id_ = caloHits[i].id();
170  if (hid.subdet() != int(HcalEndcap))
171  hid = HcalDetId(HcalEmpty, hid.ieta(), hid.iphi(), hid.depth());
172  caloHits[i].setID(hid.rawId());
173  if (verbosity_ > 0)
174  edm::LogVerbatim("HGCalValidation") << "Hit[" << i << "] " << hid;
175  }
176  }
177  analyzeHits(caloHits);
178  } else if (verbosity_ > 0) {
179  edm::LogVerbatim("HGCalValidation") << "PCaloHitContainer does not exist!";
180  }
181 }
182 
183 void HGCalSimHitValidation::analyzeHits(std::vector<PCaloHit>& hits) {
184  std::map<int, int> OccupancyMap_plus, OccupancyMap_minus;
185  OccupancyMap_plus.clear();
186  OccupancyMap_minus.clear();
187 
188  std::map<uint32_t, std::pair<hitsinfo, energysum> > map_hits;
189  map_hits.clear();
190 
191  if (verbosity_ > 0)
192  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with " << hits.size() << " PcaloHit elements";
193  unsigned int nused(0);
194  for (unsigned int i = 0; i < hits.size(); i++) {
195  double energy = hits[i].energy();
196  double time = hits[i].time();
197  uint32_t id_ = hits[i].id();
198  int cell, sector, subsector(0), layer, zside;
199  int subdet(0), cell2(0), type(0);
200  if (heRebuild_) {
201  HcalDetId detId = HcalDetId(id_);
202  subdet = detId.subdet();
203  if (subdet != static_cast<int>(HcalEndcap))
204  continue;
205  cell = detId.ietaAbs();
206  sector = detId.iphi();
207  subsector = 1;
208  layer = detId.depth();
209  zside = detId.zside();
210  } else if (hgcons_->waferHexagon8()) {
211  HGCSiliconDetId detId = HGCSiliconDetId(id_);
212  subdet = ForwardEmpty;
213  cell = detId.cellU();
214  cell2 = detId.cellV();
215  sector = detId.waferU();
216  subsector = detId.waferV();
217  type = detId.type();
218  layer = detId.layer();
219  zside = detId.zside();
220  } else if (hgcons_->geomMode() == HGCalGeometryMode::Square) {
221  HGCalTestNumbering::unpackSquareIndex(id_, zside, layer, sector, subsector, cell);
222  } else if (hgcons_->tileTrapezoid()) {
224  subdet = ForwardEmpty;
225  sector = detId.ietaAbs();
226  cell = detId.iphi();
227  subsector = 1;
228  type = detId.type();
229  layer = detId.layer();
230  zside = detId.zside();
231  } else {
232  HGCalTestNumbering::unpackHexagonIndex(id_, subdet, zside, layer, sector, type, cell);
233  }
234  nused++;
235  if (verbosity_ > 1)
236  edm::LogVerbatim("HGCalValidation")
237  << "Detector " << nameDetector_ << " zside = " << zside << " sector|wafer = " << sector << ":" << subsector
238  << " type = " << type << " layer = " << layer << " cell = " << cell << ":" << cell2 << " energy = " << energy
239  << " energyem = " << hits[i].energyEM() << " energyhad = " << hits[i].energyHad() << " time = " << time;
240 
241  HepGeom::Point3D<float> gcoord;
242  if (heRebuild_) {
243  std::pair<double, double> etaphi = hcons_->getEtaPhi(subdet, zside * cell, sector);
244  double rz = hcons_->getRZ(subdet, zside * cell, layer);
245  if (verbosity_ > 2)
246  edm::LogVerbatim("HGCalValidation") << "i/p " << subdet << ":" << zside << ":" << cell << ":" << sector << ":"
247  << layer << " o/p " << etaphi.first << ":" << etaphi.second << ":" << rz;
248  gcoord = HepGeom::Point3D<float>(rz * cos(etaphi.second) / cosh(etaphi.first),
249  rz * sin(etaphi.second) / cosh(etaphi.first),
250  rz * tanh(etaphi.first));
251  } else if (hgcons_->geomMode() == HGCalGeometryMode::Square) {
252  std::pair<float, float> xy = hgcons_->locateCell(cell, layer, subsector, false);
253  const HepGeom::Point3D<float> lcoord(xy.first, xy.second, 0);
254  int subs = (symmDet_ ? 0 : subsector);
255  id_ = HGCalTestNumbering::packSquareIndex(zside, layer, sector, subs, 0);
256  gcoord = (transMap_[id_] * lcoord);
257  } else {
258  std::pair<float, float> xy;
259  if (hgcons_->waferHexagon8()) {
260  xy = hgcons_->locateCell(layer, sector, subsector, cell, cell2, false, true);
261  } else if (hgcons_->tileTrapezoid()) {
262  xy = hgcons_->locateCellTrap(layer, sector, cell, false);
263  } else {
264  xy = hgcons_->locateCell(cell, layer, sector, false);
265  }
266  double zp = hgcons_->waferZ(layer, false);
267  if (zside < 0)
268  zp = -zp;
269  float xp = (zp < 0) ? -xy.first : xy.first;
270  gcoord = HepGeom::Point3D<float>(xp, xy.second, zp);
271  }
272  double tof = (gcoord.mag() * CLHEP::mm) / CLHEP::c_light;
273  if (verbosity_ > 1)
274  edm::LogVerbatim("HGCalValidation")
275  << std::hex << id_ << std::dec << " global coordinate " << gcoord << " time " << time << ":" << tof;
276  time -= tof;
277 
278  energysum esum;
279  hitsinfo hinfo;
280  if (map_hits.count(id_) != 0) {
281  hinfo = map_hits[id_].first;
282  esum = map_hits[id_].second;
283  } else {
284  hinfo.x = gcoord.x();
285  hinfo.y = gcoord.y();
286  hinfo.z = gcoord.z();
287  hinfo.sector = sector;
288  hinfo.sector2 = subsector;
289  hinfo.cell = cell;
290  hinfo.cell2 = cell2;
291  hinfo.type = type;
292  hinfo.layer = layer - firstLayer_;
293  hinfo.phi = gcoord.getPhi();
294  hinfo.eta = gcoord.getEta();
295  }
296  esum.etotal += energy;
297  for (unsigned int k = 0; k < nTimes_; ++k) {
298  if (time > 0 && time < times_[k])
299  esum.eTime[k] += energy;
300  }
301 
302  if (verbosity_ > 1)
303  edm::LogVerbatim("HGCalValidation") << " ----------------------- gx = " << hinfo.x << " gy = " << hinfo.y
304  << " gz = " << hinfo.z << " phi = " << hinfo.phi << " eta = " << hinfo.eta;
305  map_hits[id_] = std::pair<hitsinfo, energysum>(hinfo, esum);
306  }
307  if (verbosity_ > 0)
308  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with " << map_hits.size()
309  << " detector elements being hit";
310 
311  std::map<uint32_t, std::pair<hitsinfo, energysum> >::iterator itr;
312  for (itr = map_hits.begin(); itr != map_hits.end(); ++itr) {
313  hitsinfo hinfo = (*itr).second.first;
314  energysum esum = (*itr).second.second;
315  int layer = hinfo.layer;
316  double eta = hinfo.eta;
317 
318  for (unsigned int itimeslice = 0; itimeslice < nTimes_; itimeslice++) {
319  fillHitsInfo((*itr).second, itimeslice, esum.eTime[itimeslice]);
320  }
321 
322  if (eta > 0.0)
323  fillOccupancyMap(OccupancyMap_plus, layer);
324  else
325  fillOccupancyMap(OccupancyMap_minus, layer);
326  }
327  if (verbosity_ > 0)
328  edm::LogVerbatim("HGCalValidation") << "With map:used:total " << hits.size() << "|" << nused << "|"
329  << map_hits.size() << " hits";
330 
331  for (auto const& itr : OccupancyMap_plus) {
332  int layer = itr.first;
333  int occupancy = itr.second;
334  HitOccupancy_Plus_.at(layer)->Fill(occupancy);
335  }
336  for (auto const& itr : OccupancyMap_minus) {
337  int layer = itr.first;
338  int occupancy = itr.second;
339  HitOccupancy_Minus_.at(layer)->Fill(occupancy);
340  }
341 }
342 
343 void HGCalSimHitValidation::fillOccupancyMap(std::map<int, int>& OccupancyMap, int layer) {
344  if (OccupancyMap.find(layer) != OccupancyMap.end()) {
345  ++OccupancyMap[layer];
346  } else {
347  OccupancyMap[layer] = 1;
348  }
349 }
350 
351 void HGCalSimHitValidation::fillHitsInfo(std::pair<hitsinfo, energysum> hits, unsigned int itimeslice, double esum) {
352  unsigned int ilayer = hits.first.layer;
353  if (ilayer < layers_) {
354  energy_[itimeslice].at(ilayer)->Fill(esum);
355  if (itimeslice == 0) {
356  EtaPhi_Plus_.at(ilayer)->Fill(hits.first.eta, hits.first.phi);
357  EtaPhi_Minus_.at(ilayer)->Fill(hits.first.eta, hits.first.phi);
358  }
359  } else {
360  if (verbosity_ > 0)
361  edm::LogVerbatim("HGCalValidation")
362  << "Problematic Hit for " << nameDetector_ << " at sector " << hits.first.sector << ":" << hits.first.sector2
363  << " layer " << hits.first.layer << " cell " << hits.first.cell << ":" << hits.first.cell2 << " energy "
364  << hits.second.etotal;
365  }
366 }
367 
369  if (verbosity_ > 0)
370  edm::LogVerbatim("HGCalValidation") << "Initialize HGCalDDDConstants (DDD) for " << nameDetector_ << " : "
371  << hgcons_;
372 
374  const DDCompactView& cview = *ddViewH;
375  std::string attribute = "Volume";
377 
379  DDFilteredView fv(cview, filter);
380  bool dodet = fv.firstChild();
381 
382  while (dodet) {
383  const DDSolid& sol = fv.logicalPart().solid();
384  const std::string& name = sol.name().fullname();
385  int isd = (name.find(nameDetector_) == std::string::npos) ? -1 : 1;
386  if (isd > 0) {
387  std::vector<int> copy = fv.copyNumbers();
388  int nsiz = static_cast<int>(copy.size());
389  int lay = (nsiz > 0) ? copy[nsiz - 1] : -1;
390  int sec = (nsiz > 1) ? copy[nsiz - 2] : -1;
391  int zp = (nsiz > 3) ? copy[nsiz - 4] : -1;
392  if (zp != 1)
393  zp = -1;
394  const DDTrap& trp = static_cast<DDTrap>(sol);
395  int subs = (trp.alpha1() > 0 ? 1 : 0);
396  symmDet_ = (trp.alpha1() == 0 ? true : false);
397  uint32_t id = HGCalTestNumbering::packSquareIndex(zp, lay, sec, subs, 0);
398  DD3Vector x, y, z;
399  fv.rotation().GetComponents(x, y, z);
400  const CLHEP::HepRep3x3 rotation(x.X(), y.X(), z.X(), x.Y(), y.Y(), z.Y(), x.Z(), y.Z(), z.Z());
401  const CLHEP::HepRotation hr(rotation);
402  const CLHEP::Hep3Vector h3v(fv.translation().X(), fv.translation().Y(), fv.translation().Z());
403  const HepGeom::Transform3D ht3d(hr, h3v);
404  transMap_.insert(std::make_pair(id, ht3d));
405  if (verbosity_ > 2)
406  edm::LogVerbatim("HGCalValidation") << HGCalDetId(id) << " Transform using " << h3v << " and " << hr;
407  }
408  dodet = fv.next();
409  }
410  if (verbosity_ > 0)
411  edm::LogVerbatim("HGCalValidation") << "Finds " << transMap_.size() << " elements and SymmDet_ = " << symmDet_;
412  }
413  return true;
414 }
415 
417  if (verbosity_ > 0)
418  edm::LogVerbatim("HGCalValidation") << "Initialize HGCalDDDConstants (DD4hep) for " << nameDetector_ << " : "
419  << hgcons_;
420 
422  const cms::DDCompactView& cview = *ddViewH;
423  const cms::DDFilter filter("Volume", nameDetector_);
424  cms::DDFilteredView fv(cview, filter);
425 
426  while (fv.firstChild()) {
427  const auto& name = fv.name();
428  int isd = (name.find(nameDetector_) == std::string::npos) ? -1 : 1;
429  if (isd > 0) {
430  const auto& copy = fv.copyNos();
431  int nsiz = static_cast<int>(copy.size());
432  int lay = (nsiz > 0) ? copy[0] : -1;
433  int sec = (nsiz > 1) ? copy[1] : -1;
434  int zp = (nsiz > 3) ? copy[3] : -1;
435  if (zp != 1)
436  zp = -1;
437  const auto& pars = fv.parameters();
438  int subs = (pars[6] > 0 ? 1 : 0);
439  symmDet_ = (pars[6] == 0 ? true : false);
440  uint32_t id = HGCalTestNumbering::packSquareIndex(zp, lay, sec, subs, 0);
441  DD3Vector x, y, z;
442  fv.rotation().GetComponents(x, y, z);
443  const CLHEP::HepRep3x3 rotation(x.X(), y.X(), z.X(), x.Y(), y.Y(), z.Y(), x.Z(), y.Z(), z.Z());
444  const CLHEP::HepRotation hr(rotation);
445  const CLHEP::Hep3Vector h3v(fv.translation().X(), fv.translation().Y(), fv.translation().Z());
446  const HepGeom::Transform3D ht3d(hr, h3v);
447  transMap_.insert(std::make_pair(id, ht3d));
448  if (verbosity_ > 2)
449  edm::LogVerbatim("HGCalValidation") << HGCalDetId(id) << " Transform using " << h3v << " and " << hr;
450  }
451  }
452  if (verbosity_ > 0)
453  edm::LogVerbatim("HGCalValidation") << "Finds " << transMap_.size() << " elements and SymmDet_ = " << symmDet_;
454  }
455  return true;
456 }
457 
458 // ------------ method called when starting to processes a run ------------
460  if (heRebuild_) {
462  iSetup.get<HcalRecNumberingRecord>().get(pHRNDC);
463  hcons_ = &(*pHRNDC);
464  layers_ = hcons_->getMaxDepth(1);
465  } else {
467  iSetup.get<IdealGeometryRecord>().get(nameDetector_, pHGDC);
468  hgcons_ = &(*pHGDC);
469  layers_ = hgcons_->layers(false);
471  if (fromDDD_) {
473  iSetup.get<IdealGeometryRecord>().get(pDD);
474  defineGeometry(pDD);
475  } else {
477  iSetup.get<IdealGeometryRecord>().get(pDD);
478  defineGeometry(pDD);
479  }
480  }
481  if (verbosity_ > 0)
482  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " defined with " << layers_ << " Layers with first at "
483  << firstLayer_;
484 }
485 
487  iB.setCurrentFolder("HGCAL/HGCalSimHitsV/" + nameDetector_);
488 
489  std::ostringstream histoname;
490  for (unsigned int il = 0; il < layers_; ++il) {
491  int ilayer = firstLayer_ + static_cast<int>(il);
492  auto istr1 = std::to_string(ilayer);
493  while (istr1.size() < 2) {
494  istr1.insert(0, "0");
495  }
496  histoname.str("");
497  histoname << "HitOccupancy_Plus_layer_" << istr1;
498  HitOccupancy_Plus_.push_back(iB.book1D(histoname.str().c_str(), "HitOccupancy_Plus", 501, -0.5, 500.5));
499  histoname.str("");
500  histoname << "HitOccupancy_Minus_layer_" << istr1;
501  HitOccupancy_Minus_.push_back(iB.book1D(histoname.str().c_str(), "HitOccupancy_Minus", 501, -0.5, 500.5));
502 
503  histoname.str("");
504  histoname << "EtaPhi_Plus_"
505  << "layer_" << istr1;
506  EtaPhi_Plus_.push_back(iB.book2D(histoname.str().c_str(), "Occupancy", 31, 1.45, 3.0, 72, -CLHEP::pi, CLHEP::pi));
507  histoname.str("");
508  histoname << "EtaPhi_Minus_"
509  << "layer_" << istr1;
510  EtaPhi_Minus_.push_back(
511  iB.book2D(histoname.str().c_str(), "Occupancy", 31, -3.0, -1.45, 72, -CLHEP::pi, CLHEP::pi));
512 
513  for (unsigned int itimeslice = 0; itimeslice < nTimes_; itimeslice++) {
514  histoname.str("");
515  histoname << "energy_time_" << itimeslice << "_layer_" << istr1;
516  energy_[itimeslice].push_back(iB.book1D(histoname.str().c_str(), "energy_", 100, 0, 0.1));
517  }
518  }
519 
520  MeanHitOccupancy_Plus_ = iB.book1D("MeanHitOccupancy_Plus", "MeanHitOccupancy_Plus", layers_, 0.5, layers_ + 0.5);
521  MeanHitOccupancy_Minus_ = iB.book1D("MeanHitOccupancy_Minus", "MeanHitOccupancy_Minus", layers_, 0.5, layers_ + 0.5);
522 }
523 
525 //define this as a plug-in
ConfigurationDescriptions.h
cms::DDFilteredView::rotation
const RotationMatrix rotation() const
Definition: DDFilteredView.cc:122
HGCalSimHitValidation::HitOccupancy_Plus_
std::vector< MonitorElement * > HitOccupancy_Plus_
Definition: HGCalSimHitValidation.cc:105
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
DDAxes::y
HGCalSimHitValidation::testNumber_
bool testNumber_
Definition: HGCalSimHitValidation.cc:98
electrons_cff.bool
bool
Definition: electrons_cff.py:393
mps_fire.i
i
Definition: mps_fire.py:428
HGCScintillatorDetId::iphi
int iphi() const
get the phi index
Definition: HGCScintillatorDetId.cc:58
cms::DDFilteredView::parameters
const std::vector< double > parameters() const
extract shape parameters
Definition: DDFilteredView.cc:536
HGCalSimHitValidation::fromDDD_
bool fromDDD_
Definition: HGCalSimHitValidation.cc:98
ESTransientHandle.h
MessageLogger.h
HGCScintillatorDetId.h
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
ForwardEmpty
Definition: ForwardSubdetector.h:5
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
ESHandle.h
HGCalSimHitValidation::nTimes_
unsigned int nTimes_
Definition: HGCalSimHitValidation.cc:110
HGCalSimHitValidation::HGCalSimHitValidation
HGCalSimHitValidation(const edm::ParameterSet &)
Definition: HGCalSimHitValidation.cc:113
HcalDetId::iphi
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
HGCalDDDConstants::firstLayer
int firstLayer() const
Definition: HGCalDDDConstants.h:52
edm::Run
Definition: Run.h:45
HGCalDDDConstants::locateCellTrap
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco) const
Definition: HGCalDDDConstants.cc:716
HGCalSimHitValidation::MeanHitOccupancy_Plus_
MonitorElement * MeanHitOccupancy_Plus_
Definition: HGCalSimHitValidation.cc:107
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
HGCalSimHitValidation::hitsinfo::y
double y
Definition: HGCalSimHitValidation.cc:71
edm::EDGetTokenT< edm::PCaloHitContainer >
HGCalDDDConstants::geomMode
HGCalGeometryMode::GeometryMode geomMode() const
Definition: HGCalDDDConstants.h:53
HGCalGeometryMode.h
HGCalSimHitValidation::hgcons_
const HGCalDDDConstants * hgcons_
Definition: HGCalSimHitValidation.cc:94
HGCalSimHitValidation::hcons_
const HcalDDDRecConstants * hcons_
Definition: HGCalSimHitValidation.cc:95
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HGCalSimHitValidation::heRebuild_
bool heRebuild_
Definition: HGCalSimHitValidation.cc:98
HGCalSimHitValidation::layers_
unsigned int layers_
Definition: HGCalSimHitValidation.cc:101
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
HGCalTestNumbering::unpackHexagonIndex
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
Definition: HGCalTestNumbering.cc:47
HGCalDDDConstants::waferZ
double waferZ(int layer, bool reco) const
Definition: HGCalDDDConstants.cc:1388
HGCalSimHitValidation::analyzeHits
void analyzeHits(std::vector< PCaloHit > &hits)
Definition: HGCalSimHitValidation.cc:183
HGCSiliconDetId.h
DDFilteredView::copyNumbers
nav_type copyNumbers() const
return the stack of copy numbers
Definition: DDFilteredView.cc:193
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HGCalSimHitValidation::energysum::etotal
double etotal
Definition: HGCalSimHitValidation.cc:63
HGCalDDDConstants::waferHexagon8
bool waferHexagon8() const
Definition: HGCalDDDConstants.h:129
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
HGCalSimHitValidation::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: HGCalSimHitValidation.cc:140
HGCalSimHitValidation::energysum
Definition: HGCalSimHitValidation.cc:57
DQMStore.h
HcalRecNumberingRecord.h
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
hinfo
Definition: TauTagValidation.h:55
HGCalSimHitValidation::hitsinfo::z
double z
Definition: HGCalSimHitValidation.cc:71
DDAxes::x
HGCalSimHitValidation::hitsinfo
Definition: HGCalSimHitValidation.cc:66
cms::DDFilteredView
Definition: DDFilteredView.h:70
HcalEmpty
Definition: HcalAssistant.h:32
HGCalSimHitValidation::hitsinfo::cell
int cell
Definition: HGCalSimHitValidation.cc:72
edm::Handle< edm::HepMCProduct >
DDCompactView.h
HGCalTestNumbering::unpackSquareIndex
static void unpackSquareIndex(const uint32_t &idx, int &z, int &lay, int &sec, int &subsec, int &cell)
Definition: HGCalTestNumbering.cc:39
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
HGCalSimHitValidation::defineGeometry
bool defineGeometry(edm::ESTransientHandle< DDCompactView > &ddViewH)
Definition: HGCalSimHitValidation.cc:368
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
HGCalSimHitValidation::verbosity_
int verbosity_
Definition: HGCalSimHitValidation.cc:97
HGCalDDDConstants
Definition: HGCalDDDConstants.h:26
ForwardSubdetector.h
cms::DDFilteredView::name
std::string_view name() const
Definition: DDFilteredView.cc:853
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
cms::DDFilteredView::translation
const Translation translation() const
Definition: DDFilteredView.cc:103
HGCalSimHitValidation::transMap_
std::map< uint32_t, HepGeom::Transform3D > transMap_
Definition: HGCalSimHitValidation.cc:103
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:50
MakerMacros.h
HGCalSimHitValidation::hitsinfo::hitsinfo
hitsinfo()
Definition: HGCalSimHitValidation.cc:67
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HGCalSimHitValidation
Definition: HGCalSimHitValidation.cc:55
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DDFilteredView.h
cms::DDFilter
Definition: DDFilteredView.h:59
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HGCalTestNumbering::packSquareIndex
static uint32_t packSquareIndex(int z, int lay, int sec, int subsec, int cell)
Definition: HGCalTestNumbering.cc:6
Service.h
PVValHelper::eta
Definition: PVValidationHelpers.h:69
DDFilteredView::next
bool next()
set current node to the next node in the filtered tree
Definition: DDFilteredView.cc:67
HGCalSimHitValidation::hitsinfo::cell2
int cell2
Definition: HGCalSimHitValidation.cc:72
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
cms::DDFilteredView::copyNos
const std::vector< int > copyNos() const
The list of the volume copy numbers.
Definition: DDFilteredView.cc:89
HGCalSimHitValidation::firstLayer_
int firstLayer_
Definition: HGCalSimHitValidation.cc:102
DDBase::name
const N & name() const
Definition: DDBase.h:59
DDAxes::z
HGCScintillatorDetId::ietaAbs
int ietaAbs() const
Definition: HGCScintillatorDetId.h:55
HGCalSimHitValidation::dqmBeginRun
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Definition: HGCalSimHitValidation.cc:459
edm::ESHandle
Definition: DTSurvey.h:22
HGCalSimHitValidation::fillHitsInfo
void fillHitsInfo(std::pair< hitsinfo, energysum > hit_, unsigned int itimeslice, double esum)
Definition: HGCalSimHitValidation.cc:351
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:268
HGCalGeometryMode::Square
Definition: HGCalGeometryMode.h:26
DDSolid.h
DDFilteredView.h
HGCalSimHitValidation::energy_
std::vector< MonitorElement * > energy_[maxTime_]
Definition: HGCalSimHitValidation.cc:109
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
HGCalSimHitValidation::hitsinfo::type
int type
Definition: HGCalSimHitValidation.cc:72
DDCompactView.h
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HGCScintillatorDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCScintillatorDetId.h:47
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
HGCalSimHitValidation::EtaPhi_Plus_
std::vector< MonitorElement * > EtaPhi_Plus_
Definition: HGCalSimHitValidation.cc:106
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
DQMEDAnalyzer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
HGCalSimHitValidation::hitsinfo::sector2
int sector2
Definition: HGCalSimHitValidation.cc:72
HGCalSimHitValidation::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HGCalSimHitValidation.cc:128
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalDDDConstants::tileTrapezoid
bool tileTrapezoid() const
Definition: HGCalDDDConstants.h:110
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
Definition: PGeometricDetBuilder.cc:19
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
funct::true
true
Definition: Factorize.h:173
DDTrap
Interface to a Trapezoid.
Definition: DDSolid.h:77
HGCalSimHitValidation::energysum::energysum
energysum()
Definition: HGCalSimHitValidation.cc:58
HcalDetId::ieta
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
HGCalSimHitValidation::hitsinfo::eta
double eta
Definition: HGCalSimHitValidation.cc:71
edm::ParameterSet
Definition: ParameterSet.h:47
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
Event.h
DDSpecifics.h
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HGCalSimHitValidation::fillOccupancyMap
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
Definition: HGCalSimHitValidation.cc:343
HcalDetId.h
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
HcalHitRelabeller.h
PCaloHit.h
HGCalDDDConstants::layers
unsigned int layers(bool reco) const
Definition: HGCalDDDConstants.cc:561
HcalDetId::subdet
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
HGCalSimHitValidation::tok_hits_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
Definition: HGCalSimHitValidation.cc:99
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
DDFilter.h
value
Definition: value.py:1
HGCalSimHitValidation::nameDetector_
std::string nameDetector_
Definition: HGCalSimHitValidation.cc:93
HGCScintillatorDetId::type
int type() const
get/set the type
Definition: HGCScintillatorDetId.h:43
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
hgcalTopologyTester_cfi.cell2
cell2
Definition: hgcalTopologyTester_cfi.py:12
HGCalSimHitValidation::MeanHitOccupancy_Minus_
MonitorElement * MeanHitOccupancy_Minus_
Definition: HGCalSimHitValidation.cc:107
IdealGeometryRecord.h
edm::EventSetup
Definition: EventSetup.h:57
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:34
HGCSiliconDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HGCSiliconDetId.h:54
HGCalSimHitValidation::energysum::eTime
double eTime[6]
Definition: HGCalSimHitValidation.cc:63
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
get
#define get
HGCalSimHitValidation::hitsinfo::sector
int sector
Definition: HGCalSimHitValidation.cc:72
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:87
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
InputTag.h
HGCalSimHitValidation::hitsinfo::phi
double phi
Definition: HGCalSimHitValidation.cc:71
HcalHitRelabeller::relabel
DetId relabel(const uint32_t testId) const
Definition: HcalHitRelabeller.cc:49
HGCalDetId
Definition: HGCalDetId.h:8
HGCSiliconDetId::cellV
int cellV() const
Definition: HGCSiliconDetId.h:61
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HGCalDetId.h
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HGCSiliconDetId::cellU
int cellU() const
get the cell #'s in u,v or in x,y
Definition: HGCSiliconDetId.h:60
HcalDDDRecConstants::getRZ
double getRZ(const int &subdet, const int &ieta, const int &depth) const
Definition: HcalDDDRecConstants.cc:416
HGCalSimHitValidation::EtaPhi_Minus_
std::vector< MonitorElement * > EtaPhi_Minus_
Definition: HGCalSimHitValidation.cc:106
HGCalSimHitValidation::hitsinfo::x
double x
Definition: HGCalSimHitValidation.cc:71
HcalEndcap
Definition: HcalAssistant.h:34
DDValue
Definition: DDValue.h:21
HGCalSimHitValidation::HitOccupancy_Minus_
std::vector< MonitorElement * > HitOccupancy_Minus_
Definition: HGCalSimHitValidation.cc:105
Frameworkfwd.h
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:23
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
dqm::implementation::IBooker::book2D
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
HGCalSimHitValidation::maxTime_
static const unsigned int maxTime_
Definition: HGCalSimHitValidation.cc:108
cms::DDCompactView
Definition: DDCompactView.h:31
HcalDDDRecConstants.h
HGCalSimHitValidation::times_
std::vector< double > times_
Definition: HGCalSimHitValidation.cc:96
HGCSiliconDetId::type
int type() const
get the type
Definition: HGCSiliconDetId.h:51
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HGCSiliconDetId::waferU
int waferU() const
Definition: HGCSiliconDetId.h:76
EventSetup.h
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
DDFilteredView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:28
HGCalSimHitValidation::~HGCalSimHitValidation
~HGCalSimHitValidation() override
Definition: HGCalSimHitValidation.cc:76
PCaloHitContainer.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
HcalDDDRecConstants::getMaxDepth
int getMaxDepth(const int &type) const
Definition: HcalDDDRecConstants.h:88
HcalDDDRecConstants
Definition: HcalDDDRecConstants.h:23
HGCalSimHitValidation::tok_hepMC_
edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
Definition: HGCalSimHitValidation.cc:100
DDFilteredView
Definition: DDFilteredView.h:20
DDTrap::alpha1
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
Definition: DDSolid.cc:143
HGCalSimHitValidation::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: HGCalSimHitValidation.cc:486
pi
const Double_t pi
Definition: trackSplitPlot.h:36
DDName::fullname
const std::string fullname() const
Definition: DDName.h:40
HGCalSimHitValidation::hitsinfo::layer
int layer
Definition: HGCalSimHitValidation.cc:72
HcalDetId::ietaAbs
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
HGCalDDDConstants.h
ParameterSet.h
HcalDDDRecConstants::getEtaPhi
std::pair< double, double > getEtaPhi(const int &subdet, const int &ieta, const int &iphi) const
Definition: HcalDDDRecConstants.cc:132
HGCalDDDConstants::locateCell
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
Definition: HGCalDDDConstants.cc:580
HepMCProduct.h
HcalDetId::zside
constexpr int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.h:141
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
ntuplemaker.time
time
Definition: ntuplemaker.py:310
edm::Event
Definition: Event.h:73
fastmath::etaphi
std::pair< T, T > etaphi(T x, T y, T z)
Definition: FastMath.h:162
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:29
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
HGCSiliconDetId::waferV
int waferV() const
Definition: HGCSiliconDetId.h:77
HGCalSimHitValidation::symmDet_
bool symmDet_
Definition: HGCalSimHitValidation.cc:98
HGCalSimHitValidation::caloHitSource_
std::string caloHitSource_
Definition: HGCalSimHitValidation.cc:93
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
HGCalTestNumbering.h
HGCSiliconDetId::layer
int layer() const
get the layer #
Definition: HGCSiliconDetId.h:57