CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
23 // DQM Framework
26 // Geometry
32 // DataFormats
39 //
40 #include <string>
41 #include <stdlib.h>
42 #include <iostream>
43 #include <fstream>
44 
45 using namespace std;
46 using namespace edm;
47 
49  conf_(iConfig),
50  src_( conf_.getParameter<edm::InputTag>( "src" ) ),
51  saveFile( conf_.getUntrackedParameter<bool>("saveFile",false) ),
52  isPIB( conf_.getUntrackedParameter<bool>("isPIB",false) ),
53  slowDown( conf_.getUntrackedParameter<bool>("slowDown",false) ),
54  modOn( conf_.getUntrackedParameter<bool>("modOn",true) ),
55  twoDimOn( conf_.getUntrackedParameter<bool>("twoDimOn",true) ),
56  twoDimModOn( conf_.getUntrackedParameter<bool>("twoDimModOn",true) ),
57  twoDimOnlyLayDisk( conf_.getUntrackedParameter<bool>("twoDimOnlyLayDisk",false) ),
58  hiRes( conf_.getUntrackedParameter<bool>("hiRes",false) ),
59  reducedSet( conf_.getUntrackedParameter<bool>("reducedSet",false) ),
60  ladOn( conf_.getUntrackedParameter<bool>("ladOn",false) ),
61  layOn( conf_.getUntrackedParameter<bool>("layOn",false) ),
62  phiOn( conf_.getUntrackedParameter<bool>("phiOn",false) ),
63  ringOn( conf_.getUntrackedParameter<bool>("ringOn",false) ),
64  bladeOn( conf_.getUntrackedParameter<bool>("bladeOn",false) ),
65  diskOn( conf_.getUntrackedParameter<bool>("diskOn",false) ),
66  bigEventSize( conf_.getUntrackedParameter<int>("bigEventSize",1000) ),
67  isUpgrade( conf_.getUntrackedParameter<bool>("isUpgrade",false) ),
68  noOfLayers(0),
69  noOfDisks(0)
70 {
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) { nTOTmodules=1856; } else { nTOTmodules=1440; }
83  while(!infile.eof()&&nModsInFile<nTOTmodules) {
84  infile >> I_name[nModsInFile] >> I_detId[nModsInFile] >> I_fedId[nModsInFile] >> I_linkId1[nModsInFile] >> I_linkId2[nModsInFile];
85  nModsInFile++;
86  }
87  infile.close();
88 
89  LogInfo ("PixelDQM") << "SiPixelDigiSource::SiPixelDigiSource: Got DQM BackEnd interface"<<endl;
90 }
91 
92 
94 {
95  // do anything here that needs to be done at desctruction time
96  // (e.g. close files, deallocate resources etc.)
97  LogInfo ("PixelDQM") << "SiPixelDigiSource::~SiPixelDigiSource: Destructor"<<endl;
98 }
99 
100 
102  LogInfo ("PixelDQM") << " SiPixelDigiSource::beginJob - Initialisation ... " << std::endl;
103  LogInfo ("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/"
104  << layOn << "/" << phiOn << std::endl;
105  LogInfo ("PixelDQM") << "Blade/Disk/Ring" << bladeOn << "/" << diskOn << "/"
106  << ringOn << std::endl;
107 
108  LogInfo ("PixelDQM") << "2DIM IS " << twoDimOn << " and set to high resolution? " << hiRes << "\n";
109 
110  if(firstRun){
111  eventNo = 0;
112  lumSec = 0;
113  nLumiSecs = 0;
114  nBigEvents = 0;
115  nBPIXDigis = 0;
116  nFPIXDigis = 0;
117  for(int i=0; i!=40; i++) nDigisPerFed[i]=0;
118  for(int i=0; i!=4; i++) nDigisPerDisk[i]=0;
119  nDP1P1M1 = 0;
120  nDP1P1M2 = 0;
121  nDP1P1M3 = 0;
122  nDP1P1M4 = 0;
123  nDP1P2M1 = 0;
124  nDP1P2M2 = 0;
125  nDP1P2M3 = 0;
126  nDP2P1M1 = 0;
127  nDP2P1M2 = 0;
128  nDP2P1M3 = 0;
129  nDP2P1M4 = 0;
130  nDP2P2M1 = 0;
131  nDP2P2M2 = 0;
132  nDP2P2M3 = 0;
133  nDP3P1M1 = 0;
134  nDP3P2M1 = 0;
135  nDM1P1M1 = 0;
136  nDM1P1M2 = 0;
137  nDM1P1M3 = 0;
138  nDM1P1M4 = 0;
139  nDM1P2M1 = 0;
140  nDM1P2M2 = 0;
141  nDM1P2M3 = 0;
142  nDM2P1M1 = 0;
143  nDM2P1M2 = 0;
144  nDM2P1M3 = 0;
145  nDM2P1M4 = 0;
146  nDM2P2M1 = 0;
147  nDM2P2M2 = 0;
148  nDM2P2M3 = 0;
149  nDM3P1M1 = 0;
150  nDM3P2M1 = 0;
151  nL1M1 = 0;
152  nL1M2 = 0;
153  nL1M3 = 0;
154  nL1M4 = 0;
155  nL2M1 = 0;
156  nL2M2 = 0;
157  nL2M3 = 0;
158  nL2M4 = 0;
159  nL3M1 = 0;
160  nL3M2 = 0;
161  nL3M3 = 0;
162  nL3M4 = 0;
163  nL4M1 = 0;
164  nL4M2 = 0;
165  nL4M3 = 0;
166  nL4M4 = 0;
167 
168  // Build map
169  buildStructure(iSetup);
170  // Book Monitoring Elements
171  firstRun = false;
172  }
173 }
174 
176  bookMEs(iBooker, iSetup);
177 }
178 
179 //------------------------------------------------------------------
180 // Method called for every event
181 //------------------------------------------------------------------
183 {
184  edm::ESHandle<TrackerTopology> tTopoHandle;
185  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
186  const TrackerTopology *pTT = tTopoHandle.product();
187 
188  eventNo++;
189 
190  // get input data
192  iEvent.getByToken(srcToken_, input);
193  if (!input.isValid()) return;
194 
195 
196  int bx = iEvent.bunchCrossing();
197 
198  int lumiSection = (int)iEvent.luminosityBlock();
199  int nEventDigis = 0; int nActiveModules = 0;
200 
201  if(modOn){
202  if(averageDigiOccupancy && lumiSection%8==0){
204  nBPIXDigis = 0;
205  nFPIXDigis = 0;
206  for(int i=0; i!=40; i++) nDigisPerFed[i]=0;
207  }
208  }
209  if(!modOn){
210  if(averageDigiOccupancy && lumiSection%1==0){
212  nBPIXDigis = 0;
213  nFPIXDigis = 0;
214  for(int i=0; i!=40; i++) nDigisPerFed[i]=0;
215  }
216  }
217 
218  std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
219  for(int i=0; i!=192; i++) numberOfDigis[i]=0;
220  for(int i=0; i!=1152; i++) nDigisPerChan[i]=0;
221  for(int i=0; i!=4; i++) nDigisPerDisk[i]=0;
222  int NzeroROCs[2] = {0,-672};
223  int NloEffROCs[2] = {0,-672};
224  for (struct_iter = thePixelStructure.begin() ; struct_iter != thePixelStructure.end() ; struct_iter++) {
225  int numberOfDigisMod = (*struct_iter).second->fill(*input, iSetup,
227  modOn, ladOn, layOn, phiOn,
228  bladeOn, diskOn, ringOn,
231  if (modOn && twoDimOnlyLayDisk && lumiSection%10 == 0) (*struct_iter).second->resetRocMap();
232 
233  bool barrel = DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
234  bool endcap = DetId((*struct_iter).first).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
235  if(numberOfDigisMod>0){
236  nEventDigis = nEventDigis + numberOfDigisMod;
237  nActiveModules++;
238  int nBPiXmodules;
239  int nTOTmodules;
240  if (isUpgrade) {
241  nBPiXmodules=1184;
242  nTOTmodules=1856;
243  } else {
244  nBPiXmodules=768;
245  nTOTmodules=1440;
246  }
247  if(barrel){ // Barrel
248  nBPIXDigis = nBPIXDigis + numberOfDigisMod;
249  for(int i=0; i!=nBPiXmodules; ++i){
250  if((*struct_iter).first == I_detId[i]){
251  nDigisPerFed[I_fedId[i]]=nDigisPerFed[I_fedId[i]]+numberOfDigisMod;
252  int index1 = 0; int index2 = 0;
253  if(I_linkId1[i]>0) index1 = I_fedId[i]*36+(I_linkId1[i]-1);
254  if(I_linkId2[i]>0) index2 = I_fedId[i]*36+(I_linkId2[i]-1);
255  if(nDigisA>0 && I_linkId1[i]>0) nDigisPerChan[index1]=nDigisPerChan[index1]+nDigisA;
256  if(nDigisB>0 && I_linkId2[i]>0) nDigisPerChan[index2]=nDigisPerChan[index2]+nDigisB;
257  i=(nBPiXmodules-1);
258  }
259  }
260  }else if(endcap && !isUpgrade){ // Endcap
261  nFPIXDigis = nFPIXDigis + numberOfDigisMod;
262  PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).halfCylinder();
263  int disk = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).diskName();
264  int blade = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).bladeName();
265  int panel = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).pannelName();
266  int module = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).plaquetteName();
267  int iter=0; int i=0;
268  if(side==PixelEndcapName::mI){
269  if(disk==1){
270  i=0;
271  if(panel==1){ if(module==1) nDM1P1M1+=numberOfDigisMod;
272  else if(module==2) nDM1P1M2+=numberOfDigisMod;
273  else if(module==3) nDM1P1M3+=numberOfDigisMod;
274  else if(module==4) nDM1P1M4+=numberOfDigisMod;}
275  else if(panel==2){ if(module==1) nDM1P2M1+=numberOfDigisMod;
276  else if(module==2) nDM1P2M2+=numberOfDigisMod;
277  else if(module==3) nDM1P2M3+=numberOfDigisMod; }
278  if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
279  }else if(disk==2){
280  i=24;
281  if(panel==1){ if(module==1) nDM2P1M1+=numberOfDigisMod;
282  else if(module==2) nDM2P1M2+=numberOfDigisMod;
283  else if(module==3) nDM2P1M3+=numberOfDigisMod;
284  else if(module==4) nDM2P1M4+=numberOfDigisMod;}
285  else if(panel==2){ if(module==1) nDM2P2M1+=numberOfDigisMod;
286  else if(module==2) nDM2P2M2+=numberOfDigisMod;
287  else if(module==3) nDM2P2M3+=numberOfDigisMod; }
288  if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
289  }
290  }else if(side==PixelEndcapName::mO){
291  if(disk==1){
292  i=48;
293  if(panel==1){ if(module==1) nDM1P1M1+=numberOfDigisMod;
294  else if(module==2) nDM1P1M2+=numberOfDigisMod;
295  else if(module==3) nDM1P1M3+=numberOfDigisMod;
296  else if(module==4) nDM1P1M4+=numberOfDigisMod;}
297  else if(panel==2){ if(module==1) nDM1P2M1+=numberOfDigisMod;
298  else if(module==2) nDM1P2M2+=numberOfDigisMod;
299  else if(module==3) nDM1P2M3+=numberOfDigisMod; }
300  if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
301  }else if(disk==2){
302  i=72;
303  if(panel==1){ if(module==1) nDM2P1M1+=numberOfDigisMod;
304  else if(module==2) nDM2P1M2+=numberOfDigisMod;
305  else if(module==3) nDM2P1M3+=numberOfDigisMod;
306  else if(module==4) nDM2P1M4+=numberOfDigisMod;}
307  else if(panel==2){ if(module==1) nDM2P2M1+=numberOfDigisMod;
308  else if(module==2) nDM2P2M2+=numberOfDigisMod;
309  else if(module==3) nDM2P2M3+=numberOfDigisMod; }
310  if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
311  }
312  }else if(side==PixelEndcapName::pI){
313  if(disk==1){
314  i=96;
315  if(panel==1){ if(module==1) nDP1P1M1+=numberOfDigisMod;
316  else if(module==2) nDP1P1M2+=numberOfDigisMod;
317  else if(module==3) nDP1P1M3+=numberOfDigisMod;
318  else if(module==4) nDP1P1M4+=numberOfDigisMod;}
319  else if(panel==2){ if(module==1) nDP1P2M1+=numberOfDigisMod;
320  else if(module==2) nDP1P2M2+=numberOfDigisMod;
321  else if(module==3) nDP1P2M3+=numberOfDigisMod; }
322  if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
323  }else if(disk==2){
324  i=120;
325  if(panel==1){ if(module==1) nDP2P1M1+=numberOfDigisMod;
326  else if(module==2) nDP2P1M2+=numberOfDigisMod;
327  else if(module==3) nDP2P1M3+=numberOfDigisMod;
328  else if(module==4) nDP2P1M4+=numberOfDigisMod;}
329  else if(panel==2){ if(module==1) nDP2P2M1+=numberOfDigisMod;
330  else if(module==2) nDP2P2M2+=numberOfDigisMod;
331  else if(module==3) nDP2P2M3+=numberOfDigisMod; }
332  if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
333  }
334  }else if(side==PixelEndcapName::pO){
335  if(disk==1){
336  i=144;
337  if(panel==1){ if(module==1) nDP1P1M1+=numberOfDigisMod;
338  else if(module==2) nDP1P1M2+=numberOfDigisMod;
339  else if(module==3) nDP1P1M3+=numberOfDigisMod;
340  else if(module==4) nDP1P1M4+=numberOfDigisMod;}
341  else if(panel==2){ if(module==1) nDP1P2M1+=numberOfDigisMod;
342  else if(module==2) nDP1P2M2+=numberOfDigisMod;
343  else if(module==3) nDP1P2M3+=numberOfDigisMod; }
344  if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
345  }else if(disk==2){
346  i=168;
347  if(panel==1){ if(module==1) nDP2P1M1+=numberOfDigisMod;
348  else if(module==2) nDP2P1M2+=numberOfDigisMod;
349  else if(module==3) nDP2P1M3+=numberOfDigisMod;
350  else if(module==4) nDP2P1M4+=numberOfDigisMod;}
351  else if(panel==2){ if(module==1) nDP2P2M1+=numberOfDigisMod;
352  else if(module==2) nDP2P2M2+=numberOfDigisMod;
353  else if(module==3) nDP2P2M3+=numberOfDigisMod; }
354  if(blade<13 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
355  }
356  }
357  numberOfDigis[iter]=numberOfDigis[iter]+numberOfDigisMod;
358 
359  for(int i=nBPiXmodules; i!=nTOTmodules; i++){
360  if((*struct_iter).first == I_detId[i]){
361  nDigisPerFed[I_fedId[i]]=nDigisPerFed[I_fedId[i]]+numberOfDigisMod;
362  i=nTOTmodules-1;
363  }
364  }
365  } //endif Barrel/(Endcap && !isUpgrade)
366  else if (endcap && isUpgrade) {
367  nFPIXDigis = nFPIXDigis + numberOfDigisMod;
368  PixelEndcapName::HalfCylinder side = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).halfCylinder();
369  int disk = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).diskName();
370  int blade = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).bladeName();
371  int panel = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).pannelName();
372  int module = PixelEndcapName(DetId((*struct_iter).first),pTT,isUpgrade).plaquetteName();
373 
374  int iter=0; int i=0;
375  if(side==PixelEndcapName::mI){
376  if(disk==1){
377  i=0;
378  if(panel==1){ if(module==1) nDM1P1M1+=numberOfDigisMod; }
379  else if(panel==2){ if(module==1) nDM1P2M1+=numberOfDigisMod; }
380  if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
381  }else if(disk==2){
382  i=22;
383  if(panel==1){ if(module==1) nDM2P1M1+=numberOfDigisMod; }
384  else if(panel==2){ if(module==1) nDM2P2M1+=numberOfDigisMod; }
385  if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
386  }else if(disk==3){
387  i=44;
388  if(panel==1){ if(module==1) nDM3P1M1+=numberOfDigisMod; }
389  else if(panel==2){ if(module==1) nDM3P2M1+=numberOfDigisMod; }
390  if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
391  }
392  }else if(side==PixelEndcapName::mO){
393  if(disk==1){
394  i=66;
395  if(panel==1){ if(module==1) nDM1P1M1+=numberOfDigisMod; }
396  else if(panel==2){ if(module==1) nDM1P2M1+=numberOfDigisMod; }
397  if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
398  }else if(disk==2){
399  i=100;
400  if(panel==1){ if(module==1) nDM2P1M1+=numberOfDigisMod; }
401  else if(panel==2){ if(module==1) nDM2P2M1+=numberOfDigisMod; }
402  if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
403  }else if (disk==3){
404  i=134;
405  if(panel==1){ if(module==1) nDM3P1M1+=numberOfDigisMod; }
406  else if(panel==2){ if(module==1) nDM3P2M1+=numberOfDigisMod; }
407  if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
408  }
409  }else if(side==PixelEndcapName::pI){
410  if(disk==1){
411  i=168;
412  if(panel==1){ if(module==1) nDP1P1M1+=numberOfDigisMod; }
413  else if(panel==2){ if(module==1) nDP1P2M1+=numberOfDigisMod; }
414  if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
415  }else if(disk==2){
416  i=190;
417  if(panel==1){ if(module==1) nDP2P1M1+=numberOfDigisMod; }
418  else if(panel==2){ if(module==1) nDP2P2M1+=numberOfDigisMod; }
419  if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
420  }else if(disk==3){
421  i=212;
422  if(panel==1){ if(module==1) nDP3P1M1+=numberOfDigisMod; }
423  else if(panel==2){ if(module==1) nDP3P2M1+=numberOfDigisMod; }
424  if(blade<12 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
425  }
426  }else if(side==PixelEndcapName::pO){
427  if(disk==1){
428  i=234;
429  if(panel==1){ if(module==1) nDP1P1M1+=numberOfDigisMod; }
430  else if(panel==2){ if(module==1) nDP1P2M1+=numberOfDigisMod; }
431  if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
432  }else if(disk==2){
433  i=268;
434  if(panel==1){ if(module==1) nDP2P1M1+=numberOfDigisMod; }
435  else if(panel==2){ if(module==1) nDP2P2M1+=numberOfDigisMod; }
436  if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
437  }else if(disk==3){
438  i=302;
439  if(panel==1){ if(module==1) nDP3P1M1+=numberOfDigisMod; }
440  else if(panel==2){ if(module==1) nDP3P2M1+=numberOfDigisMod; }
441  if(blade<18 && blade>0 && (panel==1 || panel==2)) iter = i+2*(blade-1)+(panel-1);
442  }
443  }
444  numberOfDigis[iter]=numberOfDigis[iter]+numberOfDigisMod;
445  for(int i=nBPiXmodules; i!=nTOTmodules; i++){
446  if((*struct_iter).first == I_detId[i]){
447  nDigisPerFed[I_fedId[i]]=nDigisPerFed[I_fedId[i]]+numberOfDigisMod;
448  i=nTOTmodules-1;
449  }
450  }
451  }//endif(Endcap && isUpgrade)
452  } // endif any digis in this module
453  if (twoDimOnlyLayDisk && lumiSection%10 > 2){
454  std::pair<int,int> tempPair = (*struct_iter).second->getZeroLoEffROCs();
455  if (barrel){
456  NzeroROCs[0] += tempPair.first;
457  NloEffROCs[0] += tempPair.second;
458  }
459  else if (endcap){
460  NzeroROCs[1] += tempPair.first;
461  NloEffROCs[1] += tempPair.second;
462  }
463  }
464  } // endfor loop over all modules
465 
466  if (lumiSection%10> 2){
467  for (int i =0; i < 2; ++i) NloEffROCs[i] = NloEffROCs[i] - NzeroROCs[i];
468  if(noOccROCsBarrel) noOccROCsBarrel->setBinContent(1+lumiSection/10, NzeroROCs[0]);
469  if(loOccROCsBarrel) loOccROCsBarrel->setBinContent(1+lumiSection/10, NloEffROCs[0]);
470  if(noOccROCsEndcap) noOccROCsEndcap->setBinContent(1+lumiSection/10, NzeroROCs[1]);
471  if(loOccROCsEndcap) loOccROCsEndcap->setBinContent(1+lumiSection/10, NloEffROCs[1]);
472  }
473 
474  if (noOfDisks == 2) { // if (!isUpgrade)
475  if(meNDigisCHANEndcap_){ for(int j=0; j!=192; j++) if(numberOfDigis[j]>0) meNDigisCHANEndcap_->Fill((float)numberOfDigis[j]);}
476  if(meNDigisCHANEndcapDms_.at(0)){ for(int j=0; j!=72; j++) if((j<24||j>47)&&numberOfDigis[j]>0) meNDigisCHANEndcapDms_.at(0)->Fill((float)numberOfDigis[j]);}
477  if(meNDigisCHANEndcapDms_.at(1)){ for(int j=24; j!=96; j++) if((j<48||j>71)&&numberOfDigis[j]>0) meNDigisCHANEndcapDms_.at(1)->Fill((float)numberOfDigis[j]);}
478  if(meNDigisCHANEndcapDps_.at(0)){ for(int j=96; j!=168; j++) if((j<120||j>143)&&numberOfDigis[j]>0) meNDigisCHANEndcapDps_.at(0)->Fill((float)numberOfDigis[j]);}
479  if(meNDigisCHANEndcapDps_.at(1)){ for(int j=120; j!=192; j++) if((j<144||j>167)&&numberOfDigis[j]>0) meNDigisCHANEndcapDps_.at(1)->Fill((float)numberOfDigis[j]);}
480  }
481  else if (noOfDisks == 3) { // else if (isUpgrade)
482  if(meNDigisCHANEndcap_){ for(int j=0; j!=336; j++) if(numberOfDigis[j]>0) meNDigisCHANEndcap_->Fill((float)numberOfDigis[j]);}
483  if(meNDigisCHANEndcapDms_.at(0)){ for(int j=0; j!=100; j++) if((j<22||j>65)&&numberOfDigis[j]>0) meNDigisCHANEndcapDms_.at(0)->Fill((float)numberOfDigis[j]);}
484  if(meNDigisCHANEndcapDms_.at(1)){ for(int j=22; j!=134; j++) if((j<44||j>99)&&numberOfDigis[j]>0) meNDigisCHANEndcapDms_.at(1)->Fill((float)numberOfDigis[j]);}
485  if(meNDigisCHANEndcapDms_.at(2)){ for(int j=44; j!=168; j++) if((j<66||j>133)&&numberOfDigis[j]>0) meNDigisCHANEndcapDms_.at(2)->Fill((float)numberOfDigis[j]);}
486  if(meNDigisCHANEndcapDps_.at(0)){ for(int j=168; j!=268; j++) if((j<190||j>233)&&numberOfDigis[j]>0) meNDigisCHANEndcapDps_.at(0)->Fill((float)numberOfDigis[j]);}
487  if(meNDigisCHANEndcapDps_.at(1)){ for(int j=190; j!=302; j++) if((j<212||j>267)&&numberOfDigis[j]>0) meNDigisCHANEndcapDps_.at(1)->Fill((float)numberOfDigis[j]);}
488  if(meNDigisCHANEndcapDps_.at(2)){ for(int j=212; j!=336; j++) if((j<234||j>301)&&numberOfDigis[j]>0) meNDigisCHANEndcapDps_.at(2)->Fill((float)numberOfDigis[j]);}
489  }
490 
491  if(meNDigisCHANBarrelCh1_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+0]>0) meNDigisCHANBarrelCh1_->Fill((float)nDigisPerChan[i*36+0]);}
492  if(meNDigisCHANBarrelCh2_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+1]>0) meNDigisCHANBarrelCh2_->Fill((float)nDigisPerChan[i*36+1]);}
493  if(meNDigisCHANBarrelCh3_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+2]>0) meNDigisCHANBarrelCh3_->Fill((float)nDigisPerChan[i*36+2]);}
494  if(meNDigisCHANBarrelCh4_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+3]>0) meNDigisCHANBarrelCh4_->Fill((float)nDigisPerChan[i*36+3]);}
495  if(meNDigisCHANBarrelCh5_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+4]>0) meNDigisCHANBarrelCh5_->Fill((float)nDigisPerChan[i*36+4]);}
496  if(meNDigisCHANBarrelCh6_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+5]>0) meNDigisCHANBarrelCh6_->Fill((float)nDigisPerChan[i*36+5]);}
497  if(meNDigisCHANBarrelCh7_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+6]>0) meNDigisCHANBarrelCh7_->Fill((float)nDigisPerChan[i*36+6]);}
498  if(meNDigisCHANBarrelCh8_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+7]>0) meNDigisCHANBarrelCh8_->Fill((float)nDigisPerChan[i*36+7]);}
499  if(meNDigisCHANBarrelCh9_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+8]>0) meNDigisCHANBarrelCh9_->Fill((float)nDigisPerChan[i*36+8]);}
500  if(meNDigisCHANBarrelCh10_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+9]>0) meNDigisCHANBarrelCh10_->Fill((float)nDigisPerChan[i*36+9]);}
501  if(meNDigisCHANBarrelCh11_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+10]>0) meNDigisCHANBarrelCh11_->Fill((float)nDigisPerChan[i*36+10]);}
502  if(meNDigisCHANBarrelCh12_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+11]>0) meNDigisCHANBarrelCh12_->Fill((float)nDigisPerChan[i*36+11]);}
503  if(meNDigisCHANBarrelCh13_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+12]>0) meNDigisCHANBarrelCh13_->Fill((float)nDigisPerChan[i*36+12]);}
504  if(meNDigisCHANBarrelCh14_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+13]>0) meNDigisCHANBarrelCh14_->Fill((float)nDigisPerChan[i*36+13]);}
505  if(meNDigisCHANBarrelCh15_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+14]>0) meNDigisCHANBarrelCh15_->Fill((float)nDigisPerChan[i*36+14]);}
506  if(meNDigisCHANBarrelCh16_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+15]>0) meNDigisCHANBarrelCh16_->Fill((float)nDigisPerChan[i*36+15]);}
507  if(meNDigisCHANBarrelCh17_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+16]>0) meNDigisCHANBarrelCh17_->Fill((float)nDigisPerChan[i*36+16]);}
508  if(meNDigisCHANBarrelCh18_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+17]>0) meNDigisCHANBarrelCh18_->Fill((float)nDigisPerChan[i*36+17]);}
509  if(meNDigisCHANBarrelCh19_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+18]>0) meNDigisCHANBarrelCh19_->Fill((float)nDigisPerChan[i*36+18]);}
510  if(meNDigisCHANBarrelCh20_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+19]>0) meNDigisCHANBarrelCh20_->Fill((float)nDigisPerChan[i*36+19]);}
511  if(meNDigisCHANBarrelCh21_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+20]>0) meNDigisCHANBarrelCh21_->Fill((float)nDigisPerChan[i*36+20]);}
512  if(meNDigisCHANBarrelCh22_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+21]>0) meNDigisCHANBarrelCh22_->Fill((float)nDigisPerChan[i*36+21]);}
513  if(meNDigisCHANBarrelCh23_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+22]>0) meNDigisCHANBarrelCh23_->Fill((float)nDigisPerChan[i*36+22]);}
514  if(meNDigisCHANBarrelCh24_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+23]>0) meNDigisCHANBarrelCh24_->Fill((float)nDigisPerChan[i*36+23]);}
515  if(meNDigisCHANBarrelCh25_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+24]>0) meNDigisCHANBarrelCh25_->Fill((float)nDigisPerChan[i*36+24]);}
516  if(meNDigisCHANBarrelCh26_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+25]>0) meNDigisCHANBarrelCh26_->Fill((float)nDigisPerChan[i*36+25]);}
517  if(meNDigisCHANBarrelCh27_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+26]>0) meNDigisCHANBarrelCh27_->Fill((float)nDigisPerChan[i*36+26]);}
518  if(meNDigisCHANBarrelCh28_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+27]>0) meNDigisCHANBarrelCh28_->Fill((float)nDigisPerChan[i*36+27]);}
519  if(meNDigisCHANBarrelCh29_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+28]>0) meNDigisCHANBarrelCh29_->Fill((float)nDigisPerChan[i*36+28]);}
520  if(meNDigisCHANBarrelCh30_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+29]>0) meNDigisCHANBarrelCh30_->Fill((float)nDigisPerChan[i*36+29]);}
521  if(meNDigisCHANBarrelCh31_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+30]>0) meNDigisCHANBarrelCh31_->Fill((float)nDigisPerChan[i*36+30]);}
522  if(meNDigisCHANBarrelCh32_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+31]>0) meNDigisCHANBarrelCh32_->Fill((float)nDigisPerChan[i*36+31]);}
523  if(meNDigisCHANBarrelCh33_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+32]>0) meNDigisCHANBarrelCh33_->Fill((float)nDigisPerChan[i*36+32]);}
524  if(meNDigisCHANBarrelCh34_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+33]>0) meNDigisCHANBarrelCh34_->Fill((float)nDigisPerChan[i*36+33]);}
525  if(meNDigisCHANBarrelCh35_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+34]>0) meNDigisCHANBarrelCh35_->Fill((float)nDigisPerChan[i*36+34]);}
526  if(meNDigisCHANBarrelCh36_){ for(int i=0; i!=32; i++) if(nDigisPerChan[i*36+35]>0) meNDigisCHANBarrelCh36_->Fill((float)nDigisPerChan[i*36+35]);}
527 
528  // Rate of events with >N digis:
529  if(nEventDigis>bigEventSize){
530  if(bigEventRate) bigEventRate->Fill(lumiSection,1./23.);
531  }
532 
533  // Rate of pixel events and total number of pixel events per BX:
534  if(nActiveModules>=4){
535  if(pixEvtsPerBX) pixEvtsPerBX->Fill(float(bx));
536  if(pixEventRate) pixEventRate->Fill(lumiSection, 1./23.);
537  }
538 
539  // Actual digi occupancy in a FED compared to average digi occupancy per FED
541  int maxfed=0;
542  for(int i=0; i!=32; i++){
543  if(nDigisPerFed[i]>maxfed) maxfed=nDigisPerFed[i];
544  }
545  for(int i=0; i!=40; i++){
546  float averageOcc = 0.;
547  if(i<32){
548  float averageBPIXFed = float(nBPIXDigis-maxfed)/31.;
549  if(averageBPIXFed>0.) averageOcc = nDigisPerFed[i]/averageBPIXFed;
550  }else{
551  float averageFPIXFed = float(nFPIXDigis)/8.;
552  if(averageFPIXFed>0.) averageOcc = nDigisPerFed[i]/averageFPIXFed;
553  }
554  averageDigiOccupancy->setBinContent(i+1,averageOcc);
555  int lumiSections8 = int(lumiSection/8);
556  if (modOn){
557  if (avgfedDigiOccvsLumi){
558  avgfedDigiOccvsLumi->setBinContent(1+lumiSections8, i+1, averageOcc);
559  }//endif meX5
560  }//endif modOn
561  }
562  }
563 
564  // slow down...
565  if(slowDown) usleep(10000);
566 
567 }
568 
569 //------------------------------------------------------------------
570 // Build data structure
571 //------------------------------------------------------------------
573 
574  edm::ESHandle<TrackerTopology> tTopoHandle;
575  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
576  const TrackerTopology *pTT = tTopoHandle.product();
577 
578  LogInfo ("PixelDQM") <<" SiPixelDigiSource::buildStructure" ;
580  iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
581 
582  LogVerbatim ("PixelDQM") << " *** Geometry node for TrackerGeom is "<<&(*pDD)<<std::endl;
583  LogVerbatim ("PixelDQM") << " *** I have " << pDD->dets().size() <<" detectors"<<std::endl;
584  LogVerbatim ("PixelDQM") << " *** I have " << pDD->detTypes().size() <<" types"<<std::endl;
585 
586  for(TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++){
587 
588  if(dynamic_cast<PixelGeomDetUnit const *>((*it))!=0){
589 
590  DetId detId = (*it)->geographicalId();
591  const GeomDetUnit * geoUnit = pDD->idToDetUnit( detId );
592  const PixelGeomDetUnit * pixDet = dynamic_cast<const PixelGeomDetUnit*>(geoUnit);
593  int nrows = (pixDet->specificTopology()).nrows();
594  int ncols = (pixDet->specificTopology()).ncolumns();
595 
596  if(detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
597  if(isPIB) continue;
598  LogDebug ("PixelDQM") << " ---> Adding Barrel Module " << detId.rawId() << endl;
599  uint32_t id = detId();
600  int layer = PixelBarrelName(DetId(id),pTT,isUpgrade).layerName();
601  if (layer > noOfLayers) noOfLayers = layer;
602  SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
603  thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
604 
605  } else if((detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) && (!isUpgrade)) {
606  LogDebug ("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
607  uint32_t id = detId();
608  SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
609 
611  int disk = PixelEndcapName(DetId(id),pTT,isUpgrade).diskName();
612  if (disk > noOfDisks) noOfDisks = disk;
613  int blade = PixelEndcapName(DetId(id),pTT,isUpgrade).bladeName();
614  int panel = PixelEndcapName(DetId(id),pTT,isUpgrade).pannelName();
616 
617  char sside[80]; sprintf(sside, "HalfCylinder_%i",side);
618  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
619  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
620  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
621  char smodule[80];sprintf(smodule,"Module_%i",module);
622  std::string side_str = sside;
623  std::string disk_str = sdisk;
624  bool mask = side_str.find("HalfCylinder_1")!=string::npos||
625  side_str.find("HalfCylinder_2")!=string::npos||
626  side_str.find("HalfCylinder_4")!=string::npos||
627  disk_str.find("Disk_2")!=string::npos;
628  // clutch to take all of FPIX, but no BPIX:
629  mask = false;
630  if(isPIB && mask) continue;
631 
632  thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
633  } else if( (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) && (isUpgrade)) {
634  LogDebug ("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
635  uint32_t id = detId();
636  SiPixelDigiModule* theModule = new SiPixelDigiModule(id, ncols, nrows);
637 
639  int disk = PixelEndcapName(DetId(id),pTT,isUpgrade).diskName();
640  if (disk > noOfDisks) noOfDisks = disk;
641  int blade = PixelEndcapName(DetId(id),pTT,isUpgrade).bladeName();
642  int panel = PixelEndcapName(DetId(id),pTT,isUpgrade).pannelName();
644 
645  char sside[80]; sprintf(sside, "HalfCylinder_%i",side);
646  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
647  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
648  char spanel[80]; sprintf(spanel, "Panel_%i",panel);
649  char smodule[80];sprintf(smodule,"Module_%i",module);
650  std::string side_str = sside;
651  std::string disk_str = sdisk;
652  bool mask = side_str.find("HalfCylinder_1")!=string::npos||
653  side_str.find("HalfCylinder_2")!=string::npos||
654  side_str.find("HalfCylinder_4")!=string::npos||
655  disk_str.find("Disk_2")!=string::npos;
656  // clutch to take all of FPIX, but no BPIX:
657  mask = false;
658  if(isPIB && mask) continue;
659 
660  thePixelStructure.insert(pair<uint32_t,SiPixelDigiModule*> (id,theModule));
661  }//end_elseif(isUpgrade)
662 
663  }
664  }
665  LogInfo ("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl;
666 }
667 //------------------------------------------------------------------
668 // Book MEs
669 //------------------------------------------------------------------
671 
672  // Get DQM interface
674  char title[80]; sprintf(title, "Rate of events with >%i digis;LumiSection;Rate [Hz]",bigEventSize);
675  bigEventRate = iBooker.book1D("bigEventRate",title,5000,0.,5000.);
676  char title1[80]; sprintf(title1, "Pixel events vs. BX;BX;# events");
677  pixEvtsPerBX = iBooker.book1D("pixEvtsPerBX",title1,3565,0.,3565.);
678  char title2[80]; sprintf(title2, "Rate of Pixel events;LumiSection;Rate [Hz]");
679  pixEventRate = iBooker.book1D("pixEventRate",title2,5000,0.,5000.);
680  char title3[80]; sprintf(title3, "Number of Zero-Occupancy Barrel ROCs;LumiSection;N_{ZERO-OCCUPANCY} Barrel ROCs");
681  noOccROCsBarrel = iBooker.book1D("noOccROCsBarrel",title3,500,0.,5000.);
682  char title4[80]; sprintf(title4, "Number of Low-Efficiency Barrel ROCs;LumiSection;N_{LO EFF} Barrel ROCs");
683  loOccROCsBarrel = iBooker.book1D("loOccROCsBarrel",title4,500,0.,5000.);
684  char title5[80]; sprintf(title5, "Number of Zero-Occupancy Endcap ROCs;LumiSection;N_{ZERO-OCCUPANCY} Endcap ROCs");
685  noOccROCsEndcap = iBooker.book1D("noOccROCsEndcap",title5,500,0.,5000.);
686  char title6[80]; sprintf(title6, "Number of Low-Efficiency Endcap ROCs;LumiSection;N_{LO EFF} Endcap ROCs");
687  loOccROCsEndcap = iBooker.book1D("loOccROCsEndcap",title6,500,0.,5000.);
688  char title7[80]; sprintf(title7, "Average digi occupancy per FED;FED;NDigis/<NDigis>");
689  averageDigiOccupancy = iBooker.book1D("averageDigiOccupancy",title7,40,-0.5,39.5);
691  if(modOn){
692  char title4[80]; sprintf(title4, "FED Digi Occupancy (NDigis/<NDigis>) vs LumiSections;Lumi Section;FED");
693  avgfedDigiOccvsLumi = iBooker.book2D ("avgfedDigiOccvsLumi", title4, 400,0., 3200., 40, -0.5, 39.5);
694  }
695  std::map<uint32_t,SiPixelDigiModule*>::iterator struct_iter;
696 
697  SiPixelFolderOrganizer theSiPixelFolder(false);
698 
699  for(struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++){
701  if(modOn){
702  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,0,isUpgrade)){
703  (*struct_iter).second->book( conf_,iSetup,iBooker,0,twoDimOn,hiRes, reducedSet, twoDimModOn, isUpgrade);
704  } else {
705 
706  if(!isPIB) throw cms::Exception("LogicError")
707  << "[SiPixelDigiSource::bookMEs] Creation of DQM folder failed";
708  }
709  }
710  if(ladOn){
711  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,1,isUpgrade)){
712  (*struct_iter).second->book( conf_,iSetup,iBooker,1,twoDimOn,hiRes, reducedSet, isUpgrade);
713  } else {
714  LogDebug ("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n";
715  }
716 
717  }
718  if(layOn || twoDimOnlyLayDisk){
719  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,2,isUpgrade)){
720  (*struct_iter).second->book( conf_,iSetup,iBooker,2,twoDimOn,hiRes, reducedSet, twoDimOnlyLayDisk, isUpgrade);
721  } else {
722  LogDebug ("PixelDQM") << "PROBLEM WITH LAYER-FOLDER\n";
723  }
724  }
725 
726  if(phiOn){
727  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,3,isUpgrade)){
728  (*struct_iter).second->book( conf_,iSetup,iBooker,3,twoDimOn,hiRes, reducedSet, isUpgrade);
729  } else {
730  LogDebug ("PixelDQM") << "PROBLEM WITH PHI-FOLDER\n";
731  }
732  }
733  if(bladeOn){
734  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,4,isUpgrade)){
735  (*struct_iter).second->book( conf_,iSetup,iBooker,4,twoDimOn,hiRes, reducedSet, isUpgrade);
736  } else {
737  LogDebug ("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n";
738  }
739  }
740  if(diskOn || twoDimOnlyLayDisk){
741  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,5,isUpgrade)){
742  (*struct_iter).second->book( conf_,iSetup,iBooker,5,twoDimOn,hiRes, reducedSet, twoDimOnlyLayDisk, isUpgrade);
743  } else {
744  LogDebug ("PixelDQM") << "PROBLEM WITH DISK-FOLDER\n";
745  }
746  }
747  if(ringOn){
748  if(theSiPixelFolder.setModuleFolder(iBooker,(*struct_iter).first,6,isUpgrade)){
749  (*struct_iter).second->book( conf_,iSetup,iBooker,6,twoDimOn,hiRes, reducedSet, isUpgrade);
750  } else {
751  LogDebug ("PixelDQM") << "PROBLEM WITH RING-FOLDER\n";
752  }
753  }
754  }
755  iBooker.cd(topFolderName_+"/Barrel");
756  meNDigisCOMBBarrel_ = iBooker.book1D("ALLMODS_ndigisCOMB_Barrel","Number of Digis",200,0.,400.);
757  meNDigisCOMBBarrel_->setAxisTitle("Number of digis per module per event",1);
758  meNDigisCHANBarrel_ = iBooker.book1D("ALLMODS_ndigisCHAN_Barrel","Number of Digis",100,0.,1000.);
759  meNDigisCHANBarrel_->setAxisTitle("Number of digis per FED channel per event",1);
760  std::stringstream ss1, ss2;
761  for (int i = 1; i <= noOfLayers; i++)
762  {
763  ss1.str(std::string()); ss1 << "ALLMODS_ndigisCHAN_BarrelL" << i;
764  ss2.str(std::string()); ss2 << "Number of Digis L" << i;
765  meNDigisCHANBarrelLs_.push_back(iBooker.book1D(ss1.str(),ss2.str(),100,0.,1000.));
766  meNDigisCHANBarrelLs_.at(i-1)->setAxisTitle("Number of digis per FED channel per event",1);
767  }
768  meNDigisCHANBarrelCh1_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh1","Number of Digis Ch1",100,0.,1000.);
769  meNDigisCHANBarrelCh1_->setAxisTitle("Number of digis per FED channel per event",1);
770  meNDigisCHANBarrelCh2_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh2","Number of Digis Ch2",100,0.,1000.);
771  meNDigisCHANBarrelCh2_->setAxisTitle("Number of digis per FED channel per event",1);
772  meNDigisCHANBarrelCh3_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh3","Number of Digis Ch3",100,0.,1000.);
773  meNDigisCHANBarrelCh3_->setAxisTitle("Number of digis per FED channel per event",1);
774  meNDigisCHANBarrelCh4_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh4","Number of Digis Ch4",100,0.,1000.);
775  meNDigisCHANBarrelCh4_->setAxisTitle("Number of digis per FED channel per event",1);
776  meNDigisCHANBarrelCh5_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh5","Number of Digis Ch5",100,0.,1000.);
777  meNDigisCHANBarrelCh5_->setAxisTitle("Number of digis per FED channel per event",1);
778  meNDigisCHANBarrelCh6_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh6","Number of Digis Ch6",100,0.,1000.);
779  meNDigisCHANBarrelCh6_->setAxisTitle("Number of digis per FED channel per event",1);
780  meNDigisCHANBarrelCh7_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh7","Number of Digis Ch7",100,0.,1000.);
781  meNDigisCHANBarrelCh7_->setAxisTitle("Number of digis per FED channel per event",1);
782  meNDigisCHANBarrelCh8_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh8","Number of Digis Ch8",100,0.,1000.);
783  meNDigisCHANBarrelCh8_->setAxisTitle("Number of digis per FED channel per event",1);
784  meNDigisCHANBarrelCh9_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh9","Number of Digis Ch9",100,0.,1000.);
785  meNDigisCHANBarrelCh9_->setAxisTitle("Number of digis per FED channel per event",1);
786  meNDigisCHANBarrelCh10_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh10","Number of Digis Ch10",100,0.,1000.);
787  meNDigisCHANBarrelCh10_->setAxisTitle("Number of digis per FED channel per event",1);
788  meNDigisCHANBarrelCh11_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh11","Number of Digis Ch11",100,0.,1000.);
789  meNDigisCHANBarrelCh11_->setAxisTitle("Number of digis per FED channel per event",1);
790  meNDigisCHANBarrelCh12_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh12","Number of Digis Ch12",100,0.,1000.);
791  meNDigisCHANBarrelCh12_->setAxisTitle("Number of digis per FED channel per event",1);
792  meNDigisCHANBarrelCh13_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh13","Number of Digis Ch13",100,0.,1000.);
793  meNDigisCHANBarrelCh13_->setAxisTitle("Number of digis per FED channel per event",1);
794  meNDigisCHANBarrelCh14_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh14","Number of Digis Ch14",100,0.,1000.);
795  meNDigisCHANBarrelCh14_->setAxisTitle("Number of digis per FED channel per event",1);
796  meNDigisCHANBarrelCh15_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh15","Number of Digis Ch15",100,0.,1000.);
797  meNDigisCHANBarrelCh15_->setAxisTitle("Number of digis per FED channel per event",1);
798  meNDigisCHANBarrelCh16_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh16","Number of Digis Ch16",100,0.,1000.);
799  meNDigisCHANBarrelCh16_->setAxisTitle("Number of digis per FED channel per event",1);
800  meNDigisCHANBarrelCh17_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh17","Number of Digis Ch17",100,0.,1000.);
801  meNDigisCHANBarrelCh17_->setAxisTitle("Number of digis per FED channel per event",1);
802  meNDigisCHANBarrelCh18_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh18","Number of Digis Ch18",100,0.,1000.);
803  meNDigisCHANBarrelCh18_->setAxisTitle("Number of digis per FED channel per event",1);
804  meNDigisCHANBarrelCh19_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh19","Number of Digis Ch19",100,0.,1000.);
805  meNDigisCHANBarrelCh19_->setAxisTitle("Number of digis per FED channel per event",1);
806  meNDigisCHANBarrelCh20_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh20","Number of Digis Ch20",100,0.,1000.);
807  meNDigisCHANBarrelCh20_->setAxisTitle("Number of digis per FED channel per event",1);
808  meNDigisCHANBarrelCh21_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh21","Number of Digis Ch21",100,0.,1000.);
809  meNDigisCHANBarrelCh21_->setAxisTitle("Number of digis per FED channel per event",1);
810  meNDigisCHANBarrelCh22_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh22","Number of Digis Ch22",100,0.,1000.);
811  meNDigisCHANBarrelCh22_->setAxisTitle("Number of digis per FED channel per event",1);
812  meNDigisCHANBarrelCh23_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh23","Number of Digis Ch23",100,0.,1000.);
813  meNDigisCHANBarrelCh23_->setAxisTitle("Number of digis per FED channel per event",1);
814  meNDigisCHANBarrelCh24_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh24","Number of Digis Ch24",100,0.,1000.);
815  meNDigisCHANBarrelCh24_->setAxisTitle("Number of digis per FED channel per event",1);
816  meNDigisCHANBarrelCh25_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh25","Number of Digis Ch25",100,0.,1000.);
817  meNDigisCHANBarrelCh25_->setAxisTitle("Number of digis per FED channel per event",1);
818  meNDigisCHANBarrelCh26_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh26","Number of Digis Ch26",100,0.,1000.);
819  meNDigisCHANBarrelCh26_->setAxisTitle("Number of digis per FED channel per event",1);
820  meNDigisCHANBarrelCh27_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh27","Number of Digis Ch27",100,0.,1000.);
821  meNDigisCHANBarrelCh27_->setAxisTitle("Number of digis per FED channel per event",1);
822  meNDigisCHANBarrelCh28_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh28","Number of Digis Ch28",100,0.,1000.);
823  meNDigisCHANBarrelCh28_->setAxisTitle("Number of digis per FED channel per event",1);
824  meNDigisCHANBarrelCh29_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh29","Number of Digis Ch29",100,0.,1000.);
825  meNDigisCHANBarrelCh29_->setAxisTitle("Number of digis per FED channel per event",1);
826  meNDigisCHANBarrelCh30_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh30","Number of Digis Ch30",100,0.,1000.);
827  meNDigisCHANBarrelCh30_->setAxisTitle("Number of digis per FED channel per event",1);
828  meNDigisCHANBarrelCh31_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh31","Number of Digis Ch31",100,0.,1000.);
829  meNDigisCHANBarrelCh31_->setAxisTitle("Number of digis per FED channel per event",1);
830  meNDigisCHANBarrelCh32_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh32","Number of Digis Ch32",100,0.,1000.);
831  meNDigisCHANBarrelCh32_->setAxisTitle("Number of digis per FED channel per event",1);
832  meNDigisCHANBarrelCh33_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh33","Number of Digis Ch33",100,0.,1000.);
833  meNDigisCHANBarrelCh33_->setAxisTitle("Number of digis per FED channel per event",1);
834  meNDigisCHANBarrelCh34_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh34","Number of Digis Ch34",100,0.,1000.);
835  meNDigisCHANBarrelCh34_->setAxisTitle("Number of digis per FED channel per event",1);
836  meNDigisCHANBarrelCh35_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh35","Number of Digis Ch35",100,0.,1000.);
837  meNDigisCHANBarrelCh35_->setAxisTitle("Number of digis per FED channel per event",1);
838  meNDigisCHANBarrelCh36_ = iBooker.book1D("ALLMODS_ndigisCHAN_BarrelCh36","Number of Digis Ch36",100,0.,1000.);
839  meNDigisCHANBarrelCh36_->setAxisTitle("Number of digis per FED channel per event",1);
840  iBooker.cd(topFolderName_+"/Endcap");
841  meNDigisCOMBEndcap_ = iBooker.book1D("ALLMODS_ndigisCOMB_Endcap","Number of Digis",200,0.,400.);
842  meNDigisCOMBEndcap_->setAxisTitle("Number of digis per module per event",1);
843  meNDigisCHANEndcap_ = iBooker.book1D("ALLMODS_ndigisCHAN_Endcap","Number of Digis",100,0.,1000.);
844  meNDigisCHANEndcap_->setAxisTitle("Number of digis per FED channel per event",1);
845  for (int i = 1; i <= noOfDisks; i++)
846  {
847  ss1.str(std::string()); ss1 << "ALLMODS_ndigisCHAN_EndcapDp" << i;
848  ss2.str(std::string()); ss2 << "Number of Digis Disk p" << i;
849  meNDigisCHANEndcapDps_.push_back(iBooker.book1D(ss1.str(),ss2.str(),100,0.,1000.));
850  meNDigisCHANEndcapDps_.at(i-1)->setAxisTitle("Number of digis per FED channel per event",1);
851  }
852  for (int i = 1; i <= noOfDisks; i++)
853  {
854  ss1.str(std::string()); ss1 << "ALLMODS_ndigisCHAN_EndcapDm" << i;
855  ss2.str(std::string()); ss2 << "Number of Digis Disk m" << i;
856  meNDigisCHANEndcapDms_.push_back(iBooker.book1D(ss1.str(),ss2.str(),100,0.,1000.));
857  meNDigisCHANEndcapDms_.at(i-1)->setAxisTitle("Number of digis per FED channel per event",1);
858  }
859  iBooker.cd(topFolderName_);
860 }
861 
862 //define this as a plug-in
#define LogDebug(id)
int plaquetteName() const
plaquetteId (in pannel)
T getParameter(std::string const &) const
MonitorElement * meNDigisCHANBarrelCh19_
MonitorElement * meNDigisCHANBarrelCh35_
int i
Definition: DBlmapReader.cc:9
MonitorElement * meNDigisCHANBarrelCh2_
MonitorElement * meNDigisCHANBarrelCh30_
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meNDigisCHANBarrelCh31_
MonitorElement * meNDigisCHANBarrelCh8_
MonitorElement * meNDigisCHANBarrelCh36_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
void cd(void)
Definition: DQMStore.cc:266
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
MonitorElement * loOccROCsEndcap
MonitorElement * meNDigisCHANBarrelCh17_
MonitorElement * meNDigisCHANBarrelCh25_
assert(m_qm.get())
MonitorElement * meNDigisCHANBarrelCh6_
MonitorElement * meNDigisCOMBBarrel_
int bunchCrossing() const
Definition: EventBase.h:66
std::string topFolderName_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
MonitorElement * meNDigisCOMBEndcap_
MonitorElement * meNDigisCHANBarrelCh14_
MonitorElement * meNDigisCHANBarrelCh12_
MonitorElement * meNDigisCHANBarrelCh29_
static std::string const input
Definition: EdmProvDump.cc:43
void Fill(long long x)
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > srcToken_
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
MonitorElement * meNDigisCHANBarrelCh27_
int bladeName() const
blade id
virtual void bookMEs(DQMStore::IBooker &, const edm::EventSetup &iSetup)
SiPixelDigiSource(const edm::ParameterSet &conf)
int iEvent
Definition: GenABIO.cc:230
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
MonitorElement * meNDigisCHANEndcap_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * meNDigisCHANBarrelCh28_
int j
Definition: DBlmapReader.cc:9
MonitorElement * noOccROCsEndcap
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * meNDigisCHANBarrel_
std::vector< MonitorElement * > meNDigisCHANEndcapDms_
virtual void dqmBeginRun(const edm::Run &, edm::EventSetup const &)
MonitorElement * meNDigisCHANBarrelCh33_
MonitorElement * pixEventRate
MonitorElement * meNDigisCHANBarrelCh21_
unsigned int I_detId[1856]
bool isValid() const
Definition: HandleBase.h:75
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
MonitorElement * meNDigisCHANBarrelCh32_
MonitorElement * meNDigisCHANBarrelCh10_
MonitorElement * loOccROCsBarrel
MonitorElement * meNDigisCHANBarrelCh1_
MonitorElement * averageDigiOccupancy
Definition: DetId.h:18
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * meNDigisCHANBarrelCh5_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meNDigisCHANBarrelCh7_
MonitorElement * meNDigisCHANBarrelCh15_
MonitorElement * meNDigisCHANBarrelCh13_
const T & get() const
Definition: EventSetup.h:55
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
MonitorElement * meNDigisCHANBarrelCh23_
int layerName() const
layer id
T const * product() const
Definition: ESHandle.h:86
MonitorElement * meNDigisCHANBarrelCh18_
MonitorElement * bigEventRate
MonitorElement * meNDigisCHANBarrelCh20_
MonitorElement * avgfedDigiOccvsLumi
edm::ParameterSet conf_
list infile
Definition: EdgesToViz.py:90
int pannelName() const
pannel id
MonitorElement * meNDigisCHANBarrelCh22_
int diskName() const
disk id
std::vector< MonitorElement * > meNDigisCHANEndcapDps_
MonitorElement * pixEvtsPerBX
volatile std::atomic< bool > shutdown_flag false
std::vector< MonitorElement * > meNDigisCHANBarrelLs_
std::map< uint32_t, SiPixelDigiModule * > thePixelStructure
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
HalfCylinder halfCylinder() const
MonitorElement * meNDigisCHANBarrelCh16_
MonitorElement * meNDigisCHANBarrelCh11_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
Definition: vlib.h:208
virtual void buildStructure(edm::EventSetup const &)
std::string I_name[1856]
MonitorElement * meNDigisCHANBarrelCh24_
Definition: Run.h:41