CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EELaserClient.cc
Go to the documentation of this file.
1 /*
2  * \file EELaserClient.cc
3  *
4  * $Date: 2012/04/27 13:46:07 $
5  * $Revision: 1.146 $
6  * \author G. Della Ricca
7  * \author G. Franzoni
8  *
9 */
10 
11 #include <memory>
12 #include <iostream>
13 #include <fstream>
14 #include <iomanip>
15 #include <math.h>
16 
18 
21 
22 #ifdef WITH_ECAL_COND_DB
40 #endif
41 
43 
46 
48 
50 
52 
53  // cloneME switch
54  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
55 
56  // verbose switch
57  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
58 
59  // debug switch
60  debug_ = ps.getUntrackedParameter<bool>("debug", false);
61 
62  // prefixME path
63  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
64 
65  // enableCleanup_ switch
66  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
67 
68  // vector of selected Super Modules (Defaults to all 18).
69  superModules_.reserve(18);
70  for ( unsigned int i = 1; i <= 18; i++ ) superModules_.push_back(i);
71  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
72 
73  laserWavelengths_.reserve(4);
74  for ( unsigned int i = 1; i <= 4; i++ ) laserWavelengths_.push_back(i);
75  laserWavelengths_ = ps.getUntrackedParameter<std::vector<int> >("laserWavelengths", laserWavelengths_);
76 
77  if ( verbose_ ) {
78  std::cout << " Laser wavelengths:" << std::endl;
79  for ( unsigned int i = 0; i < laserWavelengths_.size(); i++ ) {
80  std::cout << " " << laserWavelengths_[i];
81  }
82  std::cout << std::endl;
83  }
84 
85  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
86 
87  int ism = superModules_[i];
88 
89  h01_[ism-1] = 0;
90  h02_[ism-1] = 0;
91  h03_[ism-1] = 0;
92  h04_[ism-1] = 0;
93  h05_[ism-1] = 0;
94  h06_[ism-1] = 0;
95  h07_[ism-1] = 0;
96  h08_[ism-1] = 0;
97 
98  h09_[ism-1] = 0;
99  h10_[ism-1] = 0;
100  h11_[ism-1] = 0;
101  h12_[ism-1] = 0;
102 
103  hs01_[ism-1] = 0;
104  hs02_[ism-1] = 0;
105  hs03_[ism-1] = 0;
106  hs04_[ism-1] = 0;
107 
108  i01_[ism-1] = 0;
109  i02_[ism-1] = 0;
110  i03_[ism-1] = 0;
111  i04_[ism-1] = 0;
112  i05_[ism-1] = 0;
113  i06_[ism-1] = 0;
114  i07_[ism-1] = 0;
115  i08_[ism-1] = 0;
116 
117  i09_[ism-1] = 0;
118  i10_[ism-1] = 0;
119  i11_[ism-1] = 0;
120  i12_[ism-1] = 0;
121  i13_[ism-1] = 0;
122  i14_[ism-1] = 0;
123  i15_[ism-1] = 0;
124  i16_[ism-1] = 0;
125 
126  }
127 
128  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
129 
130  int ism = superModules_[i];
131 
132  meg01_[ism-1] = 0;
133  meg02_[ism-1] = 0;
134  meg03_[ism-1] = 0;
135  meg04_[ism-1] = 0;
136 
137  meg05_[ism-1] = 0;
138  meg06_[ism-1] = 0;
139  meg07_[ism-1] = 0;
140  meg08_[ism-1] = 0;
141  meg09_[ism-1] = 0;
142  meg10_[ism-1] = 0;
143  meg11_[ism-1] = 0;
144  meg12_[ism-1] = 0;
145 
146  mea01_[ism-1] = 0;
147  mea02_[ism-1] = 0;
148  mea03_[ism-1] = 0;
149  mea04_[ism-1] = 0;
150 
151  met01_[ism-1] = 0;
152  met02_[ism-1] = 0;
153  met03_[ism-1] = 0;
154  met04_[ism-1] = 0;
155 
156  metav01_[ism-1] = 0;
157  metav02_[ism-1] = 0;
158  metav03_[ism-1] = 0;
159  metav04_[ism-1] = 0;
160 
161  metrms01_[ism-1] = 0;
162  metrms02_[ism-1] = 0;
163  metrms03_[ism-1] = 0;
164  metrms04_[ism-1] = 0;
165 
166  meaopn01_[ism-1] = 0;
167  meaopn02_[ism-1] = 0;
168  meaopn03_[ism-1] = 0;
169  meaopn04_[ism-1] = 0;
170 
171  mepnprms01_[ism-1] = 0;
172  mepnprms02_[ism-1] = 0;
173  mepnprms03_[ism-1] = 0;
174  mepnprms04_[ism-1] = 0;
175  mepnprms05_[ism-1] = 0;
176  mepnprms06_[ism-1] = 0;
177  mepnprms07_[ism-1] = 0;
178  mepnprms08_[ism-1] = 0;
179 
180  me_hs01_[ism-1] = 0;
181  me_hs02_[ism-1] = 0;
182  me_hs03_[ism-1] = 0;
183  me_hs04_[ism-1] = 0;
184 
185  }
186 
187  percentVariation_ = 999.; // not used nor not normalized VPTs
188 
189  amplitudeThreshold_ = 100.;
190 
191  rmsThresholdRelative_ = 0.3;
192 
195 
196  pedPnExpectedMean_[0] = 750.0;
197  pedPnExpectedMean_[1] = 750.0;
198 
199  pedPnDiscrepancyMean_[0] = 100.0;
200  pedPnDiscrepancyMean_[1] = 100.0;
201 
202  pedPnRMSThreshold_[0] = 999.;
203  pedPnRMSThreshold_[1] = 999.;
204 
205 }
206 
208 
209 }
210 
212 
214 
215  if ( debug_ ) std::cout << "EELaserClient: beginJob" << std::endl;
216 
217  ievt_ = 0;
218  jevt_ = 0;
219 
220 }
221 
223 
224  if ( debug_ ) std::cout << "EELaserClient: beginRun" << std::endl;
225 
226  jevt_ = 0;
227 
228  this->setup();
229 
230 }
231 
233 
234  if ( debug_ ) std::cout << "EELaserClient: endJob, ievt = " << ievt_ << std::endl;
235 
236  this->cleanup();
237 
238 }
239 
241 
242  if ( debug_ ) std::cout << "EELaserClient: endRun, jevt = " << jevt_ << std::endl;
243 
244  this->cleanup();
245 
246 }
247 
249 
251 
252  dqmStore_->setCurrentFolder( prefixME_ + "/EELaserClient" );
253 
254  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
255 
256  int ism = superModules_[i];
257 
258  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
259  if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
260  name = "EELT laser quality L1 " + Numbers::sEE(ism);
261  meg01_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
262  meg01_[ism-1]->setAxisTitle("ix", 1);
263  if ( ism >= 1 && ism <= 9 ) meg01_[ism-1]->setAxisTitle("101-ix", 1);
264  meg01_[ism-1]->setAxisTitle("iy", 2);
265  }
266  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
267  if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
268  name = "EELT laser quality L2 " + Numbers::sEE(ism);
269  meg02_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
270  meg02_[ism-1]->setAxisTitle("ix", 1);
271  if ( ism >= 1 && ism <= 9 ) meg02_[ism-1]->setAxisTitle("101-ix", 1);
272  meg02_[ism-1]->setAxisTitle("iy", 2);
273  }
274  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
275  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
276  name = "EELT laser quality L3 " + Numbers::sEE(ism);
277  meg03_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
278  meg03_[ism-1]->setAxisTitle("ix", 1);
279  if ( ism >= 1 && ism <= 9 ) meg03_[ism-1]->setAxisTitle("101-ix", 1);
280  meg03_[ism-1]->setAxisTitle("iy", 2);
281  }
282  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
283  if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
284  name = "EELT laser quality L4 " + Numbers::sEE(ism);
285  meg04_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
286  meg04_[ism-1]->setAxisTitle("ix", 1);
287  if ( ism >= 1 && ism <= 9 ) meg04_[ism-1]->setAxisTitle("101-ix", 1);
288  meg04_[ism-1]->setAxisTitle("iy", 2);
289  }
290  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
291  if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
292  name = "EELT laser quality L1 PNs G01 " + Numbers::sEE(ism);
293  meg05_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
294  meg05_[ism-1]->setAxisTitle("pseudo-strip", 1);
295  meg05_[ism-1]->setAxisTitle("channel", 2);
296  }
297  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
298  if ( meg06_[ism-1] ) dqmStore_->removeElement( meg06_[ism-1]->getName() );
299  name = "EELT laser quality L2 PNs G01 " + Numbers::sEE(ism);
300  meg06_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
301  meg06_[ism-1]->setAxisTitle("pseudo-strip", 1);
302  meg06_[ism-1]->setAxisTitle("channel", 2);
303  }
304  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
305  if ( meg07_[ism-1] ) dqmStore_->removeElement( meg07_[ism-1]->getName() );
306  name = "EELT laser quality L3 PNs G01 " + Numbers::sEE(ism);
307  meg07_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
308  meg07_[ism-1]->setAxisTitle("pseudo-strip", 1);
309  meg07_[ism-1]->setAxisTitle("channel", 2);
310  }
311  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
312  if ( meg08_[ism-1] ) dqmStore_->removeElement( meg08_[ism-1]->getName() );
313  name = "EELT laser quality L4 PNs G01 " + Numbers::sEE(ism);
314  meg08_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
315  meg08_[ism-1]->setAxisTitle("pseudo-strip", 1);
316  meg08_[ism-1]->setAxisTitle("channel", 2);
317  }
318  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
319  if ( meg09_[ism-1] ) dqmStore_->removeElement( meg09_[ism-1]->getName() );
320  name = "EELT laser quality L1 PNs G16 " + Numbers::sEE(ism);
321  meg09_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
322  meg09_[ism-1]->setAxisTitle("pseudo-strip", 1);
323  meg09_[ism-1]->setAxisTitle("channel", 2);
324  }
325  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
326  if ( meg10_[ism-1] ) dqmStore_->removeElement( meg10_[ism-1]->getName() );
327  name = "EELT laser quality L2 PNs G16 " + Numbers::sEE(ism);
328  meg10_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
329  meg10_[ism-1]->setAxisTitle("pseudo-strip", 1);
330  meg10_[ism-1]->setAxisTitle("channel", 2);
331  }
332  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
333  if ( meg11_[ism-1] ) dqmStore_->removeElement( meg11_[ism-1]->getName() );
334  name = "EELT laser quality L3 PNs G16 " + Numbers::sEE(ism);
335  meg11_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
336  meg11_[ism-1]->setAxisTitle("pseudo-strip", 1);
337  meg11_[ism-1]->setAxisTitle("channel", 2);
338  }
339  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
340  if ( meg12_[ism-1] ) dqmStore_->removeElement( meg12_[ism-1]->getName() );
341  name = "EELT laser quality L4 PNs G16 " + Numbers::sEE(ism);
342  meg12_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
343  meg12_[ism-1]->setAxisTitle("pseudo-strip", 1);
344  meg12_[ism-1]->setAxisTitle("channel", 2);
345  }
346 
347  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
348  if ( mea01_[ism-1] ) dqmStore_->removeElement( mea01_[ism-1]->getName() );;
349  name = "EELT amplitude L1 " + Numbers::sEE(ism);
350  mea01_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
351  mea01_[ism-1]->setAxisTitle("channel", 1);
352  mea01_[ism-1]->setAxisTitle("amplitude", 2);
353  }
354  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
355  if ( mea02_[ism-1] ) dqmStore_->removeElement( mea02_[ism-1]->getName() );
356  name = "EELT amplitude L2 " + Numbers::sEE(ism);
357  mea02_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
358  mea02_[ism-1]->setAxisTitle("channel", 1);
359  mea02_[ism-1]->setAxisTitle("amplitude", 2);
360  }
361  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
362  if ( mea03_[ism-1] ) dqmStore_->removeElement( mea03_[ism-1]->getName() );
363  name = "EELT amplitude L3 " + Numbers::sEE(ism);
364  mea03_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
365  mea03_[ism-1]->setAxisTitle("channel", 1);
366  mea03_[ism-1]->setAxisTitle("amplitude", 2);
367  }
368  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
369  if ( mea04_[ism-1] ) dqmStore_->removeElement( mea04_[ism-1]->getName() );
370  name = "EELT amplitude L4 " + Numbers::sEE(ism);
371  mea04_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
372  mea04_[ism-1]->setAxisTitle("channel", 1);
373  mea04_[ism-1]->setAxisTitle("amplitude", 2);
374  }
375 
376  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
377  if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
378  name = "EELT laser timing L1 " + Numbers::sEE(ism);
379  met01_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
380  met01_[ism-1]->setAxisTitle("channel", 1);
381  met01_[ism-1]->setAxisTitle("jitter", 2);
382  }
383  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
384  if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
385  name = "EELT laser timing L2 " + Numbers::sEE(ism);
386  met02_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
387  met02_[ism-1]->setAxisTitle("channel", 1);
388  met02_[ism-1]->setAxisTitle("jitter", 2);
389  }
390  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
391  if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
392  name = "EELT laser timing L3 " + Numbers::sEE(ism);
393  met03_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
394  met03_[ism-1]->setAxisTitle("channel", 1);
395  met03_[ism-1]->setAxisTitle("jitter", 2);
396  }
397  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
398  if ( met04_[ism-1] ) dqmStore_->removeElement( met04_[ism-1]->getName() );
399  name = "EELT laser timing L4 " + Numbers::sEE(ism);
400  met04_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
401  met04_[ism-1]->setAxisTitle("channel", 1);
402  met04_[ism-1]->setAxisTitle("jitter", 2);
403  }
404 
405  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
406  if ( metav01_[ism-1] ) dqmStore_->removeElement( metav01_[ism-1]->getName() );
407  name = "EELT laser timing mean L1 " + Numbers::sEE(ism);
408  metav01_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
409  metav01_[ism-1]->setAxisTitle("mean", 1);
410  }
411  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
412  if ( metav02_[ism-1] ) dqmStore_->removeElement( metav02_[ism-1]->getName() );
413  name = "EELT laser timing mean L2 " + Numbers::sEE(ism);
414  metav02_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
415  metav02_[ism-1]->setAxisTitle("mean", 1);
416  }
417  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
418  if ( metav03_[ism-1] ) dqmStore_->removeElement( metav03_[ism-1]->getName() );
419  name = "EELT laser timing mean L3 " + Numbers::sEE(ism);
420  metav03_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
421  metav03_[ism-1]->setAxisTitle("mean", 1);
422  }
423  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
424  if ( metav04_[ism-1] ) dqmStore_->removeElement( metav04_[ism-1]->getName() );
425  name = "EELT laser timing mean L4 " + Numbers::sEE(ism);
426  metav04_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
427  metav04_[ism-1]->setAxisTitle("mean", 1);
428  }
429 
430  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
431  if ( metrms01_[ism-1] ) dqmStore_->removeElement( metrms01_[ism-1]->getName() );
432  name = "EELT laser timing rms L1 " + Numbers::sEE(ism);
433  metrms01_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 0.5);
434  metrms01_[ism-1]->setAxisTitle("rms", 1);
435  }
436  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
437  if ( metrms02_[ism-1] ) dqmStore_->removeElement( metrms02_[ism-1]->getName() );
438  name = "EELT laser timing rms L2 " + Numbers::sEE(ism);
439  metrms02_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 0.5);
440  metrms02_[ism-1]->setAxisTitle("rms", 1);
441  }
442  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
443  if ( metrms03_[ism-1] ) dqmStore_->removeElement( metrms03_[ism-1]->getName() );
444  name = "EELT laser timing rms L3 " + Numbers::sEE(ism);
445  metrms03_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 0.5);
446  metrms03_[ism-1]->setAxisTitle("rms", 1);
447  }
448  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
449  if ( metrms04_[ism-1] ) dqmStore_->removeElement( metrms04_[ism-1]->getName() );
450  name = "EELT laser timing rms L4 " + Numbers::sEE(ism);
451  metrms04_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 0.5);
452  metrms04_[ism-1]->setAxisTitle("rms", 1);
453  }
454 
455  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
456  if ( meaopn01_[ism-1] ) dqmStore_->removeElement( meaopn01_[ism-1]->getName() );
457  name = "EELT amplitude over PN L1 " + Numbers::sEE(ism);
458  meaopn01_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
459  meaopn01_[ism-1]->setAxisTitle("channel", 1);
460  meaopn01_[ism-1]->setAxisTitle("amplitude/PN", 2);
461  }
462  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
463  if ( meaopn02_[ism-1] ) dqmStore_->removeElement( meaopn02_[ism-1]->getName() );
464  name = "EELT amplitude over PN L2 " + Numbers::sEE(ism);
465  meaopn02_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
466  meaopn02_[ism-1]->setAxisTitle("channel", 1);
467  meaopn02_[ism-1]->setAxisTitle("amplitude/PN", 2);
468  }
469  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
470  if ( meaopn03_[ism-1] ) dqmStore_->removeElement( meaopn03_[ism-1]->getName() );
471  name = "EELT amplitude over PN L3 " + Numbers::sEE(ism);
472  meaopn03_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
473  meaopn03_[ism-1]->setAxisTitle("channel", 1);
474  meaopn03_[ism-1]->setAxisTitle("amplitude/PN", 2);
475  }
476  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
477  if ( meaopn04_[ism-1] ) dqmStore_->removeElement( meaopn04_[ism-1]->getName() );
478  name = "EELT amplitude over PN L4 " + Numbers::sEE(ism);
479  meaopn04_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
480  meaopn04_[ism-1]->setAxisTitle("channel", 1);
481  meaopn04_[ism-1]->setAxisTitle("amplitude/PN", 2);
482  }
483 
484  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
485  if ( mepnprms01_[ism-1] ) dqmStore_->removeElement( mepnprms01_[ism-1]->getName() );
486  name = "EELT PNs pedestal rms " + Numbers::sEE(ism) + " G01 L1";
487  mepnprms01_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
488  mepnprms01_[ism-1]->setAxisTitle("rms", 1);
489  }
490  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
491  if ( mepnprms02_[ism-1] ) dqmStore_->removeElement( mepnprms02_[ism-1]->getName() );
492  name = "EELT PNs pedestal rms " + Numbers::sEE(ism) + " G01 L2";
493  mepnprms02_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
494  mepnprms02_[ism-1]->setAxisTitle("rms", 1);
495  }
496  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
497  if ( mepnprms03_[ism-1] ) dqmStore_->removeElement( mepnprms03_[ism-1]->getName() );
498  name = "EELT PNs pedestal rms " + Numbers::sEE(ism) + " G01 L3";
499  mepnprms03_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
500  mepnprms03_[ism-1]->setAxisTitle("rms", 1);
501  }
502  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
503  if ( mepnprms04_[ism-1] ) dqmStore_->removeElement( mepnprms04_[ism-1]->getName() );
504  name = "EELT PNs pedestal rms " + Numbers::sEE(ism) + " G01 L4";
505  mepnprms04_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
506  mepnprms04_[ism-1]->setAxisTitle("rms", 1);
507  }
508  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
509  if ( mepnprms05_[ism-1] ) dqmStore_->removeElement( mepnprms05_[ism-1]->getName() );
510  name = "EELT PNs pedestal rms " + Numbers::sEE(ism) + " G16 L1";
511  mepnprms05_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
512  mepnprms05_[ism-1]->setAxisTitle("rms", 1);
513  }
514  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
515  if ( mepnprms06_[ism-1] ) dqmStore_->removeElement( mepnprms06_[ism-1]->getName() );
516  name = "EELT PNs pedestal rms " + Numbers::sEE(ism) + " G16 L2";
517  mepnprms06_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
518  mepnprms06_[ism-1]->setAxisTitle("rms", 1);
519  }
520  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
521  if ( mepnprms07_[ism-1] ) dqmStore_->removeElement( mepnprms07_[ism-1]->getName() );
522  name = "EELT PNs pedestal rms " + Numbers::sEE(ism) + " G16 L3";
523  mepnprms07_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
524  mepnprms07_[ism-1]->setAxisTitle("rms", 1);
525  }
526  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
527  if ( mepnprms08_[ism-1] ) dqmStore_->removeElement( mepnprms08_[ism-1]->getName() );
528  name = "EELT PNs pedestal rms " + Numbers::sEE(ism) + " G16 L4";
529  mepnprms08_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
530  mepnprms08_[ism-1]->setAxisTitle("rms", 1);
531  }
532 
533  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
534  if ( me_hs01_[ism-1] ) dqmStore_->removeElement( me_hs01_[ism-1]->getName() );
535  name = "EELT laser shape L1 " + Numbers::sEE(ism);
536  me_hs01_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
537  me_hs01_[ism-1]->setAxisTitle("sample", 1);
538  me_hs01_[ism-1]->setAxisTitle("amplitude", 2);
539  }
540  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
541  if ( me_hs02_[ism-1] ) dqmStore_->removeElement( me_hs02_[ism-1]->getName() );
542  name = "EELT laser shape L2 " + Numbers::sEE(ism);
543  me_hs02_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
544  me_hs02_[ism-1]->setAxisTitle("sample", 1);
545  me_hs02_[ism-1]->setAxisTitle("amplitude", 2);
546  }
547  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
548  if ( me_hs03_[ism-1] ) dqmStore_->removeElement( me_hs03_[ism-1]->getName() );
549  name = "EELT laser shape L3 " + Numbers::sEE(ism);
550  me_hs03_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
551  me_hs03_[ism-1]->setAxisTitle("sample", 1);
552  me_hs03_[ism-1]->setAxisTitle("amplitude", 2);
553  }
554  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
555  if ( me_hs04_[ism-1] ) dqmStore_->removeElement( me_hs04_[ism-1]->getName() );
556  name = "EELT laser shape L4 " + Numbers::sEE(ism);
557  me_hs04_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
558  me_hs04_[ism-1]->setAxisTitle("sample", 1);
559  me_hs04_[ism-1]->setAxisTitle("amplitude", 2);
560  }
561 
562  }
563 
564  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
565 
566  int ism = superModules_[i];
567 
568  if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
569  if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
570  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
571  if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
572 
573  if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
574  if ( meg06_[ism-1] ) meg06_[ism-1]->Reset();
575  if ( meg07_[ism-1] ) meg07_[ism-1]->Reset();
576  if ( meg08_[ism-1] ) meg08_[ism-1]->Reset();
577  if ( meg09_[ism-1] ) meg09_[ism-1]->Reset();
578  if ( meg10_[ism-1] ) meg10_[ism-1]->Reset();
579  if ( meg11_[ism-1] ) meg11_[ism-1]->Reset();
580  if ( meg12_[ism-1] ) meg12_[ism-1]->Reset();
581 
582  for ( int ix = 1; ix <= 50; ix++ ) {
583  for ( int iy = 1; iy <= 50; iy++ ) {
584 
585  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 6. );
586  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 6. );
587  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 6. );
588  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( ix, iy, 6. );
589 
590  int jx = ix + Numbers::ix0EE(ism);
591  int jy = iy + Numbers::iy0EE(ism);
592 
593  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
594 
595  if ( Numbers::validEE(ism, jx, jy) ) {
596  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 2. );
597  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 2. );
598  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
599  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( ix, iy, 2. );
600  }
601 
602  }
603  }
604 
605  for ( int i = 1; i <= 10; i++ ) {
606 
607  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 6. );
608  if ( meg06_[ism-1] ) meg06_[ism-1]->setBinContent( i, 1, 6. );
609  if ( meg07_[ism-1] ) meg07_[ism-1]->setBinContent( i, 1, 6. );
610  if ( meg08_[ism-1] ) meg08_[ism-1]->setBinContent( i, 1, 6. );
611  if ( meg09_[ism-1] ) meg09_[ism-1]->setBinContent( i, 1, 6. );
612  if ( meg10_[ism-1] ) meg10_[ism-1]->setBinContent( i, 1, 6. );
613  if ( meg11_[ism-1] ) meg11_[ism-1]->setBinContent( i, 1, 6. );
614  if ( meg12_[ism-1] ) meg12_[ism-1]->setBinContent( i, 1, 6. );
615 
616  // non-existing mem
617  if ( (ism >= 3 && ism <= 4) || (ism >= 7 && ism <= 9) ) continue;
618  if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) ) continue;
619 
620  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
621  if ( meg06_[ism-1] ) meg06_[ism-1]->setBinContent( i, 1, 2. );
622  if ( meg07_[ism-1] ) meg07_[ism-1]->setBinContent( i, 1, 2. );
623  if ( meg08_[ism-1] ) meg08_[ism-1]->setBinContent( i, 1, 2. );
624  if ( meg09_[ism-1] ) meg09_[ism-1]->setBinContent( i, 1, 2. );
625  if ( meg10_[ism-1] ) meg10_[ism-1]->setBinContent( i, 1, 2. );
626  if ( meg11_[ism-1] ) meg11_[ism-1]->setBinContent( i, 1, 2. );
627  if ( meg12_[ism-1] ) meg12_[ism-1]->setBinContent( i, 1, 2. );
628 
629  }
630 
631  if ( mea01_[ism-1] ) mea01_[ism-1]->Reset();
632  if ( mea02_[ism-1] ) mea02_[ism-1]->Reset();
633  if ( mea03_[ism-1] ) mea03_[ism-1]->Reset();
634  if ( mea04_[ism-1] ) mea04_[ism-1]->Reset();
635 
636  if ( met01_[ism-1] ) met01_[ism-1]->Reset();
637  if ( met02_[ism-1] ) met02_[ism-1]->Reset();
638  if ( met03_[ism-1] ) met03_[ism-1]->Reset();
639  if ( met04_[ism-1] ) met04_[ism-1]->Reset();
640 
641  if ( metav01_[ism-1] ) metav01_[ism-1]->Reset();
642  if ( metav02_[ism-1] ) metav02_[ism-1]->Reset();
643  if ( metav03_[ism-1] ) metav03_[ism-1]->Reset();
644  if ( metav04_[ism-1] ) metav04_[ism-1]->Reset();
645 
646  if ( metrms01_[ism-1] ) metrms01_[ism-1]->Reset();
647  if ( metrms02_[ism-1] ) metrms02_[ism-1]->Reset();
648  if ( metrms03_[ism-1] ) metrms03_[ism-1]->Reset();
649  if ( metrms04_[ism-1] ) metrms04_[ism-1]->Reset();
650 
651  if ( meaopn01_[ism-1] ) meaopn01_[ism-1]->Reset();
652  if ( meaopn02_[ism-1] ) meaopn02_[ism-1]->Reset();
653  if ( meaopn03_[ism-1] ) meaopn03_[ism-1]->Reset();
654  if ( meaopn04_[ism-1] ) meaopn04_[ism-1]->Reset();
655 
656  if ( mepnprms01_[ism-1] ) mepnprms01_[ism-1]->Reset();
657  if ( mepnprms02_[ism-1] ) mepnprms02_[ism-1]->Reset();
658  if ( mepnprms03_[ism-1] ) mepnprms03_[ism-1]->Reset();
659  if ( mepnprms04_[ism-1] ) mepnprms04_[ism-1]->Reset();
660  if ( mepnprms05_[ism-1] ) mepnprms05_[ism-1]->Reset();
661  if ( mepnprms06_[ism-1] ) mepnprms06_[ism-1]->Reset();
662  if ( mepnprms07_[ism-1] ) mepnprms07_[ism-1]->Reset();
663  if ( mepnprms08_[ism-1] ) mepnprms08_[ism-1]->Reset();
664 
665  if ( me_hs01_[ism-1] ) me_hs01_[ism-1]->Reset();
666  if ( me_hs02_[ism-1] ) me_hs02_[ism-1]->Reset();
667  if ( me_hs03_[ism-1] ) me_hs03_[ism-1]->Reset();
668  if ( me_hs04_[ism-1] ) me_hs04_[ism-1]->Reset();
669 
670  }
671 
672 }
673 
675 
676  if ( ! enableCleanup_ ) return;
677 
678  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
679 
680  int ism = superModules_[i];
681 
682  if ( cloneME_ ) {
683  if ( h01_[ism-1] ) delete h01_[ism-1];
684  if ( h02_[ism-1] ) delete h02_[ism-1];
685  if ( h03_[ism-1] ) delete h03_[ism-1];
686  if ( h04_[ism-1] ) delete h04_[ism-1];
687  if ( h05_[ism-1] ) delete h05_[ism-1];
688  if ( h06_[ism-1] ) delete h06_[ism-1];
689  if ( h07_[ism-1] ) delete h07_[ism-1];
690  if ( h08_[ism-1] ) delete h08_[ism-1];
691 
692  if ( h09_[ism-1] ) delete h09_[ism-1];
693  if ( h10_[ism-1] ) delete h10_[ism-1];
694  if ( h11_[ism-1] ) delete h11_[ism-1];
695  if ( h12_[ism-1] ) delete h12_[ism-1];
696 
697  if ( hs01_[ism-1] ) delete hs01_[ism-1];
698  if ( hs02_[ism-1] ) delete hs02_[ism-1];
699  if ( hs03_[ism-1] ) delete hs03_[ism-1];
700  if ( hs04_[ism-1] ) delete hs04_[ism-1];
701 
702  if ( i01_[ism-1] ) delete i01_[ism-1];
703  if ( i02_[ism-1] ) delete i02_[ism-1];
704  if ( i03_[ism-1] ) delete i03_[ism-1];
705  if ( i04_[ism-1] ) delete i04_[ism-1];
706  if ( i05_[ism-1] ) delete i05_[ism-1];
707  if ( i06_[ism-1] ) delete i06_[ism-1];
708  if ( i07_[ism-1] ) delete i07_[ism-1];
709  if ( i08_[ism-1] ) delete i08_[ism-1];
710 
711  if ( i09_[ism-1] ) delete i09_[ism-1];
712  if ( i10_[ism-1] ) delete i10_[ism-1];
713  if ( i11_[ism-1] ) delete i11_[ism-1];
714  if ( i12_[ism-1] ) delete i12_[ism-1];
715  if ( i13_[ism-1] ) delete i13_[ism-1];
716  if ( i14_[ism-1] ) delete i14_[ism-1];
717  if ( i15_[ism-1] ) delete i15_[ism-1];
718  if ( i16_[ism-1] ) delete i16_[ism-1];
719  }
720 
721  h01_[ism-1] = 0;
722  h02_[ism-1] = 0;
723  h03_[ism-1] = 0;
724  h04_[ism-1] = 0;
725  h05_[ism-1] = 0;
726  h06_[ism-1] = 0;
727  h07_[ism-1] = 0;
728  h08_[ism-1] = 0;
729 
730  h09_[ism-1] = 0;
731  h10_[ism-1] = 0;
732  h11_[ism-1] = 0;
733  h12_[ism-1] = 0;
734 
735  hs01_[ism-1] = 0;
736  hs02_[ism-1] = 0;
737  hs03_[ism-1] = 0;
738  hs04_[ism-1] = 0;
739 
740  i01_[ism-1] = 0;
741  i02_[ism-1] = 0;
742  i03_[ism-1] = 0;
743  i04_[ism-1] = 0;
744  i05_[ism-1] = 0;
745  i06_[ism-1] = 0;
746  i07_[ism-1] = 0;
747  i08_[ism-1] = 0;
748 
749  i09_[ism-1] = 0;
750  i10_[ism-1] = 0;
751  i11_[ism-1] = 0;
752  i12_[ism-1] = 0;
753  i13_[ism-1] = 0;
754  i14_[ism-1] = 0;
755  i15_[ism-1] = 0;
756  i16_[ism-1] = 0;
757 
758  }
759 
760  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
761 
762  int ism = superModules_[i];
763 
764  dqmStore_->setCurrentFolder( prefixME_ + "/EELaserClient" );
765 
766  if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
767  meg01_[ism-1] = 0;
768  if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
769  meg02_[ism-1] = 0;
770  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
771  meg03_[ism-1] = 0;
772  if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
773  meg04_[ism-1] = 0;
774 
775  if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
776  meg05_[ism-1] = 0;
777  if ( meg06_[ism-1] ) dqmStore_->removeElement( meg06_[ism-1]->getName() );
778  meg06_[ism-1] = 0;
779  if ( meg07_[ism-1] ) dqmStore_->removeElement( meg07_[ism-1]->getName() );
780  meg07_[ism-1] = 0;
781  if ( meg08_[ism-1] ) dqmStore_->removeElement( meg08_[ism-1]->getName() );
782  meg08_[ism-1] = 0;
783  if ( meg09_[ism-1] ) dqmStore_->removeElement( meg09_[ism-1]->getName() );
784  meg09_[ism-1] = 0;
785  if ( meg10_[ism-1] ) dqmStore_->removeElement( meg10_[ism-1]->getName() );
786  meg10_[ism-1] = 0;
787  if ( meg11_[ism-1] ) dqmStore_->removeElement( meg11_[ism-1]->getName() );
788  meg11_[ism-1] = 0;
789  if ( meg12_[ism-1] ) dqmStore_->removeElement( meg12_[ism-1]->getName() );
790  meg12_[ism-1] = 0;
791 
792  if ( mea01_[ism-1] ) dqmStore_->removeElement( mea01_[ism-1]->getName() );
793  mea01_[ism-1] = 0;
794  if ( mea02_[ism-1] ) dqmStore_->removeElement( mea02_[ism-1]->getName() );
795  mea02_[ism-1] = 0;
796  if ( mea03_[ism-1] ) dqmStore_->removeElement( mea03_[ism-1]->getName() );
797  mea03_[ism-1] = 0;
798  if ( mea04_[ism-1] ) dqmStore_->removeElement( mea04_[ism-1]->getName() );
799  mea04_[ism-1] = 0;
800 
801  if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
802  met01_[ism-1] = 0;
803  if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
804  met02_[ism-1] = 0;
805  if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
806  met03_[ism-1] = 0;
807  if ( met04_[ism-1] ) dqmStore_->removeElement( met04_[ism-1]->getName() );
808  met04_[ism-1] = 0;
809 
810  if ( metav01_[ism-1] ) dqmStore_->removeElement( metav01_[ism-1]->getName() );
811  metav01_[ism-1] = 0;
812  if ( metav02_[ism-1] ) dqmStore_->removeElement( metav02_[ism-1]->getName() );
813  metav02_[ism-1] = 0;
814  if ( metav03_[ism-1] ) dqmStore_->removeElement( metav03_[ism-1]->getName() );
815  metav03_[ism-1] = 0;
816  if ( metav04_[ism-1] ) dqmStore_->removeElement( metav04_[ism-1]->getName() );
817  metav04_[ism-1] = 0;
818 
819  if ( metrms01_[ism-1] ) dqmStore_->removeElement( metrms01_[ism-1]->getName() );
820  metrms01_[ism-1] = 0;
821  if ( metrms02_[ism-1] ) dqmStore_->removeElement( metrms02_[ism-1]->getName() );
822  metrms02_[ism-1] = 0;
823  if ( metrms03_[ism-1] ) dqmStore_->removeElement( metrms03_[ism-1]->getName() );
824  metrms03_[ism-1] = 0;
825  if ( metrms04_[ism-1] ) dqmStore_->removeElement( metrms04_[ism-1]->getName() );
826  metrms04_[ism-1] = 0;
827 
828  if ( meaopn01_[ism-1] ) dqmStore_->removeElement( meaopn01_[ism-1]->getName() );
829  meaopn01_[ism-1] = 0;
830  if ( meaopn02_[ism-1] ) dqmStore_->removeElement( meaopn02_[ism-1]->getName() );
831  meaopn02_[ism-1] = 0;
832  if ( meaopn03_[ism-1] ) dqmStore_->removeElement( meaopn03_[ism-1]->getName() );
833  meaopn03_[ism-1] = 0;
834  if ( meaopn04_[ism-1] ) dqmStore_->removeElement( meaopn04_[ism-1]->getName() );
835  meaopn04_[ism-1] = 0;
836 
837  if ( mepnprms01_[ism-1] ) dqmStore_->removeElement( mepnprms01_[ism-1]->getName() );
838  mepnprms01_[ism-1] = 0;
839  if ( mepnprms02_[ism-1] ) dqmStore_->removeElement( mepnprms02_[ism-1]->getName() );
840  mepnprms02_[ism-1] = 0;
841  if ( mepnprms03_[ism-1] ) dqmStore_->removeElement( mepnprms03_[ism-1]->getName() );
842  mepnprms03_[ism-1] = 0;
843  if ( mepnprms04_[ism-1] ) dqmStore_->removeElement( mepnprms04_[ism-1]->getName() );
844  mepnprms04_[ism-1] = 0;
845  if ( mepnprms05_[ism-1] ) dqmStore_->removeElement( mepnprms05_[ism-1]->getName() );
846  mepnprms05_[ism-1] = 0;
847  if ( mepnprms06_[ism-1] ) dqmStore_->removeElement( mepnprms06_[ism-1]->getName() );
848  mepnprms06_[ism-1] = 0;
849  if ( mepnprms07_[ism-1] ) dqmStore_->removeElement( mepnprms07_[ism-1]->getName() );
850  mepnprms07_[ism-1] = 0;
851  if ( mepnprms08_[ism-1] ) dqmStore_->removeElement( mepnprms08_[ism-1]->getName() );
852  mepnprms08_[ism-1] = 0;
853 
854  if ( me_hs01_[ism-1] ) dqmStore_->removeElement( me_hs01_[ism-1]->getName() );
855  me_hs01_[ism-1] = 0;
856  if ( me_hs02_[ism-1] ) dqmStore_->removeElement( me_hs02_[ism-1]->getName() );
857  me_hs02_[ism-1] = 0;
858  if ( me_hs03_[ism-1] ) dqmStore_->removeElement( me_hs03_[ism-1]->getName() );
859  me_hs03_[ism-1] = 0;
860  if ( me_hs04_[ism-1] ) dqmStore_->removeElement( me_hs04_[ism-1]->getName() );
861  me_hs04_[ism-1] = 0;
862 
863  }
864 
865 }
866 
867 #ifdef WITH_ECAL_COND_DB
868 bool EELaserClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
869 
870  status = true;
871 
872  EcalLogicID ecid;
873 
874  MonLaserBlueDat apd_bl;
875  std::map<EcalLogicID, MonLaserBlueDat> dataset1_bl;
876  MonLaserGreenDat apd_gr;
877  std::map<EcalLogicID, MonLaserGreenDat> dataset1_gr;
878  MonLaserIRedDat apd_ir;
879  std::map<EcalLogicID, MonLaserIRedDat> dataset1_ir;
880  MonLaserRedDat apd_rd;
881  std::map<EcalLogicID, MonLaserRedDat> dataset1_rd;
882 
883  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
884 
885  int ism = superModules_[i];
886 
887  if ( verbose_ ) {
888  std::cout << " " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
889  std::cout << std::endl;
890  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
891  UtilsClient::printBadChannels(meg01_[ism-1], h01_[ism-1]);
892  }
893  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
894  UtilsClient::printBadChannels(meg02_[ism-1], h03_[ism-1]);
895  }
896  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
897  UtilsClient::printBadChannels(meg03_[ism-1], h05_[ism-1]);
898  }
899  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
900  UtilsClient::printBadChannels(meg04_[ism-1], h07_[ism-1]);
901  }
902  }
903 
904  for ( int ix = 1; ix <= 50; ix++ ) {
905  for ( int iy = 1; iy <= 50; iy++ ) {
906 
907  int jx = ix + Numbers::ix0EE(ism);
908  int jy = iy + Numbers::iy0EE(ism);
909 
910  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
911 
912  if ( ! Numbers::validEE(ism, jx, jy) ) continue;
913 
914  bool update01;
915  bool update02;
916  bool update03;
917  bool update04;
918  bool update05;
919  bool update06;
920  bool update07;
921  bool update08;
922 
923  float num01, num02, num03, num04, num05, num06, num07, num08;
924  float mean01, mean02, mean03, mean04, mean05, mean06, mean07, mean08;
925  float rms01, rms02, rms03, rms04, rms05, rms06, rms07, rms08;
926 
927  update01 = UtilsClient::getBinStatistics(h01_[ism-1], ix, iy, num01, mean01, rms01);
928  update02 = UtilsClient::getBinStatistics(h02_[ism-1], ix, iy, num02, mean02, rms02);
929  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ix, iy, num03, mean03, rms03);
930  update04 = UtilsClient::getBinStatistics(h04_[ism-1], ix, iy, num04, mean04, rms04);
931  update05 = UtilsClient::getBinStatistics(h05_[ism-1], ix, iy, num05, mean05, rms05);
932  update06 = UtilsClient::getBinStatistics(h06_[ism-1], ix, iy, num06, mean06, rms06);
933  update07 = UtilsClient::getBinStatistics(h07_[ism-1], ix, iy, num07, mean07, rms07);
934  update08 = UtilsClient::getBinStatistics(h08_[ism-1], ix, iy, num08, mean08, rms08);
935 
936  if ( update01 || update02 ) {
937 
938  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
939 
940  if ( verbose_ ) {
941  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
942  std::cout << "L1 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num01 << " " << mean01 << " " << rms01 << std::endl;
943  std::cout << std::endl;
944  }
945 
946  }
947 
948  apd_bl.setAPDMean(mean01);
949  apd_bl.setAPDRMS(rms01);
950 
951  apd_bl.setAPDOverPNMean(mean02);
952  apd_bl.setAPDOverPNRMS(rms02);
953 
954  if ( UtilsClient::getBinStatus(meg01_[ism-1], ix, iy) ) {
955  apd_bl.setTaskStatus(true);
956  } else {
957  apd_bl.setTaskStatus(false);
958  }
959 
960  status = status && UtilsClient::getBinQuality(meg01_[ism-1], ix, iy);
961 
962  int ic = Numbers::indexEE(ism, jx, jy);
963 
964  if ( ic == -1 ) continue;
965 
966  if ( econn ) {
967  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
968  dataset1_bl[ecid] = apd_bl;
969  }
970 
971  }
972 
973  if ( update03 || update04 ) {
974 
975  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
976 
977  if ( verbose_ ) {
978  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
979  std::cout << "L2 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num03 << " " << mean03 << " " << rms03 << std::endl;
980  std::cout << std::endl;
981  }
982 
983  }
984 
985  apd_ir.setAPDMean(mean03);
986  apd_ir.setAPDRMS(rms03);
987 
988  apd_ir.setAPDOverPNMean(mean04);
989  apd_ir.setAPDOverPNRMS(rms04);
990 
991  if ( UtilsClient::getBinStatus(meg02_[ism-1], ix, iy) ) {
992  apd_ir.setTaskStatus(true);
993  } else {
994  apd_ir.setTaskStatus(false);
995  }
996 
997  status = status && UtilsClient::getBinQuality(meg02_[ism-1], ix, iy);
998 
999  int ic = Numbers::indexEE(ism, jx, jy);
1000 
1001  if ( ic == -1 ) continue;
1002 
1003  if ( econn ) {
1004  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
1005  dataset1_ir[ecid] = apd_ir;
1006  }
1007 
1008  }
1009 
1010  if ( update05 || update06 ) {
1011 
1012  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
1013 
1014  if ( verbose_ ) {
1015  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1016  std::cout << "L3 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num05 << " " << mean05 << " " << rms05 << std::endl;
1017  std::cout << std::endl;
1018  }
1019 
1020  }
1021 
1022  apd_gr.setAPDMean(mean05);
1023  apd_gr.setAPDRMS(rms05);
1024 
1025  apd_gr.setAPDOverPNMean(mean06);
1026  apd_gr.setAPDOverPNRMS(rms06);
1027 
1028  if ( UtilsClient::getBinStatus(meg03_[ism-1], ix, iy) ) {
1029  apd_gr.setTaskStatus(true);
1030  } else {
1031  apd_gr.setTaskStatus(false);
1032  }
1033 
1034  status = status && UtilsClient::getBinQuality(meg03_[ism-1], ix, iy);
1035 
1036  int ic = Numbers::indexEE(ism, jx, jy);
1037 
1038  if ( ic == -1 ) continue;
1039 
1040  if ( econn ) {
1041  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
1042  dataset1_gr[ecid] = apd_gr;
1043  }
1044 
1045  }
1046 
1047  if ( update07 || update08 ) {
1048 
1049  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
1050 
1051  if ( verbose_ ) {
1052  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1053  std::cout << "L4 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num07 << " " << mean07 << " " << rms07 << std::endl;
1054  std::cout << std::endl;
1055  }
1056 
1057  }
1058 
1059  apd_rd.setAPDMean(mean07);
1060  apd_rd.setAPDRMS(rms07);
1061 
1062  apd_rd.setAPDOverPNMean(mean08);
1063  apd_rd.setAPDOverPNRMS(rms08);
1064 
1065  if ( UtilsClient::getBinStatus(meg04_[ism-1], ix, iy) ) {
1066  apd_rd.setTaskStatus(true);
1067  } else {
1068  apd_rd.setTaskStatus(false);
1069  }
1070 
1071  status = status && UtilsClient::getBinQuality(meg04_[ism-1], ix, iy);
1072 
1073  int ic = Numbers::indexEE(ism, jx, jy);
1074 
1075  if ( ic == -1 ) continue;
1076 
1077  if ( econn ) {
1078  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
1079  dataset1_rd[ecid] = apd_rd;
1080  }
1081 
1082  }
1083 
1084  }
1085  }
1086 
1087  }
1088 
1089  if ( econn ) {
1090  try {
1091  if ( verbose_ ) std::cout << "Inserting MonLaserDat ..." << std::endl;
1092  if ( dataset1_bl.size() != 0 ) econn->insertDataArraySet(&dataset1_bl, moniov);
1093  if ( dataset1_ir.size() != 0 ) econn->insertDataArraySet(&dataset1_ir, moniov);
1094  if ( dataset1_gr.size() != 0 ) econn->insertDataArraySet(&dataset1_gr, moniov);
1095  if ( dataset1_rd.size() != 0 ) econn->insertDataArraySet(&dataset1_rd, moniov);
1096  if ( verbose_ ) std::cout << "done." << std::endl;
1097  } catch (std::runtime_error &e) {
1098  std::cerr << e.what() << std::endl;
1099  }
1100  }
1101 
1102  if ( verbose_ ) std::cout << std::endl;
1103 
1104  MonPNBlueDat pn_bl;
1105  std::map<EcalLogicID, MonPNBlueDat> dataset2_bl;
1106  MonPNGreenDat pn_gr;
1107  std::map<EcalLogicID, MonPNGreenDat> dataset2_gr;
1108  MonPNIRedDat pn_ir;
1109  std::map<EcalLogicID, MonPNIRedDat> dataset2_ir;
1110  MonPNRedDat pn_rd;
1111  std::map<EcalLogicID, MonPNRedDat> dataset2_rd;
1112 
1113  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
1114 
1115  int ism = superModules_[i];
1116 
1117  if ( verbose_ ) {
1118  std::cout << " " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1119  std::cout << std::endl;
1120  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1121  UtilsClient::printBadChannels(meg05_[ism-1], i01_[ism-1]);
1122  UtilsClient::printBadChannels(meg05_[ism-1], i05_[ism-1]);
1123  }
1124  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1125  UtilsClient::printBadChannels(meg06_[ism-1], i02_[ism-1]);
1126  UtilsClient::printBadChannels(meg06_[ism-1], i06_[ism-1]);
1127  }
1128  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1129  UtilsClient::printBadChannels(meg07_[ism-1], i03_[ism-1]);
1130  UtilsClient::printBadChannels(meg07_[ism-1], i07_[ism-1]);
1131  }
1132  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1133  UtilsClient::printBadChannels(meg08_[ism-1], i04_[ism-1]);
1134  UtilsClient::printBadChannels(meg08_[ism-1], i08_[ism-1]);
1135  }
1136  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1137  UtilsClient::printBadChannels(meg09_[ism-1], i09_[ism-1]);
1138  UtilsClient::printBadChannels(meg09_[ism-1], i13_[ism-1]);
1139  }
1140  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1141  UtilsClient::printBadChannels(meg10_[ism-1], i10_[ism-1]);
1142  UtilsClient::printBadChannels(meg10_[ism-1], i14_[ism-1]);
1143  }
1144  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1145  UtilsClient::printBadChannels(meg11_[ism-1], i11_[ism-1]);
1146  UtilsClient::printBadChannels(meg11_[ism-1], i15_[ism-1]);
1147  }
1148  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1149  UtilsClient::printBadChannels(meg12_[ism-1], i12_[ism-1]);
1150  UtilsClient::printBadChannels(meg12_[ism-1], i16_[ism-1]);
1151  }
1152  }
1153 
1154  for ( int i = 1; i <= 10; i++ ) {
1155 
1156  bool update01;
1157  bool update02;
1158  bool update03;
1159  bool update04;
1160  bool update05;
1161  bool update06;
1162  bool update07;
1163  bool update08;
1164  bool update09;
1165  bool update10;
1166  bool update11;
1167  bool update12;
1168  bool update13;
1169  bool update14;
1170  bool update15;
1171  bool update16;
1172 
1173  float num01, num02, num03, num04, num05, num06, num07, num08;
1174  float num09, num10, num11, num12, num13, num14, num15, num16;
1175  float mean01, mean02, mean03, mean04, mean05, mean06, mean07, mean08;
1176  float mean09, mean10, mean11, mean12, mean13, mean14, mean15, mean16;
1177  float rms01, rms02, rms03, rms04, rms05, rms06, rms07, rms08;
1178  float rms09, rms10, rms11, rms12, rms13, rms14, rms15, rms16;
1179 
1180  update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
1181  update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
1182  update03 = UtilsClient::getBinStatistics(i03_[ism-1], i, 0, num03, mean03, rms03);
1183  update04 = UtilsClient::getBinStatistics(i04_[ism-1], i, 0, num04, mean04, rms04);
1184  update05 = UtilsClient::getBinStatistics(i05_[ism-1], i, 0, num05, mean05, rms05);
1185  update06 = UtilsClient::getBinStatistics(i06_[ism-1], i, 0, num06, mean06, rms06);
1186  update07 = UtilsClient::getBinStatistics(i07_[ism-1], i, 0, num07, mean07, rms07);
1187  update08 = UtilsClient::getBinStatistics(i08_[ism-1], i, 0, num08, mean08, rms08);
1188  update09 = UtilsClient::getBinStatistics(i09_[ism-1], i, 0, num09, mean09, rms09);
1189  update10 = UtilsClient::getBinStatistics(i10_[ism-1], i, 0, num10, mean10, rms10);
1190  update11 = UtilsClient::getBinStatistics(i11_[ism-1], i, 0, num11, mean11, rms11);
1191  update12 = UtilsClient::getBinStatistics(i12_[ism-1], i, 0, num12, mean12, rms12);
1192  update13 = UtilsClient::getBinStatistics(i13_[ism-1], i, 0, num13, mean13, rms13);
1193  update14 = UtilsClient::getBinStatistics(i14_[ism-1], i, 0, num14, mean14, rms14);
1194  update15 = UtilsClient::getBinStatistics(i15_[ism-1], i, 0, num15, mean15, rms15);
1195  update16 = UtilsClient::getBinStatistics(i16_[ism-1], i, 0, num16, mean16, rms16);
1196 
1197  if ( update01 || update05 || update09 || update13 ) {
1198 
1199  if ( i == 1 ) {
1200 
1201  if ( verbose_ ) {
1202  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1203  std::cout << "PNs (" << i << ") L1 G01 " << num01 << " " << mean01 << " " << rms01 << std::endl;
1204  std::cout << "PNs (" << i << ") L1 G16 " << num09 << " " << mean09 << " " << rms09 << std::endl;
1205  std::cout << std::endl;
1206  }
1207 
1208  }
1209 
1210  pn_bl.setADCMeanG1(mean01);
1211  pn_bl.setADCRMSG1(rms01);
1212 
1213  pn_bl.setPedMeanG1(mean05);
1214  pn_bl.setPedRMSG1(rms05);
1215 
1216  pn_bl.setADCMeanG16(mean09);
1217  pn_bl.setADCRMSG16(rms09);
1218 
1219  pn_bl.setPedMeanG16(mean13);
1220  pn_bl.setPedRMSG16(rms13);
1221 
1222  if ( UtilsClient::getBinStatus(meg05_[ism-1], i, 1) ||
1223  UtilsClient::getBinStatus(meg09_[ism-1], i, 1) ) {
1224  pn_bl.setTaskStatus(true);
1225  } else {
1226  pn_bl.setTaskStatus(false);
1227  }
1228 
1229  status = status && ( UtilsClient::getBinQuality(meg05_[ism-1], i, 1) ||
1230  UtilsClient::getBinQuality(meg09_[ism-1], i, 1) );
1231 
1232  if ( econn ) {
1233  ecid = LogicID::getEcalLogicID("EE_LM_PN", Numbers::iSM(ism, EcalEndcap), i-1);
1234  dataset2_bl[ecid] = pn_bl;
1235  }
1236 
1237  }
1238 
1239  if ( update02 || update06 || update10 || update14 ) {
1240 
1241  if ( i == 1 ) {
1242 
1243  if ( verbose_ ) {
1244  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1245  std::cout << "PNs (" << i << ") L2 G01 " << num02 << " " << mean02 << " " << rms02 << std::endl;
1246  std::cout << "PNs (" << i << ") L2 G16 " << num10 << " " << mean10 << " " << rms10 << std::endl;
1247  std::cout << std::endl;
1248  }
1249 
1250  }
1251 
1252  pn_ir.setADCMeanG1(mean02);
1253  pn_ir.setADCRMSG1(rms02);
1254 
1255  pn_ir.setPedMeanG1(mean06);
1256  pn_ir.setPedRMSG1(rms06);
1257 
1258  pn_ir.setADCMeanG16(mean10);
1259  pn_ir.setADCRMSG16(rms10);
1260 
1261  pn_ir.setPedMeanG16(mean14);
1262  pn_ir.setPedRMSG16(rms14);
1263 
1264  if ( UtilsClient::getBinStatus(meg06_[ism-1], i, 1) ||
1265  UtilsClient::getBinStatus(meg10_[ism-1], i, 1) ) {
1266  pn_ir.setTaskStatus(true);
1267  } else {
1268  pn_ir.setTaskStatus(false);
1269  }
1270 
1271  status = status && ( UtilsClient::getBinQuality(meg06_[ism-1], i, 1) ||
1272  UtilsClient::getBinQuality(meg10_[ism-1], i, 1) );
1273 
1274  if ( econn ) {
1275  ecid = LogicID::getEcalLogicID("EE_LM_PN", Numbers::iSM(ism, EcalEndcap), i-1);
1276  dataset2_ir[ecid] = pn_ir;
1277  }
1278 
1279  }
1280 
1281  if ( update03 || update07 || update11 || update15 ) {
1282 
1283  if ( i == 1 ) {
1284 
1285  if ( verbose_ ) {
1286  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1287  std::cout << "PNs (" << i << ") L3 G01 " << num03 << " " << mean03 << " " << rms03 << std::endl;
1288  std::cout << "PNs (" << i << ") L3 G16 " << num11 << " " << mean11 << " " << rms11 << std::endl;
1289  std::cout << std::endl;
1290  }
1291 
1292  }
1293 
1294  pn_gr.setADCMeanG1(mean03);
1295  pn_gr.setADCRMSG1(rms03);
1296 
1297  pn_gr.setPedMeanG1(mean07);
1298  pn_gr.setPedRMSG1(rms07);
1299 
1300  pn_gr.setADCMeanG16(mean11);
1301  pn_gr.setADCRMSG16(rms11);
1302 
1303  pn_gr.setPedMeanG16(mean15);
1304  pn_gr.setPedRMSG16(rms15);
1305 
1306  if ( UtilsClient::getBinStatus(meg07_[ism-1], i, 1) ||
1307  UtilsClient::getBinStatus(meg11_[ism-1], i, 1) ) {
1308  pn_gr.setTaskStatus(true);
1309  } else {
1310  pn_gr.setTaskStatus(false);
1311  }
1312 
1313  status = status && ( UtilsClient::getBinQuality(meg07_[ism-1], i, 1) ||
1314  UtilsClient::getBinQuality(meg11_[ism-1], i, 1) );
1315 
1316  if ( econn ) {
1317  ecid = LogicID::getEcalLogicID("EE_LM_PN", Numbers::iSM(ism, EcalEndcap), i-1);
1318  dataset2_gr[ecid] = pn_gr;
1319  }
1320 
1321  }
1322 
1323  if ( update04 || update08 || update12 || update16 ) {
1324 
1325  if ( i == 1 ) {
1326 
1327  if ( verbose_ ) {
1328  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1329  std::cout << "PNs (" << i << ") L4 G01 " << num04 << " " << mean04 << " " << rms04 << std::endl;
1330  std::cout << "PNs (" << i << ") L4 G16 " << num12 << " " << mean12 << " " << rms12 << std::endl;
1331  std::cout << std::endl;
1332  }
1333 
1334  }
1335 
1336  pn_rd.setADCMeanG1(mean04);
1337  pn_rd.setADCRMSG1(rms04);
1338 
1339  pn_rd.setPedMeanG1(mean08);
1340  pn_rd.setPedRMSG1(mean08);
1341 
1342  pn_rd.setADCMeanG16(mean12);
1343  pn_rd.setADCRMSG16(rms12);
1344 
1345  pn_rd.setPedMeanG16(mean16);
1346  pn_rd.setPedRMSG16(rms16);
1347 
1348  if ( UtilsClient::getBinStatus(meg08_[ism-1], i, 1) ||
1349  UtilsClient::getBinStatus(meg12_[ism-1], i, 1) ) {
1350  pn_rd.setTaskStatus(true);
1351  } else {
1352  pn_rd.setTaskStatus(false);
1353  }
1354 
1355  status = status && ( UtilsClient::getBinQuality(meg08_[ism-1], i, 1) ||
1356  UtilsClient::getBinQuality(meg12_[ism-1], i, 1) );
1357 
1358  if ( econn ) {
1359  ecid = LogicID::getEcalLogicID("EE_LM_PN", Numbers::iSM(ism, EcalEndcap), i-1);
1360  dataset2_rd[ecid] = pn_rd;
1361  }
1362 
1363  }
1364 
1365  }
1366 
1367  }
1368 
1369  if ( econn ) {
1370  try {
1371  if ( verbose_ ) std::cout << "Inserting MonPnDat ..." << std::endl;
1372  if ( dataset2_bl.size() != 0 ) econn->insertDataArraySet(&dataset2_bl, moniov);
1373  if ( dataset2_ir.size() != 0 ) econn->insertDataArraySet(&dataset2_ir, moniov);
1374  if ( dataset2_gr.size() != 0 ) econn->insertDataArraySet(&dataset2_gr, moniov);
1375  if ( dataset2_rd.size() != 0 ) econn->insertDataArraySet(&dataset2_rd, moniov);
1376  if ( verbose_ ) std::cout << "done." << std::endl;
1377  } catch (std::runtime_error &e) {
1378  std::cerr << e.what() << std::endl;
1379  }
1380  }
1381 
1382  if ( verbose_ ) std::cout << std::endl;
1383 
1385  std::map<EcalLogicID, MonTimingLaserBlueCrystalDat> dataset3_bl;
1387  std::map<EcalLogicID, MonTimingLaserGreenCrystalDat> dataset3_gr;
1389  std::map<EcalLogicID, MonTimingLaserIRedCrystalDat> dataset3_ir;
1391  std::map<EcalLogicID, MonTimingLaserRedCrystalDat> dataset3_rd;
1392 
1393  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
1394 
1395  int ism = superModules_[i];
1396 
1397  if ( verbose_ ) {
1398  std::cout << " " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1399  std::cout << std::endl;
1400  }
1401 
1402  for ( int ix = 1; ix <= 50; ix++ ) {
1403  for ( int iy = 1; iy <= 50; iy++ ) {
1404 
1405  int jx = ix + Numbers::ix0EE(ism);
1406  int jy = iy + Numbers::iy0EE(ism);
1407 
1408  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
1409 
1410  if ( ! Numbers::validEE(ism, jx, jy) ) continue;
1411 
1412  bool update01;
1413  bool update02;
1414  bool update03;
1415  bool update04;
1416 
1417  float num01, num02, num03, num04;
1418  float mean01, mean02, mean03, mean04;
1419  float rms01, rms02, rms03, rms04;
1420 
1421  update01 = UtilsClient::getBinStatistics(h09_[ism-1], ix, iy, num01, mean01, rms01);
1422  update02 = UtilsClient::getBinStatistics(h10_[ism-1], ix, iy, num02, mean02, rms02);
1423  update03 = UtilsClient::getBinStatistics(h11_[ism-1], ix, iy, num03, mean03, rms03);
1424  update04 = UtilsClient::getBinStatistics(h12_[ism-1], ix, iy, num04, mean04, rms04);
1425 
1426  if ( update01 ) {
1427 
1428  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
1429 
1430  if ( verbose_ ) {
1431  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1432  std::cout << "L1 crystal (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num01 << " " << mean01 << " " << rms01 << std::endl;
1433  std::cout << std::endl;
1434  }
1435 
1436  }
1437 
1438  t_bl.setTimingMean(mean01);
1439  t_bl.setTimingRMS(rms01);
1440 
1441  if ( UtilsClient::getBinStatus(meg01_[ism-1], ix, iy) ) {
1442  t_bl.setTaskStatus(true);
1443  } else {
1444  t_bl.setTaskStatus(false);
1445  }
1446 
1447  status = status && UtilsClient::getBinQuality(meg01_[ism-1], ix, iy);
1448 
1449  int ic = Numbers::indexEE(ism, jx, jy);
1450 
1451  if ( ic == -1 ) continue;
1452 
1453  if ( econn ) {
1454  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
1455  dataset3_bl[ecid] = t_bl;
1456  }
1457 
1458  }
1459 
1460  if ( update02 ) {
1461 
1462  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
1463 
1464  if ( verbose_ ) {
1465  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1466  std::cout << "L2 crystal (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num02 << " " << mean02 << " " << rms02 << std::endl;
1467  std::cout << std::endl;
1468  }
1469 
1470  }
1471 
1472  t_gr.setTimingMean(mean02);
1473  t_gr.setTimingRMS(rms02);
1474 
1475  if ( UtilsClient::getBinStatus(meg02_[ism-1], ix, iy) ) {
1476  t_gr.setTaskStatus(true);
1477  } else {
1478  t_gr.setTaskStatus(false);
1479  }
1480 
1481  status = status && UtilsClient::getBinQuality(meg02_[ism-1], ix, iy);
1482 
1483  int ic = Numbers::indexEE(ism, jx, jy);
1484 
1485  if ( ic == -1 ) continue;
1486 
1487  if ( econn ) {
1488  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
1489  dataset3_gr[ecid] = t_gr;
1490  }
1491 
1492  }
1493 
1494  if ( update03 ) {
1495 
1496  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
1497 
1498  if ( verbose_ ) {
1499  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1500  std::cout << "L3 crystal (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num03 << " " << mean03 << " " << rms03 << std::endl;
1501  std::cout << std::endl;
1502  }
1503 
1504  }
1505 
1506  t_ir.setTimingMean(mean03);
1507  t_ir.setTimingRMS(rms03);
1508 
1509  if ( UtilsClient::getBinStatus(meg03_[ism-1], ix, iy) ) {
1510  t_ir.setTaskStatus(true);
1511  } else {
1512  t_ir.setTaskStatus(false);
1513  }
1514 
1515  status = status && UtilsClient::getBinQuality(meg03_[ism-1], ix, iy);
1516 
1517  int ic = Numbers::indexEE(ism, jx, jy);
1518 
1519  if ( ic == -1 ) continue;
1520 
1521  if ( econn ) {
1522  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
1523  dataset3_ir[ecid] = t_ir;
1524  }
1525 
1526  }
1527 
1528  if ( update04 ) {
1529 
1530  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
1531 
1532  if ( verbose_ ) {
1533  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
1534  std::cout << "L4 crystal (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num04 << " " << mean04 << " " << rms04 << std::endl;
1535  std::cout << std::endl;
1536  }
1537 
1538  }
1539 
1540  t_rd.setTimingMean(mean04);
1541  t_rd.setTimingRMS(rms04);
1542 
1543  if ( UtilsClient::getBinStatus(meg04_[ism-1], ix, iy) ) {
1544  t_rd.setTaskStatus(true);
1545  } else {
1546  t_rd.setTaskStatus(false);
1547  }
1548 
1549  status = status && UtilsClient::getBinQuality(meg04_[ism-1], ix, iy);
1550 
1551  int ic = Numbers::indexEE(ism, jx, jy);
1552 
1553  if ( ic == -1 ) continue;
1554 
1555  if ( econn ) {
1556  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
1557  dataset3_rd[ecid] = t_rd;
1558  }
1559 
1560  }
1561 
1562  }
1563  }
1564 
1565  }
1566 
1567  if ( econn ) {
1568  try {
1569  if ( verbose_ ) std::cout << "Inserting MonTimingLaserCrystalDat ..." << std::endl;
1570  if ( dataset3_bl.size() != 0 ) econn->insertDataArraySet(&dataset3_bl, moniov);
1571  if ( dataset3_ir.size() != 0 ) econn->insertDataArraySet(&dataset3_ir, moniov);
1572  if ( dataset3_gr.size() != 0 ) econn->insertDataArraySet(&dataset3_gr, moniov);
1573  if ( dataset3_rd.size() != 0 ) econn->insertDataArraySet(&dataset3_rd, moniov);
1574  if ( verbose_ ) std::cout << "done." << std::endl;
1575  } catch (std::runtime_error &e) {
1576  std::cerr << e.what() << std::endl;
1577  }
1578  }
1579 
1580  return true;
1581 
1582 }
1583 #endif
1584 
1586 
1587  ievt_++;
1588  jevt_++;
1589  if ( ievt_ % 10 == 0 ) {
1590  if ( debug_ ) std::cout << "EELaserClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
1591  }
1592 
1593  uint32_t bits01 = 0;
1595  bits01 |= 1 << EcalDQMStatusHelper::LASER_RMS_ERROR;
1596 
1597  uint32_t bits02 = 0;
1600 
1601  uint32_t bits03 = 0;
1604 
1605  uint32_t bits04 = 0;
1608 
1609  MonitorElement* me;
1610 
1611  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
1612 
1613  int ism = superModules_[i];
1614 
1615  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1616 
1617  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser1/EELT amplitude " + Numbers::sEE(ism) + " L1" );
1618  h01_[ism-1] = UtilsClient::getHisto( me, cloneME_, h01_[ism-1] );
1619 
1620  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser1/EELT amplitude over PN " + Numbers::sEE(ism) + " L1" );
1621  h02_[ism-1] = UtilsClient::getHisto( me, cloneME_, h02_[ism-1] );
1622 
1623  }
1624 
1625  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1626 
1627  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser2/EELT amplitude " + Numbers::sEE(ism) + " L2" );
1628  h03_[ism-1] = UtilsClient::getHisto( me, cloneME_, h03_[ism-1] );
1629 
1630  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser2/EELT amplitude over PN " + Numbers::sEE(ism) + " L2" );
1631  h04_[ism-1] = UtilsClient::getHisto( me, cloneME_, h04_[ism-1] );
1632 
1633  }
1634 
1635  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1636 
1637  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser3/EELT amplitude " + Numbers::sEE(ism) + " L3" );
1638  h05_[ism-1] = UtilsClient::getHisto( me, cloneME_, h05_[ism-1] );
1639 
1640  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser3/EELT amplitude over PN " + Numbers::sEE(ism) + " L3" );
1641  h06_[ism-1] = UtilsClient::getHisto( me, cloneME_, h06_[ism-1] );
1642 
1643  }
1644 
1645  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1646 
1647  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser4/EELT amplitude " + Numbers::sEE(ism) + " L4" );
1648  h07_[ism-1] = UtilsClient::getHisto( me, cloneME_, h07_[ism-1] );
1649 
1650  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser4/EELT amplitude over PN " + Numbers::sEE(ism) + " L4" );
1651  h08_[ism-1] = UtilsClient::getHisto( me, cloneME_, h08_[ism-1] );
1652 
1653  }
1654 
1655  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1656 
1657  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser1/EELT timing " + Numbers::sEE(ism) + " L1" );
1658  h09_[ism-1] = UtilsClient::getHisto( me, cloneME_, h09_[ism-1] );
1659 
1660  }
1661 
1662  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1663 
1664  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser2/EELT timing " + Numbers::sEE(ism) + " L2" );
1665  h10_[ism-1] = UtilsClient::getHisto( me, cloneME_, h10_[ism-1] );
1666 
1667  }
1668 
1669  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1670 
1671  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser3/EELT timing " + Numbers::sEE(ism) + " L3" );
1672  h11_[ism-1] = UtilsClient::getHisto( me, cloneME_, h11_[ism-1] );
1673 
1674  }
1675 
1676  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1677 
1678  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser4/EELT timing " + Numbers::sEE(ism) + " L4" );
1679  h12_[ism-1] = UtilsClient::getHisto( me, cloneME_, h12_[ism-1] );
1680 
1681  }
1682 
1683  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1684 
1685  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser1/EELT shape " + Numbers::sEE(ism) + " L1" );
1686  hs01_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs01_[ism-1] );
1687 
1688  }
1689 
1690  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1691 
1692  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser2/EELT shape " + Numbers::sEE(ism) + " L2" );
1693  hs02_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs02_[ism-1] );
1694 
1695  }
1696 
1697  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1698 
1699  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser3/EELT shape " + Numbers::sEE(ism) + " L3" );
1700  hs03_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs03_[ism-1] );
1701 
1702  }
1703 
1704  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1705 
1706  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser4/EELT shape " + Numbers::sEE(ism) + " L4" );
1707  hs04_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs04_[ism-1] );
1708 
1709  }
1710 
1711  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1712 
1713  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser1/PN/Gain01/EELT PNs amplitude " + Numbers::sEE(ism) + " G01 L1" );
1714  i01_[ism-1] = UtilsClient::getHisto( me, cloneME_, i01_[ism-1] );
1715 
1716  }
1717 
1718  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1719 
1720  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser2/PN/Gain01/EELT PNs amplitude " + Numbers::sEE(ism) + " G01 L2" );
1721  i02_[ism-1] = UtilsClient::getHisto( me, cloneME_, i02_[ism-1] );
1722 
1723  }
1724 
1725  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1726 
1727  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser3/PN/Gain01/EELT PNs amplitude " + Numbers::sEE(ism) + " G01 L3" );
1728  i03_[ism-1] = UtilsClient::getHisto( me, cloneME_, i03_[ism-1] );
1729 
1730  }
1731 
1732  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1733 
1734  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser4/PN/Gain01/EELT PNs amplitude " + Numbers::sEE(ism) + " G01 L4" );
1735  i04_[ism-1] = UtilsClient::getHisto( me, cloneME_, i04_[ism-1] );
1736 
1737  }
1738 
1739  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1740 
1741  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser1/PN/Gain01/EELT PNs pedestal " + Numbers::sEE(ism) + " G01 L1" );
1742  i05_[ism-1] = UtilsClient::getHisto( me, cloneME_, i05_[ism-1] );
1743 
1744  }
1745 
1746  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1747 
1748  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser2/PN/Gain01/EELT PNs pedestal " + Numbers::sEE(ism) + " G01 L2" );
1749  i06_[ism-1] = UtilsClient::getHisto( me, cloneME_, i06_[ism-1] );
1750 
1751  }
1752 
1753  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1754 
1755  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser3/PN/Gain01/EELT PNs pedestal " + Numbers::sEE(ism) + " G01 L3" );
1756  i07_[ism-1] = UtilsClient::getHisto( me, cloneME_, i07_[ism-1] );
1757 
1758  }
1759 
1760  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1761 
1762  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser4/PN/Gain01/EELT PNs pedestal " + Numbers::sEE(ism) + " G01 L4" );
1763  i08_[ism-1] = UtilsClient::getHisto( me, cloneME_, i08_[ism-1] );
1764 
1765  }
1766 
1767  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1768 
1769  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser1/PN/Gain16/EELT PNs amplitude " + Numbers::sEE(ism) + " G16 L1" );
1770  i09_[ism-1] = UtilsClient::getHisto( me, cloneME_, i09_[ism-1] );
1771 
1772  }
1773 
1774  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1775 
1776  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser2/PN/Gain16/EELT PNs amplitude " + Numbers::sEE(ism) + " G16 L2" );
1777  i10_[ism-1] = UtilsClient::getHisto( me, cloneME_, i10_[ism-1] );
1778 
1779  }
1780 
1781  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1782 
1783  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser3/PN/Gain16/EELT PNs amplitude " + Numbers::sEE(ism) + " G16 L3" );
1784  i11_[ism-1] = UtilsClient::getHisto( me, cloneME_, i11_[ism-1] );
1785 
1786  }
1787 
1788  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1789 
1790  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser4/PN/Gain16/EELT PNs amplitude " + Numbers::sEE(ism) + " G16 L4" );
1791  i12_[ism-1] = UtilsClient::getHisto( me, cloneME_, i12_[ism-1] );
1792 
1793  }
1794 
1795  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1796 
1797  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser1/PN/Gain16/EELT PNs pedestal " + Numbers::sEE(ism) + " G16 L1" );
1798  i13_[ism-1] = UtilsClient::getHisto( me, cloneME_, i13_[ism-1] );
1799 
1800  }
1801 
1802  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1803 
1804  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser2/PN/Gain16/EELT PNs pedestal " + Numbers::sEE(ism) + " G16 L2" );
1805  i14_[ism-1] = UtilsClient::getHisto( me, cloneME_, i14_[ism-1] );
1806 
1807  }
1808 
1809  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1810 
1811  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser3/PN/Gain16/EELT PNs pedestal " + Numbers::sEE(ism) + " G16 L3" );
1812  i15_[ism-1] = UtilsClient::getHisto( me, cloneME_, i15_[ism-1] );
1813 
1814  }
1815 
1816  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1817 
1818  me = dqmStore_->get( prefixME_ + "/EELaserTask/Laser4/PN/Gain16/EELT PNs pedestal " + Numbers::sEE(ism) + " G16 L4" );
1819  i16_[ism-1] = UtilsClient::getHisto( me, cloneME_, i16_[ism-1] );
1820 
1821  }
1822 
1823  if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
1824  if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
1825  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
1826  if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
1827 
1828  if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
1829  if ( meg06_[ism-1] ) meg06_[ism-1]->Reset();
1830  if ( meg07_[ism-1] ) meg07_[ism-1]->Reset();
1831  if ( meg08_[ism-1] ) meg08_[ism-1]->Reset();
1832  if ( meg09_[ism-1] ) meg09_[ism-1]->Reset();
1833  if ( meg10_[ism-1] ) meg10_[ism-1]->Reset();
1834  if ( meg11_[ism-1] ) meg11_[ism-1]->Reset();
1835  if ( meg12_[ism-1] ) meg12_[ism-1]->Reset();
1836 
1837  if ( mea01_[ism-1] ) mea01_[ism-1]->Reset();
1838  if ( mea02_[ism-1] ) mea02_[ism-1]->Reset();
1839  if ( mea03_[ism-1] ) mea03_[ism-1]->Reset();
1840  if ( mea04_[ism-1] ) mea04_[ism-1]->Reset();
1841 
1842  if ( met01_[ism-1] ) met01_[ism-1]->Reset();
1843  if ( met02_[ism-1] ) met02_[ism-1]->Reset();
1844  if ( met03_[ism-1] ) met03_[ism-1]->Reset();
1845  if ( met04_[ism-1] ) met04_[ism-1]->Reset();
1846 
1847  if ( metav01_[ism-1] ) metav01_[ism-1]->Reset();
1848  if ( metav02_[ism-1] ) metav02_[ism-1]->Reset();
1849  if ( metav03_[ism-1] ) metav03_[ism-1]->Reset();
1850  if ( metav04_[ism-1] ) metav04_[ism-1]->Reset();
1851 
1852  if ( metrms01_[ism-1] ) metrms01_[ism-1]->Reset();
1853  if ( metrms02_[ism-1] ) metrms02_[ism-1]->Reset();
1854  if ( metrms03_[ism-1] ) metrms03_[ism-1]->Reset();
1855  if ( metrms04_[ism-1] ) metrms04_[ism-1]->Reset();
1856 
1857  if ( meaopn01_[ism-1] ) meaopn01_[ism-1]->Reset();
1858  if ( meaopn02_[ism-1] ) meaopn02_[ism-1]->Reset();
1859  if ( meaopn03_[ism-1] ) meaopn03_[ism-1]->Reset();
1860  if ( meaopn04_[ism-1] ) meaopn04_[ism-1]->Reset();
1861 
1862  if ( mepnprms01_[ism-1] ) mepnprms01_[ism-1]->Reset();
1863  if ( mepnprms02_[ism-1] ) mepnprms02_[ism-1]->Reset();
1864  if ( mepnprms03_[ism-1] ) mepnprms03_[ism-1]->Reset();
1865  if ( mepnprms04_[ism-1] ) mepnprms04_[ism-1]->Reset();
1866  if ( mepnprms05_[ism-1] ) mepnprms05_[ism-1]->Reset();
1867  if ( mepnprms06_[ism-1] ) mepnprms06_[ism-1]->Reset();
1868  if ( mepnprms07_[ism-1] ) mepnprms07_[ism-1]->Reset();
1869  if ( mepnprms08_[ism-1] ) mepnprms08_[ism-1]->Reset();
1870 
1871  if ( me_hs01_[ism-1] ) me_hs01_[ism-1]->Reset();
1872  if ( me_hs02_[ism-1] ) me_hs02_[ism-1]->Reset();
1873  if ( me_hs03_[ism-1] ) me_hs03_[ism-1]->Reset();
1874  if ( me_hs04_[ism-1] ) me_hs04_[ism-1]->Reset();
1875 
1876  float meanAmplL1, meanAmplL2, meanAmplL3, meanAmplL4;
1877 
1878  int nCryL1, nCryL2, nCryL3, nCryL4;
1879 
1880  meanAmplL1 = meanAmplL2 = meanAmplL3 = meanAmplL4 = 0.;
1881 
1882  nCryL1 = nCryL2 = nCryL3 = nCryL4 = 0;
1883 
1884  bool l1Data(false), l2Data(false), l3Data(false), l4Data(false);
1885 
1886  for ( int ix = 1; ix <= 50; ix++ ) {
1887  for ( int iy = 1; iy <= 50; iy++ ) {
1888 
1889  bool update01;
1890  bool update02;
1891  bool update03;
1892  bool update04;
1893 
1894  float num01, num02, num03, num04;
1895  float mean01, mean02, mean03, mean04;
1896  float rms01, rms02, rms03, rms04;
1897 
1898  update01 = UtilsClient::getBinStatistics(h01_[ism-1], ix, iy, num01, mean01, rms01);
1899  update02 = UtilsClient::getBinStatistics(h03_[ism-1], ix, iy, num02, mean02, rms02);
1900  update03 = UtilsClient::getBinStatistics(h05_[ism-1], ix, iy, num03, mean03, rms03);
1901  update04 = UtilsClient::getBinStatistics(h07_[ism-1], ix, iy, num04, mean04, rms04);
1902 
1903  if(update01) l1Data = true;
1904  if(update02) l2Data = true;
1905  if(update03) l3Data = true;
1906  if(update04) l4Data = true;
1907 
1908  if ( update01 ) {
1909  meanAmplL1 += mean01;
1910  nCryL1++;
1911  }
1912 
1913  if ( update02 ) {
1914  meanAmplL2 += mean02;
1915  nCryL2++;
1916  }
1917 
1918  if ( update03 ) {
1919  meanAmplL3 += mean03;
1920  nCryL3++;
1921  }
1922 
1923  if ( update04 ) {
1924  meanAmplL4 += mean04;
1925  nCryL4++;
1926  }
1927 
1928  }
1929  }
1930 
1931  if ( nCryL1 > 0 ) meanAmplL1 /= float (nCryL1);
1932  if ( nCryL2 > 0 ) meanAmplL2 /= float (nCryL2);
1933  if ( nCryL3 > 0 ) meanAmplL3 /= float (nCryL3);
1934  if ( nCryL4 > 0 ) meanAmplL4 /= float (nCryL4);
1935 
1936  for ( int ix = 1; ix <= 50; ix++ ) {
1937  for ( int iy = 1; iy <= 50; iy++ ) {
1938 
1939  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 6.);
1940  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 6.);
1941  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 6.);
1942  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( ix, iy, 6.);
1943 
1944  int jx = ix + Numbers::ix0EE(ism);
1945  int jy = iy + Numbers::iy0EE(ism);
1946 
1947  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
1948 
1949  if ( Numbers::validEE(ism, jx, jy) ) {
1950  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 2.);
1951  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 2.);
1952  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2.);
1953  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( ix, iy, 2.);
1954  }
1955 
1956  bool update01;
1957  bool update02;
1958  bool update03;
1959  bool update04;
1960  bool update05;
1961  bool update06;
1962  bool update07;
1963  bool update08;
1964  bool update09;
1965  bool update10;
1966  bool update11;
1967  bool update12;
1968 
1969  float num01, num02, num03, num04, num05, num06, num07, num08;
1970  float num09, num10, num11, num12;
1971  float mean01, mean02, mean03, mean04, mean05, mean06, mean07, mean08;
1972  float mean09, mean10, mean11, mean12;
1973  float rms01, rms02, rms03, rms04, rms05, rms06, rms07, rms08;
1974  float rms09, rms10, rms11, rms12;
1975 
1976  update01 = UtilsClient::getBinStatistics(h01_[ism-1], ix, iy, num01, mean01, rms01);
1977  update02 = UtilsClient::getBinStatistics(h02_[ism-1], ix, iy, num02, mean02, rms02);
1978  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ix, iy, num03, mean03, rms03);
1979  update04 = UtilsClient::getBinStatistics(h04_[ism-1], ix, iy, num04, mean04, rms04);
1980  update05 = UtilsClient::getBinStatistics(h05_[ism-1], ix, iy, num05, mean05, rms05);
1981  update06 = UtilsClient::getBinStatistics(h06_[ism-1], ix, iy, num06, mean06, rms06);
1982  update07 = UtilsClient::getBinStatistics(h07_[ism-1], ix, iy, num07, mean07, rms07);
1983  update08 = UtilsClient::getBinStatistics(h08_[ism-1], ix, iy, num08, mean08, rms08);
1984  update09 = UtilsClient::getBinStatistics(h09_[ism-1], ix, iy, num09, mean09, rms09);
1985  update10 = UtilsClient::getBinStatistics(h10_[ism-1], ix, iy, num10, mean10, rms10);
1986  update11 = UtilsClient::getBinStatistics(h11_[ism-1], ix, iy, num11, mean11, rms11);
1987  update12 = UtilsClient::getBinStatistics(h12_[ism-1], ix, iy, num12, mean12, rms12);
1988 
1989  if ( update01 ) {
1990 
1991  float val;
1992 
1993  val = 1.;
1994  if ( std::abs(mean01 - meanAmplL1) > std::abs(percentVariation_ * meanAmplL1) || mean01 < amplitudeThreshold_ || rms01 > rmsThresholdRelative_ * mean01 )
1995  val = 0.;
1996  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, val );
1997 
1998  int ic = Numbers::icEE(ism, jx, jy);
1999 
2000  if ( ic != -1 ) {
2001  if ( mea01_[ism-1] ) {
2002  if ( mean01 > 0. ) {
2003  mea01_[ism-1]->setBinContent( ic, mean01 );
2004  mea01_[ism-1]->setBinError( ic, rms01 );
2005  } else {
2006  mea01_[ism-1]->setEntries( 1.+mea01_[ism-1]->getEntries() );
2007  }
2008  }
2009  }
2010 
2011  }
2012 
2013  if ( update03 ) {
2014 
2015  float val;
2016 
2017  val = 1.;
2018  if ( std::abs(mean03 - meanAmplL2) > std::abs(percentVariation_ * meanAmplL2) || mean03 < amplitudeThreshold_ || rms03 > rmsThresholdRelative_ * mean03 )
2019  val = 0.;
2020  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, val );
2021 
2022  int ic = Numbers::icEE(ism, jx, jy);
2023 
2024  if ( ic != -1 ) {
2025  if ( mea02_[ism-1] ) {
2026  if ( mean03 > 0. ) {
2027  mea02_[ism-1]->setBinContent( ic, mean03 );
2028  mea02_[ism-1]->setBinError( ic, rms03 );
2029  } else {
2030  mea02_[ism-1]->setEntries( 1.+mea02_[ism-1]->getEntries() );
2031  }
2032  }
2033  }
2034 
2035  }
2036 
2037  if ( update05 ) {
2038 
2039  float val;
2040 
2041  val = 1.;
2042  if ( std::abs(mean05 - meanAmplL3) > std::abs(percentVariation_ * meanAmplL3) || mean05 < amplitudeThreshold_ || rms05 > rmsThresholdRelative_ * mean05 )
2043  val = 0.;
2044  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, val );
2045 
2046  int ic = Numbers::icEE(ism, jx, jy);
2047 
2048  if ( ic != -1 ) {
2049  if ( mea03_[ism-1] ) {
2050  if ( mean05 > 0. ) {
2051  mea03_[ism-1]->setBinContent( ic, mean05 );
2052  mea03_[ism-1]->setBinError( ic, rms05 );
2053  } else {
2054  mea03_[ism-1]->setEntries( 1.+mea03_[ism-1]->getEntries() );
2055  }
2056  }
2057  }
2058 
2059  }
2060 
2061  if ( update07 ) {
2062 
2063  float val;
2064 
2065  val = 1.;
2066  if ( std::abs(mean07 - meanAmplL4) > std::abs(percentVariation_ * meanAmplL4) || mean07 < amplitudeThreshold_ || rms07 > rmsThresholdRelative_ * mean07 )
2067  val = 0.;
2068  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( ix, iy, val );
2069 
2070  int ic = Numbers::icEE(ism, jx, jy);
2071 
2072  if ( ic != -1 ) {
2073  if ( mea04_[ism-1] ) {
2074  if ( mean07 > 0. ) {
2075  mea04_[ism-1]->setBinContent( ic, mean07 );
2076  mea04_[ism-1]->setBinError( ic, rms07 );
2077  } else {
2078  mea04_[ism-1]->setEntries( 1.+mea04_[ism-1]->getEntries() );
2079  }
2080  }
2081  }
2082 
2083  }
2084 
2085  if ( Masks::maskChannel(ism, ix, iy, bits01, EcalEndcap) ) {
2086  UtilsClient::maskBinContent( meg01_[ism-1], ix, iy );
2087  UtilsClient::maskBinContent( meg02_[ism-1], ix, iy );
2088  UtilsClient::maskBinContent( meg03_[ism-1], ix, iy );
2089  UtilsClient::maskBinContent( meg04_[ism-1], ix, iy );
2090  }
2091 
2092  if ( update02 ) {
2093 
2094  int ic = Numbers::icEE(ism, jx, jy);
2095 
2096  if ( ic != -1 ) {
2097  if ( meaopn01_[ism-1] ) {
2098  if ( mean02 > 0. ) {
2099  meaopn01_[ism-1]->setBinContent( ic, mean02 );
2100  meaopn01_[ism-1]->setBinError( ic, rms02 );
2101  } else {
2102  meaopn01_[ism-1]->setEntries( 1.+meaopn01_[ism-1]->getEntries() );
2103  }
2104  }
2105  }
2106 
2107  }
2108 
2109  if ( update04 ) {
2110 
2111  int ic = Numbers::icEE(ism, jx, jy);
2112 
2113  if ( ic != -1 ) {
2114  if ( meaopn02_[ism-1] ) {
2115  if ( mean04 > 0. ) {
2116  meaopn02_[ism-1]->setBinContent( ic, mean04 );
2117  meaopn02_[ism-1]->setBinError( ic, rms04 );
2118  } else {
2119  meaopn02_[ism-1]->setEntries( 1.+meaopn02_[ism-1]->getEntries() );
2120  }
2121  }
2122  }
2123 
2124  }
2125 
2126  if ( update06 ) {
2127 
2128  int ic = Numbers::icEE(ism, jx, jy);
2129 
2130  if ( ic != -1 ) {
2131  if ( meaopn03_[ism-1] ) {
2132  if ( mean06 > 0. ) {
2133  meaopn03_[ism-1]->setBinContent( ic, mean06 );
2134  meaopn03_[ism-1]->setBinError( ic, rms06 );
2135  } else {
2136  meaopn03_[ism-1]->setEntries( 1.+meaopn03_[ism-1]->getEntries() );
2137  }
2138  }
2139  }
2140 
2141  }
2142 
2143  if ( update08 ) {
2144 
2145  int ic = Numbers::icEE(ism, jx, jy);
2146 
2147  if ( ic != -1 ) {
2148  if ( meaopn04_[ism-1] ) {
2149  if ( mean08 > 0. ) {
2150  meaopn04_[ism-1]->setBinContent( ic, mean08 );
2151  meaopn04_[ism-1]->setBinError( ic, rms08 );
2152  } else {
2153  meaopn04_[ism-1]->setEntries( 1.+meaopn04_[ism-1]->getEntries() );
2154  }
2155  }
2156  }
2157 
2158  }
2159 
2160  if ( update09 ) {
2161 
2162  int ic = Numbers::icEE(ism, jx, jy);
2163 
2164  if ( ic != -1 ) {
2165  if ( met01_[ism-1] ) {
2166  if ( mean09 > 0. ) {
2167  met01_[ism-1]->setBinContent( ic, mean09 );
2168  met01_[ism-1]->setBinError( ic, rms09 );
2169  } else {
2170  met01_[ism-1]->setEntries(1.+met01_[ism-1]->getEntries());
2171  }
2172  }
2173 
2174  if ( metav01_[ism-1] ) metav01_[ism-1] ->Fill(mean09);
2175  if ( metrms01_[ism-1] ) metrms01_[ism-1]->Fill(rms09);
2176  }
2177 
2178  }
2179 
2180  if ( update10 ) {
2181 
2182  int ic = Numbers::icEE(ism, jx, jy);
2183 
2184  if ( ic != -1 ) {
2185  if ( met02_[ism-1] ) {
2186  if ( mean10 > 0. ) {
2187  met02_[ism-1]->setBinContent( ic, mean10 );
2188  met02_[ism-1]->setBinError( ic, rms10 );
2189  } else {
2190  met02_[ism-1]->setEntries(1.+met02_[ism-1]->getEntries());
2191  }
2192  }
2193 
2194  if ( metav02_[ism-1] ) metav02_[ism-1] ->Fill(mean10);
2195  if ( metrms02_[ism-1] ) metrms02_[ism-1]->Fill(rms10);
2196  }
2197 
2198  }
2199 
2200 
2201  if ( update11 ) {
2202 
2203  int ic = Numbers::icEE(ism, jx, jy);
2204 
2205  if ( ic != -1 ) {
2206  if ( met03_[ism-1] ) {
2207  if ( mean11 > 0. ) {
2208  met03_[ism-1]->setBinContent( ic, mean11 );
2209  met03_[ism-1]->setBinError( ic, rms11 );
2210  } else {
2211  met03_[ism-1]->setEntries(1.+met03_[ism-1]->getEntries());
2212  }
2213  }
2214 
2215  if ( metav03_[ism-1] ) metav03_[ism-1] ->Fill(mean11);
2216  if ( metrms03_[ism-1] ) metrms03_[ism-1]->Fill(rms11);
2217  }
2218 
2219  }
2220 
2221  if ( update12 ) {
2222 
2223  int ic = Numbers::icEE(ism, jx, jy);
2224 
2225  if ( ic != -1 ) {
2226  if ( met04_[ism-1] ) {
2227  if ( mean12 > 0. ) {
2228  met04_[ism-1]->setBinContent( ic, mean12 );
2229  met04_[ism-1]->setBinError( ic, rms12 );
2230  } else {
2231  met04_[ism-1]->setEntries(1.+met04_[ism-1]->getEntries());
2232  }
2233  }
2234 
2235  if ( metav04_[ism-1] ) metav04_[ism-1] ->Fill(mean12);
2236  if ( metrms04_[ism-1] ) metrms04_[ism-1]->Fill(rms12);
2237  }
2238 
2239  }
2240 
2241  }
2242  }
2243 
2244  for ( int i = 1; i <= 10; i++ ) {
2245 
2246  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 6. );
2247  if ( meg06_[ism-1] ) meg06_[ism-1]->setBinContent( i, 1, 6. );
2248  if ( meg07_[ism-1] ) meg07_[ism-1]->setBinContent( i, 1, 6. );
2249  if ( meg08_[ism-1] ) meg08_[ism-1]->setBinContent( i, 1, 6. );
2250  if ( meg09_[ism-1] ) meg09_[ism-1]->setBinContent( i, 1, 6. );
2251  if ( meg10_[ism-1] ) meg10_[ism-1]->setBinContent( i, 1, 6. );
2252  if ( meg11_[ism-1] ) meg11_[ism-1]->setBinContent( i, 1, 6. );
2253  if ( meg12_[ism-1] ) meg12_[ism-1]->setBinContent( i, 1, 6. );
2254 
2255  // non-existing mem
2256  if ( (ism >= 3 && ism <= 4) || (ism >= 7 && ism <= 9) ) continue;
2257  if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) ) continue;
2258 
2259  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
2260  if ( meg06_[ism-1] ) meg06_[ism-1]->setBinContent( i, 1, 2. );
2261  if ( meg07_[ism-1] ) meg07_[ism-1]->setBinContent( i, 1, 2. );
2262  if ( meg08_[ism-1] ) meg08_[ism-1]->setBinContent( i, 1, 2. );
2263  if ( meg09_[ism-1] ) meg09_[ism-1]->setBinContent( i, 1, 2. );
2264  if ( meg10_[ism-1] ) meg10_[ism-1]->setBinContent( i, 1, 2. );
2265  if ( meg11_[ism-1] ) meg11_[ism-1]->setBinContent( i, 1, 2. );
2266  if ( meg12_[ism-1] ) meg12_[ism-1]->setBinContent( i, 1, 2. );
2267 
2268  bool update01;
2269  bool update02;
2270  bool update03;
2271  bool update04;
2272  bool update05;
2273  bool update06;
2274  bool update07;
2275  bool update08;
2276  bool update09;
2277  bool update10;
2278  bool update11;
2279  bool update12;
2280  bool update13;
2281  bool update14;
2282  bool update15;
2283  bool update16;
2284 
2285  float num01, num02, num03, num04, num05, num06, num07, num08;
2286  float num09, num10, num11, num12, num13, num14, num15, num16;
2287  float mean01, mean02, mean03, mean04, mean05, mean06, mean07, mean08;
2288  float mean09, mean10, mean11, mean12, mean13, mean14, mean15, mean16;
2289  float rms01, rms02, rms03, rms04, rms05, rms06, rms07, rms08;
2290  float rms09, rms10, rms11, rms12, rms13, rms14, rms15, rms16;
2291 
2292  update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
2293  update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
2294  update03 = UtilsClient::getBinStatistics(i03_[ism-1], i, 0, num03, mean03, rms03);
2295  update04 = UtilsClient::getBinStatistics(i04_[ism-1], i, 0, num04, mean04, rms04);
2296  update05 = UtilsClient::getBinStatistics(i05_[ism-1], i, 0, num05, mean05, rms05);
2297  update06 = UtilsClient::getBinStatistics(i06_[ism-1], i, 0, num06, mean06, rms06);
2298  update07 = UtilsClient::getBinStatistics(i07_[ism-1], i, 0, num07, mean07, rms07);
2299  update08 = UtilsClient::getBinStatistics(i08_[ism-1], i, 0, num08, mean08, rms08);
2300  update09 = UtilsClient::getBinStatistics(i09_[ism-1], i, 0, num09, mean09, rms09);
2301  update10 = UtilsClient::getBinStatistics(i10_[ism-1], i, 0, num10, mean10, rms10);
2302  update11 = UtilsClient::getBinStatistics(i11_[ism-1], i, 0, num11, mean11, rms11);
2303  update12 = UtilsClient::getBinStatistics(i12_[ism-1], i, 0, num12, mean12, rms12);
2304  update13 = UtilsClient::getBinStatistics(i13_[ism-1], i, 0, num13, mean13, rms13);
2305  update14 = UtilsClient::getBinStatistics(i14_[ism-1], i, 0, num14, mean14, rms14);
2306  update15 = UtilsClient::getBinStatistics(i15_[ism-1], i, 0, num15, mean15, rms15);
2307  update16 = UtilsClient::getBinStatistics(i16_[ism-1], i, 0, num16, mean16, rms16);
2308 
2309  if ( update01 && update05 ) {
2310 
2311  float val;
2312 
2313  val = 1.;
2314  if ( mean01 < amplitudeThresholdPnG01_ )
2315  val = 0.;
2316  if ( mean05 < pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
2317  pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean05)
2318  val = 0.;
2319  if ( rms05 > pedPnRMSThreshold_[0] )
2320  val = 0.;
2321 
2322  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent(i, 1, val);
2323  if ( mepnprms01_[ism-1] ) mepnprms01_[ism-1]->Fill(rms05);
2324 
2325  }
2326 
2327  if ( update02 && update06 ) {
2328 
2329  float val;
2330 
2331  val = 1.;
2332  if ( mean02 < amplitudeThresholdPnG01_ )
2333  val = 0.;
2334  if ( mean06 < pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
2335  pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean06)
2336  val = 0.;
2337  if ( rms06 > pedPnRMSThreshold_[0] )
2338  val = 0.;
2339 
2340  if ( meg06_[ism-1] ) meg06_[ism-1]->setBinContent(i, 1, val);
2341  if ( mepnprms02_[ism-1] ) mepnprms02_[ism-1]->Fill(rms06);
2342 
2343  }
2344 
2345  if ( update03 && update07 ) {
2346 
2347  float val;
2348 
2349  val = 1.;
2350  if ( mean03 < amplitudeThresholdPnG01_ )
2351  val = 0.;
2352  if ( mean07 < pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
2353  pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean07)
2354  val = 0.;
2355  if ( rms07 > pedPnRMSThreshold_[0] )
2356  val = 0.;
2357 
2358  if ( meg07_[ism-1] ) meg07_[ism-1]->setBinContent(i, 1, val);
2359  if ( mepnprms03_[ism-1] ) mepnprms03_[ism-1]->Fill(rms07);
2360 
2361  }
2362 
2363  if ( update04 && update08 ) {
2364 
2365  float val;
2366 
2367  val = 1.;
2368  if ( mean04 < amplitudeThresholdPnG01_ )
2369  val = 0.;
2370  if ( mean08 < pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
2371  pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean08)
2372  val = 0.;
2373  if ( rms08 > pedPnRMSThreshold_[0] )
2374  val = 0.;
2375 
2376  if ( meg08_[ism-1] ) meg08_[ism-1]->setBinContent(i, 1, val);
2377  if ( mepnprms04_[ism-1] ) mepnprms04_[ism-1]->Fill(rms08);
2378 
2379  }
2380 
2381  if ( update09 && update13 ) {
2382 
2383  float val;
2384 
2385  val = 1.;
2386  if ( mean09 < amplitudeThresholdPnG16_ )
2387  val = 0.;
2388  if ( mean13 < pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
2389  pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean13)
2390  val = 0.;
2391  if ( rms13 > pedPnRMSThreshold_[1] )
2392  val = 0.;
2393 
2394  if ( meg09_[ism-1] ) meg09_[ism-1]->setBinContent(i, 1, val);
2395  if ( mepnprms05_[ism-1] ) mepnprms05_[ism-1]->Fill(rms13);
2396 
2397  }
2398  else if(l1Data){
2399  if ( meg09_[ism-1] ) meg09_[ism-1]->setBinContent(i, 1, 0.);
2400  }
2401 
2402  if ( update10 && update14 ) {
2403 
2404  float val;
2405 
2406  val = 1.;
2407  if ( mean10 < amplitudeThresholdPnG16_ )
2408  val = 0.;
2409  // if ( mean14 < pedestalThresholdPn_ )
2410  if ( mean14 < pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
2411  pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean14)
2412  val = 0.;
2413  if ( rms14 > pedPnRMSThreshold_[1] )
2414  val = 0.;
2415 
2416  if ( meg10_[ism-1] ) meg10_[ism-1]->setBinContent(i, 1, val);
2417  if ( mepnprms06_[ism-1] ) mepnprms06_[ism-1]->Fill(rms14);
2418 
2419  }
2420  else if(l2Data){
2421  if ( meg10_[ism-1] ) meg10_[ism-1]->setBinContent(i, 1, 0.);
2422  }
2423 
2424  if ( update11 && update15 ) {
2425 
2426  float val;
2427 
2428  val = 1.;
2429  if ( mean11 < amplitudeThresholdPnG16_ )
2430  val = 0.;
2431  // if ( mean15 < pedestalThresholdPn_ )
2432  if ( mean15 < pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
2433  pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean15)
2434  val = 0.;
2435  if ( rms15 > pedPnRMSThreshold_[1] )
2436  val = 0.;
2437 
2438  if ( meg11_[ism-1] ) meg11_[ism-1]->setBinContent(i, 1, val);
2439  if ( mepnprms07_[ism-1] ) mepnprms07_[ism-1]->Fill(rms15);
2440 
2441  }
2442  else if(l3Data){
2443  if ( meg11_[ism-1] ) meg11_[ism-1]->setBinContent(i, 1, 0.);
2444  }
2445 
2446  if ( update12 && update16 ) {
2447 
2448  float val;
2449 
2450  val = 1.;
2451  if ( mean12 < amplitudeThresholdPnG16_ )
2452  val = 0.;
2453  // if ( mean16 < pedestalThresholdPn_ )
2454  if ( mean16 < pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
2455  pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean16)
2456  val = 0.;
2457  if ( rms16 > pedPnRMSThreshold_[1] )
2458  val = 0.;
2459 
2460  if ( meg12_[ism-1] ) meg12_[ism-1]->setBinContent(i, 1, val);
2461  if ( mepnprms08_[ism-1] ) mepnprms08_[ism-1]->Fill(rms16);
2462 
2463  }
2464  else if(l4Data){
2465  if ( meg12_[ism-1] ) meg12_[ism-1]->setBinContent(i, 1, 0.);
2466  }
2467 
2468  if ( Masks::maskPn(ism, i, bits01|bits03, EcalEndcap) ) {
2469  UtilsClient::maskBinContent( meg05_[ism-1], i, 1 );
2470  UtilsClient::maskBinContent( meg06_[ism-1], i, 1 );
2471  UtilsClient::maskBinContent( meg07_[ism-1], i, 1 );
2472  UtilsClient::maskBinContent( meg08_[ism-1], i, 1 );
2473  }
2474 
2475  if ( Masks::maskPn(ism, i, bits01|bits04, EcalEndcap) ) {
2476  UtilsClient::maskBinContent( meg09_[ism-1], i, 1 );
2477  UtilsClient::maskBinContent( meg10_[ism-1], i, 1 );
2478  UtilsClient::maskBinContent( meg11_[ism-1], i, 1 );
2479  UtilsClient::maskBinContent( meg12_[ism-1], i, 1 );
2480  }
2481 
2482  }
2483 
2484  for ( int i = 1; i <= 10; i++ ) {
2485 
2486  if ( hs01_[ism-1] ) {
2487  int ic = UtilsClient::getFirstNonEmptyChannel( hs01_[ism-1] );
2488  if ( me_hs01_[ism-1] ) {
2489  me_hs01_[ism-1]->setBinContent( i, hs01_[ism-1]->GetBinContent(ic, i) );
2490  me_hs01_[ism-1]->setBinError( i, hs01_[ism-1]->GetBinError(ic, i) );
2491  }
2492  }
2493 
2494  if ( hs02_[ism-1] ) {
2495  int ic = UtilsClient::getFirstNonEmptyChannel( hs02_[ism-1] );
2496  if ( me_hs02_[ism-1] ) {
2497  me_hs02_[ism-1]->setBinContent( i, hs02_[ism-1]->GetBinContent(ic, i) );
2498  me_hs02_[ism-1]->setBinError( i, hs02_[ism-1]->GetBinError(ic, i) );
2499  }
2500  }
2501 
2502  if ( hs03_[ism-1] ) {
2503  int ic = UtilsClient::getFirstNonEmptyChannel( hs03_[ism-1] );
2504  if ( me_hs03_[ism-1] ) {
2505  me_hs03_[ism-1]->setBinContent( i, hs03_[ism-1]->GetBinContent(ic, i) );
2506  me_hs03_[ism-1]->setBinError( i, hs03_[ism-1]->GetBinError(ic, i) );
2507  }
2508  }
2509 
2510  if ( hs04_[ism-1] ) {
2511  int ic = UtilsClient::getFirstNonEmptyChannel( hs04_[ism-1] );
2512  if ( me_hs04_[ism-1] ) {
2513  me_hs04_[ism-1]->setBinContent( i, hs04_[ism-1]->GetBinContent(ic, i) );
2514  me_hs04_[ism-1]->setBinError( i, hs04_[ism-1]->GetBinError(ic, i) );
2515  }
2516  }
2517 
2518  }
2519 
2520  }
2521 
2522 }
2523 
std::vector< int > laserWavelengths_
Definition: EELaserClient.h:89
MonitorElement * metrms03_[18]
Cache logicID vector from database.
float rmsThresholdRelative_
void setADCMeanG1(float mean)
Definition: MonPNBlueDat.h:21
std::vector< int > superModules_
Definition: EELaserClient.h:88
T getUntrackedParameter(std::string const &, T const &) const
TProfile * i11_[18]
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
void setADCRMSG16(float mean)
Definition: MonPNIRedDat.h:30
void setPedRMSG16(float mean)
Definition: MonPNIRedDat.h:42
TProfile2D * hs02_[18]
MonitorElement * met01_[18]
void setBinContent(int binx, double content)
set content of bin (1-D)
static const int LASER_MEAN_ERROR
static bool maskChannel(int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:60
MonitorElement * me_hs01_[18]
TProfile * i10_[18]
void beginJob(void)
BeginJob.
TProfile2D * h12_[18]
static unsigned icEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:739
TProfile * i12_[18]
TProfile2D * h02_[18]
Definition: EELaserClient.h:94
void setADCRMSG16(float mean)
Definition: MonPNBlueDat.h:30
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
EELaserClient(const edm::ParameterSet &ps)
Constructor.
MonitorElement * metav04_[18]
void setADCMeanG16(float mean)
Definition: MonPNBlueDat.h:27
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:91
void setAPDOverPNRMS(float rms)
TProfile * i06_[18]
Some &quot;id&quot; conversions.
void setAPDOverPNMean(float mean)
virtual ~EELaserClient()
Destructor.
MonitorElement * mepnprms03_[18]
void setAPDMean(float mean)
static const int LASER_TIMING_RMS_ERROR
static const int PEDESTAL_HIGH_GAIN_MEAN_ERROR
static bool getBinQuality(const MonitorElement *me, const int ix, const int iy)
Returns true if the bin quality is good or masked.
Definition: UtilsClient.cc:201
void setADCMeanG16(float mean)
Definition: MonPNIRedDat.h:27
void setADCMeanG1(float mean)
Definition: MonPNRedDat.h:21
MonitorElement * meg04_[18]
void setADCRMSG1(float mean)
Definition: MonPNRedDat.h:24
void setTaskStatus(bool status)
Definition: MonPNRedDat.h:45
TProfile * i07_[18]
MonitorElement * met02_[18]
#define abs(x)
Definition: mlp_lapack.h:159
void analyze(void)
Analyze.
TProfile2D * h11_[18]
MonitorElement * meg11_[18]
MonitorElement * mepnprms02_[18]
void setADCRMSG1(float mean)
Definition: MonPNGreenDat.h:24
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:773
MonitorElement * metav02_[18]
MonitorElement * met04_[18]
static const int PEDESTAL_LOW_GAIN_RMS_ERROR
void setPedRMSG16(float mean)
Definition: MonPNBlueDat.h:42
MonitorElement * mepnprms05_[18]
void setTimingMean(float mean)
Definition: ITimingDat.h:45
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
MonitorElement * meg12_[18]
static void maskBinContent(const MonitorElement *me, const int ix, const int iy)
Mask the bin content.
Definition: UtilsClient.cc:231
MonitorElement * meg09_[18]
void setTaskStatus(bool status)
Definition: MonPNBlueDat.h:45
MonitorElement * metav03_[18]
static const int PEDESTAL_HIGH_GAIN_RMS_ERROR
static bool maskPn(int ism, int i1, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:112
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:812
MonitorElement * me_hs02_[18]
void Fill(long long x)
static bool getBinStatus(const MonitorElement *me, const int ix, const int iy)
Returns true if the bin status is red/dark red.
Definition: UtilsClient.cc:216
MonitorElement * mea04_[18]
MonitorElement * me_hs04_[18]
MonitorElement * meaopn01_[18]
void endJob(void)
EndJob.
void setADCMeanG1(float mean)
Definition: MonPNIRedDat.h:21
TProfile * i03_[18]
MonitorElement * meaopn03_[18]
void setTaskStatus(bool status)
void setup(void)
Setup.
void setAPDMean(float mean)
float pedPnDiscrepancyMean_[2]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2577
channel masking
MonitorElement * metrms02_[18]
void setPedMeanG1(float mean)
Definition: MonPNBlueDat.h:33
TProfile * i02_[18]
void setAPDMean(float mean)
void setTaskStatus(bool status)
Definition: MonPNGreenDat.h:45
MonitorElement * meaopn04_[18]
MonitorElement * mepnprms08_[18]
void setPedRMSG1(float mean)
Definition: MonPNGreenDat.h:36
void setPedRMSG1(float mean)
Definition: MonPNBlueDat.h:36
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
void setPedRMSG1(float mean)
Definition: MonPNRedDat.h:36
float pedPnRMSThreshold_[2]
float amplitudeThresholdPnG16_
void setEntries(double nentries)
set # of entries
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
MonitorElement * mea03_[18]
void setADCMeanG1(float mean)
Definition: MonPNGreenDat.h:21
MonitorElement * meg03_[18]
void setADCRMSG1(float mean)
Definition: MonPNIRedDat.h:24
void setPedRMSG1(float mean)
Definition: MonPNIRedDat.h:36
void setADCRMSG1(float mean)
Definition: MonPNBlueDat.h:24
TProfile * i01_[18]
void setTaskStatus(bool status)
MonitorElement * mepnprms06_[18]
void setAPDRMS(float rms)
MonitorElement * mea01_[18]
void setPedRMSG16(float mean)
Definition: MonPNRedDat.h:42
float pedPnExpectedMean_[2]
TProfile2D * h05_[18]
Definition: EELaserClient.h:97
float amplitudeThreshold_
TProfile2D * hs01_[18]
MonitorElement * meg08_[18]
MonitorElement * mepnprms04_[18]
void setADCRMSG16(float mean)
Definition: MonPNGreenDat.h:30
void setAPDOverPNRMS(float rms)
void setAPDRMS(float rms)
Ecal Monitor Utils for Client.
MonitorElement * me_hs03_[18]
static const int PEDESTAL_LOW_GAIN_MEAN_ERROR
TProfile * i15_[18]
void setTaskStatus(bool status)
Definition: ITimingDat.h:51
static bool getBinStatistics(TH1 *histo, const int ix, const int iy, float &num, float &mean, float &rms, float minEntries=1.)
Returns true if the bin contains good statistical data.
Definition: UtilsClient.cc:74
void setAPDOverPNRMS(float rms)
void endRun(void)
EndRun.
MonitorElement * meg07_[18]
MonitorElement * mea02_[18]
DQMStore * dqmStore_
Definition: EELaserClient.h:91
TProfile2D * h06_[18]
Definition: EELaserClient.h:98
void cleanup(void)
Cleanup.
void setAPDOverPNMean(float mean)
TProfile * i08_[18]
MonitorElement * meg02_[18]
void setTimingRMS(float rms)
Definition: ITimingDat.h:48
void setADCMeanG16(float mean)
Definition: MonPNRedDat.h:27
TProfile2D * hs03_[18]
std::string prefixME_
Definition: EELaserClient.h:84
TProfile * i16_[18]
TProfile2D * h03_[18]
Definition: EELaserClient.h:95
TProfile2D * h09_[18]
void setADCMeanG16(float mean)
Definition: MonPNGreenDat.h:27
void setTaskStatus(bool status)
void setPedMeanG16(float mean)
Definition: MonPNRedDat.h:39
void setAPDOverPNRMS(float rms)
TProfile * i05_[18]
TProfile2D * h10_[18]
void setTaskStatus(bool status)
static const int LASER_TIMING_MEAN_ERROR
void setPedMeanG1(float mean)
Definition: MonPNGreenDat.h:33
TProfile2D * h01_[18]
Definition: EELaserClient.h:93
void beginRun(void)
BeginRun.
MonitorElement * meg10_[18]
void setAPDOverPNMean(float mean)
void setAPDRMS(float rms)
MonitorElement * metrms04_[18]
void setPedMeanG16(float mean)
Definition: MonPNBlueDat.h:39
TProfile2D * h07_[18]
Definition: EELaserClient.h:99
MonitorElement * metav01_[18]
static unsigned indexEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:712
MonitorElement * meg06_[18]
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:246
void setPedMeanG1(float mean)
Definition: MonPNIRedDat.h:33
MonitorElement * metrms01_[18]
TProfile * i14_[18]
MonitorElement * mepnprms01_[18]
void setPedRMSG16(float mean)
Definition: MonPNGreenDat.h:42
TProfile2D * h08_[18]
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
TProfile * i13_[18]
tuple cout
Definition: gather_cfg.py:121
float percentVariation_
void setPedMeanG16(float mean)
Definition: MonPNIRedDat.h:39
TProfile2D * h04_[18]
Definition: EELaserClient.h:96
void setTaskStatus(bool status)
Definition: MonPNIRedDat.h:45
MonitorElement * met03_[18]
void setAPDMean(float mean)
tuple status
Definition: ntuplemaker.py:245
void setADCRMSG16(float mean)
Definition: MonPNRedDat.h:30
static const int LASER_RMS_ERROR
MonitorElement * meaopn02_[18]
TProfile * i09_[18]
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:850
static EcalLogicID getEcalLogicID(const char *name, const int id1=EcalLogicID::NULLID, const int id2=EcalLogicID::NULLID, const int id3=EcalLogicID::NULLID)
Definition: LogicID.h:31
void setAPDOverPNMean(float mean)
Definition: RunIOV.h:13
float amplitudeThresholdPnG01_
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
MonitorElement * meg05_[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)
TProfile * i04_[18]
void setPedMeanG1(float mean)
Definition: MonPNRedDat.h:33
static void printBadChannels(const MonitorElement *me, TH1 *hi, bool positive_only=false)
Print the bad channels.
Definition: UtilsClient.cc:14
void setAPDRMS(float rms)
MonitorElement * mepnprms07_[18]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
static int getFirstNonEmptyChannel(const TProfile2D *histo)
Find the first non empty bin.
Definition: UtilsClient.cc:246
void setPedMeanG16(float mean)
Definition: MonPNGreenDat.h:39
TProfile2D * hs04_[18]
MonitorElement * meg01_[18]