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