CMS 3D CMS Logo

SiPixelDigiSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelMonitorDigi
4 // Class: SiPixelDigiSource
5 //
13 //
14 // Original Author: Vincenzo Chiochia
15 // Created:
16 //
17 //
19 // Framework
24 // DQM Framework
27 // Geometry
33 // DataFormats
40 //
41 #include <string>
42 #include <cstdlib>
43 #include <iostream>
44 #include <fstream>
45 
46 using namespace std;
47 using namespace edm;
48 
50  : conf_(iConfig),
51  src_(conf_.getParameter<edm::InputTag>("src")),
52  saveFile(conf_.getUntrackedParameter<bool>("saveFile", false)),
53  isPIB(conf_.getUntrackedParameter<bool>("isPIB", false)),
54  slowDown(conf_.getUntrackedParameter<bool>("slowDown", false)),
55  modOn(conf_.getUntrackedParameter<bool>("modOn", true)),
56  twoDimOn(conf_.getUntrackedParameter<bool>("twoDimOn", true)),
57  twoDimModOn(conf_.getUntrackedParameter<bool>("twoDimModOn", true)),
58  twoDimOnlyLayDisk(conf_.getUntrackedParameter<bool>("twoDimOnlyLayDisk", false)),
59  hiRes(conf_.getUntrackedParameter<bool>("hiRes", false)),
60  reducedSet(conf_.getUntrackedParameter<bool>("reducedSet", false)),
61  ladOn(conf_.getUntrackedParameter<bool>("ladOn", false)),
62  layOn(conf_.getUntrackedParameter<bool>("layOn", false)),
63  phiOn(conf_.getUntrackedParameter<bool>("phiOn", false)),
64  ringOn(conf_.getUntrackedParameter<bool>("ringOn", false)),
65  bladeOn(conf_.getUntrackedParameter<bool>("bladeOn", false)),
66  diskOn(conf_.getUntrackedParameter<bool>("diskOn", false)),
67  bigEventSize(conf_.getUntrackedParameter<int>("bigEventSize", 1000)),
68  isUpgrade(conf_.getUntrackedParameter<bool>("isUpgrade", false)),
69  noOfLayers(0),
70  noOfDisks(0) {
71  //set Token(-s)
72  srcToken_ = consumes<edm::DetSetVector<PixelDigi> >(conf_.getParameter<edm::InputTag>("src"));
73 
74  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
75 
76  firstRun = true;
77  // find a FED# for the current detId:
78  ifstream infile(edm::FileInPath("DQM/SiPixelMonitorClient/test/detId.dat").fullPath().c_str(), ios::in);
79  int nModsInFile = 0;
80  assert(!infile.fail());
81  int nTOTmodules;
82  if (isUpgrade) {
83  nTOTmodules = 1856;
84  } else {
85  nTOTmodules = 1440;
86  }
87  while (!infile.eof() && nModsInFile < nTOTmodules) {
88  infile >> I_name[nModsInFile] >> I_detId[nModsInFile] >> I_fedId[nModsInFile] >> I_linkId1[nModsInFile] >>
89  I_linkId2[nModsInFile];
90  nModsInFile++;
91  }
92  infile.close();
93 
94  LogInfo("PixelDQM") << "SiPixelDigiSource::SiPixelDigiSource: Got DQM BackEnd interface" << endl;
95 }
96 
98  // do anything here that needs to be done at desctruction time
99  // (e.g. close files, deallocate resources etc.)
100  LogInfo("PixelDQM") << "SiPixelDigiSource::~SiPixelDigiSource: Destructor" << endl;
101 }
102 
104  int thisls = lb.id().luminosityBlock();
105 
106  if (modOn && thisls % 10 == 0 && averageDigiOccupancy) {
107  nBPIXDigis = 0;
108  nFPIXDigis = 0;
109  for (int i = 0; i != 40; i++)
110  nDigisPerFed[i] = 0;
111  }
112  if (!modOn && averageDigiOccupancy) {
113  nBPIXDigis = 0;
114  nFPIXDigis = 0;
115  for (int i = 0; i != 40; i++)
116  nDigisPerFed[i] = 0;
117  }
118 
119  if (modOn && thisls % 10 == 0) {
120  ROCMapToReset = true; //the ROC map is reset each 10 lumisections
121 
122  for (int i = 0; i < 2; i++)
123  NzeroROCs[i] = 0;
124  for (int i = 0; i < 2; i++)
125  NloEffROCs[i] = 0; //resetting also Zero and low eff. ROC counters
126 
127  NzeroROCs[1] = -672;
128  NloEffROCs[1] =
129  -672; //this magic number derives by the way the endcap occupancy is filled, there are always 672 empty bins by construction
130 
131  //these bools are needed to count zero occupancy plots in the substructure only once each 10 LS
132  DoZeroRocsBMO1 = true;
133  DoZeroRocsBMO2 = true;
134  DoZeroRocsBMO3 = true;
135 
136  DoZeroRocsBMI1 = true;
137  DoZeroRocsBMI2 = true;
138  DoZeroRocsBMI3 = true;
139 
140  DoZeroRocsBPO1 = true;
141  DoZeroRocsBPO2 = true;
142  DoZeroRocsBPO3 = true;
143 
144  DoZeroRocsBPI1 = true;
145  DoZeroRocsBPI2 = true;
146  DoZeroRocsBPI3 = true;
147 
148  DoZeroRocsFPO1 = true;
149  DoZeroRocsFPO2 = true;
150 
151  DoZeroRocsFMO1 = true;
152  DoZeroRocsFMO2 = true;
153 
154  DoZeroRocsFPI1 = true;
155  DoZeroRocsFPI2 = true;
156 
157  DoZeroRocsFMI1 = true;
158  DoZeroRocsFMI2 = true;
159  }
160 }
161 
163  int thisls = lb.id().luminosityBlock();
164 
165  float averageBPIXFed = float(nBPIXDigis) / 32.;
166  float averageFPIXFed = float(nFPIXDigis) / 8.;
167 
168  if (averageDigiOccupancy) {
169  for (int i = 0; i != 40; i++) {
170  float averageOcc = 0.;
171  if (i < 32) {
172  if (averageBPIXFed > 0.)
173  averageOcc = nDigisPerFed[i] / averageBPIXFed;
174  } else {
175  if (averageFPIXFed > 0.)
176  averageOcc = nDigisPerFed[i] / averageFPIXFed;
177  }
178  if (!modOn) {
180  i,
181  nDigisPerFed[i]); //In offline we fill all digis and normalise at the end of the run for thread safe behaviour.
182  avgfedDigiOccvsLumi->setBinContent(thisls, i + 1, nDigisPerFed[i]); //Same plot vs lumi section
183  }
184  if (modOn) {
185  if (thisls % 10 == 0)
187  i,
188  averageOcc); // "modOn" basically mean Online DQM, in this case fill histos with actual value of digi fraction per fed for each ten lumisections
189  if (avgfedDigiOccvsLumi && thisls % 5 == 0)
191  int(thisls / 5),
192  i + 1,
193  averageOcc); //fill with the mean over 5 lumisections, previous code was filling this histo only with last event of each 10th lumisection
194  }
195  }
196 
197  if (modOn && thisls % 10 == 0) {
199  int(thisls / 10), averageBPIXFed); //<NDigis> vs lumisection for barrel, filled every 10 lumi sections
201  int(thisls / 10), averageFPIXFed); //<NDigis> vs lumisection for endcap, filled every 10 lumi sections
202  }
203  }
204 }
205 
207  LogInfo("PixelDQM") << " SiPixelDigiSource::beginJob - Initialisation ... " << std::endl;
208  LogInfo("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/" << layOn << "/" << phiOn << std::endl;
209  LogInfo("PixelDQM") << "Blade/Disk/Ring" << bladeOn << "/" << diskOn << "/" << ringOn << std::endl;
210  LogInfo("PixelDQM") << "2DIM IS " << twoDimOn << " and set to high resolution? " << hiRes << "\n";
211 
212  if (firstRun) {
213  nBigEvents = 0;
214  nBPIXDigis = 0;
215  nFPIXDigis = 0;
216  for (int i = 0; i != 40; i++)
217  nDigisPerFed[i] = 0;
218  for (int i = 0; i != 4; i++)
219  nDigisPerDisk[i] = 0;
220  nDP1P1M1 = 0;
221  nDP1P1M2 = 0;
222  nDP1P1M3 = 0;
223  nDP1P1M4 = 0;
224  nDP1P2M1 = 0;
225  nDP1P2M2 = 0;
226  nDP1P2M3 = 0;
227  nDP2P1M1 = 0;
228  nDP2P1M2 = 0;
229  nDP2P1M3 = 0;
230  nDP2P1M4 = 0;
231  nDP2P2M1 = 0;
232  nDP2P2M2 = 0;
233  nDP2P2M3 = 0;
234  nDP3P1M1 = 0;
235  nDP3P2M1 = 0;
236  nDM1P1M1 = 0;
237  nDM1P1M2 = 0;
238  nDM1P1M3 = 0;
239  nDM1P1M4 = 0;
240  nDM1P2M1 = 0;
241  nDM1P2M2 = 0;
242  nDM1P2M3 = 0;
243  nDM2P1M1 = 0;
244  nDM2P1M2 = 0;
245  nDM2P1M3 = 0;
246  nDM2P1M4 = 0;
247  nDM2P2M1 = 0;
248  nDM2P2M2 = 0;
249  nDM2P2M3 = 0;
250  nDM3P1M1 = 0;
251  nDM3P2M1 = 0;
252  nL1M1 = 0;
253  nL1M2 = 0;
254  nL1M3 = 0;
255  nL1M4 = 0;
256  nL2M1 = 0;
257  nL2M2 = 0;
258  nL2M3 = 0;
259  nL2M4 = 0;
260  nL3M1 = 0;
261  nL3M2 = 0;
262  nL3M3 = 0;
263  nL3M4 = 0;
264  nL4M1 = 0;
265  nL4M2 = 0;
266  nL4M3 = 0;
267  nL4M4 = 0;
268 
269  ROCMapToReset = false;
270 
271  DoZeroRocsBMO1 = false;
272  DoZeroRocsBMO2 = false;
273  DoZeroRocsBMO3 = false;
274 
275  DoZeroRocsBMI1 = false;
276  DoZeroRocsBMI2 = false;
277  DoZeroRocsBMI3 = false;
278 
279  DoZeroRocsBPO1 = false;
280  DoZeroRocsBPO2 = false;
281  DoZeroRocsBPO3 = false;
282 
283  DoZeroRocsBPI1 = false;
284  DoZeroRocsBPI2 = false;
285  DoZeroRocsBPI3 = false;
286 
287  DoZeroRocsFPO1 = false;
288  DoZeroRocsFPO2 = false;
289 
290  DoZeroRocsFMO1 = false;
291  DoZeroRocsFMO2 = false;
292 
293  DoZeroRocsFPI1 = false;
294  DoZeroRocsFPI2 = false;
295 
296  DoZeroRocsFMI1 = false;
297  DoZeroRocsFMI2 = false;
298 
299  for (int i = 0; i < 2; i++)
300  NzeroROCs[i] = 0;
301  for (int i = 0; i < 2; i++)
302  NloEffROCs[i] = 0;
303 
304  // Build map
305  buildStructure(iSetup);
306  // Book Monitoring Elements
307  firstRun = false;
308  }
309 }
310 
312  bookMEs(iBooker, iSetup);
313 }
314 
315 //------------------------------------------------------------------
316 // Method called for every event
317 //------------------------------------------------------------------
319  edm::ESHandle<TrackerTopology> tTopoHandle;
320  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
321  const TrackerTopology* pTT = tTopoHandle.product();
322 
323  // get input data
325  iEvent.getByToken(srcToken_, input);
326  if (!input.isValid())
327  return;
328 
329  int bx = iEvent.bunchCrossing();
330 
331  int lumiSection = (int)iEvent.luminosityBlock();
332  int nEventDigis = 0;
333  int nActiveModules = 0;
334 
335  std::map<uint32_t, SiPixelDigiModule*>::iterator struct_iter;
336  for (int i = 0; i != 192; i++)
337  numberOfDigis[i] = 0;
338  for (int i = 0; i != 1152; i++)
339  nDigisPerChan[i] = 0;
340  for (int i = 0; i != 4; i++)
341  nDigisPerDisk[i] = 0;
342 
343  for (struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++) {
344  int numberOfDigisMod = (*struct_iter)
345  .second->fill(*input,
346  iSetup,
351  modOn,
352  ladOn,
353  layOn,
354  phiOn,
355  bladeOn,
356  diskOn,
357  ringOn,
358  twoDimOn,
359  reducedSet,
360  twoDimModOn,
362  nDigisA,
363  nDigisB,
364  isUpgrade);
365 
366  bool barrel = DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
367  bool endcap = DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
368 
369  if (numberOfDigisMod > 0) {
370  nEventDigis = nEventDigis + numberOfDigisMod;
371  nActiveModules++;
372  int nBPiXmodules;
373  int nTOTmodules;
374  if (isUpgrade) {
375  nBPiXmodules = 1184;
376  nTOTmodules = 1856;
377  } else {
378  nBPiXmodules = 768;
379  nTOTmodules = 1440;
380  }
381  if (barrel) { // Barrel
382  int layer = PixelBarrelName(DetId((*struct_iter).first), pTT, isUpgrade).layerName();
383  PixelBarrelName::Shell shell = PixelBarrelName(DetId((*struct_iter).first), pTT, isUpgrade).shell();
384 
385  //Count Zero Occ Rocs in Barrel in the first event after each 10 Ls
387  if (DoZeroRocsBMO1 && layer == 1)
388  CountZeroROCsInSubstructure(barrel, DoZeroRocsBMO1, (*struct_iter).second);
389  if (DoZeroRocsBMO2 && layer == 2)
390  CountZeroROCsInSubstructure(barrel, DoZeroRocsBMO2, (*struct_iter).second);
391  if (DoZeroRocsBMO3 && layer == 3)
392  CountZeroROCsInSubstructure(barrel, DoZeroRocsBMO3, (*struct_iter).second);
393  } else if (ROCMapToReset && shell == PixelBarrelName::mI && twoDimOnlyLayDisk) {
394  if (DoZeroRocsBMI1 && layer == 1)
395  CountZeroROCsInSubstructure(barrel, DoZeroRocsBMI1, (*struct_iter).second);
396  if (DoZeroRocsBMI2 && layer == 2)
397  CountZeroROCsInSubstructure(barrel, DoZeroRocsBMI2, (*struct_iter).second);
398  if (DoZeroRocsBMI3 && layer == 3)
399  CountZeroROCsInSubstructure(barrel, DoZeroRocsBMI3, (*struct_iter).second);
400  } else if (ROCMapToReset && shell == PixelBarrelName::pO && twoDimOnlyLayDisk) {
401  if (DoZeroRocsBPO1 && layer == 1)
402  CountZeroROCsInSubstructure(barrel, DoZeroRocsBPO1, (*struct_iter).second);
403  if (DoZeroRocsBPO2 && layer == 2)
404  CountZeroROCsInSubstructure(barrel, DoZeroRocsBPO2, (*struct_iter).second);
405  if (DoZeroRocsBPO3 && layer == 3)
406  CountZeroROCsInSubstructure(barrel, DoZeroRocsBPO3, (*struct_iter).second);
407  } else if (ROCMapToReset && shell == PixelBarrelName::pI && twoDimOnlyLayDisk) {
408  if (DoZeroRocsBPI1 && layer == 1)
409  CountZeroROCsInSubstructure(barrel, DoZeroRocsBPI1, (*struct_iter).second);
410  if (DoZeroRocsBPI2 && layer == 2)
411  CountZeroROCsInSubstructure(barrel, DoZeroRocsBPI2, (*struct_iter).second);
412  if (DoZeroRocsBPI3 && layer == 3)
413  CountZeroROCsInSubstructure(barrel, DoZeroRocsBPI3, (*struct_iter).second);
414  }
415 
416  nBPIXDigis = nBPIXDigis + numberOfDigisMod;
417  for (int i = 0; i != nBPiXmodules; ++i) {
418  if ((*struct_iter).first == I_detId[i]) {
419  nDigisPerFed[I_fedId[i]] = nDigisPerFed[I_fedId[i]] + numberOfDigisMod;
420  int index1 = 0;
421  int index2 = 0;
422  if (I_linkId1[i] > 0)
423  index1 = I_fedId[i] * 36 + (I_linkId1[i] - 1);
424  if (I_linkId2[i] > 0)
425  index2 = I_fedId[i] * 36 + (I_linkId2[i] - 1);
426  if (nDigisA > 0 && I_linkId1[i] > 0)
427  nDigisPerChan[index1] = nDigisPerChan[index1] + nDigisA;
428  if (nDigisB > 0 && I_linkId2[i] > 0)
429  nDigisPerChan[index2] = nDigisPerChan[index2] + nDigisB;
430  i = (nBPiXmodules - 1);
431  }
432  }
433  } else if (endcap && !isUpgrade) { // Endcap
434  nFPIXDigis = nFPIXDigis + numberOfDigisMod;
436  PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).halfCylinder();
437  int disk = PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).diskName();
438  int blade = PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).bladeName();
439  int panel = PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).pannelName();
440  int module = PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).plaquetteName();
441  int iter = 0;
442  int i = 0;
443 
444  //count Zero Occupancy ROCs in Endcap in the first event after each 10 Ls
446  if (DoZeroRocsFMO1 && disk == 1)
447  CountZeroROCsInSubstructure(barrel, DoZeroRocsFMO1, (*struct_iter).second);
448  if (DoZeroRocsFMO2 && disk == 2)
449  CountZeroROCsInSubstructure(barrel, DoZeroRocsFMO2, (*struct_iter).second);
450  } else if (ROCMapToReset && side == PixelEndcapName::mI && twoDimOnlyLayDisk) {
451  if (DoZeroRocsFMI1 && disk == 1)
452  CountZeroROCsInSubstructure(barrel, DoZeroRocsFMI1, (*struct_iter).second);
453  if (DoZeroRocsFMI2 && disk == 2)
454  CountZeroROCsInSubstructure(barrel, DoZeroRocsFMI2, (*struct_iter).second);
455  } else if (ROCMapToReset && side == PixelEndcapName::pO && twoDimOnlyLayDisk) {
456  if (DoZeroRocsFPO1 && disk == 1)
457  CountZeroROCsInSubstructure(barrel, DoZeroRocsFPO1, (*struct_iter).second);
458  if (DoZeroRocsFPO2 && disk == 2)
459  CountZeroROCsInSubstructure(barrel, DoZeroRocsFPO2, (*struct_iter).second);
460  } else if (ROCMapToReset && side == PixelEndcapName::pI && twoDimOnlyLayDisk) {
461  if (DoZeroRocsFPI1 && disk == 1)
462  CountZeroROCsInSubstructure(barrel, DoZeroRocsFPI1, (*struct_iter).second);
463  if (DoZeroRocsFPI2 && disk == 2)
464  CountZeroROCsInSubstructure(barrel, DoZeroRocsFPI2, (*struct_iter).second);
465  }
466 
467  if (side == PixelEndcapName::mI) {
468  if (disk == 1) {
469  i = 0;
470  if (panel == 1) {
471  if (module == 1)
472  nDM1P1M1 += numberOfDigisMod;
473  else if (module == 2)
474  nDM1P1M2 += numberOfDigisMod;
475  else if (module == 3)
476  nDM1P1M3 += numberOfDigisMod;
477  else if (module == 4)
478  nDM1P1M4 += numberOfDigisMod;
479  } else if (panel == 2) {
480  if (module == 1)
481  nDM1P2M1 += numberOfDigisMod;
482  else if (module == 2)
483  nDM1P2M2 += numberOfDigisMod;
484  else if (module == 3)
485  nDM1P2M3 += numberOfDigisMod;
486  }
487  if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
488  iter = i + 2 * (blade - 1) + (panel - 1);
489  } else if (disk == 2) {
490  i = 24;
491  if (panel == 1) {
492  if (module == 1)
493  nDM2P1M1 += numberOfDigisMod;
494  else if (module == 2)
495  nDM2P1M2 += numberOfDigisMod;
496  else if (module == 3)
497  nDM2P1M3 += numberOfDigisMod;
498  else if (module == 4)
499  nDM2P1M4 += numberOfDigisMod;
500  } else if (panel == 2) {
501  if (module == 1)
502  nDM2P2M1 += numberOfDigisMod;
503  else if (module == 2)
504  nDM2P2M2 += numberOfDigisMod;
505  else if (module == 3)
506  nDM2P2M3 += numberOfDigisMod;
507  }
508  if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
509  iter = i + 2 * (blade - 1) + (panel - 1);
510  }
511  } else if (side == PixelEndcapName::mO) {
512  if (disk == 1) {
513  i = 48;
514  if (panel == 1) {
515  if (module == 1)
516  nDM1P1M1 += numberOfDigisMod;
517  else if (module == 2)
518  nDM1P1M2 += numberOfDigisMod;
519  else if (module == 3)
520  nDM1P1M3 += numberOfDigisMod;
521  else if (module == 4)
522  nDM1P1M4 += numberOfDigisMod;
523  } else if (panel == 2) {
524  if (module == 1)
525  nDM1P2M1 += numberOfDigisMod;
526  else if (module == 2)
527  nDM1P2M2 += numberOfDigisMod;
528  else if (module == 3)
529  nDM1P2M3 += numberOfDigisMod;
530  }
531  if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
532  iter = i + 2 * (blade - 1) + (panel - 1);
533  } else if (disk == 2) {
534  i = 72;
535  if (panel == 1) {
536  if (module == 1)
537  nDM2P1M1 += numberOfDigisMod;
538  else if (module == 2)
539  nDM2P1M2 += numberOfDigisMod;
540  else if (module == 3)
541  nDM2P1M3 += numberOfDigisMod;
542  else if (module == 4)
543  nDM2P1M4 += numberOfDigisMod;
544  } else if (panel == 2) {
545  if (module == 1)
546  nDM2P2M1 += numberOfDigisMod;
547  else if (module == 2)
548  nDM2P2M2 += numberOfDigisMod;
549  else if (module == 3)
550  nDM2P2M3 += numberOfDigisMod;
551  }
552  if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
553  iter = i + 2 * (blade - 1) + (panel - 1);
554  }
555  } else if (side == PixelEndcapName::pI) {
556  if (disk == 1) {
557  i = 96;
558  if (panel == 1) {
559  if (module == 1)
560  nDP1P1M1 += numberOfDigisMod;
561  else if (module == 2)
562  nDP1P1M2 += numberOfDigisMod;
563  else if (module == 3)
564  nDP1P1M3 += numberOfDigisMod;
565  else if (module == 4)
566  nDP1P1M4 += numberOfDigisMod;
567  } else if (panel == 2) {
568  if (module == 1)
569  nDP1P2M1 += numberOfDigisMod;
570  else if (module == 2)
571  nDP1P2M2 += numberOfDigisMod;
572  else if (module == 3)
573  nDP1P2M3 += numberOfDigisMod;
574  }
575  if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
576  iter = i + 2 * (blade - 1) + (panel - 1);
577  } else if (disk == 2) {
578  i = 120;
579  if (panel == 1) {
580  if (module == 1)
581  nDP2P1M1 += numberOfDigisMod;
582  else if (module == 2)
583  nDP2P1M2 += numberOfDigisMod;
584  else if (module == 3)
585  nDP2P1M3 += numberOfDigisMod;
586  else if (module == 4)
587  nDP2P1M4 += numberOfDigisMod;
588  } else if (panel == 2) {
589  if (module == 1)
590  nDP2P2M1 += numberOfDigisMod;
591  else if (module == 2)
592  nDP2P2M2 += numberOfDigisMod;
593  else if (module == 3)
594  nDP2P2M3 += numberOfDigisMod;
595  }
596  if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
597  iter = i + 2 * (blade - 1) + (panel - 1);
598  }
599  } else if (side == PixelEndcapName::pO) {
600  if (disk == 1) {
601  i = 144;
602  if (panel == 1) {
603  if (module == 1)
604  nDP1P1M1 += numberOfDigisMod;
605  else if (module == 2)
606  nDP1P1M2 += numberOfDigisMod;
607  else if (module == 3)
608  nDP1P1M3 += numberOfDigisMod;
609  else if (module == 4)
610  nDP1P1M4 += numberOfDigisMod;
611  } else if (panel == 2) {
612  if (module == 1)
613  nDP1P2M1 += numberOfDigisMod;
614  else if (module == 2)
615  nDP1P2M2 += numberOfDigisMod;
616  else if (module == 3)
617  nDP1P2M3 += numberOfDigisMod;
618  }
619  if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
620  iter = i + 2 * (blade - 1) + (panel - 1);
621  } else if (disk == 2) {
622  i = 168;
623  if (panel == 1) {
624  if (module == 1)
625  nDP2P1M1 += numberOfDigisMod;
626  else if (module == 2)
627  nDP2P1M2 += numberOfDigisMod;
628  else if (module == 3)
629  nDP2P1M3 += numberOfDigisMod;
630  else if (module == 4)
631  nDP2P1M4 += numberOfDigisMod;
632  } else if (panel == 2) {
633  if (module == 1)
634  nDP2P2M1 += numberOfDigisMod;
635  else if (module == 2)
636  nDP2P2M2 += numberOfDigisMod;
637  else if (module == 3)
638  nDP2P2M3 += numberOfDigisMod;
639  }
640  if (blade < 13 && blade > 0 && (panel == 1 || panel == 2))
641  iter = i + 2 * (blade - 1) + (panel - 1);
642  }
643  }
644  numberOfDigis[iter] = numberOfDigis[iter] + numberOfDigisMod;
645 
646  for (int i = nBPiXmodules; i != nTOTmodules; i++) {
647  if ((*struct_iter).first == I_detId[i]) {
648  nDigisPerFed[I_fedId[i]] = nDigisPerFed[I_fedId[i]] + numberOfDigisMod;
649  i = nTOTmodules - 1;
650  }
651  }
652  } //endif Barrel/(Endcap && !isUpgrade)
653  else if (endcap && isUpgrade) {
654  nFPIXDigis = nFPIXDigis + numberOfDigisMod;
656  PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).halfCylinder();
657  int disk = PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).diskName();
658  int blade = PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).bladeName();
659  int panel = PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).pannelName();
660  int module = PixelEndcapName(DetId((*struct_iter).first), pTT, isUpgrade).plaquetteName();
661 
662  int iter = 0;
663  int i = 0;
664  if (side == PixelEndcapName::mI) {
665  if (disk == 1) {
666  i = 0;
667  if (panel == 1) {
668  if (module == 1)
669  nDM1P1M1 += numberOfDigisMod;
670  } else if (panel == 2) {
671  if (module == 1)
672  nDM1P2M1 += numberOfDigisMod;
673  }
674  if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
675  iter = i + 2 * (blade - 1) + (panel - 1);
676  } else if (disk == 2) {
677  i = 22;
678  if (panel == 1) {
679  if (module == 1)
680  nDM2P1M1 += numberOfDigisMod;
681  } else if (panel == 2) {
682  if (module == 1)
683  nDM2P2M1 += numberOfDigisMod;
684  }
685  if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
686  iter = i + 2 * (blade - 1) + (panel - 1);
687  } else if (disk == 3) {
688  i = 44;
689  if (panel == 1) {
690  if (module == 1)
691  nDM3P1M1 += numberOfDigisMod;
692  } else if (panel == 2) {
693  if (module == 1)
694  nDM3P2M1 += numberOfDigisMod;
695  }
696  if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
697  iter = i + 2 * (blade - 1) + (panel - 1);
698  }
699  } else if (side == PixelEndcapName::mO) {
700  if (disk == 1) {
701  i = 66;
702  if (panel == 1) {
703  if (module == 1)
704  nDM1P1M1 += numberOfDigisMod;
705  } else if (panel == 2) {
706  if (module == 1)
707  nDM1P2M1 += numberOfDigisMod;
708  }
709  if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
710  iter = i + 2 * (blade - 1) + (panel - 1);
711  } else if (disk == 2) {
712  i = 100;
713  if (panel == 1) {
714  if (module == 1)
715  nDM2P1M1 += numberOfDigisMod;
716  } else if (panel == 2) {
717  if (module == 1)
718  nDM2P2M1 += numberOfDigisMod;
719  }
720  if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
721  iter = i + 2 * (blade - 1) + (panel - 1);
722  } else if (disk == 3) {
723  i = 134;
724  if (panel == 1) {
725  if (module == 1)
726  nDM3P1M1 += numberOfDigisMod;
727  } else if (panel == 2) {
728  if (module == 1)
729  nDM3P2M1 += numberOfDigisMod;
730  }
731  if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
732  iter = i + 2 * (blade - 1) + (panel - 1);
733  }
734  } else if (side == PixelEndcapName::pI) {
735  if (disk == 1) {
736  i = 168;
737  if (panel == 1) {
738  if (module == 1)
739  nDP1P1M1 += numberOfDigisMod;
740  } else if (panel == 2) {
741  if (module == 1)
742  nDP1P2M1 += numberOfDigisMod;
743  }
744  if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
745  iter = i + 2 * (blade - 1) + (panel - 1);
746  } else if (disk == 2) {
747  i = 190;
748  if (panel == 1) {
749  if (module == 1)
750  nDP2P1M1 += numberOfDigisMod;
751  } else if (panel == 2) {
752  if (module == 1)
753  nDP2P2M1 += numberOfDigisMod;
754  }
755  if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
756  iter = i + 2 * (blade - 1) + (panel - 1);
757  } else if (disk == 3) {
758  i = 212;
759  if (panel == 1) {
760  if (module == 1)
761  nDP3P1M1 += numberOfDigisMod;
762  } else if (panel == 2) {
763  if (module == 1)
764  nDP3P2M1 += numberOfDigisMod;
765  }
766  if (blade < 12 && blade > 0 && (panel == 1 || panel == 2))
767  iter = i + 2 * (blade - 1) + (panel - 1);
768  }
769  } else if (side == PixelEndcapName::pO) {
770  if (disk == 1) {
771  i = 234;
772  if (panel == 1) {
773  if (module == 1)
774  nDP1P1M1 += numberOfDigisMod;
775  } else if (panel == 2) {
776  if (module == 1)
777  nDP1P2M1 += numberOfDigisMod;
778  }
779  if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
780  iter = i + 2 * (blade - 1) + (panel - 1);
781  } else if (disk == 2) {
782  i = 268;
783  if (panel == 1) {
784  if (module == 1)
785  nDP2P1M1 += numberOfDigisMod;
786  } else if (panel == 2) {
787  if (module == 1)
788  nDP2P2M1 += numberOfDigisMod;
789  }
790  if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
791  iter = i + 2 * (blade - 1) + (panel - 1);
792  } else if (disk == 3) {
793  i = 302;
794  if (panel == 1) {
795  if (module == 1)
796  nDP3P1M1 += numberOfDigisMod;
797  } else if (panel == 2) {
798  if (module == 1)
799  nDP3P2M1 += numberOfDigisMod;
800  }
801  if (blade < 18 && blade > 0 && (panel == 1 || panel == 2))
802  iter = i + 2 * (blade - 1) + (panel - 1);
803  }
804  }
805  numberOfDigis[iter] = numberOfDigis[iter] + numberOfDigisMod;
806  for (int i = nBPiXmodules; i != nTOTmodules; i++) {
807  if ((*struct_iter).first == I_detId[i]) {
808  nDigisPerFed[I_fedId[i]] = nDigisPerFed[I_fedId[i]] + numberOfDigisMod;
809  i = nTOTmodules - 1;
810  }
811  }
812  } //endif(Endcap && isUpgrade)
813  } // endif any digis in this module
814  } // endfor loop over all modules
815 
816  if (lumiSection % 10 == 0 && ROCMapToReset) {
817  for (int i = 0; i < 2; ++i)
819  if (noOccROCsBarrel)
820  noOccROCsBarrel->setBinContent(lumiSection / 10, NzeroROCs[0]);
821  if (loOccROCsBarrel)
822  loOccROCsBarrel->setBinContent(lumiSection / 10, NloEffROCs[0]);
823  if (noOccROCsEndcap)
824  noOccROCsEndcap->setBinContent(lumiSection / 10, NzeroROCs[1]);
825  if (loOccROCsEndcap)
826  loOccROCsEndcap->setBinContent(lumiSection / 10, NloEffROCs[1]);
827  ROCMapToReset =
828  false; // in this way the ROC maps are reset for one event only (the first event in LS multiple of 10
829  }
830 
831  if (noOfDisks == 2) { // if (!isUpgrade)
832  if (meNDigisCHANEndcap_) {
833  for (int j = 0; j != 192; j++)
834  if (numberOfDigis[j] > 0)
836  }
837  if (meNDigisCHANEndcapDms_.at(0)) {
838  for (int j = 0; j != 72; j++)
839  if ((j < 24 || j > 47) && numberOfDigis[j] > 0)
840  meNDigisCHANEndcapDms_.at(0)->Fill((float)numberOfDigis[j]);
841  }
842  if (meNDigisCHANEndcapDms_.at(1)) {
843  for (int j = 24; j != 96; j++)
844  if ((j < 48 || j > 71) && numberOfDigis[j] > 0)
845  meNDigisCHANEndcapDms_.at(1)->Fill((float)numberOfDigis[j]);
846  }
847  if (meNDigisCHANEndcapDps_.at(0)) {
848  for (int j = 96; j != 168; j++)
849  if ((j < 120 || j > 143) && numberOfDigis[j] > 0)
850  meNDigisCHANEndcapDps_.at(0)->Fill((float)numberOfDigis[j]);
851  }
852  if (meNDigisCHANEndcapDps_.at(1)) {
853  for (int j = 120; j != 192; j++)
854  if ((j < 144 || j > 167) && numberOfDigis[j] > 0)
855  meNDigisCHANEndcapDps_.at(1)->Fill((float)numberOfDigis[j]);
856  }
857  } else if (noOfDisks == 3) { // else if (isUpgrade)
858  if (meNDigisCHANEndcap_) {
859  for (int j = 0; j != 336; j++)
860  if (numberOfDigis[j] > 0)
862  }
863  if (meNDigisCHANEndcapDms_.at(0)) {
864  for (int j = 0; j != 100; j++)
865  if ((j < 22 || j > 65) && numberOfDigis[j] > 0)
866  meNDigisCHANEndcapDms_.at(0)->Fill((float)numberOfDigis[j]);
867  }
868  if (meNDigisCHANEndcapDms_.at(1)) {
869  for (int j = 22; j != 134; j++)
870  if ((j < 44 || j > 99) && numberOfDigis[j] > 0)
871  meNDigisCHANEndcapDms_.at(1)->Fill((float)numberOfDigis[j]);
872  }
873  if (meNDigisCHANEndcapDms_.at(2)) {
874  for (int j = 44; j != 168; j++)
875  if ((j < 66 || j > 133) && numberOfDigis[j] > 0)
876  meNDigisCHANEndcapDms_.at(2)->Fill((float)numberOfDigis[j]);
877  }
878  if (meNDigisCHANEndcapDps_.at(0)) {
879  for (int j = 168; j != 268; j++)
880  if ((j < 190 || j > 233) && numberOfDigis[j] > 0)
881  meNDigisCHANEndcapDps_.at(0)->Fill((float)numberOfDigis[j]);
882  }
883  if (meNDigisCHANEndcapDps_.at(1)) {
884  for (int j = 190; j != 302; j++)
885  if ((j < 212 || j > 267) && numberOfDigis[j] > 0)
886  meNDigisCHANEndcapDps_.at(1)->Fill((float)numberOfDigis[j]);
887  }
888  if (meNDigisCHANEndcapDps_.at(2)) {
889  for (int j = 212; j != 336; j++)
890  if ((j < 234 || j > 301) && numberOfDigis[j] > 0)
891  meNDigisCHANEndcapDps_.at(2)->Fill((float)numberOfDigis[j]);
892  }
893  }
894 
896  for (int i = 0; i != 32; i++)
897  if (nDigisPerChan[i * 36 + 0] > 0)
898  meNDigisCHANBarrelCh1_->Fill((float)nDigisPerChan[i * 36 + 0]);
899  }
901  for (int i = 0; i != 32; i++)
902  if (nDigisPerChan[i * 36 + 1] > 0)
903  meNDigisCHANBarrelCh2_->Fill((float)nDigisPerChan[i * 36 + 1]);
904  }
906  for (int i = 0; i != 32; i++)
907  if (nDigisPerChan[i * 36 + 2] > 0)
908  meNDigisCHANBarrelCh3_->Fill((float)nDigisPerChan[i * 36 + 2]);
909  }
911  for (int i = 0; i != 32; i++)
912  if (nDigisPerChan[i * 36 + 3] > 0)
913  meNDigisCHANBarrelCh4_->Fill((float)nDigisPerChan[i * 36 + 3]);
914  }
916  for (int i = 0; i != 32; i++)
917  if (nDigisPerChan[i * 36 + 4] > 0)
918  meNDigisCHANBarrelCh5_->Fill((float)nDigisPerChan[i * 36 + 4]);
919  }
921  for (int i = 0; i != 32; i++)
922  if (nDigisPerChan[i * 36 + 5] > 0)
923  meNDigisCHANBarrelCh6_->Fill((float)nDigisPerChan[i * 36 + 5]);
924  }
926  for (int i = 0; i != 32; i++)
927  if (nDigisPerChan[i * 36 + 6] > 0)
928  meNDigisCHANBarrelCh7_->Fill((float)nDigisPerChan[i * 36 + 6]);
929  }
931  for (int i = 0; i != 32; i++)
932  if (nDigisPerChan[i * 36 + 7] > 0)
933  meNDigisCHANBarrelCh8_->Fill((float)nDigisPerChan[i * 36 + 7]);
934  }
936  for (int i = 0; i != 32; i++)
937  if (nDigisPerChan[i * 36 + 8] > 0)
938  meNDigisCHANBarrelCh9_->Fill((float)nDigisPerChan[i * 36 + 8]);
939  }
941  for (int i = 0; i != 32; i++)
942  if (nDigisPerChan[i * 36 + 9] > 0)
943  meNDigisCHANBarrelCh10_->Fill((float)nDigisPerChan[i * 36 + 9]);
944  }
946  for (int i = 0; i != 32; i++)
947  if (nDigisPerChan[i * 36 + 10] > 0)
948  meNDigisCHANBarrelCh11_->Fill((float)nDigisPerChan[i * 36 + 10]);
949  }
951  for (int i = 0; i != 32; i++)
952  if (nDigisPerChan[i * 36 + 11] > 0)
953  meNDigisCHANBarrelCh12_->Fill((float)nDigisPerChan[i * 36 + 11]);
954  }
956  for (int i = 0; i != 32; i++)
957  if (nDigisPerChan[i * 36 + 12] > 0)
958  meNDigisCHANBarrelCh13_->Fill((float)nDigisPerChan[i * 36 + 12]);
959  }
961  for (int i = 0; i != 32; i++)
962  if (nDigisPerChan[i * 36 + 13] > 0)
963  meNDigisCHANBarrelCh14_->Fill((float)nDigisPerChan[i * 36 + 13]);
964  }
966  for (int i = 0; i != 32; i++)
967  if (nDigisPerChan[i * 36 + 14] > 0)
968  meNDigisCHANBarrelCh15_->Fill((float)nDigisPerChan[i * 36 + 14]);
969  }
971  for (int i = 0; i != 32; i++)
972  if (nDigisPerChan[i * 36 + 15] > 0)
973  meNDigisCHANBarrelCh16_->Fill((float)nDigisPerChan[i * 36 + 15]);
974  }
976  for (int i = 0; i != 32; i++)
977  if (nDigisPerChan[i * 36 + 16] > 0)
978  meNDigisCHANBarrelCh17_->Fill((float)nDigisPerChan[i * 36 + 16]);
979  }
981  for (int i = 0; i != 32; i++)
982  if (nDigisPerChan[i * 36 + 17] > 0)
983  meNDigisCHANBarrelCh18_->Fill((float)nDigisPerChan[i * 36 + 17]);
984  }
986  for (int i = 0; i != 32; i++)
987  if (nDigisPerChan[i * 36 + 18] > 0)
988  meNDigisCHANBarrelCh19_->Fill((float)nDigisPerChan[i * 36 + 18]);
989  }
991  for (int i = 0; i != 32; i++)
992  if (nDigisPerChan[i * 36 + 19] > 0)
993  meNDigisCHANBarrelCh20_->Fill((float)nDigisPerChan[i * 36 + 19]);
994  }
996  for (int i = 0; i != 32; i++)
997  if (nDigisPerChan[i * 36 + 20] > 0)
998  meNDigisCHANBarrelCh21_->Fill((float)nDigisPerChan[i * 36 + 20]);
999  }
1001  for (int i = 0; i != 32; i++)
1002  if (nDigisPerChan[i * 36 + 21] > 0)
1003  meNDigisCHANBarrelCh22_->Fill((float)nDigisPerChan[i * 36 + 21]);
1004  }
1006  for (int i = 0; i != 32; i++)
1007  if (nDigisPerChan[i * 36 + 22] > 0)
1008  meNDigisCHANBarrelCh23_->Fill((float)nDigisPerChan[i * 36 + 22]);
1009  }
1011  for (int i = 0; i != 32; i++)
1012  if (nDigisPerChan[i * 36 + 23] > 0)
1013  meNDigisCHANBarrelCh24_->Fill((float)nDigisPerChan[i * 36 + 23]);
1014  }
1016  for (int i = 0; i != 32; i++)
1017  if (nDigisPerChan[i * 36 + 24] > 0)
1018  meNDigisCHANBarrelCh25_->Fill((float)nDigisPerChan[i * 36 + 24]);
1019  }
1021  for (int i = 0; i != 32; i++)
1022  if (nDigisPerChan[i * 36 + 25] > 0)
1023  meNDigisCHANBarrelCh26_->Fill((float)nDigisPerChan[i * 36 + 25]);
1024  }
1026  for (int i = 0; i != 32; i++)
1027  if (nDigisPerChan[i * 36 + 26] > 0)
1028  meNDigisCHANBarrelCh27_->Fill((float)nDigisPerChan[i * 36 + 26]);
1029  }
1031  for (int i = 0; i != 32; i++)
1032  if (nDigisPerChan[i * 36 + 27] > 0)
1033  meNDigisCHANBarrelCh28_->Fill((float)nDigisPerChan[i * 36 + 27]);
1034  }
1036  for (int i = 0; i != 32; i++)
1037  if (nDigisPerChan[i * 36 + 28] > 0)
1038  meNDigisCHANBarrelCh29_->Fill((float)nDigisPerChan[i * 36 + 28]);
1039  }
1041  for (int i = 0; i != 32; i++)
1042  if (nDigisPerChan[i * 36 + 29] > 0)
1043  meNDigisCHANBarrelCh30_->Fill((float)nDigisPerChan[i * 36 + 29]);
1044  }
1046  for (int i = 0; i != 32; i++)
1047  if (nDigisPerChan[i * 36 + 30] > 0)
1048  meNDigisCHANBarrelCh31_->Fill((float)nDigisPerChan[i * 36 + 30]);
1049  }
1051  for (int i = 0; i != 32; i++)
1052  if (nDigisPerChan[i * 36 + 31] > 0)
1053  meNDigisCHANBarrelCh32_->Fill((float)nDigisPerChan[i * 36 + 31]);
1054  }
1056  for (int i = 0; i != 32; i++)
1057  if (nDigisPerChan[i * 36 + 32] > 0)
1058  meNDigisCHANBarrelCh33_->Fill((float)nDigisPerChan[i * 36 + 32]);
1059  }
1061  for (int i = 0; i != 32; i++)
1062  if (nDigisPerChan[i * 36 + 33] > 0)
1063  meNDigisCHANBarrelCh34_->Fill((float)nDigisPerChan[i * 36 + 33]);
1064  }
1066  for (int i = 0; i != 32; i++)
1067  if (nDigisPerChan[i * 36 + 34] > 0)
1068  meNDigisCHANBarrelCh35_->Fill((float)nDigisPerChan[i * 36 + 34]);
1069  }
1071  for (int i = 0; i != 32; i++)
1072  if (nDigisPerChan[i * 36 + 35] > 0)
1073  meNDigisCHANBarrelCh36_->Fill((float)nDigisPerChan[i * 36 + 35]);
1074  }
1075 
1076  // Rate of events with >N digis:
1077  if (nEventDigis > bigEventSize) {
1078  if (bigEventRate)
1079  bigEventRate->Fill(lumiSection, 1. / 23.);
1080  }
1081 
1082  // Rate of pixel events and total number of pixel events per BX:
1083  if (nActiveModules >= 4) {
1084  if (pixEvtsPerBX)
1085  pixEvtsPerBX->Fill(float(bx));
1086  if (pixEventRate)
1087  pixEventRate->Fill(lumiSection, 1. / 23.);
1088  }
1089 
1090  if (slowDown)
1091  usleep(10000);
1092 }
1093 
1094 //------------------------------------------------------------------
1095 // Build data structure
1096 //------------------------------------------------------------------
1098  edm::ESHandle<TrackerTopology> tTopoHandle;
1099  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
1100  const TrackerTopology* pTT = tTopoHandle.product();
1101 
1102  LogInfo("PixelDQM") << " SiPixelDigiSource::buildStructure";
1104  iSetup.get<TrackerDigiGeometryRecord>().get(pDD);
1105 
1106  LogVerbatim("PixelDQM") << " *** Geometry node for TrackerGeom is " << &(*pDD) << std::endl;
1107  LogVerbatim("PixelDQM") << " *** I have " << pDD->dets().size() << " detectors" << std::endl;
1108  LogVerbatim("PixelDQM") << " *** I have " << pDD->detTypes().size() << " types" << std::endl;
1109 
1110  for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
1111  if (dynamic_cast<PixelGeomDetUnit const*>((*it)) != nullptr) {
1112  DetId detId = (*it)->geographicalId();
1113  const GeomDetUnit* geoUnit = pDD->idToDetUnit(detId);
1114  const PixelGeomDetUnit* pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
1115  int nrows = (pixDet->specificTopology()).nrows();
1116  int ncols = (pixDet->specificTopology()).ncolumns();
1117 
1118  if (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
1119  if (isPIB)
1120  continue;
1121  LogDebug("PixelDQM") << " ---> Adding Barrel Module " << detId.rawId() << endl;
1122  uint32_t id = detId();
1123  int layer = PixelBarrelName(DetId(id), pTT, isUpgrade).layerName();
1124  if (layer > noOfLayers)
1125  noOfLayers = layer;
1126  SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
1127  thePixelStructure.insert(pair<uint32_t, SiPixelDigiModule*>(id, theModule));
1128 
1129  } else if ((detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) && (!isUpgrade)) {
1130  LogDebug("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
1131  uint32_t id = detId();
1132  SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
1133 
1135  int disk = PixelEndcapName(DetId(id), pTT, isUpgrade).diskName();
1136  if (disk > noOfDisks)
1137  noOfDisks = disk;
1138  int blade = PixelEndcapName(DetId(id), pTT, isUpgrade).bladeName();
1139  int panel = PixelEndcapName(DetId(id), pTT, isUpgrade).pannelName();
1140  int module = PixelEndcapName(DetId(id), pTT, isUpgrade).plaquetteName();
1141 
1142  char sside[80];
1143  sprintf(sside, "HalfCylinder_%i", side);
1144  char sdisk[80];
1145  sprintf(sdisk, "Disk_%i", disk);
1146  char sblade[80];
1147  sprintf(sblade, "Blade_%02i", blade);
1148  char spanel[80];
1149  sprintf(spanel, "Panel_%i", panel);
1150  char smodule[80];
1151  sprintf(smodule, "Module_%i", module);
1152  std::string side_str = sside;
1153  std::string disk_str = sdisk;
1154  bool mask = side_str.find("HalfCylinder_1") != string::npos ||
1155  side_str.find("HalfCylinder_2") != string::npos ||
1156  side_str.find("HalfCylinder_4") != string::npos || disk_str.find("Disk_2") != string::npos;
1157  // clutch to take all of FPIX, but no BPIX:
1158  mask = false;
1159  if (isPIB && mask)
1160  continue;
1161 
1162  thePixelStructure.insert(pair<uint32_t, SiPixelDigiModule*>(id, theModule));
1163  } else if ((detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) && (isUpgrade)) {
1164  LogDebug("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
1165  uint32_t id = detId();
1166  SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
1167 
1169  int disk = PixelEndcapName(DetId(id), pTT, isUpgrade).diskName();
1170  if (disk > noOfDisks)
1171  noOfDisks = disk;
1172  int blade = PixelEndcapName(DetId(id), pTT, isUpgrade).bladeName();
1173  int panel = PixelEndcapName(DetId(id), pTT, isUpgrade).pannelName();
1174  int module = PixelEndcapName(DetId(id), pTT, isUpgrade).plaquetteName();
1175 
1176  char sside[80];
1177  sprintf(sside, "HalfCylinder_%i", side);
1178  char sdisk[80];
1179  sprintf(sdisk, "Disk_%i", disk);
1180  char sblade[80];
1181  sprintf(sblade, "Blade_%02i", blade);
1182  char spanel[80];
1183  sprintf(spanel, "Panel_%i", panel);
1184  char smodule[80];
1185  sprintf(smodule, "Module_%i", module);
1186  std::string side_str = sside;
1187  std::string disk_str = sdisk;
1188  bool mask = side_str.find("HalfCylinder_1") != string::npos ||
1189  side_str.find("HalfCylinder_2") != string::npos ||
1190  side_str.find("HalfCylinder_4") != string::npos || disk_str.find("Disk_2") != string::npos;
1191  // clutch to take all of FPIX, but no BPIX:
1192  mask = false;
1193  if (isPIB && mask)
1194  continue;
1195 
1196  thePixelStructure.insert(pair<uint32_t, SiPixelDigiModule*>(id, theModule));
1197  } //end_elseif(isUpgrade)
1198  }
1199  }
1200  LogInfo("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl;
1201 }
1202 //------------------------------------------------------------------
1203 // Book MEs
1204 //------------------------------------------------------------------
1206  // Get DQM interface
1208  char title[80];
1209  sprintf(title, "Rate of events with >%i digis;LumiSection;Rate [Hz]", bigEventSize);
1210  bigEventRate = iBooker.book1D("bigEventRate", title, 5000, 0., 5000.);
1211  char title1[80];
1212  sprintf(title1, "Pixel events vs. BX;BX;# events");
1213  pixEvtsPerBX = iBooker.book1D("pixEvtsPerBX", title1, 3565, 0., 3565.);
1214  char title2[80];
1215  sprintf(title2, "Rate of Pixel events;LumiSection;Rate [Hz]");
1216  pixEventRate = iBooker.book1D("pixEventRate", title2, 5000, 0., 5000.);
1217  char title3[80];
1218  sprintf(title3, "Number of Zero-Occupancy Barrel ROCs;LumiSection;N_{ZERO-OCCUPANCY} Barrel ROCs");
1219  noOccROCsBarrel = iBooker.book1D("noOccROCsBarrel", title3, 500, 0., 5000.);
1220  char title4[80];
1221  sprintf(title4, "Number of Low-Efficiency Barrel ROCs;LumiSection;N_{LO EFF} Barrel ROCs");
1222  loOccROCsBarrel = iBooker.book1D("loOccROCsBarrel", title4, 500, 0., 5000.);
1223  char title5[80];
1224  sprintf(title5, "Number of Zero-Occupancy Endcap ROCs;LumiSection;N_{ZERO-OCCUPANCY} Endcap ROCs");
1225  noOccROCsEndcap = iBooker.book1D("noOccROCsEndcap", title5, 500, 0., 5000.);
1226  char title6[80];
1227  sprintf(title6, "Number of Low-Efficiency Endcap ROCs;LumiSection;N_{LO EFF} Endcap ROCs");
1228  loOccROCsEndcap = iBooker.book1D("loOccROCsEndcap", title6, 500, 0., 5000.);
1229  char title7[80];
1230  sprintf(title7, "Average digi occupancy per FED;FED;NDigis/<NDigis>");
1231  char title8[80];
1232  sprintf(title8, "FED Digi Occupancy (NDigis/<NDigis>) vs LumiSections;Lumi Section;FED");
1233  if (modOn) {
1234  averageDigiOccupancy = iBooker.bookProfile("averageDigiOccupancy", title7, 40, -0.5, 39.5, 0., 3.);
1236  avgfedDigiOccvsLumi = iBooker.book2D("avgfedDigiOccvsLumi", title8, 640, 0., 3200., 40, -0.5, 39.5);
1237  avgBarrelFedOccvsLumi = iBooker.book1D(
1238  "avgBarrelFedOccvsLumi",
1239  "Average Barrel FED digi occupancy (<NDigis>) vs LumiSections;Lumi Section;Average digi occupancy per FED",
1240  320,
1241  0.,
1242  3200.);
1243  avgEndcapFedOccvsLumi = iBooker.book1D(
1244  "avgEndcapFedOccvsLumi",
1245  "Average Endcap FED digi occupancy (<NDigis>) vs LumiSections;Lumi Section;Average digi occupancy per FED",
1246  320,
1247  0.,
1248  3200.);
1249  }
1250  if (!modOn) {
1251  averageDigiOccupancy = iBooker.book1D(
1252  "averageDigiOccupancy", title7, 40, -0.5, 39.5); //Book as TH1 for offline to ensure thread-safe behaviour
1253  avgfedDigiOccvsLumi = iBooker.book2D("avgfedDigiOccvsLumi", title8, 3200, 0., 3200., 40, -0.5, 39.5);
1254  }
1255  std::map<uint32_t, SiPixelDigiModule*>::iterator struct_iter;
1256 
1257  SiPixelFolderOrganizer theSiPixelFolder(false);
1258 
1259  for (struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++) {
1261  if (modOn) {
1262  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 0, isUpgrade)) {
1263  (*struct_iter).second->book(conf_, iSetup, iBooker, 0, twoDimOn, hiRes, reducedSet, twoDimModOn, isUpgrade);
1264  } else {
1265  if (!isPIB)
1266  throw cms::Exception("LogicError") << "[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
1267  }
1268  }
1269  if (ladOn) {
1270  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 1, isUpgrade)) {
1271  (*struct_iter).second->book(conf_, iSetup, iBooker, 1, twoDimOn, hiRes, reducedSet, isUpgrade);
1272  } else {
1273  LogDebug("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n";
1274  }
1275  }
1276  if (layOn || twoDimOnlyLayDisk) {
1277  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 2, isUpgrade)) {
1278  (*struct_iter)
1279  .second->book(conf_, iSetup, iBooker, 2, twoDimOn, hiRes, reducedSet, twoDimOnlyLayDisk, isUpgrade);
1280  } else {
1281  LogDebug("PixelDQM") << "PROBLEM WITH LAYER-FOLDER\n";
1282  }
1283  }
1284 
1285  if (phiOn) {
1286  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 3, isUpgrade)) {
1287  (*struct_iter).second->book(conf_, iSetup, iBooker, 3, twoDimOn, hiRes, reducedSet, isUpgrade);
1288  } else {
1289  LogDebug("PixelDQM") << "PROBLEM WITH PHI-FOLDER\n";
1290  }
1291  }
1292  if (bladeOn) {
1293  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 4, isUpgrade)) {
1294  (*struct_iter).second->book(conf_, iSetup, iBooker, 4, twoDimOn, hiRes, reducedSet, isUpgrade);
1295  } else {
1296  LogDebug("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n";
1297  }
1298  }
1299  if (diskOn || twoDimOnlyLayDisk) {
1300  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 5, isUpgrade)) {
1301  (*struct_iter)
1302  .second->book(conf_, iSetup, iBooker, 5, twoDimOn, hiRes, reducedSet, twoDimOnlyLayDisk, isUpgrade);
1303  } else {
1304  LogDebug("PixelDQM") << "PROBLEM WITH DISK-FOLDER\n";
1305  }
1306  }
1307  if (ringOn) {
1308  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 6, isUpgrade)) {
1309  (*struct_iter).second->book(conf_, iSetup, iBooker, 6, twoDimOn, hiRes, reducedSet, isUpgrade);
1310  } else {
1311  LogDebug("PixelDQM") << "PROBLEM WITH RING-FOLDER\n";
1312  }
1313  }
1314  }
1315  iBooker.cd(topFolderName_ + "/Barrel");
1316  meNDigisCOMBBarrel_ = iBooker.book1D("ALLMODS_ndigisCOMB_Barrel", "Number of Digis", 200, 0., 400.);
1317  meNDigisCOMBBarrel_->setAxisTitle("Number of digis per module per event", 1);
1318  meNDigisCHANBarrel_ = iBooker.book1D("ALLMODS_ndigisCHAN_Barrel", "Number of Digis", 100, 0., 1000.);
1319  meNDigisCHANBarrel_->setAxisTitle("Number of digis per FED channel per event", 1);
1320  std::stringstream ss1, ss2;
1321  for (int i = 1; i <= noOfLayers; i++) {
1322  ss1.str(std::string());
1323  ss1 << "ALLMODS_ndigisCHAN_BarrelL" << i;
1324  ss2.str(std::string());
1325  ss2 << "Number of Digis L" << i;
1326  meNDigisCHANBarrelLs_.push_back(iBooker.book1D(ss1.str(), ss2.str(), 100, 0., 1000.));
1327  meNDigisCHANBarrelLs_.at(i - 1)->setAxisTitle("Number of digis per FED channel per event", 1);
1328  }
1329  meNDigisCHANBarrelCh1_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh1", "Number of Digis Ch1", 100, 0., 1000.);
1330  meNDigisCHANBarrelCh1_->setAxisTitle("Number of digis per FED channel per event", 1);
1331  meNDigisCHANBarrelCh2_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh2", "Number of Digis Ch2", 100, 0., 1000.);
1332  meNDigisCHANBarrelCh2_->setAxisTitle("Number of digis per FED channel per event", 1);
1333  meNDigisCHANBarrelCh3_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh3", "Number of Digis Ch3", 100, 0., 1000.);
1334  meNDigisCHANBarrelCh3_->setAxisTitle("Number of digis per FED channel per event", 1);
1335  meNDigisCHANBarrelCh4_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh4", "Number of Digis Ch4", 100, 0., 1000.);
1336  meNDigisCHANBarrelCh4_->setAxisTitle("Number of digis per FED channel per event", 1);
1337  meNDigisCHANBarrelCh5_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh5", "Number of Digis Ch5", 100, 0., 1000.);
1338  meNDigisCHANBarrelCh5_->setAxisTitle("Number of digis per FED channel per event", 1);
1339  meNDigisCHANBarrelCh6_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh6", "Number of Digis Ch6", 100, 0., 1000.);
1340  meNDigisCHANBarrelCh6_->setAxisTitle("Number of digis per FED channel per event", 1);
1341  meNDigisCHANBarrelCh7_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh7", "Number of Digis Ch7", 100, 0., 1000.);
1342  meNDigisCHANBarrelCh7_->setAxisTitle("Number of digis per FED channel per event", 1);
1343  meNDigisCHANBarrelCh8_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh8", "Number of Digis Ch8", 100, 0., 1000.);
1344  meNDigisCHANBarrelCh8_->setAxisTitle("Number of digis per FED channel per event", 1);
1345  meNDigisCHANBarrelCh9_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh9", "Number of Digis Ch9", 100, 0., 1000.);
1346  meNDigisCHANBarrelCh9_->setAxisTitle("Number of digis per FED channel per event", 1);
1347  meNDigisCHANBarrelCh10_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh10", "Number of Digis Ch10", 100, 0., 1000.);
1348  meNDigisCHANBarrelCh10_->setAxisTitle("Number of digis per FED channel per event", 1);
1349  meNDigisCHANBarrelCh11_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh11", "Number of Digis Ch11", 100, 0., 1000.);
1350  meNDigisCHANBarrelCh11_->setAxisTitle("Number of digis per FED channel per event", 1);
1351  meNDigisCHANBarrelCh12_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh12", "Number of Digis Ch12", 100, 0., 1000.);
1352  meNDigisCHANBarrelCh12_->setAxisTitle("Number of digis per FED channel per event", 1);
1353  meNDigisCHANBarrelCh13_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh13", "Number of Digis Ch13", 100, 0., 1000.);
1354  meNDigisCHANBarrelCh13_->setAxisTitle("Number of digis per FED channel per event", 1);
1355  meNDigisCHANBarrelCh14_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh14", "Number of Digis Ch14", 100, 0., 1000.);
1356  meNDigisCHANBarrelCh14_->setAxisTitle("Number of digis per FED channel per event", 1);
1357  meNDigisCHANBarrelCh15_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh15", "Number of Digis Ch15", 100, 0., 1000.);
1358  meNDigisCHANBarrelCh15_->setAxisTitle("Number of digis per FED channel per event", 1);
1359  meNDigisCHANBarrelCh16_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh16", "Number of Digis Ch16", 100, 0., 1000.);
1360  meNDigisCHANBarrelCh16_->setAxisTitle("Number of digis per FED channel per event", 1);
1361  meNDigisCHANBarrelCh17_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh17", "Number of Digis Ch17", 100, 0., 1000.);
1362  meNDigisCHANBarrelCh17_->setAxisTitle("Number of digis per FED channel per event", 1);
1363  meNDigisCHANBarrelCh18_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh18", "Number of Digis Ch18", 100, 0., 1000.);
1364  meNDigisCHANBarrelCh18_->setAxisTitle("Number of digis per FED channel per event", 1);
1365  meNDigisCHANBarrelCh19_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh19", "Number of Digis Ch19", 100, 0., 1000.);
1366  meNDigisCHANBarrelCh19_->setAxisTitle("Number of digis per FED channel per event", 1);
1367  meNDigisCHANBarrelCh20_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh20", "Number of Digis Ch20", 100, 0., 1000.);
1368  meNDigisCHANBarrelCh20_->setAxisTitle("Number of digis per FED channel per event", 1);
1369  meNDigisCHANBarrelCh21_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh21", "Number of Digis Ch21", 100, 0., 1000.);
1370  meNDigisCHANBarrelCh21_->setAxisTitle("Number of digis per FED channel per event", 1);
1371  meNDigisCHANBarrelCh22_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh22", "Number of Digis Ch22", 100, 0., 1000.);
1372  meNDigisCHANBarrelCh22_->setAxisTitle("Number of digis per FED channel per event", 1);
1373  meNDigisCHANBarrelCh23_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh23", "Number of Digis Ch23", 100, 0., 1000.);
1374  meNDigisCHANBarrelCh23_->setAxisTitle("Number of digis per FED channel per event", 1);
1375  meNDigisCHANBarrelCh24_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh24", "Number of Digis Ch24", 100, 0., 1000.);
1376  meNDigisCHANBarrelCh24_->setAxisTitle("Number of digis per FED channel per event", 1);
1377  meNDigisCHANBarrelCh25_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh25", "Number of Digis Ch25", 100, 0., 1000.);
1378  meNDigisCHANBarrelCh25_->setAxisTitle("Number of digis per FED channel per event", 1);
1379  meNDigisCHANBarrelCh26_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh26", "Number of Digis Ch26", 100, 0., 1000.);
1380  meNDigisCHANBarrelCh26_->setAxisTitle("Number of digis per FED channel per event", 1);
1381  meNDigisCHANBarrelCh27_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh27", "Number of Digis Ch27", 100, 0., 1000.);
1382  meNDigisCHANBarrelCh27_->setAxisTitle("Number of digis per FED channel per event", 1);
1383  meNDigisCHANBarrelCh28_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh28", "Number of Digis Ch28", 100, 0., 1000.);
1384  meNDigisCHANBarrelCh28_->setAxisTitle("Number of digis per FED channel per event", 1);
1385  meNDigisCHANBarrelCh29_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh29", "Number of Digis Ch29", 100, 0., 1000.);
1386  meNDigisCHANBarrelCh29_->setAxisTitle("Number of digis per FED channel per event", 1);
1387  meNDigisCHANBarrelCh30_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh30", "Number of Digis Ch30", 100, 0., 1000.);
1388  meNDigisCHANBarrelCh30_->setAxisTitle("Number of digis per FED channel per event", 1);
1389  meNDigisCHANBarrelCh31_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh31", "Number of Digis Ch31", 100, 0., 1000.);
1390  meNDigisCHANBarrelCh31_->setAxisTitle("Number of digis per FED channel per event", 1);
1391  meNDigisCHANBarrelCh32_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh32", "Number of Digis Ch32", 100, 0., 1000.);
1392  meNDigisCHANBarrelCh32_->setAxisTitle("Number of digis per FED channel per event", 1);
1393  meNDigisCHANBarrelCh33_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh33", "Number of Digis Ch33", 100, 0., 1000.);
1394  meNDigisCHANBarrelCh33_->setAxisTitle("Number of digis per FED channel per event", 1);
1395  meNDigisCHANBarrelCh34_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh34", "Number of Digis Ch34", 100, 0., 1000.);
1396  meNDigisCHANBarrelCh34_->setAxisTitle("Number of digis per FED channel per event", 1);
1397  meNDigisCHANBarrelCh35_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh35", "Number of Digis Ch35", 100, 0., 1000.);
1398  meNDigisCHANBarrelCh35_->setAxisTitle("Number of digis per FED channel per event", 1);
1399  meNDigisCHANBarrelCh36_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh36", "Number of Digis Ch36", 100, 0., 1000.);
1400  meNDigisCHANBarrelCh36_->setAxisTitle("Number of digis per FED channel per event", 1);
1401  iBooker.cd(topFolderName_ + "/Endcap");
1402  meNDigisCOMBEndcap_ = iBooker.book1D("ALLMODS_ndigisCOMB_Endcap", "Number of Digis", 200, 0., 400.);
1403  meNDigisCOMBEndcap_->setAxisTitle("Number of digis per module per event", 1);
1404  meNDigisCHANEndcap_ = iBooker.book1D("ALLMODS_ndigisCHAN_Endcap", "Number of Digis", 100, 0., 1000.);
1405  meNDigisCHANEndcap_->setAxisTitle("Number of digis per FED channel per event", 1);
1406  for (int i = 1; i <= noOfDisks; i++) {
1407  ss1.str(std::string());
1408  ss1 << "ALLMODS_ndigisCHAN_EndcapDp" << i;
1409  ss2.str(std::string());
1410  ss2 << "Number of Digis Disk p" << i;
1411  meNDigisCHANEndcapDps_.push_back(iBooker.book1D(ss1.str(), ss2.str(), 100, 0., 1000.));
1412  meNDigisCHANEndcapDps_.at(i - 1)->setAxisTitle("Number of digis per FED channel per event", 1);
1413  }
1414  for (int i = 1; i <= noOfDisks; i++) {
1415  ss1.str(std::string());
1416  ss1 << "ALLMODS_ndigisCHAN_EndcapDm" << i;
1417  ss2.str(std::string());
1418  ss2 << "Number of Digis Disk m" << i;
1419  meNDigisCHANEndcapDms_.push_back(iBooker.book1D(ss1.str(), ss2.str(), 100, 0., 1000.));
1420  meNDigisCHANEndcapDms_.at(i - 1)->setAxisTitle("Number of digis per FED channel per event", 1);
1421  }
1422  iBooker.cd(topFolderName_);
1423 }
1424 
1426  std::pair<int, int> tempPair = mod->getZeroLoEffROCs();
1427 
1428  if (barrel) {
1429  NzeroROCs[0] += tempPair.first;
1430  NloEffROCs[0] += tempPair.second;
1431  } else {
1432  NzeroROCs[1] += tempPair.first;
1433  NloEffROCs[1] += tempPair.second;
1434  }
1435 
1436  DoZeroRocs = false;
1437  mod->resetRocMap(); //once got the number of ZeroOccupancy Rocs, reset the ROC map of the corresponding Pixel substructure
1438 }
1439 
1440 //define this as a plug-in
#define LogDebug(id)
int plaquetteName() const
plaquetteId (in pannel)
void dqmEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
LuminosityBlockID id() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
Definition: DQMStore.cc:239
T getParameter(std::string const &) const
MonitorElement * meNDigisCHANBarrelCh19_
MonitorElement * meNDigisCHANBarrelCh35_
MonitorElement * meNDigisCHANBarrelCh2_
MonitorElement * meNDigisCHANBarrelCh30_
MonitorElement * meNDigisCHANBarrelCh31_
MonitorElement * meNDigisCHANBarrelCh8_
MonitorElement * meNDigisCHANBarrelCh36_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:418
MonitorElement * loOccROCsEndcap
MonitorElement * meNDigisCHANBarrelCh17_
MonitorElement * meNDigisCHANBarrelCh25_
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
MonitorElement * meNDigisCHANBarrelCh6_
MonitorElement * meNDigisCOMBBarrel_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
void setLumiFlag()
this ME is meant to be stored for each luminosity section
int bunchCrossing() const
Definition: EventBase.h:64
std::string topFolderName_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
MonitorElement * meNDigisCOMBEndcap_
std::pair< int, int > getZeroLoEffROCs()
MonitorElement * meNDigisCHANBarrelCh14_
MonitorElement * meNDigisCHANBarrelCh12_
MonitorElement * meNDigisCHANBarrelCh29_
static std::string const input
Definition: EdmProvDump.cc:48
MonitorElement * avgBarrelFedOccvsLumi
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > srcToken_
MonitorElement * meNDigisCHANBarrelCh27_
void Fill(long long x)
int bladeName() const
blade id
virtual void bookMEs(DQMStore::IBooker &, const edm::EventSetup &iSetup)
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
SiPixelDigiSource(const edm::ParameterSet &conf)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
MonitorElement * meNDigisCHANBarrelCh3_
MonitorElement * meNDigisCHANBarrelCh9_
MonitorElement * meNDigisCHANBarrelCh4_
MonitorElement * meNDigisCHANBarrelCh34_
MonitorElement * meNDigisCHANBarrelCh26_
bool setModuleFolder(const uint32_t &rawdetid=0, int type=0, bool isUpgrade=false)
Set folder name for a module or plaquette.
MonitorElement * noOccROCsBarrel
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
Definition: DQMStore.cc:333
MonitorElement * meNDigisCHANEndcap_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
void dqmBeginRun(const edm::Run &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh28_
~SiPixelDigiSource() override
MonitorElement * noOccROCsEndcap
MonitorElement * meNDigisCHANBarrel_
std::vector< MonitorElement * > meNDigisCHANEndcapDms_
std::map< uint32_t, SiPixelDigiModule * > thePixelStructure
MonitorElement * meNDigisCHANBarrelCh33_
MonitorElement * pixEventRate
MonitorElement * meNDigisCHANBarrelCh21_
unsigned int I_detId[1856]
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * meNDigisCHANBarrelCh32_
MonitorElement * meNDigisCHANBarrelCh10_
MonitorElement * loOccROCsBarrel
MonitorElement * meNDigisCHANBarrelCh1_
MonitorElement * averageDigiOccupancy
Definition: DetId.h:17
MonitorElement * meNDigisCHANBarrelCh5_
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh7_
MonitorElement * meNDigisCHANBarrelCh15_
MonitorElement * meNDigisCHANBarrelCh13_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
MonitorElement * meNDigisCHANBarrelCh23_
int layerName() const
layer id
LuminosityBlockNumber_t luminosityBlock() const
Shell shell() const
MonitorElement * meNDigisCHANBarrelCh18_
MonitorElement * bigEventRate
HLT enums.
MonitorElement * meNDigisCHANBarrelCh20_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Definition: DQMStore.cc:266
MonitorElement * avgfedDigiOccvsLumi
edm::ParameterSet conf_
int pannelName() const
pannel id
T get() const
Definition: EventSetup.h:73
MonitorElement * meNDigisCHANBarrelCh22_
int diskName() const
disk id
Definition: shell.py:1
MonitorElement * avgEndcapFedOccvsLumi
std::vector< MonitorElement * > meNDigisCHANEndcapDps_
MonitorElement * pixEvtsPerBX
void dqmBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
std::vector< MonitorElement * > meNDigisCHANBarrelLs_
HalfCylinder halfCylinder() const
MonitorElement * meNDigisCHANBarrelCh16_
MonitorElement * meNDigisCHANBarrelCh11_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
modOn
online/offline RawDataErrors
T const * product() const
Definition: ESHandle.h:86
Definition: vlib.h:198
virtual void CountZeroROCsInSubstructure(bool, bool &, SiPixelDigiModule *)
virtual void buildStructure(edm::EventSetup const &)
std::string I_name[1856]
MonitorElement * meNDigisCHANBarrelCh24_
Definition: Run.h:45
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)