CMS 3D CMS Logo

LHEProxy.h
Go to the documentation of this file.
1 #ifndef GeneratorInterface_LHEInterface_LHEProxy_h
2 #define GeneratorInterface_LHEInterface_LHEProxy_h
3 
4 #include <memory>
5 
6 namespace lhef {
7 
8  // forward declarations
9  class LHEEvent;
10  class LHERunInfo;
11 
12  class LHEProxy {
13  public:
14  typedef unsigned long ProxyID;
15 
16  ~LHEProxy();
17 
18  const std::shared_ptr<LHERunInfo> &getRunInfo() const { return runInfo; }
19  const std::shared_ptr<LHEEvent> &getEvent() const { return event; }
20 
21  std::shared_ptr<LHERunInfo> releaseRunInfo() {
22  std::shared_ptr<LHERunInfo> result(runInfo);
23  runInfo.reset();
24  return result;
25  }
26  std::shared_ptr<LHEEvent> releaseEvent() {
27  std::shared_ptr<LHEEvent> result(event);
28  event.reset();
29  return result;
30  }
31 
32  void clearRunInfo() { runInfo.reset(); }
33  void clearEvent() { event.reset(); }
34 
35  void loadRunInfo(const std::shared_ptr<LHERunInfo> &runInfo) { this->runInfo = runInfo; }
36  void loadEvent(const std::shared_ptr<LHEEvent> &event) { this->event = event; }
37 
38  ProxyID getID() const { return id; }
39 
40  static std::shared_ptr<LHEProxy> create();
41  static std::shared_ptr<LHEProxy> find(ProxyID id);
42 
43  private:
44  LHEProxy(ProxyID id);
45 
46  // not allowed and not implemented
47  LHEProxy(const LHEProxy &orig) = delete;
48  LHEProxy &operator=(const LHEProxy &orig) = delete;
49 
50  const ProxyID id;
51 
52  std::shared_ptr<LHERunInfo> runInfo;
53  std::shared_ptr<LHEEvent> event;
54  };
55 
56 } // namespace lhef
57 
58 #endif // GeneratorProxy_LHEInterface_LHEProxy_h
lhef::LHEProxy::loadRunInfo
void loadRunInfo(const std::shared_ptr< LHERunInfo > &runInfo)
Definition: LHEProxy.h:35
lhef::LHEProxy
Definition: LHEProxy.h:12
lhef::LHEProxy::operator=
LHEProxy & operator=(const LHEProxy &orig)=delete
lhef::LHEProxy::LHEProxy
LHEProxy(ProxyID id)
Definition: LHEProxy.cc:27
particlelevel_cff.LHERunInfo
LHERunInfo
Definition: particlelevel_cff.py:56
lhef::LHEProxy::~LHEProxy
~LHEProxy()
Definition: LHEProxy.cc:29
lhef::LHEProxy::clearEvent
void clearEvent()
Definition: LHEProxy.h:33
lhef::LHEProxy::getEvent
const std::shared_ptr< LHEEvent > & getEvent() const
Definition: LHEProxy.h:19
lhef::LHEProxy::id
const ProxyID id
Definition: LHEProxy.h:50
lhef::LHEProxy::event
std::shared_ptr< LHEEvent > event
Definition: LHEProxy.h:53
lhef::LHEProxy::loadEvent
void loadEvent(const std::shared_ptr< LHEEvent > &event)
Definition: LHEProxy.h:36
lhef::LHEProxy::create
static std::shared_ptr< LHEProxy > create()
Definition: LHEProxy.cc:37
lhef
Definition: ExhumeHadronizer.h:12
lhef::LHEProxy::getRunInfo
const std::shared_ptr< LHERunInfo > & getRunInfo() const
Definition: LHEProxy.h:18
lhef::LHEProxy::clearRunInfo
void clearRunInfo()
Definition: LHEProxy.h:32
lhef::LHEProxy::releaseRunInfo
std::shared_ptr< LHERunInfo > releaseRunInfo()
Definition: LHEProxy.h:21
lhef::LHEProxy::getID
ProxyID getID() const
Definition: LHEProxy.h:38
lhef::LHEProxy::ProxyID
unsigned long ProxyID
Definition: LHEProxy.h:14
lhef::LHEProxy::runInfo
std::shared_ptr< LHERunInfo > runInfo
Definition: LHEProxy.h:52
mps_fire.result
result
Definition: mps_fire.py:303
event
Definition: event.py:1
lhef::LHEProxy::releaseEvent
std::shared_ptr< LHEEvent > releaseEvent()
Definition: LHEProxy.h:26
lhef::LHEProxy::find
static std::shared_ptr< LHEProxy > find(ProxyID id)
Definition: LHEProxy.cc:51