![]() |
![]() |
00001 // -*- C++ -*- 00002 // 00003 // Package: HcalDDDGeometryEP 00004 // Class: HcalDDDGeometryEP 00005 // 00013 // 00014 // Original Author: Sunanda Banerjee 00015 // Created: Thu Oct 20 11:35:27 CDT 2006 00016 // $Id: HcalDDDGeometryEP.cc,v 1.4 2008/05/19 20:12:41 heltsley Exp $ 00017 // 00018 // 00019 00020 #include "Geometry/HcalEventSetup/interface/HcalDDDGeometryEP.h" 00021 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00022 00023 // 00024 // constants, enums and typedefs 00025 // 00026 00027 // 00028 // static data member definitions 00029 // 00030 00031 // 00032 // constructors and destructor 00033 // 00034 HcalDDDGeometryEP::HcalDDDGeometryEP(const edm::ParameterSet& ps ) : 00035 m_loader ( 0 ) , 00036 m_cpv ( 0 ) , 00037 m_applyAlignment ( ps.getUntrackedParameter<bool>("applyAlignment", false) ) 00038 { 00039 //the following line is needed to tell the framework what 00040 // data is being produced 00041 setWhatProduced( this, 00042 &HcalDDDGeometryEP::produceAligned, 00043 dependsOn( &HcalDDDGeometryEP::idealRecordCallBack ), 00044 "HCAL"); 00045 00046 // diable 00047 // setWhatProduced( this, 00048 // &HcalDDDGeometryEP::produceIdeal, 00049 // edm::es::Label( "HCAL" ) ); 00050 } 00051 00052 00053 HcalDDDGeometryEP::~HcalDDDGeometryEP() 00054 { 00055 delete m_loader ; 00056 } 00057 00058 00059 // 00060 // member functions 00061 // 00062 00063 // ------------ method called to produce the data ------------ 00064 HcalDDDGeometryEP::ReturnType 00065 HcalDDDGeometryEP::produceIdeal(const IdealGeometryRecord& iRecord) 00066 { 00067 idealRecordCallBack( iRecord ) ; 00068 00069 assert( 0 == m_loader ) ; 00070 m_loader = new HcalDDDGeometryLoader(*m_cpv); 00071 LogDebug("HCalGeom")<<"HcalDDDGeometryEP:Initialize HcalDDDGeometryLoader"; 00072 00073 ReturnType pC ( m_loader->load() ) ; 00074 00075 return pC ; 00076 } 00077 HcalDDDGeometryEP::ReturnType 00078 HcalDDDGeometryEP::produceAligned(const HcalGeometryRecord& iRecord) 00079 { 00080 //now do what ever other initialization is needed 00081 assert( 0 != m_cpv ) ; 00082 if( 0 == m_loader ) m_loader = new HcalDDDGeometryLoader(*m_cpv); 00083 LogDebug("HCalGeom")<<"HcalDDDGeometryEP:Initialize HcalDDDGeometryLoader"; 00084 00085 ReturnType pC ( m_loader->load() ) ; 00086 00087 return pC ; 00088 } 00089 00090 void 00091 HcalDDDGeometryEP::idealRecordCallBack( const IdealGeometryRecord& iRecord ) 00092 { 00093 edm::ESHandle< DDCompactView > pDD; 00094 iRecord.get( pDD ); 00095 m_cpv = &(*pDD) ; 00096 } 00097 00098