CMS 3D CMS Logo

L1CaloGeometryProd.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: L1GeometryProducers
4 // Class: L1CaloGeometryProd
5 //
13 //
14 // Original Author: Werner Sun
15 // Created: Tue Oct 24 00:00:00 EDT 2006
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
25 
26 
27 //
28 // constants, enums and typedefs
29 //
30 
31 //
32 // static data member definitions
33 //
34 
35 //
36 // constructors and destructor
37 //
39 {
40  //the following line is needed to tell the framework what
41  // data is being produced
42  setWhatProduced(this);
43 
44  //now do what ever other initialization is needed
45 
46  // This producer should never make more than one version of L1Geometry,
47  // so we can initialize it in the ctor.
48  m_geom =
49  L1CaloGeometry( ps.getParameter<unsigned int>("numberGctEmJetPhiBins"),
50  ps.getParameter<double>("gctEmJetPhiBinOffset"),
51  ps.getParameter<unsigned int>("numberGctEtSumPhiBins"),
52  ps.getParameter<double>("gctEtSumPhiBinOffset"),
53  ps.getParameter<unsigned int>("numberGctHtSumPhiBins"),
54  ps.getParameter<double>("gctHtSumPhiBinOffset"),
55  ps.getParameter<unsigned int>("numberGctCentralEtaBinsPerHalf"),
56  ps.getParameter<unsigned int>("numberGctForwardEtaBinsPerHalf"),
57  ps.getParameter<unsigned int>("etaSignBitOffset"),
58  ps.getParameter< std::vector<double> >("gctEtaBinBoundaries") ) ;
59 }
60 
61 
63 {
64 
65  // do anything here that needs to be done at desctruction time
66  // (e.g. close files, deallocate resources etc.)
67 
68 }
69 
70 
71 //
72 // member functions
73 //
74 
75 // ------------ method called to produce the data ------------
78 {
79  using namespace edm::es;
80  std::unique_ptr<L1CaloGeometry> pL1CaloGeometry ;
81 
82  pL1CaloGeometry = std::unique_ptr< L1CaloGeometry >(
83  new L1CaloGeometry( m_geom ) ) ;
84 
85  return pL1CaloGeometry ;
86 }
87 
88 //define this as a plug-in
T getParameter(std::string const &) const
ReturnType produce(const L1CaloGeometryRecord &)
~L1CaloGeometryProd() override
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
L1CaloGeometry m_geom
L1CaloGeometryProd(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
std::unique_ptr< L1CaloGeometry > ReturnType