CMS 3D CMS Logo

SiPixelDigiModule.cc
Go to the documentation of this file.
6 // STL
7 #include <vector>
8 #include <memory>
9 #include <string>
10 #include <iostream>
11 #include <stdlib.h>
12 #include <sstream>
13 #include <cstdio>
14 
15 // Data Formats
24 
25 //
26 // Constructors
27 //
29  ncols_(416),
30  nrows_(160)
31 {
32 }
35  id_(id),
36  ncols_(416),
37  nrows_(160)
38 {
39 }
41 SiPixelDigiModule::SiPixelDigiModule(const uint32_t& id, const int& ncols, const int& nrows) :
42  id_(id),
43  ncols_(ncols),
44  nrows_(nrows)
45 {
46 }
47 //
48 // Destructor
49 //
51 //
52 // Book histograms
53 //
54 void SiPixelDigiModule::book(const edm::ParameterSet& iConfig, const edm::EventSetup& iSetup, DQMStore::IBooker & iBooker, int type, bool twoD, bool hiRes, bool reducedSet, bool additInfo, bool isUpgrade) {
55 
56  //isUpgrade = iConfig.getUntrackedParameter<bool>("isUpgrade");
58  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
59  const TrackerTopology *pTT = tTopoHandle.product();
60 
61  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
62  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
63  bool isHalfModule = false;
64  if(barrel){
65  isHalfModule = PixelBarrelName(DetId(id_),pTT,isUpgrade).isHalfModule();
66  }
67 
68  std::string hid;
69  // Get collection name and instantiate Histo Id builder
70  edm::InputTag src = iConfig.getParameter<edm::InputTag>( "src" );
71 
72  int nbinx=ncols_/2, nbiny=nrows_/2;
73  std::string twodtitle = "Number of Digis (1bin=four pixels)";
74  std::string pxtitle = "Number of Digis (1bin=two columns)";
75  std::string pytitle = "Number of Digis (1bin=two rows)";
76  std::string twodroctitle = "ROC Occupancy (1bin=one ROC)";
77  std::string twodzeroOccroctitle = "Zero Occupancy ROC Map (1bin=one ROC) for ";
78  if(hiRes){
79  nbinx = ncols_;
80  nbiny = nrows_;
81  twodtitle = "Number of Digis (1bin=one pixel)";
82  pxtitle = "Number of Digis (1bin=one column)";
83  pytitle = "Number of Digis (1bin=one row)";
84  }
85  if(type==0){
86  SiPixelHistogramId* theHistogramId = new SiPixelHistogramId( src.label() );
87  // Number of digis
88  hid = theHistogramId->setHistoId("ndigis",id_);
89  meNDigis_ = iBooker.book1D(hid,"Number of Digis",25,0.,25.);
90  meNDigis_->setAxisTitle("Number of digis",1);
91  // Charge in ADC counts
92  hid = theHistogramId->setHistoId("adc",id_);
93  meADC_ = iBooker.book1D(hid,"Digi charge",128,0.,256.);
94  meADC_->setAxisTitle("ADC counts",1);
95  if(!reducedSet)
96  {
97  if(twoD){
98  if(additInfo){
99  // 2D hit map
100  hid = theHistogramId->setHistoId("hitmap",id_);
101  mePixDigis_ = iBooker.book2D(hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
102  mePixDigis_->setAxisTitle("Columns",1);
103  mePixDigis_->setAxisTitle("Rows",2);
104  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
105  }
106  }
107  else{
108  // projections of 2D hit map
109  hid = theHistogramId->setHistoId("hitmap",id_);
110  mePixDigis_px_ = iBooker.book1D(hid+"_px",pxtitle,nbinx,0.,float(ncols_));
111  mePixDigis_py_ = iBooker.book1D(hid+"_py",pytitle,nbiny,0.,float(nrows_));
112  mePixDigis_px_->setAxisTitle("Columns",1);
113  mePixDigis_py_->setAxisTitle("Rows",1);
114  }
115  }
116  delete theHistogramId;
117 
118  }
119 
120  if(type==1 && barrel){
121  uint32_t DBladder;
122  DBladder = PixelBarrelName(DetId(id_),pTT,isUpgrade).ladderName();
123  char sladder[80]; sprintf(sladder,"Ladder_%02i",DBladder);
124  hid = src.label() + "_" + sladder;
125  if(isHalfModule) hid += "H";
126  else hid += "F";
127  // Number of digis
128  meNDigisLad_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
129  meNDigisLad_->setAxisTitle("Number of digis",1);
130  // Charge in ADC counts
131  meADCLad_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
132  meADCLad_->setAxisTitle("ADC counts",1);
133  if(!reducedSet)
134  {
135  if(twoD){
136  // 2D hit map
137  mePixDigisLad_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
138  mePixDigisLad_->setAxisTitle("Columns",1);
139  mePixDigisLad_->setAxisTitle("Rows",2);
140  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
141  }
142  else{
143  // projections of 2D hit map
144  mePixDigisLad_px_ = iBooker.book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_));
145  mePixDigisLad_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_));
146  mePixDigisLad_px_->setAxisTitle("Columns",1);
147  mePixDigisLad_py_->setAxisTitle("Rows",1);
148  }
149  }
150  }
151  if(type==2 && barrel){
152  uint32_t DBlayer;
153  DBlayer = PixelBarrelName(DetId(id_),pTT,isUpgrade).layerName();
154  char slayer[80]; sprintf(slayer,"Layer_%i",DBlayer);
155  hid = src.label() + "_" + slayer;
156  if(!additInfo){
157  // Number of digis
158  meNDigisLay_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
159  meNDigisLay_->setAxisTitle("Number of digis",1);
160  // Charge in ADC counts
161  meADCLay_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
162  meADCLay_->setAxisTitle("ADC counts",1);
163  }
164  if(!reducedSet){
165  if(twoD || additInfo){
166  // 2D hit map
167  if(isHalfModule){
168  mePixDigisLay_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),2*nbiny,0.,float(2*nrows_));
169  }
170  else{
171  mePixDigisLay_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
172 
173  }
174  mePixDigisLay_->setAxisTitle("Columns",1);
175  mePixDigisLay_->setAxisTitle("Rows",2);
176 
177  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
178  int yROCbins[3] = {18,30,42};
179  mePixRocsLay_ = iBooker.book2D("rocmap_"+hid,twodroctitle,32,0.,32.,yROCbins[DBlayer-1],1.5,1.5+float(yROCbins[DBlayer-1]/2));
180  mePixRocsLay_->setAxisTitle("ROCs per Module",1);
181  mePixRocsLay_->setAxisTitle("ROCs per 1/2 Ladder",2);
182  meZeroOccRocsLay_ = iBooker.book2D("zeroOccROC_map",twodzeroOccroctitle+hid,32,0.,32.,yROCbins[DBlayer-1],1.5,1.5+float(yROCbins[DBlayer-1]/2));
183  meZeroOccRocsLay_->setAxisTitle("ROCs per Module",1);
184  meZeroOccRocsLay_->setAxisTitle("ROCs per 1/2 Ladder",2);
185  }
186  if(!twoD && !additInfo){
187  // projections of 2D hit map
188  mePixDigisLay_px_ = iBooker.book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_));
189  if(isHalfModule){
190  mePixDigisLay_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,2*nbiny,0.,float(2*nrows_));
191  }
192  else{
193  mePixDigisLay_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_));
194  }
195  mePixDigisLay_px_->setAxisTitle("Columns",1);
196  mePixDigisLay_py_->setAxisTitle("Rows",1);
197  }
198  }
199  }
200  if(type==3 && barrel){
201  uint32_t DBmodule;
202  DBmodule = PixelBarrelName(DetId(id_),pTT,isUpgrade).moduleName();
203  char smodule[80]; sprintf(smodule,"Ring_%i",DBmodule);
204  hid = src.label() + "_" + smodule;
205  // Number of digis
206  meNDigisPhi_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
207  meNDigisPhi_->setAxisTitle("Number of digis",1);
208  // Charge in ADC counts
209  meADCPhi_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
210  meADCPhi_->setAxisTitle("ADC counts",1);
211  if(!reducedSet)
212  {
213  if(twoD){
214 
215  // 2D hit map
216  if(isHalfModule){
217  mePixDigisPhi_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),2*nbiny,0.,float(2*nrows_));
218  }
219  else {
220  mePixDigisPhi_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
221  }
222  mePixDigisPhi_->setAxisTitle("Columns",1);
223  mePixDigisPhi_->setAxisTitle("Rows",2);
224  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
225  }
226  else{
227  // projections of 2D hit map
228  mePixDigisPhi_px_ = iBooker.book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_));
229  if(isHalfModule){
230  mePixDigisPhi_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,2*nbiny,0.,float(2*nrows_));
231  }
232  else{
233  mePixDigisPhi_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_));
234  }
235  mePixDigisPhi_px_->setAxisTitle("Columns",1);
236  mePixDigisPhi_py_->setAxisTitle("Rows",1);
237  }
238  }
239  }
240  if(type==4 && endcap){
241  uint32_t blade;
242  blade= PixelEndcapName(DetId(id_),pTT,isUpgrade).bladeName();
243 
244  char sblade[80]; sprintf(sblade, "Blade_%02i",blade);
245  hid = src.label() + "_" + sblade;
246  // Number of digis
247  meNDigisBlade_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
248  meNDigisBlade_->setAxisTitle("Number of digis",1);
249  // Charge in ADC counts
250  meADCBlade_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
251  meADCBlade_->setAxisTitle("ADC counts",1);
252  }
253  if(type==5 && endcap){
254  uint32_t disk;
255  disk = PixelEndcapName(DetId(id_),pTT,isUpgrade).diskName();
256 
257  char sdisk[80]; sprintf(sdisk, "Disk_%i",disk);
258  hid = src.label() + "_" + sdisk;
259  if(!additInfo){
260  // Number of digis
261  meNDigisDisk_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
262  meNDigisDisk_->setAxisTitle("Number of digis",1);
263  // Charge in ADC counts
264  meADCDisk_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
265  meADCDisk_->setAxisTitle("ADC counts",1);
266  }
267  if(additInfo){
268  mePixDigisDisk_ = iBooker.book2D("hitmap_"+hid,twodtitle,260,0.,260.,160,0.,160.);
269  mePixDigisDisk_->setAxisTitle("Columns",1);
270  mePixDigisDisk_->setAxisTitle("Rows",2);
271  //ROC information in disks
272  mePixRocsDisk_ = iBooker.book2D("rocmap_"+hid,twodroctitle,26,0.,26.,24,1.,13.);
273  mePixRocsDisk_ ->setAxisTitle("ROCs per Module (2 Panels)",1);
274  mePixRocsDisk_ ->setAxisTitle("Blade Number",2);
275  meZeroOccRocsDisk_ = iBooker.book2D("zeroOccROC_map",twodzeroOccroctitle+hid,26,0.,26.,24,1.,13.);
276  meZeroOccRocsDisk_ ->setAxisTitle("Zero-Occupancy ROCs per Module (2 Panels)",1);
277  meZeroOccRocsDisk_ ->setAxisTitle("Blade Number",2);
278  }
279  }
280  if(type==6 && endcap){
281  uint32_t panel;
282  uint32_t module;
283  panel= PixelEndcapName(DetId(id_),pTT,isUpgrade).pannelName();
284  module= PixelEndcapName(DetId(id_),pTT,isUpgrade).plaquetteName();
285 
286  char slab[80]; sprintf(slab, "Panel_%i_Ring_%i",panel, module);
287  hid = src.label() + "_" + slab;
288  // Number of digis
289  meNDigisRing_ = iBooker.book1D("ndigis_"+hid,"Number of Digis",25,0.,25.);
290  meNDigisRing_->setAxisTitle("Number of digis",1);
291  // Charge in ADC counts
292  meADCRing_ = iBooker.book1D("adc_" + hid,"Digi charge",128,0.,256.);
293  meADCRing_->setAxisTitle("ADC counts",1);
294  if(!reducedSet)
295  {
296  if(twoD){
297  // 2D hit map
298  mePixDigisRing_ = iBooker.book2D("hitmap_"+hid,twodtitle,nbinx,0.,float(ncols_),nbiny,0.,float(nrows_));
299  mePixDigisRing_->setAxisTitle("Columns",1);
300  mePixDigisRing_->setAxisTitle("Rows",2);
301  //std::cout << "During booking: type is "<< type << ", ID is "<< id_ << ", pwd for booking is " << theDMBE->pwd() << ", Plot name: " << hid << std::endl;
302  }
303  else{
304  // projections of 2D hit map
305  mePixDigisRing_px_ = iBooker.book1D("hitmap_"+hid+"_px",pxtitle,nbinx,0.,float(ncols_));
306  mePixDigisRing_py_ = iBooker.book1D("hitmap_"+hid+"_py",pytitle,nbiny,0.,float(nrows_));
307  mePixDigisRing_px_->setAxisTitle("Columns",1);
308  mePixDigisRing_py_->setAxisTitle("Rows",1);
309  }
310  }
311  }
312 }
313 
314 
315 //
316 // Fill histograms
317 //
319  MonitorElement* combBarrel, MonitorElement* chanBarrel, std::vector<MonitorElement*>& chanBarrelL, MonitorElement* combEndcap,
320  bool modon, bool ladon, bool layon, bool phion,
321  bool bladeon, bool diskon, bool ringon,
322  bool twoD, bool reducedSet, bool twoDimModOn, bool twoDimOnlyLayDisk,
323  int &nDigisA, int &nDigisB, bool isUpgrade) {
324  edm::ESHandle<TrackerTopology> tTopoHandle;
325  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
326  const TrackerTopology *pTT = tTopoHandle.product();
327 
328  bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
329  bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);
330  bool isHalfModule = false;
331  uint32_t DBladder = 0;
332  if(barrel){
333  isHalfModule = PixelBarrelName(DetId(id_),pTT,isUpgrade).isHalfModule();
334  DBladder = PixelBarrelName(DetId(id_),pTT,isUpgrade).ladderName();
335  }
336 
337  edm::DetSetVector<PixelDigi>::const_iterator isearch = input.find(id_); // search digis of detid
338 
339  unsigned int numberOfDigisMod = 0;
340  int msize;
341  if (isUpgrade) {msize=10;} else {msize=8;}
342  int numberOfDigis[msize]; for(int i=0; i!=msize; i++) numberOfDigis[i]=0;
343  nDigisA=0; nDigisB=0;
344  if( isearch != input.end() ) { // Not an empty iterator
345 
346  // Look at digis now
348  for(di = isearch->data.begin(); di != isearch->data.end(); di++) {
349  int adc = di->adc(); // charge
350  int col = di->column(); // column
351  int row = di->row(); // row
352  numberOfDigisMod++;
353 
354  int DBlayer = 0;
355  int DBmodule =0;
356 
357  if (!isUpgrade) {
358  PixelBarrelName::Shell DBshell = PixelBarrelName(DetId(id_),pTT,isUpgrade).shell();
359  DBlayer = PixelBarrelName(DetId(id_),pTT,isUpgrade).layerName();
360  DBmodule = PixelBarrelName(DetId(id_),pTT,isUpgrade).moduleName();
361  if(barrel){
362  if(isHalfModule){
363  if(DBshell==PixelBarrelName::pI||DBshell==PixelBarrelName::pO){
364  numberOfDigis[0]++; nDigisA++;
365  if(DBlayer==1) numberOfDigis[2]++;
366  if(DBlayer==2) numberOfDigis[3]++;
367  if(DBlayer==3) numberOfDigis[4]++;
368  }
369  if(DBshell==PixelBarrelName::mI||DBshell==PixelBarrelName::mO){
370  numberOfDigis[1]++; nDigisB++;
371  if(DBlayer==1) numberOfDigis[5]++;
372  if(DBlayer==2) numberOfDigis[6]++;
373  if(DBlayer==3) numberOfDigis[7]++;
374  }
375  }else{
376  if(row<80){
377  numberOfDigis[0]++; nDigisA++;
378  if(DBlayer==1) numberOfDigis[2]++;
379  if(DBlayer==2) numberOfDigis[3]++;
380  if(DBlayer==3) numberOfDigis[4]++;
381  }else{
382  numberOfDigis[1]++; nDigisB++;
383  if(DBlayer==1) numberOfDigis[5]++;
384  if(DBlayer==2) numberOfDigis[6]++;
385  if(DBlayer==3) numberOfDigis[7]++;
386  }
387  }
388  }
389  } else if (isUpgrade) {
390  DBlayer = PixelBarrelName(DetId(id_),pTT,isUpgrade).layerName();
391  DBmodule = PixelBarrelName(DetId(id_),pTT,isUpgrade).moduleName();
392  if(barrel){
393  if(row<80){
394  numberOfDigis[0]++; nDigisA++;
395  if(DBlayer==1) numberOfDigis[2]++;
396  if(DBlayer==2) numberOfDigis[3]++;
397  if(DBlayer==3) numberOfDigis[4]++;
398  if(DBlayer==4) numberOfDigis[5]++;
399  }else{
400  numberOfDigis[1]++; nDigisB++;
401  if(DBlayer==1) numberOfDigis[6]++;
402  if(DBlayer==2) numberOfDigis[7]++;
403  if(DBlayer==3) numberOfDigis[8]++;
404  if(DBlayer==4) numberOfDigis[9]++;
405  }
406  }
407  }
408 
409  if(modon){
410  if(!reducedSet){
411  if(twoD) {
412  if(twoDimModOn) (mePixDigis_)->Fill((float)col,(float)row);
413  }
414  else {
415  (mePixDigis_px_)->Fill((float)col);
416  (mePixDigis_py_)->Fill((float)row);
417  }
418  }
419  (meADC_)->Fill((float)adc);
420  }
421  if(ladon && barrel){
422  (meADCLad_)->Fill((float)adc);
423  if(!reducedSet){
424  if(twoD) (mePixDigisLad_)->Fill((float)col,(float)row);
425  else {
426  (mePixDigisLad_px_)->Fill((float)col);
427  (mePixDigisLad_py_)->Fill((float)row);
428  }
429  }
430  }
431  if((layon || twoDimOnlyLayDisk) && barrel){
432  if(!twoDimOnlyLayDisk) (meADCLay_)->Fill((float)adc);
433  if(!reducedSet){
434  if((layon && twoD) || twoDimOnlyLayDisk){
435  //ROC histos...
436  float rocx = (float)col/52. + 8.0*float(DBmodule-1);
437  float rocy = (float)row/160.+float(DBladder);
438  //Shift 1st ladder (half modules) up by 1 bin
439  if(DBladder==1) rocy = rocy + 0.5;
440  mePixRocsLay_->Fill(rocx,rocy);
441 
442  if(isHalfModule && DBladder==1){
443  (mePixDigisLay_)->Fill((float)col,(float)row+80);
444  }
445  else (mePixDigisLay_)->Fill((float)col,(float)row);
446  }
447  if((layon && !twoD) && !twoDimOnlyLayDisk){
448  (mePixDigisLay_px_)->Fill((float)col);
449  if(isHalfModule && DBladder==1) {
450  (mePixDigisLay_py_)->Fill((float)row+80);
451  }
452  else (mePixDigisLay_py_)->Fill((float)row);
453  }
454  }
455  }
456  if(phion && barrel){
457  (meADCPhi_)->Fill((float)adc);
458  if(!reducedSet)
459  {
460  if(twoD){
461  if(isHalfModule && DBladder==1){
462  (mePixDigisPhi_)->Fill((float)col,(float)row+80);
463  }
464  else (mePixDigisPhi_)->Fill((float)col,(float)row);
465  }
466  else {
467  (mePixDigisPhi_px_)->Fill((float)col);
468  if(isHalfModule && DBladder==1) {
469  (mePixDigisPhi_py_)->Fill((float)row+80);
470  }
471  else (mePixDigisPhi_py_)->Fill((float)row);
472  }
473  }
474  }
475  if(bladeon && endcap){
476  (meADCBlade_)->Fill((float)adc);
477  }
478 
479  if((diskon || twoDimOnlyLayDisk) && endcap){
480  if(!twoDimOnlyLayDisk) (meADCDisk_)->Fill((float)adc);
481  if(twoDimOnlyLayDisk){
482  (mePixDigisDisk_)->Fill((float)col,(float)row);
483  //ROC monitoring
484  int DBpanel;
485  int DBblade;
486  DBpanel= PixelEndcapName(DetId(id_),pTT,isUpgrade).pannelName();
487  DBblade= PixelEndcapName(DetId(id_),pTT,isUpgrade).bladeName();
488  float offx = 0.;
489  //This crazy offset takes into account the roc and module fpix configuration
490  for (int i = DBpanel; i < DBmodule; ++i) {offx = offx + float(5+DBpanel-i);}
491  float rocx = (float)col/52. + offx + 14.0*float(DBpanel-1);
492  float rocy = (float)row/160.+float(DBblade);
493  mePixRocsDisk_->Fill(rocx,rocy);
494  }
495  }
496  if(ringon && endcap){
497  (meADCRing_)->Fill((float)adc);
498  if(!reducedSet)
499  {
500  if(twoD) (mePixDigisRing_)->Fill((float)col,(float)row);
501  else {
502  (mePixDigisRing_px_)->Fill((float)col);
503  (mePixDigisRing_py_)->Fill((float)row);
504  }
505  }
506  }
507  }
508  if(modon) (meNDigis_)->Fill((float)numberOfDigisMod);
509  if(ladon && barrel) (meNDigisLad_)->Fill((float)numberOfDigisMod);
510  if(layon && barrel && !twoDimOnlyLayDisk) (meNDigisLay_)->Fill((float)numberOfDigisMod);
511  if(phion && barrel) (meNDigisPhi_)->Fill((float)numberOfDigisMod);
512  if(bladeon && endcap) (meNDigisBlade_)->Fill((float)numberOfDigisMod);
513  if(diskon && endcap && !twoDimOnlyLayDisk) (meNDigisDisk_)->Fill((float)numberOfDigisMod);
514  if(ringon && endcap) (meNDigisRing_)->Fill((float)numberOfDigisMod);
515  if(barrel){
516  if(combBarrel) combBarrel->Fill((float)numberOfDigisMod);
517  if(chanBarrel){ if(numberOfDigis[0]>0) chanBarrel->Fill((float)numberOfDigis[0]); if(numberOfDigis[1]>0) chanBarrel->Fill((float)numberOfDigis[1]); }
518  int j = 2;
519  for (std::vector<MonitorElement*>::iterator i = chanBarrelL.begin(); i != chanBarrelL.end(); i++)
520  {
521  if(numberOfDigis[j]>0) (*i)->Fill((float)numberOfDigis[j]);
522  j++;
523  }
524  }else if(endcap){
525  if(combEndcap) combEndcap->Fill((float)numberOfDigisMod);
526  }
527  }
528 
529  //std::cout<<"numberOfDigis for this module: "<<numberOfDigis<<std::endl;
530  return numberOfDigisMod;
531 }
532 
533 // This was done in the Source file, but is moved to the Module for thread safety reasons. Using ME that is booked here.
537 }
538 
539 //Moved from source. Gets the zero and low eff ROCs from each module. Called in source for each module.
541  int nZeroROC = 0;
542  int nLoEffROC = 0;
543  float SF = 1.0;
546  for (int i = 1; i < mePixRocsDisk_->getNbinsX()+1; ++i){
547  for (int j = 1; j < mePixRocsDisk_->getNbinsY()+1; ++j){
548  float localX = float(i) - 0.5;
549  float localY = float(j)/2.0 + 0.75;
550  if (mePixRocsDisk_->getBinContent(i,j) < 1 ) {nZeroROC++; meZeroOccRocsDisk_->Fill(localX,localY);}
551  if (mePixRocsDisk_->getBinContent(i,j)*SF < 0.25){nLoEffROC++;}
552  }
553  }
554  return std::pair<int,int>(nZeroROC,nLoEffROC);
555  }
558  for (int i = 1; i < mePixRocsLay_->getNbinsX()+1; ++i){
559  for (int j = 1; j < mePixRocsLay_->getNbinsY()+1; ++j){
560  float localX = float(i) - 0.5;
561  float localY = float(j)/2.0 + 1.25;
562  if (mePixRocsLay_->getBinContent(i,j) < 8 ) {nZeroROC++; meZeroOccRocsLay_->Fill(localX,localY);} //in some regions of pixel there are modules with no HV but enabled ROCs that sometime give a fake hit, so the dead rocs have to be counted to have less than 8 hits in 10 LS
563  if (mePixRocsLay_->getBinContent(i,j)*SF < 0.25){nLoEffROC++;}
564  }
565  }
566  return std::pair<int,int>(nZeroROC,nLoEffROC);
567  }
568  return std::pair<int,int>(0,0);
569 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int plaquetteName() const
plaquetteId (in pannel)
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
MonitorElement * meNDigisRing_
MonitorElement * mePixDigisLad_py_
MonitorElement * mePixDigis_
MonitorElement * mePixDigisPhi_py_
iterator find(det_id_type id)
Definition: DetSetVector.h:290
int moduleName() const
module id (index in z)
MonitorElement * meADCRing_
MonitorElement * meNDigis_
MonitorElement * mePixDigisRing_px_
MonitorElement * mePixDigis_py_
std::pair< int, int > getZeroLoEffROCs()
~SiPixelDigiModule()
Destructor.
MonitorElement * meADC_
double getEntries(void) const
get # of entries
MonitorElement * mePixDigisDisk_
static std::string const input
Definition: EdmProvDump.cc:44
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
MonitorElement * meNDigisBlade_
int bladeName() const
blade id
MonitorElement * meADCDisk_
MonitorElement * mePixDigisPhi_px_
bool isHalfModule() const
full or half module
MonitorElement * mePixDigisRing_py_
MonitorElement * mePixRocsDisk_
MonitorElement * mePixRocsLay_
MonitorElement * meZeroOccRocsLay_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * mePixDigisLay_py_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * meADCLad_
MonitorElement * meADCBlade_
MonitorElement * meNDigisLay_
SiPixelDigiModule()
Default constructor.
MonitorElement * mePixDigisLad_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:361
MonitorElement * meADCLay_
std::string setHistoId(std::string variable, uint32_t &rawId)
Set Histogram Id.
Definition: DetId.h:18
void book(const edm::ParameterSet &iConfig, const edm::EventSetup &iSetup, DQMStore::IBooker &iBooker, int type=0, bool twoD=true, bool hiRes=false, bool reducedSet=false, bool additInfo=false, bool isUpgrade=false)
Book histograms.
int ladderName() const
ladder id (index in phi)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * mePixDigis_px_
const T & get() const
Definition: EventSetup.h:55
int layerName() const
layer id
MonitorElement * mePixDigisLad_px_
Shell shell() const
MonitorElement * mePixDigisLay_
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * meNDigisPhi_
double getBinContent(int binx) const
get content of bin (1-D)
int pannelName() const
pannel id
MonitorElement * meZeroOccRocsDisk_
col
Definition: cuy.py:1008
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * mePixDigisRing_
MonitorElement * meADCPhi_
int diskName() const
disk id
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
int fill(const edm::DetSetVector< PixelDigi > &input, const edm::EventSetup &iSetup, MonitorElement *combBarrel, MonitorElement *chanBarrel, std::vector< MonitorElement * > &chanBarrelL, MonitorElement *combEndcap, const bool modon, const bool ladon, const bool layon, const bool phion, const bool bladeon, const bool diskon, const bool ringon, const bool twoD, const bool reducedSet, const bool twoDimModOn, const bool twoDimOnlyLayDisk, int &nDigisA, int &nDigisB, bool isUpgrade)
Fill histograms.
MonitorElement * mePixDigisPhi_
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104
MonitorElement * meNDigisDisk_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
T const * product() const
Definition: ESHandle.h:86
MonitorElement * meNDigisLad_
MonitorElement * mePixDigisLay_px_