CMS 3D CMS Logo

RPCTriggerBxOrConfig.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RPCTriggerBxOrConfig
4 // Class: RPCTriggerBxOrConfig
5 //
13 //
14 // Original Author: Tomasz Maciej Frueboes
15 // Created: Wed Apr 9 13:57:29 CEST 2008
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
25 
27 
30 
31 //
32 // class decleration
33 //
34 
36 public:
38  ~RPCTriggerBxOrConfig() override;
39 
40  typedef std::unique_ptr<L1RPCBxOrConfig> ReturnType;
41 
42  ReturnType produce(const L1RPCBxOrConfigRcd&);
43 
44 private:
45  int m_firstBX;
46  int m_lastBX;
47 };
48 
49 //
50 // constants, enums and typedefs
51 //
52 
53 //
54 // static data member definitions
55 //
56 
57 //
58 // constructors and destructor
59 //
61  //the following line is needed to tell the framework what
62  // data is being produced
63  setWhatProduced(this);
64 
65  m_firstBX = iConfig.getParameter<int>("firstBX");
66  m_lastBX = iConfig.getParameter<int>("lastBX");
67 }
68 
70 
71 //
72 // member functions
73 //
74 
75 // ------------ method called to produce the data ------------
77  auto pRPCTriggerBxOrConfig = std::make_unique<L1RPCBxOrConfig>();
78 
79  if (m_firstBX > m_lastBX)
80  throw cms::Exception("BadConfig") << " firstBX < m_lastBX "
81  << "\n";
82 
83  pRPCTriggerBxOrConfig->setFirstBX(m_firstBX);
84  pRPCTriggerBxOrConfig->setLastBX(m_lastBX);
85 
86  return pRPCTriggerBxOrConfig;
87 }
88 
89 //define this as a plug-in
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
RPCTriggerBxOrConfig(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
ReturnType produce(const L1RPCBxOrConfigRcd &)
std::unique_ptr< L1RPCBxOrConfig > ReturnType