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