CMS 3D CMS Logo

EBBeamHodoClient.cc

Go to the documentation of this file.
00001 /*
00002  * \file EBBeamHodoClient.cc
00003  *
00004  * $Date: 2008/06/25 15:08:18 $
00005  * $Revision: 1.67 $
00006  * \author G. Della Ricca
00007  * \author G. Franzoni
00008  *
00009 */
00010 
00011 #include <memory>
00012 #include <iostream>
00013 #include <fstream>
00014 
00015 #include "TCanvas.h"
00016 #include "TStyle.h"
00017 
00018 #include "DQMServices/Core/interface/DQMStore.h"
00019 
00020 #include "DQM/EcalCommon/interface/UtilsClient.h"
00021 #include "DQM/EcalCommon/interface/Numbers.h"
00022 
00023 #include <DQM/EcalBarrelMonitorClient/interface/EBBeamHodoClient.h>
00024 
00025 using namespace cms;
00026 using namespace edm;
00027 using namespace std;
00028 
00029 EBBeamHodoClient::EBBeamHodoClient(const ParameterSet& ps) {
00030 
00031   // cloneME switch
00032   cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
00033 
00034   // verbose switch
00035   verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
00036 
00037   // debug switch
00038   debug_ = ps.getUntrackedParameter<bool>("debug", false);
00039 
00040   // prefixME path
00041   prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
00042 
00043   // enableCleanup_ switch
00044   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00045 
00046   // vector of selected Super Modules (Defaults to all 36).
00047   superModules_.reserve(36);
00048   for ( unsigned int i = 1; i <= 36; i++ ) superModules_.push_back(i);
00049   superModules_ = ps.getUntrackedParameter<vector<int> >("superModules", superModules_);
00050 
00051   for (int i=0; i<4; i++) {
00052 
00053     ho01_[i] = 0;
00054     hr01_[i] = 0;
00055 
00056   }
00057 
00058   hp01_[0] = 0;
00059   hp01_[1] = 0;
00060 
00061   hp02_ = 0;
00062 
00063   hs01_[0] = 0;
00064   hs01_[1] = 0;
00065 
00066   hq01_[0] = 0;
00067   hq01_[1] = 0;
00068 
00069   ht01_ = 0;
00070 
00071   hc01_[0] = 0;
00072   hc01_[1] = 0;
00073   hc01_[2] = 0;
00074 
00075   hm01_    = 0;
00076 
00077   he01_[0] = 0;
00078   he01_[1] = 0;
00079 
00080   he02_[0] = 0;
00081   he02_[1] = 0;
00082 
00083   he03_[0] = 0;
00084   he03_[1] = 0;
00085   he03_[2] = 0;
00086 
00087 }
00088 
00089 EBBeamHodoClient::~EBBeamHodoClient() {
00090 
00091 }
00092 
00093 void EBBeamHodoClient::beginJob(DQMStore* dqmStore) {
00094 
00095   dqmStore_ = dqmStore;
00096 
00097   if ( debug_ ) cout << "EBBeamHodoClient: beginJob" << endl;
00098 
00099   ievt_ = 0;
00100   jevt_ = 0;
00101 
00102 }
00103 
00104 void EBBeamHodoClient::beginRun(void) {
00105 
00106   if ( debug_ ) cout << "EBBeamHodoClient: beginRun" << endl;
00107 
00108   jevt_ = 0;
00109 
00110   this->setup();
00111 
00112 }
00113 
00114 void EBBeamHodoClient::endJob(void) {
00115 
00116   if ( debug_ ) cout << "EBBeamHodoClient: endJob, ievt = " << ievt_ << endl;
00117 
00118   this->cleanup();
00119 
00120   if ( cloneME_ ) {
00121 
00122     for (int i=0; i<4; i++) {
00123 
00124       if ( ho01_[i] ) delete ho01_[i];
00125       if ( hr01_[i] ) delete hr01_[i];
00126 
00127     }
00128 
00129     if ( hp01_[0] ) delete hp01_[0];
00130     if ( hp01_[1] ) delete hp01_[1];
00131 
00132     if ( hp02_ ) delete hp02_;
00133 
00134     if ( hs01_[0] ) delete hs01_[0];
00135     if ( hs01_[1] ) delete hs01_[1];
00136 
00137     if ( hq01_[0] ) delete hq01_[0];
00138     if ( hq01_[1] ) delete hq01_[1];
00139 
00140     if ( ht01_ ) delete ht01_;
00141 
00142     if ( hc01_[0] ) delete hc01_[0];
00143     if ( hc01_[1] ) delete hc01_[1];
00144     if ( hc01_[2] ) delete hc01_[2];
00145 
00146     if ( hm01_ )    delete hm01_;
00147 
00148     if ( he01_[0] ) delete he01_[0];
00149     if ( he01_[1] ) delete he01_[1];
00150 
00151     if ( he02_[0] ) delete he02_[0];
00152     if ( he02_[1] ) delete he02_[1];
00153 
00154     if ( he03_[0] ) delete he03_[0];
00155     if ( he03_[1] ) delete he03_[1];
00156     if ( he03_[2] ) delete he03_[2];
00157 
00158   }
00159 
00160   for (int i=0; i<4; i++) {
00161 
00162     ho01_[i] = 0;
00163     hr01_[i] = 0;
00164 
00165   }
00166 
00167   hp01_[0] = 0;
00168   hp01_[1] = 0;
00169 
00170   hp02_ = 0;
00171 
00172   hs01_[0] = 0;
00173   hs01_[1] = 0;
00174 
00175   hq01_[0] = 0;
00176   hq01_[1] = 0;
00177 
00178   ht01_ = 0;
00179 
00180   hc01_[0] = 0;
00181   hc01_[1] = 0;
00182   hc01_[2] = 0;
00183 
00184   hm01_    = 0;
00185 
00186   he01_[0] = 0;
00187   he01_[1] = 0;
00188 
00189   he02_[0] = 0;
00190   he02_[1] = 0;
00191 
00192   he03_[0] = 0;
00193   he03_[1] = 0;
00194   he03_[2] = 0;
00195 
00196 }
00197 
00198 void EBBeamHodoClient::endRun(void) {
00199 
00200   if ( debug_ ) cout << "EBBeamHodoClient: endRun, jevt = " << jevt_ << endl;
00201 
00202   this->cleanup();
00203 
00204 }
00205 
00206 void EBBeamHodoClient::setup(void) {
00207 
00208   dqmStore_->setCurrentFolder( prefixME_ + "/EBBeamHodoClient" );
00209 
00210 }
00211 
00212 void EBBeamHodoClient::cleanup(void) {
00213 
00214   if ( ! enableCleanup_ ) return;
00215 
00216   dqmStore_->setCurrentFolder( prefixME_ + "/EBBeamHodoClient" );
00217 
00218 }
00219 
00220 bool EBBeamHodoClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status, bool flag) {
00221 
00222   status = true;
00223 
00224   if ( ! flag ) return false;
00225 
00226   return true;
00227 
00228 }
00229 
00230 void EBBeamHodoClient::analyze(void) {
00231 
00232   ievt_++;
00233   jevt_++;
00234   if ( ievt_ % 10 == 0 ) {
00235     if ( debug_ ) cout << "EBBeamHodoClient: ievt/jevt = " << ievt_ << "/" << jevt_ << endl;
00236   }
00237 
00238   int smId = 1;
00239 
00240   char histo[200];
00241 
00242   MonitorElement* me;
00243 
00244   for (int i=0; i<4; i++) {
00245 
00246     sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT occup %s %02d").c_str(), Numbers::sEB(smId).c_str(), i+1);
00247     me = dqmStore_->get(histo);
00248     ho01_[i] = UtilsClient::getHisto<TH1F*>( me, cloneME_, ho01_[i] );
00249 
00250     sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT raw %s %02d").c_str(), Numbers::sEB(smId).c_str(), i+1);
00251     me = dqmStore_->get(histo);
00252     hr01_[i] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hr01_[i] );
00253 
00254   }
00255 
00256   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT PosX rec %s").c_str(), Numbers::sEB(smId).c_str());
00257   me = dqmStore_->get(histo);
00258   hp01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hp01_[0] );
00259 
00260   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT PosY rec %s").c_str(), Numbers::sEB(smId).c_str());
00261   me = dqmStore_->get(histo);
00262   hp01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hp01_[1] );
00263 
00264   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT PosYX rec %s").c_str(), Numbers::sEB(smId).c_str());
00265   me = dqmStore_->get(histo);
00266   hp02_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, hp02_ );
00267 
00268   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT SloX %s").c_str(), Numbers::sEB(smId).c_str());
00269   me = dqmStore_->get(histo);
00270   hs01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hs01_[0] );
00271 
00272   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT SloY %s").c_str(), Numbers::sEB(smId).c_str());
00273   me = dqmStore_->get(histo);
00274   hs01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hs01_[1] );
00275 
00276   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT QualX %s").c_str(), Numbers::sEB(smId).c_str());
00277   me = dqmStore_->get(histo);
00278   hq01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hq01_[0] );
00279 
00280   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT QualY %s").c_str(), Numbers::sEB(smId).c_str());
00281   me = dqmStore_->get(histo);
00282   hq01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hq01_[1] );
00283 
00284   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT TDC rec %s").c_str(), Numbers::sEB(smId).c_str());
00285   me = dqmStore_->get(histo);
00286   ht01_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, ht01_ );
00287 
00288   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT Hodo-Calo X vs Cry %s").c_str(), Numbers::sEB(smId).c_str());
00289   me = dqmStore_->get(histo);
00290   hc01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hc01_[0] );
00291 
00292   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT Hodo-Calo Y vs Cry %s").c_str(), Numbers::sEB(smId).c_str());
00293   me = dqmStore_->get(histo);
00294   hc01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hc01_[1] );
00295 
00296   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT TDC-Calo vs Cry %s").c_str(), Numbers::sEB(smId).c_str());
00297   me = dqmStore_->get(histo);
00298   hc01_[2] = UtilsClient::getHisto<TH1F*>( me, cloneME_, hc01_[2] );
00299 
00300   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT Missing Collections %s").c_str(), Numbers::sEB(smId).c_str());
00301   me = dqmStore_->get(histo);
00302   hm01_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hm01_ );
00303 
00304   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT prof E1 vs X %s").c_str(), Numbers::sEB(smId).c_str());
00305   me = dqmStore_->get(histo);
00306   he01_[0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, he01_[0] );
00307 
00308   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT prof E1 vs Y %s").c_str(), Numbers::sEB(smId).c_str());
00309   me = dqmStore_->get(histo);
00310   he01_[1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, he01_[1] );
00311 
00312   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT his E1 vs X %s").c_str(), Numbers::sEB(smId).c_str());
00313   me = dqmStore_->get(histo);
00314   he02_[0] = UtilsClient::getHisto<TH2F*>( me, cloneME_, he02_[0] );
00315 
00316   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT his E1 vs Y %s").c_str(), Numbers::sEB(smId).c_str());
00317   me = dqmStore_->get(histo);
00318   he02_[1] = UtilsClient::getHisto<TH2F*>( me, cloneME_, he02_[1] );
00319 
00320   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT PosX Hodo-Calo %s").c_str(), Numbers::sEB(smId).c_str());
00321   me = dqmStore_->get(histo);
00322   he03_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, he03_[0] );
00323 
00324   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT PosY Hodo-Calo %s").c_str(), Numbers::sEB(smId).c_str());
00325   me = dqmStore_->get(histo);
00326   he03_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, he03_[1] );
00327 
00328   sprintf(histo, (prefixME_ + "/EBBeamHodoTask/EBBHT TimeMax TDC-Calo %s").c_str(), Numbers::sEB(smId).c_str());
00329   me = dqmStore_->get(histo);
00330   he03_[2] = UtilsClient::getHisto<TH1F*>( me, cloneME_, he03_[2] );
00331 
00332 }
00333 
00334 void EBBeamHodoClient::softReset(bool flag) {
00335 
00336 }
00337 
00338 void EBBeamHodoClient::htmlOutput(int run, string& htmlDir, string& htmlName) {
00339 
00340   if ( verbose_ ) cout << "Preparing EBBeamHodoClient html output ..." << endl;
00341 
00342   ofstream htmlFile;
00343 
00344   htmlFile.open((htmlDir + htmlName).c_str());
00345 
00346   // html page header
00347   htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">  " << endl;
00348   htmlFile << "<html>  " << endl;
00349   htmlFile << "<head>  " << endl;
00350   htmlFile << "  <meta content=\"text/html; charset=ISO-8859-1\"  " << endl;
00351   htmlFile << " https-equiv=\"content-type\">  " << endl;
00352   htmlFile << "  <title>Monitor:BeamTask output</title> " << endl;
00353   htmlFile << "</head>  " << endl;
00354   htmlFile << "<style type=\"text/css\"> td { font-weight: bold } </style>" << endl;
00355   htmlFile << "<body>  " << endl;
00356   htmlFile << "<br>  " << endl;
00357   htmlFile << "<h2>Run:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" << endl;
00358   htmlFile << "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
00359   htmlFile << " style=\"color: rgb(0, 0, 153);\">" << run << "</span></h2>" << endl;
00360   htmlFile << "<h2>Monitoring task:&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
00361   htmlFile << " style=\"color: rgb(0, 0, 153);\">BeamHodo</span></h2> " << endl;
00362   htmlFile << "<hr>" << endl;
00363 
00364   // Produce the plots to be shown as .png files from existing histograms
00365 
00366   // html page footer
00367   htmlFile << "</body> " << endl;
00368   htmlFile << "</html> " << endl;
00369 
00370   htmlFile <<  "<a href=\"#Hodo_raw\"> Hodoscope raw </a>" << endl;
00371   htmlFile << "<p>" << endl;
00372   htmlFile <<  "<a href=\"#Hodo_reco\"> Hodoscope reco </a>" << endl;
00373   htmlFile << "<p>" << endl;
00374   htmlFile <<  "<a href=\"#Hodo-Calo\"> Hodo-Calo </a>" << endl;
00375   htmlFile << "<p>" << endl;
00376   htmlFile <<  "<a href=\"#eneVspos\"> Energy vs position </a>" << endl;
00377   htmlFile << "<p>" << endl;
00378   htmlFile <<  "<a href=\"#missingColl\"> Missing collections </a>" << endl;
00379   htmlFile << "<p>" << endl;
00380 
00381   htmlFile << "<hr>" << endl;
00382   htmlFile << "<p>" << endl;
00383 
00384   htmlFile << "<br>" << endl;
00385   htmlFile <<  "<a name=\"Hodo_raw\"> <B> Hodoscope raw plots </B> </a> " << endl;
00386   htmlFile << "</br>" << endl;
00387 
00388 
00389   const int csize = 250;
00390 
00391   const double histMax = 1.e15;
00392 
00393   int pCol4[10];
00394   for ( int i = 0; i < 10; i++ ) pCol4[i] = 401+i;
00395 
00396   TH2C dummy( "dummy", "dummy for sm", 85, 0., 85., 20, 0., 20. );
00397   for ( int i = 0; i < 68; i++ ) {
00398     int a = 2 + ( i/4 ) * 5;
00399     int b = 2 + ( i%4 ) * 5;
00400     dummy.Fill( a, b, i+1 );
00401   }
00402   dummy.SetMarkerSize(2);
00403   dummy.SetMinimum(0.1);
00404 
00405   string imgNameP, imgNameR, imgName, meName;
00406 
00407   TCanvas* cP = new TCanvas("cP", "Temp", csize, csize);
00408 
00409   TH1F* obj1f;
00410   TH2F* obj2f;
00411   TProfile* objp;
00412 
00413   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00414   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00415   htmlFile << "<tr align=\"center\">" << endl;
00416 
00417   for (int i=0; i<4; i++) {
00418 
00419     imgNameP = "";
00420 
00421     obj1f = ho01_[i];
00422 
00423     if ( obj1f ) {
00424 
00425       meName = obj1f->GetName();
00426 
00427       replace(meName.begin(), meName.end(), ' ', '_');
00428       imgNameP = meName + ".png";
00429       imgName = htmlDir + imgNameP;
00430 
00431       cP->cd();
00432       gStyle->SetOptStat("euomr");
00433       obj1f->SetStats(kTRUE);
00434       gPad->SetLogy(kFALSE);
00435       obj1f->Draw();
00436       cP->Update();
00437       cP->SaveAs(imgName.c_str());
00438       gPad->SetLogy(kFALSE);
00439 
00440     }
00441 
00442     imgNameR = "";
00443 
00444     obj1f = hr01_[i];
00445 
00446     if ( obj1f ) {
00447 
00448       meName = obj1f->GetName();
00449 
00450       replace(meName.begin(), meName.end(), ' ', '_');
00451       imgNameR = meName + ".png";
00452       imgName = htmlDir + imgNameR;
00453 
00454       cP->cd();
00455       gStyle->SetOptStat("euomr");
00456       obj1f->SetStats(kTRUE);
00457       if ( obj1f->GetMaximum(histMax) > 0. ) {
00458         gPad->SetLogy(kTRUE);
00459       } else {
00460         gPad->SetLogy(kFALSE);
00461       }
00462       obj1f->Draw();
00463       cP->Update();
00464       cP->SaveAs(imgName.c_str());
00465       gPad->SetLogy(kFALSE);
00466 
00467     }
00468 
00469     if ( imgNameP.size() != 0 )
00470       htmlFile << "<td><img src=\"" << imgNameP << "\"></td>" << endl;
00471     else
00472       htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00473 
00474     if ( imgNameR.size() != 0 )
00475       htmlFile << "<td><img src=\"" << imgNameR << "\"></td>" << endl;
00476     else
00477       htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00478 
00479     if ( i == 1 ) {
00480       htmlFile << "</tr>" << endl;
00481       htmlFile << "<tr align=\"center\">" << endl;
00482     }
00483 
00484   }
00485 
00486   htmlFile << "</tr>" << endl;
00487   htmlFile << "</table>" << endl;
00488   htmlFile << "<br>" << endl;
00489 
00490   htmlFile << "<br>" << endl;
00491   htmlFile <<  "<a name=\"Hodo_reco\"> <B> Hodoscope reco plots </B> </a> " << endl;
00492   htmlFile << "</br>" << endl;
00493 
00494 
00495   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00496   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00497   htmlFile << "<tr align=\"center\">" << endl;
00498 
00499   for (int i=0; i<2; i++) {
00500 
00501     imgNameP = "";
00502 
00503     obj1f = hp01_[i];
00504 
00505     if ( obj1f ) {
00506 
00507       meName = obj1f->GetName();
00508 
00509       replace(meName.begin(), meName.end(), ' ', '_');
00510       imgNameP = meName + ".png";
00511       imgName = htmlDir + imgNameP;
00512 
00513       cP->cd();
00514       gStyle->SetOptStat("euomr");
00515       obj1f->SetStats(kTRUE);
00516       if ( obj1f->GetMaximum(histMax) > 0. ) {
00517         gPad->SetLogy(kTRUE);
00518       } else {
00519         gPad->SetLogy(kFALSE);
00520       }
00521       obj1f->Draw();
00522       cP->Update();
00523       cP->SaveAs(imgName.c_str());
00524       gPad->SetLogy(kFALSE);
00525 
00526     }
00527 
00528     if ( imgNameP.size() != 0 )
00529       htmlFile << "<td><img src=\"" << imgNameP << "\"></td>" << endl;
00530     else
00531       htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00532 
00533   }
00534 
00535   obj2f = hp02_;
00536 
00537   imgNameP = "";
00538 
00539   if ( obj2f ) {
00540 
00541     meName = obj2f->GetName();
00542 
00543     replace(meName.begin(), meName.end(), ' ', '_');
00544     imgNameP = meName + ".png";
00545     imgName = htmlDir + imgNameP;
00546 
00547     cP->cd();
00548 //    gStyle->SetOptStat("euomr");
00549 //    obj2f->SetStats(kTRUE);
00550     obj2f->Draw("");
00551     cP->Update();
00552     cP->SaveAs(imgName.c_str());
00553 
00554   }
00555 
00556   if ( imgNameP.size() != 0 )
00557     htmlFile << "<td><img src=\"" << imgNameP << "\"></td>" << endl;
00558   else
00559     htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00560 
00561   htmlFile << "</tr>" << endl;
00562   htmlFile << "</table>" << endl;
00563   htmlFile << "<br>" << endl;
00564 
00565   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00566   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00567   htmlFile << "<tr align=\"center\">" << endl;
00568 
00569   for (int i=0; i<4; i++) {
00570 
00571     obj1f = 0;
00572 
00573     imgNameP = "";
00574 
00575     switch ( i ) {
00576     case 0:
00577       obj1f = hs01_[0];
00578       break;
00579     case 1:
00580       obj1f = hs01_[1];
00581       break;
00582     case 2:
00583       obj1f = hq01_[0];
00584       break;
00585     case 3:
00586       obj1f = hq01_[1];
00587       break;
00588     default:
00589       break;
00590     }
00591 
00592     if ( obj1f ) {
00593 
00594       meName = obj1f->GetName();
00595 
00596       replace(meName.begin(), meName.end(), ' ', '_');
00597       imgNameP = meName + ".png";
00598       imgName = htmlDir + imgNameP;
00599 
00600       cP->cd();
00601       gStyle->SetOptStat("euomr");
00602       obj1f->SetStats(kTRUE);
00603       if ( obj1f->GetMaximum(histMax) > 0. ) {
00604         gPad->SetLogy(kTRUE);
00605       } else {
00606         gPad->SetLogy(kFALSE);
00607       }
00608       obj1f->Draw();
00609       cP->Update();
00610       cP->SaveAs(imgName.c_str());
00611       gPad->SetLogy(kFALSE);
00612 
00613     }
00614 
00615     if ( imgNameP.size() != 0 )
00616       htmlFile << "<td><img src=\"" << imgNameP << "\"></td>" << endl;
00617     else
00618       htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00619 
00620   }
00621 
00622   htmlFile << "</tr>" << endl;
00623   htmlFile << "</table>" << endl;
00624   htmlFile << "<br>" << endl;
00625 
00626 
00627   htmlFile << "<br>" << endl;
00628   htmlFile <<  "<a name=\"Hodo-Calo\"> <B> Hodo-Calo plots </B> </a> " << endl;
00629   htmlFile << "</br>" << endl;
00630 
00631 
00632   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00633   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00634   htmlFile << "<tr align=\"center\">" << endl;
00635 
00636   for (int i=0; i<3; i++) {
00637 
00638     obj1f = 0;
00639 
00640     imgNameP = "";
00641 
00642     switch ( i ) {
00643     case 0:
00644       obj1f = hc01_[0];
00645       break;
00646     case 1:
00647       obj1f = hc01_[1];
00648       break;
00649     case 2:
00650       obj1f = hc01_[2];
00651       break;
00652     default:
00653       break;
00654     }
00655 
00656     if ( obj1f ) {
00657 
00658       meName = obj1f->GetName();
00659 
00660       replace(meName.begin(), meName.end(), ' ', '_');
00661       imgNameP = meName + ".png";
00662       imgName = htmlDir + imgNameP;
00663 
00664       cP->cd();
00665       gStyle->SetOptStat("euomr");
00666       obj1f->SetStats(kTRUE);
00667       gPad->SetLogy(kFALSE);
00668       obj1f->Draw();
00669       cP->Update();
00670       cP->SaveAs(imgName.c_str());
00671       gPad->SetLogy(kFALSE);
00672 
00673     }
00674 
00675     if ( imgNameP.size() != 0 )
00676       htmlFile << "<td><img src=\"" << imgNameP << "\"></td>" << endl;
00677     else
00678       htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00679 
00680   }
00681 
00682   htmlFile << "</tr>" << endl;
00683   htmlFile << "</table>" << endl;
00684   htmlFile << "<br>" << endl;
00685 
00686   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00687   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00688   htmlFile << "<tr align=\"center\">" << endl;
00689 
00690 
00691   for (int i=0; i<3; i++) {
00692 
00693     obj1f = 0;
00694 
00695     imgNameP = "";
00696 
00697     switch ( i ) {
00698     case 0:
00699       obj1f = he03_[0];
00700       break;
00701     case 1:
00702       obj1f = he03_[1];
00703       break;
00704     case 2:
00705       obj1f = he03_[2];
00706       break;
00707     default:
00708       break;
00709     }
00710 
00711     if ( obj1f ) {
00712 
00713       meName = obj1f->GetName();
00714 
00715       replace(meName.begin(), meName.end(), ' ', '_');
00716       imgNameP = meName + ".png";
00717       imgName = htmlDir + imgNameP;
00718 
00719       cP->cd();
00720       gStyle->SetOptStat("euomr");
00721       obj1f->SetStats(kTRUE);
00722 //      if ( obj1f->GetMaximum(histMax) > 0. ) {
00723 //        gPad->SetLogy(kTRUE);
00724 //      } else {
00725 //        gPad->SetLogy(kFALSE);
00726 //      }
00727       obj1f->Draw();
00728       cP->Update();
00729       cP->SaveAs(imgName.c_str());
00730 
00731       gPad->SetLogy(kFALSE);
00732 
00733     }
00734 
00735 
00736     if ( imgNameP.size() != 0 )
00737       htmlFile << "<td><img src=\"" << imgNameP << "\"></td>" << endl;
00738     else
00739       htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00740 
00741   }
00742 
00743   htmlFile << "</tr>" << endl;
00744   htmlFile << "</table>" << endl;
00745   htmlFile << "<br>" << endl;
00746 
00747 
00748   htmlFile << "<br>" << endl;
00749   htmlFile <<  "<a name=\"eneVspos\"> <B> Energy vs position plots </B> </a> " << endl;
00750   htmlFile << "</br>" << endl;
00751 
00752 
00753   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00754   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00755   htmlFile << "<tr align=\"center\">" << endl;
00756 
00757   for (int i=0; i<2; i++) {
00758 
00759     objp = 0;
00760 
00761     imgNameP = "";
00762 
00763     switch ( i ) {
00764     case 0:
00765       objp = he01_[0];
00766       break;
00767     case 1:
00768       objp = he01_[1];
00769       break;
00770     default:
00771       break;
00772     }
00773 
00774     if ( objp ) {
00775 
00776       meName = objp->GetName();
00777 
00778       replace(meName.begin(), meName.end(), ' ', '_');
00779       imgNameP = meName + ".png";
00780       imgName = htmlDir + imgNameP;
00781 
00782       cP->cd();
00783       gStyle->SetOptStat("euomr");
00784       objp->SetStats(kTRUE);
00785       objp->Draw();
00786       cP->Update();
00787       cP->SaveAs(imgName.c_str());
00788       gPad->SetLogy(kFALSE);
00789 
00790     }
00791 
00792     obj2f = 0;
00793 
00794     imgNameR = "";
00795 
00796     switch ( i ) {
00797     case 0:
00798       obj2f = he02_[0];
00799     break;
00800     case 1:
00801       obj2f = he02_[1];
00802       break;
00803     default:
00804       break;
00805     }
00806 
00807     if ( obj2f ) {
00808 
00809       meName = obj2f->GetName();
00810 
00811       replace(meName.begin(), meName.end(), ' ', '_');
00812       imgNameR = meName + ".png";
00813       imgName = htmlDir + imgNameR;
00814 
00815       cP->cd();
00816 //      gStyle->SetOptStat("euomr");
00817 //      obj2f->SetStats(kTRUE);
00818       obj2f->Draw();
00819       cP->Update();
00820       cP->SaveAs(imgName.c_str());
00821       gPad->SetLogy(kFALSE);
00822 
00823     }
00824 
00825     if ( imgNameP.size() != 0 )
00826       htmlFile << "<td><img src=\"" << imgNameP << "\"></td>" << endl;
00827     else
00828       htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00829 
00830     if ( imgNameR.size() != 0 )
00831       htmlFile << "<td><img src=\"" << imgNameR << "\"></td>" << endl;
00832     else
00833       htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00834 
00835   }
00836 
00837   htmlFile << "</tr>" << endl;
00838   htmlFile << "</table>" << endl;
00839   htmlFile << "<br>" << endl;
00840 
00841   htmlFile << "<br>" << endl;
00842   htmlFile <<  "<a name=\"missingColl\"> <B> Missing collections  </B> </a> " << endl;
00843   htmlFile << "</br>" << endl;
00844 
00845   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00846   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00847   htmlFile << "<tr align=\"center\">" << endl;
00848 
00849   obj1f = hm01_;
00850 
00851   imgNameP = "";
00852 
00853   if ( obj1f ) {
00854 
00855     meName = obj1f->GetName();
00856 
00857     replace(meName.begin(), meName.end(), ' ', '_');
00858     imgNameP = meName + ".png";
00859     imgName = htmlDir + imgNameP;
00860 
00861     cP->cd();
00862     gStyle->SetOptStat("euomr");
00863     obj1f->SetStats(kTRUE);
00864     obj1f->Draw();
00865     cP->Update();
00866     cP->SaveAs(imgName.c_str());
00867     gPad->SetLogy(kFALSE);
00868 
00869   }
00870 
00871   if ( imgNameP.size() != 0 )
00872     htmlFile << "<td><img src=\"" << imgNameP << "\"></td>" << endl;
00873   else
00874     htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00875 
00876   htmlFile << "</tr>" << endl;
00877   htmlFile << "</table>" << endl;
00878   htmlFile << "<br>" << endl;
00879 
00880   delete cP;
00881 
00882   htmlFile << "</tr>" << endl;
00883   htmlFile << "</table>" << endl;
00884   htmlFile << "<br>" << endl;
00885 
00886   htmlFile.close();
00887 
00888 }
00889 

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