CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/DQM/EcalBarrelMonitorClient/src/EBSummaryClient.cc

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