CMS 3D CMS Logo

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