CMS 3D CMS Logo

EEOccupancyClient.cc

Go to the documentation of this file.
00001 /*
00002  * \file EEOccupancyClient.cc
00003  *
00004  * $Date: 2008/08/11 20:53:49 $
00005  * $Revision: 1.28 $
00006  * \author G. Della Ricca
00007  * \author F. Cossutti
00008  *
00009 */
00010 
00011 #include <memory>
00012 #include <iostream>
00013 #include <fstream>
00014 #include <iomanip>
00015 #include <math.h>
00016 
00017 #include "TCanvas.h"
00018 #include "TStyle.h"
00019 #include "TGraph.h"
00020 #include "TLine.h"
00021 
00022 #include "DQMServices/Core/interface/DQMStore.h"
00023 
00024 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
00025 
00026 #include "DQM/EcalCommon/interface/UtilsClient.h"
00027 #include "DQM/EcalCommon/interface/LogicID.h"
00028 #include "DQM/EcalCommon/interface/Numbers.h"
00029 
00030 #include <DQM/EcalEndcapMonitorClient/interface/EEOccupancyClient.h>
00031 
00032 using namespace cms;
00033 using namespace edm;
00034 using namespace std;
00035 
00036 EEOccupancyClient::EEOccupancyClient(const ParameterSet& ps) {
00037 
00038   // cloneME switch
00039   cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
00040 
00041   // verbose switch
00042   verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
00043 
00044   // debug switch
00045   debug_ = ps.getUntrackedParameter<bool>("debug", false);
00046 
00047   // prefixME path
00048   prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
00049 
00050   // enableCleanup_ switch
00051   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00052 
00053   // vector of selected Super Modules (Defaults to all 18).
00054   superModules_.reserve(18);
00055   for ( unsigned int i = 1; i <= 18; i++ ) superModules_.push_back(i);
00056   superModules_ = ps.getUntrackedParameter<vector<int> >("superModules", superModules_);
00057 
00058   for ( int i=0; i<3; i++) {
00059     h01_[0][i] = 0;
00060     h01ProjR_[0][i] = 0;
00061     h01ProjPhi_[0][i] = 0;
00062     h01_[1][i] = 0;
00063     h01ProjR_[1][i] = 0;
00064     h01ProjPhi_[1][i] = 0;
00065   }
00066 
00067   for ( int i=0; i<2; i++) {
00068     h02_[0][i] = 0;
00069     h02ProjR_[0][i] = 0;
00070     h02ProjPhi_[0][i] = 0;
00071     h02_[1][i] = 0;
00072     h02ProjR_[1][i] = 0;
00073     h02ProjPhi_[1][i] = 0;
00074   }
00075 
00076 }
00077 
00078 EEOccupancyClient::~EEOccupancyClient() {
00079 
00080 }
00081 
00082 void EEOccupancyClient::beginJob(DQMStore* dqmStore) {
00083 
00084   dqmStore_ = dqmStore;
00085 
00086   if ( debug_ ) cout << "EEOccupancyClient: beginJob" << endl;
00087 
00088   ievt_ = 0;
00089   jevt_ = 0;
00090 
00091 }
00092 
00093 void EEOccupancyClient::beginRun(void) {
00094 
00095   if ( debug_ ) cout << "EEOccupancyClient: beginRun" << endl;
00096 
00097   jevt_ = 0;
00098 
00099   this->setup();
00100 
00101 }
00102 
00103 void EEOccupancyClient::endJob(void) {
00104 
00105   if ( debug_ ) cout << "EEOccupancyClient: endJob, ievt = " << ievt_ << endl;
00106 
00107   this->cleanup();
00108 
00109 }
00110 
00111 void EEOccupancyClient::endRun(void) {
00112 
00113   if ( debug_ ) cout << "EEOccupancyClient: endRun, jevt = " << jevt_ << endl;
00114 
00115   this->cleanup();
00116 
00117 }
00118 
00119 void EEOccupancyClient::setup(void) {
00120 
00121   dqmStore_->setCurrentFolder( prefixME_ + "/EEOccupancyClient" );
00122 
00123 }
00124 
00125 void EEOccupancyClient::cleanup(void) {
00126 
00127   if ( ! enableCleanup_ ) return;
00128 
00129   if ( cloneME_ ) {
00130 
00131     for ( int i=0; i<3; ++i ) {
00132       if ( h01_[0][i] ) delete h01_[0][i];
00133       if ( h01ProjR_[0][i] ) delete h01ProjR_[0][i];
00134       if ( h01ProjPhi_[0][i] ) delete h01ProjPhi_[0][i];
00135       if ( h01_[1][i] ) delete h01_[1][i];
00136       if ( h01ProjR_[1][i] ) delete h01ProjR_[1][i];
00137       if ( h01ProjPhi_[1][i] ) delete h01ProjPhi_[1][i];
00138     }
00139 
00140     for ( int i=0; i<2; ++i ) {
00141       if ( h02_[0][i] ) delete h02_[0][i];
00142       if ( h02ProjR_[0][i] ) delete h02ProjR_[0][i];
00143       if ( h02ProjPhi_[0][i] ) delete h02ProjPhi_[0][i];
00144       if ( h01_[1][i] ) delete h01_[1][i];
00145       if ( h01ProjR_[1][i] ) delete h01ProjR_[1][i];
00146       if ( h01ProjPhi_[1][i] ) delete h01ProjPhi_[1][i];
00147     }
00148 
00149   }
00150 
00151   for ( int i=0; i<3; i++) {
00152     h01_[0][i] = 0;
00153     h01ProjR_[0][i] = 0;
00154     h01ProjPhi_[0][i] = 0;
00155     h01_[1][i] = 0;
00156     h01ProjR_[1][i] = 0;
00157     h01ProjPhi_[1][i] = 0;
00158   }
00159 
00160   for ( int i=0; i<2; i++) {
00161     h02_[0][i] = 0;
00162     h02ProjR_[0][i] = 0;
00163     h02ProjPhi_[0][i] = 0;
00164     h02_[1][i] = 0;
00165     h02ProjR_[1][i] = 0;
00166     h02ProjPhi_[1][i] = 0;
00167   }
00168 
00169 }
00170 
00171 bool EEOccupancyClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status, bool flag) {
00172 
00173   status = true;
00174 
00175   if ( ! flag ) return false;
00176 
00177   return true;
00178 
00179 }
00180 
00181 void EEOccupancyClient::analyze(void) {
00182 
00183   ievt_++;
00184   jevt_++;
00185   if ( ievt_ % 10 == 0 ) {
00186     if ( debug_ ) cout << "EEOccupancyClient: ievt/jevt = " << ievt_ << "/" << jevt_ << endl;
00187   }
00188 
00189   char histo[200];
00190 
00191   MonitorElement* me;
00192 
00193   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT digi occupancy EE -").c_str());
00194   me = dqmStore_->get(histo);
00195   h01_[0][0] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[0][0] );
00196 
00197   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT digi occupancy EE - projection R").c_str());
00198   me = dqmStore_->get(histo);
00199   h01ProjR_[0][0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjR_[0][0] );
00200 
00201   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT digi occupancy EE - projection phi").c_str());
00202   me = dqmStore_->get(histo);
00203   h01ProjPhi_[0][0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[0][0] );
00204 
00205   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT digi occupancy EE +").c_str());
00206   me = dqmStore_->get(histo);
00207   h01_[1][0] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[1][0] );
00208 
00209   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT digi occupancy EE + projection R").c_str());
00210   me = dqmStore_->get(histo);
00211   h01ProjR_[1][0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjR_[1][0] );
00212 
00213   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT digi occupancy EE + projection phi").c_str());
00214   me = dqmStore_->get(histo);
00215   h01ProjPhi_[1][0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[1][0] );
00216 
00217   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit occupancy EE -").c_str());
00218   me = dqmStore_->get(histo);
00219   h01_[0][1] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[0][1] );
00220 
00221   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit occupancy EE - projection R").c_str());
00222   me = dqmStore_->get(histo);
00223   h01ProjR_[0][1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjR_[0][1] );
00224 
00225   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit occupancy EE - projection phi").c_str());
00226   me = dqmStore_->get(histo);
00227   h01ProjPhi_[0][1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[0][1] );
00228 
00229   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit occupancy EE +").c_str());
00230   me = dqmStore_->get(histo);
00231   h01_[1][1] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[1][1] );
00232 
00233   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit occupancy EE + projection R").c_str());
00234   me = dqmStore_->get(histo);
00235   h01ProjR_[1][1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjR_[1][1] );
00236 
00237   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit occupancy EE + projection phi").c_str());
00238   me = dqmStore_->get(histo);
00239   h01ProjPhi_[1][1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[1][1] );
00240 
00241   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi occupancy EE -").c_str());
00242   me = dqmStore_->get(histo);
00243   h01_[0][2] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[0][2] );
00244 
00245   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi occupancy EE - projection R").c_str());
00246   me = dqmStore_->get(histo);
00247   h01ProjR_[0][2] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjR_[0][2] );
00248 
00249   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi occupancy EE - projection phi").c_str());
00250   me = dqmStore_->get(histo);
00251   h01ProjPhi_[0][2] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[0][2] );
00252 
00253   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi occupancy EE +").c_str());
00254   me = dqmStore_->get(histo);
00255   h01_[1][2] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h01_[1][2] );
00256 
00257   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi occupancy EE + projection R").c_str());
00258   me = dqmStore_->get(histo);
00259   h01ProjR_[1][2] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjR_[1][2] );
00260 
00261   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi occupancy EE + projection phi").c_str());
00262   me = dqmStore_->get(histo);
00263   h01ProjPhi_[1][2] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h01ProjPhi_[1][2] );
00264 
00265   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit thr occupancy EE -").c_str());
00266   me = dqmStore_->get(histo);
00267   h02_[0][0] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h02_[0][0] );
00268 
00269   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit thr occupancy EE - projection R").c_str());
00270   me = dqmStore_->get(histo);
00271   h02ProjR_[0][0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjR_[0][0] );
00272 
00273   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit thr occupancy EE - projection phi").c_str());
00274   me = dqmStore_->get(histo);
00275   h02ProjPhi_[0][0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjPhi_[0][0] );
00276 
00277   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit thr occupancy EE +").c_str());
00278   me = dqmStore_->get(histo);
00279   h02_[1][0] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h02_[1][0] );
00280 
00281   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit thr occupancy EE + projection R").c_str());
00282   me = dqmStore_->get(histo);
00283   h02ProjR_[1][0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjR_[1][0] );
00284 
00285   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT rec hit thr occupancy EE + projection phi").c_str());
00286   me = dqmStore_->get(histo);
00287   h02ProjPhi_[1][0] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjPhi_[1][0] );
00288 
00289   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi thr occupancy EE -").c_str());
00290   me = dqmStore_->get(histo);
00291   h02_[0][1] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h02_[0][1] );
00292 
00293   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi thr occupancy EE - projection R").c_str());
00294   me = dqmStore_->get(histo);
00295   h02ProjR_[0][1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjR_[0][1] );
00296 
00297   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi thr occupancy EE - projection phi").c_str());
00298   me = dqmStore_->get(histo);
00299   h02ProjPhi_[0][1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjPhi_[0][1] );
00300 
00301   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi thr occupancy EE +").c_str());
00302   me = dqmStore_->get(histo);
00303   h02_[1][1] = UtilsClient::getHisto<TH2F*> ( me, cloneME_, h02_[1][1] );
00304 
00305   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi thr occupancy EE + projection R").c_str());
00306   me = dqmStore_->get(histo);
00307   h02ProjR_[1][1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjR_[1][1] );
00308 
00309   sprintf(histo, (prefixME_ + "/EEOccupancyTask/EEOT TP digi thr occupancy EE + projection phi").c_str());
00310   me = dqmStore_->get(histo);
00311   h02ProjPhi_[1][1] = UtilsClient::getHisto<TH1F*> ( me, cloneME_, h02ProjPhi_[1][1] );
00312 
00313 }
00314 
00315 void EEOccupancyClient::softReset(bool flag) {
00316 
00317 }
00318 
00319 void EEOccupancyClient::htmlOutput(int run, string& htmlDir, string& htmlName) {
00320 
00321   if ( verbose_ ) cout << "Preparing EEOccupancyClient html output ..." << endl;
00322 
00323   ofstream htmlFile;
00324 
00325   htmlFile.open((htmlDir + htmlName).c_str());
00326 
00327   // html page header
00328   htmlFile << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">  " << endl;
00329   htmlFile << "<html>  " << endl;
00330   htmlFile << "<head>  " << endl;
00331   htmlFile << "  <meta content=\"text/html; charset=ISO-8859-1\"  " << endl;
00332   htmlFile << " https-equiv=\"content-type\">  " << endl;
00333   htmlFile << "  <title>Monitor:OccupancyTask output</title> " << endl;
00334   htmlFile << "</head>  " << endl;
00335   htmlFile << "<style type=\"text/css\"> td { font-weight: bold } </style>" << endl;
00336   htmlFile << "<body>  " << endl;
00337   //htmlFile << "<br>  " << endl;
00338   htmlFile << "<a name=""top""></a>" << endl;
00339   htmlFile << "<h2>Run:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" << endl;
00340   htmlFile << "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
00341   htmlFile << " style=\"color: rgb(0, 0, 153);\">" << run << "</span></h2>" << endl;
00342   htmlFile << "<h2>Monitoring task:&nbsp;&nbsp;&nbsp;&nbsp; <span " << endl;
00343   htmlFile << " style=\"color: rgb(0, 0, 153);\">OCCUPANCY</span></h2> " << endl;
00344   htmlFile << "<hr>" << endl;
00345 
00346   // Produce the plots to be shown as .png files from existing histograms
00347 
00348   const int csize1D = 250;
00349   const int csize2D = 500;
00350 
00351   int pCol4[10];
00352   for ( int i = 0; i < 10; i++ ) pCol4[i] = 401+i;
00353 
00354   TH2C dummy1("labelGrid1","label grid for EE -", 10, 0., 100., 10, 0., 100.);
00355 
00356   for ( int i=1; i<=10; i++) {
00357     for ( int j=1; j<=10; j++) {
00358       dummy1.SetBinContent(i, j, -10);
00359     }
00360   }
00361 
00362   dummy1.SetBinContent(2, 5, -3);
00363   dummy1.SetBinContent(2, 7, -2);
00364   dummy1.SetBinContent(4, 9, -1);
00365   dummy1.SetBinContent(7, 9, -9);
00366   dummy1.SetBinContent(9, 7, -8);
00367   dummy1.SetBinContent(9, 5, -7);
00368   dummy1.SetBinContent(8, 3, -6);
00369   dummy1.SetBinContent(5, 2, -5);
00370   dummy1.SetBinContent(3, 3, -4);
00371 
00372   dummy1.SetMarkerSize(2);
00373   dummy1.SetMinimum(-9.01);
00374   dummy1.SetMaximum(-0.01);
00375 
00376   TH2C dummy2("labelGrid2","label grid for EE +", 10, 0., 100., 10, 0., 100.);
00377 
00378   for ( int i=1; i<=10; i++) {
00379     for ( int j=1; j<=10; j++) {
00380       dummy2.SetBinContent(i, j, -10);
00381     }
00382   }
00383 
00384   dummy2.SetBinContent(2, 5, +3);
00385   dummy2.SetBinContent(2, 7, +2);
00386   dummy2.SetBinContent(4, 9, +1);
00387   dummy2.SetBinContent(7, 9, +9);
00388   dummy2.SetBinContent(9, 7, +8);
00389   dummy2.SetBinContent(9, 5, +7);
00390   dummy2.SetBinContent(8, 3, +6);
00391   dummy2.SetBinContent(6, 2, +5);
00392   dummy2.SetBinContent(3, 3, +4);
00393 
00394   dummy2.SetMarkerSize(2);
00395   dummy2.SetMinimum(+0.01);
00396   dummy2.SetMaximum(+9.01);
00397 
00398   string imgNameMap[2][3], imgNameProjR[2][3], imgNameProjPhi[2][3];
00399   string imgNameMapThr[2][2], imgNameProjRThr[2][2], imgNameProjPhiThr[2][2];
00400   string imgName, meName;
00401 
00402   TCanvas* cMap = new TCanvas("cMap", "cMap", csize2D, csize2D);
00403   TCanvas* cProj = new TCanvas("cProj", "cProj", csize1D, csize1D);
00404 
00405   TH2F* obj2f;
00406   TH1F* obj1fR;
00407   TH1F* obj1fPhi;
00408 
00409   gStyle->SetPaintTextFormat("+g");
00410 
00411   // Occupancy without threshold
00412   for ( int iMap=0; iMap<3; iMap++ ) {
00413     for ( int iEE=0; iEE<2; iEE++ ) {
00414 
00415       imgNameMap[iEE][iMap] = "";
00416 
00417       obj2f = h01_[iEE][iMap];
00418 
00419       if ( obj2f ) {
00420 
00421         meName = obj2f->GetName();
00422 
00423         replace(meName.begin(), meName.end(), ' ', '_');
00424         imgNameMap[iEE][iMap] = meName + ".png";
00425         imgName = htmlDir + imgNameMap[iEE][iMap];
00426 
00427         cMap->cd();
00428         gStyle->SetOptStat(" ");
00429         gStyle->SetPalette(10, pCol4);
00430         obj2f->GetXaxis()->SetNdivisions(10, kFALSE);
00431         obj2f->GetXaxis()->SetLabelSize(0.02);
00432         obj2f->GetXaxis()->SetTitleSize(0.02);
00433         obj2f->GetYaxis()->SetNdivisions(10, kFALSE);
00434         obj2f->GetYaxis()->SetLabelSize(0.02);
00435         obj2f->GetYaxis()->SetTitleSize(0.02);
00436         obj2f->GetZaxis()->SetLabelSize(0.02);
00437         cMap->SetGridx();
00438         cMap->SetGridy();
00439         obj2f->Draw("colz");
00440         if ( iEE == 0 ) dummy1.Draw("text,same");
00441         if ( iEE == 1 ) dummy2.Draw("text,same");
00442         cMap->SetBit(TGraph::kClipFrame);
00443         TLine l;
00444         l.SetLineWidth(1);
00445         for ( int i=0; i<201; i=i+1) {
00446           if ( (Numbers::ixSectorsEE[i]!=0 || Numbers::iySectorsEE[i]!=0) && (Numbers::ixSectorsEE[i+1]!=0 || Numbers::iySectorsEE[i+1]!=0) ) {
00447             l.DrawLine(Numbers::ixSectorsEE[i], Numbers::iySectorsEE[i], Numbers::ixSectorsEE[i+1], Numbers::iySectorsEE[i+1]);
00448           }
00449         }
00450         cMap->Update();
00451         cMap->SaveAs(imgName.c_str());
00452 
00453       }
00454 
00455       obj1fR = h01ProjR_[iEE][iMap];
00456 
00457       if ( obj1fR ) {
00458 
00459         meName = obj1fR->GetName();
00460 
00461         replace(meName.begin(), meName.end(), ' ', '_');
00462         imgNameProjR[iEE][iMap] = meName + ".png";
00463         imgName = htmlDir + imgNameProjR[iEE][iMap];
00464 
00465         cProj->cd();
00466         gStyle->SetOptStat("emr");
00467         obj1fR->SetStats(kTRUE);
00468         obj1fR->Draw("pe");
00469         cProj->Update();
00470         cProj->SaveAs(imgName.c_str());
00471 
00472       }
00473 
00474       obj1fPhi = h01ProjPhi_[iEE][iMap];
00475 
00476       if ( obj1fPhi ) {
00477 
00478         meName = obj1fPhi->GetName();
00479 
00480         replace(meName.begin(), meName.end(), ' ', '_');
00481         imgNameProjPhi[iEE][iMap] = meName + ".png";
00482         imgName = htmlDir + imgNameProjPhi[iEE][iMap];
00483 
00484         cProj->cd();
00485         gStyle->SetOptStat("emr");
00486         obj1fPhi->GetXaxis()->SetNdivisions(50206, kFALSE);
00487         obj1fPhi->SetStats(kTRUE);
00488         obj1fPhi->Draw("pe");
00489         cProj->Update();
00490         cProj->SaveAs(imgName.c_str());
00491 
00492       }
00493 
00494     }
00495   }
00496 
00497   // Occupancy with threshold
00498   for ( int iMap=0; iMap<2; iMap++ ) {
00499     for( int iEE=0; iEE<2; iEE++ ) {
00500 
00501       imgNameMapThr[iEE][iMap] = "";
00502 
00503       obj2f = h02_[iEE][iMap];
00504 
00505       if ( obj2f ) {
00506 
00507         meName = obj2f->GetName();
00508 
00509         replace(meName.begin(), meName.end(), ' ', '_');
00510         imgNameMapThr[iEE][iMap] = meName + ".png";
00511         imgName = htmlDir + imgNameMapThr[iEE][iMap];
00512 
00513         cMap->cd();
00514         gStyle->SetOptStat(" ");
00515         gStyle->SetPalette(10, pCol4);
00516         obj2f->GetXaxis()->SetNdivisions(10, kFALSE);
00517         obj2f->GetXaxis()->SetLabelSize(0.02);
00518         obj2f->GetXaxis()->SetTitleSize(0.02);
00519         obj2f->GetYaxis()->SetNdivisions(10, kFALSE);
00520         obj2f->GetYaxis()->SetLabelSize(0.02);
00521         obj2f->GetYaxis()->SetTitleSize(0.02);
00522         obj2f->GetZaxis()->SetLabelSize(0.02);
00523         cMap->SetGridx();
00524         cMap->SetGridy();
00525         obj2f->Draw("colz");
00526         if ( iEE == 0 ) dummy1.Draw("text,same");
00527         if ( iEE == 1 ) dummy2.Draw("text,same");
00528         cMap->SetBit(TGraph::kClipFrame);
00529         TLine l;
00530         l.SetLineWidth(1);
00531         for ( int i=0; i<201; i=i+1) {
00532           if ( (Numbers::ixSectorsEE[i]!=0 || Numbers::iySectorsEE[i]!=0) && (Numbers::ixSectorsEE[i+1]!=0 || Numbers::iySectorsEE[i+1]!=0) ) {
00533             l.DrawLine(Numbers::ixSectorsEE[i], Numbers::iySectorsEE[i], Numbers::ixSectorsEE[i+1], Numbers::iySectorsEE[i+1]);
00534           }
00535         }
00536         cMap->Update();
00537         cMap->SaveAs(imgName.c_str());
00538 
00539       }
00540 
00541       obj1fR = h02ProjR_[iEE][iMap];
00542 
00543       if ( obj1fR ) {
00544 
00545         meName = obj1fR->GetName();
00546 
00547         replace(meName.begin(), meName.end(), ' ', '_');
00548         imgNameProjRThr[iEE][iMap] = meName + ".png";
00549         imgName = htmlDir + imgNameProjRThr[iEE][iMap];
00550 
00551         cProj->cd();
00552         gStyle->SetOptStat("emr");
00553         obj1fR->SetStats(kTRUE);
00554         obj1fR->Draw("pe");
00555         cProj->Update();
00556         cProj->SaveAs(imgName.c_str());
00557 
00558       }
00559 
00560       obj1fPhi = h02ProjPhi_[iEE][iMap];
00561 
00562       if ( obj1fPhi ) {
00563 
00564         meName = obj1fPhi->GetName();
00565 
00566         replace(meName.begin(), meName.end(), ' ', '_');
00567         imgNameProjPhiThr[iEE][iMap] = meName + ".png";
00568         imgName = htmlDir + imgNameProjPhiThr[iEE][iMap];
00569 
00570         cProj->cd();
00571         gStyle->SetOptStat("emr");
00572         obj1fPhi->GetXaxis()->SetNdivisions(50206, kFALSE);
00573         obj1fPhi->SetStats(kTRUE);
00574         obj1fPhi->Draw("pe");
00575         cProj->Update();
00576         cProj->SaveAs(imgName.c_str());
00577 
00578       }
00579 
00580     }
00581   }
00582 
00583   gStyle->SetPaintTextFormat();
00584 
00585   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00586   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00587   htmlFile << "<tr align=\"center\">" << endl;
00588 
00589   for (int iMap=0; iMap<3; iMap++) {
00590     for (int iEE=0; iEE<2; iEE++) {
00591       if ( imgNameMap[iEE][iMap].size() != 0 )
00592         htmlFile << "<td><img src=\"" << imgNameMap[iEE][iMap] << "\"></td>" << endl;
00593       else
00594         htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00595     }
00596   }
00597 
00598   htmlFile << "</tr>" << endl;
00599   htmlFile << "</table>" << endl;
00600   htmlFile << "<br>" << endl;
00601 
00602   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00603   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00604   htmlFile << "<tr align=\"center\">" << endl;
00605 
00606   for (int iMap=0; iMap<3; iMap++) {
00607     for (int iEE=0; iEE<2; iEE++) {
00608       if ( imgNameProjR[iEE][iMap].size() != 0 )
00609         htmlFile << "<td><img src=\"" << imgNameProjR[iEE][iMap] << "\"></td>" << endl;
00610       else
00611         htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00612       if ( imgNameProjPhi[iEE][iMap].size() != 0 )
00613         htmlFile << "<td><img src=\"" << imgNameProjPhi[iEE][iMap] << "\"></td>" << endl;
00614       else
00615         htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00616     }
00617   }
00618 
00619   htmlFile << "</tr>" << endl;
00620   htmlFile << "</table>" << endl;
00621   htmlFile << "<br>" << endl;
00622 
00623   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00624   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00625   htmlFile << "<tr align=\"center\">" << endl;
00626 
00627   for (int iMap=0; iMap<2; iMap++) {
00628     for (int iEE=0; iEE<2; iEE++) {
00629       if ( imgNameMapThr[iEE][iMap].size() != 0 )
00630         htmlFile << "<td><img src=\"" << imgNameMapThr[iEE][iMap] << "\"></td>" << endl;
00631       else
00632         htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00633     }
00634   }
00635 
00636   htmlFile << "</tr>" << endl;
00637   htmlFile << "</table>" << endl;
00638   htmlFile << "<br>" << endl;
00639 
00640   htmlFile << "<table border=\"0\" cellspacing=\"0\" " << endl;
00641   htmlFile << "cellpadding=\"10\" align=\"center\"> " << endl;
00642   htmlFile << "<tr align=\"center\">" << endl;
00643 
00644   for (int iMap=0; iMap<2; iMap++) {
00645     for (int iEE=0; iEE<2; iEE++) {
00646       if ( imgNameProjRThr[iEE][iMap].size() != 0 )
00647         htmlFile << "<td><img src=\"" << imgNameProjRThr[iEE][iMap] << "\"></td>" << endl;
00648       else
00649         htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00650       if ( imgNameProjPhiThr[iEE][iMap].size() != 0 )
00651         htmlFile << "<td><img src=\"" << imgNameProjPhiThr[iEE][iMap] << "\"></td>" << endl;
00652       else
00653         htmlFile << "<td><img src=\"" << " " << "\"></td>" << endl;
00654     }
00655   }
00656 
00657   htmlFile << "</tr>" << endl;
00658   htmlFile << "</table>" << endl;
00659   htmlFile << "<br>" << endl;
00660 
00661   htmlFile.close();
00662 
00663 }
00664 

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