CMS 3D CMS Logo

Phase2TrackerMonitorDigi.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Phase2TrackerMonitorDigi
4 // Class: Phase2TrackerMonitorDigi
5 //
11 //
12 // Author: Suchandra Dutta, Gourab Saha, Suvankar Roy Chowdhury, Subir Sarkar
13 // Date: January 29, 2016
14 // Date: November 8, 2019 (Modified for adding in phase2 DQM Offline)
15 //
16 // system include files
17 
18 #include <memory>
19 
21 
24 
28 
34 
40 
41 // DQM Histograming
43 
44 //
45 // constructors
46 //
48  : config_(iConfig),
49  pixelFlag_(config_.getParameter<bool>("PixelPlotFillingFlag")),
50  geomType_(config_.getParameter<std::string>("GeometryType")),
51  otDigiSrc_(config_.getParameter<edm::InputTag>("OuterTrackerDigiSource")),
52  itPixelDigiSrc_(config_.getParameter<edm::InputTag>("InnerPixelDigiSource")),
53  otDigiToken_(consumes<edm::DetSetVector<Phase2TrackerDigi>>(otDigiSrc_)),
54  itPixelDigiToken_(consumes<edm::DetSetVector<PixelDigi>>(itPixelDigiSrc_)) {
55  edm::LogInfo("Phase2TrackerMonitorDigi") << ">>> Construct Phase2TrackerMonitorDigi ";
56 }
57 
58 //
59 // destructor
60 //
62  // do anything here that needs to be done at desctruction time
63  // (e.g. close files, deallocate resources etc.)
64  edm::LogInfo("Phase2TrackerMonitorDigi") << ">>> Destroy Phase2TrackerMonitorDigi ";
65 }
66 
67 // -- Analyze
68 //
70  using namespace edm;
71 
72  // Get digis
74  iEvent.getByToken(itPixelDigiToken_, pixDigiHandle);
75 
77  iEvent.getByToken(otDigiToken_, otDigiHandle);
78 
79  // Tracker Topology
81 
82  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
83  if (theTkDigiGeomWatcher.check(iSetup)) {
85  iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geomHandle);
86 
87  if (pixelFlag_)
88  fillITPixelDigiHistos(pixDigiHandle, geomHandle);
89  else
90  fillOTDigiHistos(otDigiHandle, geomHandle);
91  }
92 }
94  const edm::ESHandle<TrackerGeometry> gHandle) {
95  const edm::DetSetVector<PixelDigi>* digis = handle.product();
96 
97  const TrackerTopology* tTopo = tTopoHandle_.product();
98  const TrackerGeometry* tGeom = gHandle.product();
99 
100  for (typename edm::DetSetVector<PixelDigi>::const_iterator DSViter = digis->begin(); DSViter != digis->end();
101  DSViter++) {
102  unsigned int rawid = DSViter->id;
103  edm::LogInfo("Phase2TrackerMonitorDigi") << " Det Id = " << rawid;
104  int layer = tTopo->getITPixelLayerNumber(rawid);
105  if (layer < 0)
106  continue;
107  std::map<uint32_t, DigiMEs>::iterator pos = layerMEs.find(layer);
108  if (pos == layerMEs.end())
109  continue;
110 
111  const DetId detId(rawid);
112 
113  if (DetId(detId).det() != DetId::Detector::Tracker)
114  continue;
115 
116  const GeomDetUnit* gDetUnit = tGeom->idToDetUnit(detId);
117  const GeomDet* geomDet = tGeom->idToDet(detId);
118 
119  const Phase2TrackerGeomDetUnit* tkDetUnit = dynamic_cast<const Phase2TrackerGeomDetUnit*>(gDetUnit);
120  int nRows = tkDetUnit->specificTopology().nrows();
121  int nColumns = tkDetUnit->specificTopology().ncolumns();
122  if (nRows * nColumns == 0)
123  continue;
124 
125  DigiMEs& local_mes = pos->second;
126 
127  local_mes.nHitDetsPerLayer++;
128 
129  int nDigi = 0;
130  int row_last = -1;
131  int col_last = -1;
132  int nclus = 0;
133  int width = 1;
134  int position = 0;
135  std::vector<int> charges;
136  for (typename edm::DetSet<PixelDigi>::const_iterator di = DSViter->begin(); di != DSViter->end(); di++) {
137  int col = di->column(); // column
138  int row = di->row(); // row
139  int adc = di->adc(); // digi charge
140  if (geomDet) {
141  MeasurementPoint mp(row + 0.5, col + 0.5);
142  GlobalPoint pdPos = geomDet->surface().toGlobal(gDetUnit->topology().localPosition(mp));
143  if (XYPositionMap)
144  XYPositionMap->Fill(pdPos.x() * 10., pdPos.y() * 10.);
145  if (RZPositionMap)
146  RZPositionMap->Fill(pdPos.z() * 10., std::hypot(pdPos.x(), pdPos.y()) * 10.);
147  }
148  nDigi++;
149  edm::LogInfo("Phase2TrackerMonitorDigi") << " column " << col << " row " << row << std::dec << std::endl;
150  if (local_mes.ChargeXYMap)
151  local_mes.ChargeXYMap->Fill(col, row, adc);
152  if (local_mes.PositionOfDigisP)
153  local_mes.PositionOfDigisP->Fill(row + 1, col + 1);
154  if (local_mes.ChargeOfDigis)
155  local_mes.ChargeOfDigis->Fill(adc);
156  if (row_last == -1) {
157  position = row + 1;
158  nclus++;
159  charges.push_back(adc);
160  } else {
161  if (abs(row - row_last) == 1 && col == col_last) {
162  position += row + 1;
163  width++;
164  charges.push_back(adc);
165  } else {
166  position /= width;
167  if (local_mes.ClusterWidth)
168  local_mes.ClusterWidth->Fill(width);
169  if (local_mes.ClusterPositionP)
170  local_mes.ClusterPositionP->Fill(position, col + 1);
171  for (auto v : charges)
172  if (local_mes.ChargeOfDigisVsWidth)
173  local_mes.ChargeOfDigisVsWidth->Fill(v, width);
174  charges.clear();
175  charges.push_back(adc);
176  width = 1;
177  position = row + 1;
178  nclus++;
179  }
180  }
181  edm::LogInfo("Phase2TrackerMonitorDigi") << " row " << row << " col " << col << " row_last " << row_last
182  << " col_last " << col_last << " width " << width;
183  row_last = row;
184  col_last = col;
185  }
186  if (local_mes.NumberOfClustersPerDet)
187  local_mes.NumberOfClustersPerDet->Fill(nclus);
188  if (local_mes.NumberOfDigisPerDet)
189  local_mes.NumberOfDigisPerDet->Fill(nDigi);
190  local_mes.nDigiPerLayer += nDigi;
191  float occupancy = 1.0;
192  if (nRows * nColumns > 0)
193  occupancy = nDigi * 1.0 / (nRows * nColumns);
194  if (geomDet) {
195  GlobalPoint gp = geomDet->surface().toGlobal(
196  gDetUnit->topology().localPosition(MeasurementPoint(nRows / 2.0, nColumns / 2.0)));
197  if (XYOccupancyMap)
198  XYOccupancyMap->Fill(gp.x() * 10., gp.y() * 10, occupancy);
199  if (RZOccupancyMap)
200  RZOccupancyMap->Fill(gp.z() * 10., std::hypot(gp.x(), gp.y()) * 10., occupancy);
201  if (local_mes.EtaOccupancyProfP)
202  local_mes.EtaOccupancyProfP->Fill(gp.eta(), occupancy);
203  }
204 
205  if (local_mes.DigiOccupancyP)
206  local_mes.DigiOccupancyP->Fill(occupancy);
207  }
208  // Fill histograms after loop over digis are complete
209  for (auto& ilayer : layerMEs) {
210  DigiMEs& local_mes = ilayer.second;
211  if (local_mes.TotalNumberOfDigisPerLayer)
212  local_mes.TotalNumberOfDigisPerLayer->Fill(local_mes.nDigiPerLayer);
213  if (local_mes.NumberOfHitDetectorsPerLayer)
214  local_mes.NumberOfHitDetectorsPerLayer->Fill(local_mes.nHitDetsPerLayer);
215  local_mes.nDigiPerLayer = 0;
216  local_mes.nHitDetsPerLayer = 0;
217  }
218 }
220  const edm::ESHandle<TrackerGeometry> gHandle) {
221  const edm::DetSetVector<Phase2TrackerDigi>* digis = handle.product();
222 
223  const TrackerTopology* tTopo = tTopoHandle_.product();
224  const TrackerGeometry* tGeom = gHandle.product();
225 
226  for (typename edm::DetSetVector<Phase2TrackerDigi>::const_iterator DSViter = digis->begin(); DSViter != digis->end();
227  DSViter++) {
228  unsigned int rawid = DSViter->id;
229  DetId detId(rawid);
230  edm::LogInfo("Phase2TrackerMonitorDigi") << " Det Id = " << rawid;
231  int layer = tTopo->getOTLayerNumber(rawid);
232  if (layer < 0)
233  continue;
234  std::map<uint32_t, DigiMEs>::iterator pos = layerMEs.find(layer);
235  if (pos == layerMEs.end())
236  continue;
237  DigiMEs& local_mes = pos->second;
238 
239  local_mes.nHitDetsPerLayer++;
240  if (DetId(detId).det() != DetId::Detector::Tracker)
241  continue;
242 
243  const GeomDetUnit* gDetUnit = tGeom->idToDetUnit(detId);
244  const GeomDet* geomDet = tGeom->idToDet(detId);
245 
246  const Phase2TrackerGeomDetUnit* tkDetUnit = dynamic_cast<const Phase2TrackerGeomDetUnit*>(gDetUnit);
247  int nRows = tkDetUnit->specificTopology().nrows();
248  int nColumns = tkDetUnit->specificTopology().ncolumns();
249  if (nRows * nColumns == 0)
250  continue;
251 
252  int nDigi = 0;
253  int row_last = -1;
254  int col_last = -1;
255  int nclus = 0;
256  int width = 1;
257  int position = 0;
258  float frac_ot = 0.;
259  for (typename edm::DetSet<Phase2TrackerDigi>::const_iterator di = DSViter->begin(); di != DSViter->end(); di++) {
260  int col = di->column(); // column
261  int row = di->row(); // row
262  const DetId detId(rawid);
263 
264  if (geomDet) {
265  MeasurementPoint mp(row + 0.5, col + 0.5);
266  GlobalPoint pdPos = geomDet->surface().toGlobal(gDetUnit->topology().localPosition(mp));
267  if (XYPositionMap)
268  XYPositionMap->Fill(pdPos.x() * 10., pdPos.y() * 10.);
269  if (RZPositionMap)
270  RZPositionMap->Fill(pdPos.z() * 10., std::hypot(pdPos.x(), pdPos.y()) * 10.);
271  }
272  nDigi++;
273  if (di->overThreshold())
274  frac_ot++;
275  edm::LogInfo("Phase2TrackerMonitorDigi") << " column " << col << " row " << row << std::dec << std::endl;
276  if (nColumns > 2 && local_mes.PositionOfDigisP)
277  local_mes.PositionOfDigisP->Fill(row + 1, col + 1);
278  if (nColumns <= 2 && local_mes.PositionOfDigisS)
279  local_mes.PositionOfDigisS->Fill(row + 1, col + 1);
280 
281  if (row_last == -1) {
282  position = row + 1;
283  nclus++;
284  } else {
285  if (abs(row - row_last) == 1 && col == col_last) {
286  position += row + 1;
287  width++;
288  } else {
289  position /= width;
290  if (local_mes.ClusterWidth)
291  local_mes.ClusterWidth->Fill(width);
292  if (local_mes.ClusterPositionP && nColumns > 2)
293  local_mes.ClusterPositionP->Fill(position, col + 1);
294  if (local_mes.ClusterPositionS && nColumns <= 2)
295  local_mes.ClusterPositionS->Fill(position, col + 1);
296 
297  width = 1;
298  position = row + 1;
299  nclus++;
300  }
301  }
302  edm::LogInfo("Phase2TrackerMonitorDigi") << " row " << row << " col " << col << " row_last " << row_last
303  << " col_last " << col_last << " width " << width;
304  row_last = row;
305  col_last = col;
306  }
307  if (local_mes.NumberOfClustersPerDet)
308  local_mes.NumberOfClustersPerDet->Fill(nclus);
309  if (local_mes.NumberOfDigisPerDet)
310  local_mes.NumberOfDigisPerDet->Fill(nDigi);
311  local_mes.nDigiPerLayer += nDigi;
312  if (nDigi)
313  frac_ot /= nDigi;
314  if (local_mes.FractionOfOvTBits && nColumns <= 2)
315  local_mes.FractionOfOvTBits->Fill(frac_ot);
316 
317  float occupancy = 1.0;
318  if (nRows * nColumns > 0)
319  occupancy = nDigi * 1.0 / (nRows * nColumns);
320  if (geomDet) {
321  GlobalPoint gp = geomDet->surface().toGlobal(gDetUnit->topology().localPosition(MeasurementPoint(0.0, 0.0)));
322  if (XYOccupancyMap)
323  XYOccupancyMap->Fill(gp.x() * 10., gp.y() * 10., occupancy);
324  if (RZOccupancyMap)
325  RZOccupancyMap->Fill(gp.z() * 10., std::hypot(gp.x(), gp.y()) * 10., occupancy);
326  if (nColumns > 2) {
327  if (local_mes.DigiOccupancyP)
328  local_mes.DigiOccupancyP->Fill(occupancy);
329  if (local_mes.EtaOccupancyProfP)
330  local_mes.EtaOccupancyProfP->Fill(gp.eta(), occupancy);
331  } else {
332  if (local_mes.DigiOccupancyS)
333  local_mes.DigiOccupancyS->Fill(occupancy);
334  if (local_mes.EtaOccupancyProfS)
335  local_mes.EtaOccupancyProfS->Fill(gp.eta(), occupancy);
336  if (local_mes.FractionOfOvTBitsVsEta)
337  local_mes.FractionOfOvTBitsVsEta->Fill(gp.eta(), frac_ot);
338  }
339  }
340  }
341  // Fill histograms after loop over digis are complete
342  for (auto& ilayer : layerMEs) {
343  DigiMEs& local_mes = ilayer.second;
344  if (local_mes.TotalNumberOfDigisPerLayer)
345  local_mes.TotalNumberOfDigisPerLayer->Fill(local_mes.nDigiPerLayer);
346  if (local_mes.NumberOfHitDetectorsPerLayer)
347  local_mes.NumberOfHitDetectorsPerLayer->Fill(local_mes.nHitDetsPerLayer);
348  local_mes.nDigiPerLayer = 0;
349  local_mes.nHitDetsPerLayer = 0;
350  }
351 }
352 //
353 // -- Book Histograms
354 //
356  edm::Run const& iRun,
357  edm::EventSetup const& iSetup) {
358  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
359  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
360 
362  const TrackerTopology* const tTopo = tTopoHandle_.product();
363 
364  if (theTkDigiGeomWatcher.check(iSetup)) {
365  edm::ESHandle<TrackerGeometry> geom_handle;
366  iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geom_handle);
367  const TrackerGeometry* tGeom = geom_handle.product();
368  for (auto const& det_u : tGeom->detUnits()) {
369  unsigned int detId_raw = det_u->geographicalId().rawId();
370  bookLayerHistos(ibooker, detId_raw, tTopo);
371  }
372  }
373  ibooker.cd();
374  std::stringstream folder_name;
375  folder_name << top_folder << "/"
376  << "DigiMonitor";
377  ibooker.setCurrentFolder(folder_name.str());
378 
380  edm::ParameterSet ParametersOcc = config_.getParameter<edm::ParameterSet>("DigiOccupancyPH");
381  if (Parameters.getParameter<bool>("switch"))
382  XYPositionMap = ibooker.book2D("DigiXPosVsYPos",
383  "DigiXPosVsYPos",
384  Parameters.getParameter<int32_t>("Nxbins"),
385  Parameters.getParameter<double>("xmin"),
386  Parameters.getParameter<double>("xmax"),
387  Parameters.getParameter<int32_t>("Nybins"),
388  Parameters.getParameter<double>("ymin"),
389  Parameters.getParameter<double>("ymax"));
390  else
391  XYPositionMap = nullptr;
392 
393  if (Parameters.getParameter<bool>("switch") && ParametersOcc.getParameter<bool>("switch"))
394  XYOccupancyMap = ibooker.bookProfile2D("OccupancyInXY",
395  "OccupancyInXY",
396  Parameters.getParameter<int32_t>("Nxbins"),
397  Parameters.getParameter<double>("xmin"),
398  Parameters.getParameter<double>("xmax"),
399  Parameters.getParameter<int32_t>("Nybins"),
400  Parameters.getParameter<double>("ymin"),
401  Parameters.getParameter<double>("ymax"),
402  ParametersOcc.getParameter<double>("xmin"),
403  ParametersOcc.getParameter<double>("xmax"));
404  else
405  XYOccupancyMap = nullptr;
406 
407  Parameters = config_.getParameter<edm::ParameterSet>("RZPositionMapH");
408  if (Parameters.getParameter<bool>("switch"))
409  RZPositionMap = ibooker.book2D("DigiRPosVsZPos",
410  "DigiRPosVsZPos",
411  Parameters.getParameter<int32_t>("Nxbins"),
412  Parameters.getParameter<double>("xmin"),
413  Parameters.getParameter<double>("xmax"),
414  Parameters.getParameter<int32_t>("Nybins"),
415  Parameters.getParameter<double>("ymin"),
416  Parameters.getParameter<double>("ymax"));
417  else
418  RZPositionMap = nullptr;
419 
420  if (Parameters.getParameter<bool>("switch") && ParametersOcc.getParameter<bool>("switch"))
421  RZOccupancyMap = ibooker.bookProfile2D("OccupancyInRZ",
422  "OccupancyInRZ",
423  Parameters.getParameter<int32_t>("Nxbins"),
424  Parameters.getParameter<double>("xmin"),
425  Parameters.getParameter<double>("xmax"),
426  Parameters.getParameter<int32_t>("Nybins"),
427  Parameters.getParameter<double>("ymin"),
428  Parameters.getParameter<double>("ymax"),
429  ParametersOcc.getParameter<double>("xmin"),
430  ParametersOcc.getParameter<double>("xmax"));
431  else
432  RZOccupancyMap = nullptr;
433 }
434 //
435 // -- Book Layer Histograms
436 //
438  unsigned int det_id,
439  const TrackerTopology* tTopo) {
440  int layer;
441  if (pixelFlag_)
442  layer = tTopo->getITPixelLayerNumber(det_id);
443  else
444  layer = tTopo->getOTLayerNumber(det_id);
445 
446  if (layer < 0)
447  return;
448  std::map<uint32_t, DigiMEs>::iterator pos = layerMEs.find(layer);
449  if (pos == layerMEs.end()) {
450  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
451  std::stringstream folder_name;
452 
453  // initialise Histograms
454  std::ostringstream fname1, fname2, tag;
455  int side = 0;
456  int idisc = 0;
457  if (layer < 100) {
458  fname1 << "Barrel";
459  fname2 << "Layer_" << layer;
460  } else {
461  side = layer / 100;
462  idisc = layer - side * 100;
463  fname1 << "EndCap_Side_" << side;
464  fname2 << "Disc_" << idisc;
465  }
466 
467  ibooker.cd();
468  folder_name << top_folder << "/"
469  << "DigiMonitor"
470  << "/" << fname1.str() << "/" << fname2.str();
471  ibooker.setCurrentFolder(folder_name.str());
472 
473  edm::LogInfo("Phase2TrackerMonitorDigi") << " Booking Histograms in : " << folder_name.str();
474 
475  std::ostringstream HistoName;
476  DigiMEs local_mes;
477 
478  local_mes.nDigiPerLayer = 0;
479  local_mes.nHitDetsPerLayer = 0;
480 
482  edm::ParameterSet EtaParameters = config_.getParameter<edm::ParameterSet>("EtaH");
483  HistoName.str("");
484  HistoName << "NumberOfDigisPerDet_" << fname2.str();
485  if (Parameters.getParameter<bool>("switch"))
486  local_mes.NumberOfDigisPerDet = ibooker.book1D(HistoName.str(),
487  HistoName.str(),
488  Parameters.getParameter<int32_t>("Nbins"),
489  Parameters.getParameter<double>("xmin"),
490  Parameters.getParameter<double>("xmax"));
491  else
492  local_mes.NumberOfDigisPerDet = nullptr;
493 
494  if (pixelFlag_ || (layer < 4 || layer > 6)) {
495  Parameters = config_.getParameter<edm::ParameterSet>("DigiOccupancyPH");
496  HistoName.str("");
497  HistoName << "DigiOccupancyP_" << fname2.str();
498  if (Parameters.getParameter<bool>("switch"))
499  local_mes.DigiOccupancyP = ibooker.book1D(HistoName.str(),
500  HistoName.str(),
501  Parameters.getParameter<int32_t>("Nbins"),
502  Parameters.getParameter<double>("xmin"),
503  Parameters.getParameter<double>("xmax"));
504  else
505  local_mes.DigiOccupancyP = nullptr;
506 
507  HistoName.str("");
508  HistoName << "DigiOccupancyVsEtaP_" << fname2.str();
509  if (Parameters.getParameter<bool>("switch") && EtaParameters.getParameter<bool>("switch"))
510  local_mes.EtaOccupancyProfP = ibooker.bookProfile(HistoName.str(),
511  HistoName.str(),
512  EtaParameters.getParameter<int32_t>("Nbins"),
513  EtaParameters.getParameter<double>("xmin"),
514  EtaParameters.getParameter<double>("xmax"),
515  Parameters.getParameter<double>("xmin"),
516  Parameters.getParameter<double>("xmax"),
517  "");
518  else
519  local_mes.EtaOccupancyProfP = nullptr;
520 
521  Parameters = config_.getParameter<edm::ParameterSet>("PositionOfDigisPH");
522  HistoName.str("");
523  HistoName << "PositionOfDigisP_" << fname2.str().c_str();
524  if (Parameters.getParameter<bool>("switch"))
525  local_mes.PositionOfDigisP = ibooker.book2D(HistoName.str(),
526  HistoName.str(),
527  Parameters.getParameter<int32_t>("Nxbins"),
528  Parameters.getParameter<double>("xmin"),
529  Parameters.getParameter<double>("xmax"),
530  Parameters.getParameter<int32_t>("Nybins"),
531  Parameters.getParameter<double>("ymin"),
532  Parameters.getParameter<double>("ymax"));
533  else
534  local_mes.PositionOfDigisP = nullptr;
535 
536  Parameters = config_.getParameter<edm::ParameterSet>("ClusterPositionPH");
537  HistoName.str("");
538  HistoName << "ClusterPositionP_" << fname2.str();
539  if (Parameters.getParameter<bool>("switch"))
540  local_mes.ClusterPositionP = ibooker.book2D(HistoName.str(),
541  HistoName.str(),
542  Parameters.getParameter<int32_t>("Nxbins"),
543  Parameters.getParameter<double>("xmin"),
544  Parameters.getParameter<double>("xmax"),
545  Parameters.getParameter<int32_t>("Nybins"),
546  Parameters.getParameter<double>("ymin"),
547  Parameters.getParameter<double>("ymax"));
548  else
549  local_mes.ClusterPositionP = nullptr;
550  }
551 
553  HistoName.str("");
554  HistoName << "ChargeXYMap_" << fname2.str().c_str();
555  if (Parameters.getParameter<bool>("switch"))
556  local_mes.ChargeXYMap = ibooker.book2D(HistoName.str(),
557  HistoName.str(),
558  Parameters.getParameter<int32_t>("Nxbins"),
559  Parameters.getParameter<double>("xmin"),
560  Parameters.getParameter<double>("xmax"),
561  Parameters.getParameter<int32_t>("Nybins"),
562  Parameters.getParameter<double>("ymin"),
563  Parameters.getParameter<double>("ymax"));
564  else
565  local_mes.ChargeXYMap = nullptr;
566 
567  Parameters = config_.getParameter<edm::ParameterSet>("TotalNumberOfDigisPerLayerH");
568  HistoName.str("");
569  HistoName << "TotalNumberOfDigisPerLayer_" << fname2.str();
570  if (Parameters.getParameter<bool>("switch"))
571  local_mes.TotalNumberOfDigisPerLayer = ibooker.book1D(HistoName.str(),
572  HistoName.str(),
573  Parameters.getParameter<int32_t>("Nbins"),
574  Parameters.getParameter<double>("xmin"),
575  Parameters.getParameter<double>("xmax"));
576  else
577  local_mes.TotalNumberOfDigisPerLayer = nullptr;
578 
579  Parameters = config_.getParameter<edm::ParameterSet>("NumberOfHitDetsPerLayerH");
580  HistoName.str("");
581  HistoName << "NumberOfHitDetectorsPerLayer_" << fname2.str();
582  if (Parameters.getParameter<bool>("switch"))
583  local_mes.NumberOfHitDetectorsPerLayer = ibooker.book1D(HistoName.str(),
584  HistoName.str(),
585  Parameters.getParameter<int32_t>("Nbins"),
586  Parameters.getParameter<double>("xmin"),
587  Parameters.getParameter<double>("xmax"));
588  else
589  local_mes.NumberOfHitDetectorsPerLayer = nullptr;
590 
591  Parameters = config_.getParameter<edm::ParameterSet>("NumberOfClustersPerDetH");
592  HistoName.str("");
593  HistoName << "NumberOfClustersPerDet_" << fname2.str();
594  if (Parameters.getParameter<bool>("switch"))
595  local_mes.NumberOfClustersPerDet = ibooker.book1D(HistoName.str(),
596  HistoName.str(),
597  Parameters.getParameter<int32_t>("Nbins"),
598  Parameters.getParameter<double>("xmin"),
599  Parameters.getParameter<double>("xmax"));
600  else
601  local_mes.NumberOfClustersPerDet = nullptr;
602 
603  Parameters = config_.getParameter<edm::ParameterSet>("ClusterWidthH");
604  HistoName.str("");
605  HistoName << "ClusterWidth_" << fname2.str();
606  if (Parameters.getParameter<bool>("switch"))
607  local_mes.ClusterWidth = ibooker.book1D(HistoName.str(),
608  HistoName.str(),
609  Parameters.getParameter<int32_t>("Nbins"),
610  Parameters.getParameter<double>("xmin"),
611  Parameters.getParameter<double>("xmax"));
612  else
613  local_mes.ClusterWidth = nullptr;
614 
615  if (!pixelFlag_) {
616  Parameters = config_.getParameter<edm::ParameterSet>("DigiOccupancySH");
617  HistoName.str("");
618  HistoName << "DigiOccupancyS_" << fname2.str();
619  if (Parameters.getParameter<bool>("switch"))
620  local_mes.DigiOccupancyS = ibooker.book1D(HistoName.str(),
621  HistoName.str(),
622  Parameters.getParameter<int32_t>("Nbins"),
623  Parameters.getParameter<double>("xmin"),
624  Parameters.getParameter<double>("xmax"));
625  else
626  local_mes.DigiOccupancyS = nullptr;
627 
628  HistoName.str("");
629  HistoName << "DigiOccupancyVsEtaS_" << fname2.str();
630  if (Parameters.getParameter<bool>("switch") && EtaParameters.getParameter<bool>("switch"))
631  local_mes.EtaOccupancyProfS = ibooker.bookProfile(HistoName.str(),
632  HistoName.str(),
633  EtaParameters.getParameter<int32_t>("Nbins"),
634  EtaParameters.getParameter<double>("xmin"),
635  EtaParameters.getParameter<double>("xmax"),
636  Parameters.getParameter<double>("xmin"),
637  Parameters.getParameter<double>("xmax"),
638  "");
639  else
640  local_mes.EtaOccupancyProfS = nullptr;
641 
642  HistoName.str("");
643  HistoName << "FractionOfOverThresholdDigis_" << fname2.str();
644  local_mes.FractionOfOvTBits = ibooker.book1D(HistoName.str(), HistoName.str(), 11, -0.05, 1.05);
645 
646  Parameters = config_.getParameter<edm::ParameterSet>("NumberOfDigisPerDetH");
647  HistoName.str("");
648  HistoName << "FractionOfOverThresholdDigisVaEta_" << fname2.str();
649  if (Parameters.getParameter<bool>("switch") && EtaParameters.getParameter<bool>("switch"))
650  local_mes.FractionOfOvTBitsVsEta = ibooker.bookProfile(HistoName.str(),
651  HistoName.str(),
652  EtaParameters.getParameter<int32_t>("Nbins"),
653  EtaParameters.getParameter<double>("xmin"),
654  EtaParameters.getParameter<double>("xmax"),
655  Parameters.getParameter<double>("xmin"),
656  Parameters.getParameter<double>("xmax"),
657  "");
658  else
659  local_mes.FractionOfOvTBitsVsEta = nullptr;
660 
661  Parameters = config_.getParameter<edm::ParameterSet>("ClusterPositionSH");
662  HistoName.str("");
663  HistoName << "ClusterPositionS_" << fname2.str();
664  if (Parameters.getParameter<bool>("switch"))
665  local_mes.ClusterPositionS = ibooker.book2D(HistoName.str(),
666  HistoName.str(),
667  Parameters.getParameter<int32_t>("Nxbins"),
668  Parameters.getParameter<double>("xmin"),
669  Parameters.getParameter<double>("xmax"),
670  Parameters.getParameter<int32_t>("Nybins"),
671  Parameters.getParameter<double>("ymin"),
672  Parameters.getParameter<double>("ymax"));
673  else
674  local_mes.ClusterPositionS = nullptr;
675 
676  Parameters = config_.getParameter<edm::ParameterSet>("PositionOfDigisSH");
677  HistoName.str("");
678  HistoName << "PositionOfDigisS_" << fname2.str().c_str();
679  if (Parameters.getParameter<bool>("switch"))
680  local_mes.PositionOfDigisS = ibooker.book2D(HistoName.str(),
681  HistoName.str(),
682  Parameters.getParameter<int32_t>("Nxbins"),
683  Parameters.getParameter<double>("xmin"),
684  Parameters.getParameter<double>("xmax"),
685  Parameters.getParameter<int32_t>("Nybins"),
686  Parameters.getParameter<double>("ymin"),
687  Parameters.getParameter<double>("ymax"));
688  else
689  local_mes.PositionOfDigisS = nullptr;
690  } else {
692  HistoName.str("");
693  HistoName << "ChargeOfDigis_" << fname2.str();
694  if (Parameters.getParameter<bool>("switch"))
695  local_mes.ChargeOfDigis = ibooker.book1D(HistoName.str(),
696  HistoName.str(),
697  Parameters.getParameter<int32_t>("Nbins"),
698  Parameters.getParameter<double>("xmin"),
699  Parameters.getParameter<double>("xmax"));
700  else
701  local_mes.ChargeOfDigis = nullptr;
702 
703  edm::ParameterSet WidthParameters = config_.getParameter<edm::ParameterSet>("ClusterWidthH");
704  HistoName.str("");
705  HistoName << "ChargeOfDigisVsWidth_" << fname2.str();
706  if (Parameters.getParameter<bool>("switch") && WidthParameters.getParameter<bool>("switch"))
707  local_mes.ChargeOfDigisVsWidth = ibooker.book2D(HistoName.str(),
708  HistoName.str(),
709  Parameters.getParameter<int32_t>("Nbins"),
710  Parameters.getParameter<double>("xmin"),
711  Parameters.getParameter<double>("xmax"),
712  WidthParameters.getParameter<int32_t>("Nbins"),
713  WidthParameters.getParameter<double>("xmin"),
714  WidthParameters.getParameter<double>("xmax"));
715  else
716  local_mes.ChargeOfDigisVsWidth = nullptr;
717  }
718 
719  layerMEs.insert(std::make_pair(layer, local_mes));
720  }
721 }
722 //define this as a plug-in
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
Phase2TrackerMonitorDigi::DigiMEs::PositionOfDigisS
MonitorElement * PositionOfDigisS
Definition: Phase2TrackerMonitorDigi.h:31
edm::DetSetVector
Definition: DetSetVector.h:61
Point2DBase
Definition: Point2DBase.h:9
PixelDigiCollection.h
Phase2TrackerMonitorDigi::otDigiToken_
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
Definition: Phase2TrackerMonitorDigi.h:67
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
CosmicGenFilterHelix_cfi.charges
charges
only generated particles of these IDs are considered
Definition: CosmicGenFilterHelix_cfi.py:6
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:372
MessageLogger.h
TrackerGeometry.h
Phase2TrackerMonitorDigi::config_
edm::ParameterSet config_
Definition: Phase2TrackerMonitorDigi.h:60
GeomDet
Definition: GeomDet.h:27
Phase2TrackerMonitorDigi::fillOTDigiHistos
void fillOTDigiHistos(const edm::Handle< edm::DetSetVector< Phase2TrackerDigi >> handle, const edm::ESHandle< TrackerGeometry > gHandle)
Definition: Phase2TrackerMonitorDigi.cc:219
Phase2TrackerMonitorDigi::RZOccupancyMap
MonitorElement * RZOccupancyMap
Definition: Phase2TrackerMonitorDigi.h:51
edm::ESWatcher< TrackerDigiGeometryRecord >
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
Phase2TrackerMonitorDigi::DigiMEs::TotalNumberOfDigisPerLayer
MonitorElement * TotalNumberOfDigisPerLayer
Definition: Phase2TrackerMonitorDigi.h:34
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
patZpeak.handle
handle
Definition: patZpeak.py:23
edm::Run
Definition: Run.h:45
TrackerTopology::getITPixelLayerNumber
int getITPixelLayerNumber(const DetId &id) const
Definition: TrackerTopology.cc:436
TrackerTopology::getOTLayerNumber
int getOTLayerNumber(const DetId &id) const
Definition: TrackerTopology.cc:421
edm
HLT enums.
Definition: AlignableModifier.h:19
Phase2TrackerMonitorDigi::DigiMEs::ChargeXYMap
MonitorElement * ChargeXYMap
Definition: Phase2TrackerMonitorDigi.h:29
TrackerTopology
Definition: TrackerTopology.h:16
dqm::implementation::IBooker::bookProfile2D
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
Phase2TrackerMonitorDigi.h
cuy.col
col
Definition: cuy.py:1010
pos
Definition: PixelAliasList.h:18
Phase2TrackerMonitorDigi::geomType_
std::string geomType_
Definition: Phase2TrackerMonitorDigi.h:64
edm::LogInfo
Definition: MessageLogger.h:254
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
PixelDigi
Definition: PixelDigi.h:14
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
Phase2TrackerMonitorDigi::DigiMEs::EtaOccupancyProfS
MonitorElement * EtaOccupancyProfS
Definition: Phase2TrackerMonitorDigi.h:43
Phase2TrackerMonitorDigi::analyze
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition: Phase2TrackerMonitorDigi.cc:69
GeomDet::topology
virtual const Topology & topology() const
Definition: GeomDet.cc:67
Topology::localPosition
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
Phase2TrackerMonitorDigi::layerMEs
std::map< unsigned int, DigiMEs > layerMEs
Definition: Phase2TrackerMonitorDigi.h:61
PixelDigi.h
Phase2TrackerMonitorDigi::XYOccupancyMap
MonitorElement * XYOccupancyMap
Definition: Phase2TrackerMonitorDigi.h:50
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::Handle
Definition: AssociativeIterator.h:50
Phase2TrackerMonitorDigi::DigiMEs::FractionOfOvTBitsVsEta
MonitorElement * FractionOfOvTBitsVsEta
Definition: Phase2TrackerMonitorDigi.h:41
Phase2TrackerMonitorDigi::tTopoHandle_
edm::ESHandle< TrackerTopology > tTopoHandle_
Definition: Phase2TrackerMonitorDigi.h:69
Phase2TrackerMonitorDigi::DigiMEs::NumberOfClustersPerDet
MonitorElement * NumberOfClustersPerDet
Definition: Phase2TrackerMonitorDigi.h:36
align::Tracker
Definition: StructureType.h:70
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
Phase2TrackerMonitorDigi::DigiMEs
Definition: Phase2TrackerMonitorDigi.h:25
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Phase2TrackerMonitorDigi::XYPositionMap
MonitorElement * XYPositionMap
Definition: Phase2TrackerMonitorDigi.h:48
DetId
Definition: DetId.h:17
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
MakerMacros.h
Phase2TrackerMonitorDigi::DigiMEs::nHitDetsPerLayer
unsigned int nHitDetsPerLayer
Definition: Phase2TrackerMonitorDigi.h:45
Phase2TrackerMonitorDigi::DigiMEs::nDigiPerLayer
unsigned int nDigiPerLayer
Definition: Phase2TrackerMonitorDigi.h:44
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Phase2TrackerMonitorDigi::fillITPixelDigiHistos
void fillITPixelDigiHistos(const edm::Handle< edm::DetSetVector< PixelDigi >> handle, const edm::ESHandle< TrackerGeometry > gHandle)
Definition: Phase2TrackerMonitorDigi.cc:93
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
Service.h
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
Phase2TrackerMonitorDigi::DigiMEs::NumberOfDigisPerDet
MonitorElement * NumberOfDigisPerDet
Definition: Phase2TrackerMonitorDigi.h:26
edm::ESHandle< TrackerGeometry >
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
PixelTopology::ncolumns
virtual int ncolumns() const =0
Phase2TrackerMonitorDigi::DigiMEs::ChargeOfDigis
MonitorElement * ChargeOfDigis
Definition: Phase2TrackerMonitorDigi.h:32
Point3DBase< float, GlobalTag >
PixelGeomDetType.h
Phase2TrackerMonitorDigi::DigiMEs::ClusterWidth
MonitorElement * ClusterWidth
Definition: Phase2TrackerMonitorDigi.h:37
Phase2TrackerMonitorDigi::DigiMEs::ClusterPositionS
MonitorElement * ClusterPositionS
Definition: Phase2TrackerMonitorDigi.h:39
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Phase2TrackerMonitorDigi::Phase2TrackerMonitorDigi
Phase2TrackerMonitorDigi(const edm::ParameterSet &)
Definition: Phase2TrackerMonitorDigi.cc:47
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
TrackerDigiGeometryRecord.h
Phase2TrackerDigi.h
MonitorElement.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Phase2TrackerMonitorDigi::DigiMEs::PositionOfDigisP
MonitorElement * PositionOfDigisP
Definition: Phase2TrackerMonitorDigi.h:30
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
fed_dqm_sourceclient-live_cfg.folder_name
folder_name
Definition: fed_dqm_sourceclient-live_cfg.py:42
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
iEvent
int iEvent
Definition: GenABIO.cc:224
cscdqm::HistoName
std::string HistoName
Definition: CSCDQM_HistoDef.h:32
Phase2TrackerMonitorDigi::bookHistograms
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
Definition: Phase2TrackerMonitorDigi.cc:355
Phase2TrackerMonitorDigi::itPixelDigiToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
Definition: Phase2TrackerMonitorDigi.h:68
edm::EventSetup
Definition: EventSetup.h:57
Phase2TrackerMonitorDigi::DigiMEs::DigiOccupancyS
MonitorElement * DigiOccupancyS
Definition: Phase2TrackerMonitorDigi.h:28
Phase2TrackerMonitorDigi::bookLayerHistos
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id, const TrackerTopology *tTopo)
Definition: Phase2TrackerMonitorDigi.cc:437
get
#define get
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Phase2TrackerMonitorDigi::~Phase2TrackerMonitorDigi
~Phase2TrackerMonitorDigi() override
Definition: Phase2TrackerMonitorDigi.cc:61
Phase2TrackerDigi
Definition: Phase2TrackerDigi.h:12
GeomDet.h
std
Definition: JetResolutionObject.h:76
Phase2TrackerMonitorDigi::DigiMEs::FractionOfOvTBits
MonitorElement * FractionOfOvTBits
Definition: Phase2TrackerMonitorDigi.h:40
Phase2TrackerMonitorDigi
Definition: Phase2TrackerMonitorDigi.h:18
ESWatcher.h
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
Phase2TrackerMonitorDigi::DigiMEs::DigiOccupancyP
MonitorElement * DigiOccupancyP
Definition: Phase2TrackerMonitorDigi.h:27
PixelGeomDetUnit.h
Phase2TrackerMonitorDigi::DigiMEs::ChargeOfDigisVsWidth
MonitorElement * ChargeOfDigisVsWidth
Definition: Phase2TrackerMonitorDigi.h:33
Phase2TrackerMonitorDigi::DigiMEs::EtaOccupancyProfP
MonitorElement * EtaOccupancyProfP
Definition: Phase2TrackerMonitorDigi.h:42
Phase2TrackerMonitorDigi::DigiMEs::NumberOfHitDetectorsPerLayer
MonitorElement * NumberOfHitDetectorsPerLayer
Definition: Phase2TrackerMonitorDigi.h:35
dqm::implementation::IBooker
Definition: DQMStore.h:43
Phase2TrackerDigitizerFwd.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
edm::Event
Definition: Event.h:73
PixelTopology::nrows
virtual int nrows() const =0
Phase2TrackerMonitorDigi::DigiMEs::ClusterPositionP
MonitorElement * ClusterPositionP
Definition: Phase2TrackerMonitorDigi.h:38
Parameters
vector< ParameterSet > Parameters
Definition: HLTMuonPlotter.cc:25
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
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
Phase2TrackerMonitorDigi::pixelFlag_
bool pixelFlag_
Definition: Phase2TrackerMonitorDigi.h:63
Phase2TrackerMonitorDigi::RZPositionMap
MonitorElement * RZPositionMap
Definition: Phase2TrackerMonitorDigi.h:49
TrackerGeometry
Definition: TrackerGeometry.h:14
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31