CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EBSummaryClient.cc
Go to the documentation of this file.
1 /*
2  * \file EBSummaryClient.cc
3  *
4  * \author G. Della Ricca
5  *
6 */
7 
8 #include <memory>
9 #include <iostream>
10 #include <fstream>
11 #include <iomanip>
12 
14 
17 
18 #ifdef WITH_ECAL_COND_DB
21 #endif
22 
26 
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  subfolder_ = ps.getUntrackedParameter<std::string>("subfolder", "");
55 
56  // enableCleanup_ switch
57  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
58 
59  produceReports_ = ps.getUntrackedParameter<bool>("produceReports", true);
60 
61  reducedReports_ = ps.getUntrackedParameter<bool>("reducedReports", false);
62 
63  // vector of selected Super Modules (Defaults to all 36).
64  superModules_.reserve(36);
65  for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
66  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
67 
68  laserWavelengths_.reserve(4);
69  for ( unsigned int i = 1; i <= 4; i++ ) laserWavelengths_.push_back(i);
70  laserWavelengths_ = ps.getUntrackedParameter<std::vector<int> >("laserWavelengths", laserWavelengths_);
71 
72  MGPAGains_.reserve(3);
73  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
74  MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
75 
76  MGPAGainsPN_.reserve(2);
77  for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
78  MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
79 
80  timingNHitThreshold_ = ps.getUntrackedParameter<int>("timingNHitThreshold", 5);
81 
82  synchErrorThreshold_ = ps.getUntrackedParameter<double>("synchErrorThreshold", 0.01);
83 
84  // summary maps
85  meIntegrity_ = 0;
86  meIntegrityPN_ = 0;
87  meOccupancy_ = 0;
88  meOccupancyPN_ = 0;
89  meStatusFlags_ = 0;
94 
95  meLaserL1_ = 0;
96  meLaserL1PN_ = 0;
97  meLaserL1Ampl_ = 0;
98  meLaserL1Timing_ = 0;
100 
101  meLaserL2_ = 0;
102  meLaserL2PN_ = 0;
103  meLaserL2Ampl_ = 0;
104  meLaserL2Timing_ = 0;
106 
107  meLaserL3_ = 0;
108  meLaserL3PN_ = 0;
109  meLaserL3Ampl_ = 0;
110  meLaserL3Timing_ = 0;
112 
113  meLaserL4_ = 0;
114  meLaserL4PN_ = 0;
115  meLaserL4Ampl_ = 0;
116  meLaserL4Timing_ = 0;
118 
119  mePedestalG01_ = 0;
120  mePedestalG06_ = 0;
121  mePedestalG12_ = 0;
122  mePedestalPNG01_ = 0;
123  mePedestalPNG16_ = 0;
124  meTestPulseG01_ = 0;
125  meTestPulseG06_ = 0;
126  meTestPulseG12_ = 0;
127  meTestPulsePNG01_ = 0;
128  meTestPulsePNG16_ = 0;
132  meGlobalSummary_ = 0;
133 
134  meRecHitEnergy_ = 0;
135  meTiming_ = 0;
136  meTimingMean1D_ = 0;
137  meTimingRMS1D_ = 0;
138  meTimingMean_ = 0;
139  meTimingRMS_ = 0;
140  meTriggerTowerEt_ = 0;
144 
145  // summary errors
146  meIntegrityErr_ = 0;
147  meOccupancy1D_ = 0;
148  meStatusFlagsErr_ = 0;
150  meLaserL1Err_ = 0;
151  meLaserL1PNErr_ = 0;
152  meLaserL2Err_ = 0;
153  meLaserL2PNErr_ = 0;
154  meLaserL3Err_ = 0;
155  meLaserL3PNErr_ = 0;
156  meLaserL4Err_ = 0;
157  meLaserL4PNErr_ = 0;
158 
159  meSummaryErr_ = 0;
160 
161  // additional histograms from tasks
162  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
163 
164  int ism = superModules_[i];
165 
166  hpot01_[ism-1] = 0;
167  httt01_[ism-1] = 0;
168  htmt01_[ism-1] = 0;
169 
170  }
171 }
172 
174 
175 }
176 
178 
180 
181  if ( debug_ ) std::cout << "EBSummaryClient: beginJob" << std::endl;
182 
183  ievt_ = 0;
184  jevt_ = 0;
185 
186 }
187 
189 
190  if ( debug_ ) std::cout << "EBSummaryClient: beginRun" << std::endl;
191 
192  jevt_ = 0;
193 
194  this->setup();
195 
196 }
197 
199 
200  if ( debug_ ) std::cout << "EBSummaryClient: endJob, ievt = " << ievt_ << std::endl;
201 
202  this->cleanup();
203 
204 }
205 
207 
208  if ( debug_ ) std::cout << "EBSummaryClient: endRun, jevt = " << jevt_ << std::endl;
209 
210  this->cleanup();
211 
212 }
213 
215 
216  bool integrityClient(false);
217  bool occupancyClient(false);
218  bool statusFlagsClient(false);
219  bool pedestalOnlineClient(false);
220  bool laserClient(false);
221  bool pedestalClient(false);
222  bool testPulseClient(false);
223  bool timingClient(false);
224  bool triggerTowerClient(false);
225 
226  for(unsigned i = 0; i < clients_.size(); i++){
227 
228  if(dynamic_cast<EBIntegrityClient*>(clients_[i])) integrityClient = true;
229  if(dynamic_cast<EBOccupancyClient*>(clients_[i])) occupancyClient = true;
230  if(dynamic_cast<EBStatusFlagsClient*>(clients_[i])) statusFlagsClient = true;
231  if(dynamic_cast<EBPedestalOnlineClient*>(clients_[i])) pedestalOnlineClient = true;
232  if(dynamic_cast<EBLaserClient*>(clients_[i])) laserClient = true;
233  if(dynamic_cast<EBPedestalClient*>(clients_[i])) pedestalClient = true;
234  if(dynamic_cast<EBTestPulseClient*>(clients_[i])) testPulseClient = true;
235  if(dynamic_cast<EBTimingClient*>(clients_[i])) timingClient = true;
236  if(dynamic_cast<EBTriggerTowerClient*>(clients_[i])) triggerTowerClient = true;
237 
238  }
239 
241 
242  dqmStore_->setCurrentFolder( prefixME_ + "/EBSummaryClient" );
243 
244  if(integrityClient){
245  if(produceReports_){
247  name = "EBIT integrity quality summary";
248  meIntegrity_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
249  meIntegrity_->setAxisTitle("jphi", 1);
250  meIntegrity_->setAxisTitle("jeta", 2);
251 
253  name = "EBIT integrity quality errors summary";
254  meIntegrityErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
255  for (int i = 0; i < 36; i++) {
256  meIntegrityErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
257  }
258  }
259  if(laserClient){
261  name = "EBIT PN integrity quality summary";
262  meIntegrityPN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
263  meIntegrityPN_->setAxisTitle("jchannel", 1);
264  meIntegrityPN_->setAxisTitle("jpseudo-strip", 2);
265  }
266  }
267 
268  if(occupancyClient){
269  if(produceReports_){
271  name = "EBOT digi occupancy summary";
272  meOccupancy_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
273  meOccupancy_->setAxisTitle("jphi", 1);
274  meOccupancy_->setAxisTitle("jeta", 2);
275 
277  name = "EBOT digi occupancy summary 1D";
278  meOccupancy1D_ = dqmStore_->book1D(name, name, 36, 1, 37);
279  for (int i = 0; i < 36; i++) {
280  meOccupancy1D_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
281  }
282 
284  name = "EBOT energy summary";
285  meRecHitEnergy_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
286  meRecHitEnergy_->setAxisTitle("jphi", 1);
287  meRecHitEnergy_->setAxisTitle("jeta", 2);
288  meRecHitEnergy_->setAxisTitle("energy (GeV)", 3);
289  }
290  if(laserClient){
292  name = "EBOT PN digi occupancy summary";
293  meOccupancyPN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
294  meOccupancyPN_->setAxisTitle("jchannel", 1);
295  meOccupancyPN_->setAxisTitle("jpseudo-strip", 2);
296  }
297 
298  }
299 
300  if(statusFlagsClient && produceReports_){
302  name = "EBSFT front-end status summary";
303  meStatusFlags_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
304  meStatusFlags_->setAxisTitle("jphi'", 1);
305  meStatusFlags_->setAxisTitle("jeta'", 2);
306 
308  name = "EBSFT front-end status errors summary";
309  meStatusFlagsErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
310  for (int i = 0; i < 36; i++) {
311  meStatusFlagsErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
312  }
313  }
314 
315  if(pedestalOnlineClient && produceReports_){
317  name = "EBPOT pedestal quality summary G12";
318  mePedestalOnline_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
319  mePedestalOnline_->setAxisTitle("jphi", 1);
320  mePedestalOnline_->setAxisTitle("jeta", 2);
321 
323  name = "EBPOT pedestal quality errors summary G12";
324  mePedestalOnlineErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
325  for (int i = 0; i < 36; i++) {
326  mePedestalOnlineErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
327  }
328 
330  name = "EBPOT pedestal G12 RMS map";
331  mePedestalOnlineRMSMap_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
335 
337  name = "EBPOT pedestal G12 mean";
338  mePedestalOnlineMean_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 150., 250.);
339  for (int i = 0; i < 36; i++) {
340  mePedestalOnlineMean_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
341  }
342 
344  name = "EBPOT pedestal G12 rms";
345  mePedestalOnlineRMS_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10.);
346  for (int i = 0; i < 36; i++) {
347  mePedestalOnlineRMS_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
348  }
349  }
350 
351  if(laserClient){
352 
353  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
354 
356  name = "EBLT laser quality summary L1";
357  meLaserL1_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
358  meLaserL1_->setAxisTitle("jphi", 1);
359  meLaserL1_->setAxisTitle("jeta", 2);
360 
362  name = "EBLT laser quality errors summary L1";
363  meLaserL1Err_ = dqmStore_->book1D(name, name, 36, 1, 37);
364  for (int i = 0; i < 36; i++) {
365  meLaserL1Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
366  }
367 
369  name = "EBLT PN laser quality summary L1";
370  meLaserL1PN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
371  meLaserL1PN_->setAxisTitle("jchannel", 1);
372  meLaserL1PN_->setAxisTitle("jpseudo-strip", 2);
373 
375  name = "EBLT PN laser quality errors summary L1";
376  meLaserL1PNErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
377  for (int i = 0; i < 36; i++) {
378  meLaserL1PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
379  }
380 
382  name = "EBLT laser L1 amplitude summary";
383  meLaserL1Ampl_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096., "s");
384  for (int i = 0; i < 36; i++) {
385  meLaserL1Ampl_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
386  }
387 
389  name = "EBLT laser L1 timing summary";
390  meLaserL1Timing_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10., "s");
391  for (int i = 0; i < 36; i++) {
392  meLaserL1Timing_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
393  }
394 
396  name = "EBLT laser L1 amplitude over PN summary";
397  meLaserL1AmplOverPN_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
398  for (int i = 0; i < 36; i++) {
399  meLaserL1AmplOverPN_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
400  }
401 
402  }
403 
404  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
405 
407  name = "EBLT laser quality summary L2";
408  meLaserL2_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
409  meLaserL2_->setAxisTitle("jphi", 1);
410  meLaserL2_->setAxisTitle("jeta", 2);
411 
413  name = "EBLT laser quality errors summary L2";
414  meLaserL2Err_ = dqmStore_->book1D(name, name, 36, 1, 37);
415  for (int i = 0; i < 36; i++) {
416  meLaserL2Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
417  }
418 
420  name = "EBLT PN laser quality summary L2";
421  meLaserL2PN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
422  meLaserL2PN_->setAxisTitle("jchannel", 1);
423  meLaserL2PN_->setAxisTitle("jpseudo-strip", 2);
424 
426  name = "EBLT PN laser quality errors summary L2";
427  meLaserL2PNErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
428  for (int i = 0; i < 36; i++) {
429  meLaserL2PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
430  }
431 
433  name = "EBLT laser L2 amplitude summary";
434  meLaserL2Ampl_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096., "s");
435  for (int i = 0; i < 36; i++) {
436  meLaserL2Ampl_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
437  }
438 
440  name = "EBLT laser L2 timing summary";
441  meLaserL2Timing_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10., "s");
442  for (int i = 0; i < 36; i++) {
443  meLaserL2Timing_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
444  }
445 
447  name = "EBLT laser L2 amplitude over PN summary";
448  meLaserL2AmplOverPN_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
449  for (int i = 0; i < 36; i++) {
450  meLaserL2AmplOverPN_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
451  }
452 
453  }
454 
455  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
456 
458  name = "EBLT laser quality summary L3";
459  meLaserL3_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
460  meLaserL3_->setAxisTitle("jphi", 1);
461  meLaserL3_->setAxisTitle("jeta", 2);
462 
464  name = "EBLT laser quality errors summary L3";
465  meLaserL3Err_ = dqmStore_->book1D(name, name, 36, 1, 37);
466  for (int i = 0; i < 36; i++) {
467  meLaserL3Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
468  }
469 
471  name = "EBLT PN laser quality summary L3";
472  meLaserL3PN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
473  meLaserL3PN_->setAxisTitle("jchannel", 1);
474  meLaserL3PN_->setAxisTitle("jpseudo-strip", 2);
475 
477  name = "EBLT PN laser quality errors summary L3";
478  meLaserL3PNErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
479  for (int i = 0; i < 36; i++) {
480  meLaserL3PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
481  }
482 
484  name = "EBLT laser L3 amplitude summary";
485  meLaserL3Ampl_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096., "s");
486  for (int i = 0; i < 36; i++) {
487  meLaserL3Ampl_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
488  }
489 
491  name = "EBLT laser L3 timing summary";
492  meLaserL3Timing_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10., "s");
493  for (int i = 0; i < 36; i++) {
494  meLaserL3Timing_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
495  }
496 
498  name = "EBLT laser L3 amplitude over PN summary";
499  meLaserL3AmplOverPN_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
500  for (int i = 0; i < 36; i++) {
501  meLaserL3AmplOverPN_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
502  }
503 
504  }
505 
506  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
507 
509  name = "EBLT laser quality summary L4";
510  meLaserL4_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
511  meLaserL4_->setAxisTitle("jphi", 1);
512  meLaserL4_->setAxisTitle("jeta", 2);
513 
515  name = "EBLT laser quality errors summary L4";
516  meLaserL4Err_ = dqmStore_->book1D(name, name, 36, 1, 37);
517  for (int i = 0; i < 36; i++) {
518  meLaserL4Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
519  }
520 
522  name = "EBLT PN laser quality summary L4";
523  meLaserL4PN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
524  meLaserL4PN_->setAxisTitle("jchannel", 1);
525  meLaserL4PN_->setAxisTitle("jpseudo-strip", 2);
526 
528  name = "EBLT PN laser quality errors summary L4";
529  meLaserL4PNErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
530  for (int i = 0; i < 36; i++) {
531  meLaserL4PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
532  }
533 
535  name = "EBLT laser L4 amplitude summary";
536  meLaserL4Ampl_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096., "s");
537  for (int i = 0; i < 36; i++) {
538  meLaserL4Ampl_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
539  }
540 
542  name = "EBLT laser L4 timing summary";
543  meLaserL4Timing_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10., "s");
544  for (int i = 0; i < 36; i++) {
545  meLaserL4Timing_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
546  }
547 
549  name = "EBLT laser L4 amplitude over PN summary";
550  meLaserL4AmplOverPN_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
551  for (int i = 0; i < 36; i++) {
552  meLaserL4AmplOverPN_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
553  }
554 
555  }
556  }
557 
558  if(pedestalClient){
559  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
560 
562  name = "EBPT pedestal quality G01 summary";
563  mePedestalG01_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
564  mePedestalG01_->setAxisTitle("jphi", 1);
565  mePedestalG01_->setAxisTitle("jeta", 2);
566 
567  }
568 
569  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
570 
572  name = "EBPT pedestal quality G06 summary";
573  mePedestalG06_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
574  mePedestalG06_->setAxisTitle("jphi", 1);
575  mePedestalG06_->setAxisTitle("jeta", 2);
576 
577  }
578 
579  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
580 
582  name = "EBPT pedestal quality G12 summary";
583  mePedestalG12_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
584  mePedestalG12_->setAxisTitle("jphi", 1);
585  mePedestalG12_->setAxisTitle("jeta", 2);
586 
587  }
588 
589  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
590 
592  name = "EBPT PN pedestal quality G01 summary";
593  mePedestalPNG01_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10, 10.);
594  mePedestalPNG01_->setAxisTitle("jchannel", 1);
595  mePedestalPNG01_->setAxisTitle("jpseudo-strip", 2);
596 
597  }
598 
599  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
600 
602  name = "EBPT PN pedestal quality G16 summary";
603  mePedestalPNG16_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10, 10.);
604  mePedestalPNG16_->setAxisTitle("jchannel", 1);
605  mePedestalPNG16_->setAxisTitle("jpseudo-strip", 2);
606 
607  }
608  }
609 
610  if(testPulseClient){
611  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
612 
614  name = "EBTPT test pulse quality G01 summary";
615  meTestPulseG01_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
616  meTestPulseG01_->setAxisTitle("jphi", 1);
617  meTestPulseG01_->setAxisTitle("jeta", 2);
618 
619  }
620 
621  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
622 
624  name = "EBTPT test pulse quality G06 summary";
625  meTestPulseG06_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
626  meTestPulseG06_->setAxisTitle("jphi", 1);
627  meTestPulseG06_->setAxisTitle("jeta", 2);
628 
629  }
630 
631  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
632 
634  name = "EBTPT test pulse quality G12 summary";
635  meTestPulseG12_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
636  meTestPulseG12_->setAxisTitle("jphi", 1);
637  meTestPulseG12_->setAxisTitle("jeta", 2);
638 
639  }
640 
641  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
642 
644  name = "EBTPT PN test pulse quality G01 summary";
645  meTestPulsePNG01_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
646  meTestPulsePNG01_->setAxisTitle("jchannel", 1);
647  meTestPulsePNG01_->setAxisTitle("jpseudo-strip", 2);
648 
649  }
650 
651  if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
652 
654  name = "EBTPT PN test pulse quality G16 summary";
655  meTestPulsePNG16_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
656  meTestPulsePNG16_->setAxisTitle("jchannel", 1);
657  meTestPulsePNG16_->setAxisTitle("jpseudo-strip", 2);
658 
659  }
660 
661  if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
662 
664  name = "EBTPT test pulse amplitude G01 summary";
665  meTestPulseAmplG01_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
666  for (int i = 0; i < 36; i++) {
667  meTestPulseAmplG01_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
668  }
669 
670  }
671 
672  if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
673 
675  name = "EBTPT test pulse amplitude G06 summary";
676  meTestPulseAmplG06_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
677  for (int i = 0; i < 36; i++) {
678  meTestPulseAmplG06_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
679  }
680 
681  }
682 
683  if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
684 
686  name = "EBTPT test pulse amplitude G12 summary";
687  meTestPulseAmplG12_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
688  for (int i = 0; i < 36; i++) {
689  meTestPulseAmplG12_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
690  }
691 
692  }
693  }
694 
695  if(timingClient){
697  name = "EBTMT timing quality summary";
698  meTiming_ = dqmStore_->book2D(name, name, 72, 0., 360., 34, -85., 85.);
699  meTiming_->setAxisTitle("jphi", 1);
700  meTiming_->setAxisTitle("jeta", 2);
701 
703  name = "EBTMT timing mean 1D summary";
704  meTimingMean1D_ = dqmStore_->book1D(name, name, 100, -25., 25.);
705  meTimingMean1D_->setAxisTitle("mean (ns)", 1);
706 
708  name = "EBTMT timing rms 1D summary";
709  meTimingRMS1D_ = dqmStore_->book1D(name, name, 100, 0.0, 10.0);
710  meTimingRMS1D_->setAxisTitle("rms (ns)", 1);
711 
713  name = "EBTMT timing mean";
714  meTimingMean_ = dqmStore_->bookProfile(name, name, 36, 1, 37, -20., 20.,"");
715  for (int i = 0; i < 36; i++) {
716  meTimingMean_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
717  }
718  meTimingMean_->setAxisTitle("mean (ns)", 2);
719 
721  name = "EBTMT timing rms";
722  meTimingRMS_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10.,"");
723  for (int i = 0; i < 36; i++) {
724  meTimingRMS_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
725  }
726  meTimingRMS_->setAxisTitle("rms (ns)", 2);
727  }
728 
729  if(triggerTowerClient){
731  name = "EBTTT Et trigger tower summary";
732  meTriggerTowerEt_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
733  meTriggerTowerEt_->setAxisTitle("jphi'", 1);
734  meTriggerTowerEt_->setAxisTitle("jeta'", 2);
735  meTriggerTowerEt_->setAxisTitle("Et (GeV)", 3);
736 
738  name = "EBTTT emulator error quality summary";
739  meTriggerTowerEmulError_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
742 
744  name = "EBTTT Trigger Primitives Timing summary";
745  meTriggerTowerTiming_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
746  meTriggerTowerTiming_->setAxisTitle("jphi'", 1);
747  meTriggerTowerTiming_->setAxisTitle("jeta'", 2);
748  meTriggerTowerTiming_->setAxisTitle("TP data matching emulator", 3);
749 
751  name = "EBTTT Trigger Primitives Non Single Timing summary";
752  meTriggerTowerNonSingleTiming_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
756  }
757 
760  name = "EB global summary";
761  meGlobalSummary_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
762  meGlobalSummary_->setAxisTitle("jphi", 1);
763  meGlobalSummary_->setAxisTitle("jeta", 2);
764 
766  name = "EB global summary errors";
767  meSummaryErr_ = dqmStore_->book1D(name, name, 1, 0., 1.);
768  }
769 }
770 
772 
773  if ( ! enableCleanup_ ) return;
774 
775  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
776 
777  int ism = superModules_[i];
778 
779  if ( cloneME_ ) {
780  if ( hpot01_[ism-1] ) delete hpot01_[ism-1];
781  if ( httt01_[ism-1] ) delete httt01_[ism-1];
782  }
783 
784  hpot01_[ism-1] = 0;
785  httt01_[ism-1] = 0;
786 
787  }
788 
789  dqmStore_->setCurrentFolder( prefixME_ + "/EBSummaryClient" );
790 
792  meIntegrity_ = 0;
793 
795  meIntegrityErr_ = 0;
796 
798  meIntegrityPN_ = 0;
799 
801  meOccupancy_ = 0;
802 
804  meOccupancy1D_ = 0;
805 
807  meOccupancyPN_ = 0;
808 
810  meStatusFlags_ = 0;
811 
813  meStatusFlagsErr_ = 0;
814 
816  mePedestalOnline_ = 0;
817 
820 
823 
826 
829 
831  meLaserL1_ = 0;
832 
834  meLaserL1Err_ = 0;
835 
837  meLaserL1Ampl_ = 0;
838 
840  meLaserL1Timing_ = 0;
841 
844 
846  meLaserL1PN_ = 0;
847 
849  meLaserL1PNErr_ = 0;
850 
852  meLaserL2_ = 0;
853 
855  meLaserL2Err_ = 0;
856 
858  meLaserL2Ampl_ = 0;
859 
861  meLaserL2Timing_ = 0;
862 
865 
867  meLaserL2PN_ = 0;
868 
870  meLaserL2PNErr_ = 0;
871 
873  meLaserL3_ = 0;
874 
876  meLaserL3Err_ = 0;
877 
879  meLaserL3Ampl_ = 0;
880 
882  meLaserL3Timing_ = 0;
883 
886 
888  meLaserL3PN_ = 0;
889 
891  meLaserL3PNErr_ = 0;
892 
894  meLaserL4_ = 0;
895 
897  meLaserL4Err_ = 0;
898 
900  meLaserL4Ampl_ = 0;
901 
903  meLaserL4Timing_ = 0;
904 
907 
909  meLaserL4PN_ = 0;
910 
912  meLaserL4PNErr_ = 0;
913 
915  mePedestalG01_ = 0;
916 
918  mePedestalG06_ = 0;
919 
921  mePedestalG12_ = 0;
922 
924  meTestPulseG01_ = 0;
925 
927  meTestPulseG06_ = 0;
928 
930  meTestPulseG12_ = 0;
931 
933  meTestPulseG01_ = 0;
934 
937 
940 
943 
945  meRecHitEnergy_ = 0;
946 
948  meTiming_ = 0;
949 
951  meTimingMean1D_ = 0;
952 
954  meTimingRMS1D_ = 0;
955 
957  meTimingMean_ = 0;
958 
960  meTimingRMS_ = 0;
961 
963  meTriggerTowerEt_ = 0;
964 
967 
970 
973 
975  meGlobalSummary_ = 0;
976 
978  meSummaryErr_ = 0;
979 }
980 
981 #ifdef WITH_ECAL_COND_DB
982 bool EBSummaryClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
983 
984  status = true;
985 
986  return true;
987 
988 }
989 #endif
990 
992 
993  ievt_++;
994  jevt_++;
995  if ( ievt_ % 10 == 0 ) {
996  if ( debug_ ) std::cout << "EBSummaryClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
997  }
998 
999  uint32_t chWarnBit = 1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING;
1000 
1001  for ( int iex = 1; iex <= 170; iex++ ) {
1002  for ( int ipx = 1; ipx <= 360; ipx++ ) {
1003 
1004  if ( meIntegrity_ ) meIntegrity_->setBinContent( ipx, iex, 6. );
1005  if ( meOccupancy_ ) meOccupancy_->setBinContent( ipx, iex, 0. );
1006  if ( meStatusFlags_ ) meStatusFlags_->setBinContent( ipx, iex, 6. );
1007  if ( mePedestalOnline_ ) mePedestalOnline_->setBinContent( ipx, iex, 6. );
1009  if ( meLaserL1_ ) meLaserL1_->setBinContent( ipx, iex, 6. );
1010  if ( meLaserL2_ ) meLaserL2_->setBinContent( ipx, iex, 6. );
1011  if ( meLaserL3_ ) meLaserL3_->setBinContent( ipx, iex, 6. );
1012  if ( meLaserL4_ ) meLaserL4_->setBinContent( ipx, iex, 6. );
1013  if ( mePedestalG01_ ) mePedestalG01_->setBinContent( ipx, iex, 6. );
1014  if ( mePedestalG06_ ) mePedestalG06_->setBinContent( ipx, iex, 6. );
1015  if ( mePedestalG12_ ) mePedestalG12_->setBinContent( ipx, iex, 6. );
1016  if ( meTestPulseG01_ ) meTestPulseG01_->setBinContent( ipx, iex, 6. );
1017  if ( meTestPulseG06_ ) meTestPulseG06_->setBinContent( ipx, iex, 6. );
1018  if ( meTestPulseG12_ ) meTestPulseG12_->setBinContent( ipx, iex, 6. );
1019 
1020  if ( meRecHitEnergy_ ) meRecHitEnergy_->setBinContent( ipx, iex, 0. );
1021 
1022  if(meGlobalSummary_ ) meGlobalSummary_->setBinContent( ipx, iex, 6. );
1023 
1024  }
1025  }
1026 
1027  for ( int iex = 1; iex <= 20; iex++ ) {
1028  for ( int ipx = 1; ipx <= 90; ipx++ ) {
1029 
1030  if ( meIntegrityPN_ ) meIntegrityPN_->setBinContent( ipx, iex, 6. );
1031  if ( meOccupancyPN_ ) meOccupancyPN_->setBinContent( ipx, iex, 0. );
1032  if ( meLaserL1PN_ ) meLaserL1PN_->setBinContent( ipx, iex, 6. );
1033  if ( meLaserL2PN_ ) meLaserL2PN_->setBinContent( ipx, iex, 6. );
1034  if ( meLaserL3PN_ ) meLaserL3PN_->setBinContent( ipx, iex, 6. );
1035  if ( meLaserL4PN_ ) meLaserL4PN_->setBinContent( ipx, iex, 6. );
1036  if ( mePedestalPNG01_ ) mePedestalPNG01_->setBinContent( ipx, iex, 6. );
1037  if ( mePedestalPNG16_ ) mePedestalPNG16_->setBinContent( ipx, iex, 6. );
1038  if ( meTestPulsePNG01_ ) meTestPulsePNG01_->setBinContent( ipx, iex, 6. );
1039  if ( meTestPulsePNG16_ ) meTestPulsePNG16_->setBinContent( ipx, iex, 6. );
1040 
1041  }
1042  }
1043 
1044  for ( int iex = 1; iex <= 34; iex++ ) {
1045  for ( int ipx = 1; ipx <= 72; ipx++ ) {
1046  if ( meTriggerTowerEt_ ) meTriggerTowerEt_->setBinContent( ipx, iex, 0. );
1050  if ( meTiming_ ) meTiming_->setBinContent( ipx, iex, 6. );
1051  }
1052  }
1053 
1054  if ( meIntegrity_ ) meIntegrity_->setEntries( 0 );
1057  if ( meOccupancy_ ) meOccupancy_->setEntries( 0 );
1067 
1068  if ( meLaserL1_ ) meLaserL1_->setEntries( 0 );
1069  if ( meLaserL1Err_ ) meLaserL1Err_->Reset();
1073  if ( meLaserL1PN_ ) meLaserL1PN_->setEntries( 0 );
1075 
1076  if ( meLaserL2_ ) meLaserL2_->setEntries( 0 );
1077  if ( meLaserL2Err_ ) meLaserL2Err_->Reset();
1081  if ( meLaserL2PN_ ) meLaserL2PN_->setEntries( 0 );
1083 
1084  if ( meLaserL3_ ) meLaserL3_->setEntries( 0 );
1085  if ( meLaserL3Err_ ) meLaserL3Err_->Reset();
1089  if ( meLaserL3PN_ ) meLaserL3PN_->setEntries( 0 );
1091 
1092  if ( meLaserL4_ ) meLaserL4_->setEntries( 0 );
1093  if ( meLaserL4Err_ ) meLaserL4Err_->Reset();
1097  if ( meLaserL4PN_ ) meLaserL4PN_->setEntries( 0 );
1099 
1113 
1115  if ( meTiming_ ) meTiming_->setEntries( 0 );
1118  if ( meTimingMean_ ) meTimingMean_->Reset();
1119  if ( meTimingRMS_ ) meTimingRMS_->Reset();
1124 
1126 
1128 
1129  MonitorElement* me(0);
1130  me = dqmStore_->get(prefixME_ + "/EBTimingTask/EBTMT timing map");
1131  TProfile2D* htmt(0);
1132  htmt = UtilsClient::getHisto(me, false, htmt);
1133 
1134  std::string subdir(subfolder_ == "" ? "" : subfolder_ + "/");
1135 
1136  TH1F* oosTrend(0);
1137 
1138  for ( unsigned int i=0; i<clients_.size(); i++ ) {
1139 
1140  EBIntegrityClient* ebic = dynamic_cast<EBIntegrityClient*>(clients_[i]);
1141  EBStatusFlagsClient* ebsfc = dynamic_cast<EBStatusFlagsClient*>(clients_[i]);
1142  if(!produceReports_) ebsfc = 0;
1143  EBPedestalOnlineClient* ebpoc = dynamic_cast<EBPedestalOnlineClient*>(clients_[i]);
1144  if(!produceReports_) ebpoc = 0;
1145 
1146  EBLaserClient* eblc = dynamic_cast<EBLaserClient*>(clients_[i]);
1147  EBPedestalClient* ebpc = dynamic_cast<EBPedestalClient*>(clients_[i]);
1148  EBTestPulseClient* ebtpc = dynamic_cast<EBTestPulseClient*>(clients_[i]);
1149 
1150  EBTimingClient* ebtmc = dynamic_cast<EBTimingClient*>(clients_[i]);
1151  EBTriggerTowerClient* ebtttc = dynamic_cast<EBTriggerTowerClient*>(clients_[i]);
1152 
1153  MonitorElement *me_01, *me_02, *me_03;
1154  MonitorElement *me_04, *me_05;
1155  // MonitorElement *me_f[6], *me_fg[2];
1156  TH2F* h2;
1157  TH2F* h3;
1158 
1159  me = dqmStore_->get( prefixME_ + "/EcalInfo/EBMM DCC" );
1161 
1162  me = dqmStore_->get( prefixME_ + "/EBRawDataTask/" + subdir + "EBRDT L1A FE errors" );
1164 
1165  me = dqmStore_->get(prefixME_ + "/EBRawDataTask/" + subdir + "EBRDT accumulated FE synchronization errors");
1166  oosTrend = UtilsClient::getHisto(me, cloneME_, oosTrend);
1167 
1168  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
1169 
1170  int ism = superModules_[i];
1171 
1172  me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/" + subdir + "EBOT rec hit energy " + Numbers::sEB(ism) );
1173  hot01_[ism-1] = UtilsClient::getHisto( me, cloneME_, hot01_[ism-1] );
1174 
1175  me = dqmStore_->get( prefixME_ + "/EBPedestalOnlineTask/"+ subdir + "Gain12/EBPOT pedestal " + Numbers::sEB(ism) + " G12" );
1176  hpot01_[ism-1] = UtilsClient::getHisto( me, cloneME_, hpot01_[ism-1] );
1177 
1178  me = dqmStore_->get( prefixME_ + "/EBTriggerTowerTask/EBTTT Et map Real Digis " + Numbers::sEB(ism) );
1179  httt01_[ism-1] = UtilsClient::getHisto( me, cloneME_, httt01_[ism-1] );
1180 
1181  me = dqmStore_->get( prefixME_ + "/EBTimingTask/EBTMT timing " + Numbers::sEB(ism) );
1182  htmt01_[ism-1] = UtilsClient::getHisto( me, cloneME_, htmt01_[ism-1] );
1183 
1184  for ( int ie = 1; ie <= 85; ie++ ) {
1185  for ( int ip = 1; ip <= 20; ip++ ) {
1186 
1187  if ( ebic ) {
1188 
1189  me = ebic->meg01_[ism-1];
1190 
1191  if ( me ) {
1192 
1193  float xval = me->getBinContent( ie, ip );
1194 
1195  int iex;
1196  int ipx;
1197 
1198  if ( ism <= 18 ) {
1199  iex = 1+(85-ie);
1200  ipx = ip+20*(ism-1);
1201  } else {
1202  iex = 85+ie;
1203  ipx = 1+(20-ip)+20*(ism-19);
1204  }
1205 
1206  if(meIntegrity_) meIntegrity_->setBinContent( ipx, iex, xval );
1207  if( xval == 0 && meIntegrityErr_) meIntegrityErr_->Fill( ism );
1208 
1209  }
1210 
1211  h2 = ebic->h_[ism-1];
1212 
1213  if ( h2 ) {
1214 
1215  float xval = h2->GetBinContent( ie, ip );
1216 
1217  int iex;
1218  int ipx;
1219 
1220  if ( ism <= 18 ) {
1221  iex = 1+(85-ie);
1222  ipx = ip+20*(ism-1);
1223  } else {
1224  iex = 85+ie;
1225  ipx = 1+(20-ip)+20*(ism-19);
1226  }
1227 
1228  if(meOccupancy_) meOccupancy_->setBinContent( ipx, iex, xval );
1229  if ( xval != 0 && meOccupancy1D_) meOccupancy1D_->Fill( ism, xval );
1230 
1231  }
1232 
1233  }
1234 
1235  if ( ebpoc ) {
1236 
1237  me = ebpoc->meg03_[ism-1];
1238 
1239  if ( me ) {
1240 
1241  int iex;
1242  int ipx;
1243 
1244  if ( ism <= 18 ) {
1245  iex = 1+(85-ie);
1246  ipx = ip+20*(ism-1);
1247  } else {
1248  iex = 85+ie;
1249  ipx = 1+(20-ip)+20*(ism-19);
1250  }
1251 
1252  float xval = me->getBinContent( ie, ip );
1253 
1254  if(mePedestalOnline_) mePedestalOnline_->setBinContent( ipx, iex, xval );
1255  if ( xval == 0 && mePedestalOnlineErr_ ) mePedestalOnlineErr_->Fill( ism );
1256 
1257  }
1258 
1259  float num01, mean01, rms01;
1260  bool update01 = UtilsClient::getBinStatistics(hpot01_[ism-1], ie, ip, num01, mean01, rms01);
1261 
1262  if ( update01 ) {
1263 
1264  int iex;
1265  int ipx;
1266 
1267  if ( ism <= 18 ) {
1268  iex = 1+(85-ie);
1269  ipx = ip+20*(ism-1);
1270  } else {
1271  iex = 85+ie;
1272  ipx = 1+(20-ip)+20*(ism-19);
1273  }
1274 
1276 
1277  if(mePedestalOnlineRMS_) mePedestalOnlineRMS_->Fill( ism, rms01 );
1278 
1279  if(mePedestalOnlineMean_) mePedestalOnlineMean_->Fill( ism, mean01 );
1280 
1281  }
1282 
1283  }
1284 
1285  if ( eblc ) {
1286 
1287  int iex;
1288  int ipx;
1289 
1290  if ( ism <= 18 ) {
1291  iex = 1+(85-ie);
1292  ipx = ip+20*(ism-1);
1293  } else {
1294  iex = 85+ie;
1295  ipx = 1+(20-ip)+20*(ism-19);
1296  }
1297 
1298  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1299 
1300  me = eblc->meg01_[ism-1];
1301 
1302  if ( me ) {
1303 
1304  float xval = me->getBinContent( ie, ip );
1305 
1306  if ( me->getEntries() != 0 ) {
1307  meLaserL1_->setBinContent( ipx, iex, xval );
1308  if ( xval == 0 ) meLaserL1Err_->Fill( ism );
1309  }
1310 
1311  }
1312 
1313  }
1314 
1315  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1316 
1317  me = eblc->meg02_[ism-1];
1318 
1319  if ( me ) {
1320 
1321  float xval = me->getBinContent( ie, ip );
1322 
1323  if ( me->getEntries() != 0 ) {
1324  meLaserL2_->setBinContent( ipx, iex, xval );
1325  if ( xval == 0 ) meLaserL2Err_->Fill( ism );
1326  }
1327 
1328  }
1329 
1330  }
1331 
1332  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1333 
1334  me = eblc->meg03_[ism-1];
1335 
1336  if ( me ) {
1337 
1338  float xval = me->getBinContent( ie, ip );
1339 
1340  if ( me->getEntries() != 0 ) {
1341  meLaserL3_->setBinContent( ipx, iex, xval );
1342  if ( xval == 0 ) meLaserL3Err_->Fill( ism );
1343  }
1344 
1345  }
1346 
1347  }
1348 
1349  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1350 
1351  me = eblc->meg04_[ism-1];
1352 
1353  if ( me ) {
1354 
1355  float xval = me->getBinContent( ie, ip );
1356 
1357  if ( me->getEntries() != 0 ) {
1358  meLaserL4_->setBinContent( ipx, iex, xval );
1359  if ( xval == 0 ) meLaserL4Err_->Fill( ism );
1360  }
1361 
1362  }
1363 
1364  }
1365 
1366  }
1367 
1368  if ( ebpc ) {
1369 
1370  me_01 = ebpc->meg01_[ism-1];
1371  me_02 = ebpc->meg02_[ism-1];
1372  me_03 = ebpc->meg03_[ism-1];
1373 
1374  int iex;
1375  int ipx;
1376 
1377  if ( ism <= 18 ) {
1378  iex = 1+(85-ie);
1379  ipx = ip+20*(ism-1);
1380  } else {
1381  iex = 85+ie;
1382  ipx = 1+(20-ip)+20*(ism-19);
1383  }
1384 
1385  if ( me_01 ) {
1386  float val_01=me_01->getBinContent(ie,ip);
1387  if ( me_01->getEntries() != 0 ) mePedestalG01_->setBinContent( ipx, iex, val_01 );
1388  }
1389  if ( me_02 ) {
1390  float val_02=me_02->getBinContent(ie,ip);
1391  if ( me_02->getEntries() != 0 ) mePedestalG06_->setBinContent( ipx, iex, val_02 );
1392  }
1393  if ( me_03 ) {
1394  float val_03=me_03->getBinContent(ie,ip);
1395  if ( me_03->getEntries() != 0 ) mePedestalG12_->setBinContent( ipx, iex, val_03 );
1396  }
1397 
1398  }
1399 
1400  if ( ebtpc ) {
1401 
1402  me_01 = ebtpc->meg01_[ism-1];
1403  me_02 = ebtpc->meg02_[ism-1];
1404  me_03 = ebtpc->meg03_[ism-1];
1405 
1406  int iex;
1407  int ipx;
1408 
1409  if ( ism <= 18 ) {
1410  iex = 1+(85-ie);
1411  ipx = ip+20*(ism-1);
1412  } else {
1413  iex = 85+ie;
1414  ipx = 1+(20-ip)+20*(ism-19);
1415  }
1416 
1417  if ( me_01 ) {
1418 
1419  float val_01=me_01->getBinContent(ie,ip);
1420 
1421  if ( me_01->getEntries() != 0 ) meTestPulseG01_->setBinContent( ipx, iex, val_01 );
1422 
1423  }
1424  if ( me_02 ) {
1425 
1426  float val_02=me_02->getBinContent(ie,ip);
1427 
1428  if ( me_02->getEntries() != 0 ) meTestPulseG06_->setBinContent( ipx, iex, val_02 );
1429 
1430  }
1431  if ( me_03 ) {
1432 
1433  float val_03=me_03->getBinContent(ie,ip);
1434 
1435  if ( me_03->getEntries() != 0 ) meTestPulseG12_->setBinContent( ipx, iex, val_03 );
1436 
1437  }
1438 
1439 
1440  }
1441 
1442  if ( hot01_[ism-1] ) {
1443 
1444  float xval = hot01_[ism-1]->GetBinContent( ie, ip );
1445 
1446  int iex;
1447  int ipx;
1448 
1449  if ( ism <= 18 ) {
1450  iex = 1+(85-ie);
1451  ipx = ip+20*(ism-1);
1452  } else {
1453  iex = 85+ie;
1454  ipx = 1+(20-ip)+20*(ism-19);
1455  }
1456 
1457  if(meRecHitEnergy_) meRecHitEnergy_->setBinContent( ipx, iex, xval );
1458 
1459  }
1460 
1461  if ( ebtmc ) {
1462 
1463  float num02, mean02, rms02;
1464 
1465  bool update02 = UtilsClient::getBinStatistics(htmt01_[ism-1], ie, ip, num02, mean02, rms02, timingNHitThreshold_);
1466 
1467  if ( update02 ) {
1468 
1469  mean02 -= 50.;
1470 
1471  meTimingMean1D_->Fill(mean02);
1472 
1473  meTimingRMS1D_->Fill(rms02);
1474 
1475  meTimingMean_->Fill( ism, mean02 );
1476 
1477  meTimingRMS_->Fill( ism, rms02 );
1478 
1479  }
1480 
1481  }
1482 
1483  }
1484  }
1485 
1486  for (int ie = 1; ie <= 17; ie++ ) {
1487  for (int ip = 1; ip <= 4; ip++ ) {
1488 
1489  int iex;
1490  int ipx;
1491 
1492  if ( ism <= 18 ) {
1493  iex = 1+(17-ie);
1494  ipx = ip+4*(ism-1);
1495  } else {
1496  iex = 17+ie;
1497  ipx = 1+(4-ip)+4*(ism-19);
1498  }
1499 
1500  if ( ebsfc ) {
1501 
1502  me = dqmStore_->get(prefixME_ + "/EcalInfo/EBMM DCC");
1503 
1504  float xval = 6;
1505 
1506  if ( me ) {
1507 
1508  xval = 2;
1509  if ( me->getBinContent( ism ) > 0 ) xval = 1;
1510 
1511  }
1512 
1513  me = ebsfc->meh01_[ism-1];
1514 
1515  if ( me ) {
1516 
1517  if ( me->getBinContent( ie, ip ) > 0 ) xval = 0;
1518 
1519  meStatusFlags_->setBinContent( ipx, iex, xval );
1520 
1521  if ( me->getBinError( ie, ip ) > 0 && me->getBinError( ie, ip ) < 0.1 ) UtilsClient::maskBinContent( meStatusFlags_, ipx, iex );
1522 
1523  if ( xval == 0 ) meStatusFlagsErr_->Fill( ism );
1524 
1525  }
1526 
1527  }
1528 
1529  if ( ebtttc ) {
1530 
1531  float mean01 = 0;
1532  bool hadNonZeroInterest = false;
1533 
1534  if ( httt01_[ism-1] ) {
1535 
1536  mean01 = httt01_[ism-1]->GetBinContent( ie, ip );
1537 
1538  if ( mean01 != 0. ) {
1539  if ( meTriggerTowerEt_ ) meTriggerTowerEt_->setBinContent( ipx, iex, mean01 );
1540  }
1541 
1542  }
1543 
1544  me = ebtttc->me_o01_[ism-1];
1545 
1546  if ( me ) {
1547 
1548  float xval = me->getBinContent( ie, ip );
1549 
1550  if ( xval != 0. ) {
1551  meTriggerTowerTiming_->setBinContent( ipx, iex, xval );
1552  hadNonZeroInterest = true;
1553  }
1554 
1555  }
1556 
1557  me = ebtttc->me_o02_[ism-1];
1558 
1559  if ( me ) {
1560 
1561  float xval = me->getBinContent( ie, ip );
1562 
1563  if ( xval != 0. ) {
1564  meTriggerTowerNonSingleTiming_->setBinContent( ipx, iex, xval );
1565  }
1566 
1567  }
1568 
1569  float xval = 2;
1570  if( mean01 > 0. ) {
1571 
1572  h2 = ebtttc->l01_[ism-1];
1573  h3 = ebtttc->l02_[ism-1];
1574 
1575  if ( h2 && h3 ) {
1576 
1577  // float emulErrorVal = h2->GetBinContent( ie, ip ) + h3->GetBinContent( ie, ip );
1578  float emulErrorVal = h2->GetBinContent( ie, ip );
1579 
1580  if( emulErrorVal > 0.01 * ievt_ && hadNonZeroInterest ) xval = 0;
1581 
1582  }
1583 
1584  if ( xval!=0 && hadNonZeroInterest ) xval = 1;
1585 
1586  }
1587 
1588  meTriggerTowerEmulError_->setBinContent( ipx, iex, xval );
1589 
1590  }
1591 
1592  if ( ebtmc ) {
1593 
1594  if( htmt01_[ism-1] ){
1595 
1596  float num(0.);
1597  bool mask(false);
1598 
1599  for(int ce=1; ce<=5; ce++){
1600  for(int cp=1; cp<=5; cp++){
1601 
1602  int scie = (ie - 1) * 5 + ce;
1603  int scip = (ip - 1) * 5 + cp;
1604 
1605  num += htmt01_[ism-1]->GetBinEntries(htmt01_[ism-1]->GetBin(scie, scip));
1606 
1607  if(Masks::maskChannel(ism, scie, scip, chWarnBit, EcalBarrel)) mask = true;
1608  }
1609  }
1610 
1611  float nHitThreshold(timingNHitThreshold_ * 18.);
1612 
1613  bool update01(false);
1614  float num01, mean01, rms01;
1615  update01 = UtilsClient::getBinStatistics(htmt, ipx, iex, num01, mean01, rms01, nHitThreshold);
1616 
1617  mean01 -= 50.;
1618 
1619  if(!update01){
1620  mean01 = 0.;
1621  rms01 = 0.;
1622  }
1623 
1624  update01 |= num > 1.3 * nHitThreshold;
1625 
1626  float xval = 2.;
1627  if(update01){
1628 
1629  if( std::abs(mean01) > 2. || rms01 > 6. || num > 1.3 * num01) xval = 0.;
1630  else xval = 1.;
1631 
1632  }
1633 
1634  meTiming_->setBinContent( ipx, iex, xval );
1635  if ( mask ) UtilsClient::maskBinContent( meTiming_, ipx, iex );
1636 
1637  }
1638 
1639  }
1640 
1641  }
1642  }
1643 
1644  // PN's summaries
1645  for( int i = 1; i <= 10; i++ ) {
1646  for( int j = 1; j <= 5; j++ ) {
1647 
1648  int ichanx;
1649  int ipseudostripx;
1650 
1651  if(ism<=18) {
1652  ichanx = i;
1653  ipseudostripx = j+5*(ism-1);
1654  } else {
1655  ichanx = i+10;
1656  ipseudostripx = j+5*(ism-19);
1657  }
1658 
1659  if ( ebic ) {
1660 
1661  me_04 = ebic->meg02_[ism-1];
1662  h2 = ebic->hmem_[ism-1];
1663 
1664  if( me_04 ) {
1665 
1666  float xval = me_04->getBinContent(i,j);
1667  if(meIntegrityPN_) meIntegrityPN_->setBinContent( ipseudostripx, ichanx, xval );
1668 
1669  }
1670 
1671  if ( h2 ) {
1672 
1673  float xval = h2->GetBinContent(i,1);
1674  if(meOccupancyPN_) meOccupancyPN_->setBinContent( ipseudostripx, ichanx, xval );
1675 
1676  }
1677 
1678  }
1679 
1680  if ( ebpc ) {
1681 
1682  me_04 = ebpc->meg04_[ism-1];
1683  me_05 = ebpc->meg05_[ism-1];
1684 
1685  if( me_04 ) {
1686  float val_04=me_04->getBinContent(i,1);
1687  mePedestalPNG01_->setBinContent( ipseudostripx, ichanx, val_04 );
1688  }
1689  if( me_05 ) {
1690  float val_05=me_05->getBinContent(i,1);
1691  mePedestalPNG16_->setBinContent( ipseudostripx, ichanx, val_05 );
1692  }
1693 
1694  }
1695 
1696  if ( ebtpc ) {
1697 
1698  me_04 = ebtpc->meg04_[ism-1];
1699  me_05 = ebtpc->meg05_[ism-1];
1700 
1701  if( me_04 ) {
1702  float val_04=me_04->getBinContent(i,1);
1703  meTestPulsePNG01_->setBinContent( ipseudostripx, ichanx, val_04 );
1704  }
1705  if( me_05 ) {
1706  float val_05=me_05->getBinContent(i,1);
1707  meTestPulsePNG16_->setBinContent( ipseudostripx, ichanx, val_05 );
1708  }
1709 
1710  }
1711 
1712  if ( eblc ) {
1713 
1714  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1715 
1716  me = eblc->meg09_[ism-1];
1717 
1718  if( me ) {
1719 
1720  float xval = me->getBinContent(i,1);
1721 
1722  if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
1723  meLaserL1PN_->setBinContent( ipseudostripx, ichanx, xval );
1724  if ( xval == 0 ) meLaserL1PNErr_->Fill( ism );
1725  }
1726 
1727  }
1728 
1729  }
1730 
1731  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1732 
1733  me = eblc->meg10_[ism-1];
1734 
1735  if( me ) {
1736 
1737  float xval = me->getBinContent(i,1);
1738 
1739  if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
1740  meLaserL2PN_->setBinContent( ipseudostripx, ichanx, xval );
1741  if ( xval == 0 ) meLaserL2PNErr_->Fill( ism );
1742  }
1743 
1744  }
1745 
1746  }
1747 
1748  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1749 
1750  me = eblc->meg11_[ism-1];
1751 
1752  if( me ) {
1753 
1754  float xval = me->getBinContent(i,1);
1755 
1756  if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
1757  meLaserL3PN_->setBinContent( ipseudostripx, ichanx, xval );
1758  if ( xval == 0 ) meLaserL3PNErr_->Fill( ism );
1759  }
1760 
1761  }
1762 
1763  }
1764 
1765  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1766 
1767  me = eblc->meg12_[ism-1];
1768 
1769  if( me ) {
1770 
1771  float xval = me->getBinContent(i,1);
1772 
1773  if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
1774  meLaserL4PN_->setBinContent( ipseudostripx, ichanx, xval );
1775  if ( xval == 0 ) meLaserL4PNErr_->Fill( ism );
1776  }
1777 
1778  }
1779 
1780  }
1781 
1782  }
1783 
1784  }
1785  }
1786 
1787  for(int chan=0; chan<1700; chan++) {
1788 
1789  int ie = (chan)/20 + 1;
1790  int ip = (chan)%20 + 1;
1791 
1792  // laser 1D summaries
1793  if ( eblc ) {
1794 
1795  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1796 
1797  MonitorElement *meg = eblc->meg01_[ism-1];
1798 
1799  float xval = 2;
1800  if ( meg ) xval = meg->getBinContent( ie, ip );
1801 
1802  // exclude channels without laser data (yellow in the quality map)
1803  if( xval != 2 && xval != 5 ) {
1804 
1805  MonitorElement* mea01 = eblc->mea01_[ism-1];
1806  MonitorElement* met01 = eblc->met01_[ism-1];
1807  MonitorElement* meaopn01 = eblc->meaopn01_[ism-1];
1808 
1809  if( mea01 && met01 && meaopn01 ) {
1810  meLaserL1Ampl_->Fill( ism, mea01->getBinContent( chan+1 ) );
1811  if( met01->getBinContent( chan+1 ) > 0. ) meLaserL1Timing_->Fill( ism, met01->getBinContent( chan+1 ) );
1812  meLaserL1AmplOverPN_->Fill( ism, meaopn01->getBinContent( chan+1 ) );
1813  }
1814 
1815  }
1816 
1817  }
1818 
1819  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
1820 
1821  MonitorElement *meg = eblc->meg02_[ism-1];
1822 
1823  float xval = 2;
1824  if ( meg ) xval = meg->getBinContent( ie, ip );
1825 
1826  // exclude channels without laser data (yellow in the quality map)
1827  if( xval != 2 && xval != 5 ) {
1828 
1829  MonitorElement* mea02 = eblc->mea02_[ism-1];
1830  MonitorElement* met02 = eblc->met02_[ism-1];
1831  MonitorElement* meaopn02 = eblc->meaopn02_[ism-1];
1832 
1833  if( mea02 && met02 && meaopn02 ) {
1834  meLaserL2Ampl_->Fill( ism, mea02->getBinContent( chan+1 ) );
1835  if( met02->getBinContent( chan+1 ) > 0. ) meLaserL2Timing_->Fill( ism, met02->getBinContent( chan+1 ) );
1836  meLaserL2AmplOverPN_->Fill( ism, meaopn02->getBinContent( chan+1 ) );
1837  }
1838 
1839  }
1840 
1841  }
1842 
1843  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
1844 
1845  MonitorElement *meg = eblc->meg03_[ism-1];
1846 
1847  float xval = 2;
1848  if ( meg ) xval = meg->getBinContent( ie, ip );
1849 
1850  // exclude channels without laser data (yellow in the quality map)
1851  if( xval != 2 && xval != 5 ) {
1852 
1853  MonitorElement* mea03 = eblc->mea03_[ism-1];
1854  MonitorElement* met03 = eblc->met03_[ism-1];
1855  MonitorElement* meaopn03 = eblc->meaopn03_[ism-1];
1856 
1857  if( mea03 && met03 && meaopn03 ) {
1858  meLaserL3Ampl_->Fill( ism, mea03->getBinContent( chan+1 ) );
1859  if( met03->getBinContent( chan+1 ) > 0. ) meLaserL3Timing_->Fill( ism, met03->getBinContent( chan+1 ) );
1860  meLaserL3AmplOverPN_->Fill( ism, meaopn03->getBinContent( chan+1 ) );
1861  }
1862 
1863  }
1864 
1865  }
1866 
1867  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
1868 
1869  MonitorElement *meg = eblc->meg04_[ism-1];
1870 
1871  float xval = 2;
1872  if ( meg ) xval = meg->getBinContent( ie, ip );
1873 
1874  // exclude channels without laser data (yellow in the quality map)
1875  if( xval != 2 && xval != 5 ) {
1876 
1877  MonitorElement* mea04 = eblc->mea04_[ism-1];
1878  MonitorElement* met04 = eblc->met04_[ism-1];
1879  MonitorElement* meaopn04 = eblc->meaopn04_[ism-1];
1880 
1881  if( mea04 && met04 && meaopn04 ) {
1882  meLaserL4Ampl_->Fill( ism, mea04->getBinContent( chan+1 ) );
1883  if( met04->getBinContent( chan+1 ) > 0. ) meLaserL4Timing_->Fill( ism, met04->getBinContent( chan+1 ) );
1884  meLaserL4AmplOverPN_->Fill( ism, meaopn04->getBinContent( chan+1 ) );
1885  }
1886 
1887  }
1888 
1889  }
1890 
1891  }
1892 
1893  if ( ebtpc ) {
1894 
1895  MonitorElement *meg01 = ebtpc->meg01_[ism-1];
1896  MonitorElement *meg02 = ebtpc->meg02_[ism-1];
1897  MonitorElement *meg03 = ebtpc->meg03_[ism-1];
1898 
1899  if ( meg01 ) {
1900 
1901  float xval01 = meg01->getBinContent(ie,ip);
1902 
1903  if ( xval01 != 2 && xval01 != 5 ) {
1904 
1905  me = ebtpc->mea01_[ism-1];
1906 
1907  if ( me ) {
1908 
1909  meTestPulseAmplG01_->Fill( ism, me->getBinContent( chan+1 ) );
1910 
1911  }
1912 
1913  }
1914 
1915  }
1916 
1917  if ( meg02 ) {
1918 
1919  float xval02 = meg02->getBinContent(ie,ip);
1920 
1921  if ( xval02 != 2 && xval02 != 5 ) {
1922 
1923  me = ebtpc->mea02_[ism-1];
1924 
1925  if ( me ) {
1926 
1927  meTestPulseAmplG06_->Fill( ism, me->getBinContent( chan+1 ) );
1928 
1929  }
1930 
1931  }
1932 
1933  }
1934 
1935  if ( meg03 ) {
1936 
1937  float xval03 = meg03->getBinContent(ie,ip);
1938 
1939  if ( xval03 != 2 && xval03 != 5 ) {
1940 
1941  me = ebtpc->mea03_[ism-1];
1942 
1943  if ( me ) {
1944 
1945  meTestPulseAmplG12_->Fill( ism, me->getBinContent( chan+1 ) );
1946 
1947  }
1948 
1949  }
1950 
1951  }
1952 
1953  }
1954 
1955  } // loop on channels
1956 
1957  } // loop on SM
1958 
1959  } // loop on clients
1960 
1961  // The global-summary
1962 
1963  int nGlobalErrors = 0;
1964  int nGlobalErrorsEB[36];
1965  int nValidChannels = 0;
1966  int nValidChannelsEB[36];
1967 
1968  for (int i = 0; i < 36; i++) {
1969  nGlobalErrorsEB[i] = 0;
1970  nValidChannelsEB[i] = 0;
1971  }
1972 
1973  for ( int iex = 1; iex <= 170; iex++ ) {
1974  for ( int ipx = 1; ipx <= 360; ipx++ ) {
1975 
1976  if(meGlobalSummary_) {
1977 
1978  int ism = (ipx-1)/20 + 1 ;
1979  if ( iex>85 ) ism+=18;
1980 
1981  int iet = (iex-1)/5 + 1;
1982  int ipt = (ipx-1)/5 + 1;
1983 
1984  float xval = 6;
1985  float val_in = meIntegrity_->getBinContent(ipx,iex);
1986  float val_po = mePedestalOnline_->getBinContent(ipx,iex);
1987  float val_tm = reducedReports_ ? 1. : meTiming_->getBinContent(ipt,iet);
1988  float val_sf = meStatusFlags_->getBinContent((ipx-1)/5+1,(iex-1)/5+1);
1989  float val_ee = reducedReports_ ? 1. : meTriggerTowerEmulError_->getBinContent((ipx-1)/5+1,(iex-1)/5+1); // removed from the global summary temporarily
1990  // float val_ee = 1;
1991 
1992  // combine all the available wavelenghts in unique laser status
1993  // for each laser turn dark color and yellow into bright green
1994  float val_ls_1=2, val_ls_2=2, val_ls_3=2, val_ls_4=2;
1995  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
1996  if ( meLaserL1_ ) val_ls_1 = meLaserL1_->getBinContent(ipx,iex);
1997  if(val_ls_1==2 || val_ls_1==3 || val_ls_1==4 || val_ls_1==5) val_ls_1=1;
1998  }
1999  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
2000  if ( meLaserL2_ ) val_ls_2 = meLaserL2_->getBinContent(ipx,iex);
2001  if(val_ls_2==2 || val_ls_2==3 || val_ls_2==4 || val_ls_2==5) val_ls_2=1;
2002  }
2003  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
2004  if ( meLaserL3_ ) val_ls_3 = meLaserL3_->getBinContent(ipx,iex);
2005  if(val_ls_3==2 || val_ls_3==3 || val_ls_3==4 || val_ls_3==5) val_ls_3=1;
2006  }
2007  if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
2008  if ( meLaserL4_ ) val_ls_4 = meLaserL4_->getBinContent(ipx,iex);
2009  if(val_ls_4==2 || val_ls_4==3 || val_ls_4==4 || val_ls_4==5) val_ls_4=1;
2010  }
2011 
2012  float val_ls = 1;
2013  if (val_ls_1 == 0 || val_ls_2==0 || val_ls_3==0 || val_ls_4==0) val_ls=0;
2014 
2015  // DO NOT CONSIDER CALIBRATION EVENTS IN THE REPORT SUMMARY UNTIL LHC COLLISIONS
2016  val_ls = 1;
2017 
2018  // turn each dark color (masked channel) to bright green
2019  // for laser & timing & trigger turn also yellow into bright green
2020  // for pedestal online too because is not computed in calibration events
2021 
2022  // 0/3 = red/dark red
2023  // 1/4 = green/dark green
2024  // 2/5 = yellow/dark yellow
2025  // 6 = unknown
2026 
2027  if( val_in==3 || val_in==4 || val_in==5) val_in=1;
2028  if(val_po==2 || val_po==3 || val_po==4 || val_po==5) val_po=1;
2029  if(val_tm==2 || val_tm==3 || val_tm==4 || val_tm==5) val_tm=1;
2030  if( val_sf==3 || val_sf==4 || val_sf==5) val_sf=1;
2031  if(val_ee==2 || val_ee==3 || val_ee==4 || val_ee==5) val_ee=1;
2032 
2033  if(val_in==6) xval=6;
2034  else if(val_in==0) xval=0;
2035  else if(val_po==0 || val_ls==0 || val_tm==0 || val_sf==0 || val_ee==0) xval=0;
2036  else if(val_po==2 || val_ls==2 || val_tm==2 || val_sf==2 || val_ee==2) xval=2;
2037  else xval=1;
2038 
2039  // if the SM is entirely not read, the masked channels
2040  // are reverted back to yellow
2041  float iEntries=0;
2042 
2043  if(norm01_ && synch01_) {
2044  float frac_synch_errors = 0.;
2045  float norm = norm01_->GetBinContent(ism);
2046  if(norm > 0) frac_synch_errors = float(synch01_->GetBinContent(ism))/float(norm);
2047  if(frac_synch_errors > synchErrorThreshold_){
2048  xval = 0;
2049  if(oosTrend && oosTrend->GetBinContent(oosTrend->GetNbinsX()) - oosTrend->GetBinContent(1) < 1.) xval += 3.;
2050  }
2051  }
2052 
2053  std::vector<int>::iterator iter = find(superModules_.begin(), superModules_.end(), ism);
2054  if (iter != superModules_.end()) {
2055  for ( unsigned int i=0; i<clients_.size(); i++ ) {
2056  EBIntegrityClient* ebic = dynamic_cast<EBIntegrityClient*>(clients_[i]);
2057  if ( ebic ) {
2058  TH2F* h2 = ebic->h_[ism-1];
2059  if ( h2 ) {
2060  iEntries = h2->GetEntries();
2061  }
2062  }
2063  }
2064  }
2065 
2066  if ( iEntries==0 ) {
2067  xval=2;
2068  }
2069 
2070  meGlobalSummary_->setBinContent( ipx, iex, xval );
2071 
2072  if ( xval >= 0 && xval <= 5 ) {
2073  if ( xval != 2 && xval != 5 ) ++nValidChannels;
2074  if ( iex <= 85 ) {
2075  if ( xval != 2 && xval != 5 ) ++nValidChannelsEB[(ipx-1)/20];
2076  } else {
2077  if ( xval != 2 && xval != 5 ) ++nValidChannelsEB[18+(ipx-1)/20];
2078  }
2079  if ( xval == 0 ) ++nGlobalErrors;
2080  if ( iex <= 85 ) {
2081  if ( xval == 0 ) ++nGlobalErrorsEB[(ipx-1)/20];
2082  } else {
2083  if ( xval == 0 ) ++nGlobalErrorsEB[18+(ipx-1)/20];
2084  }
2085  }
2086 
2087  }
2088 
2089  }
2090  }
2091 
2092  if(meSummaryErr_)
2093  meSummaryErr_->setBinContent(1, double(nGlobalErrors) / double(nValidChannels));
2094 
2095  float reportSummary = -1.0;
2096  if ( nValidChannels != 0 )
2097  reportSummary = 1.0 - float(nGlobalErrors)/float(nValidChannels);
2098  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummary");
2099  if ( me )
2100  me->Fill(reportSummary);
2101 
2102  for (int i = 0; i < 36; i++) {
2103  float reportSummaryEB = -1.0;
2104  if ( nValidChannelsEB[i] != 0 )
2105  reportSummaryEB = 1.0 - float(nGlobalErrorsEB[i])/float(nValidChannelsEB[i]);
2106  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryContents/EcalBarrel_" + Numbers::sEB(i+1));
2107  if ( me ) me->Fill(reportSummaryEB);
2108  }
2109 
2110  if(meGlobalSummary_){
2111 
2112  me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryMap");
2113  if ( me ) {
2114 
2115  int nValidChannelsTT[72][34];
2116  int nGlobalErrorsTT[72][34];
2117  for ( int iettx = 0; iettx < 34; iettx++ ) {
2118  for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
2119  nValidChannelsTT[ipttx][iettx] = 0;
2120  nGlobalErrorsTT[ipttx][iettx] = 0;
2121  }
2122  }
2123 
2124  for ( int iex = 1; iex <= 170; iex++ ) {
2125  for ( int ipx = 1; ipx <= 360; ipx++ ) {
2126 
2127  int iettx = (iex-1)/5+1;
2128  int ipttx = (ipx-1)/5+1;
2129 
2130  float xval = meGlobalSummary_->getBinContent( ipx, iex );
2131 
2132  if ( xval >= 0 && xval <= 5 ) {
2133  if ( xval != 2 && xval != 5 ) ++nValidChannelsTT[ipttx-1][iettx-1];
2134  if ( xval == 0 ) ++nGlobalErrorsTT[ipttx-1][iettx-1];
2135  }
2136 
2137  }
2138  }
2139 
2140  // Countermeasure to partial TR failure
2141  // make the whole SM red if more than 2 towers within a 2x2 matrix fails
2142 
2143  for(int jeta(1); jeta <= 33; jeta++){
2144  for(int jphi(1); jphi <= 71; jphi++){
2145  int nErr(0);
2146  if(nValidChannelsTT[jphi - 1][jeta - 1] > 0 && nGlobalErrorsTT[jphi - 1][jeta - 1] == nValidChannelsTT[jphi - 1][jeta - 1]) nErr += 1;
2147  if(nValidChannelsTT[jphi][jeta - 1] > 0 && nGlobalErrorsTT[jphi][jeta - 1] == nValidChannelsTT[jphi][jeta - 1]) nErr += 1;
2148  if(nValidChannelsTT[jphi - 1][jeta] > 0 && nGlobalErrorsTT[jphi - 1][jeta] == nValidChannelsTT[jphi - 1][jeta]) nErr += 1;
2149  if(nValidChannelsTT[jphi][jeta] > 0 && nGlobalErrorsTT[jphi][jeta] == nValidChannelsTT[jphi][jeta]) nErr += 1;
2150  if(nErr > 2){
2151  int jphi0(((jphi - 1) / 4) * 4);
2152  int jeta0(((jeta - 1) / 17) * 17);
2153  for(int jjphi(jphi0); jjphi < jphi0 + 4; jjphi++){
2154  for(int jjeta(jeta0); jjeta < jeta0 + 17; jjeta++){
2155  nGlobalErrorsTT[jjphi][jjeta] = nValidChannelsTT[jjphi][jjeta];
2156  }
2157  }
2158  }
2159  }
2160  }
2161 
2162  for ( int iettx = 0; iettx < 34; iettx++ ) {
2163  for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
2164 
2165  float xval = -1.0;
2166  if ( nValidChannelsTT[ipttx][iettx] != 0 )
2167  xval = 1.0 - float(nGlobalErrorsTT[ipttx][iettx])/float(nValidChannelsTT[ipttx][iettx]);
2168 
2169  me->setBinContent( ipttx+1, iettx+1, xval );
2170  }
2171  }
2172 
2173  }
2174 
2175  }
2176 
2177 }
2178 
MonitorElement * mea02_[36]
MonitorElement * meg12_[36]
MonitorElement * mePedestalOnlineRMS_
MonitorElement * meLaserL4PNErr_
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * meOccupancyPN_
MonitorElement * meRecHitEnergy_
MonitorElement * meg09_[36]
MonitorElement * meTriggerTowerEt_
void setBinContent(int binx, double content)
set content of bin (1-D)
virtual ~EBSummaryClient()
Destructor.
static bool maskChannel(int ism, int i1, int i2, uint32_t bits, const EcalSubdetector subdet)
Definition: Masks.cc:57
MonitorElement * meLaserL3_
void cleanup(void)
Cleanup.
MonitorElement * meTestPulseAmplG01_
MonitorElement * meg03_[36]
MonitorElement * me_o02_[36]
TProfile2D * hot01_[36]
MonitorElement * meg02_[36]
TProfile2D * httt01_[36]
MonitorElement * meg05_[36]
MonitorElement * meTestPulseG12_
static const int PHYSICS_BAD_CHANNEL_WARNING
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * meLaserL4AmplOverPN_
MonitorElement * meg04_[36]
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:89
MonitorElement * mePedestalPNG01_
MonitorElement * met02_[36]
MonitorElement * meLaserL1Timing_
MonitorElement * meTimingMean_
Some &quot;id&quot; conversions.
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:91
MonitorElement * meStatusFlagsErr_
MonitorElement * meLaserL1_
MonitorElement * meg02_[36]
MonitorElement * meg03_[36]
void endRun(void)
EndRun.
MonitorElement * mea01_[36]
MonitorElement * meIntegrity_
MonitorElement * meg02_[36]
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * meg01_[36]
MonitorElement * mePedestalOnlineErr_
MonitorElement * mePedestalG06_
MonitorElement * meOccupancy_
MonitorElement * meTestPulseAmplG12_
MonitorElement * meLaserL3Timing_
std::vector< int > superModules_
std::vector< int > laserWavelengths_
double getEntries(void) const
get # of entries
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
static void maskBinContent(const MonitorElement *me, const int ix, const int iy)
Mask the bin content.
Definition: UtilsClient.cc:231
MonitorElement * mea03_[36]
MonitorElement * met04_[36]
MonitorElement * meLaserL2Err_
MonitorElement * meLaserL2_
MonitorElement * meg04_[36]
void Fill(long long x)
MonitorElement * meLaserL3Ampl_
MonitorElement * meTestPulsePNG16_
MonitorElement * mea02_[36]
MonitorElement * mePedestalG01_
MonitorElement * meg10_[36]
MonitorElement * meIntegrityErr_
void beginJob(void)
BeginJob.
MonitorElement * meSummaryErr_
MonitorElement * meLaserL3PNErr_
MonitorElement * meg01_[36]
MonitorElement * meLaserL2PN_
MonitorElement * meTestPulsePNG01_
MonitorElement * meLaserL4Timing_
MonitorElement * meLaserL2AmplOverPN_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * meTimingRMS_
channel masking
std::string prefixME_
EBSummaryClient(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meIntegrityPN_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
void setup(void)
Setup.
MonitorElement * mea04_[36]
TProfile2D * hpot01_[36]
MonitorElement * meLaserL3Err_
MonitorElement * meLaserL4Err_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1186
MonitorElement * meh01_[36]
MonitorElement * meg04_[36]
MonitorElement * meTimingRMS1D_
MonitorElement * meOccupancy1D_
void setEntries(double nentries)
set # of entries
MonitorElement * meTriggerTowerEmulError_
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
MonitorElement * met03_[36]
MonitorElement * meTriggerTowerTiming_
Ecal Monitor Utils for Client.
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
DQMStore * dqmStore_
MonitorElement * meLaserL3PN_
MonitorElement * meLaserL3AmplOverPN_
MonitorElement * meaopn04_[36]
MonitorElement * meLaserL4PN_
MonitorElement * meLaserL2Timing_
MonitorElement * meaopn01_[36]
MonitorElement * meTimingMean1D_
MonitorElement * me_o01_[36]
MonitorElement * meTiming_
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
MonitorElement * meg03_[36]
MonitorElement * meLaserL1AmplOverPN_
MonitorElement * mePedestalOnlineRMSMap_
MonitorElement * meg11_[36]
MonitorElement * meLaserL4Ampl_
MonitorElement * meLaserL1Err_
MonitorElement * mea01_[36]
MonitorElement * mea03_[36]
MonitorElement * meLaserL4_
MonitorElement * meg01_[36]
MonitorElement * meTestPulseAmplG06_
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * mePedestalOnline_
MonitorElement * meGlobalSummary_
void endJob(void)
EndJob.
std::vector< int > MGPAGainsPN_
MonitorElement * meStatusFlags_
MonitorElement * meLaserL1PN_
MonitorElement * meLaserL2PNErr_
MonitorElement * meTestPulseG06_
MonitorElement * meTestPulseG01_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meLaserL1Ampl_
MonitorElement * meg05_[36]
float synchErrorThreshold_
MonitorElement * meLaserL1PNErr_
MonitorElement * meg02_[36]
MonitorElement * meg03_[36]
tuple status
Definition: ntuplemaker.py:245
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
MonitorElement * meg01_[36]
std::vector< int > MGPAGains_
Definition: RunIOV.h:13
MonitorElement * meaopn02_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
MonitorElement * meaopn03_[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)
MonitorElement * meLaserL2Ampl_
std::vector< EBClient * > clients_
void analyze(void)
Analyze.
void beginRun(void)
BeginRun.
MonitorElement * mePedestalG12_
TProfile2D * htmt01_[36]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * met01_[36]
std::string subfolder_
MonitorElement * meTriggerTowerNonSingleTiming_
MonitorElement * mePedestalOnlineMean_
MonitorElement * mePedestalPNG16_