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 
11 
14 
24 
27 
31 
32 #include "CLHEP/Units/GlobalSystemOfUnits.h"
33 #include "CLHEP/Units/GlobalPhysicalConstants.h"
34 
36 public:
37  struct energysum {
39  etotal = 0;
40  for (int i = 0; i < 6; ++i)
41  eTime[i] = 0.;
42  }
43  double eTime[6], etotal;
44  };
45 
46  struct hitsinfo {
48  x = y = z = phi = eta = 0.0;
49  cell = cell2 = sector = sector2 = type = layer = 0;
50  }
51  double x, y, z, phi, eta;
53  };
54 
56  ~HGCalSimHitValidation() override = default;
57 
58  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
59 
60 protected:
61  void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
62  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
63  void analyze(const edm::Event&, const edm::EventSetup&) override;
64 
65 private:
66  void analyzeHits(std::vector<PCaloHit>& hits);
67  void fillOccupancyMap(std::map<int, int>& OccupancyMap, int layer);
68  void fillHitsInfo(std::pair<hitsinfo, energysum> hit_, unsigned int itimeslice, double esum);
69 
70  TH1F* createHisto(std::string histname, const int nbins, float minIndexX, float maxIndexX, bool isLogX = true);
71  void histoSetting(TH1F*& histo,
72  const char* xTitle,
73  const char* yTitle = "",
74  Color_t lineColor = kBlack,
75  Color_t markerColor = kBlack,
76  int linewidth = 1);
77  void histoSetting(TH2F*& histo,
78  const char* xTitle,
79  const char* yTitle = "",
80  Color_t lineColor = kBlack,
81  Color_t markerColor = kBlack,
82  int linewidth = 1);
83  void fillMuonTomoHistos(int partialType, std::pair<hitsinfo, energysum> hit_);
84 
85  // ----------member data ---------------------------
88  const std::vector<double> times_;
89  const int verbosity_;
93  unsigned int layers_;
95 
96  std::vector<MonitorElement*> HitOccupancy_Plus_, HitOccupancy_Minus_;
97  std::vector<MonitorElement*> EtaPhi_Plus_, EtaPhi_Minus_;
99  static const unsigned int maxTime_ = 6;
100  std::vector<MonitorElement*> energy_[maxTime_];
101  std::vector<MonitorElement*> energyFWF_, energyFWCN_, energyFWCK_;
102  std::vector<MonitorElement*> energyPWF_, energyPWCN_, energyPWCK_;
103  std::vector<MonitorElement*> hitXYFWF_, hitXYFWCN_, hitXYFWCK_, hitXYB_;
104  unsigned int nTimes_;
105 };
106 
108  : nameDetector_(iConfig.getParameter<std::string>("DetectorName")),
109  caloHitSource_(iConfig.getParameter<std::string>("CaloHitSource")),
110  times_(iConfig.getParameter<std::vector<double> >("TimeSlices")),
111  verbosity_(iConfig.getUntrackedParameter<int>("Verbosity", 0)),
113  edm::ESInputTag{"", nameDetector_})),
114  tok_hepMC_(consumes<edm::HepMCProduct>(edm::InputTag("generatorSmeared"))),
115  tok_hits_(consumes<edm::PCaloHitContainer>(edm::InputTag("g4SimHits", caloHitSource_))),
116  firstLayer_(1) {
117  nTimes_ = (times_.size() > maxTime_) ? maxTime_ : times_.size();
118 }
119 
122  std::vector<double> times = {25.0, 1000.0};
123  desc.add<std::string>("DetectorName", "HGCalEESensitive");
124  desc.add<std::string>("CaloHitSource", "HGCHitsEE");
125  desc.add<std::vector<double> >("TimeSlices", times);
126  desc.addUntracked<int>("Verbosity", 0);
127  desc.addUntracked<bool>("TestNumber", true);
128  descriptions.add("hgcalSimHitValidationEE", desc);
129 }
130 
132  //Generator input
133  if (verbosity_ > 0) {
134  const edm::Handle<edm::HepMCProduct>& evtMC = iEvent.getHandle(tok_hepMC_);
135  if (!evtMC.isValid()) {
136  edm::LogVerbatim("HGCalValidation") << "no HepMCProduct found";
137  } else {
138  const HepMC::GenEvent* myGenEvent = evtMC->GetEvent();
139  unsigned int k(0);
140  for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end();
141  ++p, ++k) {
142  edm::LogVerbatim("HGCalValidation") << "Particle[" << k << "] with pt " << (*p)->momentum().perp() << " eta "
143  << (*p)->momentum().eta() << " phi " << (*p)->momentum().phi();
144  }
145  }
146  }
147 
148  //Now the hits
149  const edm::Handle<edm::PCaloHitContainer>& theCaloHitContainers = iEvent.getHandle(tok_hits_);
150  if (theCaloHitContainers.isValid()) {
151  if (verbosity_ > 0)
152  edm::LogVerbatim("HGCalValidation") << " PcalohitItr = " << theCaloHitContainers->size();
153  std::vector<PCaloHit> caloHits;
154  caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
155  analyzeHits(caloHits);
156  } else if (verbosity_ > 0) {
157  edm::LogVerbatim("HGCalValidation") << "PCaloHitContainer does not exist!";
158  }
159 }
160 
161 void HGCalSimHitValidation::analyzeHits(std::vector<PCaloHit>& hits) {
162  std::map<int, int> OccupancyMap_plus, OccupancyMap_minus;
163  OccupancyMap_plus.clear();
164  OccupancyMap_minus.clear();
165 
166  std::map<uint32_t, std::pair<hitsinfo, energysum> > map_hits;
167  map_hits.clear();
168 
169  if (verbosity_ > 0)
170  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with " << hits.size() << " PcaloHit elements";
171  unsigned int nused(0);
172  for (unsigned int i = 0; i < hits.size(); i++) {
173  double energy = hits[i].energy();
174  double time = hits[i].time();
175  uint32_t id_ = hits[i].id();
176  int cell, sector, subsector(0), layer, zside;
177  int cell2(0), type(0);
178  if (hgcons_->waferHexagon8()) {
180  cell = detId.cellU();
181  cell2 = detId.cellV();
182  sector = detId.waferU();
183  subsector = detId.waferV();
184  type = detId.type();
185  layer = detId.layer();
186  zside = detId.zside();
187  } else if (hgcons_->tileTrapezoid()) {
189  sector = detId.ietaAbs();
190  cell = detId.iphi();
191  subsector = 1;
192  type = detId.type();
193  layer = detId.layer();
194  zside = detId.zside();
195  } else {
196  edm::LogError("HGCalValidation") << "Wrong geometry mode " << hgcons_->geomMode();
197  continue;
198  }
199  nused++;
200  if (verbosity_ > 1)
201  edm::LogVerbatim("HGCalValidation")
202  << "Detector " << nameDetector_ << " zside = " << zside << " sector|wafer = " << sector << ":" << subsector
203  << " type = " << type << " layer = " << layer << " cell = " << cell << ":" << cell2 << " energy = " << energy
204  << " energyem = " << hits[i].energyEM() << " energyhad = " << hits[i].energyHad() << " time = " << time;
205 
206  HepGeom::Point3D<float> gcoord;
207  std::pair<float, float> xy;
208  if (hgcons_->waferHexagon8()) {
209  xy = hgcons_->locateCell(zside, layer, sector, subsector, cell, cell2, false, true, false, false);
210  } else {
211  xy = hgcons_->locateCellTrap(zside, layer, sector, cell, false, false);
212  }
213  double zp = hgcons_->waferZ(layer, false);
214  if (zside < 0)
215  zp = -zp;
216  float xp = (zp < 0) ? -xy.first : xy.first;
217  gcoord = HepGeom::Point3D<float>(xp, xy.second, zp);
218  double tof = (gcoord.mag() * CLHEP::mm) / CLHEP::c_light;
219  if (verbosity_ > 1)
220  edm::LogVerbatim("HGCalValidation")
221  << std::hex << id_ << std::dec << " global coordinate " << gcoord << " time " << time << ":" << tof;
222  time -= tof;
223 
224  energysum esum;
225  hitsinfo hinfo;
226  if (map_hits.count(id_) != 0) {
227  hinfo = map_hits[id_].first;
228  esum = map_hits[id_].second;
229  } else {
230  hinfo.x = gcoord.x();
231  hinfo.y = gcoord.y();
232  hinfo.z = gcoord.z();
233  hinfo.sector = sector;
234  hinfo.sector2 = subsector;
235  hinfo.cell = cell;
236  hinfo.cell2 = cell2;
237  hinfo.type = type;
238  hinfo.layer = layer - firstLayer_;
239  hinfo.phi = gcoord.getPhi();
240  hinfo.eta = gcoord.getEta();
241  }
242  esum.etotal += energy;
243  for (unsigned int k = 0; k < nTimes_; ++k) {
244  if (time > 0 && time < times_[k])
245  esum.eTime[k] += energy;
246  }
247 
248  if (verbosity_ > 1)
249  edm::LogVerbatim("HGCalValidation") << " ----------------------- gx = " << hinfo.x << " gy = " << hinfo.y
250  << " gz = " << hinfo.z << " phi = " << hinfo.phi << " eta = " << hinfo.eta;
251  map_hits[id_] = std::pair<hitsinfo, energysum>(hinfo, esum);
252  }
253  if (verbosity_ > 0)
254  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " with " << map_hits.size()
255  << " detector elements being hit";
256 
257  std::map<uint32_t, std::pair<hitsinfo, energysum> >::iterator itr;
258  for (itr = map_hits.begin(); itr != map_hits.end(); ++itr) {
259  hitsinfo hinfo = (*itr).second.first;
260  energysum esum = (*itr).second.second;
261  int layer = hinfo.layer;
262  double eta = hinfo.eta;
263  int type, part, orient;
264  int partialType = -1;
265  if ((nameDetector_ == "HGCalEESensitive") || (nameDetector_ == "HGCalHESiliconSensitive")) {
266  HGCSiliconDetId detId = HGCSiliconDetId((*itr).first);
267  std::tie(type, part, orient) = hgcons_->waferType(detId, false);
268  partialType = part;
269  }
270 
271  for (unsigned int itimeslice = 0; itimeslice < nTimes_; itimeslice++) {
272  fillHitsInfo((*itr).second, itimeslice, esum.eTime[itimeslice]);
273  }
274 
275  if (eta > 0.0)
276  fillOccupancyMap(OccupancyMap_plus, layer);
277  else
278  fillOccupancyMap(OccupancyMap_minus, layer);
279 
280  fillMuonTomoHistos(partialType, (*itr).second);
281  }
282  if (verbosity_ > 0)
283  edm::LogVerbatim("HGCalValidation") << "With map:used:total " << hits.size() << "|" << nused << "|"
284  << map_hits.size() << " hits";
285 
286  for (auto const& itr : OccupancyMap_plus) {
287  int layer = itr.first;
288  int occupancy = itr.second;
289  HitOccupancy_Plus_.at(layer)->Fill(occupancy);
290  }
291  for (auto const& itr : OccupancyMap_minus) {
292  int layer = itr.first;
293  int occupancy = itr.second;
294  HitOccupancy_Minus_.at(layer)->Fill(occupancy);
295  }
296 }
297 
298 void HGCalSimHitValidation::fillOccupancyMap(std::map<int, int>& OccupancyMap, int layer) {
299  if (OccupancyMap.find(layer) != OccupancyMap.end()) {
300  ++OccupancyMap[layer];
301  } else {
302  OccupancyMap[layer] = 1;
303  }
304 }
305 
306 void HGCalSimHitValidation::fillHitsInfo(std::pair<hitsinfo, energysum> hits, unsigned int itimeslice, double esum) {
307  unsigned int ilayer = hits.first.layer;
308  if (ilayer < layers_) {
309  energy_[itimeslice].at(ilayer)->Fill(esum);
310  if (itimeslice == 0) {
311  EtaPhi_Plus_.at(ilayer)->Fill(hits.first.eta, hits.first.phi);
312  EtaPhi_Minus_.at(ilayer)->Fill(hits.first.eta, hits.first.phi);
313  }
314  } else {
315  if (verbosity_ > 0)
316  edm::LogVerbatim("HGCalValidation")
317  << "Problematic Hit for " << nameDetector_ << " at sector " << hits.first.sector << ":" << hits.first.sector2
318  << " layer " << hits.first.layer << " cell " << hits.first.cell << ":" << hits.first.cell2 << " energy "
319  << hits.second.etotal;
320  }
321 }
322 
323 void HGCalSimHitValidation::fillMuonTomoHistos(int partialType, std::pair<hitsinfo, energysum> hits) {
324  hitsinfo hinfo = hits.first;
325  energysum esum = hits.second;
326  double edep =
327  esum.eTime[0] * CLHEP::GeV /
328  CLHEP::keV; //index 0 and 1 corresponds to 25 ns and 1000 ns, respectively. In addititon, chaging energy loss unit to keV.
329 
330  unsigned int ilayer = hinfo.layer;
331  double x = hinfo.x * CLHEP::mm / CLHEP::cm; // chaging length unit to cm.
332  double y = hinfo.y * CLHEP::mm / CLHEP::cm;
333  if (ilayer < layers_) {
334  if (nameDetector_ == "HGCalEESensitive" or nameDetector_ == "HGCalHESiliconSensitive") {
335  // Fill the energy loss histograms for MIP
336  if (!TMath::AreEqualAbs(edep, 0.0, 1.e-5)) { //to avoid peak at zero due Eloss less than 10 mili eV.
337  if (hinfo.type == HGCSiliconDetId::HGCalFine) {
338  if (partialType == 0)
339  energyFWF_.at(ilayer)->Fill(edep);
340  if (partialType > 0)
341  energyPWF_.at(ilayer)->Fill(edep);
342  }
344  if (partialType == 0)
345  energyFWCN_.at(ilayer)->Fill(edep);
346  if (partialType > 0)
347  energyPWCN_.at(ilayer)->Fill(edep);
348  }
350  if (partialType == 0)
351  energyFWCK_.at(ilayer)->Fill(edep);
352  if (partialType > 0)
353  energyPWCK_.at(ilayer)->Fill(edep);
354  }
355  }
356 
357  // Fill the XY distribution of detector hits
358  if (hinfo.type == HGCSiliconDetId::HGCalFine)
359  hitXYFWF_.at(ilayer)->Fill(x, y);
360 
362  hitXYFWCN_.at(ilayer)->Fill(x, y);
363 
365  hitXYFWCK_.at(ilayer)->Fill(x, y);
366 
367  } //is Silicon
368  if (nameDetector_ == "HGCalHEScintillatorSensitive") {
369  hitXYB_.at(ilayer)->Fill(x, y);
370  } //is Scintillator
371  } //layer condition
372 }
373 
374 // ------------ method called when starting to processes a run ------------
376  hgcons_ = &iSetup.getData(tok_hgcal_);
377  layers_ = hgcons_->layers(false);
379  if (verbosity_ > 0)
380  edm::LogVerbatim("HGCalValidation") << nameDetector_ << " defined with " << layers_ << " Layers with first at "
381  << firstLayer_;
382 }
383 
385  iB.setCurrentFolder("HGCAL/HGCalSimHitsV/" + nameDetector_);
386 
387  std::ostringstream histoname;
388  for (unsigned int il = 0; il < layers_; ++il) {
389  int ilayer = firstLayer_ + static_cast<int>(il);
390  auto istr1 = std::to_string(ilayer);
391  while (istr1.size() < 2) {
392  istr1.insert(0, "0");
393  }
394  histoname.str("");
395  histoname << "HitOccupancy_Plus_layer_" << istr1;
396  HitOccupancy_Plus_.push_back(iB.book1D(histoname.str().c_str(), "HitOccupancy_Plus", 501, -0.5, 500.5));
397  histoname.str("");
398  histoname << "HitOccupancy_Minus_layer_" << istr1;
399  HitOccupancy_Minus_.push_back(iB.book1D(histoname.str().c_str(), "HitOccupancy_Minus", 501, -0.5, 500.5));
400 
401  histoname.str("");
402  histoname << "EtaPhi_Plus_"
403  << "layer_" << istr1;
404  EtaPhi_Plus_.push_back(iB.book2D(histoname.str().c_str(), "Occupancy", 31, 1.45, 3.0, 72, -CLHEP::pi, CLHEP::pi));
405  histoname.str("");
406  histoname << "EtaPhi_Minus_"
407  << "layer_" << istr1;
408  EtaPhi_Minus_.push_back(
409  iB.book2D(histoname.str().c_str(), "Occupancy", 31, -3.0, -1.45, 72, -CLHEP::pi, CLHEP::pi));
410 
411  for (unsigned int itimeslice = 0; itimeslice < nTimes_; itimeslice++) {
412  histoname.str("");
413  histoname << "energy_time_" << itimeslice << "_layer_" << istr1;
414  energy_[itimeslice].push_back(iB.book1D(histoname.str().c_str(), "energy_", 100, 0, 0.1));
415  }
416 
418  if ((nameDetector_ == "HGCalEESensitive") || (nameDetector_ == "HGCalHESiliconSensitive")) {
419  histoname.str("");
420  histoname << "energy_FullWafer_Fine_layer_" << istr1;
421  TH1F* hEdepFWF = createHisto(histoname.str(), 100, 0., 400., false);
422  histoSetting(hEdepFWF, "Eloss (keV)", "", kRed, kRed, 2);
423  energyFWF_.push_back(iB.book1D(histoname.str().c_str(), hEdepFWF));
424  hEdepFWF->Delete();
425 
426  histoname.str("");
427  histoname << "energy_FullWafer_CoarseThin_layer_" << istr1;
428  TH1F* hEdepFWCN = createHisto(histoname.str(), 100, 0., 400., false);
429  histoSetting(hEdepFWCN, "Eloss (keV)", "", kGreen + 1, kGreen + 1, 2);
430  energyFWCN_.push_back(iB.book1D(histoname.str().c_str(), hEdepFWCN));
431  hEdepFWCN->Delete();
432 
433  histoname.str("");
434  histoname << "energy_FullWafer_CoarseThick_layer_" << istr1;
435  TH1F* hEdepFWCK = createHisto(histoname.str(), 100, 0., 400., false);
436  histoSetting(hEdepFWCK, "Eloss (keV)", "", kMagenta, kMagenta, 2);
437  energyFWCK_.push_back(iB.book1D(histoname.str().c_str(), hEdepFWCK));
438  hEdepFWCK->Delete();
439  }
440 
442 
444  if ((nameDetector_ == "HGCalEESensitive") || (nameDetector_ == "HGCalHESiliconSensitive")) {
445  histoname.str("");
446  histoname << "energy_PartialWafer_Fine_layer_" << istr1;
447  TH1F* hEdepPWF = createHisto(histoname.str(), 100, 0., 400., false);
448  histoSetting(hEdepPWF, "Eloss (keV)", "", kRed, kRed, 2);
449  energyPWF_.push_back(iB.book1D(histoname.str().c_str(), hEdepPWF));
450  hEdepPWF->Delete();
451 
452  histoname.str("");
453  histoname << "energy_PartialWafer_CoarseThin_layer_" << istr1;
454  TH1F* hEdepPWCN = createHisto(histoname.str(), 100, 0., 400., false);
455  histoSetting(hEdepPWCN, "Eloss (keV)", "", kGreen + 1, kGreen + 1, 2);
456  energyPWCN_.push_back(iB.book1D(histoname.str().c_str(), hEdepPWCN));
457  hEdepPWCN->Delete();
458 
459  histoname.str("");
460  histoname << "energy_PartialWafer_CoarseThick_layer_" << istr1;
461  TH1F* hEdepPWCK = createHisto(histoname.str(), 100, 0., 400., false);
462  histoSetting(hEdepPWCK, "Eloss (keV)", "", kMagenta, kMagenta, 2);
463  energyPWCK_.push_back(iB.book1D(histoname.str().c_str(), hEdepPWCK));
464  hEdepPWCK->Delete();
465  }
467 
468  // ///////////// Histograms for the XY distribution of fired cells/scintillator tiles ///////////////
469  if ((nameDetector_ == "HGCalEESensitive") || (nameDetector_ == "HGCalHESiliconSensitive")) {
470  histoname.str("");
471  histoname << "hitXY_FullWafer_Fine_layer_" << istr1;
472  TH2F* hitXYFWF = new TH2F(
473  Form("hitXYFWF_%s", histoname.str().c_str()), histoname.str().c_str(), 100, -300., 300., 100, -300., 300.);
474  histoSetting(hitXYFWF, "x (cm)", "y (cm)", kRed, kRed);
475  hitXYFWF_.push_back(iB.book2D(histoname.str().c_str(), hitXYFWF));
476  hitXYFWF->Delete();
477 
478  histoname.str("");
479  histoname << "hitXY_FullWafer_CoarseThin_layer_" << istr1;
480  TH2F* hitXYFWCN = new TH2F(
481  Form("hitXYFWCN_%s", histoname.str().c_str()), histoname.str().c_str(), 100, -300., 300., 100, -300., 300.);
482  histoSetting(hitXYFWCN, "x (cm)", "y (cm)", kGreen + 1, kGreen + 1);
483  hitXYFWCN_.push_back(iB.book2D(histoname.str().c_str(), hitXYFWCN));
484  hitXYFWCN->Delete();
485 
486  histoname.str("");
487  histoname << "hitXY_FullWafer_CoarseThick_layer_" << istr1;
488  TH2F* hitXYFWCK = new TH2F(
489  Form("hitXYFWCK_%s", histoname.str().c_str()), histoname.str().c_str(), 100, -300., 300., 100, -300., 300.);
490  histoSetting(hitXYFWCK, "x (cm)", "y (cm)", kMagenta, kMagenta);
491  hitXYFWCK_.push_back(iB.book2D(histoname.str().c_str(), hitXYFWCK));
492  hitXYFWCK->Delete();
493  }
494 
495  if (nameDetector_ == "HGCalHEScintillatorSensitive") {
496  histoname.str("");
497  histoname << "hitXY_Scintillator_layer_" << istr1;
498  TH2F* hitXYB = new TH2F(
499  Form("hitXYB_%s", histoname.str().c_str()), histoname.str().c_str(), 100, -300., 300., 100, -300., 300.);
500  histoSetting(hitXYB, "x (cm)", "y (cm)", kBlue, kBlue);
501  hitXYB_.push_back(iB.book2D(histoname.str().c_str(), hitXYB));
502  hitXYB->Delete();
503  }
505  }
506  MeanHitOccupancy_Plus_ = iB.book1D("MeanHitOccupancy_Plus", "MeanHitOccupancy_Plus", layers_, 0.5, layers_ + 0.5);
507  MeanHitOccupancy_Minus_ = iB.book1D("MeanHitOccupancy_Minus", "MeanHitOccupancy_Minus", layers_, 0.5, layers_ + 0.5);
508 }
509 
511  std::string histname, const int nbins, float minIndexX, float maxIndexX, bool isLogX) {
512  TH1F* hist = nullptr;
513  if (isLogX) {
514  Double_t xbins[nbins + 1];
515  double dx = (maxIndexX - minIndexX) / nbins;
516  for (int i = 0; i <= nbins; i++) {
517  xbins[i] = TMath::Power(10, (minIndexX + i * dx));
518  }
519  hist = new TH1F(Form("hEdep_%s", histname.c_str()), histname.c_str(), nbins, xbins);
520  } else {
521  hist = new TH1F(Form("hEdep_%s", histname.c_str()), histname.c_str(), nbins, minIndexX, maxIndexX);
522  }
523  return hist;
524 }
525 
527  TH1F*& histo, const char* xTitle, const char* yTitle, Color_t lineColor, Color_t markerColor, int lineWidth) {
528  histo->SetStats();
529  histo->SetLineColor(lineColor);
530  histo->SetLineWidth(lineWidth);
531  histo->SetMarkerColor(markerColor);
532  histo->GetXaxis()->SetTitle(xTitle);
533  histo->GetYaxis()->SetTitle(yTitle);
534 }
535 
537  TH2F*& histo, const char* xTitle, const char* yTitle, Color_t lineColor, Color_t markerColor, int lineWidth) {
538  histo->SetStats();
539  histo->SetLineColor(lineColor);
540  histo->SetLineWidth(lineWidth);
541  histo->SetMarkerColor(markerColor);
542  histo->SetMarkerStyle(kFullCircle);
543  histo->SetMarkerSize(0.6);
544  histo->GetXaxis()->SetTitle(xTitle);
545  histo->GetYaxis()->SetTitle(yTitle);
546 }
548 //define this as a plug-in
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * MeanHitOccupancy_Plus_
double waferZ(int layer, bool reco) const
Log< level::Info, true > LogVerbatim
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::vector< MonitorElement * > HitOccupancy_Plus_
const double xbins[]
void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< double > times_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
bool waferHexagon8() const
void analyzeHits(std::vector< PCaloHit > &hits)
std::vector< MonitorElement * > energyPWF_
int zside(DetId const &)
std::vector< MonitorElement * > HitOccupancy_Minus_
int firstLayer() const
Log< level::Error, false > LogError
HGCalGeometryMode::GeometryMode geomMode() const
static std::string to_string(const XMLCh *ch)
MonitorElement * MeanHitOccupancy_Minus_
const Double_t pi
std::vector< MonitorElement * > energyPWCN_
const std::string nameDetector_
int iEvent
Definition: GenABIO.cc:224
std::vector< MonitorElement * > hitXYFWCK_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
static const unsigned int maxTime_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
TH1F * createHisto(std::string histname, const int nbins, float minIndexX, float maxIndexX, bool isLogX=true)
Transition
Definition: Transition.h:12
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
unsigned int layers(bool reco) const
std::vector< MonitorElement * > energyFWF_
bool tileTrapezoid() const
std::vector< MonitorElement * > EtaPhi_Plus_
std::pair< float, float > locateCellTrap(int zside, int lay, int ieta, int iphi, bool reco, bool debug) const
std::vector< MonitorElement * > energyFWCN_
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
HGCalSimHitValidation(const edm::ParameterSet &)
~HGCalSimHitValidation() override=default
const edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
std::vector< MonitorElement * > energyFWCK_
std::vector< MonitorElement * > hitXYFWF_
const std::string caloHitSource_
part
Definition: HCALResponse.h:20
std::vector< MonitorElement * > energyPWCK_
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:212
int waferType(DetId const &id, bool fromFile) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
bool isValid() const
Definition: HandleBase.h:70
std::vector< MonitorElement * > energy_[maxTime_]
HLT enums.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void histoSetting(TH1F *&histo, const char *xTitle, const char *yTitle="", Color_t lineColor=kBlack, Color_t markerColor=kBlack, int linewidth=1)
const HGCalDDDConstants * hgcons_
std::vector< MonitorElement * > EtaPhi_Minus_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::vector< MonitorElement * > hitXYFWCN_
void fillMuonTomoHistos(int partialType, std::pair< hitsinfo, energysum > hit_)
std::vector< MonitorElement * > hitXYB_
void fillHitsInfo(std::pair< hitsinfo, energysum > hit_, unsigned int itimeslice, double esum)
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > tok_hgcal_
Definition: Run.h:45