CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EETestPulseClient.cc
Go to the documentation of this file.
1 /*
2  * \file EETestPulseClient.cc
3  *
4  * \author G. Della Ricca
5  * \author F. Cossutti
6  *
7 */
8 
9 #include <memory>
10 #include <iostream>
11 #include <fstream>
12 #include <iomanip>
13 #include <math.h>
14 
16 
19 
20 #ifdef WITH_ECAL_COND_DB
29 #endif
30 
32 
35 
37 
39 
41 
42  // cloneME switch
43  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
44 
45  // verbose switch
46  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
47 
48  // debug switch
49  debug_ = ps.getUntrackedParameter<bool>("debug", false);
50 
51  // prefixME path
52  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
53 
54  // enableCleanup_ switch
55  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
56 
57  // vector of selected Super Modules (Defaults to all 18).
58  superModules_.reserve(18);
59  for ( unsigned int i = 1; i <= 18; i++ ) superModules_.push_back(i);
60  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
61 
62  MGPAGains_.reserve(3);
63  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
64  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
65 
66  MGPAGainsPN_.reserve(2);
67  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
68  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
69 
70  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
71 
72  int ism = superModules_[i];
73 
74  ha01_[ism-1] = 0;
75  ha02_[ism-1] = 0;
76  ha03_[ism-1] = 0;
77 
78  hs01_[ism-1] = 0;
79  hs02_[ism-1] = 0;
80  hs03_[ism-1] = 0;
81 
82  i01_[ism-1] = 0;
83  i02_[ism-1] = 0;
84  i03_[ism-1] = 0;
85  i04_[ism-1] = 0;
86 
87  }
88 
89  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
90 
91  int ism = superModules_[i];
92 
93  meg01_[ism-1] = 0;
94  meg02_[ism-1] = 0;
95  meg03_[ism-1] = 0;
96 
97  meg04_[ism-1] = 0;
98  meg05_[ism-1] = 0;
99 
100  mea01_[ism-1] = 0;
101  mea02_[ism-1] = 0;
102  mea03_[ism-1] = 0;
103 
104  mer04_[ism-1] = 0;
105  mer05_[ism-1] = 0;
106 
107  me_hs01_[ism-1] = 0;
108  me_hs02_[ism-1] = 0;
109  me_hs03_[ism-1] = 0;
110 
111  }
112 
113  percentVariation_ = 0.2;
114  RMSThreshold_ = 300.0;
115  amplitudeThreshold_ = 10.;
116 
117  amplitudeThresholdPnG01_ = 200./16.;
119 
120  pedPnExpectedMean_[0] = 750.0;
121  pedPnExpectedMean_[1] = 750.0;
122 
123  pedPnDiscrepancyMean_[0] = 100.0;
124  pedPnDiscrepancyMean_[1] = 100.0;
125 
126  pedPnRMSThreshold_[0] = 999.;
127  pedPnRMSThreshold_[1] = 999.;
128 
129 }
130 
132 
133 }
134 
136 
138 
139  if ( debug_ ) std::cout << "EETestPulseClient: beginJob" << std::endl;
140 
141  ievt_ = 0;
142  jevt_ = 0;
143 
144 }
145 
147 
148  if ( debug_ ) std::cout << "EETestPulseClient: beginRun" << std::endl;
149 
150  jevt_ = 0;
151 
152  this->setup();
153 
154 }
155 
157 
158  if ( debug_ ) std::cout << "EETestPulseClient: endJob, ievt = " << ievt_ << std::endl;
159 
160  this->cleanup();
161 
162 }
163 
165 
166  if ( debug_ ) std::cout << "EETestPulseClient: endRun, jevt = " << jevt_ << std::endl;
167 
168  this->cleanup();
169 
170 }
171 
173 
175 
176  dqmStore_->setCurrentFolder( prefixME_ + "/EETestPulseClient" );
177 
178  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
179 
180  int ism = superModules_[i];
181 
182  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
183  if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
184  name = "EETPT test pulse quality G01 " + Numbers::sEE(ism);
185  meg01_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
186  meg01_[ism-1]->setAxisTitle("ix", 1);
187  if ( ism >= 1 && ism <= 9 ) meg01_[ism-1]->setAxisTitle("101-ix", 1);
188  meg01_[ism-1]->setAxisTitle("iy", 2);
189  }
190  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
191  if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
192  name = "EETPT test pulse quality G06 " + Numbers::sEE(ism);
193  meg02_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
194  meg02_[ism-1]->setAxisTitle("ix", 1);
195  if ( ism >= 1 && ism <= 9 ) meg02_[ism-1]->setAxisTitle("101-ix", 1);
196  meg02_[ism-1]->setAxisTitle("iy", 2);
197  }
198  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
199  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
200  name = "EETPT test pulse quality G12 " + Numbers::sEE(ism);
201  meg03_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
202  meg03_[ism-1]->setAxisTitle("ix", 1);
203  if ( ism >= 1 && ism <= 9 ) meg03_[ism-1]->setAxisTitle("101-ix", 1);
204  meg03_[ism-1]->setAxisTitle("iy", 2);
205  }
206 
207  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
208  if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
209  name = "EETPT test pulse quality PNs G01 " + Numbers::sEE(ism);
210  meg04_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
211  meg04_[ism-1]->setAxisTitle("pseudo-strip", 1);
212  meg04_[ism-1]->setAxisTitle("channel", 2);
213  }
214  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
215  if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
216  name = "EETPT test pulse quality PNs G16 " + Numbers::sEE(ism);
217  meg05_[ism-1] = dqmStore_->book2D(name, name, 10, 0., 10., 1, 0., 5.);
218  meg05_[ism-1]->setAxisTitle("pseudo-strip", 1);
219  meg05_[ism-1]->setAxisTitle("channel", 2);
220  }
221 
222  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
223  if ( mea01_[ism-1] ) dqmStore_->removeElement( mea01_[ism-1]->getName() );
224  name = "EETPT test pulse amplitude G01 " + Numbers::sEE(ism);
225  mea01_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
226  mea01_[ism-1]->setAxisTitle("channel", 1);
227  mea01_[ism-1]->setAxisTitle("amplitude", 2);
228  }
229  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
230  if ( mea02_[ism-1] ) dqmStore_->removeElement( mea02_[ism-1]->getName() );
231  name = "EETPT test pulse amplitude G06 " + Numbers::sEE(ism);
232  mea02_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
233  mea02_[ism-1]->setAxisTitle("channel", 1);
234  mea02_[ism-1]->setAxisTitle("amplitude", 2);
235  }
236  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
237  if ( mea03_[ism-1] ) dqmStore_->removeElement( mea03_[ism-1]->getName() );
238  name = "EETPT test pulse amplitude G12 " + Numbers::sEE(ism);
239  mea03_[ism-1] = dqmStore_->book1D(name, name, 850, 0., 850.);
240  mea03_[ism-1]->setAxisTitle("channel", 1);
241  mea03_[ism-1]->setAxisTitle("amplitude", 2);
242  }
243 
244  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
245  if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
246  name = "EETPT PNs pedestal rms " + Numbers::sEE(ism) + " G01";
247  mer04_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
248  mer04_[ism-1]->setAxisTitle("rms", 1);
249  }
250  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
251  if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
252  name = "EETPT PNs pedestal rms " + Numbers::sEE(ism) + " G16";
253  mer05_[ism-1] = dqmStore_->book1D(name, name, 100, 0., 10.);
254  mer05_[ism-1]->setAxisTitle("rms", 1);
255  }
256 
257  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
258  if ( me_hs01_[ism-1] ) dqmStore_->removeElement( me_hs01_[ism-1]->getName() );
259  name = "EETPT test pulse shape G01 " + Numbers::sEE(ism);
260  me_hs01_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
261  me_hs01_[ism-1]->setAxisTitle("sample", 1);
262  me_hs01_[ism-1]->setAxisTitle("amplitude", 2);
263  }
264  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
265  if ( me_hs02_[ism-1] ) dqmStore_->removeElement( me_hs02_[ism-1]->getName() );
266  name = "EETPT test pulse shape G06 " + Numbers::sEE(ism);
267  me_hs02_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
268  me_hs02_[ism-1]->setAxisTitle("sample", 1);
269  me_hs02_[ism-1]->setAxisTitle("amplitude", 2);
270  }
271  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
272  if ( me_hs03_[ism-1] ) dqmStore_->removeElement( me_hs03_[ism-1]->getName() );
273  name = "EETPT test pulse shape G12 " + Numbers::sEE(ism);
274  me_hs03_[ism-1] = dqmStore_->book1D(name, name, 10, 0., 10.);
275  me_hs03_[ism-1]->setAxisTitle("sample", 1);
276  me_hs03_[ism-1]->setAxisTitle("amplitude", 2);
277  }
278 
279  }
280 
281  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
282 
283  int ism = superModules_[i];
284 
285  if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
286  if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
287  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
288 
289  if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
290  if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
291 
292  for ( int ix = 1; ix <= 50; ix++ ) {
293  for ( int iy = 1; iy <= 50; iy++ ) {
294 
295  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 6. );
296  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 6. );
297  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 6. );
298 
299  int jx = ix + Numbers::ix0EE(ism);
300  int jy = iy + Numbers::iy0EE(ism);
301 
302  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
303 
304  if ( Numbers::validEE(ism, jx, jy) ) {
305  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 2. );
306  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 2. );
307  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
308  }
309 
310  }
311  }
312 
313  for ( int i = 1; i <= 10; i++ ) {
314 
315  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 6. );
316  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 6. );
317 
318  // non-existing mem
319  if ( (ism >= 3 && ism <= 4) || (ism >= 7 && ism <= 9) ) continue;
320  if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) ) continue;
321 
322  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
323  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
324 
325  }
326 
327  if ( mea01_[ism-1] ) mea01_[ism-1]->Reset();
328  if ( mea02_[ism-1] ) mea02_[ism-1]->Reset();
329  if ( mea03_[ism-1] ) mea03_[ism-1]->Reset();
330 
331  if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
332  if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();
333 
334  if ( me_hs01_[ism-1] ) me_hs01_[ism-1]->Reset();
335  if ( me_hs02_[ism-1] ) me_hs02_[ism-1]->Reset();
336  if ( me_hs03_[ism-1] ) me_hs03_[ism-1]->Reset();
337 
338  }
339 
340 }
341 
343 
344  if ( ! enableCleanup_ ) return;
345 
346  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
347 
348  int ism = superModules_[i];
349 
350  if ( cloneME_ ) {
351  if ( ha01_[ism-1] ) delete ha01_[ism-1];
352  if ( ha02_[ism-1] ) delete ha02_[ism-1];
353  if ( ha03_[ism-1] ) delete ha03_[ism-1];
354 
355  if ( hs01_[ism-1] ) delete hs01_[ism-1];
356  if ( hs02_[ism-1] ) delete hs02_[ism-1];
357  if ( hs03_[ism-1] ) delete hs03_[ism-1];
358 
359  if ( i01_[ism-1] ) delete i01_[ism-1];
360  if ( i02_[ism-1] ) delete i02_[ism-1];
361  if ( i03_[ism-1] ) delete i03_[ism-1];
362  if ( i04_[ism-1] ) delete i04_[ism-1];
363  }
364 
365  ha01_[ism-1] = 0;
366  ha02_[ism-1] = 0;
367  ha03_[ism-1] = 0;
368 
369  hs01_[ism-1] = 0;
370  hs02_[ism-1] = 0;
371  hs03_[ism-1] = 0;
372 
373  i01_[ism-1] = 0;
374  i02_[ism-1] = 0;
375  i03_[ism-1] = 0;
376  i04_[ism-1] = 0;
377 
378  }
379 
380  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
381 
382  int ism = superModules_[i];
383 
384  dqmStore_->setCurrentFolder( prefixME_ + "/EETestPulseClient" );
385 
386  if ( meg01_[ism-1] ) dqmStore_->removeElement( meg01_[ism-1]->getName() );
387  meg01_[ism-1] = 0;
388  if ( meg02_[ism-1] ) dqmStore_->removeElement( meg02_[ism-1]->getName() );
389  meg02_[ism-1] = 0;
390  if ( meg03_[ism-1] ) dqmStore_->removeElement( meg03_[ism-1]->getName() );
391  meg03_[ism-1] = 0;
392 
393  if ( meg04_[ism-1] ) dqmStore_->removeElement( meg04_[ism-1]->getName() );
394  meg04_[ism-1] = 0;
395  if ( meg05_[ism-1] ) dqmStore_->removeElement( meg05_[ism-1]->getName() );
396  meg05_[ism-1] = 0;
397 
398  if ( mea01_[ism-1] ) dqmStore_->removeElement( mea01_[ism-1]->getName() );
399  mea01_[ism-1] = 0;
400  if ( mea02_[ism-1] ) dqmStore_->removeElement( mea02_[ism-1]->getName() );
401  mea02_[ism-1] = 0;
402  if ( mea03_[ism-1] ) dqmStore_->removeElement( mea03_[ism-1]->getName() );
403  mea03_[ism-1] = 0;
404 
405  if ( mer04_[ism-1] ) dqmStore_->removeElement( mer04_[ism-1]->getName() );
406  mer04_[ism-1] = 0;
407  if ( mer05_[ism-1] ) dqmStore_->removeElement( mer05_[ism-1]->getName() );
408  mer05_[ism-1] = 0;
409 
410  if ( me_hs01_[ism-1] ) dqmStore_->removeElement( me_hs01_[ism-1]->getName() );
411  me_hs01_[ism-1] = 0;
412  if ( me_hs02_[ism-1] ) dqmStore_->removeElement( me_hs02_[ism-1]->getName() );
413  me_hs02_[ism-1] = 0;
414  if ( me_hs03_[ism-1] ) dqmStore_->removeElement( me_hs03_[ism-1]->getName() );
415  me_hs03_[ism-1] = 0;
416 
417  }
418 
419 }
420 
421 #ifdef WITH_ECAL_COND_DB
422 bool EETestPulseClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
423 
424  status = true;
425 
426  EcalLogicID ecid;
427 
429  std::map<EcalLogicID, MonTestPulseDat> dataset1;
430  MonPulseShapeDat shape;
431  std::map<EcalLogicID, MonPulseShapeDat> dataset2;
432 
433  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
434 
435  int ism = superModules_[i];
436 
437  if ( verbose_ ) {
438  std::cout << " " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
439  std::cout << std::endl;
440  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
442  }
443  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
445  }
446  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
448  }
449  }
450 
451  for ( int ix = 1; ix <= 50; ix++ ) {
452  for ( int iy = 1; iy <= 50; iy++ ) {
453 
454  int jx = ix + Numbers::ix0EE(ism);
455  int jy = iy + Numbers::iy0EE(ism);
456 
457  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
458 
459  if ( ! Numbers::validEE(ism, jx, jy) ) continue;
460 
461  bool update01;
462  bool update02;
463  bool update03;
464 
465  float num01, num02, num03;
466  float mean01, mean02, mean03;
467  float rms01, rms02, rms03;
468 
469  update01 = UtilsClient::getBinStatistics(ha01_[ism-1], ix, iy, num01, mean01, rms01);
470  update02 = UtilsClient::getBinStatistics(ha02_[ism-1], ix, iy, num02, mean02, rms02);
471  update03 = UtilsClient::getBinStatistics(ha03_[ism-1], ix, iy, num03, mean03, rms03);
472 
473  if ( update01 || update02 || update03 ) {
474 
475  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
476 
477  if ( verbose_ ) {
478  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
479  std::cout << "G01 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num01 << " " << mean01 << " " << rms01 << std::endl;
480  std::cout << "G06 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num02 << " " << mean02 << " " << rms02 << std::endl;
481  std::cout << "G12 (" << Numbers::ix0EE(i+1)+ix << "," << Numbers::iy0EE(i+1)+iy << ") " << num03 << " " << mean03 << " " << rms03 << std::endl;
482  std::cout << std::endl;
483  }
484 
485  }
486 
487  adc.setADCMeanG1(mean01);
488  adc.setADCRMSG1(rms01);
489 
490  adc.setADCMeanG6(mean02);
491  adc.setADCRMSG6(rms02);
492 
493  adc.setADCMeanG12(mean03);
494  adc.setADCRMSG12(rms03);
495 
496  if ( UtilsClient::getBinStatus(meg01_[ism-1], ix, iy) &&
497  UtilsClient::getBinStatus(meg02_[ism-1], ix, iy) &&
498  UtilsClient::getBinStatus(meg03_[ism-1], ix, iy) ) {
499  adc.setTaskStatus(true);
500  } else {
501  adc.setTaskStatus(false);
502  }
503 
504  status = status && UtilsClient::getBinQuality(meg01_[ism-1], ix, iy) &&
505  UtilsClient::getBinQuality(meg02_[ism-1], ix, iy) &&
506  UtilsClient::getBinQuality(meg03_[ism-1], ix, iy);
507 
508  if ( Numbers::icEE(ism, jx, jy) == 1 ) {
509 
510  std::vector<float> sample01, sample02, sample03;
511 
512  sample01.clear();
513  sample02.clear();
514  sample03.clear();
515 
516  if ( me_hs01_[ism-1] ) {
517  for ( int i = 1; i <= 10; i++ ) {
518  sample01.push_back(int(me_hs01_[ism-1]->getBinContent(i)));
519  }
520  } else {
521  for ( int i = 1; i <= 10; i++ ) { sample01.push_back(-1.); }
522  }
523 
524  if ( me_hs02_[ism-1] ) {
525  for ( int i = 1; i <= 10; i++ ) {
526  sample02.push_back(int(me_hs02_[ism-1]->getBinContent(i)));
527  }
528  } else {
529  for ( int i = 1; i <= 10; i++ ) { sample02.push_back(-1.); }
530  }
531 
532  if ( me_hs03_[ism-1] ) {
533  for ( int i = 1; i <= 10; i++ ) {
534  sample03.push_back(int(me_hs03_[ism-1]->getBinContent(i)));
535  }
536  } else {
537  for ( int i = 1; i <= 10; i++ ) { sample03.push_back(-1.); }
538  }
539 
540  if ( verbose_ ) {
541  std::cout << "sample01 = " << std::flush;
542  for ( unsigned int i = 0; i < sample01.size(); i++ ) {
543  std::cout << sample01[i] << " " << std::flush;
544  }
545  std::cout << std::endl;
546 
547  std::cout << "sample02 = " << std::flush;
548  for ( unsigned int i = 0; i < sample02.size(); i++ ) {
549  std::cout << sample02[i] << " " << std::flush;
550  }
551  std::cout << std::endl;
552 
553  std::cout << "sample03 = " << std::flush;
554  for ( unsigned int i = 0; i < sample03.size(); i++ ) {
555  std::cout << sample03[i] << " " << std::flush;
556  }
557  std::cout << std::endl;
558  }
559 
560  if ( verbose_ ) std::cout << std::endl;
561 
562  shape.setSamples(sample01, 1);
563  shape.setSamples(sample02, 6);
564  shape.setSamples(sample03, 12);
565 
566  }
567 
568  int ic = Numbers::indexEE(ism, jx, jy);
569 
570  if ( ic == -1 ) continue;
571 
572  if ( econn ) {
573  ecid = LogicID::getEcalLogicID("EE_crystal_number", Numbers::iSM(ism, EcalEndcap), ic);
574  dataset1[ecid] = adc;
575  if ( Numbers::icEE(ism, jx, jy) == 1 ) dataset2[ecid] = shape;
576  }
577 
578  }
579 
580  }
581  }
582 
583  }
584 
585  if ( econn ) {
586  try {
587  if ( verbose_ ) std::cout << "Inserting MonTestPulseDat ..." << std::endl;
588  if ( dataset1.size() != 0 ) econn->insertDataArraySet(&dataset1, moniov);
589  if ( dataset2.size() != 0 ) econn->insertDataSet(&dataset2, moniov);
590  if ( verbose_ ) std::cout << "done." << std::endl;
591  } catch (std::runtime_error &e) {
592  std::cerr << e.what() << std::endl;
593  }
594  }
595 
596  if ( verbose_ ) std::cout << std::endl;
597 
598  MonPNMGPADat pn;
599  std::map<EcalLogicID, MonPNMGPADat> dataset3;
600 
601  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
602 
603  int ism = superModules_[i];
604 
605  if ( verbose_ ) {
606  std::cout << " " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
607  std::cout << std::endl;
608  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
609  UtilsClient::printBadChannels(meg04_[ism-1], i01_[ism-1]);
610  UtilsClient::printBadChannels(meg04_[ism-1], i03_[ism-1]);
611  }
612  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
613  UtilsClient::printBadChannels(meg05_[ism-1], i02_[ism-1]);
614  UtilsClient::printBadChannels(meg05_[ism-1], i04_[ism-1]);
615  }
616  }
617 
618  for ( int i = 1; i <= 10; i++ ) {
619 
620  bool update01;
621  bool update02;
622  bool update03;
623  bool update04;
624 
625  float num01, num02, num03, num04;
626  float mean01, mean02, mean03, mean04;
627  float rms01, rms02, rms03, rms04;
628 
629  update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
630  update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
631  update03 = UtilsClient::getBinStatistics(i03_[ism-1], i, 0, num03, mean03, rms03);
632  update04 = UtilsClient::getBinStatistics(i04_[ism-1], i, 0, num04, mean04, rms04);
633 
634  if ( update01 || update02 || update03 || update04 ) {
635 
636  if ( i == 1 ) {
637 
638  if ( verbose_ ) {
639  std::cout << "Preparing dataset for " << Numbers::sEE(ism) << " (ism=" << ism << ")" << std::endl;
640  std::cout << "PNs (" << i << ") G01 " << num01 << " " << mean01 << " " << rms01 << " " << num03 << " " << mean03 << " " << rms03 << std::endl;
641  std::cout << "PNs (" << i << ") G16 " << num02 << " " << mean02 << " " << rms02 << " " << num04 << " " << mean04 << " " << rms04 << std::endl;
642  std::cout << std::endl;
643  }
644 
645  }
646 
647  pn.setADCMeanG1(mean01);
648  pn.setADCRMSG1(rms01);
649 
650  pn.setPedMeanG1(mean03);
651  pn.setPedRMSG1(rms03);
652 
653  pn.setADCMeanG16(mean02);
654  pn.setADCRMSG16(rms02);
655 
656  pn.setPedMeanG16(mean04);
657  pn.setPedRMSG16(rms04);
658 
659  if ( UtilsClient::getBinStatus(meg04_[ism-1], i, 1) &&
660  UtilsClient::getBinStatus(meg05_[ism-1], i, 1) ) {
661  pn.setTaskStatus(true);
662  } else {
663  pn.setTaskStatus(false);
664  }
665 
666  status = status && UtilsClient::getBinQuality(meg04_[ism-1], i, 1) &&
667  UtilsClient::getBinQuality(meg05_[ism-1], i, 1);
668 
669  if ( econn ) {
670  ecid = LogicID::getEcalLogicID("EE_LM_PN", Numbers::iSM(ism, EcalEndcap), i-1);
671  dataset3[ecid] = pn;
672  }
673 
674  }
675 
676  }
677 
678  }
679 
680  if ( econn ) {
681  try {
682  if ( verbose_ ) std::cout << "Inserting MonPNMGPADat ..." << std::endl;
683  if ( dataset3.size() != 0 ) econn->insertDataArraySet(&dataset3, moniov);
684  if ( verbose_ ) std::cout << "done." << std::endl;
685  } catch (std::runtime_error &e) {
686  std::cerr << e.what() << std::endl;
687  }
688  }
689 
690  return true;
691 
692 }
693 #endif
694 
696 
697  ievt_++;
698  jevt_++;
699  if ( ievt_ % 10 == 0 ) {
700  if ( debug_ ) std::cout << "EETestPulseClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
701  }
702 
703  uint32_t bits01 = 0;
706 
707  uint32_t bits02 = 0;
710 
711  uint32_t bits03 = 0;
714 
715  uint32_t bits04 = 0;
718 
719  uint32_t bits05 = 0;
722 
723  MonitorElement* me;
724 
725  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
726 
727  int ism = superModules_[i];
728 
729  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
730  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain01/EETPT amplitude " + Numbers::sEE(ism) + " G01" );
731  ha01_[ism-1] = UtilsClient::getHisto( me, cloneME_, ha01_[ism-1] );
732  }
733 
734  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
735  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain06/EETPT amplitude " + Numbers::sEE(ism) + " G06" );
736  ha02_[ism-1] = UtilsClient::getHisto( me, cloneME_, ha02_[ism-1] );
737  }
738 
739  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
740  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain12/EETPT amplitude " + Numbers::sEE(ism) + " G12" );
741  ha03_[ism-1] = UtilsClient::getHisto( me, cloneME_, ha03_[ism-1] );
742  }
743 
744  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
745  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain01/EETPT shape " + Numbers::sEE(ism) + " G01" );
746  hs01_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs01_[ism-1] );
747  }
748 
749  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
750  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain06/EETPT shape " + Numbers::sEE(ism) + " G06" );
751  hs02_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs02_[ism-1] );
752  }
753 
754  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
755  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/Gain12/EETPT shape " + Numbers::sEE(ism) + " G12" );
756  hs03_[ism-1] = UtilsClient::getHisto( me, cloneME_, hs03_[ism-1] );
757  }
758 
759  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
760  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/PN/Gain01/EETPT PNs amplitude " + Numbers::sEE(ism) + " G01" );
761  i01_[ism-1] = UtilsClient::getHisto( me, cloneME_, i01_[ism-1] );
762  }
763 
764  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
765  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/PN/Gain16/EETPT PNs amplitude " + Numbers::sEE(ism) + " G16" );
766  i02_[ism-1] = UtilsClient::getHisto( me, cloneME_, i02_[ism-1] );
767  }
768 
769  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
770  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/PN/Gain01/EETPT PNs pedestal " + Numbers::sEE(ism) + " G01" );
771  i03_[ism-1] = UtilsClient::getHisto( me, cloneME_, i03_[ism-1] );
772  }
773 
774  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
775  me = dqmStore_->get( prefixME_ + "/EETestPulseTask/PN/Gain16/EETPT PNs pedestal " + Numbers::sEE(ism) + " G16" );
776  i04_[ism-1] = UtilsClient::getHisto( me, cloneME_, i04_[ism-1] );
777  }
778 
779  if ( meg01_[ism-1] ) meg01_[ism-1]->Reset();
780  if ( meg02_[ism-1] ) meg02_[ism-1]->Reset();
781  if ( meg03_[ism-1] ) meg03_[ism-1]->Reset();
782 
783  if ( meg04_[ism-1] ) meg04_[ism-1]->Reset();
784  if ( meg05_[ism-1] ) meg05_[ism-1]->Reset();
785 
786  if ( mea01_[ism-1] ) mea01_[ism-1]->Reset();
787  if ( mea02_[ism-1] ) mea02_[ism-1]->Reset();
788  if ( mea03_[ism-1] ) mea03_[ism-1]->Reset();
789 
790  if ( mer04_[ism-1] ) mer04_[ism-1]->Reset();
791  if ( mer05_[ism-1] ) mer05_[ism-1]->Reset();
792 
793  if ( me_hs01_[ism-1] ) me_hs01_[ism-1]->Reset();
794  if ( me_hs02_[ism-1] ) me_hs02_[ism-1]->Reset();
795  if ( me_hs03_[ism-1] ) me_hs03_[ism-1]->Reset();
796 
797  float meanAmpl01, meanAmpl02, meanAmpl03;
798 
799  int nCry01, nCry02, nCry03;
800 
801  meanAmpl01 = meanAmpl02 = meanAmpl03 = 0.;
802 
803  nCry01 = nCry02 = nCry03 = 0;
804 
805  for ( int ix = 1; ix <= 50; ix++ ) {
806  for ( int iy = 1; iy <= 50; iy++ ) {
807 
808  bool update01;
809  bool update02;
810  bool update03;
811 
812  float num01, num02, num03;
813  float mean01, mean02, mean03;
814  float rms01, rms02, rms03;
815 
816  update01 = UtilsClient::getBinStatistics(ha01_[ism-1], ix, iy, num01, mean01, rms01);
817  update02 = UtilsClient::getBinStatistics(ha02_[ism-1], ix, iy, num02, mean02, rms02);
818  update03 = UtilsClient::getBinStatistics(ha03_[ism-1], ix, iy, num03, mean03, rms03);
819 
820  if ( update01 ) {
821  meanAmpl01 += mean01;
822  nCry01++;
823  }
824 
825  if ( update02 ) {
826  meanAmpl02 += mean02;
827  nCry02++;
828  }
829 
830  if ( update03 ) {
831  meanAmpl03 += mean03;
832  nCry03++;
833  }
834 
835  }
836  }
837 
838  if ( nCry01 > 0 ) meanAmpl01 /= float (nCry01);
839  if ( nCry02 > 0 ) meanAmpl02 /= float (nCry02);
840  if ( nCry03 > 0 ) meanAmpl03 /= float (nCry03);
841 
842  for ( int ix = 1; ix <= 50; ix++ ) {
843  for ( int iy = 1; iy <= 50; iy++ ) {
844 
845  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 6. );
846  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 6. );
847  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 6. );
848 
849  int jx = ix + Numbers::ix0EE(ism);
850  int jy = iy + Numbers::iy0EE(ism);
851 
852  if ( ism >= 1 && ism <= 9 ) jx = 101 - jx;
853 
854  if ( Numbers::validEE(ism, jx, jy) ) {
855  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, 2. );
856  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, 2. );
857  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, 2. );
858  }
859 
860  bool update01;
861  bool update02;
862  bool update03;
863 
864  float num01, num02, num03;
865  float mean01, mean02, mean03;
866  float rms01, rms02, rms03;
867 
868  update01 = UtilsClient::getBinStatistics(ha01_[ism-1], ix, iy, num01, mean01, rms01);
869  update02 = UtilsClient::getBinStatistics(ha02_[ism-1], ix, iy, num02, mean02, rms02);
870  update03 = UtilsClient::getBinStatistics(ha03_[ism-1], ix, iy, num03, mean03, rms03);
871 
872  if ( update01 ) {
873 
874  float val;
875 
876  val = 1.;
877  if ( std::abs(mean01 - meanAmpl01) > std::abs(percentVariation_ * meanAmpl01) || mean01 < amplitudeThreshold_ )
878  val = 0.;
879  if ( rms01 > RMSThreshold_ )
880  val = 0.;
881  if ( meg01_[ism-1] ) meg01_[ism-1]->setBinContent( ix, iy, val );
882 
883  int ic = Numbers::icEE(ism, jx, jy);
884 
885  if ( ic != -1 ) {
886  if ( mea01_[ism-1] ) {
887  if ( mean01 > 0. ) {
888  mea01_[ism-1]->setBinContent( ic, mean01 );
889  mea01_[ism-1]->setBinError( ic, rms01 );
890  } else {
891  mea01_[ism-1]->setEntries( 1.+mea01_[ism-1]->getEntries() );
892  }
893  }
894  }
895 
896  }
897 
898  if ( update02 ) {
899 
900  float val;
901 
902  val = 1.;
903  if ( std::abs(mean02 - meanAmpl02) > std::abs(percentVariation_ * meanAmpl02) || mean02 < amplitudeThreshold_ )
904  val = 0.;
905  if ( rms02 > RMSThreshold_ )
906  val = 0.;
907  if ( meg02_[ism-1] ) meg02_[ism-1]->setBinContent( ix, iy, val );
908 
909  int ic = Numbers::icEE(ism, jx, jy);
910 
911  if ( ic != -1 ) {
912  if ( mea02_[ism-1] ) {
913  if ( mean02 > 0. ) {
914  mea02_[ism-1]->setBinContent( ic, mean02 );
915  mea02_[ism-1]->setBinError( ic, rms02 );
916  } else {
917  mea02_[ism-1]->setEntries( 1.+mea02_[ism-1]->getEntries() );
918  }
919  }
920  }
921 
922  }
923 
924  if ( update03 ) {
925 
926  float val;
927 
928  val = 1.;
929  if ( std::abs(mean03 - meanAmpl03) > std::abs(percentVariation_ * meanAmpl03) || mean03 < amplitudeThreshold_ )
930  val = 0.;
931  if ( rms03 > RMSThreshold_ )
932  val = 0.;
933  if ( meg03_[ism-1] ) meg03_[ism-1]->setBinContent( ix, iy, val );
934 
935  int ic = Numbers::icEE(ism, jx, jy);
936 
937  if ( ic != -1 ) {
938  if ( mea03_[ism-1] ) {
939  if ( mean03 > 0. ) {
940  mea03_[ism-1]->setBinContent( ic, mean03 );
941  mea03_[ism-1]->setBinError( ic, rms03 );
942  } else {
943  mea03_[ism-1]->setEntries( 1.+mea03_[ism-1]->getEntries() );
944  }
945  }
946  }
947 
948  }
949 
950  if ( Masks::maskChannel(ism, ix, iy, bits01, EcalEndcap) ) UtilsClient::maskBinContent( meg01_[ism-1], ix, iy );
951  if ( Masks::maskChannel(ism, ix, iy, bits02, EcalEndcap) ) UtilsClient::maskBinContent( meg02_[ism-1], ix, iy );
952  if ( Masks::maskChannel(ism, ix, iy, bits03, EcalEndcap) ) UtilsClient::maskBinContent( meg03_[ism-1], ix, iy );
953 
954  }
955  }
956 
957  for ( int i = 1; i <= 10; i++ ) {
958 
959  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 6. );
960  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 6. );
961 
962  // non-existing mem
963  if ( (ism >= 3 && ism <= 4) || (ism >= 7 && ism <= 9) ) continue;
964  if ( (ism >= 12 && ism <= 13) || (ism >= 16 && ism <= 18) ) continue;
965 
966  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent( i, 1, 2. );
967  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent( i, 1, 2. );
968 
969  bool update01;
970  bool update02;
971  bool update03;
972  bool update04;
973 
974  float num01, num02, num03, num04;
975  float mean01, mean02, mean03, mean04;
976  float rms01, rms02, rms03, rms04;
977 
978  update01 = UtilsClient::getBinStatistics(i01_[ism-1], i, 0, num01, mean01, rms01);
979  update02 = UtilsClient::getBinStatistics(i02_[ism-1], i, 0, num02, mean02, rms02);
980  update03 = UtilsClient::getBinStatistics(i03_[ism-1], i, 0, num03, mean03, rms03);
981  update04 = UtilsClient::getBinStatistics(i04_[ism-1], i, 0, num04, mean04, rms04);
982 
983  if ( mer04_[ism-1] ) mer04_[ism-1]->Fill(rms03);
984  if ( mer05_[ism-1] ) mer05_[ism-1]->Fill(rms04);
985 
986  if ( update01 && update03 ) {
987 
988  float val;
989 
990  val = 1.;
991  if ( mean01 < amplitudeThresholdPnG01_ )
992  val = 0.;
993  if ( mean03 < pedPnExpectedMean_[0] - pedPnDiscrepancyMean_[0] ||
994  pedPnExpectedMean_[0] + pedPnDiscrepancyMean_[0] < mean03)
995  val = 0.;
996  if ( rms03 > pedPnRMSThreshold_[0] )
997  val = 0.;
998  if ( meg04_[ism-1] ) meg04_[ism-1]->setBinContent(i, 1, val);
999 
1000  }
1001 
1002  if ( update02 && update04 ) {
1003 
1004  float val;
1005 
1006  val = 1.;
1007  if ( mean02 < amplitudeThresholdPnG16_ )
1008  val = 0.;
1009  if ( mean04 < pedPnExpectedMean_[1] - pedPnDiscrepancyMean_[1] ||
1010  pedPnExpectedMean_[1] + pedPnDiscrepancyMean_[1] < mean04)
1011  val = 0.;
1012  if ( rms04 > pedPnRMSThreshold_[1] )
1013  val = 0.;
1014  if ( meg05_[ism-1] ) meg05_[ism-1]->setBinContent(i, 1, val);
1015 
1016  }
1017 
1018  if ( Masks::maskPn(ism, i, bits01|bits04, EcalEndcap) ) UtilsClient::maskBinContent( meg04_[ism-1], i, 1 );
1019  if ( Masks::maskPn(ism, i, bits03|bits05, EcalEndcap) ) UtilsClient::maskBinContent( meg05_[ism-1], i, 1 );
1020 
1021  }
1022 
1023  for ( int i = 1; i <= 10; i++ ) {
1024 
1025  if ( hs01_[ism-1] ) {
1026  int ic = UtilsClient::getFirstNonEmptyChannel( hs01_[ism-1] );
1027  if ( me_hs01_[ism-1] ) {
1028  me_hs01_[ism-1]->setBinContent( i, hs01_[ism-1]->GetBinContent(ic, i) );
1029  me_hs01_[ism-1]->setBinError( i, hs01_[ism-1]->GetBinError(ic, i) );
1030  }
1031  }
1032 
1033  if ( hs02_[ism-1] ) {
1034  int ic = UtilsClient::getFirstNonEmptyChannel( hs02_[ism-1] );
1035  if ( me_hs02_[ism-1] ) {
1036  me_hs02_[ism-1]->setBinContent( i, hs02_[ism-1]->GetBinContent(ic, i) );
1037  me_hs02_[ism-1]->setBinError( i, hs02_[ism-1]->GetBinError(ic, i) );
1038  }
1039  }
1040 
1041  if ( hs03_[ism-1] ) {
1042  int ic = UtilsClient::getFirstNonEmptyChannel( hs03_[ism-1] );
1043  if ( me_hs03_[ism-1] ) {
1044  me_hs03_[ism-1]->setBinContent( i, hs03_[ism-1]->GetBinContent(ic, i) );
1045  me_hs03_[ism-1]->setBinError( i, hs03_[ism-1]->GetBinError(ic, i) );
1046  }
1047  }
1048 
1049  }
1050 
1051  }
1052 
1053 }
1054 
int adc(sample_type sample)
get the ADC sample (12 bits)
TProfile2D * hs03_[18]
Cache logicID vector from database.
MonitorElement * me_hs03_[18]
T getUntrackedParameter(std::string const &, T const &) const
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:223
int i
Definition: DBlmapReader.cc:9
MonitorElement * mea03_[18]
static bool validEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:829
void setPedRMSG1(float mean)
Definition: MonPNMGPADat.h:36
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:57
static const int TESTPULSE_LOW_GAIN_RMS_ERROR
TProfile2D * hs01_[18]
TProfile2D * ha01_[18]
static unsigned icEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:736
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
void setADCRMSG1(float rms)
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:89
Some &quot;id&quot; conversions.
MonitorElement * me_hs02_[18]
static const int PEDESTAL_HIGH_GAIN_MEAN_ERROR
static bool getBinQuality(const MonitorElement *me, const int ix, const int iy)
Returns true if the bin quality is good or masked.
Definition: UtilsClient.cc:201
void beginJob(void)
BeginJob.
void setADCMeanG1(float mean)
TProfile2D * ha02_[18]
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:770
MonitorElement * mea01_[18]
void setADCMeanG6(float mean)
static const int TESTPULSE_MIDDLE_GAIN_MEAN_ERROR
void setTaskStatus(bool status)
Definition: MonPNMGPADat.h:45
static const int PEDESTAL_LOW_GAIN_RMS_ERROR
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
std::vector< int > MGPAGainsPN_
static const int PEDESTAL_HIGH_GAIN_RMS_ERROR
static bool maskPn(int ism, int i1, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:109
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:809
MonitorElement * meg01_[18]
MonitorElement * meg05_[18]
void setSamples(std::vector< float > &samples, int gain)
void Fill(long long x)
void beginRun(void)
BeginRun.
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
static const int TESTPULSE_MIDDLE_GAIN_RMS_ERROR
void setADCMeanG12(float mean)
void setup(void)
Setup.
TProfile * i03_[18]
void setADCMeanG16(float mean)
Definition: MonPNMGPADat.h:27
TProfile * i02_[18]
MonitorElement * meg04_[18]
void setTaskStatus(bool status)
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
channel masking
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int TESTPULSE_HIGH_GAIN_RMS_ERROR
MonitorElement * meg03_[18]
MonitorElement * mea02_[18]
void setADCRMSG12(float rms)
TProfile * i04_[18]
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * mer04_[18]
void setEntries(double nentries)
set # of entries
MonitorElement * mer05_[18]
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
Ecal Monitor Utils for Client.
static const int PEDESTAL_LOW_GAIN_MEAN_ERROR
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
static const int TESTPULSE_LOW_GAIN_MEAN_ERROR
MonitorElement * me_hs01_[18]
MonitorElement * meg02_[18]
void setADCRMSG6(float rms)
void setPedMeanG16(float mean)
Definition: MonPNMGPADat.h:39
void setADCRMSG1(float mean)
Definition: MonPNMGPADat.h:24
static unsigned indexEE(const unsigned ism, const unsigned ix, const unsigned iy)
Definition: Numbers.cc:709
static unsigned iSM(const unsigned ism, const EcalSubdetector subdet)
Definition: Numbers.cc:243
TProfile2D * ha03_[18]
TProfile2D * hs02_[18]
void setADCMeanG1(float mean)
Definition: MonPNMGPADat.h:21
TProfile * i01_[18]
void insertDataArraySet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
void analyze(void)
Analyze.
tuple cout
Definition: gather_cfg.py:121
void cleanup(void)
Cleanup.
void insertDataSet(const std::map< EcalLogicID, DATT > *data, IOVT *iov)
EETestPulseClient(const edm::ParameterSet &ps)
Constructor.
static const int TESTPULSE_HIGH_GAIN_MEAN_ERROR
tuple status
Definition: ntuplemaker.py:245
void setADCRMSG16(float mean)
Definition: MonPNMGPADat.h:30
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
static EcalLogicID getEcalLogicID(const char *name, const int id1=EcalLogicID::NULLID, const int id2=EcalLogicID::NULLID, const int id3=EcalLogicID::NULLID)
Definition: LogicID.h:29
std::vector< int > MGPAGains_
Definition: RunIOV.h:13
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
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)
virtual ~EETestPulseClient()
Destructor.
void setPedMeanG1(float mean)
Definition: MonPNMGPADat.h:33
static void printBadChannels(const MonitorElement *me, TH1 *hi, bool positive_only=false)
Print the bad channels.
Definition: UtilsClient.cc:14
float pedPnDiscrepancyMean_[2]
void setPedRMSG16(float mean)
Definition: MonPNMGPADat.h:42
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
static int getFirstNonEmptyChannel(const TProfile2D *histo)
Find the first non empty bin.
Definition: UtilsClient.cc:246
void endRun(void)
EndRun.
std::vector< int > superModules_
void endJob(void)
EndJob.