CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EEPedestalTask.cc
Go to the documentation of this file.
1 /*
2  * \file EEPedestalTask.cc
3  *
4  * $Date: 2010/07/30 05:42:47 $
5  * $Revision: 1.54 $
6  * \author G. Della Ricca
7  *
8 */
9 
10 #include <iostream>
11 #include <fstream>
12 #include <vector>
13 
16 
18 
20 
25 
27 
29 
30 // #define COMMON_NOISE_ANALYSIS
31 
33 
34  init_ = false;
35 
37 
38  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
39 
40  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
41 
42  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
43 
44  EcalRawDataCollection_ = ps.getParameter<edm::InputTag>("EcalRawDataCollection");
45  EEDigiCollection_ = ps.getParameter<edm::InputTag>("EEDigiCollection");
46  EcalPnDiodeDigiCollection_ = ps.getParameter<edm::InputTag>("EcalPnDiodeDigiCollection");
47 
48  MGPAGains_.reserve(3);
49  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
50  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
51 
52  MGPAGainsPN_.reserve(2);
53  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
54  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
55 
56  for (int i = 0; i < 18; i++) {
57  mePedMapG01_[i] = 0;
58  mePedMapG06_[i] = 0;
59  mePedMapG12_[i] = 0;
60 #ifdef COMMON_NOISE_ANALYSIS
61  mePed3SumMapG01_[i] = 0;
62  mePed3SumMapG06_[i] = 0;
63  mePed3SumMapG12_[i] = 0;
64  mePed5SumMapG01_[i] = 0;
65  mePed5SumMapG06_[i] = 0;
66  mePed5SumMapG12_[i] = 0;
67 #endif
68  mePnPedMapG01_[i] = 0;
69  mePnPedMapG16_[i] = 0;
70  }
71 
72 }
73 
75 
76 }
77 
79 
80  ievt_ = 0;
81 
82  if ( dqmStore_ ) {
83  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
84  dqmStore_->rmdir(prefixME_ + "/EEPedestalTask");
85  }
86 
87 }
88 
90 
91  Numbers::initGeometry(c, false);
92 
93  if ( ! mergeRuns_ ) this->reset();
94 
95 }
96 
98 
99 }
100 
102 
103  for (int i = 0; i < 18; i++) {
104  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
105  if ( mePedMapG01_[i] ) mePedMapG01_[i]->Reset();
106  }
107  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
108  if ( mePedMapG06_[i] ) mePedMapG06_[i]->Reset();
109  }
110  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
111  if ( mePedMapG12_[i] ) mePedMapG12_[i]->Reset();
112  }
113 #ifdef COMMON_NOISE_ANALYSIS
120 #endif
121  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
122  if ( mePnPedMapG01_[i] ) mePnPedMapG01_[i]->Reset();
123  }
124  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
125  if ( mePnPedMapG16_[i] ) mePnPedMapG16_[i]->Reset();
126  }
127  }
128 
129 }
130 
132 
133  init_ = true;
134 
135  char histo[200];
136 
137  if ( dqmStore_ ) {
138  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
139 
140  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
141 
142  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain01");
143  for (int i = 0; i < 18; i++) {
144  sprintf(histo, "EEPT pedestal %s G01", Numbers::sEE(i+1).c_str());
145  mePedMapG01_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
146  mePedMapG01_[i]->setAxisTitle("ix", 1);
147  if ( i+1 >= 1 && i+1 <= 9 ) mePedMapG01_[i]->setAxisTitle("101-ix", 1);
148  mePedMapG01_[i]->setAxisTitle("iy", 2);
149  dqmStore_->tag(mePedMapG01_[i], i+1);
150 #ifdef COMMON_NOISE_ANALYSIS
151  sprintf(histo, "EEPT pedestal 3sum %s G01", Numbers::sEE(i+1).c_str());
152  mePed3SumMapG01_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
153  mePed3SumMapG01_[i]->setAxisTitle("ix", 1);
154  if ( i+1 >= 1 && i+1 <= 9 ) mePed3SumMapG01_[i]->setAxisTitle("101-ix", 1);
155  mePed3SumMapG01_[i]->setAxisTitle("iy", 2);
156  dqmStore_->tag(mePed3SumMapG01_[i], i+1);
157  sprintf(histo, "EEPT pedestal 5sum %s G01", Numbers::sEE(i+1).c_str());
158  mePed5SumMapG01_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
159  mePed5SumMapG01_[i]->setAxisTitle("ix", 1);
160  if ( i+1 >= 1 && i+1 <= 9 ) mePed5SumMapG01_[i]->setAxisTitle("101-ix", 1);
161  mePed5SumMapG01_[i]->setAxisTitle("iy", 2);
162  dqmStore_->tag(mePed5SumMapG01_[i], i+1);
163 #endif
164  }
165 
166  }
167 
168  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
169 
170  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain06");
171  for (int i = 0; i < 18; i++) {
172  sprintf(histo, "EEPT pedestal %s G06", Numbers::sEE(i+1).c_str());
173  mePedMapG06_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
174  mePedMapG06_[i]->setAxisTitle("ix", 1);
175  if ( i+1 >= 1 && i+1 <= 9 ) mePedMapG06_[i]->setAxisTitle("101-ix", 1);
176  mePedMapG06_[i]->setAxisTitle("iy", 2);
177  dqmStore_->tag(mePedMapG06_[i], i+1);
178 #ifdef COMMON_NOISE_ANALYSIS
179  sprintf(histo, "EEPT pedestal 3sum %s G06", Numbers::sEE(i+1).c_str());
180  mePed3SumMapG06_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
181  mePed3SumMapG06_[i]->setAxisTitle("ix", 1);
182  if ( i+1 >= 1 && i+1 <= 9 ) mePed3SumMapG06_[i]->setAxisTitle("101-ix", 1);
183  mePed3SumMapG06_[i]->setAxisTitle("iy", 2);
184  dqmStore_->tag(mePed3SumMapG06_[i], i+1);
185  sprintf(histo, "EEPT pedestal 5sum %s G06", Numbers::sEE(i+1).c_str());
186  mePed5SumMapG06_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
187  mePed5SumMapG06_[i]->setAxisTitle("ix", 1);
188  if ( i+1 >= 1 && i+1 <= 9 ) mePed5SumMapG06_[i]->setAxisTitle("101-ix", 1);
189  mePed5SumMapG06_[i]->setAxisTitle("iy", 2);
190  dqmStore_->tag(mePed5SumMapG06_[i], i+1);
191 #endif
192  }
193 
194  }
195 
196  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
197 
198  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain12");
199  for (int i = 0; i < 18; i++) {
200  sprintf(histo, "EEPT pedestal %s G12", Numbers::sEE(i+1).c_str());
201  mePedMapG12_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
202  mePedMapG12_[i]->setAxisTitle("ix", 1);
203  if ( i+1 >= 1 && i+1 <= 9 ) mePedMapG12_[i]->setAxisTitle("101-ix", 1);
204  mePedMapG12_[i]->setAxisTitle("iy", 2);
205  dqmStore_->tag(mePedMapG12_[i], i+1);
206 #ifdef COMMON_NOISE_ANALYSIS
207  sprintf(histo, "EEPT pedestal 3sum %s G12", Numbers::sEE(i+1).c_str());
208  mePed3SumMapG12_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
209  mePed3SumMapG12_[i]->setAxisTitle("ix", 1);
210  if ( i+1 >= 1 && i+1 <= 9 ) mePed3SumMapG12_[i]->setAxisTitle("101-ix", 1);
211  mePed3SumMapG12_[i]->setAxisTitle("iy", 2);
212  dqmStore_->tag(mePed3SumMapG12_[i], i+1);
213  sprintf(histo, "EEPT pedestal 5sum %s G12", Numbers::sEE(i+1).c_str());
214  mePed5SumMapG12_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
215  mePed5SumMapG12_[i]->setAxisTitle("ix", 1);
216  if ( i+1 >= 1 && i+1 <= 9 ) mePed5SumMapG12_[i]->setAxisTitle("101-ix", 1);
217  mePed5SumMapG12_[i]->setAxisTitle("iy", 2);
218  dqmStore_->tag(mePed5SumMapG12_[i], i+1);
219 #endif
220  }
221 
222  }
223 
224  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN");
225 
226  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
227 
228  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain01");
229  for (int i = 0; i < 18; i++) {
230  sprintf(histo, "EEPDT PNs pedestal %s G01", Numbers::sEE(i+1).c_str());
231  mePnPedMapG01_[i] = dqmStore_->bookProfile(histo, histo, 10, 0., 10., 4096, 0., 4096., "s");
232  mePnPedMapG01_[i]->setAxisTitle("channel", 1);
233  mePnPedMapG01_[i]->setAxisTitle("pedestal", 2);
234  dqmStore_->tag(mePnPedMapG01_[i], i+1);
235  }
236 
237  }
238 
239  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
240 
241  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain16");
242  for (int i = 0; i < 18; i++) {
243  sprintf(histo, "EEPDT PNs pedestal %s G16", Numbers::sEE(i+1).c_str());
244  mePnPedMapG16_[i] = dqmStore_->bookProfile(histo, histo, 10, 0., 10., 4096, 0., 4096., "s");
245  mePnPedMapG16_[i]->setAxisTitle("channel", 1);
246  mePnPedMapG16_[i]->setAxisTitle("pedestal", 2);
247  dqmStore_->tag(mePnPedMapG16_[i], i+1);
248  }
249 
250  }
251 
252  }
253 
254 }
255 
257 
258  if ( ! init_ ) return;
259 
260  if ( dqmStore_ ) {
261  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask");
262 
263  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
264 
265  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain01");
266  for ( int i = 0; i < 18; i++ ) {
268  mePedMapG01_[i] = 0;
269 #ifdef COMMON_NOISE_ANALYSIS
271  mePed3SumMapG01_[i] = 0;
273  mePed5SumMapG01_[i] = 0;
274 #endif
275  }
276 
277  }
278 
279  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
280 
281  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain06");
282  for ( int i = 0; i < 18; i++ ) {
284  mePedMapG06_[i] = 0;
285 #ifdef COMMON_NOISE_ANALYSIS
287  mePed3SumMapG06_[i] = 0;
289  mePed5SumMapG06_[i] = 0;
290 #endif
291  }
292 
293  }
294 
295  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
296 
297  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/Gain12");
298  for ( int i = 0; i < 18; i++ ) {
300  mePedMapG12_[i] = 0;
301 #ifdef COMMON_NOISE_ANALYSIS
303  mePed3SumMapG12_[i] = 0;
305  mePed5SumMapG12_[i] = 0;
306 #endif
307  }
308 
309  }
310 
311  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN");
312 
313  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
314 
315  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain01");
316  for ( int i = 0; i < 18; i++ ) {
318  mePnPedMapG01_[i] = 0;
319  }
320 
321  }
322 
323  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
324 
325  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalTask/PN/Gain16");
326  for ( int i = 0; i < 18; i++ ) {
328  mePnPedMapG16_[i] = 0;
329  }
330 
331  }
332 
333  }
334 
335  init_ = false;
336 
337 }
338 
340 
341  edm::LogInfo("EEPedestalTask") << "analyzed " << ievt_ << " events";
342 
343  if ( enableCleanup_ ) this->cleanup();
344 
345 }
346 
348 
349  bool enable = false;
350  int runType[18];
351  for (int i=0; i<18; i++) runType[i] = -1;
352 
354 
355  if ( e.getByLabel(EcalRawDataCollection_, dcchs) ) {
356 
357  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
358 
359  if ( Numbers::subDet( *dcchItr ) != EcalEndcap ) continue;
360 
361  int ism = Numbers::iSM( *dcchItr, EcalEndcap );
362 
363  runType[ism-1] = dcchItr->getRunType();
364 
365  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_STD ||
366  dcchItr->getRunType() == EcalDCCHeaderBlock::PEDESTAL_GAP ) enable = true;
367 
368  }
369 
370  } else {
371 
372  edm::LogWarning("EEPedestalTask") << EcalRawDataCollection_ << " not available";
373 
374  }
375 
376  if ( ! enable ) return;
377 
378  if ( ! init_ ) this->setup();
379 
380  ievt_++;
381 
383 
384  if ( e.getByLabel(EEDigiCollection_, digis) ) {
385 
386  int need = digis->size();
387  LogDebug("EEPedestalTask") << "event " << ievt_ << " digi collection size " << need;
388 
389  float xmap01[18][50][50];
390  float xmap06[18][50][50];
391  float xmap12[18][50][50];
392 
393  for ( int ism = 1; ism <= 18; ism++ ) {
394  for ( int ix = 1; ix <= 50; ix++ ) {
395  for ( int iy = 1; iy <= 50; iy++ ) {
396 
397  xmap01[ism-1][ix-1][iy-1] = 0.;
398  xmap06[ism-1][ix-1][iy-1] = 0.;
399  xmap12[ism-1][ix-1][iy-1] = 0.;
400 
401  }
402  }
403  }
404 
405  for ( EEDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
406 
407  EEDetId id = digiItr->id();
408 
409  int ix = id.ix();
410  int iy = id.iy();
411 
412  int ism = Numbers::iSM( id );
413 
414  if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
415 
416  float xix = ix - 0.5;
417  float xiy = iy - 0.5;
418 
419  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_STD ||
420  runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_GAP ) ) continue;
421 
422  EEDataFrame dataframe = (*digiItr);
423 
424  for (int i = 0; i < 10; i++) {
425 
426  int adc = dataframe.sample(i).adc();
427 
428  MonitorElement* mePedMap = 0;
429 
430  if ( dataframe.sample(i).gainId() == 1 ) mePedMap = mePedMapG12_[ism-1];
431  if ( dataframe.sample(i).gainId() == 2 ) mePedMap = mePedMapG06_[ism-1];
432  if ( dataframe.sample(i).gainId() == 3 ) mePedMap = mePedMapG01_[ism-1];
433 
434  float xval = float(adc);
435 
436  if ( mePedMap ) mePedMap->Fill(xix, xiy, xval);
437 
438  if ( dataframe.sample(i).gainId() == 1 ) xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
439  if ( dataframe.sample(i).gainId() == 2 ) xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
440  if ( dataframe.sample(i).gainId() == 3 ) xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] = xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)] + xval;
441 
442  }
443 
444  xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap12[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
445  xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap06[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
446  xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]=xmap01[ism-1][ix-1-Numbers::ix0EE(ism)][iy-1-Numbers::iy0EE(ism)]/10.;
447 
448  }
449 
450  // to be re-done using the 3x3 & 5x5 Selectors (if faster)
451 
452 #ifdef COMMON_NOISE_ANALYSIS
453  for ( int ism = 1; ism <= 18; ism++ ) {
454  for ( int ix = 1; ix <= 50; ix++ ) {
455  for ( int iy = 1; iy <= 50; iy++ ) {
456 
457  int xix = ix + Numbers::ix0EE(ism);
458  int xiy = iy + Numbers::iy0EE(ism);
459 
460  if ( ism >= 1 && ism <= 9 ) xix = 101 - xix;
461 
462  if ( ! Numbers::validEE(ism, xix, xiy) ) continue;
463 
464  float xix = ix - 0.5;
465  float xiy = iy - 0.5;
466 
467  float x3val01;
468  float x3val06;
469  float x3val12;
470 
471  if ( ix >= 2 && ix <= 49 && iy >= 2 && iy <= 49 ) {
472 
473  x3val01 = 0.;
474  x3val06 = 0.;
475  x3val12 = 0.;
476  for ( int i = -1; i <= +1; i++ ) {
477  for ( int j = -1; j <= +1; j++ ) {
478 
479  x3val01 = x3val01 + xmap01[ism-1][ix-1+i][iy-1+j];
480  x3val06 = x3val06 + xmap06[ism-1][ix-1+i][iy-1+j];
481  x3val12 = x3val12 + xmap12[ism-1][ix-1+i][iy-1+j];
482 
483  }
484  }
485  x3val01 = x3val01 / 9.;
486  x3val06 = x3val06 / 9.;
487  x3val12 = x3val12 / 9.;
488  if ( mePed3SumMapG01_[ism-1] && x3val01 != 0. ) mePed3SumMapG01_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val01);
489  if ( mePed3SumMapG06_[ism-1] && x3val06 != 0. ) mePed3SumMapG06_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val06);
490  if ( mePed3SumMapG12_[ism-1] && x3val12 != 0. ) mePed3SumMapG12_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x3val12);
491 
492  }
493 
494  float x5val01;
495  float x5val06;
496  float x5val12;
497 
498  if ( ix >= 3 && ix <= 48 && iy >= 3 && iy <= 48 ) {
499 
500  x5val01 = 0.;
501  x5val06 = 0.;
502  x5val12 = 0.;
503  for ( int i = -2; i <= +2; i++ ) {
504  for ( int j = -2; j <= +2; j++ ) {
505 
506  x5val01 = x5val01 + xmap01[ism-1][ix-1+i][iy-1+j];
507  x5val06 = x5val06 + xmap06[ism-1][ix-1+i][iy-1+j];
508  x5val12 = x5val12 + xmap12[ism-1][ix-1+i][iy-1+j];
509 
510  }
511  }
512  x5val01 = x5val01 / 25.;
513  x5val06 = x5val06 / 25.;
514  x5val12 = x5val12 / 25.;
515  if ( mePed5SumMapG01_[ism-1] && x5val01 != 0. ) mePed5SumMapG01_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val01);
516  if ( mePed5SumMapG06_[ism-1] && x5val06 != 0. ) mePed5SumMapG06_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val06);
517  if ( mePed5SumMapG12_[ism-1] && x5val12 != 0. ) mePed5SumMapG12_[ism-1]->Fill(xix+Numbers::ix0EE(ism), xiy+Numbers::iy0EE(ism), x5val12);
518 
519  }
520 
521  }
522  }
523  }
524 #endif
525 
526  } else {
527 
528  edm::LogWarning("EEPedestalTask") << EEDigiCollection_ << " not available";
529 
530  }
531 
533 
534  if ( e.getByLabel(EcalPnDiodeDigiCollection_, pns) ) {
535 
536  int nep = pns->size();
537  LogDebug("EEPedestalTask") << "event " << ievt_ << " pns collection size " << nep;
538 
539  for ( EcalPnDiodeDigiCollection::const_iterator pnItr = pns->begin(); pnItr != pns->end(); ++pnItr ) {
540 
541  if ( Numbers::subDet( pnItr->id() ) != EcalEndcap ) continue;
542 
543  int ism = Numbers::iSM( pnItr->id() );
544 
545  int num = pnItr->id().iPnId();
546 
547  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_STD ||
548  runType[ism-1] == EcalDCCHeaderBlock::PEDESTAL_GAP ) ) continue;
549 
550  for (int i = 0; i < 50; i++) {
551 
552  int adc = pnItr->sample(i).adc();
553 
554  MonitorElement* mePNPed = 0;
555 
556  if ( pnItr->sample(i).gainId() == 0 ) mePNPed = mePnPedMapG01_[ism-1];
557  if ( pnItr->sample(i).gainId() == 1 ) mePNPed = mePnPedMapG16_[ism-1];
558 
559  float xval = float(adc);
560 
561  if ( mePNPed ) mePNPed->Fill(num - 0.5, xval);
562 
563  }
564 
565  }
566 
567  } else {
568 
569  edm::LogWarning("EEPedestalTask") << EcalPnDiodeDigiCollection_ << " not available";
570 
571  }
572 
573 }
574 
int adc(sample_type sample)
get the ADC sample (12 bits)
#define LogDebug(id)
edm::InputTag EcalRawDataCollection_
T getParameter(std::string const &) const
MonitorElement * mePedMapG06_[18]
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
int ix() const
Definition: EEDetId.h:71
void cleanup(void)
Cleanup.
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2296
MonitorElement * mePedMapG01_[18]
static int iy0EE(const int ism)
Definition: Numbers.cc:964
Some &quot;id&quot; conversions.
void setup(void)
Setup.
static std::string sEE(const int ism)
Definition: Numbers.cc:199
edm::InputTag EcalPnDiodeDigiCollection_
std::vector< T >::const_iterator const_iterator
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:28
tuple histo
Definition: trackerHits.py:12
MonitorElement * mePnPedMapG16_[18]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int gainId() const
get the gainId (2 bits)
edm::InputTag EEDigiCollection_
void reset(void)
Reset.
void Fill(long long x)
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1156
EEPedestalTask(const edm::ParameterSet &ps)
Constructor.
void endJob(void)
EndJob.
void beginJob(void)
BeginJob.
static int iSM(const int ism, const EcalSubdetector subdet)
Definition: Numbers.cc:216
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
virtual ~EEPedestalTask()
Destructor.
void removeElement(const std::string &name)
Definition: DQMStore.cc:2338
MonitorElement * mePed3SumMapG06_[18]
int j
Definition: DBlmapReader.cc:9
MonitorElement * mePed5SumMapG06_[18]
MonitorElement * mePed3SumMapG01_[18]
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:833
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
std::vector< int > MGPAGains_
std::string prefixME_
MonitorElement * mePed5SumMapG12_[18]
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:43
MonitorElement * mePnPedMapG01_[18]
long long int num
Definition: procUtils.cc:71
std::vector< int > MGPAGainsPN_
MonitorElement * mePed5SumMapG01_[18]
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
static int ix0EE(const int ism)
Definition: Numbers.cc:946
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:130
static bool validEE(const int ism, const int ix, const int iy)
Definition: Numbers.cc:982
DQMStore * dqmStore_
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:47
MonitorElement * mePed3SumMapG12_[18]
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)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
Definition: Run.h:31
int adc() const
get the ADC sample (12 bits)
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:977