CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/L1TriggerConfig/L1GeometryProducers/src/L1CaloGeometryProd.cc

Go to the documentation of this file.
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.4 2009/09/28 23:02:20 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>("numberGctHtSumPhiBins"),
00056                      ps.getParameter<double>("gctHtSumPhiBinOffset"),
00057                      ps.getParameter<unsigned int>("numberGctCentralEtaBinsPerHalf"),
00058                      ps.getParameter<unsigned int>("numberGctForwardEtaBinsPerHalf"),
00059                      ps.getParameter<unsigned int>("etaSignBitOffset"),
00060                      ps.getParameter< std::vector<double> >("gctEtaBinBoundaries") ) ;
00061 }
00062 
00063 
00064 L1CaloGeometryProd::~L1CaloGeometryProd()
00065 {
00066  
00067    // do anything here that needs to be done at desctruction time
00068    // (e.g. close files, deallocate resources etc.)
00069 
00070 }
00071 
00072 
00073 //
00074 // member functions
00075 //
00076 
00077 // ------------ method called to produce the data  ------------
00078 L1CaloGeometryProd::ReturnType
00079 L1CaloGeometryProd::produce(const L1CaloGeometryRecord& iRecord)
00080 {
00081    using namespace edm::es;
00082    std::auto_ptr<L1CaloGeometry> pL1CaloGeometry ;
00083 
00084    pL1CaloGeometry = std::auto_ptr< L1CaloGeometry >(
00085       new L1CaloGeometry( m_geom ) ) ;
00086 
00087    return pL1CaloGeometry ;
00088 }
00089 
00090 //define this as a plug-in
00091 DEFINE_FWK_EVENTSETUP_MODULE(L1CaloGeometryProd) ;