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