CMS 3D CMS Logo

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