CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EBPedestalClient.cc
Go to the documentation of this file.
1 /*
2  * \file EBPedestalClient.cc
3  *
4  * $Date: 2012/04/27 13:45:59 $
5  * $Revision: 1.233 $
6  * \author G. Della Ricca
7  * \author F. Cossutti
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
30 #endif
31 
33 
36 
38 
39 // #define COMMON_NOISE_ANALYSIS
40 
42 
43  // cloneME switch
44  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
45 
46  // verbose switch
47  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
48 
49  // debug switch
50  debug_ = ps.getUntrackedParameter<bool>("debug", false);
51 
52  // prefixME path
53  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
54 
55  // enableCleanup_ switch
56  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
57 
58  // vector of selected Super Modules (Defaults to all 36).
59  superModules_.reserve(36);
60  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
61  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
62 
63  MGPAGains_.reserve(3);
64  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
65  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
66 
67  MGPAGainsPN_.reserve(2);
68  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
69  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
70 
71  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
72 
73  int ism = superModules_[i];
74 
75  h01_[ism-1] = 0;
76  h02_[ism-1] = 0;
77  h03_[ism-1] = 0;
78 
79  j01_[ism-1] = 0;
80  j02_[ism-1] = 0;
81  j03_[ism-1] = 0;
82 
83  k01_[ism-1] = 0;
84  k02_[ism-1] = 0;
85  k03_[ism-1] = 0;
86 
87  i01_[ism-1] = 0;
88  i02_[ism-1] = 0;
89 
90  }
91 
92  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
93 
94  int ism = superModules_[i];
95 
96  meg01_[ism-1] = 0;
97  meg02_[ism-1] = 0;
98  meg03_[ism-1] = 0;
99 
100  meg04_[ism-1] = 0;
101  meg05_[ism-1] = 0;
102 
103  mep01_[ism-1] = 0;
104  mep02_[ism-1] = 0;
105  mep03_[ism-1] = 0;
106 
107  mer01_[ism-1] = 0;
108  mer02_[ism-1] = 0;
109  mer03_[ism-1] = 0;
110 
111  mer04_[ism-1] = 0;
112  mer05_[ism-1] = 0;
113 
114 #ifdef COMMON_NOISE_ANALYSIS
115  mes01_[ism-1] = 0;
116  mes02_[ism-1] = 0;
117  mes03_[ism-1] = 0;
118 
119  met01_[ism-1] = 0;
120  met02_[ism-1] = 0;
121  met03_[ism-1] = 0;
122 #endif
123 
124  }
125 
126  expectedMean_[0] = 200.0;
127  expectedMean_[1] = 200.0;
128  expectedMean_[2] = 200.0;
129 
130  discrepancyMean_[0] = 25.0;
131  discrepancyMean_[1] = 25.0;
132  discrepancyMean_[2] = 25.0;
133 
134  RMSThreshold_[0] = 1.0;
135  RMSThreshold_[1] = 1.2;
136  RMSThreshold_[2] = 2.0;
137 
138  expectedMeanPn_[0] = 750.0;
139  expectedMeanPn_[1] = 750.0;
140 
141  discrepancyMeanPn_[0] = 100.0;
142  discrepancyMeanPn_[1] = 100.0;
143 
144  RMSThresholdPn_[0] = 999.;
145  RMSThresholdPn_[1] = 999.;
146 
147 }
148 
150 
151 }
152 
154 
156 
157  if ( debug_ ) std::cout << "EBPedestalClient: beginJob" << std::endl;
158 
159  ievt_ = 0;
160  jevt_ = 0;
161 
162 }
163 
165 
166  if ( debug_ ) std::cout << "EBPedestalClient: beginRun" << std::endl;
167 
168  jevt_ = 0;
169 
170  this->setup();
171 
172 }
173 
175 
176  if ( debug_ ) std::cout << "EBPedestalClient: endJob, ievt = " << ievt_ << std::endl;
177 
178  this->cleanup();
179 
180 }
181 
183 
184  if ( debug_ ) std::cout << "EBPedestalClient: endRun, jevt = " << jevt_ << std::endl;
185 
186  this->cleanup();
187 
188 }
189 
191 
192  std::string name;
193 
194  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalClient" );
195 
196  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
197 
198  int ism = superModules_[i];
199 
200  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
201  if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
202  name = "EBPT pedestal quality G01 " + Numbers::sEB(ism);
203  meg01_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
204  meg01_[ism-1]->setAxisTitle("ieta", 1);
205  meg01_[ism-1]->setAxisTitle("iphi", 2);
206  }
207  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
208  if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
209  name = "EBPT pedestal quality G06 " + Numbers::sEB(ism);
210  meg02_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
211  meg02_[ism-1]->setAxisTitle("ieta", 1);
212  meg02_[ism-1]->setAxisTitle("iphi", 2);
213  }
214  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
215  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
216  name = "EBPT pedestal quality G12 " + Numbers::sEB(ism);
217  meg03_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
218  meg03_[ism-1]->setAxisTitle("ieta", 1);
219  meg03_[ism-1]->setAxisTitle("iphi", 2);
220  }
221 
222  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
223  if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
224  name = "EBPT pedestal quality PNs G01 " + Numbers::sEB(ism);
225  meg04_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
226  meg04_[ism-1]->setAxisTitle("pseudo-strip", 1);
227  meg04_[ism-1]->setAxisTitle("channel", 2);
228  }
229  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
230  if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
231  name = "EBPT pedestal quality PNs G16 " + Numbers::sEB(ism);
232  meg05_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
233  meg05_[ism-1]->setAxisTitle("pseudo-strip", 1);
234  meg05_[ism-1]->setAxisTitle("channel", 2);
235  }
236 
237  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
238  if ( mep01_[ism-1] ) dqmStore_->removeElement( mep01_[ism-1]->getName() );
239  name = "EBPT pedestal mean G01 " + Numbers::sEB(ism);
240  mep01_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
241  mep01_[ism-1]->setAxisTitle("mean", 1);
242  }
243  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
244  if ( mep02_[ism-1] ) dqmStore_->removeElement( mep02_[ism-1]->getName() );
245  name = "EBPT pedestal mean G06 " + Numbers::sEB(ism);
246  mep02_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
247  mep02_[ism-1]->setAxisTitle("mean", 1);
248  }
249  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
250  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
251  name = "EBPT pedestal mean G12 " + Numbers::sEB(ism);
252  mep03_[ism-1] = dqmStore_->book1D(name, name, 100, 150., 250.);
253  mep03_[ism-1]->setAxisTitle("mean", 1);
254  }
255 
256  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
257  if ( mer01_[ism-1] ) dqmStore_->removeElement( mer01_[ism-1]->getName() );
258  name = "EBPT pedestal rms G01 " + Numbers::sEB(ism);
259  mer01_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
260  mer01_[ism-1]->setAxisTitle("rms", 1);
261  }
262  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
263  if ( mer02_[ism-1] ) dqmStore_->removeElement( mer02_[ism-1]->getName() );
264  name = "EBPT pedestal rms G06 " + Numbers::sEB(ism);
265  mer02_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
266  mer02_[ism-1]->setAxisTitle("rms", 1);
267  }
268  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
269  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
270  name = "EBPT pedestal rms G12 " + Numbers::sEB(ism);
271  mer03_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
272  mer03_[ism-1]->setAxisTitle("rms", 1);
273  }
274 
275  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
276  if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
277  name = "EBPDT PNs pedestal rms " + Numbers::sEB(ism) + " G01";
278  mer04_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
279  mer04_[ism-1]->setAxisTitle("rms", 1);
280  }
281  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
282  if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
283  name = "EBPDT PNs pedestal rms " + Numbers::sEB(ism) + " G16";
284  mer05_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
285  mer05_[ism-1]->setAxisTitle("rms", 1);
286  }
287 
288 #ifdef COMMON_NOISE_ANALYSIS
289  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
290  if ( mes01_[ism-1] ) dqmStore_->removeElement( mes01_[ism-1]->getName() );
291  name = "EBPT pedestal 3sum G01 " + Numbers::sEB(ism);
292  mes01_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
293  mes01_[ism-1]->setAxisTitle("ieta", 1);
294  mes01_[ism-1]->setAxisTitle("iphi", 2);
295  }
296  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
297  if ( mes02_[ism-1] ) dqmStore_->removeElement( mes02_[ism-1]->getName() );
298  name = "EBPT pedestal 3sum G06 " + Numbers::sEB(ism);
299  mes02_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
300  mes02_[ism-1]->setAxisTitle("ieta", 1);
301  mes02_[ism-1]->setAxisTitle("iphi", 2);
302  }
303  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
304  if ( mes03_[ism-1] ) dqmStore_->removeElement( mes03_[ism-1]->getName() );
305  name = "EBPT pedestal 3sum G12 " + Numbers::sEB(ism);
306  mes03_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
307  mes03_[ism-1]->setAxisTitle("ieta", 1);
308  mes03_[ism-1]->setAxisTitle("iphi", 2);
309  }
310 
311  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
312  if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
313  name = "EBPT pedestal 5sum G01 " + Numbers::sEB(ism);
314  met01_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
315  met01_[ism-1]->setAxisTitle("ieta", 1);
316  met01_[ism-1]->setAxisTitle("iphi", 2);
317  }
318  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
319  if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
320  name = "EBPT pedestal 5sum G06 " + Numbers::sEB(ism);
321  met02_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
322  met02_[ism-1]->setAxisTitle("ieta", 1);
323  met02_[ism-1]->setAxisTitle("iphi", 2);
324  }
325  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
326  if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
327  name = "EBPT pedestal 5sum G12 " + Numbers::sEB(ism);
328  met03_[ism-1] = dqmStore_->book2D(name, name, 85, 0., 85., 20, 0., 20.);
329  met03_[ism-1]->setAxisTitle("ieta", 1);
330  met03_[ism-1]->setAxisTitle("iphi", 2);
331  }
332 #endif
333 
334  }
335 
336  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
337 
338  int ism = superModules_[i];
339 
340  if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
341  if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
342  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
343 
344  if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
345  if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
346 
347  for ( int ie = 1; ie <= 85; ie++ ) {
348  for ( int ip = 1; ip <= 20; ip++ ) {
349 
350  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ie, ip, 2. );
351  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ie, ip, 2. );
352  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ie, ip, 2. );
353 
354  }
355  }
356 
357  for ( int i = 1; i <= 10; i++ ) {
358 
359  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
360  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
361 
362  }
363 
364  if ( mep01_[ism-1] ) mep01_[ism-1]->Reset();
365  if ( mep02_[ism-1] ) mep02_[ism-1]->Reset();
366  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
367 
368  if ( mer01_[ism-1] ) mer01_[ism-1]->Reset();
369  if ( mer02_[ism-1] ) mer02_[ism-1]->Reset();
370  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
371 
372  if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
373  if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();
374 
375 #ifdef COMMON_NOISE_ANALYSIS
376  if ( mes01_[ism-1] ) mes01_[ism-1]->Reset();
377  if ( mes02_[ism-1] ) mes02_[ism-1]->Reset();
378  if ( mes03_[ism-1] ) mes03_[ism-1]->Reset();
379 
380  if ( met01_[ism-1] ) met01_[ism-1]->Reset();
381  if ( met02_[ism-1] ) met02_[ism-1]->Reset();
382  if ( met03_[ism-1] ) met03_[ism-1]->Reset();
383 
384  for ( int ie = 1; ie <= 85; ie++ ) {
385  for ( int ip = 1; ip <= 20; ip++ ) {
386 
387  if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent( ie, ip, -999. );
388  if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent( ie, ip, -999. );
389  if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent( ie, ip, -999. );
390 
391  if ( met01_[ism-1] ) met01_[ism-1]->setBinContent( ie, ip, -999. );
392  if ( met02_[ism-1] ) met02_[ism-1]->setBinContent( ie, ip, -999. );
393  if ( met03_[ism-1] ) met03_[ism-1]->setBinContent( ie, ip, -999. );
394 
395  }
396  }
397 #endif
398 
399  }
400 
401 }
402 
404 
405  if ( ! enableCleanup_ ) return;
406 
407  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
408 
409  int ism = superModules_[i];
410 
411  if ( cloneME_ ) {
412  if ( h01_[ism-1] ) delete h01_[ism-1];
413  if ( h02_[ism-1] ) delete h02_[ism-1];
414  if ( h03_[ism-1] ) delete h03_[ism-1];
415 
416  if ( j01_[ism-1] ) delete j01_[ism-1];
417  if ( j02_[ism-1] ) delete j02_[ism-1];
418  if ( j03_[ism-1] ) delete j03_[ism-1];
419 
420  if ( k01_[ism-1] ) delete k01_[ism-1];
421  if ( k02_[ism-1] ) delete k02_[ism-1];
422  if ( k03_[ism-1] ) delete k03_[ism-1];
423 
424  if ( i01_[ism-1] ) delete i01_[ism-1];
425  if ( i02_[ism-1] ) delete i02_[ism-1];
426  }
427 
428  h01_[ism-1] = 0;
429  h02_[ism-1] = 0;
430  h03_[ism-1] = 0;
431 
432  j01_[ism-1] = 0;
433  j02_[ism-1] = 0;
434  j03_[ism-1] = 0;
435 
436  k01_[ism-1] = 0;
437  k02_[ism-1] = 0;
438  k03_[ism-1] = 0;
439 
440  i01_[ism-1] = 0;
441  i02_[ism-1] = 0;
442 
443  }
444 
445  dqmStore_->setCurrentFolder( prefixME_ + "/EBPedestalClient" );
446 
447  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
448 
449  int ism = superModules_[i];
450 
451  if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
452  meg01_[ism-1] = 0;
453  if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
454  meg02_[ism-1] = 0;
455  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
456  meg03_[ism-1] = 0;
457 
458  if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
459  meg04_[ism-1] = 0;
460  if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
461  meg05_[ism-1] = 0;
462 
463  if ( mep01_[ism-1] ) dqmStore_->removeElement( mep01_[ism-1]->getName() );
464  mep01_[ism-1] = 0;
465  if ( mep02_[ism-1] ) dqmStore_->removeElement( mep02_[ism-1]->getName() );
466  mep02_[ism-1] = 0;
467  if ( mep03_[ism-1] ) dqmStore_->removeElement( mep03_[ism-1]->getName() );
468  mep03_[ism-1] = 0;
469 
470  if ( mer01_[ism-1] ) dqmStore_->removeElement( mer01_[ism-1]->getName() );
471  mer01_[ism-1] = 0;
472  if ( mer02_[ism-1] ) dqmStore_->removeElement( mer02_[ism-1]->getName() );
473  mer02_[ism-1] = 0;
474  if ( mer03_[ism-1] ) dqmStore_->removeElement( mer03_[ism-1]->getName() );
475  mer03_[ism-1] = 0;
476 
477  if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
478  mer04_[ism-1] = 0;
479  if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
480  mer05_[ism-1] = 0;
481 
482 #ifdef COMMON_NOISE_ANALYSIS
483  if ( mes01_[ism-1] ) dqmStore_->removeElement( mes01_[ism-1]->getName() );
484  mes01_[ism-1] = 0;
485  if ( mes02_[ism-1] ) dqmStore_->removeElement( mes02_[ism-1]->getName() );
486  mes02_[ism-1] = 0;
487  if ( mes03_[ism-1] ) dqmStore_->removeElement( mes03_[ism-1]->getName() );
488  mes03_[ism-1] = 0;
489 
490  if ( met01_[ism-1] ) dqmStore_->removeElement( met01_[ism-1]->getName() );
491  met01_[ism-1] = 0;
492  if ( met02_[ism-1] ) dqmStore_->removeElement( met02_[ism-1]->getName() );
493  met02_[ism-1] = 0;
494  if ( met03_[ism-1] ) dqmStore_->removeElement( met03_[ism-1]->getName() );
495  met03_[ism-1] = 0;
496 #endif
497 
498  }
499 
500 }
501 
502 #ifdef WITH_ECAL_COND_DB
503 bool EBPedestalClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
504 
505  status = true;
506 
507  EcalLogicID ecid;
508 
510  std::map<EcalLogicID, MonPedestalsDat> dataset1;
511 
512  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
513 
514  int ism = superModules_[i];
515 
516  if ( verbose_ ) {
517  std::cout << " " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
518  std::cout << std::endl;
519  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
520  UtilsClient::printBadChannels(meg01_[ism-1], h01_[ism-1]);
521  }
522  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
523  UtilsClient::printBadChannels(meg02_[ism-1], h02_[ism-1]);
524  }
525  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
526  UtilsClient::printBadChannels(meg03_[ism-1], h03_[ism-1]);
527  }
528  }
529 
530  for ( int ie = 1; ie <= 85; ie++ ) {
531  for ( int ip = 1; ip <= 20; ip++ ) {
532 
533  bool update01;
534  bool update02;
535  bool update03;
536 
537  float num01, num02, num03;
538  float mean01, mean02, mean03;
539  float rms01, rms02, rms03;
540 
541  update01 = UtilsClient::getBinStatistics(h01_[ism-1], ie, ip, num01, mean01, rms01);
542  update02 = UtilsClient::getBinStatistics(h02_[ism-1], ie, ip, num02, mean02, rms02);
543  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);
544 
545  if ( update01 || update02 || update03 ) {
546 
547  if ( Numbers::icEB(ism, ie, ip) == 1 ) {
548 
549  if ( verbose_ ) {
550  std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
551  std::cout << "G01 (" << ie << "," << ip << ") " << num01 << " " << mean01 << " " << rms01 << std::endl;
552  std::cout << "G06 (" << ie << "," << ip << ") " << num02 << " " << mean02 << " " << rms02 << std::endl;
553  std::cout << "G12 (" << ie << "," << ip << ") " << num03 << " " << mean03 << " " << rms03 << std::endl;
554  std::cout << std::endl;
555  }
556 
557  }
558 
559  p.setPedMeanG1(mean01);
560  p.setPedRMSG1(rms01);
561 
562  p.setPedMeanG6(mean02);
563  p.setPedRMSG6(rms02);
564 
565  p.setPedMeanG12(mean03);
566  p.setPedRMSG12(rms03);
567 
568  if ( UtilsClient::getBinStatus(meg01_[ism-1], ie, ip) &&
569  UtilsClient::getBinStatus(meg02_[ism-1], ie, ip) &&
570  UtilsClient::getBinStatus(meg03_[ism-1], ie, ip) ) {
571  p.setTaskStatus(true);
572  } else {
573  p.setTaskStatus(false);
574  }
575 
576  status = status && UtilsClient::getBinQuality(meg01_[ism-1], ie, ip) &&
577  UtilsClient::getBinQuality(meg02_[ism-1], ie, ip) &&
578  UtilsClient::getBinQuality(meg03_[ism-1], ie, ip);
579 
580  int ic = Numbers::indexEB(ism, ie, ip);
581 
582  if ( econn ) {
583  ecid = LogicID::getEcalLogicID("EB_crystal_number", Numbers::iSM(ism, EcalBarrel), ic);
584  dataset1[ecid] = p;
585  }
586 
587  }
588 
589  }
590  }
591 
592  }
593 
594  if ( econn ) {
595  try {
596  if ( verbose_ ) std::cout << "Inserting MonPedestalsDat ..." << std::endl;
597  if ( dataset1.size() != 0 ) econn->insertDataArraySet(&dataset1, moniov);
598  if ( verbose_ ) std::cout << "done." << std::endl;
599  } catch (std::runtime_error &e) {
600  std::cerr << e.what() << std::endl;
601  }
602  }
603 
604  if ( verbose_ ) std::cout << std::endl;
605 
606  MonPNPedDat pn;
607  std::map<EcalLogicID, MonPNPedDat> dataset2;
608 
609  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
610 
611  int ism = superModules_[i];
612 
613  if ( verbose_ ) {
614  std::cout << " " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
615  std::cout << std::endl;
616  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
617  UtilsClient::printBadChannels(meg04_[ism-1], i01_[ism-1]);
618  }
619  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
620  UtilsClient::printBadChannels(meg05_[ism-1], i02_[ism-1]);
621  }
622  }
623 
624  for ( int i = 1; i <= 10; i++ ) {
625 
626  bool update01;
627  bool update02;
628 
629  float num01, num02;
630  float mean01, mean02;
631  float rms01, rms02;
632 
633  update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
634  update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
635 
636  if ( update01 || update02 ) {
637 
638  if ( i == 1 ) {
639 
640  if ( verbose_ ) {
641  std::cout << "Preparing dataset for " << Numbers::sEB(ism) << " (ism=" << ism << ")" << std::endl;
642  std::cout << "PNs (" << i << ") G01 " << num01 << " " << mean01 << " " << rms01 << std::endl;
643  std::cout << "PNs (" << i << ") G16 " << num01 << " " << mean01 << " " << rms01 << std::endl;
644  std::cout << std::endl;
645  }
646 
647  }
648 
649  pn.setPedMeanG1(mean01);
650  pn.setPedRMSG1(rms01);
651 
652  pn.setPedMeanG16(mean02);
653  pn.setPedRMSG16(rms02);
654 
655  if ( UtilsClient::getBinStatus(meg04_[ism-1], i, 1) &&
656  UtilsClient::getBinStatus(meg05_[ism-1], i, 1) ) {
657  pn.setTaskStatus(true);
658  } else {
659  pn.setTaskStatus(false);
660  }
661 
662  status = status && UtilsClient::getBinQuality(meg04_[ism-1], i, 1) &&
663  UtilsClient::getBinQuality(meg05_[ism-1], i, 1);
664 
665  if ( econn ) {
666  ecid = LogicID::getEcalLogicID("EB_LM_PN", Numbers::iSM(ism, EcalBarrel), i-1);
667  dataset2[ecid] = pn;
668  }
669 
670  }
671 
672  }
673 
674  }
675 
676  if ( econn ) {
677  try {
678  if ( verbose_ ) std::cout << "Inserting MonPNPedDat ..." << std::endl;
679  if ( dataset2.size() != 0 ) econn->insertDataArraySet(&dataset2, moniov);
680  if ( verbose_ ) std::cout << "done." << std::endl;
681  } catch (std::runtime_error &e) {
682  std::cerr << e.what() << std::endl;
683  }
684  }
685 
686  return true;
687 
688 }
689 #endif
690 
692 
693  ievt_++;
694  jevt_++;
695  if ( ievt_ % 10 == 0 ) {
696  if ( debug_ ) std::cout << "EBPedestalClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
697  }
698 
699  uint32_t bits01 = 0;
702 
703  uint32_t bits02 = 0;
706 
707  uint32_t bits03 = 0;
710 
711  MonitorElement* me;
712 
713  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
714 
715  int ism = superModules_[i];
716 
717  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
718 
719  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain01/EBPT pedestal " + Numbers::sEB(ism) + " G01");
720  h01_[ism-1] = UtilsClient::getHisto( me, cloneME_, h01_[ism-1] );
721 
722  }
723 
724  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
725 
726  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain06/EBPT pedestal " + Numbers::sEB(ism) + " G06");
727  h02_[ism-1] = UtilsClient::getHisto( me, cloneME_, h02_[ism-1] );
728 
729  }
730 
731  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
732 
733  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain12/EBPT pedestal " + Numbers::sEB(ism) + " G12");
734  h03_[ism-1] = UtilsClient::getHisto( me, cloneME_, h03_[ism-1] );
735 
736  }
737 
738 #ifdef COMMON_NOISE_ANALYSIS
739  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
740 
741  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain01/EBPT pedestal 3sum " + Numbers::sEB(ism) + " G01");
742  j01_[ism-1] = UtilsClient::getHisto( me, cloneME_, j01_[ism-1] );
743 
744  }
745 
746  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
747 
748  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain06/EBPT pedestal 3sum " + Numbers::sEB(ism) + " G06");
749  j02_[ism-1] = UtilsClient::getHisto( me, cloneME_, j02_[ism-1] );
750 
751  }
752 
753  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
754 
755  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain12/EBPT pedestal 3sum " + Numbers::sEB(ism) + " G12");
756  j03_[ism-1] = UtilsClient::getHisto( me, cloneME_, j03_[ism-1] );
757 
758  }
759 
760  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
761 
762  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain01/EBPT pedestal 5sum " + Numbers::sEB(ism) + " G01");
763  k01_[ism-1] = UtilsClient::getHisto( me, cloneME_, k01_[ism-1] );
764 
765  }
766 
767  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
768 
769  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain06/EBPT pedestal 5sum " + Numbers::sEB(ism) + " G06");
770  k02_[ism-1] = UtilsClient::getHisto( me, cloneME_, k02_[ism-1] );
771 
772  }
773 
774  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
775 
776  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/Gain12/EBPT pedestal 5sum " + Numbers::sEB(ism) + " G12");
777  k03_[ism-1] = UtilsClient::getHisto( me, cloneME_, k03_[ism-1] );
778 
779  }
780 #endif
781 
782  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
783 
784  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/PN/Gain01/EBPDT PNs pedestal " + Numbers::sEB(ism) + " G01");
785  i01_[ism-1] = UtilsClient::getHisto( me, cloneME_, i01_[ism-1] );
786 
787  }
788 
789  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
790 
791  me = dqmStore_->get(prefixME_ + "/EBPedestalTask/PN/Gain16/EBPDT PNs pedestal " + Numbers::sEB(ism) + " G16");
792  i02_[ism-1] = UtilsClient::getHisto( me, cloneME_, i02_[ism-1] );
793 
794  }
795 
796  if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
797  if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
798  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
799 
800  if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
801  if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
802 
803  if ( mep01_[ism-1] ) mep01_[ism-1]->Reset();
804  if ( mep02_[ism-1] ) mep02_[ism-1]->Reset();
805  if ( mep03_[ism-1] ) mep03_[ism-1]->Reset();
806 
807  if ( mer01_[ism-1] ) mer01_[ism-1]->Reset();
808  if ( mer02_[ism-1] ) mer02_[ism-1]->Reset();
809  if ( mer03_[ism-1] ) mer03_[ism-1]->Reset();
810 
811  if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
812  if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();
813 
814 #ifdef COMMON_NOISE_ANALYSIS
815  if ( mes01_[ism-1] ) mes01_[ism-1]->Reset();
816  if ( mes02_[ism-1] ) mes02_[ism-1]->Reset();
817  if ( mes03_[ism-1] ) mes03_[ism-1]->Reset();
818 
819  if ( met01_[ism-1] ) met01_[ism-1]->Reset();
820  if ( met02_[ism-1] ) met02_[ism-1]->Reset();
821  if ( met03_[ism-1] ) met03_[ism-1]->Reset();
822 #endif
823 
824  for ( int ie = 1; ie <= 85; ie++ ) {
825  for ( int ip = 1; ip <= 20; ip++ ) {
826 
827  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent(ie, ip, 2.);
828  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent(ie, ip, 2.);
829  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, 2.);
830 
831  bool update01;
832  bool update02;
833  bool update03;
834 
835  float num01, num02, num03;
836  float mean01, mean02, mean03;
837  float rms01, rms02, rms03;
838 
839  update01 = UtilsClient::getBinStatistics(h01_[ism-1], ie, ip, num01, mean01, rms01);
840  update02 = UtilsClient::getBinStatistics(h02_[ism-1], ie, ip, num02, mean02, rms02);
841  update03 = UtilsClient::getBinStatistics(h03_[ism-1], ie, ip, num03, mean03, rms03);
842 
843  if ( update01 ) {
844 
845  float val;
846 
847  val = 1.;
848  if ( std::abs(mean01 - expectedMean_[0]) > discrepancyMean_[0] )
849  val = 0.;
850  if ( rms01 > RMSThreshold_[0] )
851  val = 0.;
852  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent(ie, ip, val);
853 
854  if ( mep01_[ism-1] ) mep01_[ism-1]->Fill(mean01);
855  if ( mer01_[ism-1] ) mer01_[ism-1]->Fill(rms01);
856 
857  }
858 
859  if ( update02 ) {
860 
861  float val;
862 
863  val = 1.;
864  if ( std::abs(mean02 - expectedMean_[1]) > discrepancyMean_[1] )
865  val = 0.;
866  if ( rms02 > RMSThreshold_[1] )
867  val = 0.;
868  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent(ie, ip, val);
869 
870  if ( mep02_[ism-1] ) mep02_[ism-1]->Fill(mean02);
871  if ( mer02_[ism-1] ) mer02_[ism-1]->Fill(rms02);
872 
873  }
874 
875  if ( update03 ) {
876 
877  float val;
878 
879  val = 1.;
880  if ( std::abs(mean03 - expectedMean_[2]) > discrepancyMean_[2] )
881  val = 0.;
882  if ( rms03 > RMSThreshold_[2] )
883  val = 0.;
884  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent(ie, ip, val);
885 
886  if ( mep03_[ism-1] ) mep03_[ism-1]->Fill(mean03);
887  if ( mer03_[ism-1] ) mer03_[ism-1]->Fill(rms03);
888 
889  }
890 
891  if ( Masks::maskChannel(ism, ie, ip, bits01, EcalBarrel) ) UtilsClient::maskBinContent( meg01_[ism-1], ie, ip );
892  if ( Masks::maskChannel(ism, ie, ip, bits02, EcalBarrel) ) UtilsClient::maskBinContent( meg02_[ism-1], ie, ip );
893  if ( Masks::maskChannel(ism, ie, ip, bits03, EcalBarrel) ) UtilsClient::maskBinContent( meg03_[ism-1], ie, ip );
894 
895  }
896  }
897 
898  // PN diodes
899 
900  for ( int i = 1; i <= 10; i++ ) {
901 
902  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
903  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
904 
905  bool update01;
906  bool update02;
907 
908  float num01, num02;
909  float mean01, mean02;
910  float rms01, rms02;
911 
912  update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
913  update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
914 
915  // filling projections
916  if ( mer04_[ism-1] ) mer04_[ism-1]->Fill(rms01);
917  if ( mer05_[ism-1] ) mer05_[ism-1]->Fill(rms02);
918 
919  if ( update01 ) {
920 
921  float val;
922 
923  val = 1.;
924  if ( mean01 < (expectedMeanPn_[0] - discrepancyMeanPn_[0])
925  || (expectedMeanPn_[0] + discrepancyMeanPn_[0]) < mean01)
926  val = 0.;
927  if ( rms01 > RMSThresholdPn_[0])
928  val = 0.;
929 
930  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent(i, 1, val);
931 
932  }
933 
934  if ( update02 ) {
935 
936  float val;
937 
938  val = 1.;
939  if ( mean02 < (expectedMeanPn_[1] - discrepancyMeanPn_[1])
940  || (expectedMeanPn_[1] + discrepancyMeanPn_[1]) < mean02)
941  val = 0.;
942  if ( rms02 > RMSThresholdPn_[1])
943  val = 0.;
944 
945  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent(i, 1, val);
946  }
947 
948  if ( Masks::maskPn(ism, i, bits01, EcalBarrel) ) UtilsClient::maskBinContent( meg04_[ism-1], i, 1 );
949  if ( Masks::maskPn(ism, i, bits03, EcalBarrel) ) UtilsClient::maskBinContent( meg05_[ism-1], i, 1 );
950 
951  }
952 
953 #ifdef COMMON_NOISE_ANALYSIS
954  for ( int ie = 1; ie <= 85; ie++ ) {
955  for ( int ip = 1; ip <= 20; ip++ ) {
956 
957  float x3val01;
958  float x3val02;
959  float x3val03;
960 
961  float y3val01;
962  float y3val02;
963  float y3val03;
964 
965  float z3val01;
966  float z3val02;
967  float z3val03;
968 
969  float x5val01;
970  float x5val02;
971  float x5val03;
972 
973  float y5val01;
974  float y5val02;
975  float y5val03;
976 
977  float z5val01;
978  float z5val02;
979  float z5val03;
980 
981  if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent(ie, ip, -999.);
982  if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent(ie, ip, -999.);
983  if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent(ie, ip, -999.);
984 
985  if ( met01_[ism-1] ) met01_[ism-1]->setBinContent(ie, ip, -999.);
986  if ( met02_[ism-1] ) met02_[ism-1]->setBinContent(ie, ip, -999.);
987  if ( met03_[ism-1] ) met03_[ism-1]->setBinContent(ie, ip, -999.);
988 
989  if ( ie >= 2 && ie <= 84 && ip >= 2 && ip <= 19 ) {
990 
991  x3val01 = 0.;
992  x3val02 = 0.;
993  x3val03 = 0.;
994  for ( int i = -1; i <= +1; i++ ) {
995  for ( int j = -1; j <= +1; j++ ) {
996 
997  if ( h01_[ism-1] ) x3val01 = x3val01 + h01_[ism-1]->GetBinError(ie+i, ip+j) *
998  h01_[ism-1]->GetBinError(ie+i, ip+j);
999 
1000  if ( h02_[ism-1] ) x3val02 = x3val02 + h02_[ism-1]->GetBinError(ie+i, ip+j) *
1001  h02_[ism-1]->GetBinError(ie+i, ip+j);
1002 
1003  if ( h03_[ism-1] ) x3val03 = x3val03 + h03_[ism-1]->GetBinError(ie+i, ip+j) *
1004  h03_[ism-1]->GetBinError(ie+i, ip+j);
1005 
1006  }
1007  }
1008  x3val01 = x3val01 / (9.*9.);
1009  x3val02 = x3val02 / (9.*9.);
1010  x3val03 = x3val03 / (9.*9.);
1011 
1012  y3val01 = 0.;
1013  if ( j01_[ism-1] ) y3val01 = j01_[ism-1]->GetBinError(ie, ip) *
1014  j01_[ism-1]->GetBinError(ie, ip);
1015 
1016  y3val02 = 0.;
1017  if ( j02_[ism-1] ) y3val02 = j02_[ism-1]->GetBinError(ie, ip) *
1018  j02_[ism-1]->GetBinError(ie, ip);
1019 
1020  y3val03 = 0.;
1021  if ( j03_[ism-1] ) y3val03 = j03_[ism-1]->GetBinError(ie, ip) *
1022  j03_[ism-1]->GetBinError(ie, ip);
1023 
1024  z3val01 = -999.;
1025  if ( x3val01 != 0 && y3val01 != 0 ) z3val01 = sqrt(std::abs(x3val01 - y3val01));
1026  if ( (x3val01 - y3val01) < 0 ) z3val01 = -z3val01;
1027 
1028  if ( mes01_[ism-1] ) mes01_[ism-1]->setBinContent(ie, ip, z3val01);
1029 
1030  z3val02 = -999.;
1031  if ( x3val02 != 0 && y3val02 != 0 ) z3val02 = sqrt(std::abs(x3val02 - y3val02));
1032  if ( (x3val02 - y3val02) < 0 ) z3val02 = -z3val02;
1033 
1034  if ( mes02_[ism-1] ) mes02_[ism-1]->setBinContent(ie, ip, z3val02);
1035 
1036  z3val03 = -999.;
1037  if ( x3val03 != 0 && y3val03 != 0 ) z3val03 = sqrt(std::abs(x3val03 - y3val03));
1038  if ( (x3val03 - y3val03) < 0 ) z3val03 = -z3val03;
1039 
1040  if ( mes03_[ism-1] ) mes03_[ism-1]->setBinContent(ie, ip, z3val03);
1041 
1042  }
1043 
1044  if ( ie >= 3 && ie <= 83 && ip >= 3 && ip <= 18 ) {
1045 
1046  x5val01 = 0.;
1047  x5val02 = 0.;
1048  x5val03 = 0.;
1049  for ( int i = -2; i <= +2; i++ ) {
1050  for ( int j = -2; j <= +2; j++ ) {
1051 
1052  if ( h01_[ism-1] ) x5val01 = x5val01 + h01_[ism-1]->GetBinError(ie+i, ip+j) *
1053  h01_[ism-1]->GetBinError(ie+i, ip+j);
1054 
1055  if ( h02_[ism-1] ) x5val02 = x5val02 + h02_[ism-1]->GetBinError(ie+i, ip+j) *
1056  h02_[ism-1]->GetBinError(ie+i, ip+j);
1057 
1058  if ( h03_[ism-1] ) x5val03 = x5val03 + h03_[ism-1]->GetBinError(ie+i, ip+j) *
1059  h03_[ism-1]->GetBinError(ie+i, ip+j);
1060 
1061  }
1062  }
1063  x5val01 = x5val01 / (25.*25.);
1064  x5val02 = x5val02 / (25.*25.);
1065  x5val03 = x5val03 / (25.*25.);
1066 
1067  y5val01 = 0.;
1068  if ( k01_[ism-1] ) y5val01 = k01_[ism-1]->GetBinError(ie, ip) *
1069  k01_[ism-1]->GetBinError(ie, ip);
1070 
1071  y5val02 = 0.;
1072  if ( k02_[ism-1] ) y5val02 = k02_[ism-1]->GetBinError(ie, ip) *
1073  k02_[ism-1]->GetBinError(ie, ip);
1074 
1075  y5val03 = 0.;
1076  if ( k03_[ism-1] ) y5val03 = k03_[ism-1]->GetBinError(ie, ip) *
1077  k03_[ism-1]->GetBinError(ie, ip);
1078 
1079  z5val01 = -999.;
1080  if ( x5val01 != 0 && y5val01 != 0 ) z5val01 = sqrt(std::abs(x5val01 - y5val01));
1081  if ( (x5val01 - y5val01) < 0 ) z5val01 = -z5val01;
1082 
1083  if ( met01_[ism-1] ) met01_[ism-1]->setBinContent(ie, ip, z5val01);
1084 
1085  z5val02 = -999.;
1086  if ( x5val02 != 0 && y5val02 != 0 ) z5val02 = sqrt(std::abs(x5val02 - y5val02));
1087  if ( (x5val02 - y5val02) < 0 ) z5val02 = -z5val02;
1088 
1089  if ( met02_[ism-1] ) met02_[ism-1]->setBinContent(ie, ip, z5val02);
1090 
1091  z5val03 = -999.;
1092  if ( x5val03 != 0 && y5val03 != 0 ) z5val03 = sqrt(std::abs(x5val03 - y5val03));
1093  if ( (x5val03 - y5val03) < 0 ) z5val03 = -z5val03;
1094 
1095  if ( met03_[ism-1] ) met03_[ism-1]->setBinContent(ie, ip, z5val03);
1096 
1097  }
1098 
1099  }
1100  }
1101 #endif
1102 
1103  }
1104 
1105 }
1106 
MonitorElement * mer01_[36]
void beginRun(void)
begin of run method
Cache logicID vector from database.
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void setPedMeanG1(float mean)
static const int PEDESTAL_MIDDLE_GAIN_RMS_ERROR
void setBinContent(int binx, double content)
set content of bin (1-D)
static bool maskChannel(int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:60
MonitorElement * mer02_[36]
MonitorElement * meg03_[36]
MonitorElement * meg02_[36]
MonitorElement * met03_[36]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::string prefixME_
MonitorElement * met02_[36]
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:91
Some &quot;id&quot; conversions.
TProfile2D * k03_[36]
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
void setPedRMSG16(float mean)
Definition: MonPNPedDat.h:30
static const int PEDESTAL_HIGH_GAIN_MEAN_ERROR
std::vector< int > MGPAGains_
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
MonitorElement * mes02_[36]
TProfile * i01_[36]
virtual ~EBPedestalClient()
Destructor.
MonitorElement * mep02_[36]
#define abs(x)
Definition: mlp_lapack.h:159
MonitorElement * meg01_[36]
void setPedRMSG1(float mean)
Definition: MonPNPedDat.h:24
static const int PEDESTAL_LOW_GAIN_RMS_ERROR
void setPedMeanG1(float mean)
Definition: MonPNPedDat.h:21
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
void setPedRMSG6(float rms)
MonitorElement * meg04_[36]
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
void setTaskStatus(bool status)
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
void cleanup(void)
clean up method
MonitorElement * mep03_[36]
MonitorElement * mes03_[36]
TProfile2D * h02_[36]
MonitorElement * mer03_[36]
T sqrt(T t)
Definition: SSEVec.h:46
MonitorElement * mer05_[36]
void setPedMeanG6(float mean)
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
TProfile2D * j01_[36]
void endJob(void)
end of job method
std::vector< int > superModules_
channel masking
int j
Definition: DBlmapReader.cc:9
static unsigned indexEB(const unsigned ism, const unsigned ie, const unsigned ip)
Definition: Numbers.cc:698
MonitorElement * mer04_[36]
DQMStore * dqmStore_
EBPedestalClient(const edm::ParameterSet &ps)
Constructor.
void analyze(void)
Analyze.
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
void setPedMeanG16(float mean)
Definition: MonPNPedDat.h:27
std::vector< int > MGPAGainsPN_
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 endRun(void)
end of run method
void beginJob(void)
begin of job method
Ecal Monitor Utils for Client.
static const int PEDESTAL_LOW_GAIN_MEAN_ERROR
TProfile * i02_[36]
MonitorElement * mep01_[36]
void setPedRMSG1(float rms)
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
MonitorElement * met01_[36]
TProfile2D * k01_[36]
void setup(void)
Setup.
TProfile2D * j03_[36]
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:246
TProfile2D * j02_[36]
float discrepancyMeanPn_[2]
void setPedMeanG12(float mean)
void setTaskStatus(bool status)
Definition: MonPNPedDat.h:33
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
tuple cout
Definition: gather_cfg.py:121
TProfile2D * k02_[36]
MonitorElement * meg05_[36]
static const int PEDESTAL_MIDDLE_GAIN_MEAN_ERROR
tuple status
Definition: ntuplemaker.py:245
MonitorElement * mes01_[36]
TProfile2D * h03_[36]
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
Definition: RunIOV.h:13
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
TProfile2D * h01_[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)
static void printBadChannels(const MonitorElement *me, TH1 *hi, bool positive_only=false)
Print the bad channels.
Definition: UtilsClient.cc:14
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void setPedRMSG12(float rms)