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