CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EELaserTask.cc
Go to the documentation of this file.
1 /*
2  * \file EELaserTask.cc
3  *
4  * $Date: 2012/04/27 13:46:15 $
5  * $Revision: 1.81 $
6  * \author G. Della Ricca
7  *
8 */
9 
10 #include <iostream>
11 #include <sstream>
12 #include <vector>
13 
16 
18 
20 
27 
30 
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  EcalUncalibratedRecHitCollection_ = ps.getParameter<edm::InputTag>("EcalUncalibratedRecHitCollection");
49 
50  // vector of enabled wavelengths (Default to all 4)
51  laserWavelengths_.reserve(4);
52  for ( unsigned int i = 1; i <= 4; i++ ) laserWavelengths_.push_back(i);
53  laserWavelengths_ = ps.getUntrackedParameter<std::vector<int> >("laserWavelengths", laserWavelengths_);
54 
55  for (int i = 0; i < 18; i++) {
56  meShapeMapL1_[i] = 0;
57  meAmplMapL1_[i] = 0;
58  meTimeMapL1_[i] = 0;
59  meAmplPNMapL1_[i] = 0;
60  mePnAmplMapG01L1_[i] = 0;
61  mePnPedMapG01L1_[i] = 0;
62  mePnAmplMapG16L1_[i] = 0;
63  mePnPedMapG16L1_[i] = 0;
64 
65  meShapeMapL2_[i] = 0;
66  meAmplMapL2_[i] = 0;
67  meTimeMapL2_[i] = 0;
68  meAmplPNMapL2_[i] = 0;
69  mePnAmplMapG01L2_[i] = 0;
70  mePnPedMapG01L2_[i] = 0;
71  mePnAmplMapG16L2_[i] = 0;
72  mePnPedMapG16L2_[i] = 0;
73 
74  meShapeMapL3_[i] = 0;
75  meAmplMapL3_[i] = 0;
76  meTimeMapL3_[i] = 0;
77  meAmplPNMapL3_[i] = 0;
78  mePnAmplMapG01L3_[i] = 0;
79  mePnPedMapG01L3_[i] = 0;
80  mePnAmplMapG16L3_[i] = 0;
81  mePnPedMapG16L3_[i] = 0;
82 
83  meShapeMapL4_[i] = 0;
84  meAmplMapL4_[i] = 0;
85  meTimeMapL4_[i] = 0;
86  meAmplPNMapL4_[i] = 0;
87  mePnAmplMapG01L4_[i] = 0;
88  mePnPedMapG01L4_[i] = 0;
89  mePnAmplMapG16L4_[i] = 0;
90  mePnPedMapG16L4_[i] = 0;
91  }
92 
93  for(int i=0; i<2; i++){
98  }
99 
100 }
101 
103 
104 }
105 
107 
108  ievt_ = 0;
109 
110  if ( dqmStore_ ) {
111  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask");
112  dqmStore_->rmdir(prefixME_ + "/EELaserTask");
113  }
114 
115 }
116 
118 
119  Numbers::initGeometry(c, false);
120 
121  if ( ! mergeRuns_ ) this->reset();
122 
123 }
124 
126 
127 }
128 
129 void EELaserTask::reset(void) {
130 
131  for (int i = 0; i < 18; i++) {
132  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
133  if ( meShapeMapL1_[i] ) meShapeMapL1_[i]->Reset();
134  if ( meAmplMapL1_[i] ) meAmplMapL1_[i]->Reset();
135  if ( meTimeMapL1_[i] ) meTimeMapL1_[i]->Reset();
136  if ( meAmplPNMapL1_[i] ) meAmplPNMapL1_[i]->Reset();
137  }
138 
139  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
140  if ( meShapeMapL2_[i] ) meShapeMapL2_[i]->Reset();
141  if ( meAmplMapL2_[i] ) meAmplMapL2_[i]->Reset();
142  if ( meTimeMapL2_[i] ) meTimeMapL2_[i]->Reset();
143  if ( meAmplPNMapL2_[i] ) meAmplPNMapL2_[i]->Reset();
144  }
145 
146  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
147  if ( meShapeMapL3_[i] ) meShapeMapL3_[i]->Reset();
148  if ( meAmplMapL3_[i] ) meAmplMapL3_[i]->Reset();
149  if ( meTimeMapL3_[i] ) meTimeMapL3_[i]->Reset();
150  if ( meAmplPNMapL3_[i] ) meAmplPNMapL3_[i]->Reset();
151  }
152 
153  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
154  if ( meShapeMapL4_[i] ) meShapeMapL4_[i]->Reset();
155  if ( meAmplMapL4_[i] ) meAmplMapL4_[i]->Reset();
156  if ( meTimeMapL4_[i] ) meTimeMapL4_[i]->Reset();
157  if ( meAmplPNMapL4_[i] ) meAmplPNMapL4_[i]->Reset();
158  }
159 
160  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
163 
166  }
167 
168 
169  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
172 
175  }
176 
177  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
180 
183  }
184 
185  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
188 
191  }
192 
193  }
194 
195  for(int i=0; i<2; i++){
200  }
201 
202 }
203 
205 
206  init_ = true;
207 
209  std::stringstream LaserN, LN;
210 
211  if ( dqmStore_ ) {
212  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask");
213 
214  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
215 
216  LaserN.str("");
217  LaserN << "Laser" << 1;
218  LN.str("");
219  LN << "L" << 1;
220 
221  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str());
222  for (int i = 0; i < 18; i++) {
223  name = "EELT shape " + Numbers::sEE(i+1) + " " + LN.str();
224  meShapeMapL1_[i] = dqmStore_->bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096., "s");
225  meShapeMapL1_[i]->setAxisTitle("channel", 1);
226  meShapeMapL1_[i]->setAxisTitle("sample", 2);
227  meShapeMapL1_[i]->setAxisTitle("amplitude", 3);
228  dqmStore_->tag(meShapeMapL1_[i], i+1);
229 
230  name = "EELT amplitude " + Numbers::sEE(i+1) + " " + LN.str();
231  meAmplMapL1_[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.*12., "s");
232  meAmplMapL1_[i]->setAxisTitle("ix", 1);
233  if ( i+1 >= 1 && i+1 <= 9 ) meAmplMapL1_[i]->setAxisTitle("101-ix", 1);
234  meAmplMapL1_[i]->setAxisTitle("iy", 2);
235  dqmStore_->tag(meAmplMapL1_[i], i+1);
236 
237  name = "EELT timing " + Numbers::sEE(i+1) + " " + LN.str();
238  meTimeMapL1_[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., 250, 0., 10., "s");
239  meTimeMapL1_[i]->setAxisTitle("ix", 1);
240  if ( i+1 >= 1 && i+1 <= 9 ) meTimeMapL1_[i]->setAxisTitle("101-ix", 1);
241  meTimeMapL1_[i]->setAxisTitle("iy", 2);
242  dqmStore_->tag(meTimeMapL1_[i], i+1);
243 
244  name = "EELT amplitude over PN " + Numbers::sEE(i+1) + " " + LN.str();
245  meAmplPNMapL1_[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.*12., "s");
246  meAmplPNMapL1_[i]->setAxisTitle("ix", 1);
247  if ( i+1 >= 1 && i+1 <= 9 ) meAmplPNMapL1_[i]->setAxisTitle("101-ix", 1);
248  meAmplPNMapL1_[i]->setAxisTitle("iy", 2);
249  dqmStore_->tag(meAmplPNMapL1_[i], i+1);
250  }
251 
252  name = "EELT amplitude map " + LN.str() + " EE -";
253  meAmplSummaryMapL1_[0] = dqmStore_->bookProfile2D(name, name, 20, 0., 100., 20, 0., 100., 0., 4096.);
254  meAmplSummaryMapL1_[0]->setAxisTitle("ix", 1);
255  meAmplSummaryMapL1_[0]->setAxisTitle("iy", 2);
256 
257  name = "EELT amplitude map " + LN.str() + " EE +";
258  meAmplSummaryMapL1_[1] = dqmStore_->bookProfile2D(name, name, 20, 0., 100., 20, 0., 100., 0., 4096.);
259  meAmplSummaryMapL1_[1]->setAxisTitle("ix", 1);
260  meAmplSummaryMapL1_[1]->setAxisTitle("iy", 2);
261 
262  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str() + "/PN");
263 
264  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str() + "/PN/Gain01");
265 
266  for (int i = 0; i < 18; i++) {
267  name = "EELT PNs amplitude " + Numbers::sEE(i+1) + " G01 " + LN.str();
268  mePnAmplMapG01L1_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
269  mePnAmplMapG01L1_[i]->setAxisTitle("channel", 1);
270  mePnAmplMapG01L1_[i]->setAxisTitle("amplitude", 2);
272 
273  name = "EELT PNs pedestal " + Numbers::sEE(i+1) + " G01 " + LN.str();
274  mePnPedMapG01L1_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
275  mePnPedMapG01L1_[i]->setAxisTitle("channel", 1);
276  mePnPedMapG01L1_[i]->setAxisTitle("pedestal", 2);
277  dqmStore_->tag(mePnPedMapG01L1_[i], i+1);
278  }
279 
280  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str() + "/PN/Gain16");
281 
282  for (int i = 0; i < 18; i++) {
283  name = "EELT PNs amplitude " + Numbers::sEE(i+1) + " G16 " + LN.str();
284  mePnAmplMapG16L1_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
285  mePnAmplMapG16L1_[i]->setAxisTitle("channel", 1);
286  mePnAmplMapG16L1_[i]->setAxisTitle("amplitude", 2);
288 
289  name = "EELT PNs pedestal " + Numbers::sEE(i+1) + " G16 " + LN.str();
290  mePnPedMapG16L1_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
291  mePnPedMapG16L1_[i]->setAxisTitle("channel", 1);
292  mePnPedMapG16L1_[i]->setAxisTitle("pedestal", 2);
293  dqmStore_->tag(mePnPedMapG16L1_[i], i+1);
294  }
295 
296  }
297 
298  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
299 
300  LaserN.str("");
301  LaserN << "Laser" << 2;
302  LN.str("");
303  LN << "L" << 2;
304 
305  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str());
306  for (int i = 0; i < 18; i++) {
307  name = "EELT shape " + Numbers::sEE(i+1) + " " + LN.str();
308  meShapeMapL2_[i] = dqmStore_->bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096., "s");
309  meShapeMapL2_[i]->setAxisTitle("channel", 1);
310  meShapeMapL2_[i]->setAxisTitle("sample", 2);
311  meShapeMapL2_[i]->setAxisTitle("amplitude", 3);
312  dqmStore_->tag(meShapeMapL2_[i], i+1);
313 
314  name = "EELT amplitude " + Numbers::sEE(i+1) + " " + LN.str();
315  meAmplMapL2_[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.*12., "s");
316  meAmplMapL2_[i]->setAxisTitle("ix", 1);
317  if ( i+1 >= 1 && i+1 <= 9 ) meAmplMapL2_[i]->setAxisTitle("101-ix", 1);
318  meAmplMapL2_[i]->setAxisTitle("iy", 2);
319  dqmStore_->tag(meAmplMapL2_[i], i+1);
320 
321  name = "EELT timing " + Numbers::sEE(i+1) + " " + LN.str();
322  meTimeMapL2_[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., 250, 0., 10., "s");
323  meTimeMapL2_[i]->setAxisTitle("ix", 1);
324  if ( i+1 >= 1 && i+1 <= 9 ) meTimeMapL2_[i]->setAxisTitle("101-ix", 1);
325  meTimeMapL2_[i]->setAxisTitle("iy", 2);
326  dqmStore_->tag(meTimeMapL2_[i], i+1);
327 
328  name = "EELT amplitude over PN " + Numbers::sEE(i+1) + " " + LN.str();
329  meAmplPNMapL2_[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.*12., "s");
330  meAmplPNMapL2_[i]->setAxisTitle("ix", 1);
331  if ( i+1 >= 1 && i+1 <= 9 ) meAmplPNMapL2_[i]->setAxisTitle("101-ix", 1);
332  meAmplPNMapL2_[i]->setAxisTitle("iy", 2);
333  dqmStore_->tag(meAmplPNMapL2_[i], i+1);
334  }
335 
336  name = "EELT amplitude map " + LN.str() + " EE -";
337  meAmplSummaryMapL2_[0] = dqmStore_->bookProfile2D(name, name, 20, 0., 100., 20, 0., 100., 0., 4096.);
338  meAmplSummaryMapL2_[0]->setAxisTitle("ix", 1);
339  meAmplSummaryMapL2_[0]->setAxisTitle("iy", 2);
340 
341  name = "EELT amplitude map " + LN.str() + " EE +";
342  meAmplSummaryMapL2_[1] = dqmStore_->bookProfile2D(name, name, 20, 0., 100., 20, 0., 100., 0., 4096.);
343  meAmplSummaryMapL2_[1]->setAxisTitle("ix", 1);
344  meAmplSummaryMapL2_[1]->setAxisTitle("iy", 2);
345 
346  for (int i = 0; i < 18; i++) {
347  name = "EELT PNs amplitude " + Numbers::sEE(i+1) + " G01 " + LN.str();
348  mePnAmplMapG01L2_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
349  mePnAmplMapG01L2_[i]->setAxisTitle("channel", 1);
350  mePnAmplMapG01L2_[i]->setAxisTitle("amplitude", 2);
352 
353  name = "EELT PNs pedestal " + Numbers::sEE(i+1) + " G01 " + LN.str();
354  mePnPedMapG01L2_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
355  mePnPedMapG01L2_[i]->setAxisTitle("channel", 1);
356  mePnPedMapG01L2_[i]->setAxisTitle("pedestal", 2);
357  dqmStore_->tag(mePnPedMapG01L2_[i], i+1);
358  }
359 
360  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str() + "/PN/Gain16");
361 
362  for (int i = 0; i < 18; i++) {
363  name = "EELT PNs amplitude " + Numbers::sEE(i+1) + " G16 " + LN.str();
364  mePnAmplMapG16L2_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
365  mePnAmplMapG16L2_[i]->setAxisTitle("channel", 1);
366  mePnAmplMapG16L2_[i]->setAxisTitle("amplitude", 2);
368 
369  name = "EELT PNs pedestal " + Numbers::sEE(i+1) + " G16 " + LN.str();
370  mePnPedMapG16L2_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
371  mePnPedMapG16L2_[i]->setAxisTitle("channel", 1);
372  mePnPedMapG16L2_[i]->setAxisTitle("pedestal", 2);
373  dqmStore_->tag(mePnPedMapG16L2_[i], i+1);
374  }
375 
376  }
377 
378  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
379 
380  LaserN.str("");
381  LaserN << "Laser" << 3;
382  LN.str("");
383  LN << "L" << 3;
384 
385  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str());
386  for (int i = 0; i < 18; i++) {
387  name = "EELT shape " + Numbers::sEE(i+1) + " " + LN.str();
388  meShapeMapL3_[i] = dqmStore_->bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096., "s");
389  meShapeMapL3_[i]->setAxisTitle("channel", 1);
390  meShapeMapL3_[i]->setAxisTitle("sample", 2);
391  meShapeMapL3_[i]->setAxisTitle("amplitude", 3);
392  dqmStore_->tag(meShapeMapL3_[i], i+1);
393 
394  name = "EELT amplitude " + Numbers::sEE(i+1) + " " + LN.str();
395  meAmplMapL3_[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.*12., "s");
396  meAmplMapL3_[i]->setAxisTitle("ix", 1);
397  if ( i+1 >= 1 && i+1 <= 9 ) meAmplMapL3_[i]->setAxisTitle("101-ix", 1);
398  meAmplMapL3_[i]->setAxisTitle("iy", 2);
399  dqmStore_->tag(meAmplMapL3_[i], i+1);
400 
401  name = "EELT timing " + Numbers::sEE(i+1) + " " + LN.str();
402  meTimeMapL3_[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., 250, 0., 10., "s");
403  meTimeMapL3_[i]->setAxisTitle("ix", 1);
404  if ( i+1 >= 1 && i+1 <= 9 ) meTimeMapL3_[i]->setAxisTitle("101-ix", 1);
405  meTimeMapL3_[i]->setAxisTitle("iy", 2);
406  dqmStore_->tag(meTimeMapL3_[i], i+1);
407 
408  name = "EELT amplitude over PN " + Numbers::sEE(i+1) + " " + LN.str();
409  meAmplPNMapL3_[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.*12., "s");
410  meAmplPNMapL3_[i]->setAxisTitle("ix", 1);
411  if ( i+1 >= 1 && i+1 <= 9 ) meAmplPNMapL3_[i]->setAxisTitle("101-ix", 1);
412  meAmplPNMapL3_[i]->setAxisTitle("iy", 2);
413  dqmStore_->tag(meAmplPNMapL3_[i], i+1);
414  }
415 
416  name = "EELT amplitude map " + LN.str() + " EE -";
417  meAmplSummaryMapL3_[0] = dqmStore_->bookProfile2D(name, name, 20, 0., 100., 20, 0., 100., 0., 4096.);
418  meAmplSummaryMapL3_[0]->setAxisTitle("ix", 1);
419  meAmplSummaryMapL3_[0]->setAxisTitle("iy", 2);
420 
421  name = "EELT amplitude map " + LN.str() + " EE +";
422  meAmplSummaryMapL3_[1] = dqmStore_->bookProfile2D(name, name, 20, 0., 100., 20, 0., 100., 0., 4096.);
423  meAmplSummaryMapL3_[1]->setAxisTitle("ix", 1);
424  meAmplSummaryMapL3_[1]->setAxisTitle("iy", 2);
425 
426  for (int i = 0; i < 18; i++) {
427  name = "EELT PNs amplitude " + Numbers::sEE(i+1) + " G01 " + LN.str();
428  mePnAmplMapG01L3_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
429  mePnAmplMapG01L3_[i]->setAxisTitle("channel", 1);
430  mePnAmplMapG01L3_[i]->setAxisTitle("amplitude", 2);
432 
433  name = "EELT PNs pedestal " + Numbers::sEE(i+1) + " G01 " + LN.str();
434  mePnPedMapG01L3_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
435  mePnPedMapG01L3_[i]->setAxisTitle("channel", 1);
436  mePnPedMapG01L3_[i]->setAxisTitle("pedestal", 2);
437  dqmStore_->tag(mePnPedMapG01L3_[i], i+1);
438  }
439 
440  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str() + "/PN/Gain16");
441 
442  for (int i = 0; i < 18; i++) {
443  name = "EELT PNs amplitude " + Numbers::sEE(i+1) + " G16 " + LN.str();
444  mePnAmplMapG16L3_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
445  mePnAmplMapG16L3_[i]->setAxisTitle("channel", 1);
446  mePnAmplMapG16L3_[i]->setAxisTitle("amplitude", 2);
448 
449  name = "EELT PNs pedestal " + Numbers::sEE(i+1) + " G16 " + LN.str();
450  mePnPedMapG16L3_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
451  mePnPedMapG16L3_[i]->setAxisTitle("channel", 1);
452  mePnPedMapG16L3_[i]->setAxisTitle("pedestal", 2);
453  dqmStore_->tag(mePnPedMapG16L3_[i], i+1);
454  }
455 
456  }
457 
458  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
459 
460  LaserN.str("");
461  LaserN << "Laser" << 4;
462  LN.str("");
463  LN << "L" << 4;
464 
465  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str());
466  for (int i = 0; i < 18; i++) {
467  name = "EELT shape " + Numbers::sEE(i+1) + " " + LN.str();
468  meShapeMapL4_[i] = dqmStore_->bookProfile2D(name, name, 850, 0., 850., 10, 0., 10., 4096, 0., 4096., "s");
469  meShapeMapL4_[i]->setAxisTitle("channel", 1);
470  meShapeMapL4_[i]->setAxisTitle("sample", 2);
471  meShapeMapL4_[i]->setAxisTitle("amplitude", 3);
472  dqmStore_->tag(meShapeMapL4_[i], i+1);
473 
474  name = "EELT amplitude " + Numbers::sEE(i+1) + " " + LN.str();
475  meAmplMapL4_[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.*12., "s");
476  meAmplMapL4_[i]->setAxisTitle("ix", 1);
477  if ( i+1 >= 1 && i+1 <= 9 ) meAmplMapL4_[i]->setAxisTitle("101-ix", 1);
478  meAmplMapL4_[i]->setAxisTitle("iy", 2);
479  dqmStore_->tag(meAmplMapL4_[i], i+1);
480 
481  name = "EELT timing " + Numbers::sEE(i+1) + " " + LN.str();
482  meTimeMapL4_[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., 250, 0., 10., "s");
483  meTimeMapL4_[i]->setAxisTitle("ix", 1);
484  if ( i+1 >= 1 && i+1 <= 9 ) meTimeMapL4_[i]->setAxisTitle("101-ix", 1);
485  meTimeMapL4_[i]->setAxisTitle("iy", 2);
486  dqmStore_->tag(meTimeMapL4_[i], i+1);
487 
488  name = "EELT amplitude over PN " + Numbers::sEE(i+1) + " " + LN.str();
489  meAmplPNMapL4_[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.*12., "s");
490  meAmplPNMapL4_[i]->setAxisTitle("ix", 1);
491  if ( i+1 >= 1 && i+1 <= 9 ) meAmplPNMapL4_[i]->setAxisTitle("101-ix", 1);
492  meAmplPNMapL4_[i]->setAxisTitle("iy", 2);
493  dqmStore_->tag(meAmplPNMapL4_[i], i+1);
494  }
495 
496  name = "EELT amplitude map " + LN.str() + " EE -";
497  meAmplSummaryMapL4_[0] = dqmStore_->bookProfile2D(name, name, 20, 0., 100., 20, 0., 100., 0., 4096.);
498  meAmplSummaryMapL4_[0]->setAxisTitle("ix", 1);
499  meAmplSummaryMapL4_[0]->setAxisTitle("iy", 2);
500 
501  name = "EELT amplitude map " + LN.str() + " EE +";
502  meAmplSummaryMapL4_[1] = dqmStore_->bookProfile2D(name, name, 20, 0., 100., 20, 0., 100., 0., 4096.);
503  meAmplSummaryMapL4_[1]->setAxisTitle("ix", 1);
504  meAmplSummaryMapL4_[1]->setAxisTitle("iy", 2);
505 
506  for (int i = 0; i < 18; i++) {
507  name = "EELT PNs amplitude " + Numbers::sEE(i+1) + " G01 " + LN.str();
508  mePnAmplMapG01L4_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
509  mePnAmplMapG01L4_[i]->setAxisTitle("channel", 1);
510  mePnAmplMapG01L4_[i]->setAxisTitle("amplitude", 2);
512 
513  name = "EELT PNs pedestal " + Numbers::sEE(i+1) + " G01 " + LN.str();
514  mePnPedMapG01L4_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
515  mePnPedMapG01L4_[i]->setAxisTitle("channel", 1);
516  mePnPedMapG01L4_[i]->setAxisTitle("pedestal", 2);
517  dqmStore_->tag(mePnPedMapG01L4_[i], i+1);
518  }
519 
520  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/" + LaserN.str() + "/PN/Gain16");
521 
522  for (int i = 0; i < 18; i++) {
523  name = "EELT PNs amplitude " + Numbers::sEE(i+1) + " G16 " + LN.str();
524  mePnAmplMapG16L4_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
525  mePnAmplMapG16L4_[i]->setAxisTitle("channel", 1);
526  mePnAmplMapG16L4_[i]->setAxisTitle("amplitude", 2);
528 
529  name = "EELT PNs pedestal " + Numbers::sEE(i+1) + " G16 " + LN.str();
530  mePnPedMapG16L4_[i] = dqmStore_->bookProfile(name, name, 10, 0., 10., 4096, 0., 4096., "s");
531  mePnPedMapG16L4_[i]->setAxisTitle("channel", 1);
532  mePnPedMapG16L4_[i]->setAxisTitle("pedestal", 2);
533  dqmStore_->tag(mePnPedMapG16L4_[i], i+1);
534  }
535 
536  }
537 
538  }
539 
540 }
541 
543 
544  if ( ! init_ ) return;
545 
546  if ( dqmStore_ ) {
547  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask");
548 
549  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
550 
551  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser1");
552  for (int i = 0; i < 18; i++) {
553  if ( meShapeMapL1_[i] ) dqmStore_->removeElement( meShapeMapL1_[i]->getName() );
554  meShapeMapL1_[i] = 0;
555  if ( meAmplMapL1_[i] ) dqmStore_->removeElement( meAmplMapL1_[i]->getName() );
556  meAmplMapL1_[i] = 0;
557  if ( meTimeMapL1_[i] ) dqmStore_->removeElement( meTimeMapL1_[i]->getName() );
558  meTimeMapL1_[i] = 0;
559  if ( meAmplPNMapL1_[i] ) dqmStore_->removeElement( meAmplPNMapL1_[i]->getName() );
560  meAmplPNMapL1_[i] = 0;
561  }
562 
563  for(int i=0; i<2; i++)
565  }
566 
567  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
568 
569  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser2");
570  for (int i = 0; i < 18; i++) {
571  if ( meShapeMapL2_[i] ) dqmStore_->removeElement( meShapeMapL2_[i]->getName() );
572  meShapeMapL2_[i] = 0;
573  if ( meAmplMapL2_[i] ) dqmStore_->removeElement( meAmplMapL2_[i]->getName() );
574  meAmplMapL2_[i] = 0;
575  if ( meTimeMapL2_[i] ) dqmStore_->removeElement( meTimeMapL2_[i]->getName() );
576  meTimeMapL2_[i] = 0;
577  if ( meAmplPNMapL2_[i] ) dqmStore_->removeElement( meAmplPNMapL2_[i]->getName() );
578  meAmplPNMapL2_[i] = 0;
579  }
580 
581  for(int i=0; i<2; i++)
583 
584  }
585 
586  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
587 
588  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser3");
589  for (int i = 0; i < 18; i++) {
590  if ( meShapeMapL3_[i] ) dqmStore_->removeElement( meShapeMapL3_[i]->getName() );
591  meShapeMapL3_[i] = 0;
592  if ( meAmplMapL3_[i] ) dqmStore_->removeElement( meAmplMapL3_[i]->getName() );
593  meAmplMapL3_[i] = 0;
594  if ( meTimeMapL3_[i] ) dqmStore_->removeElement( meTimeMapL3_[i]->getName() );
595  meTimeMapL3_[i] = 0;
596  if ( meAmplPNMapL3_[i] ) dqmStore_->removeElement( meAmplPNMapL3_[i]->getName() );
597  meAmplPNMapL3_[i] = 0;
598  }
599 
600  for(int i=0; i<2; i++)
602 
603  }
604 
605  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
606 
607  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser4");
608  for (int i = 0; i < 18; i++) {
609  if ( meShapeMapL4_[i] ) dqmStore_->removeElement( meShapeMapL4_[i]->getName() );
610  meShapeMapL4_[i] = 0;
611  if ( meAmplMapL4_[i] ) dqmStore_->removeElement( meAmplMapL4_[i]->getName() );
612  meAmplMapL4_[i] = 0;
613  if ( meTimeMapL4_[i] ) dqmStore_->removeElement( meTimeMapL4_[i]->getName() );
614  meTimeMapL4_[i] = 0;
615  if ( meAmplPNMapL4_[i] ) dqmStore_->removeElement( meAmplPNMapL4_[i]->getName() );
616  meAmplPNMapL4_[i] = 0;
617  }
618 
619  for(int i=0; i<2; i++)
621 
622  }
623 
624  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
625 
626  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser1/PN");
627 
628  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser1/PN/Gain01");
629  for (int i = 0; i < 18; i++) {
630  if ( mePnAmplMapG01L1_[i] ) dqmStore_->removeElement( mePnAmplMapG01L1_[i]->getName() );
631  mePnAmplMapG01L1_[i] = 0;
632  if ( mePnPedMapG01L1_[i] ) dqmStore_->removeElement( mePnPedMapG01L1_[i]->getName() );
633  mePnPedMapG01L1_[i] = 0;
634  }
635 
636  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser1/PN/Gain16");
637  for (int i = 0; i < 18; i++) {
638  if ( mePnAmplMapG16L1_[i] ) dqmStore_->removeElement( mePnAmplMapG16L1_[i]->getName() );
639  mePnAmplMapG16L1_[i] = 0;
640  if ( mePnPedMapG16L1_[i] ) dqmStore_->removeElement( mePnPedMapG16L1_[i]->getName() );
641  mePnPedMapG16L1_[i] = 0;
642  }
643 
644  }
645 
646  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
647 
648  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser2/PN");
649 
650  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser2/PN/Gain01");
651  for (int i = 0; i < 18; i++) {
652  if ( mePnAmplMapG01L2_[i] ) dqmStore_->removeElement( mePnAmplMapG01L2_[i]->getName() );
653  mePnAmplMapG01L2_[i] = 0;
654  if ( mePnPedMapG01L2_[i] ) dqmStore_->removeElement( mePnPedMapG01L2_[i]->getName() );
655  mePnPedMapG01L2_[i] = 0;
656  }
657 
658  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser2/PN/Gain16");
659  for (int i = 0; i < 18; i++) {
660  if ( mePnAmplMapG16L2_[i] ) dqmStore_->removeElement( mePnAmplMapG16L2_[i]->getName() );
661  mePnAmplMapG16L2_[i] = 0;
662  if ( mePnPedMapG16L2_[i] ) dqmStore_->removeElement( mePnPedMapG16L2_[i]->getName() );
663  mePnPedMapG16L2_[i] = 0;
664  }
665 
666  }
667 
668  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
669 
670  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser3/PN");
671 
672  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser3/PN/Gain01");
673  for (int i = 0; i < 18; i++) {
674  if ( mePnAmplMapG01L3_[i] ) dqmStore_->removeElement( mePnAmplMapG01L3_[i]->getName() );
675  mePnAmplMapG01L3_[i] = 0;
676  if ( mePnPedMapG01L3_[i] ) dqmStore_->removeElement( mePnPedMapG01L3_[i]->getName() );
677  mePnPedMapG01L3_[i] = 0;
678  }
679 
680  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser3/PN/Gain16");
681  for (int i = 0; i < 18; i++) {
682  if ( mePnAmplMapG16L3_[i] ) dqmStore_->removeElement( mePnAmplMapG16L3_[i]->getName() );
683  mePnAmplMapG16L3_[i] = 0;
684  if ( mePnPedMapG16L3_[i] ) dqmStore_->removeElement( mePnPedMapG16L3_[i]->getName() );
685  mePnPedMapG16L3_[i] = 0;
686  }
687 
688  }
689 
690  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
691 
692  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser4/PN");
693 
694  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser4/PN/Gain01");
695  for (int i = 0; i < 18; i++) {
696  if ( mePnAmplMapG01L4_[i] ) dqmStore_->removeElement( mePnAmplMapG01L4_[i]->getName() );
697  mePnAmplMapG01L4_[i] = 0;
698  if ( mePnPedMapG01L4_[i] ) dqmStore_->removeElement( mePnPedMapG01L4_[i]->getName() );
699  mePnPedMapG01L4_[i] = 0;
700  }
701 
702  dqmStore_->setCurrentFolder(prefixME_ + "/EELaserTask/Laser4/PN/Gain16");
703  for (int i = 0; i < 18; i++) {
704  if ( mePnAmplMapG16L4_[i] ) dqmStore_->removeElement( mePnAmplMapG16L4_[i]->getName() );
705  mePnAmplMapG16L4_[i] = 0;
706  if ( mePnPedMapG16L4_[i] ) dqmStore_->removeElement( mePnPedMapG16L4_[i]->getName() );
707  mePnPedMapG16L4_[i] = 0;
708  }
709 
710  }
711 
712  }
713 
714  init_ = false;
715 
716 }
717 
719 
720  edm::LogInfo("EELaserTask") << "analyzed " << ievt_ << " events";
721 
722  if ( enableCleanup_ ) this->cleanup();
723 
724 }
725 
727 
728  bool enable = false;
729  int runType[18];
730  for (int i=0; i<18; i++) runType[i] = -1;
731  unsigned rtHalf[18];
732  for (int i=0; i<18; i++) rtHalf[i] = -1;
733  int waveLength[18];
734  for (int i=0; i<18; i++) waveLength[i] = -1;
735 
737 
738  if ( e.getByLabel(EcalRawDataCollection_, dcchs) ) {
739 
740  for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) {
741 
742  if ( Numbers::subDet( *dcchItr ) != EcalEndcap ) continue;
743 
744  int ism = Numbers::iSM( *dcchItr, EcalEndcap );
745 
746  runType[ism-1] = dcchItr->getRunType();
747  rtHalf[ism-1] = dcchItr->getRtHalf();
748  waveLength[ism-1] = dcchItr->getEventSettings().wavelength;
749 
750  if ( dcchItr->getRunType() == EcalDCCHeaderBlock::LASER_STD ||
751  dcchItr->getRunType() == EcalDCCHeaderBlock::LASER_GAP ) enable = true;
752 
753  }
754 
755  } else {
756 
757  edm::LogWarning("EELaserTask") << EcalRawDataCollection_ << " not available";
758 
759  }
760 
761  if ( ! enable ) return;
762 
763  if ( ! init_ ) this->setup();
764 
765  ievt_++;
766 
767  bool numPN[80];
768  float adcPN[80];
769  for ( int i = 0; i < 80; i++ ) {
770  numPN[i] = false;
771  adcPN[i] = 0.;
772  }
773 
774  std::vector<int> PNs;
775  PNs.reserve(12);
776 
778 
779  if ( e.getByLabel(EEDigiCollection_, digis) ) {
780 
781  int maxpos[10];
782  for(int i(0); i < 10; i++)
783  maxpos[i] = 0;
784  int nReadouts(0);
785 
786  for ( EEDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
787 
788  EEDetId id = digiItr->id();
789 
790  int ism = Numbers::iSM( id );
791 
792  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::LASER_STD ||
793  runType[ism-1] == EcalDCCHeaderBlock::LASER_GAP ) ) continue;
794 
795  if ( rtHalf[ism-1] != Numbers::RtHalf(id) ) continue;
796 
797  nReadouts++;
798 
799  EEDataFrame dataframe = (*digiItr);
800 
801  int iMax(-1);
802  float max(0.);
803  float min(4096.);
804  for (int i = 0; i < 10; i++) {
805  int adc = dataframe.sample(i).adc();
806  if(adc > max){
807  max = adc;
808  iMax = i;
809  }
810  if(adc < min)
811  min = adc;
812  }
813  if(iMax >= 0 && max - min > 20.)
814  maxpos[iMax] += 1;
815 
816  }
817 
818  int threshold(nReadouts / 2);
819  enable = false;
820  for(int i(0); i < 10; i++){
821  if(maxpos[i] > threshold){
822  enable = true;
823  break;
824  }
825  }
826 
827  if(!enable) return;
828 
829  int need = digis->size();
830  LogDebug("EELaserTask") << "event " << ievt_ << " digi collection size " << need;
831 
832  for ( EEDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
833 
834  EEDetId id = digiItr->id();
835 
836  int ix = id.ix();
837  int iy = id.iy();
838 
839  int ism = Numbers::iSM( id );
840 
841  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::LASER_STD ||
842  runType[ism-1] == EcalDCCHeaderBlock::LASER_GAP ) ) continue;
843 
844  if ( rtHalf[ism-1] != Numbers::RtHalf(id) ) continue;
845 
846  int ic = Numbers::icEE(ism, ix, iy);
847 
848  EEDataFrame dataframe = (*digiItr);
849 
850  for (int i = 0; i < 10; i++) {
851 
852  int adc = dataframe.sample(i).adc();
853 
854  MonitorElement* meShapeMap = 0;
855 
856  if ( rtHalf[ism-1] == 0 || rtHalf[ism-1] == 1 ) {
857 
858  if ( waveLength[ism-1] == 0 ) meShapeMap = meShapeMapL1_[ism-1];
859  if ( waveLength[ism-1] == 1 ) meShapeMap = meShapeMapL2_[ism-1];
860  if ( waveLength[ism-1] == 2 ) meShapeMap = meShapeMapL3_[ism-1];
861  if ( waveLength[ism-1] == 3 ) meShapeMap = meShapeMapL4_[ism-1];
862 
863  } else {
864 
865  edm::LogWarning("EELaserTask") << " RtHalf = " << rtHalf[ism-1];
866 
867  }
868 
869  float xval = float(adc);
870 
871  if ( meShapeMap ) meShapeMap->Fill(ic - 0.5, i + 0.5, xval);
872 
873  }
874 
875  NumbersPn::getPNs( ism, ix, iy, PNs );
876 
877  for (unsigned int i=0; i<PNs.size(); i++) {
878  int ipn = PNs[i];
879  if ( ipn >= 0 && ipn < 80 ) numPN[ipn] = true;
880  }
881 
882  }
883 
884  } else {
885 
886  edm::LogWarning("EELaserTask") << EEDigiCollection_ << " not available";
887 
888  }
889 
891 
892  if ( e.getByLabel(EcalPnDiodeDigiCollection_, pns) ) {
893 
894  int nep = pns->size();
895  LogDebug("EELaserTask") << "event " << ievt_ << " pns collection size " << nep;
896 
897  for ( EcalPnDiodeDigiCollection::const_iterator pnItr = pns->begin(); pnItr != pns->end(); ++pnItr ) {
898 
899  if ( Numbers::subDet( pnItr->id() ) != EcalEndcap ) continue;
900 
901  int ism = Numbers::iSM( pnItr->id() );
902 
903  int num = pnItr->id().iPnId();
904 
905  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::LASER_STD ||
906  runType[ism-1] == EcalDCCHeaderBlock::LASER_GAP ) ) continue;
907 
908  int ipn = NumbersPn::ipnEE( ism, num );
909 
910  if ( ipn >= 0 && ipn < 80 && numPN[ipn] == false ) continue;
911 
912  float xvalped = 0.;
913 
914  for (int i = 0; i < 4; i++) {
915 
916  int adc = pnItr->sample(i).adc();
917 
918  MonitorElement* mePNPed = 0;
919 
920  if ( pnItr->sample(i).gainId() == 0 ) {
921  if ( waveLength[ism-1] == 0 ) mePNPed = mePnPedMapG01L1_[ism-1];
922  if ( waveLength[ism-1] == 1 ) mePNPed = mePnPedMapG01L2_[ism-1];
923  if ( waveLength[ism-1] == 2 ) mePNPed = mePnPedMapG01L3_[ism-1];
924  if ( waveLength[ism-1] == 3 ) mePNPed = mePnPedMapG01L4_[ism-1];
925  }
926  if ( pnItr->sample(i).gainId() == 1 ) {
927  if ( waveLength[ism-1] == 0 ) mePNPed = mePnPedMapG16L1_[ism-1];
928  if ( waveLength[ism-1] == 1 ) mePNPed = mePnPedMapG16L2_[ism-1];
929  if ( waveLength[ism-1] == 2 ) mePNPed = mePnPedMapG16L3_[ism-1];
930  if ( waveLength[ism-1] == 3 ) mePNPed = mePnPedMapG16L4_[ism-1];
931  }
932 
933  float xval = float(adc);
934 
935  if ( mePNPed ) mePNPed->Fill(num - 0.5, xval);
936 
937  xvalped = xvalped + xval;
938 
939  }
940 
941  xvalped = xvalped / 4;
942 
943  float xvalmax = 0.;
944 
945  MonitorElement* mePN = 0;
946 
947  for (int i = 0; i < 50; i++) {
948 
949  int adc = pnItr->sample(i).adc();
950 
951  float xval = float(adc);
952 
953  if ( xval >= xvalmax ) xvalmax = xval;
954 
955  }
956 
957  xvalmax = xvalmax - xvalped;
958 
959  if ( pnItr->sample(0).gainId() == 0 ) {
960  if ( waveLength[ism-1] == 0 ) mePN = mePnAmplMapG01L1_[ism-1];
961  if ( waveLength[ism-1] == 1 ) mePN = mePnAmplMapG01L2_[ism-1];
962  if ( waveLength[ism-1] == 2 ) mePN = mePnAmplMapG01L3_[ism-1];
963  if ( waveLength[ism-1] == 3 ) mePN = mePnAmplMapG01L4_[ism-1];
964  }
965  if ( pnItr->sample(0).gainId() == 1 ) {
966  if ( waveLength[ism-1] == 0 ) mePN = mePnAmplMapG16L1_[ism-1];
967  if ( waveLength[ism-1] == 1 ) mePN = mePnAmplMapG16L2_[ism-1];
968  if ( waveLength[ism-1] == 2 ) mePN = mePnAmplMapG16L3_[ism-1];
969  if ( waveLength[ism-1] == 3 ) mePN = mePnAmplMapG16L4_[ism-1];
970  }
971 
972  if ( mePN ) mePN->Fill(num - 0.5, xvalmax);
973 
974  if ( ipn >= 0 && ipn < 80 ) adcPN[ipn] = xvalmax;
975 
976  }
977 
978  } else {
979 
980  edm::LogWarning("EELaserTask") << EcalPnDiodeDigiCollection_ << " not available";
981 
982  }
983 
985 
987 
988  int neh = hits->size();
989  LogDebug("EELaserTask") << "event " << ievt_ << " hits collection size " << neh;
990 
991  for ( EcalUncalibratedRecHitCollection::const_iterator hitItr = hits->begin(); hitItr != hits->end(); ++hitItr ) {
992 
993  EEDetId id = hitItr->id();
994 
995  int ix = id.ix();
996  int iy = id.iy();
997  int iz;
998 
999  int ism = Numbers::iSM( id );
1000 
1001  if ( ism >= 1 && ism <= 9 ){
1002  ix = 101 - ix;
1003  iz = 0;
1004  }else{
1005  iz = 1;
1006  }
1007 
1008  float xix = ix - 0.5;
1009  float xiy = iy - 0.5;
1010 
1011  if ( ! ( runType[ism-1] == EcalDCCHeaderBlock::LASER_STD ||
1012  runType[ism-1] == EcalDCCHeaderBlock::LASER_GAP ) ) continue;
1013 
1014  if ( rtHalf[ism-1] != Numbers::RtHalf(id) ) continue;
1015 
1016  MonitorElement* meAmplMap = 0;
1017  MonitorElement* meTimeMap = 0;
1018  MonitorElement* meAmplPNMap = 0;
1019  MonitorElement* meAmplSummaryMap = 0;
1020 
1021  if ( rtHalf[ism-1] == 0 || rtHalf[ism-1] == 1 ) {
1022 
1023  if ( waveLength[ism-1] == 0 ) {
1024  meAmplMap = meAmplMapL1_[ism-1];
1025  meTimeMap = meTimeMapL1_[ism-1];
1026  meAmplPNMap = meAmplPNMapL1_[ism-1];
1027  meAmplSummaryMap = meAmplSummaryMapL1_[iz];
1028  }
1029  if ( waveLength[ism-1] == 1 ) {
1030  meAmplMap = meAmplMapL2_[ism-1];
1031  meTimeMap = meTimeMapL2_[ism-1];
1032  meAmplPNMap = meAmplPNMapL2_[ism-1];
1033  meAmplSummaryMap = meAmplSummaryMapL2_[iz];
1034  }
1035  if ( waveLength[ism-1] == 2 ) {
1036  meAmplMap = meAmplMapL3_[ism-1];
1037  meTimeMap = meTimeMapL3_[ism-1];
1038  meAmplPNMap = meAmplPNMapL3_[ism-1];
1039  meAmplSummaryMap = meAmplSummaryMapL3_[iz];
1040  }
1041  if ( waveLength[ism-1] == 3 ) {
1042  meAmplMap = meAmplMapL4_[ism-1];
1043  meTimeMap = meTimeMapL4_[ism-1];
1044  meAmplPNMap = meAmplPNMapL4_[ism-1];
1045  meAmplSummaryMap = meAmplSummaryMapL4_[iz];
1046  }
1047 
1048  } else {
1049 
1050  edm::LogWarning("EELaserTask") << " RtHalf = " << rtHalf[ism-1];
1051 
1052  }
1053 
1054  float xval = hitItr->amplitude();
1055  if ( xval <= 0. ) xval = 0.0;
1056  float yval = hitItr->jitter() + 5.0;
1057  if ( yval <= 0. ) yval = 0.0;
1058  float zval = hitItr->pedestal();
1059  if ( zval <= 0. ) zval = 0.0;
1060 
1061  if ( meAmplMap ) meAmplMap->Fill(xix, xiy, xval);
1062 
1063  if ( xval > 16. ) {
1064  if ( meTimeMap ) meTimeMap->Fill(xix, xiy, yval);
1065  }
1066 
1067  float wval = 0.;
1068 
1069  NumbersPn::getPNs( ism, ix, iy, PNs );
1070 
1071  if ( PNs.size() > 0 ) {
1072  int ipn = PNs[0];
1073  if ( ipn >= 0 && ipn < 80 ) {
1074  if ( adcPN[ipn] != 0. ) wval = xval / adcPN[ipn];
1075  }
1076  }
1077 
1078  if ( meAmplPNMap ) meAmplPNMap->Fill(xix, xiy, wval);
1079 
1080  if( meAmplSummaryMap ) meAmplSummaryMap->Fill(xix, xiy, xval);
1081 
1082  }
1083 
1084  } else {
1085 
1086  edm::LogWarning("EELaserTask") << EcalUncalibratedRecHitCollection_ << " not available";
1087 
1088  }
1089 
1090 }
1091 
#define LogDebug(id)
int adc(sample_type sample)
get the ADC sample (12 bits)
MonitorElement * mePnAmplMapG01L2_[18]
Definition: EELaserTask.h:87
edm::InputTag EcalUncalibratedRecHitCollection_
Definition: EELaserTask.h:71
Some &quot;id&quot; conversions.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:226
MonitorElement * meTimeMapL4_[18]
Definition: EELaserTask.h:103
int i
Definition: DBlmapReader.cc:9
static int ipnEE(const int ism, const int ipnid)
Definition: NumbersPn.cc:21
MonitorElement * mePnAmplMapG16L2_[18]
Definition: EELaserTask.h:89
int ix() const
Definition: EEDetId.h:77
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
MonitorElement * meTimeMapL3_[18]
Definition: EELaserTask.h:94
static unsigned icEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:739
MonitorElement * mePnAmplMapG16L1_[18]
Definition: EELaserTask.h:80
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2535
std::string prefixME_
Definition: EELaserTask.h:62
Some &quot;id&quot; conversions.
MonitorElement * mePnPedMapG01L4_[18]
Definition: EELaserTask.h:106
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
Definition: EELaserTask.cc:726
MonitorElement * mePnPedMapG01L2_[18]
Definition: EELaserTask.h:88
std::vector< T >::const_iterator const_iterator
MonitorElement * meAmplMapL2_[18]
Definition: EELaserTask.h:84
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:30
#define min(a, b)
Definition: mlp_lapack.h:161
MonitorElement * mePnAmplMapG01L1_[18]
Definition: EELaserTask.h:78
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:773
MonitorElement * mePnPedMapG01L3_[18]
Definition: EELaserTask.h:97
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
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
edm::InputTag EcalPnDiodeDigiCollection_
Definition: EELaserTask.h:70
MonitorElement * mePnPedMapG16L2_[18]
Definition: EELaserTask.h:90
MonitorElement * mePnAmplMapG01L4_[18]
Definition: EELaserTask.h:105
virtual ~EELaserTask()
Destructor.
Definition: EELaserTask.cc:102
MonitorElement * meTimeMapL2_[18]
Definition: EELaserTask.h:85
MonitorElement * mePnPedMapG16L4_[18]
Definition: EELaserTask.h:108
MonitorElement * meShapeMapL3_[18]
Definition: EELaserTask.h:92
const T & max(const T &a, const T &b)
MonitorElement * meAmplMapL4_[18]
Definition: EELaserTask.h:102
MonitorElement * mePnPedMapG16L1_[18]
Definition: EELaserTask.h:81
MonitorElement * meTimeMapL1_[18]
Definition: EELaserTask.h:76
void removeElement(const std::string &name)
Definition: DQMStore.cc:2577
MonitorElement * meAmplMapL3_[18]
Definition: EELaserTask.h:93
MonitorElement * meAmplSummaryMapL1_[2]
Definition: EELaserTask.h:110
MonitorElement * meAmplSummaryMapL4_[2]
Definition: EELaserTask.h:113
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
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
Definition: EELaserTask.cc:117
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void reset(void)
Reset.
Definition: EELaserTask.cc:129
DQMStore * dqmStore_
Definition: EELaserTask.h:60
MonitorElement * meAmplPNMapL3_[18]
Definition: EELaserTask.h:95
std::vector< int > laserWavelengths_
Definition: EELaserTask.h:72
MonitorElement * mePnPedMapG01L1_[18]
Definition: EELaserTask.h:79
MonitorElement * meAmplMapL1_[18]
Definition: EELaserTask.h:75
EELaserTask(const edm::ParameterSet &ps)
Constructor.
Definition: EELaserTask.cc:33
edm::InputTag EcalRawDataCollection_
Definition: EELaserTask.h:68
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:50
MonitorElement * meAmplSummaryMapL3_[2]
Definition: EELaserTask.h:112
MonitorElement * mePnAmplMapG16L3_[18]
Definition: EELaserTask.h:98
edm::InputTag EEDigiCollection_
Definition: EELaserTask.h:69
MonitorElement * mePnAmplMapG16L4_[18]
Definition: EELaserTask.h:107
long long int num
Definition: procUtils.cc:71
void setup(void)
Setup.
Definition: EELaserTask.cc:204
void endJob(void)
EndJob.
Definition: EELaserTask.cc:718
MonitorElement * mePnAmplMapG01L3_[18]
Definition: EELaserTask.h:96
void cleanup(void)
Cleanup.
Definition: EELaserTask.cc:542
MonitorElement * mePnPedMapG16L3_[18]
Definition: EELaserTask.h:99
MonitorElement * meAmplPNMapL4_[18]
Definition: EELaserTask.h:104
MonitorElement * meAmplPNMapL1_[18]
Definition: EELaserTask.h:77
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:246
MonitorElement * meAmplSummaryMapL2_[2]
Definition: EELaserTask.h:111
static void getPNs(const int ism, const int ix, const int iy, std::vector< int > &PNsInLM)
Definition: NumbersPn.cc:51
static unsigned RtHalf(const EBDetId &id)
Definition: Numbers.cc:608
bool mergeRuns_
Definition: EELaserTask.h:66
void endRun(const edm::Run &r, const edm::EventSetup &c)
EndRun.
Definition: EELaserTask.cc:125
static EcalSubdetector subDet(const EBDetId &id)
Definition: Numbers.cc:145
bool enableCleanup_
Definition: EELaserTask.h:64
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
MonitorElement * meAmplPNMapL2_[18]
Definition: EELaserTask.h:86
MonitorElement * meShapeMapL1_[18]
Definition: EELaserTask.h:74
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 beginJob(void)
BeginJob.
Definition: EELaserTask.cc:106
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
MonitorElement * meShapeMapL4_[18]
Definition: EELaserTask.h:101
MonitorElement * meShapeMapL2_[18]
Definition: EELaserTask.h:83
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