CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoEcal/EgammaCoreTools/plugins/EcalClusterCrackCorrectionBaseClass.cc

Go to the documentation of this file.
00001 #include "RecoEcal/EgammaCoreTools/plugins/EcalClusterCrackCorrectionBaseClass.h"
00002 
00003 #include "CondFormats/DataRecord/interface/EcalClusterCrackCorrParametersRcd.h"
00004 
00005 #include "FWCore/Framework/interface/EventSetup.h"
00006 #include "FWCore/Framework/interface/ESHandle.h"
00007 
00008 EcalClusterCrackCorrectionBaseClass::EcalClusterCrackCorrectionBaseClass() :
00009         params_(0)
00010 {}
00011 
00012 EcalClusterCrackCorrectionBaseClass::~EcalClusterCrackCorrectionBaseClass()
00013 {}
00014 
00015 void
00016 EcalClusterCrackCorrectionBaseClass::init( const edm::EventSetup& es )
00017 {
00018         es.get<EcalClusterCrackCorrParametersRcd>().get( esParams_ );
00019         params_ = esParams_.product();
00020         es_ = &es; //needed to access the ECAL geometry
00021 
00023         //EcalClusterCrackCorrParameters::const_iterator it;
00024         //std::cout << "[[EcalClusterCrackCorrectionBaseClass::init]] " 
00025         //        << params_->size() << " parameters:";
00026         //for ( it = params_->begin(); it != params_->end(); ++it ) {
00027         //        std::cout << " " << *it;
00028         //}
00029         //std::cout << "\n";
00030 }
00031 
00032 void
00033 EcalClusterCrackCorrectionBaseClass::checkInit() const
00034 {
00035         if ( ! params_ ) {
00036                 // non initialized function parameters: throw exception
00037                 throw cms::Exception("EcalClusterCrackCorrectionBaseClass::checkInit()") 
00038                         << "Trying to access an uninitialized crack correction function.\n"
00039                         "Please call `init( edm::EventSetup &)' before any use of the function.\n";
00040         }
00041 }