CMS 3D CMS Logo

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