CMS 3D CMS Logo

EBSummaryClient.cc

Go to the documentation of this file.
00001 /*
00002  * \file EBSummaryClient.cc
00003  *
00004  * $Date: 2008/12/04 13:54:25 $
00005  * $Revision: 1.170 $
00006  * \author G. Della Ricca
00007  *
00008 */
00009 
00010 #include <memory>
00011 #include <iostream>
00012 #include <iomanip>
00013 #include <map>
00014 
00015 #include "TCanvas.h"
00016 #include "TStyle.h"
00017 
00018 #include "DQMServices/Core/interface/DQMStore.h"
00019 
00020 #include "OnlineDB/EcalCondDB/interface/RunTag.h"
00021 #include "OnlineDB/EcalCondDB/interface/RunIOV.h"
00022 
00023 #include <DQM/EcalCommon/interface/UtilsClient.h>
00024 #include <DQM/EcalCommon/interface/Numbers.h>
00025 
00026 #include <DQM/EcalBarrelMonitorClient/interface/EBCosmicClient.h>
00027 #include <DQM/EcalBarrelMonitorClient/interface/EBStatusFlagsClient.h>
00028 #include <DQM/EcalBarrelMonitorClient/interface/EBIntegrityClient.h>
00029 #include <DQM/EcalBarrelMonitorClient/interface/EBLaserClient.h>
00030 #include <DQM/EcalBarrelMonitorClient/interface/EBPedestalClient.h>
00031 #include <DQM/EcalBarrelMonitorClient/interface/EBPedestalOnlineClient.h>
00032 #include <DQM/EcalBarrelMonitorClient/interface/EBTestPulseClient.h>
00033 #include <DQM/EcalBarrelMonitorClient/interface/EBBeamCaloClient.h>
00034 #include <DQM/EcalBarrelMonitorClient/interface/EBBeamHodoClient.h>
00035 #include <DQM/EcalBarrelMonitorClient/interface/EBTriggerTowerClient.h>
00036 #include <DQM/EcalBarrelMonitorClient/interface/EBClusterClient.h>
00037 #include <DQM/EcalBarrelMonitorClient/interface/EBTimingClient.h>
00038 
00039 #include <DQM/EcalBarrelMonitorClient/interface/EBSummaryClient.h>
00040 
00041 using namespace cms;
00042 using namespace edm;
00043 using namespace std;
00044 
00045 EBSummaryClient::EBSummaryClient(const ParameterSet& ps) {
00046 
00047   // cloneME switch
00048   cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
00049 
00050   // verbose switch
00051   verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
00052 
00053   // debug switch
00054   debug_ = ps.getUntrackedParameter<bool>("debug", false);
00055 
00056   // prefixME path
00057   prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
00058 
00059   // enableCleanup_ switch
00060   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00061 
00062   // vector of selected Super Modules (Defaults to all 36).
00063   superModules_.reserve(36);
00064   for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
00065   superModules_ = ps.getUntrackedParameter<vector<int> >("superModules", superModules_);
00066 
00067   // summary maps
00068   meIntegrity_      = 0;
00069   meOccupancy_      = 0;
00070   meStatusFlags_    = 0;
00071   mePedestalOnline_ = 0;
00072   meLaserL1_        = 0;
00073   meLaserL1PN_      = 0;
00074   mePedestal_       = 0;
00075   mePedestalPN_     = 0;
00076   meTestPulse_      = 0;
00077   meTestPulsePN_    = 0;
00078   meGlobalSummary_  = 0;
00079 
00080   meCosmic_         = 0;
00081   meTiming_         = 0;
00082   meTriggerTowerEt_        = 0;
00083   meTriggerTowerEmulError_ = 0;
00084   meTriggerTowerTiming_ = 0;
00085 
00086   // summary errors
00087   meIntegrityErr_       = 0;
00088   meOccupancy1D_        = 0;
00089   meStatusFlagsErr_     = 0;
00090   mePedestalOnlineErr_  = 0;
00091   meLaserL1Err_         = 0;
00092   meLaserL1PNErr_       = 0;
00093   mePedestalErr_        = 0;
00094   mePedestalPNErr_      = 0;
00095   meTestPulseErr_       = 0;
00096   meTestPulsePNErr_     = 0;
00097 
00098 }
00099 
00100 EBSummaryClient::~EBSummaryClient() {
00101 
00102 }
00103 
00104 void EBSummaryClient::beginJob(DQMStore* dqmStore) {
00105 
00106   dqmStore_ = dqmStore;
00107 
00108   if ( debug_ ) cout << "EBSummaryClient: beginJob" << endl;
00109 
00110   ievt_ = 0;
00111   jevt_ = 0;
00112 
00113   // summary for DQM GUI
00114 
00115   char histo[200];
00116 
00117   MonitorElement* me;
00118 
00119   dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo" );
00120 
00121   sprintf(histo, "reportSummary");
00122   if ( me = dqmStore_->get(prefixME_ + "/EventInfo/" + histo) ) {
00123     dqmStore_->removeElement(me->getName());
00124   }
00125   me = dqmStore_->bookFloat(histo);
00126   me->Fill(-1.0);
00127 
00128   dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo/reportSummaryContents" );
00129 
00130   for (int i = 0; i < 36; i++) {
00131     sprintf(histo, "EcalBarrel_%s", Numbers::sEB(i+1).c_str());
00132     if ( me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryContents/" + histo) ) {
00133       dqmStore_->removeElement(me->getName());
00134     }
00135     me = dqmStore_->bookFloat(histo);
00136     me->Fill(-1.0);
00137   }
00138 
00139   dqmStore_->setCurrentFolder( prefixME_ + "/EventInfo" );
00140 
00141   sprintf(histo, "reportSummaryMap");
00142   if ( me = dqmStore_->get(prefixME_ + "/EventInfo/" + histo) ) {
00143     dqmStore_->removeElement(me->getName());
00144   }
00145   me = dqmStore_->book2D(histo, histo, 72, 0., 72., 34, 0., 34);
00146   for ( int iettx = 0; iettx < 34; iettx++ ) {
00147     for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
00148       me->setBinContent( ipttx+1, iettx+1, -1.0 );
00149     }
00150   }
00151   me->setAxisTitle("jphi", 1);
00152   me->setAxisTitle("jeta", 2);
00153 
00154 }
00155 
00156 void EBSummaryClient::beginRun(void) {
00157 
00158   if ( debug_ ) cout << "EBSummaryClient: beginRun" << endl;
00159 
00160   jevt_ = 0;
00161 
00162   this->setup();
00163 
00164 }
00165 
00166 void EBSummaryClient::endJob(void) {
00167 
00168   if ( debug_ ) cout << "EBSummaryClient: endJob, ievt = " << ievt_ << endl;
00169 
00170   this->cleanup();
00171 
00172 }
00173 
00174 void EBSummaryClient::endRun(void) {
00175 
00176   if ( debug_ ) cout << "EBSummaryClient: endRun, jevt = " << jevt_ << endl;
00177 
00178   this->cleanup();
00179 
00180 }
00181 
00182 void EBSummaryClient::setup(void) {
00183 
00184   char histo[200];
00185 
00186   dqmStore_->setCurrentFolder( prefixME_ + "/EBSummaryClient" );
00187 
00188   if ( meIntegrity_ ) dqmStore_->removeElement( meIntegrity_->getName() );
00189   sprintf(histo, "EBIT integrity quality summary");
00190   meIntegrity_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00191   meIntegrity_->setAxisTitle("jphi", 1);
00192   meIntegrity_->setAxisTitle("jeta", 2);
00193 
00194   if ( meIntegrityErr_ ) dqmStore_->removeElement( meIntegrityErr_->getName() );
00195   sprintf(histo, "EBIT integrity quality errors summary");
00196   meIntegrityErr_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00197   for (int i = 0; i < 36; i++) {
00198     meIntegrityErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00199   }
00200 
00201   if ( meOccupancy_ ) dqmStore_->removeElement( meOccupancy_->getName() );
00202   sprintf(histo, "EBOT digi occupancy summary");
00203   meOccupancy_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00204   meOccupancy_->setAxisTitle("jphi", 1);
00205   meOccupancy_->setAxisTitle("jeta", 2);
00206 
00207   if ( meOccupancy1D_ ) dqmStore_->removeElement( meOccupancy1D_->getName() );
00208   sprintf(histo, "EBOT digi occupancy summary 1D");
00209   meOccupancy1D_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00210   for (int i = 0; i < 36; i++) {
00211     meOccupancy1D_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00212   }
00213 
00214   if ( meStatusFlags_ ) dqmStore_->removeElement( meStatusFlags_->getName() );
00215   sprintf(histo, "EBSFT front-end status summary");
00216   meStatusFlags_ = dqmStore_->book2D(histo, histo, 72, 0., 72., 34, -17., 17.);
00217   meStatusFlags_->setAxisTitle("jphi'", 1);
00218   meStatusFlags_->setAxisTitle("jeta'", 2);
00219 
00220   if ( meStatusFlagsErr_ ) dqmStore_->removeElement( meStatusFlagsErr_->getName() );
00221   sprintf(histo, "EBSFT front-end status errors summary");
00222   meStatusFlagsErr_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00223   for (int i = 0; i < 36; i++) {
00224     meStatusFlagsErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00225   }
00226 
00227   if ( mePedestalOnline_ ) dqmStore_->removeElement( mePedestalOnline_->getName() );
00228   sprintf(histo, "EBPOT pedestal quality summary G12");
00229   mePedestalOnline_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00230   mePedestalOnline_->setAxisTitle("jphi", 1);
00231   mePedestalOnline_->setAxisTitle("jeta", 2);
00232 
00233   if ( mePedestalOnlineErr_ ) dqmStore_->removeElement( mePedestalOnlineErr_->getName() );
00234   sprintf(histo, "EBPOT pedestal quality errors summary G12");
00235   mePedestalOnlineErr_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00236   for (int i = 0; i < 36; i++) {
00237     mePedestalOnlineErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00238   }
00239 
00240   if ( meLaserL1_ ) dqmStore_->removeElement( meLaserL1_->getName() );
00241   sprintf(histo, "EBLT laser quality summary L1");
00242   meLaserL1_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00243   meLaserL1_->setAxisTitle("jphi", 1);
00244   meLaserL1_->setAxisTitle("jeta", 2);
00245 
00246   if ( meLaserL1Err_ ) dqmStore_->removeElement( meLaserL1Err_->getName() );
00247   sprintf(histo, "EBLT laser quality errors summary L1");
00248   meLaserL1Err_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00249   for (int i = 0; i < 36; i++) {
00250     meLaserL1Err_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00251   }
00252 
00253   if ( meLaserL1PN_ ) dqmStore_->removeElement( meLaserL1PN_->getName() );
00254   sprintf(histo, "EBLT PN laser quality summary L1");
00255   meLaserL1PN_ = dqmStore_->book2D(histo, histo, 90, 0., 90., 20, -10., 10.);
00256   meLaserL1PN_->setAxisTitle("jphi", 1);
00257   meLaserL1PN_->setAxisTitle("jeta", 2);
00258 
00259   if ( meLaserL1PNErr_ ) dqmStore_->removeElement( meLaserL1PNErr_->getName() );
00260   sprintf(histo, "EBLT PN laser quality errors summary L1");
00261   meLaserL1PNErr_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00262   for (int i = 0; i < 36; i++) {
00263     meLaserL1PNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00264   }
00265 
00266   if( mePedestal_ ) dqmStore_->removeElement( mePedestal_->getName() );
00267   sprintf(histo, "EBPT pedestal quality summary");
00268   mePedestal_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00269   mePedestal_->setAxisTitle("jphi", 1);
00270   mePedestal_->setAxisTitle("jeta", 2);
00271 
00272   if( mePedestalErr_ ) dqmStore_->removeElement( mePedestalErr_->getName() );
00273   sprintf(histo, "EBPT pedestal quality errors summary");
00274   mePedestalErr_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00275   for (int i = 0; i < 36; i++) {
00276     mePedestalErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00277   }
00278 
00279   if( mePedestalPN_ ) dqmStore_->removeElement( mePedestalPN_->getName() );
00280   sprintf(histo, "EBPT PN pedestal quality summary");
00281   mePedestalPN_ = dqmStore_->book2D(histo, histo, 90, 0., 90., 20, -10, 10.);
00282   mePedestalPN_->setAxisTitle("jphi", 1);
00283   mePedestalPN_->setAxisTitle("jeta", 2);
00284 
00285   if( mePedestalPNErr_ ) dqmStore_->removeElement( mePedestalPNErr_->getName() );
00286   sprintf(histo, "EBPT PN pedestal quality errors summary");
00287   mePedestalPNErr_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00288   for (int i = 0; i < 36; i++) {
00289     mePedestalPNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00290   }
00291 
00292   if( meTestPulse_ ) dqmStore_->removeElement( meTestPulse_->getName() );
00293   sprintf(histo, "EBTPT test pulse quality summary");
00294   meTestPulse_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00295   meTestPulse_->setAxisTitle("jphi", 1);
00296   meTestPulse_->setAxisTitle("jeta", 2);
00297 
00298   if( meTestPulseErr_ ) dqmStore_->removeElement( meTestPulseErr_->getName() );
00299   sprintf(histo, "EBTPT test pulse quality errors summary");
00300   meTestPulseErr_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00301   for (int i = 0; i < 36; i++) {
00302     meTestPulseErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00303   }
00304 
00305   if( meTestPulsePN_ ) dqmStore_->removeElement( meTestPulsePN_->getName() );
00306   sprintf(histo, "EBTPT PN test pulse quality summary");
00307   meTestPulsePN_ = dqmStore_->book2D(histo, histo, 90, 0., 90., 20, -10., 10.);
00308   meTestPulsePN_->setAxisTitle("jphi", 1);
00309   meTestPulsePN_->setAxisTitle("jeta", 2);
00310 
00311   if( meTestPulsePNErr_ ) dqmStore_->removeElement( meTestPulsePNErr_->getName() );
00312   sprintf(histo, "EBTPT PN test pulse quality errors summary");
00313   meTestPulsePNErr_ = dqmStore_->book1D(histo, histo, 36, 1, 37);
00314   for (int i = 0; i < 36; i++) {
00315     meTestPulsePNErr_->setBinLabel(i+1, Numbers::sEB(i+1).c_str(), 1);
00316   }
00317 
00318   if( meCosmic_ ) dqmStore_->removeElement( meCosmic_->getName() );
00319   sprintf(histo, "EBCT cosmic summary");
00320   meCosmic_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00321   meCosmic_->setAxisTitle("jphi", 1);
00322   meCosmic_->setAxisTitle("jeta", 2);
00323 
00324   if( meTiming_ ) dqmStore_->removeElement( meTiming_->getName() );
00325   sprintf(histo, "EBTMT timing quality summary");
00326   meTiming_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00327   meTiming_->setAxisTitle("jphi", 1);
00328   meTiming_->setAxisTitle("jeta", 2);
00329 
00330   if( meTriggerTowerEt_ ) dqmStore_->removeElement( meTriggerTowerEt_->getName() );
00331   sprintf(histo, "EBTTT Et trigger tower summary");
00332   meTriggerTowerEt_ = dqmStore_->book2D(histo, histo, 72, 0., 72., 34, -17., 17.);
00333   meTriggerTowerEt_->setAxisTitle("jphi'", 1);
00334   meTriggerTowerEt_->setAxisTitle("jeta'", 2);
00335 
00336   if( meTriggerTowerEmulError_ ) dqmStore_->removeElement( meTriggerTowerEmulError_->getName() );
00337   sprintf(histo, "EBTTT emulator error quality summary");
00338   meTriggerTowerEmulError_ = dqmStore_->book2D(histo, histo, 72, 0., 72., 34, -17., 17.);
00339   meTriggerTowerEmulError_->setAxisTitle("jphi'", 1);
00340   meTriggerTowerEmulError_->setAxisTitle("jeta'", 2);
00341 
00342   if( meTriggerTowerTiming_ ) dqmStore_->removeElement( meTriggerTowerTiming_->getName() );
00343   sprintf(histo, "EBTTT Trigger Primitives Timing summary");
00344   meTriggerTowerTiming_ = dqmStore_->book2D(histo, histo, 72, 0., 72., 34, -17., 17.);
00345   meTriggerTowerTiming_->setAxisTitle("jphi'", 1);
00346   meTriggerTowerTiming_->setAxisTitle("jeta'", 2);
00347 
00348   if( meGlobalSummary_ ) dqmStore_->removeElement( meGlobalSummary_->getName() );
00349   sprintf(histo, "EB global summary");
00350   meGlobalSummary_ = dqmStore_->book2D(histo, histo, 360, 0., 360., 170, -85., 85.);
00351   meGlobalSummary_->setAxisTitle("jphi", 1);
00352   meGlobalSummary_->setAxisTitle("jeta", 2);
00353 
00354 }
00355 
00356 void EBSummaryClient::cleanup(void) {
00357 
00358   if ( ! enableCleanup_ ) return;
00359 
00360   dqmStore_->setCurrentFolder( prefixME_ + "/EBSummaryClient" );
00361 
00362   if ( meIntegrity_ ) dqmStore_->removeElement( meIntegrity_->getName() );
00363   meIntegrity_ = 0;
00364 
00365   if ( meIntegrityErr_ ) dqmStore_->removeElement( meIntegrityErr_->getName() );
00366   meIntegrityErr_ = 0;
00367 
00368   if ( meOccupancy_ ) dqmStore_->removeElement( meOccupancy_->getName() );
00369   meOccupancy_ = 0;
00370 
00371   if ( meOccupancy1D_ ) dqmStore_->removeElement( meOccupancy1D_->getName() );
00372   meOccupancy1D_ = 0;
00373 
00374   if ( meStatusFlags_ ) dqmStore_->removeElement( meStatusFlags_->getName() );
00375   meStatusFlags_ = 0;
00376 
00377   if ( meStatusFlagsErr_ ) dqmStore_->removeElement( meStatusFlagsErr_->getName() );
00378   meStatusFlagsErr_ = 0;
00379 
00380   if ( mePedestalOnline_ ) dqmStore_->removeElement( mePedestalOnline_->getName() );
00381   mePedestalOnline_ = 0;
00382 
00383   if ( mePedestalOnlineErr_ ) dqmStore_->removeElement( mePedestalOnlineErr_->getName() );
00384   mePedestalOnlineErr_ = 0;
00385 
00386   if ( meLaserL1_ ) dqmStore_->removeElement( meLaserL1_->getName() );
00387   meLaserL1_ = 0;
00388 
00389   if ( meLaserL1Err_ ) dqmStore_->removeElement( meLaserL1Err_->getName() );
00390   meLaserL1Err_ = 0;
00391 
00392   if ( meLaserL1PN_ ) dqmStore_->removeElement( meLaserL1PN_->getName() );
00393   meLaserL1PN_ = 0;
00394 
00395   if ( meLaserL1PNErr_ ) dqmStore_->removeElement( meLaserL1PNErr_->getName() );
00396   meLaserL1PNErr_ = 0;
00397 
00398   if ( mePedestal_ ) dqmStore_->removeElement( mePedestal_->getName() );
00399   mePedestal_ = 0;
00400 
00401   if ( mePedestalErr_ ) dqmStore_->removeElement( mePedestalErr_->getName() );
00402   mePedestalErr_ = 0;
00403 
00404   if ( mePedestalPN_ ) dqmStore_->removeElement( mePedestalPN_->getName() );
00405   mePedestalPN_ = 0;
00406 
00407   if ( mePedestalPNErr_ ) dqmStore_->removeElement( mePedestalPNErr_->getName() );
00408   mePedestalPNErr_ = 0;
00409 
00410   if ( meTestPulse_ ) dqmStore_->removeElement( meTestPulse_->getName() );
00411   meTestPulse_ = 0;
00412 
00413   if ( meTestPulseErr_ ) dqmStore_->removeElement( meTestPulseErr_->getName() );
00414   meTestPulseErr_ = 0;
00415 
00416   if ( meTestPulsePN_ ) dqmStore_->removeElement( meTestPulsePN_->getName() );
00417   meTestPulsePN_ = 0;
00418 
00419   if ( meTestPulsePNErr_ ) dqmStore_->removeElement( meTestPulsePNErr_->getName() );
00420   meTestPulsePNErr_ = 0;
00421 
00422   if ( meCosmic_ ) dqmStore_->removeElement( meCosmic_->getName() );
00423   meCosmic_ = 0;
00424 
00425   if ( meTiming_ ) dqmStore_->removeElement( meTiming_->getName() );
00426   meTiming_ = 0;
00427 
00428   if ( meTriggerTowerEt_ ) dqmStore_->removeElement( meTriggerTowerEt_->getName() );
00429   meTriggerTowerEt_ = 0;
00430 
00431   if ( meTriggerTowerEmulError_ ) dqmStore_->removeElement( meTriggerTowerEmulError_->getName() );
00432   meTriggerTowerEmulError_ = 0;
00433 
00434   if ( meTriggerTowerTiming_ ) dqmStore_->removeElement( meTriggerTowerTiming_->getName() );
00435   meTriggerTowerTiming_ = 0;
00436 
00437   if ( meGlobalSummary_ ) dqmStore_->removeElement( meGlobalSummary_->getName() );
00438   meGlobalSummary_ = 0;
00439 
00440 }
00441 
00442 bool EBSummaryClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status, bool flag) {
00443 
00444   status = true;
00445 
00446   if ( ! flag ) return false;
00447 
00448   return true;
00449 
00450 }
00451 
00452 void EBSummaryClient::analyze(void) {
00453 
00454   ievt_++;
00455   jevt_++;
00456   if ( ievt_ % 10 == 0 ) {
00457     if ( debug_ ) cout << "EBSummaryClient: ievt/jevt = " << ievt_ << "/" << jevt_ << endl;
00458   }
00459 
00460   for ( int iex = 1; iex <= 170; iex++ ) {
00461     for ( int ipx = 1; ipx <= 360; ipx++ ) {
00462 
00463       meIntegrity_->setBinContent( ipx, iex, 6. );
00464       meOccupancy_->setBinContent( ipx, iex, 0. );
00465       meStatusFlags_->setBinContent( ipx, iex, 6. );
00466       mePedestalOnline_->setBinContent( ipx, iex, 6. );
00467 
00468       meLaserL1_->setBinContent( ipx, iex, 6. );
00469       mePedestal_->setBinContent( ipx, iex, 6. );
00470       meTestPulse_->setBinContent( ipx, iex, 6. );
00471 
00472       meCosmic_->setBinContent( ipx, iex, 0. );
00473       meTiming_->setBinContent( ipx, iex, 6. );
00474 
00475       meGlobalSummary_->setBinContent( ipx, iex, 6. );
00476 
00477     }
00478   }
00479 
00480   for ( int iex = 1; iex <= 20; iex++ ) {
00481     for ( int ipx = 1; ipx <= 90; ipx++ ) {
00482 
00483       meLaserL1PN_->setBinContent( ipx, iex, 6. );
00484       mePedestalPN_->setBinContent( ipx, iex, 6. );
00485       meTestPulsePN_->setBinContent( ipx, iex, 6. );
00486 
00487     }
00488   }
00489 
00490   for ( int iex = 1; iex <= 34; iex++ ) {
00491     for ( int ipx = 1; ipx <= 72; ipx++ ) {
00492       meTriggerTowerEt_->setBinContent( ipx, iex, 0. );
00493       meTriggerTowerEmulError_->setBinContent( ipx, iex, 6. );
00494       meTriggerTowerTiming_->setBinContent( ipx, iex, -1. );
00495     }
00496   }
00497 
00498   meIntegrity_->setEntries( 0 );
00499   meIntegrityErr_->Reset();
00500   meOccupancy_->setEntries( 0 );
00501   meOccupancy1D_->Reset();
00502   meStatusFlags_->setEntries( 0 );
00503   meStatusFlagsErr_->Reset();
00504   mePedestalOnline_->setEntries( 0 );
00505   mePedestalOnlineErr_->Reset();
00506 
00507   meLaserL1_->setEntries( 0 );
00508   meLaserL1Err_->Reset();
00509   meLaserL1PN_->setEntries( 0 );
00510   meLaserL1PNErr_->Reset();
00511   mePedestal_->setEntries( 0 );
00512   mePedestalErr_->Reset();
00513   mePedestalPN_->setEntries( 0 );
00514   mePedestalPNErr_->Reset();
00515   meTestPulse_->setEntries( 0 );
00516   meTestPulseErr_->Reset();
00517   meTestPulsePN_->setEntries( 0 );
00518   meTestPulsePNErr_->Reset();
00519 
00520   meCosmic_->setEntries( 0 );
00521   meTiming_->setEntries( 0 );
00522   meTriggerTowerEt_->setEntries( 0 );
00523   meTriggerTowerEmulError_->setEntries( 0 );
00524   meTriggerTowerTiming_->setEntries( 0 );
00525 
00526   meGlobalSummary_->setEntries( 0 );
00527 
00528   for ( unsigned int i=0; i<clients_.size(); i++ ) {
00529 
00530     EBIntegrityClient* ebic = dynamic_cast<EBIntegrityClient*>(clients_[i]);
00531     EBStatusFlagsClient* ebsfc = dynamic_cast<EBStatusFlagsClient*>(clients_[i]);
00532     EBPedestalOnlineClient* ebpoc = dynamic_cast<EBPedestalOnlineClient*>(clients_[i]);
00533 
00534     EBLaserClient* eblc = dynamic_cast<EBLaserClient*>(clients_[i]);
00535     EBPedestalClient* ebpc = dynamic_cast<EBPedestalClient*>(clients_[i]);
00536     EBTestPulseClient* ebtpc = dynamic_cast<EBTestPulseClient*>(clients_[i]);
00537 
00538     EBCosmicClient* ebcc = dynamic_cast<EBCosmicClient*>(clients_[i]);
00539     EBTimingClient* ebtmc = dynamic_cast<EBTimingClient*>(clients_[i]);
00540     EBTriggerTowerClient* ebtttc = dynamic_cast<EBTriggerTowerClient*>(clients_[i]);
00541 
00542     MonitorElement *me;
00543     MonitorElement *me_01, *me_02, *me_03;
00544     MonitorElement *me_04, *me_05;
00545     //    MonitorElement *me_f[6], *me_fg[2];
00546     TH2F* h2;
00547     TProfile2D* h2d;
00548 
00549     // fill the gain value priority map<id,priority>
00550     map<float,float> priority;
00551     priority.insert( pair<float,float>(0,3) );
00552     priority.insert( pair<float,float>(1,1) );
00553     priority.insert( pair<float,float>(2,2) );
00554     priority.insert( pair<float,float>(3,2) );
00555     priority.insert( pair<float,float>(4,3) );
00556     priority.insert( pair<float,float>(5,1) );
00557 
00558     for ( unsigned int i=0; i<superModules_.size(); i++ ) {
00559 
00560       int ism = superModules_[i];
00561 
00562       for ( int ie = 1; ie <= 85; ie++ ) {
00563         for ( int ip = 1; ip <= 20; ip++ ) {
00564 
00565           if ( ebic ) {
00566 
00567             me = ebic->meg01_[ism-1];
00568 
00569             if ( me ) {
00570 
00571               float xval = me->getBinContent( ie, ip );
00572 
00573               int iex;
00574               int ipx;
00575 
00576               if ( ism <= 18 ) {
00577                 iex = 1+(85-ie);
00578                 ipx = ip+20*(ism-1);
00579               } else {
00580                 iex = 85+ie;
00581                 ipx = 1+(20-ip)+20*(ism-19);
00582               }
00583 
00584               meIntegrity_->setBinContent( ipx, iex, xval );
00585               if( xval == 0 ) meIntegrityErr_->Fill( ism );
00586 
00587             }
00588 
00589             h2 = ebic->h_[ism-1];
00590 
00591             if ( h2 ) {
00592 
00593               float xval = h2->GetBinContent( ie, ip );
00594 
00595               int iex;
00596               int ipx;
00597 
00598               if ( ism <= 18 ) {
00599                 iex = 1+(85-ie);
00600                 ipx = ip+20*(ism-1);
00601               } else {
00602                 iex = 85+ie;
00603                 ipx = 1+(20-ip)+20*(ism-19);
00604               }
00605 
00606               meOccupancy_->setBinContent( ipx, iex, xval );
00607               if ( xval != 0 ) meOccupancy1D_->Fill( ism, xval );
00608 
00609             }
00610 
00611           }
00612 
00613           if ( ebpoc ) {
00614 
00615             me = ebpoc->meg03_[ism-1];
00616 
00617             if ( me ) {
00618 
00619               float xval = me->getBinContent( ie, ip );
00620 
00621               int iex;
00622               int ipx;
00623 
00624               if ( ism <= 18 ) {
00625                 iex = 1+(85-ie);
00626                 ipx = ip+20*(ism-1);
00627               } else {
00628                 iex = 85+ie;
00629                 ipx = 1+(20-ip)+20*(ism-19);
00630               }
00631 
00632               mePedestalOnline_->setBinContent( ipx, iex, xval );
00633               if ( xval == 0 ) mePedestalOnlineErr_->Fill( ism );
00634 
00635             }
00636 
00637           }
00638 
00639           if ( eblc ) {
00640 
00641             me = eblc->meg01_[ism-1];
00642 
00643             if ( me ) {
00644 
00645               float xval = me->getBinContent( ie, ip );
00646 
00647               int iex;
00648               int ipx;
00649 
00650               if ( ism <= 18 ) {
00651                 iex = 1+(85-ie);
00652                 ipx = ip+20*(ism-1);
00653               } else {
00654                 iex = 85+ie;
00655                 ipx = 1+(20-ip)+20*(ism-19);
00656               }
00657 
00658               if ( me->getEntries() != 0 ) {
00659                 meLaserL1_->setBinContent( ipx, iex, xval );
00660                 if ( xval == 0 ) meLaserL1Err_->Fill( ism );
00661               }
00662 
00663             }
00664 
00665           }
00666 
00667           if ( ebpc ) {
00668 
00669             me_01 = ebpc->meg01_[ism-1];
00670             me_02 = ebpc->meg02_[ism-1];
00671             me_03 = ebpc->meg03_[ism-1];
00672 
00673             if ( me_01 && me_02 && me_03 ) {
00674               float xval=2;
00675               float val_01=me_01->getBinContent(ie,ip);
00676               float val_02=me_02->getBinContent(ie,ip);
00677               float val_03=me_03->getBinContent(ie,ip);
00678 
00679               vector<float> maskedVal, unmaskedVal;
00680               (val_01>=3&&val_01<=5) ? maskedVal.push_back(val_01) : unmaskedVal.push_back(val_01);
00681               (val_02>=3&&val_02<=5) ? maskedVal.push_back(val_02) : unmaskedVal.push_back(val_02);
00682               (val_03>=3&&val_03<=5) ? maskedVal.push_back(val_03) : unmaskedVal.push_back(val_03);
00683 
00684               float brightColor=6, darkColor=6;
00685               float maxPriority=-1;
00686 
00687               vector<float>::const_iterator Val;
00688               for(Val=unmaskedVal.begin(); Val<unmaskedVal.end(); Val++) {
00689                 if(priority[*Val]>maxPriority) brightColor=*Val;
00690               }
00691               maxPriority=-1;
00692               for(Val=maskedVal.begin(); Val<maskedVal.end(); Val++) {
00693                 if(priority[*Val]>maxPriority) darkColor=*Val;
00694               }
00695               if(unmaskedVal.size()==3) xval = brightColor;
00696               else if(maskedVal.size()==3) xval = darkColor;
00697               else {
00698                 if(brightColor==1 && darkColor==5) xval = 5;
00699                 else xval = brightColor;
00700               }
00701 
00702               int iex;
00703               int ipx;
00704 
00705               if ( ism <= 18 ) {
00706                 iex = 1+(85-ie);
00707                 ipx = ip+20*(ism-1);
00708               } else {
00709                 iex = 85+ie;
00710                 ipx = 1+(20-ip)+20*(ism-19);
00711               }
00712 
00713               if ( me_01->getEntries() != 0 && me_02->getEntries() != 0 && me_03->getEntries() != 0 ) {
00714                 mePedestal_->setBinContent( ipx, iex, xval );
00715                 if ( xval == 0 ) mePedestalErr_->Fill( ism );
00716               }
00717 
00718             }
00719 
00720           }
00721 
00722           if ( ebtpc ) {
00723 
00724             me_01 = ebtpc->meg01_[ism-1];
00725             me_02 = ebtpc->meg02_[ism-1];
00726             me_03 = ebtpc->meg03_[ism-1];
00727 
00728             if ( me_01 && me_02 && me_03 ) {
00729               float xval=2;
00730               float val_01=me_01->getBinContent(ie,ip);
00731               float val_02=me_02->getBinContent(ie,ip);
00732               float val_03=me_03->getBinContent(ie,ip);
00733 
00734               vector<float> maskedVal, unmaskedVal;
00735               (val_01>=3&&val_01<=5) ? maskedVal.push_back(val_01) : unmaskedVal.push_back(val_01);
00736               (val_02>=3&&val_02<=5) ? maskedVal.push_back(val_02) : unmaskedVal.push_back(val_02);
00737               (val_03>=3&&val_03<=5) ? maskedVal.push_back(val_03) : unmaskedVal.push_back(val_03);
00738 
00739               float brightColor=6, darkColor=6;
00740               float maxPriority=-1;
00741 
00742               vector<float>::const_iterator Val;
00743               for(Val=unmaskedVal.begin(); Val<unmaskedVal.end(); Val++) {
00744                 if(priority[*Val]>maxPriority) brightColor=*Val;
00745               }
00746               maxPriority=-1;
00747               for(Val=maskedVal.begin(); Val<maskedVal.end(); Val++) {
00748                 if(priority[*Val]>maxPriority) darkColor=*Val;
00749               }
00750               if(unmaskedVal.size()==3) xval = brightColor;
00751               else if(maskedVal.size()==3) xval = darkColor;
00752               else {
00753                 if(brightColor==1 && darkColor==5) xval = 5;
00754                 else xval = brightColor;
00755               }
00756 
00757               int iex;
00758               int ipx;
00759 
00760               if ( ism <= 18 ) {
00761                 iex = 1+(85-ie);
00762                 ipx = ip+20*(ism-1);
00763               } else {
00764                 iex = 85+ie;
00765                 ipx = 1+(20-ip)+20*(ism-19);
00766               }
00767 
00768               if ( me_01->getEntries() != 0 && me_02->getEntries() != 0 && me_03->getEntries() != 0 ) {
00769                 meTestPulse_->setBinContent( ipx, iex, xval );
00770                 if( xval == 0 ) meTestPulseErr_->Fill( ism );
00771               }
00772 
00773             }
00774 
00775           }
00776 
00777           if ( ebcc ) {
00778 
00779             h2d = ebcc->h02_[ism-1];
00780 
00781             if ( h2d ) {
00782 
00783               float xval = h2d->GetBinContent( ie, ip );
00784 
00785               int iex;
00786               int ipx;
00787 
00788               if ( ism <= 18 ) {
00789                 iex = 1+(85-ie);
00790                 ipx = ip+20*(ism-1);
00791               } else {
00792                 iex = 85+ie;
00793                 ipx = 1+(20-ip)+20*(ism-19);
00794               }
00795 
00796               meCosmic_->setBinContent( ipx, iex, xval );
00797 
00798             }
00799 
00800           }
00801 
00802           if ( ebtmc ) {
00803 
00804             me = ebtmc->meg01_[ism-1];
00805 
00806             if ( me ) {
00807 
00808               float xval = me->getBinContent( ie, ip );
00809 
00810               int iex;
00811               int ipx;
00812 
00813               if ( ism <= 18 ) {
00814                 iex = 1+(85-ie);
00815                 ipx = ip+20*(ism-1);
00816               } else {
00817                 iex = 85+ie;
00818                 ipx = 1+(20-ip)+20*(ism-19);
00819               }
00820 
00821               meTiming_->setBinContent( ipx, iex, xval );
00822 
00823             }
00824 
00825           }
00826 
00827         }
00828       }
00829 
00830       for (int ie = 1; ie <= 17; ie++ ) {
00831         for (int ip = 1; ip <= 4; ip++ ) {
00832 
00833           int iex;
00834           int ipx;
00835           
00836           if ( ism <= 18 ) {
00837             iex = 1+(17-ie);
00838             ipx = ip+4*(ism-1);
00839           } else {
00840             iex = 17+ie;
00841             ipx = 1+(4-ip)+4*(ism-19);
00842           }
00843 
00844           if ( ebsfc ) {
00845 
00846             me = ebsfc->meh01_[ism-1];
00847 
00848             if ( me ) {
00849 
00850               float xval = 6;
00851 
00852               if ( me->getBinContent( ie, ip ) == 6 ) xval = 2;
00853               if ( me->getBinContent( ie, ip ) == 0 ) xval = 1;
00854               if ( me->getBinContent( ie, ip ) > 0 ) xval = 0;
00855 
00856               if ( me->getEntries() != 0 ) {
00857                 meStatusFlags_->setBinContent( ipx, iex, xval );
00858                 if ( xval == 0 ) meStatusFlagsErr_->Fill( ism );
00859               }
00860 
00861             }
00862 
00863           }
00864 
00865           if ( ebtttc ) {
00866 
00867             me = ebtttc->me_h01_[ism-1];
00868 
00869             bool hasRealDigi = false;
00870 
00871             if ( me ) {
00872 
00873               float xval = me->getBinContent( ie, ip );
00874 
00875               TProfile2D* obj = UtilsClient::getHisto<TProfile2D*>( me );
00876               if(obj && obj->GetBinEntries(obj->GetBin( ie, ip ))!=0) hasRealDigi = true;
00877 
00878               meTriggerTowerEt_->setBinContent( ipx, iex, xval );
00879 
00880             }
00881 
00882             me = ebtttc->me_o01_[ism-1];
00883 
00884             if ( me ) {
00885 
00886               float xval = me->getBinContent( ie, ip );
00887 
00888               meTriggerTowerTiming_->setBinContent( ipx, iex, xval );
00889 
00890             }
00891 
00892             float xval = 6;
00893             if(!hasRealDigi) xval = 2;
00894             else {
00895 
00896               h2 = ebtttc->l01_[ism-1];
00897 
00898               if ( h2 ) {
00899 
00900                 float emulErrorVal = h2->GetBinContent( ie, ip );
00901                 if( emulErrorVal!=0 ) xval = 0;
00902 
00903               }
00904 
00905               // do not propagate the flag bits to the summary for now
00906 //               for ( int iflag=0; iflag<6; iflag++ ) {
00907 
00908 //                 me_f[iflag] = ebtttc->me_m01_[ism-1][iflag];
00909 
00910 //                 if ( me_f[iflag] ) {
00911 
00912 //                   float emulFlagErrorVal = me_f[iflag]->getBinContent( ie, ip );
00913 //                   if ( emulFlagErrorVal!=0 ) xval = 0;
00914 
00915 //                 }
00916 
00917 //               }
00918 
00919 //               for ( int ifg=0; ifg<2; ifg++) {
00920 
00921 //                 me_fg[ifg] = ebtttc->me_n01_[ism-1][ifg];
00922 //                 if ( me_fg[ifg] ) {
00923 
00924 //                   float emulFineGrainVetoErrorVal = me_fg[ifg]->getBinContent( ie, ip );
00925 //                   if ( emulFineGrainVetoErrorVal!=0 ) xval = 0;
00926 
00927 //                 }
00928 
00929 //               }
00930 
00931               if ( xval!=0 ) xval = 1;
00932 
00933             }
00934 
00935             meTriggerTowerEmulError_->setBinContent( ipx, iex, xval );
00936 
00937           }
00938 
00939         }
00940       }
00941 
00942       // PN's summaries
00943       for( int i = 1; i <= 10; i++ ) {
00944         for( int j = 1; j <= 5; j++ ) {
00945 
00946           if ( ebpc ) {
00947 
00948             me_04 = ebpc->meg04_[ism-1];
00949             me_05 = ebpc->meg05_[ism-1];
00950 
00951             if( me_04 && me_05) {
00952               float xval=2;
00953               float val_04=me_04->getBinContent(i,1);
00954               float val_05=me_05->getBinContent(i,1);
00955 
00956               vector<float> maskedVal, unmaskedVal;
00957               (val_04>=3&&val_04<=5) ? maskedVal.push_back(val_04) : unmaskedVal.push_back(val_04);
00958               (val_05>=3&&val_05<=5) ? maskedVal.push_back(val_05) : unmaskedVal.push_back(val_05);
00959 
00960               float brightColor=6, darkColor=6;
00961               float maxPriority=-1;
00962 
00963               vector<float>::const_iterator Val;
00964               for(Val=unmaskedVal.begin(); Val<unmaskedVal.end(); Val++) {
00965                 if(priority[*Val]>maxPriority) brightColor=*Val;
00966               }
00967               maxPriority=-1;
00968               for(Val=maskedVal.begin(); Val<maskedVal.end(); Val++) {
00969                 if(priority[*Val]>maxPriority) darkColor=*Val;
00970               }
00971               if(unmaskedVal.size()==2) xval = brightColor;
00972               else if(maskedVal.size()==2) xval = darkColor;
00973               else {
00974                 if(brightColor==1 && darkColor==5) xval = 5;
00975                 else xval = brightColor;
00976               }
00977 
00978               int iex;
00979               int ipx;
00980 
00981               if(ism<=18) {
00982                 iex = i;
00983                 ipx = j+5*(ism-1);
00984               } else {
00985                 iex = i+10;
00986                 ipx = j+5*(ism-19);
00987               }
00988 
00989               if ( me_04->getEntries() != 0 && me_05->getEntries() != 0 ) {
00990                 mePedestalPN_->setBinContent( ipx, iex, xval );
00991                 if( xval == 0 ) mePedestalPNErr_->Fill( ism );
00992               }
00993 
00994             }
00995 
00996           }
00997 
00998           if ( ebtpc ) {
00999 
01000             me_04 = ebtpc->meg04_[ism-1];
01001             me_05 = ebtpc->meg05_[ism-1];
01002 
01003             if( me_04 && me_05) {
01004               float xval=2;
01005               float val_04=me_04->getBinContent(i,1);
01006               float val_05=me_05->getBinContent(i,1);
01007 
01008               vector<float> maskedVal, unmaskedVal;
01009               (val_04>=3&&val_04<=5) ? maskedVal.push_back(val_04) : unmaskedVal.push_back(val_04);
01010               (val_05>=3&&val_05<=5) ? maskedVal.push_back(val_05) : unmaskedVal.push_back(val_05);
01011 
01012               float brightColor=6, darkColor=6;
01013               float maxPriority=-1;
01014 
01015               vector<float>::const_iterator Val;
01016               for(Val=unmaskedVal.begin(); Val<unmaskedVal.end(); Val++) {
01017                 if(priority[*Val]>maxPriority) brightColor=*Val;
01018               }
01019               maxPriority=-1;
01020               for(Val=maskedVal.begin(); Val<maskedVal.end(); Val++) {
01021                 if(priority[*Val]>maxPriority) darkColor=*Val;
01022               }
01023               if(unmaskedVal.size()==2) xval = brightColor;
01024               else if(maskedVal.size()==2) xval = darkColor;
01025               else {
01026                 if(brightColor==1 && darkColor==5) xval = 5;
01027                 else xval = brightColor;
01028               }
01029 
01030               int iex;
01031               int ipx;
01032 
01033               if(ism<=18) {
01034                 iex = i;
01035                 ipx = j+5*(ism-1);
01036               } else {
01037                 iex = i+10;
01038                 ipx = j+5*(ism-19);
01039               }
01040 
01041               if ( me_04->getEntries() != 0 && me_05->getEntries() != 0 ) {
01042                 meTestPulsePN_->setBinContent( ipx, iex, xval );
01043                 if ( xval == 0 ) meTestPulsePNErr_->Fill ( ism );
01044               }
01045 
01046             }
01047           }
01048 
01049           if ( eblc ) {
01050 
01051             me = eblc->meg09_[ism-1];
01052 
01053             if( me ) {
01054 
01055               float xval = me->getBinContent(i,1);
01056 
01057               int iex;
01058               int ipx;
01059 
01060               if(ism<=18) {
01061                 iex = i;
01062                 ipx = j+5*(ism-1);
01063               } else {
01064                 iex = i+10;
01065                 ipx = j+5*(ism-19);
01066               }
01067 
01068               if ( me->getEntries() != 0 && me->getEntries() != 0 ) {
01069                 meLaserL1PN_->setBinContent( ipx, iex, xval );
01070                 if ( xval == 0 ) meLaserL1PNErr_->Fill( ism );
01071               }
01072 
01073             }
01074 
01075           }
01076 
01077         }
01078       }
01079 
01080     } // loop on SM
01081 
01082   } // loop on clients
01083 
01084   // The global-summary
01085   int nGlobalErrors = 0;
01086   int nGlobalErrorsEB[36];
01087   int nValidChannels = 0;
01088   int nValidChannelsEB[36];
01089 
01090   for (int i = 0; i < 36; i++) {
01091     nGlobalErrorsEB[i] = 0;
01092     nValidChannelsEB[i] = 0;
01093   }
01094 
01095   for ( int iex = 1; iex <= 170; iex++ ) {
01096     for ( int ipx = 1; ipx <= 360; ipx++ ) {
01097 
01098       if(meIntegrity_ && mePedestalOnline_ && meLaserL1_ && meTiming_ && meStatusFlags_ && meTriggerTowerEmulError_) {
01099 
01100         float xval = 6;
01101         float val_in = meIntegrity_->getBinContent(ipx,iex);
01102         float val_po = mePedestalOnline_->getBinContent(ipx,iex);
01103         float val_ls = meLaserL1_->getBinContent(ipx,iex);
01104         float val_tm = meTiming_->getBinContent(ipx,iex);
01105         float val_sf = meStatusFlags_->getBinContent((ipx-1)/5+1,(iex-1)/5+1);
01106         // float val_ee = meTriggerTowerEmulError_->getBinContent((ipx-1)/5+1,(iex-1)/5+1); // removed from the global summary temporarily
01107         float val_ee = 1;
01108 
01109         // turn each dark color (masked channel) to bright green
01110         // for laser & timing & trigger turn also yellow into bright green
01111 
01112         //  0/3 = red/dark red
01113         //  1/4 = green/dark green
01114         //  2/5 = yellow/dark yellow
01115         //  6   = unknown
01116 
01117         if(             val_in==3 || val_in==4 || val_in==5) val_in=1;
01118         if(             val_po==3 || val_po==4 || val_po==5) val_po=1;
01119         if(val_ls==2 || val_ls==3 || val_ls==4 || val_ls==5) val_ls=1;
01120         if(val_tm==2 || val_tm==3 || val_tm==4 || val_tm==5) val_tm=1;
01121         if(             val_sf==3 || val_sf==4 || val_sf==5) val_sf=1;
01122         if(val_ee==2 || val_ee==3 || val_ee==4 || val_ee==5) val_ee=1;
01123 
01124         if(val_in==6) xval=6;
01125         else if(val_in==0) xval=0;
01126         else if(val_po==0 || val_ls==0 || val_tm==0 || val_sf==0 || val_ee==0) xval=0;
01127         else if(val_po==2 || val_ls==2 || val_tm==2 || val_sf==2 || val_ee==2) xval=2;
01128         else xval=1;
01129 
01130         // if the SM is entirely not read, the masked channels
01131         // are reverted back to yellow
01132         float iEntries=0;
01133 
01134         int ism = (ipx-1)/20 + 1 ;
01135         if ( iex>85 ) ism+=18;
01136 
01137         vector<int>::iterator iter = find(superModules_.begin(), superModules_.end(), ism);
01138         if (iter != superModules_.end()) {
01139           for ( unsigned int i=0; i<clients_.size(); i++ ) {
01140             EBIntegrityClient* ebic = dynamic_cast<EBIntegrityClient*>(clients_[i]);
01141             if ( ebic ) {
01142               TH2F* h2 = ebic->h_[ism-1];
01143               if ( h2 ) {
01144                 iEntries = h2->GetEntries();
01145               }
01146             }
01147           }
01148         }
01149 
01150         if ( iEntries==0 ) {
01151           xval=2;
01152         }
01153 
01154         meGlobalSummary_->setBinContent( ipx, iex, xval );
01155 
01156         if ( xval >= 0 && xval <= 5 ) {
01157           if ( xval != 2 && xval != 5 ) ++nValidChannels;
01158           if ( iex <= 85 ) {
01159             if ( xval != 2 && xval != 5 ) ++nValidChannelsEB[(ipx-1)/20];
01160           } else {
01161             if ( xval != 2 && xval != 5 ) ++nValidChannelsEB[18+(ipx-1)/20];
01162           }
01163           if ( xval == 0 ) ++nGlobalErrors;
01164           if ( iex <= 85 ) {
01165             if ( xval == 0 ) ++nGlobalErrorsEB[(ipx-1)/20];
01166           } else {
01167             if ( xval == 0 ) ++nGlobalErrorsEB[18+(ipx-1)/20];
01168           }
01169         }
01170 
01171       }
01172 
01173     }
01174   }
01175 
01176   MonitorElement* me;
01177 
01178   float reportSummary = -1.0;
01179   if ( nValidChannels != 0 )
01180     reportSummary = 1.0 - float(nGlobalErrors)/float(nValidChannels);
01181   me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummary");
01182   if ( me ) me->Fill(reportSummary);
01183 
01184   char histo[200];
01185 
01186   for (int i = 0; i < 36; i++) {
01187     float reportSummaryEB = -1.0;
01188     if ( nValidChannelsEB[i] != 0 )
01189       reportSummaryEB = 1.0 - float(nGlobalErrorsEB[i])/float(nValidChannelsEB[i]);
01190     sprintf(histo, "EcalBarrel_%s", Numbers::sEB(i+1).c_str());
01191     me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryContents/" + histo);
01192     if ( me ) me->Fill(reportSummaryEB);
01193   }
01194 
01195   me = dqmStore_->get(prefixME_ + "/EventInfo/reportSummaryMap");
01196   if ( me ) {
01197 
01198     int nValidChannelsTT[72][34];
01199     int nGlobalErrorsTT[72][34];
01200     for ( int iettx = 0; iettx < 34; iettx++ ) {
01201       for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
01202         nValidChannelsTT[ipttx][iettx] = 0;
01203         nGlobalErrorsTT[ipttx][iettx] = 0;
01204       }
01205     }
01206 
01207     for ( int iex = 1; iex <= 170; iex++ ) {
01208       for ( int ipx = 1; ipx <= 360; ipx++ ) {
01209 
01210         int iettx = (iex-1)/5+1;
01211         int ipttx = (ipx-1)/5+1;
01212 
01213         float xval = meGlobalSummary_->getBinContent( ipx, iex );
01214 
01215         if ( xval >= 0 && xval <= 5 ) {
01216           if ( xval != 2 && xval != 5 ) ++nValidChannelsTT[ipttx-1][iettx-1];
01217           if ( xval == 0 ) ++nGlobalErrorsTT[ipttx-1][iettx-1];
01218         }
01219 
01220       }
01221     }
01222 
01223     for ( int iettx = 0; iettx < 34; iettx++ ) {
01224       for ( int ipttx = 0; ipttx < 72; ipttx++ ) {
01225 
01226         float xval = -1.0;
01227         if ( nValidChannelsTT[ipttx][iettx] != 0 )
01228           xval = 1.0 - float(nGlobalErrorsTT[ipttx][iettx])/float(nValidChannelsTT[ipttx][iettx]);
01229 
01230         me->setBinContent( ipttx+1, iettx+1, xval );
01231 
01232       }
01233     }
01234 
01235   }
01236 
01237 }
01238 
01239 void EBSummaryClient::softReset(bool flag) {
01240 
01241 }
01242 
01243 void EBSummaryClient::htmlOutput(int run, string& htmlDir, string& htmlName) {
01244 
01245   if ( verbose_ ) cout << "Preparing EBSummaryClient html output ..." << endl;
01246 
01247   ofstream htmlFile;
01248 
01249   htmlFile.open((htmlDir + htmlName).c_str());
01250 
01251   // html page header
01252   htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">  " << endl;
01253   htmlFile << "<html>  " << endl;
01254   htmlFile << "<head>  " << endl;
01255   htmlFile << "  <meta content=\"text/html; charset=ISO-8859-1\"  " << endl;
01256   htmlFile << " https-equiv=\"content-type\">  " << endl;
01257   htmlFile << "  <title>Monitor:Summary output</title> " << endl;
01258   htmlFile << "</head>  " << endl;
01259   htmlFile << "<style type=\"text/css\"> td { font-weight: bold } </style>" << endl;
01260   htmlFile << "<body>  " << endl;
01261   //htmlFile << "<br>  " << endl;
01262   htmlFile << "<a name=""top""></a>" << endl;
01263   htmlFile << "<h2>Run:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" << endl;
01264   htmlFile << "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
01265   htmlFile << " style=\"color: rgb(0, 0, 153);\">" << run << "</span></h2>" << endl;
01266   htmlFile << "<h2>Monitoring task:&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
01267   htmlFile << " style=\"color: rgb(0, 0, 153);\">SUMMARY</span></h2> " << endl;
01268   htmlFile << "<hr>" << endl;
01269   htmlFile << "<table border=1><tr><td bgcolor=red>channel has problems in this task</td>" << endl;
01270   htmlFile << "<td bgcolor=lime>channel has NO problems</td>" << endl;
01271   htmlFile << "<td bgcolor=yellow>channel is missing</td></table>" << endl;
01272   htmlFile << "<br>" << endl;
01273 
01274   // Produce the plots to be shown as .png files from existing histograms
01275 
01276   const int csize = 400;
01277 
01278 //  const double histMax = 1.e15;
01279 
01280   int pCol3[7] = { 301, 302, 303, 304, 305, 306, 307 };
01281   int pCol4[10];
01282   for ( int i = 0; i < 10; i++ ) pCol4[i] = 401+i;
01283 
01284   // dummy histogram labelling the SM's
01285   TH2C labelGrid("labelGrid","label grid for SM", 18, 0., 360., 2, -85., 85.);
01286   for ( short sm=0; sm<36; sm++ ) {
01287     int x = 1 + sm%18;
01288     int y = 1 + sm/18;
01289     labelGrid.SetBinContent(x, y, Numbers::iEB(sm+1));
01290   }
01291   labelGrid.SetMarkerSize(2);
01292   labelGrid.SetMinimum(-18.01);
01293 
01294   TH2C labelGridPN("labelGridPN","label grid for SM", 18, 0., 90., 2, -10., 10.);
01295   for ( short sm=0; sm<36; sm++ ) {
01296     int x = 1 + sm%18;
01297     int y = 1 + sm/18;
01298     labelGridPN.SetBinContent(x, y, Numbers::iEB(sm+1));
01299   }
01300   labelGridPN.SetMarkerSize(4);
01301   labelGridPN.SetMinimum(-18.01);
01302 
01303   TH2C labelGridTT("labelGridTT","label grid for SM", 18, 0., 72., 2, -17., 17.);
01304   for ( short sm=0; sm<36; sm++ ) {
01305     int x = 1 + sm%18;
01306     int y = 1 + sm/18;
01307     labelGridTT.SetBinContent(x, y, Numbers::iEB(sm+1));
01308   }
01309   labelGridTT.SetMarkerSize(2);
01310   labelGridTT.SetMinimum(-18.01);
01311 
01312   string imgNameMapI, imgNameMapO;
01313   string imgNameMapSF;
01314   string imgNameMapPO;
01315   string imgNameMapLL1, imgNameMapLL1_PN;
01316   string imgNameMapP, imgNameMapP_PN;
01317   string imgNameMapTP, imgNameMapTP_PN;
01318   string imgNameMapC;
01319   string imgNameMapTM;
01320   string imgNameMapTTEt;
01321   string imgNameMapTTEmulError;
01322   string imgName, meName;
01323   string imgNameMapGS;
01324 
01325   TCanvas* cMap = new TCanvas("cMap", "Temp", int(360./170.*csize), csize);
01326   TCanvas* cMapPN = new TCanvas("cMapPN", "Temp", int(360./170.*csize), int(20./90.*360./170.*csize));
01327 
01328   float saveHeigth = gStyle->GetTitleH();
01329   gStyle->SetTitleH(0.07);
01330   float saveFontSize = gStyle->GetTitleFontSize();
01331   gStyle->SetTitleFontSize(14);
01332   float saveTitleOffset = gStyle->GetTitleX();
01333 
01334   TH2F* obj2f;
01335 
01336   imgNameMapI = "";
01337 
01338   gStyle->SetPaintTextFormat("+g");
01339 
01340   obj2f = 0;
01341   obj2f = UtilsClient::getHisto<TH2F*>( meIntegrity_ );
01342 
01343   if ( obj2f ) {
01344 
01345     meName = obj2f->GetName();
01346 
01347     replace(meName.begin(), meName.end(), ' ', '_');
01348     imgNameMapI = meName + ".png";
01349     imgName = htmlDir + imgNameMapI;
01350 
01351     cMap->cd();
01352     gStyle->SetOptStat(" ");
01353     gStyle->SetPalette(7, pCol3);
01354     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01355     obj2f->GetYaxis()->SetNdivisions(2);
01356     cMap->SetGridx();
01357     cMap->SetGridy();
01358     obj2f->SetMinimum(-0.00000001);
01359     obj2f->SetMaximum(7.0);
01360     obj2f->GetXaxis()->SetLabelSize(0.03);
01361     obj2f->GetYaxis()->SetLabelSize(0.03);
01362     obj2f->Draw("col");
01363     labelGrid.Draw("text,same");
01364     cMap->Update();
01365     cMap->SaveAs(imgName.c_str());
01366 
01367   }
01368 
01369   imgNameMapO = "";
01370 
01371   obj2f = 0;
01372   obj2f = UtilsClient::getHisto<TH2F*>( meOccupancy_ );
01373 
01374   if ( obj2f ) {
01375 
01376     meName = obj2f->GetName();
01377 
01378     replace(meName.begin(), meName.end(), ' ', '_');
01379     imgNameMapO = meName + ".png";
01380     imgName = htmlDir + imgNameMapO;
01381 
01382     cMap->cd();
01383     gStyle->SetOptStat(" ");
01384     gStyle->SetPalette(10, pCol4);
01385     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01386     obj2f->GetYaxis()->SetNdivisions(2);
01387     cMap->SetGridx();
01388     cMap->SetGridy();
01389     obj2f->SetMinimum(0.0);
01390     obj2f->GetXaxis()->SetLabelSize(0.03);
01391     obj2f->GetYaxis()->SetLabelSize(0.03);
01392     obj2f->GetZaxis()->SetLabelSize(0.03);
01393     obj2f->Draw("colz");
01394     labelGrid.Draw("text,same");
01395     cMap->Update();
01396     cMap->SaveAs(imgName.c_str());
01397 
01398   }
01399 
01400   imgNameMapSF = "";
01401 
01402   gStyle->SetPaintTextFormat("+g");
01403 
01404   obj2f = 0;
01405   obj2f = UtilsClient::getHisto<TH2F*>( meStatusFlags_ );
01406 
01407   if ( obj2f && obj2f->GetEntries() != 0 ) {
01408 
01409     meName = obj2f->GetName();
01410 
01411     replace(meName.begin(), meName.end(), ' ', '_');
01412     imgNameMapSF = meName + ".png";
01413     imgName = htmlDir + imgNameMapSF;
01414 
01415     cMap->cd();
01416     gStyle->SetOptStat(" ");
01417     gStyle->SetPalette(7, pCol3);
01418     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01419     obj2f->GetYaxis()->SetNdivisions(2);
01420     cMap->SetGridx();
01421     cMap->SetGridy();
01422     obj2f->SetMinimum(-0.00000001);
01423     obj2f->SetMaximum(7.0);
01424     obj2f->GetXaxis()->SetLabelSize(0.03);
01425     obj2f->GetYaxis()->SetLabelSize(0.03);
01426     obj2f->Draw("col");
01427     labelGridTT.Draw("text,same");
01428     cMap->Update();
01429     cMap->SaveAs(imgName.c_str());
01430 
01431   }
01432 
01433   imgNameMapPO = "";
01434 
01435   obj2f = 0;
01436   obj2f = UtilsClient::getHisto<TH2F*>( mePedestalOnline_ );
01437 
01438   if ( obj2f && obj2f->GetEntries() != 0 ) {
01439 
01440     meName = obj2f->GetName();
01441 
01442     replace(meName.begin(), meName.end(), ' ', '_');
01443     imgNameMapPO = meName + ".png";
01444     imgName = htmlDir + imgNameMapPO;
01445 
01446     cMap->cd();
01447     gStyle->SetOptStat(" ");
01448     gStyle->SetPalette(7, pCol3);
01449     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01450     obj2f->GetYaxis()->SetNdivisions(2);
01451     cMap->SetGridx();
01452     cMap->SetGridy();
01453     obj2f->SetMinimum(-0.00000001);
01454     obj2f->SetMaximum(7.0);
01455     obj2f->GetXaxis()->SetLabelSize(0.03);
01456     obj2f->GetYaxis()->SetLabelSize(0.03);
01457     obj2f->Draw("col");
01458     labelGrid.Draw("text,same");
01459     cMap->Update();
01460     cMap->SaveAs(imgName.c_str());
01461 
01462   }
01463 
01464   imgNameMapLL1 = "";
01465 
01466   obj2f = 0;
01467   obj2f = UtilsClient::getHisto<TH2F*>( meLaserL1_ );
01468 
01469   if ( obj2f && obj2f->GetEntries() != 0 ) {
01470 
01471     meName = obj2f->GetName();
01472 
01473     replace(meName.begin(), meName.end(), ' ', '_');
01474     imgNameMapLL1 = meName + ".png";
01475     imgName = htmlDir + imgNameMapLL1;
01476 
01477     cMap->cd();
01478     gStyle->SetOptStat(" ");
01479     gStyle->SetPalette(7, pCol3);
01480     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01481     obj2f->GetYaxis()->SetNdivisions(2);
01482     cMap->SetGridx();
01483     cMap->SetGridy();
01484     obj2f->SetMinimum(-0.00000001);
01485     obj2f->SetMaximum(7.0);
01486     obj2f->GetXaxis()->SetLabelSize(0.03);
01487     obj2f->GetYaxis()->SetLabelSize(0.03);
01488     obj2f->Draw("col");
01489     labelGrid.Draw("text,same");
01490     cMap->Update();
01491     cMap->SaveAs(imgName.c_str());
01492 
01493   }
01494 
01495   imgNameMapLL1_PN = "";
01496 
01497   obj2f = 0;
01498   obj2f = UtilsClient::getHisto<TH2F*>( meLaserL1PN_ );
01499 
01500   if ( obj2f && obj2f->GetEntries() != 0 ) {
01501 
01502     meName = obj2f->GetName();
01503 
01504     replace(meName.begin(), meName.end(), ' ', '_');
01505     imgNameMapLL1_PN = meName + ".png";
01506     imgName = htmlDir + imgNameMapLL1_PN;
01507 
01508     cMapPN->cd();
01509     gStyle->SetOptStat(" ");
01510     gStyle->SetPalette(7, pCol3);
01511     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01512     obj2f->GetYaxis()->SetNdivisions(2, kFALSE);
01513     cMapPN->SetGridx();
01514     cMapPN->SetGridy();
01515     obj2f->SetMinimum(-0.00000001);
01516     obj2f->SetMaximum(7.0);
01517     obj2f->GetXaxis()->SetLabelSize(0.07);
01518     obj2f->GetYaxis()->SetLabelSize(0.07);
01519     gStyle->SetTitleX(0.15);
01520     obj2f->Draw("col");
01521     labelGridPN.Draw("text,same");
01522     cMapPN->Update();
01523     cMapPN->SaveAs(imgName.c_str());
01524     gStyle->SetTitleX(saveTitleOffset);
01525   }
01526 
01527   imgNameMapP = "";
01528 
01529   obj2f = 0;
01530   obj2f = UtilsClient::getHisto<TH2F*>( mePedestal_ );
01531 
01532   if ( obj2f && obj2f->GetEntries() != 0 ) {
01533 
01534     meName = obj2f->GetName();
01535 
01536     replace(meName.begin(), meName.end(), ' ', '_');
01537     imgNameMapP = meName + ".png";
01538     imgName = htmlDir + imgNameMapP;
01539 
01540     cMap->cd();
01541     gStyle->SetOptStat(" ");
01542     gStyle->SetPalette(7, pCol3);
01543     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01544     obj2f->GetYaxis()->SetNdivisions(2);
01545     cMap->SetGridx();
01546     cMap->SetGridy();
01547     obj2f->SetMinimum(-0.00000001);
01548     obj2f->SetMaximum(7.0);
01549     obj2f->GetXaxis()->SetLabelSize(0.03);
01550     obj2f->GetYaxis()->SetLabelSize(0.03);
01551     obj2f->Draw("col");
01552     labelGrid.Draw("text,same");
01553     cMap->Update();
01554     cMap->SaveAs(imgName.c_str());
01555 
01556   }
01557 
01558   imgNameMapP_PN = "";
01559 
01560   obj2f = 0;
01561   obj2f = UtilsClient::getHisto<TH2F*>( mePedestalPN_ );
01562 
01563   if ( obj2f && obj2f->GetEntries() != 0 ) {
01564 
01565     meName = obj2f->GetName();
01566 
01567     replace(meName.begin(), meName.end(), ' ', '_');
01568     imgNameMapP_PN = meName + ".png";
01569     imgName = htmlDir + imgNameMapP_PN;
01570 
01571     cMapPN->cd();
01572     gStyle->SetOptStat(" ");
01573     gStyle->SetPalette(7, pCol3);
01574     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01575     obj2f->GetYaxis()->SetNdivisions(2, kFALSE);
01576     cMapPN->SetGridx();
01577     cMapPN->SetGridy();
01578     obj2f->SetMinimum(-0.00000001);
01579     obj2f->SetMaximum(7.0);
01580     obj2f->GetXaxis()->SetLabelSize(0.07);
01581     obj2f->GetYaxis()->SetLabelSize(0.07);
01582     gStyle->SetTitleX(0.15);
01583     obj2f->Draw("col");
01584     labelGridPN.Draw("text,same");
01585     cMapPN->Update();
01586     cMapPN->SaveAs(imgName.c_str());
01587     gStyle->SetTitleX(saveTitleOffset);
01588   }
01589 
01590 
01591   imgNameMapTP = "";
01592 
01593   obj2f = 0;
01594   obj2f = UtilsClient::getHisto<TH2F*>( meTestPulse_ );
01595 
01596   if ( obj2f && obj2f->GetEntries() != 0 ) {
01597 
01598     meName = obj2f->GetName();
01599 
01600     replace(meName.begin(), meName.end(), ' ', '_');
01601     imgNameMapTP = meName + ".png";
01602     imgName = htmlDir + imgNameMapTP;
01603 
01604     cMap->cd();
01605     gStyle->SetOptStat(" ");
01606     gStyle->SetPalette(7, pCol3);
01607     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01608     obj2f->GetYaxis()->SetNdivisions(2);
01609     cMap->SetGridx();
01610     cMap->SetGridy();
01611     obj2f->SetMinimum(-0.00000001);
01612     obj2f->SetMaximum(7.0);
01613     obj2f->GetXaxis()->SetLabelSize(0.03);
01614     obj2f->GetYaxis()->SetLabelSize(0.03);
01615     obj2f->Draw("col");
01616     labelGrid.Draw("text,same");
01617     cMap->Update();
01618     cMap->SaveAs(imgName.c_str());
01619 
01620   }
01621 
01622   imgNameMapTP_PN = "";
01623 
01624   obj2f = 0;
01625   obj2f = UtilsClient::getHisto<TH2F*>( meTestPulsePN_ );
01626 
01627   if ( obj2f && obj2f->GetEntries() != 0 ) {
01628 
01629     meName = obj2f->GetName();
01630 
01631     replace(meName.begin(), meName.end(), ' ', '_');
01632     imgNameMapTP_PN = meName + ".png";
01633     imgName = htmlDir + imgNameMapTP_PN;
01634 
01635     cMapPN->cd();
01636     gStyle->SetOptStat(" ");
01637     gStyle->SetPalette(7, pCol3);
01638     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01639     obj2f->GetYaxis()->SetNdivisions(2);
01640     cMapPN->SetGridx();
01641     cMapPN->SetGridy();
01642     obj2f->SetMinimum(-0.00000001);
01643     obj2f->SetMaximum(7.0);
01644     obj2f->GetXaxis()->SetLabelSize(0.07);
01645     obj2f->GetYaxis()->SetLabelSize(0.07);
01646     gStyle->SetTitleX(0.15);
01647     obj2f->Draw("col");
01648     labelGridPN.Draw("text,same");
01649     cMapPN->Update();
01650     cMapPN->SaveAs(imgName.c_str());
01651     gStyle->SetTitleX(saveTitleOffset);
01652   }
01653 
01654   imgNameMapC = "";
01655 
01656   obj2f = 0;
01657   obj2f = UtilsClient::getHisto<TH2F*>( meCosmic_ );
01658 
01659   if ( obj2f && obj2f->GetEntries() != 0 ) {
01660 
01661     meName = obj2f->GetName();
01662 
01663     replace(meName.begin(), meName.end(), ' ', '_');
01664     imgNameMapC = meName + ".png";
01665     imgName = htmlDir + imgNameMapC;
01666 
01667     cMap->cd();
01668     gStyle->SetOptStat(" ");
01669     gStyle->SetPalette(10, pCol4);
01670     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01671     obj2f->GetYaxis()->SetNdivisions(2);
01672     cMap->SetGridx();
01673     cMap->SetGridy();
01674     obj2f->SetMinimum(0.0);
01675     obj2f->GetXaxis()->SetLabelSize(0.03);
01676     obj2f->GetYaxis()->SetLabelSize(0.03);
01677     obj2f->GetZaxis()->SetLabelSize(0.03);
01678     obj2f->Draw("colz");
01679     labelGrid.Draw("text,same");
01680     cMap->Update();
01681     cMap->SaveAs(imgName.c_str());
01682 
01683   }
01684 
01685   imgNameMapTM = "";
01686 
01687   obj2f = 0;
01688   obj2f = UtilsClient::getHisto<TH2F*>( meTiming_ );
01689 
01690   if ( obj2f && obj2f->GetEntries() != 0 ) {
01691 
01692     meName = obj2f->GetName();
01693 
01694     replace(meName.begin(), meName.end(), ' ', '_');
01695     imgNameMapTM = meName + ".png";
01696     imgName = htmlDir + imgNameMapTM;
01697 
01698     cMap->cd();
01699     gStyle->SetOptStat(" ");
01700     gStyle->SetPalette(7, pCol3);
01701     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01702     obj2f->GetYaxis()->SetNdivisions(2);
01703     cMap->SetGridx();
01704     cMap->SetGridy();
01705     obj2f->SetMinimum(-0.00000001);
01706     obj2f->SetMaximum(7.0);
01707     obj2f->GetXaxis()->SetLabelSize(0.03);
01708     obj2f->GetYaxis()->SetLabelSize(0.03);
01709     obj2f->Draw("col");
01710     labelGrid.Draw("text,same");
01711     cMap->Update();
01712     cMap->SaveAs(imgName.c_str());
01713 
01714   }
01715 
01716   imgNameMapTTEmulError = "";
01717 
01718   obj2f = 0;
01719   obj2f = UtilsClient::getHisto<TH2F*>( meTriggerTowerEmulError_ );
01720 
01721   if ( obj2f && obj2f->GetEntries() != 0 ) {
01722 
01723     meName = obj2f->GetName();
01724 
01725     replace(meName.begin(), meName.end(), ' ', '_');
01726     imgNameMapTTEmulError = meName + ".png";
01727     imgName = htmlDir + imgNameMapTTEmulError;
01728 
01729     cMap->cd();
01730     gStyle->SetOptStat(" ");
01731     gStyle->SetPalette(7, pCol3);
01732     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01733     obj2f->GetYaxis()->SetNdivisions(2);
01734     cMap->SetGridx();
01735     cMap->SetGridy();
01736     obj2f->SetMinimum(-0.00000001);
01737     obj2f->SetMaximum(7.0);
01738     obj2f->GetXaxis()->SetLabelSize(0.03);
01739     obj2f->GetYaxis()->SetLabelSize(0.03);
01740     obj2f->Draw("col");
01741     labelGridTT.Draw("text,same");
01742     cMap->Update();
01743     cMap->SaveAs(imgName.c_str());
01744 
01745   }
01746 
01747   imgNameMapTTEt = "";
01748 
01749   obj2f = 0;
01750   obj2f = UtilsClient::getHisto<TH2F*>( meTriggerTowerEt_ );
01751 
01752   if ( obj2f && obj2f->GetEntries() != 0 ) {
01753 
01754     meName = obj2f->GetName();
01755 
01756     replace(meName.begin(), meName.end(), ' ', '_');
01757     imgNameMapTTEt = meName + ".png";
01758     imgName = htmlDir + imgNameMapTTEt;
01759 
01760     cMap->cd();
01761     gStyle->SetOptStat(" ");
01762     gStyle->SetPalette(10, pCol4);
01763     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01764     obj2f->GetYaxis()->SetNdivisions(2);
01765     cMap->SetGridx();
01766     cMap->SetGridy();
01767     obj2f->SetMinimum(0.0);
01768     obj2f->GetXaxis()->SetLabelSize(0.03);
01769     obj2f->GetYaxis()->SetLabelSize(0.03);
01770     obj2f->GetZaxis()->SetLabelSize(0.03);
01771     obj2f->Draw("colz");
01772     labelGridTT.Draw("text,same");
01773     cMap->Update();
01774     cMap->SaveAs(imgName.c_str());
01775 
01776   }
01777 
01778   imgNameMapGS = "";
01779 
01780   obj2f = 0;
01781   obj2f = UtilsClient::getHisto<TH2F*>( meGlobalSummary_ );
01782 
01783   if ( obj2f ) {
01784 
01785     meName = obj2f->GetName();
01786 
01787     replace(meName.begin(), meName.end(), ' ', '_');
01788     imgNameMapGS = meName + ".png";
01789     imgName = htmlDir + imgNameMapGS;
01790 
01791     cMap->cd();
01792     gStyle->SetOptStat(" ");
01793     gStyle->SetPalette(7, pCol3);
01794     obj2f->GetXaxis()->SetNdivisions(18, kFALSE);
01795     obj2f->GetYaxis()->SetNdivisions(2);
01796     cMap->SetGridx();
01797     cMap->SetGridy();
01798     obj2f->SetMinimum(-0.00000001);
01799     obj2f->SetMaximum(7.0);
01800     obj2f->GetXaxis()->SetLabelSize(0.03);
01801     obj2f->GetYaxis()->SetLabelSize(0.03);
01802     obj2f->Draw("col");
01803     labelGrid.Draw("text,same");
01804     cMap->Update();
01805     cMap->SaveAs(imgName.c_str());
01806 
01807   }
01808 
01809 
01810   gStyle->SetPaintTextFormat();
01811 
01812   if ( imgNameMapI.size() != 0 ) {
01813     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01814     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01815     htmlFile << "<tr align=\"center\">" << endl;
01816     htmlFile << "<td><img src=\"" << imgNameMapI << "\" usemap=\"#Integrity\" border=0></td>" << endl;
01817     htmlFile << "</tr>" << endl;
01818     htmlFile << "</table>" << endl;
01819     htmlFile << "<br>" << endl;
01820   }
01821 
01822   if ( imgNameMapO.size() != 0 ) {
01823     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01824     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01825     htmlFile << "<tr align=\"center\">" << endl;
01826     htmlFile << "<td><img src=\"" << imgNameMapO << "\" usemap=\"#Occupancy\" border=0></td>" << endl;
01827     htmlFile << "</tr>" << endl;
01828     htmlFile << "</table>" << endl;
01829     htmlFile << "<br>" << endl;
01830   }
01831 
01832   if ( imgNameMapSF.size() != 0 ) {
01833     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01834     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01835     htmlFile << "<tr align=\"center\">" << endl;
01836     htmlFile << "<td><img src=\"" << imgNameMapSF << "\" usemap=\"#StatusFlags\" border=0></td>" << endl;
01837     htmlFile << "</tr>" << endl;
01838     htmlFile << "</table>" << endl;
01839     htmlFile << "<br>" << endl;
01840   }
01841 
01842   if ( imgNameMapPO.size() != 0 ) {
01843     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01844     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01845     htmlFile << "<tr align=\"center\">" << endl;
01846     htmlFile << "<td><img src=\"" << imgNameMapPO << "\" usemap=\"#PedestalOnline\" border=0></td>" << endl;
01847     htmlFile << "</tr>" << endl;
01848     htmlFile << "</table>" << endl;
01849     htmlFile << "<br>" << endl;
01850   }
01851 
01852   if ( imgNameMapLL1.size() != 0 ) {
01853     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01854     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01855     htmlFile << "<tr align=\"center\">" << endl;
01856     htmlFile << "<td><img src=\"" << imgNameMapLL1 << "\" usemap=\"#LaserL1\" border=0></td>" << endl;
01857     htmlFile << "</tr>" << endl;
01858     htmlFile << "</table>" << endl;
01859     htmlFile << "<br>" << endl;
01860   }
01861 
01862   if ( imgNameMapLL1_PN.size() != 0 ) {
01863     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01864     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01865     htmlFile << "<tr align=\"center\">" << endl;
01866     htmlFile << "<td><img src=\"" << imgNameMapLL1_PN << "\" border=0></td>" << endl;
01867     htmlFile << "</tr>" << endl;
01868     htmlFile << "</table>" << endl;
01869     htmlFile << "<br>" << endl;
01870   }
01871 
01872   if ( imgNameMapP.size() != 0 ) {
01873     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01874     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01875     htmlFile << "<tr align=\"center\">" << endl;
01876     htmlFile << "<td><img src=\"" << imgNameMapP << "\" usemap=\"#Pedestal\" border=0></td>" << endl;
01877     htmlFile << "</tr>" << endl;
01878     htmlFile << "</table>" << endl;
01879     htmlFile << "<br>" << endl;
01880   }
01881 
01882   if ( imgNameMapP_PN.size() != 0 ) {
01883     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01884     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01885     htmlFile << "<tr align=\"center\">" << endl;
01886     htmlFile << "<td><img src=\"" << imgNameMapP_PN << "\" border=0></td>" << endl;
01887     htmlFile << "</tr>" << endl;
01888     htmlFile << "</table>" << endl;
01889     htmlFile << "<br>" << endl;
01890   }
01891 
01892   if ( imgNameMapTP.size() != 0 ) {
01893     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01894     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01895     htmlFile << "<tr align=\"center\">" << endl;
01896     htmlFile << "<td><img src=\"" << imgNameMapTP << "\" usemap=\"#TestPulse\" border=0></td>" << endl;
01897     htmlFile << "</tr>" << endl;
01898     htmlFile << "</table>" << endl;
01899     htmlFile << "<br>" << endl;
01900   }
01901 
01902   if ( imgNameMapTP_PN.size() != 0 ) {
01903     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01904     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01905     htmlFile << "<tr align=\"center\">" << endl;
01906     htmlFile << "<td><img src=\"" << imgNameMapTP_PN << "\" border=0></td>" << endl;
01907     htmlFile << "</tr>" << endl;
01908     htmlFile << "</table>" << endl;
01909     htmlFile << "<br>" << endl;
01910   }
01911 
01912   if ( imgNameMapC.size() != 0 ) {
01913     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01914     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01915     htmlFile << "<tr align=\"center\">" << endl;
01916     htmlFile << "<td><img src=\"" << imgNameMapC << "\" usemap=\"#Cosmic\" border=0></td>" << endl;
01917     htmlFile << "</tr>" << endl;
01918     htmlFile << "</table>" << endl;
01919     htmlFile << "<br>" << endl;
01920   }
01921 
01922   if ( imgNameMapTM.size() != 0 ) {
01923     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01924     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01925     htmlFile << "<tr align=\"center\">" << endl;
01926     htmlFile << "<td><img src=\"" << imgNameMapTM << "\" usemap=\"#Timing\" border=0></td>" << endl;
01927     htmlFile << "</tr>" << endl;
01928     htmlFile << "</table>" << endl;
01929     htmlFile << "<br>" << endl;
01930   }
01931 
01932   if ( imgNameMapTTEmulError.size() != 0 ) {
01933     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01934     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01935     htmlFile << "<tr align=\"center\">" << endl;
01936     htmlFile << "<td><img src=\"" << imgNameMapTTEmulError << "\" usemap=\"#TriggerTower\" border=0></td>" << endl;
01937     htmlFile << "</tr>" << endl;
01938     htmlFile << "</table>" << endl;
01939     htmlFile << "<br>" << endl;
01940   }
01941 
01942   if ( imgNameMapTTEt.size() != 0 ) {
01943     htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
01944     htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
01945     htmlFile << "<tr align=\"center\">" << endl;
01946     htmlFile << "<td><img src=\"" << imgNameMapTTEt << "\" usemap=\"#TriggerTower\" border=0></td>" << endl;
01947     htmlFile << "</tr>" << endl;
01948     htmlFile << "</table>" << endl;
01949     htmlFile << "<br>" << endl;
01950   }
01951 
01952   delete cMap;
01953   delete cMapPN;
01954 
01955   gStyle->SetPaintTextFormat();
01956 
01957   if ( imgNameMapI.size() != 0 ) this->writeMap( htmlFile, "Integrity" );
01958   if ( imgNameMapO.size() != 0 ) this->writeMap( htmlFile, "Occupancy" );
01959   if ( imgNameMapSF.size() != 0 ) this->writeMap( htmlFile, "StatusFlags" );
01960   if ( imgNameMapPO.size() != 0 ) this->writeMap( htmlFile, "PedestalOnline" );
01961   if ( imgNameMapLL1.size() != 0 ) this->writeMap( htmlFile, "LaserL1" );
01962   if ( imgNameMapP.size() != 0 ) this->writeMap( htmlFile, "Pedestal" );
01963   if ( imgNameMapTP.size() != 0 ) this->writeMap( htmlFile, "TestPulse" );
01964 
01965   if ( imgNameMapC.size() != 0 ) this->writeMap( htmlFile, "Cosmic" );
01966   if ( imgNameMapTM.size() != 0 ) this->writeMap( htmlFile, "Timing" );
01967   if ( imgNameMapTTEt.size() != 0 ) this->writeMap( htmlFile, "TriggerTower" );
01968   if ( imgNameMapTTEmulError.size() != 0 ) this->writeMap( htmlFile, "TriggerTower" );
01969 
01970   // html page footer
01971   htmlFile << "</body> " << endl;
01972   htmlFile << "</html> " << endl;
01973 
01974   htmlFile.close();
01975 
01976   gStyle->SetTitleH( saveHeigth );
01977   gStyle->SetTitleFontSize( saveFontSize );
01978 
01979 }
01980 
01981 void EBSummaryClient::writeMap( ofstream& hf, const char* mapname ) {
01982 
01983   map<string, string> refhtml;
01984   refhtml["Integrity"] = "EBIntegrityClient.html";
01985   refhtml["Occupancy"] = "EBIntegrityClient.html";
01986   refhtml["StatusFlags"] = "EBStatusFlagsClient.html";
01987   refhtml["PedestalOnline"] = "EBPedestalOnlineClient.html";
01988   refhtml["LaserL1"] = "EBLaserClient.html";
01989   refhtml["Pedestal"] = "EBPedestalClient.html";
01990   refhtml["TestPulse"] = "EBTestPulseClient.html";
01991 
01992   refhtml["Cosmic"] = "EBCosmicClient.html";
01993   refhtml["Timing"] = "EBTimingClient.html";
01994   refhtml["TriggerTower"] = "EBTriggerTowerClient.html";
01995 
01996   const int A0 =  85;
01997   const int A1 = 759;
01998   const int B0 =  35;
01999   const int B1 = 334;
02000 
02001   hf << "<map name=\"" << mapname << "\">" << endl;
02002   for( unsigned int sm=0; sm<superModules_.size(); sm++ ) {
02003     int i=(superModules_[sm]-1)/18;
02004     int j=(superModules_[sm]-1)%18;
02005     int x0 = A0 + (A1-A0)*j/18;
02006     int x1 = A0 + (A1-A0)*(j+1)/18;
02007     int y0 = B0 + (B1-B0)*(1-i)/2;
02008     int y1 = B0 + (B1-B0)*((1-i)+1)/2;
02009     hf << "<area title=\"" << Numbers::sEB(superModules_[sm])
02010        << "\" shape=\"rect\" href=\"" << refhtml[mapname]
02011        << "#" << Numbers::sEB(superModules_[sm])
02012        << "\" coords=\"" << x0 << ", " << y0 << ", "
02013                          << x1 << ", " << y1 << "\">"
02014        << endl;
02015   }
02016   hf << "</map>" << endl;
02017 
02018 }
02019 

Generated on Tue Jun 9 17:32:44 2009 for CMSSW by  doxygen 1.5.4