CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQM/EcalBarrelMonitorClient/src/EBSummaryClient.cc

Go to the documentation of this file.
00001 /*
00002  * \file EBSummaryClient.cc
00003  *
00004  * $Date: 2012/06/11 22:57:15 $
00005  * $Revision: 1.232 $
00006  * \author G. Della Ricca
00007  *
00008 */
00009 
00010 #include <memory>
00011 #include <iostream>
00012 #include <fstream>
00013 #include <iomanip>
00014 
00015 #include "FWCore/ServiceRegistry/interface/Service.h"
00016 
00017 #include "DQMServices/Core/interface/DQMStore.h"
00018 #include "DQMServices/Core/interface/MonitorElement.h"
00019 
00020 #ifdef WITH_ECAL_COND_DB
00021 #include "OnlineDB/EcalCondDB/interface/RunTag.h"
00022 #include "OnlineDB/EcalCondDB/interface/RunIOV.h"
00023 #endif
00024 
00025 #include "DQM/EcalCommon/interface/UtilsClient.h"
00026 #include "DQM/EcalCommon/interface/Numbers.h"
00027 #include "DQM/EcalCommon/interface/Masks.h"
00028 
00029 #include "DQM/EcalBarrelMonitorClient/interface/EBStatusFlagsClient.h"
00030 #include "DQM/EcalBarrelMonitorClient/interface/EBIntegrityClient.h"
00031 #include "DQM/EcalBarrelMonitorClient/interface/EBOccupancyClient.h"
00032 #include "DQM/EcalBarrelMonitorClient/interface/EBLaserClient.h"
00033 #include "DQM/EcalBarrelMonitorClient/interface/EBPedestalClient.h"
00034 #include "DQM/EcalBarrelMonitorClient/interface/EBPedestalOnlineClient.h"
00035 #include "DQM/EcalBarrelMonitorClient/interface/EBTestPulseClient.h"
00036 #include "DQM/EcalBarrelMonitorClient/interface/EBTriggerTowerClient.h"
00037 #include "DQM/EcalBarrelMonitorClient/interface/EBClusterClient.h"
00038 #include "DQM/EcalBarrelMonitorClient/interface/EBTimingClient.h"
00039 
00040 #include "DQM/EcalBarrelMonitorClient/interface/EBSummaryClient.h"
00041 
00042 EBSummaryClient::EBSummaryClient(const edm::ParameterSet& ps) {
00043 
00044   // cloneME switch
00045   cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
00046 
00047   // verbose switch
00048   verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
00049 
00050   // debug switch
00051   debug_ = ps.getUntrackedParameter<bool>("debug", false);
00052 
00053   // prefixME path
00054   prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
00055 
00056   subfolder_ = ps.getUntrackedParameter<std::string>("subfolder", "");
00057 
00058   // enableCleanup_ switch
00059   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00060 
00061   produceReports_ = ps.getUntrackedParameter<bool>("produceReports", true);
00062 
00063   reducedReports_ = ps.getUntrackedParameter<bool>("reducedReports", false);
00064 
00065   // vector of selected Super Modules (Defaults to all 36).
00066   superModules_.reserve(36);
00067   for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
00068   superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
00069 
00070   laserWavelengths_.reserve(4);
00071   for ( unsigned int i = 1; i <= 4; i++ ) laserWavelengths_.push_back(i);
00072   laserWavelengths_ = ps.getUntrackedParameter<std::vector<int> >("laserWavelengths", laserWavelengths_);
00073 
00074   MGPAGains_.reserve(3);
00075   for ( unsigned int i = 1; i <= 3; i++ ) MGPAGains_.push_back(i);
00076   MGPAGains_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGains", MGPAGains_);
00077 
00078   MGPAGainsPN_.reserve(2);
00079   for ( unsigned int i = 1; i <= 3; i++ ) MGPAGainsPN_.push_back(i);
00080   MGPAGainsPN_ = ps.getUntrackedParameter<std::vector<int> >("MGPAGainsPN", MGPAGainsPN_);
00081 
00082   timingNHitThreshold_ = ps.getUntrackedParameter<int>("timingNHitThreshold", 5);
00083 
00084   synchErrorThreshold_ = ps.getUntrackedParameter<double>("synchErrorThreshold", 0.01);
00085 
00086   // summary maps
00087   meIntegrity_            = 0;
00088   meIntegrityPN_          = 0;
00089   meOccupancy_            = 0;
00090   meOccupancyPN_          = 0;
00091   meStatusFlags_          = 0;
00092   mePedestalOnline_       = 0;
00093   mePedestalOnlineRMSMap_ = 0;
00094   mePedestalOnlineMean_   = 0;
00095   mePedestalOnlineRMS_    = 0;
00096 
00097   meLaserL1_              = 0;
00098   meLaserL1PN_            = 0;
00099   meLaserL1Ampl_          = 0;
00100   meLaserL1Timing_        = 0;
00101   meLaserL1AmplOverPN_    = 0;
00102 
00103   meLaserL2_              = 0;
00104   meLaserL2PN_            = 0;
00105   meLaserL2Ampl_          = 0;
00106   meLaserL2Timing_        = 0;
00107   meLaserL2AmplOverPN_    = 0;
00108 
00109   meLaserL3_              = 0;
00110   meLaserL3PN_            = 0;
00111   meLaserL3Ampl_          = 0;
00112   meLaserL3Timing_        = 0;
00113   meLaserL3AmplOverPN_    = 0;
00114 
00115   meLaserL4_              = 0;
00116   meLaserL4PN_            = 0;
00117   meLaserL4Ampl_          = 0;
00118   meLaserL4Timing_        = 0;
00119   meLaserL4AmplOverPN_    = 0;
00120 
00121   mePedestalG01_          = 0;
00122   mePedestalG06_          = 0;
00123   mePedestalG12_          = 0;
00124   mePedestalPNG01_        = 0;
00125   mePedestalPNG16_        = 0;
00126   meTestPulseG01_         = 0;
00127   meTestPulseG06_         = 0;
00128   meTestPulseG12_         = 0;
00129   meTestPulsePNG01_       = 0;
00130   meTestPulsePNG16_       = 0;
00131   meTestPulseAmplG01_     = 0;
00132   meTestPulseAmplG06_     = 0;
00133   meTestPulseAmplG12_     = 0;
00134   meGlobalSummary_        = 0;
00135 
00136   meRecHitEnergy_         = 0;
00137   meTiming_         = 0;
00138   meTimingMean1D_   = 0;
00139   meTimingRMS1D_    = 0;
00140   meTimingMean_     = 0;
00141   meTimingRMS_      = 0;
00142   meTriggerTowerEt_        = 0;
00143   meTriggerTowerEmulError_ = 0;
00144   meTriggerTowerTiming_ = 0;
00145   meTriggerTowerNonSingleTiming_ = 0;
00146 
00147   // summary errors
00148   meIntegrityErr_       = 0;
00149   meOccupancy1D_        = 0;
00150   meStatusFlagsErr_     = 0;
00151   mePedestalOnlineErr_  = 0;
00152   meLaserL1Err_         = 0;
00153   meLaserL1PNErr_       = 0;
00154   meLaserL2Err_         = 0;
00155   meLaserL2PNErr_       = 0;
00156   meLaserL3Err_         = 0;
00157   meLaserL3PNErr_       = 0;
00158   meLaserL4Err_         = 0;
00159   meLaserL4PNErr_       = 0;
00160 
00161   meSummaryErr_ = 0;
00162 
00163   // additional histograms from tasks
00164   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00165 
00166     int ism = superModules_[i];
00167 
00168     hpot01_[ism-1] = 0;
00169     httt01_[ism-1] = 0;
00170     htmt01_[ism-1] = 0;
00171 
00172   }
00173 }
00174 
00175 EBSummaryClient::~EBSummaryClient() {
00176 
00177 }
00178 
00179 void EBSummaryClient::beginJob(void) {
00180 
00181   dqmStore_ = edm::Service<DQMStore>().operator->();
00182 
00183   if ( debug_ ) std::cout << "EBSummaryClient: beginJob" << std::endl;
00184 
00185   ievt_ = 0;
00186   jevt_ = 0;
00187 
00188 }
00189 
00190 void EBSummaryClient::beginRun(void) {
00191 
00192   if ( debug_ ) std::cout << "EBSummaryClient: beginRun" << std::endl;
00193 
00194   jevt_ = 0;
00195 
00196   this->setup();
00197 
00198 }
00199 
00200 void EBSummaryClient::endJob(void) {
00201 
00202   if ( debug_ ) std::cout << "EBSummaryClient: endJob, ievt = " << ievt_ << std::endl;
00203 
00204   this->cleanup();
00205 
00206 }
00207 
00208 void EBSummaryClient::endRun(void) {
00209 
00210   if ( debug_ ) std::cout << "EBSummaryClient: endRun, jevt = " << jevt_ << std::endl;
00211 
00212   this->cleanup();
00213 
00214 }
00215 
00216 void EBSummaryClient::setup(void) {
00217 
00218   bool integrityClient(false);
00219   bool occupancyClient(false);
00220   bool statusFlagsClient(false);
00221   bool pedestalOnlineClient(false);
00222   bool laserClient(false);
00223   bool pedestalClient(false);
00224   bool testPulseClient(false);
00225   bool timingClient(false);
00226   bool triggerTowerClient(false);
00227 
00228   for(unsigned i = 0; i < clients_.size(); i++){
00229 
00230     if(dynamic_cast<EBIntegrityClient*>(clients_[i])) integrityClient = true;
00231     if(dynamic_cast<EBOccupancyClient*>(clients_[i])) occupancyClient = true;
00232     if(dynamic_cast<EBStatusFlagsClient*>(clients_[i])) statusFlagsClient = true;
00233     if(dynamic_cast<EBPedestalOnlineClient*>(clients_[i])) pedestalOnlineClient = true;
00234     if(dynamic_cast<EBLaserClient*>(clients_[i])) laserClient = true;
00235     if(dynamic_cast<EBPedestalClient*>(clients_[i])) pedestalClient = true;
00236     if(dynamic_cast<EBTestPulseClient*>(clients_[i])) testPulseClient = true;
00237     if(dynamic_cast<EBTimingClient*>(clients_[i])) timingClient = true;
00238     if(dynamic_cast<EBTriggerTowerClient*>(clients_[i])) triggerTowerClient = true;
00239 
00240   }
00241 
00242   std::string name;
00243 
00244   dqmStore_->setCurrentFolder( prefixME_ + "/EBSummaryClient" );
00245 
00246   if(integrityClient){
00247     if(produceReports_){
00248       if ( meIntegrity_ ) dqmStore_->removeElement( meIntegrity_->getName() );
00249       name = "EBIT integrity quality summary";
00250       meIntegrity_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00251       meIntegrity_->setAxisTitle("jphi", 1);
00252       meIntegrity_->setAxisTitle("jeta", 2);
00253 
00254       if ( meIntegrityErr_ ) dqmStore_->removeElement( meIntegrityErr_->getName() );
00255       name = "EBIT integrity quality errors summary";
00256       meIntegrityErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
00257       for (int i = 0; i < 36; i++) {
00258         meIntegrityErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00259       }
00260     }
00261     if(laserClient){
00262       if ( meIntegrityPN_ ) dqmStore_->removeElement( meIntegrityPN_->getName() );
00263       name = "EBIT PN integrity quality summary";
00264       meIntegrityPN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
00265       meIntegrityPN_->setAxisTitle("jchannel", 1);
00266       meIntegrityPN_->setAxisTitle("jpseudo-strip", 2);
00267     }
00268   }
00269 
00270   if(occupancyClient){
00271     if(produceReports_){
00272       if ( meOccupancy_ ) dqmStore_->removeElement( meOccupancy_->getName() );
00273       name = "EBOT digi occupancy summary";
00274       meOccupancy_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00275       meOccupancy_->setAxisTitle("jphi", 1);
00276       meOccupancy_->setAxisTitle("jeta", 2);
00277 
00278       if ( meOccupancy1D_ ) dqmStore_->removeElement( meOccupancy1D_->getName() );
00279       name = "EBOT digi occupancy summary 1D";
00280       meOccupancy1D_ = dqmStore_->book1D(name, name, 36, 1, 37);
00281       for (int i = 0; i < 36; i++) {
00282         meOccupancy1D_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00283       }
00284 
00285       if( meRecHitEnergy_ ) dqmStore_->removeElement( meRecHitEnergy_->getName() );
00286       name = "EBOT energy summary";
00287       meRecHitEnergy_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00288       meRecHitEnergy_->setAxisTitle("jphi", 1);
00289       meRecHitEnergy_->setAxisTitle("jeta", 2);
00290       meRecHitEnergy_->setAxisTitle("energy (GeV)", 3);
00291     }
00292     if(laserClient){
00293       if ( meOccupancyPN_ ) dqmStore_->removeElement( meOccupancyPN_->getName() );
00294       name = "EBOT PN digi occupancy summary";
00295       meOccupancyPN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
00296       meOccupancyPN_->setAxisTitle("jchannel", 1);
00297       meOccupancyPN_->setAxisTitle("jpseudo-strip", 2);
00298     }
00299 
00300   }
00301 
00302   if(statusFlagsClient && produceReports_){
00303     if ( meStatusFlags_ ) dqmStore_->removeElement( meStatusFlags_->getName() );
00304     name = "EBSFT front-end status summary";
00305     meStatusFlags_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
00306     meStatusFlags_->setAxisTitle("jphi'", 1);
00307     meStatusFlags_->setAxisTitle("jeta'", 2);
00308 
00309     if ( meStatusFlagsErr_ ) dqmStore_->removeElement( meStatusFlagsErr_->getName() );
00310     name = "EBSFT front-end status errors summary";
00311     meStatusFlagsErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
00312     for (int i = 0; i < 36; i++) {
00313       meStatusFlagsErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00314     }
00315   }
00316 
00317   if(pedestalOnlineClient && produceReports_){
00318     if ( mePedestalOnline_ ) dqmStore_->removeElement( mePedestalOnline_->getName() );
00319     name = "EBPOT pedestal quality summary G12";
00320     mePedestalOnline_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00321     mePedestalOnline_->setAxisTitle("jphi", 1);
00322     mePedestalOnline_->setAxisTitle("jeta", 2);
00323 
00324     if ( mePedestalOnlineErr_ ) dqmStore_->removeElement( mePedestalOnlineErr_->getName() );
00325     name = "EBPOT pedestal quality errors summary G12";
00326     mePedestalOnlineErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
00327     for (int i = 0; i < 36; i++) {
00328       mePedestalOnlineErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00329     }
00330 
00331     if ( mePedestalOnlineRMSMap_ ) dqmStore_->removeElement( mePedestalOnlineRMSMap_->getName() );
00332     name = "EBPOT pedestal G12 RMS map";
00333     mePedestalOnlineRMSMap_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00334     mePedestalOnlineRMSMap_->setAxisTitle("jphi", 1);
00335     mePedestalOnlineRMSMap_->setAxisTitle("jeta", 2);
00336     mePedestalOnlineRMSMap_->setAxisTitle("rms", 3);
00337 
00338     if ( mePedestalOnlineMean_ ) dqmStore_->removeElement( mePedestalOnlineMean_->getName() );
00339     name = "EBPOT pedestal G12 mean";
00340     mePedestalOnlineMean_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 150., 250.);
00341     for (int i = 0; i < 36; i++) {
00342       mePedestalOnlineMean_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00343     }
00344 
00345     if ( mePedestalOnlineRMS_ ) dqmStore_->removeElement( mePedestalOnlineRMS_->getName() );
00346     name = "EBPOT pedestal G12 rms";
00347     mePedestalOnlineRMS_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10.);
00348     for (int i = 0; i < 36; i++) {
00349       mePedestalOnlineRMS_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00350     }
00351   }
00352 
00353   if(laserClient){
00354 
00355     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
00356 
00357       if ( meLaserL1_ ) dqmStore_->removeElement( meLaserL1_->getName() );
00358       name = "EBLT laser quality summary L1";
00359       meLaserL1_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00360       meLaserL1_->setAxisTitle("jphi", 1);
00361       meLaserL1_->setAxisTitle("jeta", 2);
00362 
00363       if ( meLaserL1Err_ ) dqmStore_->removeElement( meLaserL1Err_->getName() );
00364       name = "EBLT laser quality errors summary L1";
00365       meLaserL1Err_ = dqmStore_->book1D(name, name, 36, 1, 37);
00366       for (int i = 0; i < 36; i++) {
00367         meLaserL1Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00368       }
00369 
00370       if ( meLaserL1PN_ ) dqmStore_->removeElement( meLaserL1PN_->getName() );
00371       name = "EBLT PN laser quality summary L1";
00372       meLaserL1PN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
00373       meLaserL1PN_->setAxisTitle("jchannel", 1);
00374       meLaserL1PN_->setAxisTitle("jpseudo-strip", 2);
00375 
00376       if ( meLaserL1PNErr_ ) dqmStore_->removeElement( meLaserL1PNErr_->getName() );
00377       name = "EBLT PN laser quality errors summary L1";
00378       meLaserL1PNErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
00379       for (int i = 0; i < 36; i++) {
00380         meLaserL1PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00381       }
00382 
00383       if ( meLaserL1Ampl_ ) dqmStore_->removeElement( meLaserL1Ampl_->getName() );
00384       name = "EBLT laser L1 amplitude summary";
00385       meLaserL1Ampl_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096., "s");
00386       for (int i = 0; i < 36; i++) {
00387         meLaserL1Ampl_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00388       }
00389 
00390       if ( meLaserL1Timing_ ) dqmStore_->removeElement( meLaserL1Timing_->getName() );
00391       name = "EBLT laser L1 timing summary";
00392       meLaserL1Timing_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10., "s");
00393       for (int i = 0; i < 36; i++) {
00394         meLaserL1Timing_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00395       }
00396 
00397       if ( meLaserL1AmplOverPN_ ) dqmStore_->removeElement( meLaserL1AmplOverPN_->getName() );
00398       name = "EBLT laser L1 amplitude over PN summary";
00399       meLaserL1AmplOverPN_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
00400       for (int i = 0; i < 36; i++) {
00401         meLaserL1AmplOverPN_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00402       }
00403 
00404     }
00405 
00406     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
00407 
00408       if ( meLaserL2_ ) dqmStore_->removeElement( meLaserL2_->getName() );
00409       name = "EBLT laser quality summary L2";
00410       meLaserL2_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00411       meLaserL2_->setAxisTitle("jphi", 1);
00412       meLaserL2_->setAxisTitle("jeta", 2);
00413 
00414       if ( meLaserL2Err_ ) dqmStore_->removeElement( meLaserL2Err_->getName() );
00415       name = "EBLT laser quality errors summary L2";
00416       meLaserL2Err_ = dqmStore_->book1D(name, name, 36, 1, 37);
00417       for (int i = 0; i < 36; i++) {
00418         meLaserL2Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00419       }
00420 
00421       if ( meLaserL2PN_ ) dqmStore_->removeElement( meLaserL2PN_->getName() );
00422       name = "EBLT PN laser quality summary L2";
00423       meLaserL2PN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
00424       meLaserL2PN_->setAxisTitle("jchannel", 1);
00425       meLaserL2PN_->setAxisTitle("jpseudo-strip", 2);
00426 
00427       if ( meLaserL2PNErr_ ) dqmStore_->removeElement( meLaserL2PNErr_->getName() );
00428       name = "EBLT PN laser quality errors summary L2";
00429       meLaserL2PNErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
00430       for (int i = 0; i < 36; i++) {
00431         meLaserL2PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00432       }
00433 
00434       if ( meLaserL2Ampl_ ) dqmStore_->removeElement( meLaserL2Ampl_->getName() );
00435       name = "EBLT laser L2 amplitude summary";
00436       meLaserL2Ampl_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096., "s");
00437       for (int i = 0; i < 36; i++) {
00438         meLaserL2Ampl_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00439       }
00440 
00441       if ( meLaserL2Timing_ ) dqmStore_->removeElement( meLaserL2Timing_->getName() );
00442       name = "EBLT laser L2 timing summary";
00443       meLaserL2Timing_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10., "s");
00444       for (int i = 0; i < 36; i++) {
00445         meLaserL2Timing_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00446       }
00447 
00448       if ( meLaserL2AmplOverPN_ ) dqmStore_->removeElement( meLaserL2AmplOverPN_->getName() );
00449       name = "EBLT laser L2 amplitude over PN summary";
00450       meLaserL2AmplOverPN_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
00451       for (int i = 0; i < 36; i++) {
00452         meLaserL2AmplOverPN_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00453       }
00454 
00455     }
00456 
00457     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
00458 
00459       if ( meLaserL3_ ) dqmStore_->removeElement( meLaserL3_->getName() );
00460       name = "EBLT laser quality summary L3";
00461       meLaserL3_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00462       meLaserL3_->setAxisTitle("jphi", 1);
00463       meLaserL3_->setAxisTitle("jeta", 2);
00464 
00465       if ( meLaserL3Err_ ) dqmStore_->removeElement( meLaserL3Err_->getName() );
00466       name = "EBLT laser quality errors summary L3";
00467       meLaserL3Err_ = dqmStore_->book1D(name, name, 36, 1, 37);
00468       for (int i = 0; i < 36; i++) {
00469         meLaserL3Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00470       }
00471 
00472       if ( meLaserL3PN_ ) dqmStore_->removeElement( meLaserL3PN_->getName() );
00473       name = "EBLT PN laser quality summary L3";
00474       meLaserL3PN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
00475       meLaserL3PN_->setAxisTitle("jchannel", 1);
00476       meLaserL3PN_->setAxisTitle("jpseudo-strip", 2);
00477 
00478       if ( meLaserL3PNErr_ ) dqmStore_->removeElement( meLaserL3PNErr_->getName() );
00479       name = "EBLT PN laser quality errors summary L3";
00480       meLaserL3PNErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
00481       for (int i = 0; i < 36; i++) {
00482         meLaserL3PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00483       }
00484 
00485       if ( meLaserL3Ampl_ ) dqmStore_->removeElement( meLaserL3Ampl_->getName() );
00486       name = "EBLT laser L3 amplitude summary";
00487       meLaserL3Ampl_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096., "s");
00488       for (int i = 0; i < 36; i++) {
00489         meLaserL3Ampl_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00490       }
00491 
00492       if ( meLaserL3Timing_ ) dqmStore_->removeElement( meLaserL3Timing_->getName() );
00493       name = "EBLT laser L3 timing summary";
00494       meLaserL3Timing_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10., "s");
00495       for (int i = 0; i < 36; i++) {
00496         meLaserL3Timing_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00497       }
00498 
00499       if ( meLaserL3AmplOverPN_ ) dqmStore_->removeElement( meLaserL3AmplOverPN_->getName() );
00500       name = "EBLT laser L3 amplitude over PN summary";
00501       meLaserL3AmplOverPN_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
00502       for (int i = 0; i < 36; i++) {
00503         meLaserL3AmplOverPN_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00504       }
00505 
00506     }
00507 
00508     if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
00509 
00510       if ( meLaserL4_ ) dqmStore_->removeElement( meLaserL4_->getName() );
00511       name = "EBLT laser quality summary L4";
00512       meLaserL4_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00513       meLaserL4_->setAxisTitle("jphi", 1);
00514       meLaserL4_->setAxisTitle("jeta", 2);
00515 
00516       if ( meLaserL4Err_ ) dqmStore_->removeElement( meLaserL4Err_->getName() );
00517       name = "EBLT laser quality errors summary L4";
00518       meLaserL4Err_ = dqmStore_->book1D(name, name, 36, 1, 37);
00519       for (int i = 0; i < 36; i++) {
00520         meLaserL4Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00521       }
00522 
00523       if ( meLaserL4PN_ ) dqmStore_->removeElement( meLaserL4PN_->getName() );
00524       name = "EBLT PN laser quality summary L4";
00525       meLaserL4PN_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
00526       meLaserL4PN_->setAxisTitle("jchannel", 1);
00527       meLaserL4PN_->setAxisTitle("jpseudo-strip", 2);
00528 
00529       if ( meLaserL4PNErr_ ) dqmStore_->removeElement( meLaserL4PNErr_->getName() );
00530       name = "EBLT PN laser quality errors summary L4";
00531       meLaserL4PNErr_ = dqmStore_->book1D(name, name, 36, 1, 37);
00532       for (int i = 0; i < 36; i++) {
00533         meLaserL4PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00534       }
00535 
00536       if ( meLaserL4Ampl_ ) dqmStore_->removeElement( meLaserL4Ampl_->getName() );
00537       name = "EBLT laser L4 amplitude summary";
00538       meLaserL4Ampl_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096., "s");
00539       for (int i = 0; i < 36; i++) {
00540         meLaserL4Ampl_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00541       }
00542 
00543       if ( meLaserL4Timing_ ) dqmStore_->removeElement( meLaserL4Timing_->getName() );
00544       name = "EBLT laser L4 timing summary";
00545       meLaserL4Timing_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10., "s");
00546       for (int i = 0; i < 36; i++) {
00547         meLaserL4Timing_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00548       }
00549 
00550       if ( meLaserL4AmplOverPN_ ) dqmStore_->removeElement( meLaserL4AmplOverPN_->getName() );
00551       name = "EBLT laser L4 amplitude over PN summary";
00552       meLaserL4AmplOverPN_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
00553       for (int i = 0; i < 36; i++) {
00554         meLaserL4AmplOverPN_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00555       }
00556 
00557     }
00558   }
00559 
00560   if(pedestalClient){
00561     if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00562 
00563       if( mePedestalG01_ ) dqmStore_->removeElement( mePedestalG01_->getName() );
00564       name = "EBPT pedestal quality G01 summary";
00565       mePedestalG01_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00566       mePedestalG01_->setAxisTitle("jphi", 1);
00567       mePedestalG01_->setAxisTitle("jeta", 2);
00568 
00569     }
00570 
00571     if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00572 
00573       if( mePedestalG06_ ) dqmStore_->removeElement( mePedestalG06_->getName() );
00574       name = "EBPT pedestal quality G06 summary";
00575       mePedestalG06_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00576       mePedestalG06_->setAxisTitle("jphi", 1);
00577       mePedestalG06_->setAxisTitle("jeta", 2);
00578 
00579     }
00580 
00581     if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00582 
00583       if( mePedestalG12_ ) dqmStore_->removeElement( mePedestalG12_->getName() );
00584       name = "EBPT pedestal quality G12 summary";
00585       mePedestalG12_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00586       mePedestalG12_->setAxisTitle("jphi", 1);
00587       mePedestalG12_->setAxisTitle("jeta", 2);
00588 
00589     }
00590 
00591     if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
00592 
00593       if( mePedestalPNG01_ ) dqmStore_->removeElement( mePedestalPNG01_->getName() );
00594       name = "EBPT PN pedestal quality G01 summary";
00595       mePedestalPNG01_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10, 10.);
00596       mePedestalPNG01_->setAxisTitle("jchannel", 1);
00597       mePedestalPNG01_->setAxisTitle("jpseudo-strip", 2);
00598 
00599     }
00600 
00601     if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
00602 
00603       if( mePedestalPNG16_ ) dqmStore_->removeElement( mePedestalPNG16_->getName() );
00604       name = "EBPT PN pedestal quality G16 summary";
00605       mePedestalPNG16_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10, 10.);
00606       mePedestalPNG16_->setAxisTitle("jchannel", 1);
00607       mePedestalPNG16_->setAxisTitle("jpseudo-strip", 2);
00608 
00609     }
00610   }
00611 
00612   if(testPulseClient){
00613     if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00614 
00615       if( meTestPulseG01_ ) dqmStore_->removeElement( meTestPulseG01_->getName() );
00616       name = "EBTPT test pulse quality G01 summary";
00617       meTestPulseG01_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00618       meTestPulseG01_->setAxisTitle("jphi", 1);
00619       meTestPulseG01_->setAxisTitle("jeta", 2);
00620 
00621     }
00622 
00623     if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00624 
00625       if( meTestPulseG06_ ) dqmStore_->removeElement( meTestPulseG06_->getName() );
00626       name = "EBTPT test pulse quality G06 summary";
00627       meTestPulseG06_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00628       meTestPulseG06_->setAxisTitle("jphi", 1);
00629       meTestPulseG06_->setAxisTitle("jeta", 2);
00630 
00631     }
00632 
00633     if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00634 
00635       if( meTestPulseG12_ ) dqmStore_->removeElement( meTestPulseG12_->getName() );
00636       name = "EBTPT test pulse quality G12 summary";
00637       meTestPulseG12_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00638       meTestPulseG12_->setAxisTitle("jphi", 1);
00639       meTestPulseG12_->setAxisTitle("jeta", 2);
00640 
00641     }
00642 
00643     if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 1) != MGPAGainsPN_.end() ) {
00644 
00645       if( meTestPulsePNG01_ ) dqmStore_->removeElement( meTestPulsePNG01_->getName() );
00646       name = "EBTPT PN test pulse quality G01 summary";
00647       meTestPulsePNG01_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
00648       meTestPulsePNG01_->setAxisTitle("jchannel", 1);
00649       meTestPulsePNG01_->setAxisTitle("jpseudo-strip", 2);
00650 
00651     }
00652 
00653     if (find(MGPAGainsPN_.begin(), MGPAGainsPN_.end(), 16) != MGPAGainsPN_.end() ) {
00654 
00655       if( meTestPulsePNG16_ ) dqmStore_->removeElement( meTestPulsePNG16_->getName() );
00656       name = "EBTPT PN test pulse quality G16 summary";
00657       meTestPulsePNG16_ = dqmStore_->book2D(name, name, 90, 0., 90., 20, -10., 10.);
00658       meTestPulsePNG16_->setAxisTitle("jchannel", 1);
00659       meTestPulsePNG16_->setAxisTitle("jpseudo-strip", 2);
00660 
00661     }
00662 
00663     if (find(MGPAGains_.begin(), MGPAGains_.end(), 1) != MGPAGains_.end() ) {
00664 
00665       if( meTestPulseAmplG01_ ) dqmStore_->removeElement( meTestPulseAmplG01_->getName() );
00666       name = "EBTPT test pulse amplitude G01 summary";
00667       meTestPulseAmplG01_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
00668       for (int i = 0; i < 36; i++) {
00669         meTestPulseAmplG01_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00670       }
00671 
00672     }
00673 
00674     if (find(MGPAGains_.begin(), MGPAGains_.end(), 6) != MGPAGains_.end() ) {
00675 
00676       if( meTestPulseAmplG06_ ) dqmStore_->removeElement( meTestPulseAmplG06_->getName() );
00677       name = "EBTPT test pulse amplitude G06 summary";
00678       meTestPulseAmplG06_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
00679       for (int i = 0; i < 36; i++) {
00680         meTestPulseAmplG06_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00681       }
00682 
00683     }
00684 
00685     if (find(MGPAGains_.begin(), MGPAGains_.end(), 12) != MGPAGains_.end() ) {
00686 
00687       if( meTestPulseAmplG12_ ) dqmStore_->removeElement( meTestPulseAmplG12_->getName() );
00688       name = "EBTPT test pulse amplitude G12 summary";
00689       meTestPulseAmplG12_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 4096, 0., 4096.*12., "s");
00690       for (int i = 0; i < 36; i++) {
00691         meTestPulseAmplG12_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00692       }
00693 
00694     }
00695   }
00696 
00697   if(timingClient){
00698     if( meTiming_ ) dqmStore_->removeElement( meTiming_->getName() );
00699     name = "EBTMT timing quality summary";
00700     meTiming_ = dqmStore_->book2D(name, name, 72, 0., 360., 34, -85., 85.);
00701     meTiming_->setAxisTitle("jphi", 1);
00702     meTiming_->setAxisTitle("jeta", 2);
00703 
00704     if( meTimingMean1D_ ) dqmStore_->removeElement( meTimingMean1D_->getName() );
00705     name = "EBTMT timing mean 1D summary";
00706     meTimingMean1D_ = dqmStore_->book1D(name, name, 100, -25., 25.);
00707     meTimingMean1D_->setAxisTitle("mean (ns)", 1);
00708 
00709     if( meTimingRMS1D_ ) dqmStore_->removeElement( meTimingRMS1D_->getName() );
00710     name = "EBTMT timing rms 1D summary";
00711     meTimingRMS1D_ = dqmStore_->book1D(name, name, 100, 0.0, 10.0);
00712     meTimingRMS1D_->setAxisTitle("rms (ns)", 1);
00713 
00714     if ( meTimingMean_ ) dqmStore_->removeElement( meTimingMean_->getName() );
00715     name = "EBTMT timing mean";
00716     meTimingMean_ = dqmStore_->bookProfile(name, name, 36, 1, 37, -20., 20.,"");
00717     for (int i = 0; i < 36; i++) {
00718       meTimingMean_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00719     }
00720     meTimingMean_->setAxisTitle("mean (ns)", 2);
00721 
00722     if ( meTimingRMS_ ) dqmStore_->removeElement( meTimingRMS_->getName() );
00723     name = "EBTMT timing rms";
00724     meTimingRMS_ = dqmStore_->bookProfile(name, name, 36, 1, 37, 100, 0., 10.,"");
00725     for (int i = 0; i < 36; i++) {
00726       meTimingRMS_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00727     }
00728     meTimingRMS_->setAxisTitle("rms (ns)", 2);
00729   }
00730 
00731   if(triggerTowerClient){
00732     if( meTriggerTowerEt_ ) dqmStore_->removeElement( meTriggerTowerEt_->getName() );
00733     name = "EBTTT Et trigger tower summary";
00734     meTriggerTowerEt_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
00735     meTriggerTowerEt_->setAxisTitle("jphi'", 1);
00736     meTriggerTowerEt_->setAxisTitle("jeta'", 2);
00737     meTriggerTowerEt_->setAxisTitle("Et (GeV)", 3);
00738 
00739     if( meTriggerTowerEmulError_ ) dqmStore_->removeElement( meTriggerTowerEmulError_->getName() );
00740     name = "EBTTT emulator error quality summary";
00741     meTriggerTowerEmulError_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
00742     meTriggerTowerEmulError_->setAxisTitle("jphi'", 1);
00743     meTriggerTowerEmulError_->setAxisTitle("jeta'", 2);
00744 
00745     if( meTriggerTowerTiming_ ) dqmStore_->removeElement( meTriggerTowerTiming_->getName() );
00746     name = "EBTTT Trigger Primitives Timing summary";
00747     meTriggerTowerTiming_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
00748     meTriggerTowerTiming_->setAxisTitle("jphi'", 1);
00749     meTriggerTowerTiming_->setAxisTitle("jeta'", 2);
00750     meTriggerTowerTiming_->setAxisTitle("TP data matching emulator", 3);
00751 
00752     if( meTriggerTowerNonSingleTiming_ ) dqmStore_->removeElement( meTriggerTowerNonSingleTiming_->getName() );
00753     name = "EBTTT Trigger Primitives Non Single Timing summary";
00754     meTriggerTowerNonSingleTiming_ = dqmStore_->book2D(name, name, 72, 0., 72., 34, -17., 17.);
00755     meTriggerTowerNonSingleTiming_->setAxisTitle("jphi'", 1);
00756     meTriggerTowerNonSingleTiming_->setAxisTitle("jeta'", 2);
00757     meTriggerTowerNonSingleTiming_->setAxisTitle("fraction", 3);
00758   }
00759 
00760   if(meIntegrity_ && mePedestalOnline_ && meStatusFlags_ && (reducedReports_ || (meTiming_ && meTriggerTowerEmulError_))){
00761     if( meGlobalSummary_ ) dqmStore_->removeElement( meGlobalSummary_->getName() );
00762     name = "EB global summary";
00763     meGlobalSummary_ = dqmStore_->book2D(name, name, 360, 0., 360., 170, -85., 85.);
00764     meGlobalSummary_->setAxisTitle("jphi", 1);
00765     meGlobalSummary_->setAxisTitle("jeta", 2);
00766 
00767     if(meSummaryErr_) dqmStore_->removeElement(meSummaryErr_->getName());
00768     name = "EB global summary errors";
00769     meSummaryErr_ = dqmStore_->book1D(name, name, 1, 0., 1.);
00770   }
00771 }
00772 
00773 void EBSummaryClient::cleanup(void) {
00774 
00775   if ( ! enableCleanup_ ) return;
00776 
00777   for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00778 
00779     int ism = superModules_[i];
00780 
00781     if ( cloneME_ ) {
00782       if ( hpot01_[ism-1] ) delete hpot01_[ism-1];
00783       if ( httt01_[ism-1] ) delete httt01_[ism-1];
00784     }
00785 
00786     hpot01_[ism-1] = 0;
00787     httt01_[ism-1] = 0;
00788 
00789   }
00790 
00791   dqmStore_->setCurrentFolder( prefixME_ + "/EBSummaryClient" );
00792 
00793   if ( meIntegrity_ ) dqmStore_->removeElement( meIntegrity_->getName() );
00794   meIntegrity_ = 0;
00795 
00796   if ( meIntegrityErr_ ) dqmStore_->removeElement( meIntegrityErr_->getName() );
00797   meIntegrityErr_ = 0;
00798 
00799   if ( meIntegrityPN_ ) dqmStore_->removeElement( meIntegrityPN_->getName() );
00800   meIntegrityPN_ = 0;
00801 
00802   if ( meOccupancy_ ) dqmStore_->removeElement( meOccupancy_->getName() );
00803   meOccupancy_ = 0;
00804 
00805   if ( meOccupancy1D_ ) dqmStore_->removeElement( meOccupancy1D_->getName() );
00806   meOccupancy1D_ = 0;
00807 
00808   if ( meOccupancyPN_ ) dqmStore_->removeElement( meOccupancyPN_->getName() );
00809   meOccupancyPN_ = 0;
00810 
00811   if ( meStatusFlags_ ) dqmStore_->removeElement( meStatusFlags_->getName() );
00812   meStatusFlags_ = 0;
00813 
00814   if ( meStatusFlagsErr_ ) dqmStore_->removeElement( meStatusFlagsErr_->getName() );
00815   meStatusFlagsErr_ = 0;
00816 
00817   if ( mePedestalOnline_ ) dqmStore_->removeElement( mePedestalOnline_->getName() );
00818   mePedestalOnline_ = 0;
00819 
00820   if ( mePedestalOnlineErr_ ) dqmStore_->removeElement( mePedestalOnlineErr_->getName() );
00821   mePedestalOnlineErr_ = 0;
00822 
00823   if ( mePedestalOnlineMean_ ) dqmStore_->removeElement( mePedestalOnlineMean_->getName() );
00824   mePedestalOnlineMean_ = 0;
00825 
00826   if ( mePedestalOnlineRMS_ ) dqmStore_->removeElement( mePedestalOnlineRMS_->getName() );
00827   mePedestalOnlineRMS_ = 0;
00828 
00829   if ( mePedestalOnlineRMSMap_ ) dqmStore_->removeElement( mePedestalOnlineRMSMap_->getName() );
00830   mePedestalOnlineRMSMap_ = 0;
00831 
00832   if ( meLaserL1_ ) dqmStore_->removeElement( meLaserL1_->getName() );
00833   meLaserL1_ = 0;
00834 
00835   if ( meLaserL1Err_ ) dqmStore_->removeElement( meLaserL1Err_->getName() );
00836   meLaserL1Err_ = 0;
00837 
00838   if ( meLaserL1Ampl_ ) dqmStore_->removeElement( meLaserL1Ampl_->getName() );
00839   meLaserL1Ampl_ = 0;
00840 
00841   if ( meLaserL1Timing_ ) dqmStore_->removeElement( meLaserL1Timing_->getName() );
00842   meLaserL1Timing_ = 0;
00843 
00844   if ( meLaserL1AmplOverPN_ ) dqmStore_->removeElement( meLaserL1AmplOverPN_->getName() );
00845   meLaserL1AmplOverPN_ = 0;
00846 
00847   if ( meLaserL1PN_ ) dqmStore_->removeElement( meLaserL1PN_->getName() );
00848   meLaserL1PN_ = 0;
00849 
00850   if ( meLaserL1PNErr_ ) dqmStore_->removeElement( meLaserL1PNErr_->getName() );
00851   meLaserL1PNErr_ = 0;
00852 
00853   if ( meLaserL2_ ) dqmStore_->removeElement( meLaserL2_->getName() );
00854   meLaserL2_ = 0;
00855 
00856   if ( meLaserL2Err_ ) dqmStore_->removeElement( meLaserL2Err_->getName() );
00857   meLaserL2Err_ = 0;
00858 
00859   if ( meLaserL2Ampl_ ) dqmStore_->removeElement( meLaserL2Ampl_->getName() );
00860   meLaserL2Ampl_ = 0;
00861 
00862   if ( meLaserL2Timing_ ) dqmStore_->removeElement( meLaserL2Timing_->getName() );
00863   meLaserL2Timing_ = 0;
00864 
00865   if ( meLaserL2AmplOverPN_ ) dqmStore_->removeElement( meLaserL2AmplOverPN_->getName() );
00866   meLaserL2AmplOverPN_ = 0;
00867 
00868   if ( meLaserL2PN_ ) dqmStore_->removeElement( meLaserL2PN_->getName() );
00869   meLaserL2PN_ = 0;
00870 
00871   if ( meLaserL2PNErr_ ) dqmStore_->removeElement( meLaserL2PNErr_->getName() );
00872   meLaserL2PNErr_ = 0;
00873 
00874   if ( meLaserL3_ ) dqmStore_->removeElement( meLaserL3_->getName() );
00875   meLaserL3_ = 0;
00876 
00877   if ( meLaserL3Err_ ) dqmStore_->removeElement( meLaserL3Err_->getName() );
00878   meLaserL3Err_ = 0;
00879 
00880   if ( meLaserL3Ampl_ ) dqmStore_->removeElement( meLaserL3Ampl_->getName() );
00881   meLaserL3Ampl_ = 0;
00882 
00883   if ( meLaserL3Timing_ ) dqmStore_->removeElement( meLaserL3Timing_->getName() );
00884   meLaserL3Timing_ = 0;
00885 
00886   if ( meLaserL3AmplOverPN_ ) dqmStore_->removeElement( meLaserL3AmplOverPN_->getName() );
00887   meLaserL3AmplOverPN_ = 0;
00888 
00889   if ( meLaserL3PN_ ) dqmStore_->removeElement( meLaserL3PN_->getName() );
00890   meLaserL3PN_ = 0;
00891 
00892   if ( meLaserL3PNErr_ ) dqmStore_->removeElement( meLaserL3PNErr_->getName() );
00893   meLaserL3PNErr_ = 0;
00894 
00895   if ( meLaserL4_ ) dqmStore_->removeElement( meLaserL4_->getName() );
00896   meLaserL4_ = 0;
00897 
00898   if ( meLaserL4Err_ ) dqmStore_->removeElement( meLaserL4Err_->getName() );
00899   meLaserL4Err_ = 0;
00900 
00901   if ( meLaserL4Ampl_ ) dqmStore_->removeElement( meLaserL4Ampl_->getName() );
00902   meLaserL4Ampl_ = 0;
00903 
00904   if ( meLaserL4Timing_ ) dqmStore_->removeElement( meLaserL4Timing_->getName() );
00905   meLaserL4Timing_ = 0;
00906 
00907   if ( meLaserL4AmplOverPN_ ) dqmStore_->removeElement( meLaserL4AmplOverPN_->getName() );
00908   meLaserL4AmplOverPN_ = 0;
00909 
00910   if ( meLaserL4PN_ ) dqmStore_->removeElement( meLaserL4PN_->getName() );
00911   meLaserL4PN_ = 0;
00912 
00913   if ( meLaserL4PNErr_ ) dqmStore_->removeElement( meLaserL4PNErr_->getName() );
00914   meLaserL4PNErr_ = 0;
00915 
00916   if ( mePedestalG01_ ) dqmStore_->removeElement( mePedestalG01_->getName() );
00917   mePedestalG01_ = 0;
00918 
00919   if ( mePedestalG06_ ) dqmStore_->removeElement( mePedestalG06_->getName() );
00920   mePedestalG06_ = 0;
00921 
00922   if ( mePedestalG12_ ) dqmStore_->removeElement( mePedestalG12_->getName() );
00923   mePedestalG12_ = 0;
00924 
00925   if ( meTestPulseG01_ ) dqmStore_->removeElement( meTestPulseG01_->getName() );
00926   meTestPulseG01_ = 0;
00927 
00928   if ( meTestPulseG06_ ) dqmStore_->removeElement( meTestPulseG06_->getName() );
00929   meTestPulseG06_ = 0;
00930 
00931   if ( meTestPulseG12_ ) dqmStore_->removeElement( meTestPulseG12_->getName() );
00932   meTestPulseG12_ = 0;
00933 
00934   if ( meTestPulseG01_ ) dqmStore_->removeElement( meTestPulseG01_->getName() );
00935   meTestPulseG01_ = 0;
00936 
00937   if ( meTestPulseAmplG01_ ) dqmStore_->removeElement( meTestPulseAmplG01_->getName() );
00938   meTestPulseAmplG01_ = 0;
00939 
00940   if ( meTestPulseAmplG06_ ) dqmStore_->removeElement( meTestPulseAmplG06_->getName() );
00941   meTestPulseAmplG06_ = 0;
00942 
00943   if ( meTestPulseAmplG12_ ) dqmStore_->removeElement( meTestPulseAmplG12_->getName() );
00944   meTestPulseAmplG12_ = 0;
00945 
00946   if ( meRecHitEnergy_ ) dqmStore_->removeElement( meRecHitEnergy_->getName() );
00947   meRecHitEnergy_ = 0;
00948 
00949   if ( meTiming_ ) dqmStore_->removeElement( meTiming_->getName() );
00950   meTiming_ = 0;
00951 
00952   if ( meTimingMean1D_ ) dqmStore_->removeElement( meTimingMean1D_->getName() );
00953   meTimingMean1D_ = 0;
00954 
00955   if ( meTimingRMS1D_ ) dqmStore_->removeElement( meTimingRMS1D_->getName() );
00956   meTimingRMS1D_ = 0;
00957 
00958   if ( meTimingMean_ ) dqmStore_->removeElement( meTimingMean_->getName() );
00959   meTimingMean_ = 0;
00960 
00961   if ( meTimingRMS_ ) dqmStore_->removeElement( meTimingRMS_->getName() );
00962   meTimingRMS_ = 0;
00963 
00964   if ( meTriggerTowerEt_ ) dqmStore_->removeElement( meTriggerTowerEt_->getName() );
00965   meTriggerTowerEt_ = 0;
00966 
00967   if ( meTriggerTowerEmulError_ ) dqmStore_->removeElement( meTriggerTowerEmulError_->getName() );
00968   meTriggerTowerEmulError_ = 0;
00969 
00970   if ( meTriggerTowerTiming_ ) dqmStore_->removeElement( meTriggerTowerTiming_->getName() );
00971   meTriggerTowerTiming_ = 0;
00972 
00973   if ( meTriggerTowerNonSingleTiming_ ) dqmStore_->removeElement( meTriggerTowerNonSingleTiming_->getName() );
00974   meTriggerTowerNonSingleTiming_ = 0;
00975 
00976   if ( meGlobalSummary_ ) dqmStore_->removeElement( meGlobalSummary_->getName() );
00977   meGlobalSummary_ = 0;
00978 
00979   if(meSummaryErr_) dqmStore_->removeElement(meSummaryErr_->getName());
00980   meSummaryErr_ = 0;
00981 }
00982 
00983 #ifdef WITH_ECAL_COND_DB
00984 bool EBSummaryClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
00985 
00986   status = true;
00987 
00988   return true;
00989 
00990 }
00991 #endif
00992 
00993 void EBSummaryClient::analyze(void) {
00994 
00995   ievt_++;
00996   jevt_++;
00997   if ( ievt_ % 10 == 0 ) {
00998     if ( debug_ ) std::cout << "EBSummaryClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
00999   }
01000 
01001   uint32_t chWarnBit = 1 << EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING;
01002 
01003   for ( int iex = 1; iex <= 170; iex++ ) {
01004     for ( int ipx = 1; ipx <= 360; ipx++ ) {
01005 
01006       if ( meIntegrity_ ) meIntegrity_->setBinContent( ipx, iex, 6. );
01007       if ( meOccupancy_ ) meOccupancy_->setBinContent( ipx, iex, 0. );
01008       if ( meStatusFlags_ ) meStatusFlags_->setBinContent( ipx, iex, 6. );
01009       if ( mePedestalOnline_ ) mePedestalOnline_->setBinContent( ipx, iex, 6. );
01010       if ( mePedestalOnlineRMSMap_ ) mePedestalOnlineRMSMap_->setBinContent( ipx, iex, -1.);
01011       if ( meLaserL1_ ) meLaserL1_->setBinContent( ipx, iex, 6. );
01012       if ( meLaserL2_ ) meLaserL2_->setBinContent( ipx, iex, 6. );
01013       if ( meLaserL3_ ) meLaserL3_->setBinContent( ipx, iex, 6. );
01014       if ( meLaserL4_ ) meLaserL4_->setBinContent( ipx, iex, 6. );
01015       if ( mePedestalG01_ ) mePedestalG01_->setBinContent( ipx, iex, 6. );
01016       if ( mePedestalG06_ ) mePedestalG06_->setBinContent( ipx, iex, 6. );
01017       if ( mePedestalG12_ ) mePedestalG12_->setBinContent( ipx, iex, 6. );
01018       if ( meTestPulseG01_ ) meTestPulseG01_->setBinContent( ipx, iex, 6. );
01019       if ( meTestPulseG06_ ) meTestPulseG06_->setBinContent( ipx, iex, 6. );
01020       if ( meTestPulseG12_ ) meTestPulseG12_->setBinContent( ipx, iex, 6. );
01021 
01022       if ( meRecHitEnergy_ ) meRecHitEnergy_->setBinContent( ipx, iex, 0. );
01023 
01024       if(meGlobalSummary_ ) meGlobalSummary_->setBinContent( ipx, iex, 6. );
01025 
01026     }
01027   }
01028 
01029   for ( int iex = 1; iex <= 20; iex++ ) {
01030     for ( int ipx = 1; ipx <= 90; ipx++ ) {
01031 
01032       if ( meIntegrityPN_ ) meIntegrityPN_->setBinContent( ipx, iex, 6. );
01033       if ( meOccupancyPN_ ) meOccupancyPN_->setBinContent( ipx, iex, 0. );
01034       if ( meLaserL1PN_ ) meLaserL1PN_->setBinContent( ipx, iex, 6. );
01035       if ( meLaserL2PN_ ) meLaserL2PN_->setBinContent( ipx, iex, 6. );
01036       if ( meLaserL3PN_ ) meLaserL3PN_->setBinContent( ipx, iex, 6. );
01037       if ( meLaserL4PN_ ) meLaserL4PN_->setBinContent( ipx, iex, 6. );
01038       if ( mePedestalPNG01_ ) mePedestalPNG01_->setBinContent( ipx, iex, 6. );
01039       if ( mePedestalPNG16_ ) mePedestalPNG16_->setBinContent( ipx, iex, 6. );
01040       if ( meTestPulsePNG01_ ) meTestPulsePNG01_->setBinContent( ipx, iex, 6. );
01041       if ( meTestPulsePNG16_ ) meTestPulsePNG16_->setBinContent( ipx, iex, 6. );
01042 
01043     }
01044   }
01045 
01046   for ( int iex = 1; iex <= 34; iex++ ) {
01047     for ( int ipx = 1; ipx <= 72; ipx++ ) {
01048       if ( meTriggerTowerEt_ ) meTriggerTowerEt_->setBinContent( ipx, iex, 0. );
01049       if ( meTriggerTowerEmulError_ ) meTriggerTowerEmulError_->setBinContent( ipx, iex, 6. );
01050       if ( meTriggerTowerTiming_ ) meTriggerTowerTiming_->setBinContent( ipx, iex, 0. );
01051       if ( meTriggerTowerNonSingleTiming_ ) meTriggerTowerNonSingleTiming_->setBinContent( ipx, iex, -1. );
01052       if ( meTiming_ ) meTiming_->setBinContent( ipx, iex, 6. );
01053     }
01054   }
01055 
01056   if ( meIntegrity_ ) meIntegrity_->setEntries( 0 );
01057   if ( meIntegrityErr_ ) meIntegrityErr_->Reset();
01058   if ( meIntegrityPN_ ) meIntegrityPN_->setEntries( 0 );
01059   if ( meOccupancy_ ) meOccupancy_->setEntries( 0 );
01060   if ( meOccupancy1D_ ) meOccupancy1D_->Reset();
01061   if ( meOccupancyPN_ ) meOccupancyPN_->setEntries( 0 );
01062   if ( meStatusFlags_ ) meStatusFlags_->setEntries( 0 );
01063   if ( meStatusFlagsErr_ ) meStatusFlagsErr_->Reset();
01064   if ( mePedestalOnline_ ) mePedestalOnline_->setEntries( 0 );
01065   if ( mePedestalOnlineErr_ ) mePedestalOnlineErr_->Reset();
01066   if ( mePedestalOnlineMean_ ) mePedestalOnlineMean_->Reset();
01067   if ( mePedestalOnlineRMS_ ) mePedestalOnlineRMS_->Reset();
01068   if ( mePedestalOnlineRMSMap_ ) mePedestalOnlineRMSMap_->Reset();
01069 
01070   if ( meLaserL1_ ) meLaserL1_->setEntries( 0 );
01071   if ( meLaserL1Err_ ) meLaserL1Err_->Reset();
01072   if ( meLaserL1Ampl_ ) meLaserL1Ampl_->Reset();
01073   if ( meLaserL1Timing_ ) meLaserL1Timing_->Reset();
01074   if ( meLaserL1AmplOverPN_ ) meLaserL1AmplOverPN_->Reset();
01075   if ( meLaserL1PN_ ) meLaserL1PN_->setEntries( 0 );
01076   if ( meLaserL1PNErr_ ) meLaserL1PNErr_->Reset();
01077 
01078   if ( meLaserL2_ ) meLaserL2_->setEntries( 0 );
01079   if ( meLaserL2Err_ ) meLaserL2Err_->Reset();
01080   if ( meLaserL2Ampl_ ) meLaserL2Ampl_->Reset();
01081   if ( meLaserL2Timing_ ) meLaserL2Timing_->Reset();
01082   if ( meLaserL2AmplOverPN_ ) meLaserL2AmplOverPN_->Reset();
01083   if ( meLaserL2PN_ ) meLaserL2PN_->setEntries( 0 );
01084   if ( meLaserL2PNErr_ ) meLaserL2PNErr_->Reset();
01085 
01086   if ( meLaserL3_ ) meLaserL3_->setEntries( 0 );
01087   if ( meLaserL3Err_ ) meLaserL3Err_->Reset();
01088   if ( meLaserL3Ampl_ ) meLaserL3Ampl_->Reset();
01089   if ( meLaserL3Timing_ ) meLaserL3Timing_->Reset();
01090   if ( meLaserL3AmplOverPN_ ) meLaserL3AmplOverPN_->Reset();
01091   if ( meLaserL3PN_ ) meLaserL3PN_->setEntries( 0 );
01092   if ( meLaserL3PNErr_ ) meLaserL3PNErr_->Reset();
01093 
01094   if ( meLaserL4_ ) meLaserL4_->setEntries( 0 );
01095   if ( meLaserL4Err_ ) meLaserL4Err_->Reset();
01096   if ( meLaserL4Ampl_ ) meLaserL4Ampl_->Reset();
01097   if ( meLaserL4Timing_ ) meLaserL4Timing_->Reset();
01098   if ( meLaserL4AmplOverPN_ ) meLaserL4AmplOverPN_->Reset();
01099   if ( meLaserL4PN_ ) meLaserL4PN_->setEntries( 0 );
01100   if ( meLaserL4PNErr_ ) meLaserL4PNErr_->Reset();
01101 
01102   if ( mePedestalG01_ ) mePedestalG01_->setEntries( 0 );
01103   if ( mePedestalG06_ ) mePedestalG06_->setEntries( 0 );
01104   if ( mePedestalG12_ ) mePedestalG12_->setEntries( 0 );
01105   if ( mePedestalPNG01_ ) mePedestalPNG01_->setEntries( 0 );
01106   if ( mePedestalPNG16_ ) mePedestalPNG16_->setEntries( 0 );
01107   if ( meTestPulseG01_ ) meTestPulseG01_->setEntries( 0 );
01108   if ( meTestPulseG06_ ) meTestPulseG06_->setEntries( 0 );
01109   if ( meTestPulseG12_ ) meTestPulseG12_->setEntries( 0 );
01110   if ( meTestPulsePNG01_ ) meTestPulsePNG01_->setEntries( 0 );
01111   if ( meTestPulsePNG16_ ) meTestPulsePNG16_->setEntries( 0 );
01112   if ( meTestPulseAmplG01_ ) meTestPulseAmplG01_->Reset();
01113   if ( meTestPulseAmplG06_ ) meTestPulseAmplG06_->Reset();
01114   if ( meTestPulseAmplG12_ ) meTestPulseAmplG12_->Reset();
01115 
01116   if ( meRecHitEnergy_ ) meRecHitEnergy_->setEntries( 0 );
01117   if ( meTiming_ ) meTiming_->setEntries( 0 );
01118   if ( meTimingMean1D_ ) meTimingMean1D_->Reset();
01119   if ( meTimingRMS1D_ ) meTimingRMS1D_->Reset();
01120   if ( meTimingMean_ ) meTimingMean_->Reset();
01121   if ( meTimingRMS_ ) meTimingRMS_->Reset();
01122   if ( meTriggerTowerEt_ ) meTriggerTowerEt_->setEntries( 0 );
01123   if ( meTriggerTowerEmulError_ ) meTriggerTowerEmulError_->setEntries( 0 );
01124   if ( meTriggerTowerTiming_ ) meTriggerTowerTiming_->setEntries( 0 );
01125   if ( meTriggerTowerNonSingleTiming_ ) meTriggerTowerNonSingleTiming_->setEntries( 0 );
01126 
01127   if(meGlobalSummary_ ) meGlobalSummary_->setEntries( 0 );
01128 
01129   if(meSummaryErr_) meSummaryErr_->Reset();
01130 
01131   MonitorElement* me(0);
01132   me = dqmStore_->get(prefixME_ + "/EBTimingTask/EBTMT timing map");
01133   TProfile2D* htmt(0);
01134   htmt = UtilsClient::getHisto(me, false, htmt);
01135 
01136   std::string subdir(subfolder_ == "" ? "" : subfolder_ + "/");
01137 
01138   TH1F* oosTrend(0);
01139 
01140   for ( unsigned int i=0; i<clients_.size(); i++ ) {
01141 
01142     EBIntegrityClient* ebic = dynamic_cast<EBIntegrityClient*>(clients_[i]);
01143     EBStatusFlagsClient* ebsfc = dynamic_cast<EBStatusFlagsClient*>(clients_[i]);
01144     if(!produceReports_) ebsfc = 0;
01145     EBPedestalOnlineClient* ebpoc = dynamic_cast<EBPedestalOnlineClient*>(clients_[i]);
01146     if(!produceReports_) ebpoc = 0;
01147 
01148     EBLaserClient* eblc = dynamic_cast<EBLaserClient*>(clients_[i]);
01149     EBPedestalClient* ebpc = dynamic_cast<EBPedestalClient*>(clients_[i]);
01150     EBTestPulseClient* ebtpc = dynamic_cast<EBTestPulseClient*>(clients_[i]);
01151 
01152     EBTimingClient* ebtmc = dynamic_cast<EBTimingClient*>(clients_[i]);
01153     EBTriggerTowerClient* ebtttc = dynamic_cast<EBTriggerTowerClient*>(clients_[i]);
01154 
01155     MonitorElement *me_01, *me_02, *me_03;
01156     MonitorElement *me_04, *me_05;
01157     //    MonitorElement *me_f[6], *me_fg[2];
01158     TH2F* h2;
01159     TH2F* h3;
01160 
01161     me = dqmStore_->get( prefixME_ + "/EcalInfo/EBMM DCC" );
01162     norm01_ = UtilsClient::getHisto( me, cloneME_, norm01_ );
01163 
01164     me = dqmStore_->get( prefixME_ + "/EBRawDataTask/" + subdir + "EBRDT L1A FE errors" );
01165     synch01_ = UtilsClient::getHisto( me, cloneME_, synch01_ );
01166 
01167     me = dqmStore_->get(prefixME_ + "/EBRawDataTask/" + subdir + "EBRDT accumulated FE synchronization errors");
01168     oosTrend = UtilsClient::getHisto(me, cloneME_, oosTrend);
01169 
01170     for ( unsigned int i=0; i<superModules_.size(); i++ ) {
01171 
01172       int ism = superModules_[i];
01173 
01174       me = dqmStore_->get( prefixME_ + "/EBOccupancyTask/" + subdir + "EBOT rec hit energy " + Numbers::sEB(ism) );
01175       hot01_[ism-1] = UtilsClient::getHisto( me, cloneME_, hot01_[ism-1] );
01176 
01177       me = dqmStore_->get( prefixME_ + "/EBPedestalOnlineTask/"+ subdir + "Gain12/EBPOT pedestal " + Numbers::sEB(ism) + " G12" );
01178       hpot01_[ism-1] = UtilsClient::getHisto( me, cloneME_, hpot01_[ism-1] );
01179 
01180       me = dqmStore_->get( prefixME_ + "/EBTriggerTowerTask/EBTTT Et map Real Digis " + Numbers::sEB(ism) );
01181       httt01_[ism-1] = UtilsClient::getHisto( me, cloneME_, httt01_[ism-1] );
01182 
01183       me = dqmStore_->get( prefixME_ + "/EBTimingTask/EBTMT timing " + Numbers::sEB(ism) );
01184       htmt01_[ism-1] = UtilsClient::getHisto( me, cloneME_, htmt01_[ism-1] );
01185 
01186       for ( int ie = 1; ie <= 85; ie++ ) {
01187         for ( int ip = 1; ip <= 20; ip++ ) {
01188 
01189           if ( ebic ) {
01190 
01191             me = ebic->meg01_[ism-1];
01192 
01193             if ( me ) {
01194 
01195               float xval = me->getBinContent( ie, ip );
01196 
01197               int iex;
01198               int ipx;
01199 
01200               if ( ism <= 18 ) {
01201                 iex = 1+(85-ie);
01202                 ipx = ip+20*(ism-1);
01203               } else {
01204                 iex = 85+ie;
01205                 ipx = 1+(20-ip)+20*(ism-19);
01206               }
01207 
01208               if(meIntegrity_) meIntegrity_->setBinContent( ipx, iex, xval );
01209               if( xval == 0 && meIntegrityErr_) meIntegrityErr_->Fill( ism );
01210 
01211             }
01212 
01213             h2 = ebic->h_[ism-1];
01214 
01215             if ( h2 ) {
01216 
01217               float xval = h2->GetBinContent( ie, ip );
01218 
01219               int iex;
01220               int ipx;
01221 
01222               if ( ism <= 18 ) {
01223                 iex = 1+(85-ie);
01224                 ipx = ip+20*(ism-1);
01225               } else {
01226                 iex = 85+ie;
01227                 ipx = 1+(20-ip)+20*(ism-19);
01228               }
01229 
01230               if(meOccupancy_) meOccupancy_->setBinContent( ipx, iex, xval );
01231               if ( xval != 0 && meOccupancy1D_) meOccupancy1D_->Fill( ism, xval );
01232 
01233             }
01234 
01235           }
01236 
01237           if ( ebpoc ) {
01238 
01239             me = ebpoc->meg03_[ism-1];
01240 
01241             if ( me ) {
01242 
01243               int iex;
01244               int ipx;
01245 
01246               if ( ism <= 18 ) {
01247                 iex = 1+(85-ie);
01248                 ipx = ip+20*(ism-1);
01249               } else {
01250                 iex = 85+ie;
01251                 ipx = 1+(20-ip)+20*(ism-19);
01252               }
01253 
01254               float xval = me->getBinContent( ie, ip );
01255 
01256               if(mePedestalOnline_) mePedestalOnline_->setBinContent( ipx, iex, xval );
01257               if ( xval == 0 && mePedestalOnlineErr_ ) mePedestalOnlineErr_->Fill( ism );
01258 
01259             }
01260 
01261             float num01, mean01, rms01;
01262             bool update01 = UtilsClient::getBinStatistics(hpot01_[ism-1], ie, ip, num01, mean01, rms01);
01263 
01264             if ( update01 ) {
01265 
01266               int iex;
01267               int ipx;
01268 
01269               if ( ism <= 18 ) {
01270                 iex = 1+(85-ie);
01271                 ipx = ip+20*(ism-1);
01272               } else {
01273                 iex = 85+ie;
01274                 ipx = 1+(20-ip)+20*(ism-19);
01275               }
01276 
01277               if(mePedestalOnlineRMSMap_) mePedestalOnlineRMSMap_->setBinContent( ipx, iex, rms01 );
01278 
01279               if(mePedestalOnlineRMS_) mePedestalOnlineRMS_->Fill( ism, rms01 );
01280 
01281               if(mePedestalOnlineMean_) mePedestalOnlineMean_->Fill( ism, mean01 );
01282 
01283             }
01284 
01285           }
01286 
01287           if ( eblc ) {
01288 
01289             int iex;
01290             int ipx;
01291 
01292             if ( ism <= 18 ) {
01293               iex = 1+(85-ie);
01294               ipx = ip+20*(ism-1);
01295             } else {
01296               iex = 85+ie;
01297               ipx = 1+(20-ip)+20*(ism-19);
01298             }
01299 
01300             if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01301 
01302               me = eblc->meg01_[ism-1];
01303 
01304               if ( me ) {
01305 
01306                 float xval = me->getBinContent( ie, ip );
01307 
01308                 if ( me->getEntries() != 0 ) {
01309                   meLaserL1_->setBinContent( ipx, iex, xval );
01310                   if ( xval == 0 ) meLaserL1Err_->Fill( ism );
01311                 }
01312 
01313               }
01314 
01315             }
01316 
01317             if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01318 
01319               me = eblc->meg02_[ism-1];
01320 
01321               if ( me ) {
01322 
01323                 float xval = me->getBinContent( ie, ip );
01324 
01325                 if ( me->getEntries() != 0 ) {
01326                   meLaserL2_->setBinContent( ipx, iex, xval );
01327                   if ( xval == 0 ) meLaserL2Err_->Fill( ism );
01328                 }
01329 
01330               }
01331 
01332             }
01333 
01334             if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01335 
01336               me = eblc->meg03_[ism-1];
01337 
01338               if ( me ) {
01339 
01340                 float xval = me->getBinContent( ie, ip );
01341 
01342                 if ( me->getEntries() != 0 ) {
01343                   meLaserL3_->setBinContent( ipx, iex, xval );
01344                   if ( xval == 0 ) meLaserL3Err_->Fill( ism );
01345                 }
01346 
01347               }
01348 
01349             }
01350 
01351             if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01352 
01353               me = eblc->meg04_[ism-1];
01354 
01355               if ( me ) {
01356 
01357                 float xval = me->getBinContent( ie, ip );
01358 
01359                 if ( me->getEntries() != 0 ) {
01360                   meLaserL4_->setBinContent( ipx, iex, xval );
01361                   if ( xval == 0 ) meLaserL4Err_->Fill( ism );
01362                 }
01363 
01364               }
01365 
01366             }
01367 
01368           }
01369 
01370           if ( ebpc ) {
01371 
01372             me_01 = ebpc->meg01_[ism-1];
01373             me_02 = ebpc->meg02_[ism-1];
01374             me_03 = ebpc->meg03_[ism-1];
01375 
01376             int iex;
01377             int ipx;
01378 
01379             if ( ism <= 18 ) {
01380               iex = 1+(85-ie);
01381               ipx = ip+20*(ism-1);
01382             } else {
01383               iex = 85+ie;
01384               ipx = 1+(20-ip)+20*(ism-19);
01385             }
01386 
01387             if ( me_01 ) {
01388               float val_01=me_01->getBinContent(ie,ip);
01389               if ( me_01->getEntries() != 0 ) mePedestalG01_->setBinContent( ipx, iex, val_01 );
01390             }
01391             if ( me_02 ) {
01392               float val_02=me_02->getBinContent(ie,ip);
01393               if ( me_02->getEntries() != 0 ) mePedestalG06_->setBinContent( ipx, iex, val_02 );
01394             }
01395             if ( me_03 ) {
01396               float val_03=me_03->getBinContent(ie,ip);
01397               if ( me_03->getEntries() != 0 ) mePedestalG12_->setBinContent( ipx, iex, val_03 );
01398             }
01399 
01400           }
01401 
01402           if ( ebtpc ) {
01403 
01404             me_01 = ebtpc->meg01_[ism-1];
01405             me_02 = ebtpc->meg02_[ism-1];
01406             me_03 = ebtpc->meg03_[ism-1];
01407 
01408             int iex;
01409             int ipx;
01410 
01411             if ( ism <= 18 ) {
01412               iex = 1+(85-ie);
01413               ipx = ip+20*(ism-1);
01414             } else {
01415               iex = 85+ie;
01416               ipx = 1+(20-ip)+20*(ism-19);
01417             }
01418 
01419             if ( me_01 ) {
01420 
01421               float val_01=me_01->getBinContent(ie,ip);
01422 
01423               if ( me_01->getEntries() != 0 ) meTestPulseG01_->setBinContent( ipx, iex, val_01 );
01424 
01425             }
01426             if ( me_02 ) {
01427 
01428               float val_02=me_02->getBinContent(ie,ip);
01429 
01430               if ( me_02->getEntries() != 0 ) meTestPulseG06_->setBinContent( ipx, iex, val_02 );
01431 
01432             }
01433             if ( me_03 ) {
01434 
01435               float val_03=me_03->getBinContent(ie,ip);
01436 
01437               if ( me_03->getEntries() != 0 ) meTestPulseG12_->setBinContent( ipx, iex, val_03 );
01438 
01439             }
01440 
01441 
01442           }
01443 
01444           if ( hot01_[ism-1] ) {
01445 
01446             float xval = hot01_[ism-1]->GetBinContent( ie, ip );
01447 
01448             int iex;
01449             int ipx;
01450 
01451             if ( ism <= 18 ) {
01452               iex = 1+(85-ie);
01453               ipx = ip+20*(ism-1);
01454             } else {
01455               iex = 85+ie;
01456               ipx = 1+(20-ip)+20*(ism-19);
01457             }
01458 
01459             if(meRecHitEnergy_) meRecHitEnergy_->setBinContent( ipx, iex, xval );
01460 
01461           }
01462 
01463           if ( ebtmc ) {
01464 
01465             float num02, mean02, rms02;
01466 
01467             bool update02 = UtilsClient::getBinStatistics(htmt01_[ism-1], ie, ip, num02, mean02, rms02, timingNHitThreshold_);
01468 
01469             if ( update02 ) {
01470 
01471               mean02 -= 50.;
01472 
01473               meTimingMean1D_->Fill(mean02);
01474 
01475               meTimingRMS1D_->Fill(rms02);
01476 
01477               meTimingMean_->Fill( ism, mean02 );
01478 
01479               meTimingRMS_->Fill( ism, rms02 );
01480 
01481             }
01482 
01483           }
01484 
01485         }
01486       }
01487 
01488       for (int ie = 1; ie <= 17; ie++ ) {
01489         for (int ip = 1; ip <= 4; ip++ ) {
01490 
01491           int iex;
01492           int ipx;
01493 
01494           if ( ism <= 18 ) {
01495             iex = 1+(17-ie);
01496             ipx = ip+4*(ism-1);
01497           } else {
01498             iex = 17+ie;
01499             ipx = 1+(4-ip)+4*(ism-19);
01500           }
01501 
01502           if ( ebsfc ) {
01503 
01504             me = dqmStore_->get(prefixME_ + "/EcalInfo/EBMM DCC");
01505 
01506             float xval = 6;
01507 
01508             if ( me ) {
01509 
01510               xval = 2;
01511               if ( me->getBinContent( ism ) > 0 ) xval = 1;
01512 
01513             }
01514 
01515             me = ebsfc->meh01_[ism-1];
01516 
01517             if ( me ) {
01518 
01519               if ( me->getBinContent( ie, ip ) > 0 ) xval = 0;
01520 
01521               meStatusFlags_->setBinContent( ipx, iex, xval );
01522 
01523               if ( me->getBinError( ie, ip ) > 0 && me->getBinError( ie, ip ) < 0.1 ) UtilsClient::maskBinContent( meStatusFlags_, ipx, iex );
01524 
01525               if ( xval == 0 ) meStatusFlagsErr_->Fill( ism );
01526 
01527             }
01528 
01529           }
01530 
01531           if ( ebtttc ) {
01532 
01533             float mean01 = 0;
01534             bool hadNonZeroInterest = false;
01535 
01536             if ( httt01_[ism-1] ) {
01537 
01538               mean01 = httt01_[ism-1]->GetBinContent( ie, ip );
01539 
01540               if ( mean01 != 0. ) {
01541                 if ( meTriggerTowerEt_ ) meTriggerTowerEt_->setBinContent( ipx, iex, mean01 );
01542               }
01543 
01544             }
01545 
01546             me = ebtttc->me_o01_[ism-1];
01547 
01548             if ( me ) {
01549 
01550               float xval = me->getBinContent( ie, ip );
01551 
01552               if ( xval != 0. ) {
01553                 meTriggerTowerTiming_->setBinContent( ipx, iex, xval );
01554                 hadNonZeroInterest = true;
01555               }
01556 
01557             }
01558 
01559             me = ebtttc->me_o02_[ism-1];
01560 
01561             if ( me ) {
01562 
01563               float xval = me->getBinContent( ie, ip );
01564 
01565               if ( xval != 0. ) {
01566                 meTriggerTowerNonSingleTiming_->setBinContent( ipx, iex, xval );
01567               }
01568 
01569             }
01570 
01571             float xval = 2;
01572             if( mean01 > 0. ) {
01573 
01574               h2 = ebtttc->l01_[ism-1];
01575               h3 = ebtttc->l02_[ism-1];
01576 
01577               if ( h2 && h3 ) {
01578 
01579                 // float emulErrorVal = h2->GetBinContent( ie, ip ) + h3->GetBinContent( ie, ip );
01580                 float emulErrorVal = h2->GetBinContent( ie, ip );
01581 
01582                 if( emulErrorVal > 0.01 * ievt_ && hadNonZeroInterest ) xval = 0;
01583 
01584               }
01585 
01586               if ( xval!=0 && hadNonZeroInterest ) xval = 1;
01587 
01588             }
01589 
01590             meTriggerTowerEmulError_->setBinContent( ipx, iex, xval );
01591 
01592           }
01593 
01594           if ( ebtmc ) {
01595 
01596             if( htmt01_[ism-1] ){
01597 
01598               float num(0.);
01599               bool mask(false);
01600 
01601               for(int ce=1; ce<=5; ce++){
01602                 for(int cp=1; cp<=5; cp++){
01603 
01604                   int scie = (ie - 1) * 5 + ce;
01605                   int scip = (ip - 1) * 5 + cp; 
01606 
01607                   num += htmt01_[ism-1]->GetBinEntries(htmt01_[ism-1]->GetBin(scie, scip));
01608 
01609                   if(Masks::maskChannel(ism, scie, scip, chWarnBit, EcalBarrel)) mask = true;
01610                 }
01611               }
01612 
01613               float nHitThreshold(timingNHitThreshold_ * 18.);
01614 
01615               bool update01(false);
01616               float num01, mean01, rms01;
01617               update01 = UtilsClient::getBinStatistics(htmt, ipx, iex, num01, mean01, rms01, nHitThreshold);
01618 
01619               mean01 -= 50.;
01620 
01621               if(!update01){
01622                 mean01 = 0.;
01623                 rms01 = 0.;
01624               }
01625 
01626               update01 |= num > 1.3 * nHitThreshold;
01627 
01628               float xval = 2.;
01629               if(update01){
01630 
01631                 if( std::abs(mean01) > 2. || rms01 > 6. || num > 1.3 * num01) xval = 0.;
01632                 else xval = 1.;
01633 
01634               }
01635 
01636               meTiming_->setBinContent( ipx, iex, xval );
01637               if ( mask ) UtilsClient::maskBinContent( meTiming_, ipx, iex );
01638 
01639             }
01640 
01641           }
01642 
01643         }
01644       }
01645 
01646       // PN's summaries
01647       for( int i = 1; i <= 10; i++ ) {
01648         for( int j = 1; j <= 5; j++ ) {
01649 
01650           int ichanx;
01651           int ipseudostripx;
01652 
01653           if(ism<=18) {
01654             ichanx = i;
01655             ipseudostripx = j+5*(ism-1);
01656           } else {
01657             ichanx = i+10;
01658             ipseudostripx = j+5*(ism-19);
01659           }
01660 
01661           if ( ebic ) {
01662 
01663             me_04 = ebic->meg02_[ism-1];
01664             h2 = ebic->hmem_[ism-1];
01665 
01666             if( me_04 ) {
01667 
01668               float xval = me_04->getBinContent(i,j);
01669               if(meIntegrityPN_) meIntegrityPN_->setBinContent( ipseudostripx, ichanx, xval );
01670 
01671             }
01672 
01673             if ( h2 ) {
01674 
01675               float xval = h2->GetBinContent(i,1);
01676               if(meOccupancyPN_) meOccupancyPN_->setBinContent( ipseudostripx, ichanx, xval );
01677 
01678             }
01679 
01680           }
01681 
01682           if ( ebpc ) {
01683 
01684             me_04 = ebpc->meg04_[ism-1];
01685             me_05 = ebpc->meg05_[ism-1];
01686 
01687             if( me_04 ) {
01688               float val_04=me_04->getBinContent(i,1);
01689               mePedestalPNG01_->setBinContent( ipseudostripx, ichanx, val_04 );
01690             }
01691             if( me_05 ) {
01692               float val_05=me_05->getBinContent(i,1);
01693               mePedestalPNG16_->setBinContent( ipseudostripx, ichanx, val_05 );
01694             }
01695 
01696           }
01697 
01698           if ( ebtpc ) {
01699 
01700             me_04 = ebtpc->meg04_[ism-1];
01701             me_05 = ebtpc->meg05_[ism-1];
01702 
01703             if( me_04 ) {
01704               float val_04=me_04->getBinContent(i,1);
01705               meTestPulsePNG01_->setBinContent( ipseudostripx, ichanx, val_04 );
01706             }
01707             if( me_05 ) {
01708               float val_05=me_05->getBinContent(i,1);
01709               meTestPulsePNG16_->setBinContent( ipseudostripx, ichanx, val_05 );
01710             }
01711 
01712           }
01713 
01714           if ( eblc ) {
01715 
01716             if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01717 
01718               me = eblc->meg09_[ism-1];
01719 
01720               if( me ) {
01721 
01722                 float xval = me->getBinContent(i,1);
01723 
01724                 if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
01725                   meLaserL1PN_->setBinContent( ipseudostripx, ichanx, xval );
01726                   if ( xval == 0 ) meLaserL1PNErr_->Fill( ism );
01727                 }
01728 
01729               }
01730 
01731             }
01732 
01733             if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01734 
01735               me = eblc->meg10_[ism-1];
01736 
01737               if( me ) {
01738 
01739                 float xval = me->getBinContent(i,1);
01740 
01741                 if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
01742                   meLaserL2PN_->setBinContent( ipseudostripx, ichanx, xval );
01743                   if ( xval == 0 ) meLaserL2PNErr_->Fill( ism );
01744                 }
01745 
01746               }
01747 
01748             }
01749 
01750             if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01751 
01752               me = eblc->meg11_[ism-1];
01753 
01754               if( me ) {
01755 
01756                 float xval = me->getBinContent(i,1);
01757 
01758                 if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
01759                   meLaserL3PN_->setBinContent( ipseudostripx, ichanx, xval );
01760                   if ( xval == 0 ) meLaserL3PNErr_->Fill( ism );
01761                 }
01762 
01763               }
01764 
01765             }
01766 
01767             if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01768 
01769               me = eblc->meg12_[ism-1];
01770 
01771               if( me ) {
01772 
01773                 float xval = me->getBinContent(i,1);
01774 
01775                 if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
01776                   meLaserL4PN_->setBinContent( ipseudostripx, ichanx, xval );
01777                   if ( xval == 0 ) meLaserL4PNErr_->Fill( ism );
01778                 }
01779 
01780               }
01781 
01782             }
01783 
01784           }
01785 
01786         }
01787       }
01788 
01789       for(int chan=0; chan<1700; chan++) {
01790 
01791         int ie = (chan)/20 + 1;
01792         int ip = (chan)%20 + 1;
01793 
01794         // laser 1D summaries
01795         if ( eblc ) {
01796 
01797           if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01798 
01799             MonitorElement *meg = eblc->meg01_[ism-1];
01800 
01801             float xval = 2;
01802             if ( meg ) xval = meg->getBinContent( ie, ip );
01803 
01804             // exclude channels without laser data (yellow in the quality map)
01805             if( xval != 2 && xval != 5 ) {
01806 
01807               MonitorElement* mea01 = eblc->mea01_[ism-1];
01808               MonitorElement* met01 = eblc->met01_[ism-1];
01809               MonitorElement* meaopn01 = eblc->meaopn01_[ism-1];
01810 
01811               if( mea01 && met01 && meaopn01 ) {
01812                 meLaserL1Ampl_->Fill( ism, mea01->getBinContent( chan+1 ) );
01813                 if( met01->getBinContent( chan+1 ) > 0. ) meLaserL1Timing_->Fill( ism, met01->getBinContent( chan+1 ) );
01814                 meLaserL1AmplOverPN_->Fill( ism, meaopn01->getBinContent( chan+1 ) );
01815               }
01816 
01817             }
01818 
01819           }
01820 
01821           if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
01822 
01823             MonitorElement *meg = eblc->meg02_[ism-1];
01824 
01825             float xval = 2;
01826             if ( meg ) xval = meg->getBinContent( ie, ip );
01827 
01828             // exclude channels without laser data (yellow in the quality map)
01829             if( xval != 2 && xval != 5 ) {
01830 
01831               MonitorElement* mea02 = eblc->mea02_[ism-1];
01832               MonitorElement* met02 = eblc->met02_[ism-1];
01833               MonitorElement* meaopn02 = eblc->meaopn02_[ism-1];
01834 
01835               if( mea02 && met02 && meaopn02 ) {
01836                 meLaserL2Ampl_->Fill( ism, mea02->getBinContent( chan+1 ) );
01837                 if( met02->getBinContent( chan+1 ) > 0. ) meLaserL2Timing_->Fill( ism, met02->getBinContent( chan+1 ) );
01838                 meLaserL2AmplOverPN_->Fill( ism, meaopn02->getBinContent( chan+1 ) );
01839               }
01840 
01841             }
01842 
01843           }
01844 
01845           if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
01846 
01847             MonitorElement *meg = eblc->meg03_[ism-1];
01848 
01849             float xval = 2;
01850             if ( meg ) xval = meg->getBinContent( ie, ip );
01851 
01852             // exclude channels without laser data (yellow in the quality map)
01853             if( xval != 2 && xval != 5 ) {
01854 
01855               MonitorElement* mea03 = eblc->mea03_[ism-1];
01856               MonitorElement* met03 = eblc->met03_[ism-1];
01857               MonitorElement* meaopn03 = eblc->meaopn03_[ism-1];
01858 
01859               if( mea03 && met03 && meaopn03 ) {
01860                 meLaserL3Ampl_->Fill( ism, mea03->getBinContent( chan+1 ) );
01861                 if( met03->getBinContent( chan+1 ) > 0. ) meLaserL3Timing_->Fill( ism, met03->getBinContent( chan+1 ) );
01862                 meLaserL3AmplOverPN_->Fill( ism, meaopn03->getBinContent( chan+1 ) );
01863               }
01864 
01865             }
01866 
01867           }
01868 
01869           if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
01870 
01871             MonitorElement *meg = eblc->meg04_[ism-1];
01872 
01873             float xval = 2;
01874             if ( meg ) xval = meg->getBinContent( ie, ip );
01875 
01876             // exclude channels without laser data (yellow in the quality map)
01877             if( xval != 2 && xval != 5 ) {
01878 
01879               MonitorElement* mea04 = eblc->mea04_[ism-1];
01880               MonitorElement* met04 = eblc->met04_[ism-1];
01881               MonitorElement* meaopn04 = eblc->meaopn04_[ism-1];
01882 
01883               if( mea04 && met04 && meaopn04 ) {
01884                 meLaserL4Ampl_->Fill( ism, mea04->getBinContent( chan+1 ) );
01885                 if( met04->getBinContent( chan+1 ) > 0. ) meLaserL4Timing_->Fill( ism, met04->getBinContent( chan+1 ) );
01886                 meLaserL4AmplOverPN_->Fill( ism, meaopn04->getBinContent( chan+1 ) );
01887               }
01888 
01889             }
01890 
01891           }
01892 
01893         }
01894 
01895         if ( ebtpc ) {
01896 
01897           MonitorElement *meg01 = ebtpc->meg01_[ism-1];
01898           MonitorElement *meg02 = ebtpc->meg02_[ism-1];
01899           MonitorElement *meg03 = ebtpc->meg03_[ism-1];
01900 
01901           if ( meg01 ) {
01902 
01903             float xval01 = meg01->getBinContent(ie,ip);
01904 
01905             if ( xval01 != 2 && xval01 != 5 ) {
01906 
01907               me = ebtpc->mea01_[ism-1];
01908 
01909               if ( me ) {
01910 
01911                 meTestPulseAmplG01_->Fill( ism, me->getBinContent( chan+1 ) );
01912 
01913               }
01914 
01915             }
01916 
01917           }
01918 
01919           if ( meg02 ) {
01920 
01921             float xval02 = meg02->getBinContent(ie,ip);
01922 
01923             if ( xval02 != 2 && xval02 != 5 ) {
01924 
01925               me = ebtpc->mea02_[ism-1];
01926 
01927               if ( me ) {
01928 
01929                 meTestPulseAmplG06_->Fill( ism, me->getBinContent( chan+1 ) );
01930 
01931               }
01932 
01933             }
01934 
01935           }
01936 
01937           if ( meg03 ) {
01938 
01939             float xval03 = meg03->getBinContent(ie,ip);
01940 
01941             if ( xval03 != 2 && xval03 != 5 ) {
01942 
01943               me = ebtpc->mea03_[ism-1];
01944 
01945               if ( me ) {
01946 
01947                 meTestPulseAmplG12_->Fill( ism, me->getBinContent( chan+1 ) );
01948 
01949               }
01950 
01951             }
01952 
01953           }
01954 
01955         }
01956 
01957       }  // loop on channels
01958 
01959     } // loop on SM
01960 
01961   } // loop on clients
01962 
01963   // The global-summary
01964 
01965   int nGlobalErrors = 0;
01966   int nGlobalErrorsEB[36];
01967   int nValidChannels = 0;
01968   int nValidChannelsEB[36];
01969 
01970   for (int i = 0; i < 36; i++) {
01971     nGlobalErrorsEB[i] = 0;
01972     nValidChannelsEB[i] = 0;
01973   }
01974 
01975   for ( int iex = 1; iex <= 170; iex++ ) {
01976     for ( int ipx = 1; ipx <= 360; ipx++ ) {
01977 
01978       if(meGlobalSummary_) {
01979 
01980         int ism = (ipx-1)/20 + 1 ;
01981         if ( iex>85 ) ism+=18;
01982 
01983         int iet = (iex-1)/5 + 1;
01984         int ipt = (ipx-1)/5 + 1;
01985 
01986         float xval = 6;
01987         float val_in = meIntegrity_->getBinContent(ipx,iex);
01988         float val_po = mePedestalOnline_->getBinContent(ipx,iex);
01989         float val_tm = reducedReports_ ? 1. : meTiming_->getBinContent(ipt,iet);
01990         float val_sf = meStatusFlags_->getBinContent((ipx-1)/5+1,(iex-1)/5+1);
01991         float val_ee = reducedReports_ ? 1. : meTriggerTowerEmulError_->getBinContent((ipx-1)/5+1,(iex-1)/5+1); // removed from the global summary temporarily
01992         //        float val_ee = 1;
01993 
01994         // combine all the available wavelenghts in unique laser status
01995         // for each laser turn dark color and yellow into bright green
01996         float val_ls_1=2, val_ls_2=2, val_ls_3=2, val_ls_4=2;
01997         if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 1) != laserWavelengths_.end() ) {
01998           if ( meLaserL1_ ) val_ls_1 = meLaserL1_->getBinContent(ipx,iex);
01999           if(val_ls_1==2 || val_ls_1==3 || val_ls_1==4 || val_ls_1==5) val_ls_1=1;
02000         }
02001         if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 2) != laserWavelengths_.end() ) {
02002           if ( meLaserL2_ ) val_ls_2 = meLaserL2_->getBinContent(ipx,iex);
02003           if(val_ls_2==2 || val_ls_2==3 || val_ls_2==4 || val_ls_2==5) val_ls_2=1;
02004         }
02005         if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 3) != laserWavelengths_.end() ) {
02006           if ( meLaserL3_ ) val_ls_3 = meLaserL3_->getBinContent(ipx,iex);
02007           if(val_ls_3==2 || val_ls_3==3 || val_ls_3==4 || val_ls_3==5) val_ls_3=1;
02008         }
02009         if ( find(laserWavelengths_.begin(), laserWavelengths_.end(), 4) != laserWavelengths_.end() ) {
02010           if ( meLaserL4_ ) val_ls_4 = meLaserL4_->getBinContent(ipx,iex);
02011           if(val_ls_4==2 || val_ls_4==3 || val_ls_4==4 || val_ls_4==5) val_ls_4=1;
02012         }
02013 
02014         float val_ls = 1;
02015         if (val_ls_1 == 0 || val_ls_2==0 || val_ls_3==0 || val_ls_4==0) val_ls=0;
02016 
02017         // DO NOT CONSIDER CALIBRATION EVENTS IN THE REPORT SUMMARY UNTIL LHC COLLISIONS
02018         val_ls = 1;
02019 
02020         // turn each dark color (masked channel) to bright green
02021         // for laser & timing & trigger turn also yellow into bright green
02022         // for pedestal online too because is not computed in calibration events
02023 
02024         //  0/3 = red/dark red
02025         //  1/4 = green/dark green
02026         //  2/5 = yellow/dark yellow
02027         //  6   = unknown
02028 
02029         if(             val_in==3 || val_in==4 || val_in==5) val_in=1;
02030         if(val_po==2 || val_po==3 || val_po==4 || val_po==5) val_po=1;
02031         if(val_tm==2 || val_tm==3 || val_tm==4 || val_tm==5) val_tm=1;
02032         if(             val_sf==3 || val_sf==4 || val_sf==5) val_sf=1;
02033         if(val_ee==2 || val_ee==3 || val_ee==4 || val_ee==5) val_ee=1;
02034 
02035         if(val_in==6) xval=6;
02036         else if(val_in==0) xval=0;
02037         else if(val_po==0 || val_ls==0 || val_tm==0 || val_sf==0 || val_ee==0) xval=0;
02038         else if(val_po==2 || val_ls==2 || val_tm==2 || val_sf==2 || val_ee==2) xval=2;
02039         else xval=1;
02040 
02041         // if the SM is entirely not read, the masked channels
02042         // are reverted back to yellow
02043         float iEntries=0;
02044 
02045         if(norm01_ && synch01_) {
02046           float frac_synch_errors = 0.;
02047           float norm = norm01_->GetBinContent(ism);
02048           if(norm > 0) frac_synch_errors = float(synch01_->GetBinContent(ism))/float(norm);
02049           if(frac_synch_errors > synchErrorThreshold_){
02050             xval = 0;
02051             if(oosTrend && oosTrend->GetBinContent(oosTrend->GetNbinsX()) - oosTrend->GetBinContent(1) < 1.) xval += 3.;
02052           }
02053         }
02054 
02055         std::vector<int>::iterator iter = find(superModules_.begin(), superModules_.end(), ism);
02056         if (iter != superModules_.end()) {
02057           for ( unsigned int i=0; i<clients_.size(); i++ ) {
02058             EBIntegrityClient* ebic = dynamic_cast<EBIntegrityClient*>(clients_[i]);
02059             if ( ebic ) {
02060               TH2F* h2 = ebic->h_[ism-1];
02061               if ( h2 ) {
02062                 iEntries = h2->GetEntries();
02063               }
02064             }
02065           }
02066         }
02067 
02068         if ( iEntries==0 ) {
02069           xval=2;
02070         }
02071 
02072         meGlobalSummary_->setBinContent( ipx, iex, xval );
02073 
02074         if ( xval >= 0 && xval <= 5 ) {
02075           if ( xval != 2 && xval != 5 ) ++nValidChannels;
02076           if ( iex <= 85 ) {
02077             if ( xval != 2 && xval != 5 ) ++nValidChannelsEB[(ipx-1)/20];
02078           } else {
02079             if ( xval != 2 && xval != 5 ) ++nValidChannelsEB[18+(ipx-1)/20];
02080           }
02081           if ( xval == 0 ) ++nGlobalErrors;
02082           if ( iex <= 85 ) {
02083             if ( xval == 0 ) ++nGlobalErrorsEB[(ipx-1)/20];
02084           } else {
02085             if ( xval == 0 ) ++nGlobalErrorsEB[18+(ipx-1)/20];
02086           }
02087         }
02088 
02089       }
02090 
02091     }
02092   }
02093 
02094   if(meSummaryErr_)
02095     meSummaryErr_->setBinContent(1, double(nGlobalErrors) / double(nValidChannels));
02096 
02097   float reportSummary = -1.0;
02098   if ( nValidChannels != 0 )
02099     reportSummary = 1.0 - float(nGlobalErrors)/float(nValidChannels);
02100   me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummary");
02101   if ( me )
02102     me->Fill(reportSummary);
02103 
02104   for (int i = 0; i < 36; i++) {
02105     float reportSummaryEB = -1.0;
02106     if ( nValidChannelsEB[i] != 0 )
02107       reportSummaryEB = 1.0 - float(nGlobalErrorsEB[i])/float(nValidChannelsEB[i]);
02108     me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryContents/EcalBarrel_" + Numbers::sEB(i+1));
02109     if ( me ) me->Fill(reportSummaryEB);
02110   }
02111 
02112   if(meGlobalSummary_){
02113 
02114     me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryMap");
02115     if ( me ) {
02116 
02117       int nValidChannelsTT[72][34];
02118       int nGlobalErrorsTT[72][34];
02119       for ( int iettx = 0; iettx < 34; iettx++ ) {
02120         for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
02121           nValidChannelsTT[ipttx][iettx] = 0;
02122           nGlobalErrorsTT[ipttx][iettx] = 0;
02123         }
02124       }
02125 
02126       for ( int iex = 1; iex <= 170; iex++ ) {
02127         for ( int ipx = 1; ipx <= 360; ipx++ ) {
02128 
02129           int iettx = (iex-1)/5+1;
02130           int ipttx = (ipx-1)/5+1;
02131 
02132           float xval = meGlobalSummary_->getBinContent( ipx, iex );
02133 
02134           if ( xval >= 0 && xval <= 5 ) {
02135             if ( xval != 2 && xval != 5 ) ++nValidChannelsTT[ipttx-1][iettx-1];
02136             if ( xval == 0 ) ++nGlobalErrorsTT[ipttx-1][iettx-1];
02137           }
02138 
02139         }
02140       }
02141 
02142       // Countermeasure to partial TR failure
02143       // make the whole SM red if more than 2 towers within a 2x2 matrix fails
02144 
02145       for(int jeta(1); jeta <= 33; jeta++){
02146         for(int jphi(1); jphi <= 71; jphi++){
02147           int nErr(0);
02148           if(nValidChannelsTT[jphi - 1][jeta - 1] > 0 && nGlobalErrorsTT[jphi - 1][jeta - 1] == nValidChannelsTT[jphi - 1][jeta - 1]) nErr += 1;
02149           if(nValidChannelsTT[jphi][jeta - 1] > 0 && nGlobalErrorsTT[jphi][jeta - 1] == nValidChannelsTT[jphi][jeta - 1]) nErr += 1;
02150           if(nValidChannelsTT[jphi - 1][jeta] > 0 && nGlobalErrorsTT[jphi - 1][jeta] == nValidChannelsTT[jphi - 1][jeta]) nErr += 1;
02151           if(nValidChannelsTT[jphi][jeta] > 0 && nGlobalErrorsTT[jphi][jeta] == nValidChannelsTT[jphi][jeta]) nErr += 1;
02152           if(nErr > 2){
02153             int jphi0(((jphi - 1) / 4) * 4);
02154             int jeta0(((jeta - 1) / 17) * 17);
02155             for(int jjphi(jphi0); jjphi < jphi0 + 4; jjphi++){
02156               for(int jjeta(jeta0); jjeta < jeta0 + 17; jjeta++){
02157                 nGlobalErrorsTT[jjphi][jjeta] = nValidChannelsTT[jjphi][jjeta];
02158               }
02159             }
02160           }
02161         }
02162       }
02163 
02164       for ( int iettx = 0; iettx < 34; iettx++ ) {
02165         for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
02166 
02167           float xval = -1.0;
02168           if ( nValidChannelsTT[ipttx][iettx] != 0 )
02169             xval = 1.0 - float(nGlobalErrorsTT[ipttx][iettx])/float(nValidChannelsTT[ipttx][iettx]);
02170 
02171           me->setBinContent( ipttx+1, iettx+1, xval );
02172         }
02173       }
02174 
02175     }
02176 
02177   }
02178 
02179 }
02180