CMS 3D CMS Logo

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