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  // not allowed and not implemented
17  LHEProxy(const LHEProxy &orig) = delete;
18  LHEProxy &operator=(const LHEProxy &orig) = delete;
19 
20  ~LHEProxy();
21 
22  const std::shared_ptr<LHERunInfo> &getRunInfo() const { return runInfo; }
23  const std::shared_ptr<LHEEvent> &getEvent() const { return event; }
24 
25  std::shared_ptr<LHERunInfo> releaseRunInfo() {
26  std::shared_ptr<LHERunInfo> result(runInfo);
27  runInfo.reset();
28  return result;
29  }
30  std::shared_ptr<LHEEvent> releaseEvent() {
31  std::shared_ptr<LHEEvent> result(event);
32  event.reset();
33  return result;
34  }
35 
36  void clearRunInfo() { runInfo.reset(); }
37  void clearEvent() { event.reset(); }
38 
39  void loadRunInfo(const std::shared_ptr<LHERunInfo> &runInfo) { this->runInfo = runInfo; }
40  void loadEvent(const std::shared_ptr<LHEEvent> &event) { this->event = event; }
41 
42  ProxyID getID() const { return id; }
43 
44  static std::shared_ptr<LHEProxy> create();
45  static std::shared_ptr<LHEProxy> find(ProxyID id);
46 
47  private:
48  LHEProxy(ProxyID id);
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
std::shared_ptr< LHERunInfo > runInfo
Definition: LHEProxy.h:52
LHEProxy(const LHEProxy &orig)=delete
static std::shared_ptr< LHEProxy > find(ProxyID id)
Definition: LHEProxy.cc:50
LHEProxy & operator=(const LHEProxy &orig)=delete
const ProxyID id
Definition: LHEProxy.h:50
void clearEvent()
Definition: LHEProxy.h:37
std::shared_ptr< LHERunInfo > releaseRunInfo()
Definition: LHEProxy.h:25
static std::shared_ptr< LHEProxy > create()
Definition: LHEProxy.cc:36
void loadRunInfo(const std::shared_ptr< LHERunInfo > &runInfo)
Definition: LHEProxy.h:39
std::shared_ptr< LHEEvent > event
Definition: LHEProxy.h:53
const std::shared_ptr< LHERunInfo > & getRunInfo() const
Definition: LHEProxy.h:22
void loadEvent(const std::shared_ptr< LHEEvent > &event)
Definition: LHEProxy.h:40
const std::shared_ptr< LHEEvent > & getEvent() const
Definition: LHEProxy.h:23
ProxyID getID() const
Definition: LHEProxy.h:42
unsigned long ProxyID
Definition: LHEProxy.h:14
std::shared_ptr< LHEEvent > releaseEvent()
Definition: LHEProxy.h:30
void clearRunInfo()
Definition: LHEProxy.h:36
Definition: event.py:1