00001 // -*- C++ -*- 00002 // 00003 // Package: L1GeometryProducers 00004 // Class: L1CaloGeometryProd 00005 // 00013 // 00014 // Original Author: Werner Sun 00015 // Created: Tue Oct 24 00:00:00 EDT 2006 00016 // $Id: L1CaloGeometryProd.cc,v 1.2 2008/04/18 00:01:00 wsun Exp $ 00017 // 00018 // 00019 00020 00021 // system include files 00022 #include <memory> 00023 #include "boost/shared_ptr.hpp" 00024 00025 // user include files 00026 #include "L1TriggerConfig/L1GeometryProducers/interface/L1CaloGeometryProd.h" 00027 00028 00029 // 00030 // constants, enums and typedefs 00031 // 00032 00033 // 00034 // static data member definitions 00035 // 00036 00037 // 00038 // constructors and destructor 00039 // 00040 L1CaloGeometryProd::L1CaloGeometryProd(const edm::ParameterSet& ps) 00041 { 00042 //the following line is needed to tell the framework what 00043 // data is being produced 00044 setWhatProduced(this); 00045 00046 //now do what ever other initialization is needed 00047 00048 // This producer should never make more than one version of L1Geometry, 00049 // so we can initialize it in the ctor. 00050 m_geom = 00051 L1CaloGeometry( ps.getParameter<unsigned int>("numberGctEmJetPhiBins"), 00052 ps.getParameter<double>("gctEmJetPhiBinOffset"), 00053 ps.getParameter<unsigned int>("numberGctEtSumPhiBins"), 00054 ps.getParameter<double>("gctEtSumPhiBinOffset"), 00055 ps.getParameter<unsigned int>("numberGctCentralEtaBinsPerHalf"), 00056 ps.getParameter<unsigned int>("numberGctForwardEtaBinsPerHalf"), 00057 ps.getParameter<unsigned int>("etaSignBitOffset"), 00058 ps.getParameter< std::vector<double> >("gctEtaBinBoundaries") ) ; 00059 } 00060 00061 00062 L1CaloGeometryProd::~L1CaloGeometryProd() 00063 { 00064 00065 // do anything here that needs to be done at desctruction time 00066 // (e.g. close files, deallocate resources etc.) 00067 00068 } 00069 00070 00071 // 00072 // member functions 00073 // 00074 00075 // ------------ method called to produce the data ------------ 00076 L1CaloGeometryProd::ReturnType 00077 L1CaloGeometryProd::produce(const L1CaloGeometryRecord& iRecord) 00078 { 00079 using namespace edm::es; 00080 std::auto_ptr<L1CaloGeometry> pL1CaloGeometry ; 00081 00082 pL1CaloGeometry = std::auto_ptr< L1CaloGeometry >( 00083 new L1CaloGeometry( m_geom ) ) ; 00084 00085 return pL1CaloGeometry ; 00086 } 00087 00088 //define this as a plug-in 00089 //DEFINE_FWK_EVENTSETUP_MODULE(L1CaloGeometryProd)