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