CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQM/EcalEndcapMonitorClient/src/EEClusterClient.cc

Go to the documentation of this file.
00001 /*
00002  * \file EEClusterClient.cc
00003  *
00004  * $Date: 2010/08/08 08:46:06 $
00005  * $Revision: 1.64 $
00006  * \author G. Della Ricca
00007  * \author E. Di Marco
00008  *
00009 */
00010 
00011 #include <memory>
00012 #include <iostream>
00013 #include <fstream>
00014 
00015 #include "FWCore/ServiceRegistry/interface/Service.h"
00016 
00017 #include "DQMServices/Core/interface/DQMStore.h"
00018 
00019 #include "DQM/EcalCommon/interface/UtilsClient.h"
00020 #include "DQM/EcalCommon/interface/Numbers.h"
00021 
00022 #include "DQM/EcalEndcapMonitorClient/interface/EEClusterClient.h"
00023 
00024 EEClusterClient::EEClusterClient(const edm::ParameterSet& ps) {
00025 
00026   // cloneME switch
00027   cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
00028 
00029   // verbose switch
00030   verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
00031 
00032   // debug switch
00033   debug_ = ps.getUntrackedParameter<bool>("debug", false);
00034 
00035   // prefixME path
00036   prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
00037 
00038   // enableCleanup_ switch
00039   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
00040 
00041   // vector of selected Super Modules (Defaults to all 18).
00042   superModules_.reserve(18);
00043   for ( unsigned int i = 1; i <= 18; i++ ) superModules_.push_back(i);
00044   superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
00045 
00046   h01_[0] = 0;
00047   h01_[1] = 0;
00048   h01_[2] = 0;
00049 
00050   for(int iEE=0;iEE<2;iEE++) {
00051     for(int i=0;i<3;++i) {
00052       h04_[i][iEE] = 0;
00053       h02ProjEta_[i][iEE] = 0;
00054       h02ProjPhi_[i][iEE] = 0;
00055     }
00056   }
00057 
00058   h03_[0] = 0;
00059   h03ProjEta_[0] = 0;
00060   h03ProjPhi_[0] = 0;
00061 
00062   h03_[1] = 0;
00063   h03ProjEta_[1] = 0;
00064   h03ProjPhi_[1] = 0;
00065 
00066   i01_[0] = 0;
00067   i01_[1] = 0;
00068   i01_[2] = 0;
00069 
00070   s01_[0] = 0;
00071   s01_[1] = 0;
00072   s01_[2] = 0;
00073 
00074 }
00075 
00076 EEClusterClient::~EEClusterClient() {
00077 
00078 }
00079 
00080 void EEClusterClient::beginJob(void) {
00081 
00082   dqmStore_ = edm::Service<DQMStore>().operator->();
00083 
00084   if ( debug_ ) std::cout << "EEClusterClient: beginJob" << std::endl;
00085 
00086   ievt_ = 0;
00087   jevt_ = 0;
00088 
00089 }
00090 
00091 void EEClusterClient::beginRun(void) {
00092 
00093   if ( debug_ ) std::cout << "EEClusterClient: beginRun" << std::endl;
00094 
00095   jevt_ = 0;
00096 
00097   this->setup();
00098 
00099 }
00100 
00101 void EEClusterClient::endJob(void) {
00102 
00103   if ( debug_ ) std::cout << "EEClusterClient: endJob, ievt = " << ievt_ << std::endl;
00104 
00105   this->cleanup();
00106 
00107 }
00108 
00109 void EEClusterClient::endRun(void) {
00110 
00111   if ( debug_ ) std::cout << "EEClusterClient: endRun, jevt = " << jevt_ << std::endl;
00112 
00113   this->cleanup();
00114 
00115 }
00116 
00117 void EEClusterClient::setup(void) {
00118 
00119   dqmStore_->setCurrentFolder( prefixME_ + "/EEClusterClient" );
00120 
00121 }
00122 
00123 void EEClusterClient::cleanup(void) {
00124 
00125   if ( ! enableCleanup_ ) return;
00126 
00127   if ( cloneME_ ) {
00128     if ( h01_[0] ) delete h01_[0];
00129     if ( h01_[1] ) delete h01_[1];
00130     if ( h01_[2] ) delete h01_[2];
00131 
00132     for(int iEE=0;iEE<2;iEE++) {
00133       for(int i=0;i<3;++i) {
00134         if(h04_[i][iEE]) delete h04_[i][iEE];
00135         if(h02ProjEta_[i][iEE]) delete h02ProjEta_[i][iEE];
00136         if(h02ProjPhi_[i][iEE]) delete h02ProjPhi_[i][iEE];
00137       }
00138     }
00139 
00140     if(h03_[0]) delete h03_[0];
00141     if(h03ProjEta_[0]) delete h03ProjEta_[0];
00142     if(h03ProjPhi_[0]) delete h03ProjPhi_[0];
00143 
00144     if(h03_[1]) delete h03_[1];
00145     if(h03ProjEta_[1]) delete h03ProjEta_[1];
00146     if(h03ProjPhi_[1]) delete h03ProjPhi_[1];
00147 
00148     if(i01_[0]) delete i01_[0];
00149     if(i01_[1]) delete i01_[1];
00150     if(i01_[2]) delete i01_[2];
00151 
00152     if(s01_[0]) delete s01_[0];
00153     if(s01_[1]) delete s01_[1];
00154     if(s01_[2]) delete s01_[2];
00155 
00156   }
00157 
00158   h01_[0] = 0;
00159   h01_[1] = 0;
00160   h01_[2] = 0;
00161 
00162   for(int iEE=0;iEE<2;iEE++) {
00163     for(int i=0;i<3;++i) {
00164       h04_[i][iEE] = 0;
00165       h02ProjEta_[i][iEE] = 0;
00166       h02ProjPhi_[i][iEE] = 0;
00167     }
00168   }
00169 
00170   h03_[0] = 0;
00171   h03ProjEta_[0] = 0;
00172   h03ProjPhi_[0] = 0;
00173 
00174   h03_[1] = 0;
00175   h03ProjEta_[1] = 0;
00176   h03ProjPhi_[1] = 0;
00177 
00178   i01_[0] = 0;
00179   i01_[1] = 0;
00180   i01_[2] = 0;
00181 
00182   s01_[0] = 0;
00183   s01_[1] = 0;
00184   s01_[2] = 0;
00185 
00186 }
00187 
00188 #ifdef WITH_ECAL_COND_DB
00189 bool EEClusterClient::writeDb(EcalCondDBInterface* econn, RunIOV* runiov, MonRunIOV* moniov, bool& status) {
00190 
00191   status = true;
00192 
00193   return true;
00194 
00195 }
00196 #endif
00197 
00198 void EEClusterClient::analyze(void) {
00199 
00200   ievt_++;
00201   jevt_++;
00202   if ( ievt_ % 10 == 0 ) {
00203     if ( debug_ ) std::cout << "EEClusterClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
00204   }
00205 
00206   char histo[200];
00207 
00208   MonitorElement* me;
00209 
00210   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC energy").c_str());
00211   me = dqmStore_->get(histo);
00212   h01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h01_[0] );
00213 
00214   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC size").c_str());
00215   me = dqmStore_->get(histo);
00216   h01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h01_[1] );
00217 
00218   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC number").c_str());
00219   me = dqmStore_->get(histo);
00220   h01_[2] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h01_[2] );
00221 
00222   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC energy map EE -").c_str());
00223   me = dqmStore_->get(histo);
00224   h04_[0][0] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h04_[0][0] );
00225 
00226   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC number map EE -").c_str());
00227   me = dqmStore_->get(histo);
00228   h03_[0] = UtilsClient::getHisto<TH2F*>( me, cloneME_, h03_[0] );
00229 
00230   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC ET map EE -").c_str());
00231   me = dqmStore_->get(histo);
00232   h04_[1][0] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h04_[1][0] );
00233 
00234   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC size map EE -").c_str());
00235   me = dqmStore_->get(histo);
00236   h04_[2][0] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h04_[2][0] );
00237 
00238   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC energy projection eta EE -").c_str());
00239   me = dqmStore_->get(histo);
00240   h02ProjEta_[0][0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjEta_[0][0] );
00241 
00242   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC energy projection phi EE -").c_str());
00243   me = dqmStore_->get(histo);
00244   h02ProjPhi_[0][0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjPhi_[0][0] );
00245 
00246   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC number projection eta EE -").c_str());
00247   me = dqmStore_->get(histo);
00248   h03ProjEta_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03ProjEta_[0] );
00249 
00250   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC number projection phi EE -").c_str());
00251   me = dqmStore_->get(histo);
00252   h03ProjPhi_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03ProjPhi_[0] );
00253 
00254   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC ET projection eta EE -").c_str());
00255   me = dqmStore_->get(histo);
00256   h02ProjEta_[1][0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjEta_[1][0] );
00257 
00258   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC ET projection phi EE -").c_str());
00259   me = dqmStore_->get(histo);
00260   h02ProjPhi_[1][0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjPhi_[1][0] );
00261 
00262   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC size projection eta EE -").c_str());
00263   me = dqmStore_->get(histo);
00264   h02ProjEta_[2][0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjEta_[2][0] );
00265 
00266   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC size projection phi EE -").c_str());
00267   me = dqmStore_->get(histo);
00268   h02ProjPhi_[2][0] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjPhi_[2][0] );
00269 
00270   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC energy map EE +").c_str());
00271   me = dqmStore_->get(histo);
00272   h04_[0][1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h04_[0][1] );
00273 
00274   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC number map EE +").c_str());
00275   me = dqmStore_->get(histo);
00276   h03_[1] = UtilsClient::getHisto<TH2F*>( me, cloneME_, h03_[1] );
00277 
00278   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC ET map EE +").c_str());
00279   me = dqmStore_->get(histo);
00280   h04_[1][1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h04_[1][1] );
00281 
00282   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC size map EE +").c_str());
00283   me = dqmStore_->get(histo);
00284   h04_[2][1] = UtilsClient::getHisto<TProfile2D*>( me, cloneME_, h04_[2][1] );
00285 
00286   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC energy projection eta EE +").c_str());
00287   me = dqmStore_->get(histo);
00288   h02ProjEta_[0][1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjEta_[0][1] );
00289 
00290   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC energy projection phi EE +").c_str());
00291   me = dqmStore_->get(histo);
00292   h02ProjPhi_[0][1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjPhi_[0][1] );
00293 
00294   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC number projection eta EE +").c_str());
00295   me = dqmStore_->get(histo);
00296   h03ProjEta_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03ProjEta_[1] );
00297 
00298   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC number projection phi EE +").c_str());
00299   me = dqmStore_->get(histo);
00300   h03ProjPhi_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, h03ProjPhi_[1] );
00301 
00302   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC ET projection eta EE +").c_str());
00303   me = dqmStore_->get(histo);
00304   h02ProjEta_[1][1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjEta_[1][1] );
00305 
00306   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC ET projection phi EE +").c_str());
00307   me = dqmStore_->get(histo);
00308   h02ProjPhi_[1][1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjPhi_[1][1] );
00309 
00310   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC size projection eta EE +").c_str());
00311   me = dqmStore_->get(histo);
00312   h02ProjEta_[2][1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjEta_[2][1] );
00313 
00314   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT BC size projection phi EE +").c_str());
00315   me = dqmStore_->get(histo);
00316   h02ProjPhi_[2][1] = UtilsClient::getHisto<TProfile*>( me, cloneME_, h02ProjPhi_[2][1] );
00317 
00318   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT SC energy").c_str());
00319   me = dqmStore_->get(histo);
00320   i01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, i01_[0] );
00321 
00322   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT SC size").c_str());
00323   me = dqmStore_->get(histo);
00324   i01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, i01_[1] );
00325 
00326   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT SC number").c_str());
00327   me = dqmStore_->get(histo);
00328   i01_[2] = UtilsClient::getHisto<TH1F*>( me, cloneME_, i01_[2] );
00329 
00330   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT s1s9").c_str());
00331   me = dqmStore_->get(histo);
00332   s01_[0] = UtilsClient::getHisto<TH1F*>( me, cloneME_, s01_[0] );
00333 
00334   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT s9s25").c_str());
00335   me = dqmStore_->get(histo);
00336   s01_[1] = UtilsClient::getHisto<TH1F*>( me, cloneME_, s01_[1] );
00337 
00338   sprintf(histo, (prefixME_ + "/EEClusterTask/EECLT dicluster invariant mass Pi0").c_str());
00339   me = dqmStore_->get(histo);
00340   s01_[2] = UtilsClient::getHisto<TH1F*>( me, cloneME_, s01_[2] );
00341 
00342 }
00343