Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:17

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1GeometryProducers
0004 // Class:      L1CaloGeometryProd
0005 //
0006 /**\class L1CaloGeometryProd L1CaloGeometryProd.h
0007  L1TriggerConfig/L1GeometryProducers/interface/L1CaloGeometryProd.h
0008 
0009  Description: <one line class summary>
0010 
0011  Implementation:
0012      <Notes on implementation>
0013 */
0014 //
0015 // Original Author:  Werner Sun
0016 //         Created:  Tue Oct 24 00:00:00 EDT 2006
0017 //
0018 //
0019 
0020 // system include files
0021 #include <memory>
0022 
0023 // user include files
0024 #include "L1TriggerConfig/L1GeometryProducers/interface/L1CaloGeometryProd.h"
0025 
0026 //
0027 // constants, enums and typedefs
0028 //
0029 
0030 //
0031 // static data member definitions
0032 //
0033 
0034 //
0035 // constructors and destructor
0036 //
0037 L1CaloGeometryProd::L1CaloGeometryProd(const edm::ParameterSet &ps) {
0038   // the following line is needed to tell the framework what
0039   // data is being produced
0040   setWhatProduced(this);
0041 
0042   // now do what ever other initialization is needed
0043 
0044   // This producer should never make more than one version of L1Geometry,
0045   // so we can initialize it in the ctor.
0046   m_geom = L1CaloGeometry(ps.getParameter<unsigned int>("numberGctEmJetPhiBins"),
0047                           ps.getParameter<double>("gctEmJetPhiBinOffset"),
0048                           ps.getParameter<unsigned int>("numberGctEtSumPhiBins"),
0049                           ps.getParameter<double>("gctEtSumPhiBinOffset"),
0050                           ps.getParameter<unsigned int>("numberGctHtSumPhiBins"),
0051                           ps.getParameter<double>("gctHtSumPhiBinOffset"),
0052                           ps.getParameter<unsigned int>("numberGctCentralEtaBinsPerHalf"),
0053                           ps.getParameter<unsigned int>("numberGctForwardEtaBinsPerHalf"),
0054                           ps.getParameter<unsigned int>("etaSignBitOffset"),
0055                           ps.getParameter<std::vector<double>>("gctEtaBinBoundaries"));
0056 }
0057 
0058 L1CaloGeometryProd::~L1CaloGeometryProd() {
0059   // do anything here that needs to be done at desctruction time
0060   // (e.g. close files, deallocate resources etc.)
0061 }
0062 
0063 //
0064 // member functions
0065 //
0066 
0067 // ------------ method called to produce the data  ------------
0068 L1CaloGeometryProd::ReturnType L1CaloGeometryProd::produce(const L1CaloGeometryRecord &iRecord) {
0069   using namespace edm::es;
0070   std::unique_ptr<L1CaloGeometry> pL1CaloGeometry;
0071 
0072   pL1CaloGeometry = std::make_unique<L1CaloGeometry>(m_geom);
0073 
0074   return pL1CaloGeometry;
0075 }
0076 
0077 // define this as a plug-in
0078 DEFINE_FWK_EVENTSETUP_MODULE(L1CaloGeometryProd);