CMS 3D CMS Logo

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