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