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