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