00001 // -*- C++ -*- 00002 // 00003 // Package: HcalHardcodeGeometryEP 00004 // Class: HcalHardcodeGeometryEP 00005 // 00013 // 00014 // Original Author: Jeremiah Mans 00015 // Created: Mon Oct 3 11:35:27 CDT 2005 00016 // $Id: HcalHardcodeGeometryEP.cc,v 1.12 2012/03/22 10:30:51 sunanda Exp $ 00017 // 00018 // 00019 00020 #include "Geometry/HcalEventSetup/interface/HcalHardcodeGeometryEP.h" 00021 00022 #include "FWCore/Framework/interface/ESHandle.h" 00023 #include "Geometry/Records/interface/IdealGeometryRecord.h" 00024 #include "Geometry/Records/interface/HcalGeometryRecord.h" 00025 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" 00026 #include "Geometry/HcalTowerAlgo/interface/HcalFlexiHardcodeGeometryLoader.h" 00027 #include "Geometry/HcalTowerAlgo/interface/HcalGeometry.h" 00028 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00029 00030 class HcalTopology; 00031 00032 // 00033 // constants, enums and typedefs 00034 // 00035 00036 // 00037 // static data member definitions 00038 // 00039 00040 // 00041 // constructors and destructor 00042 // 00043 00044 HcalHardcodeGeometryEP::HcalHardcodeGeometryEP( const edm::ParameterSet& ps ) : ps0(ps) { 00045 00046 //the following line is needed to tell the framework what 00047 // data is being produced 00048 setWhatProduced( this, 00049 &HcalHardcodeGeometryEP::produceAligned, 00050 dependsOn( &HcalHardcodeGeometryEP::idealRecordCallBack ), 00051 HcalGeometry::producerTag() ); 00052 00053 // disable 00054 // setWhatProduced( this, 00055 // &HcalHardcodeGeometryEP::produceIdeal, 00056 // edm::es::Label( "HCAL" ) ); 00057 } 00058 00059 00060 HcalHardcodeGeometryEP::~HcalHardcodeGeometryEP() 00061 { 00062 } 00063 00064 00065 // 00066 // member functions 00067 // 00068 00069 // ------------ method called to produce the data ------------ 00070 00071 void 00072 HcalHardcodeGeometryEP::idealRecordCallBack( const IdealGeometryRecord& iRecord ) 00073 { 00074 } 00075 00076 HcalHardcodeGeometryEP::ReturnType 00077 HcalHardcodeGeometryEP::produceIdeal( const IdealGeometryRecord& iRecord ) 00078 { 00079 00080 edm::LogInfo("HCAL") << "Using default HCAL topology" ; 00081 edm::ESHandle<HcalTopology> topology ; 00082 iRecord.get( topology ) ; 00083 HcalFlexiHardcodeGeometryLoader loader(ps0); 00084 return ReturnType (loader.load (*topology)); 00085 } 00086 00087 HcalHardcodeGeometryEP::ReturnType 00088 HcalHardcodeGeometryEP::produceAligned( const HcalGeometryRecord& iRecord ) 00089 { 00090 const IdealGeometryRecord& idealRecord = iRecord.getRecord<IdealGeometryRecord>(); 00091 return produceIdeal (idealRecord); 00092 } 00093