CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BaseHadronizer.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 //
4 
5 // class BaseHadronizer meant as base class for hadronizers
6 // implements a few common methods concerning communication with the
7 // gen::HadronizerFilter<...> and gen::GeneratorFilter<...> templates,
8 // mostly memory management regarding the GenEvent pointers and such
9 
10 #ifndef gen_BaseHadronizer_h
11 #define gen_BaseHadronizer_h
12 
13 #include <memory>
14 
15 #include <boost/shared_ptr.hpp>
16 
18 
21 
24 
28 
29 // foward declarations
30 namespace edm {
31  class Event;
32 }
33 
34 namespace gen {
35 
37  public:
38  BaseHadronizer( edm::ParameterSet const& ps );
40 
41  // GenRunInfo and GenEvent passing
43  HepMC::GenEvent *getGenEvent() { return genEvent_.release(); }
45 
46  void resetEvent(HepMC::GenEvent *event) { genEvent_.reset(event); }
48 
49  // LHERunInfo and LHEEvent passing
50  const boost::shared_ptr<lhef::LHERunInfo> &getLHERunInfo() const { return lheRunInfo_; }
51 
53  void setLHEEvent(lhef::LHEEvent *event) { lheEvent_.reset(event); }
54 
55  // interface for accessing the EDM information from the hadronizer
57  edm::Event &getEDMEvent() const { return *edmEvent_; }
58  virtual bool select(HepMC::GenEvent*) const { return true;}
59 
60  protected:
62  std::auto_ptr<HepMC::GenEvent>& event() { return genEvent_; }
63  std::auto_ptr<GenEventInfoProduct>& eventInfo() { return genEventInfo_; }
64 
65  lhef::LHEEvent* lheEvent() { return lheEvent_.get(); }
67 
68  private:
70  std::auto_ptr<HepMC::GenEvent> genEvent_;
71  std::auto_ptr<GenEventInfoProduct> genEventInfo_;
72 
73  boost::shared_ptr<lhef::LHERunInfo> lheRunInfo_;
74  std::auto_ptr<lhef::LHEEvent> lheEvent_;
75 
77  };
78 
79 } // namespace gen
80 
81 #endif // gen_BaseHadronizer_h
virtual bool select(HepMC::GenEvent *) const
GenRunInfoProduct genRunInfo_
void setEDMEvent(edm::Event &event)
BaseHadronizer(edm::ParameterSet const &ps)
edm::Event * edmEvent_
GenRunInfoProduct & getGenRunInfo()
void resetEventInfo(GenEventInfoProduct *eventInfo)
std::auto_ptr< HepMC::GenEvent > & event()
GenRunInfoProduct & runInfo()
lhef::LHEEvent * lheEvent()
std::auto_ptr< lhef::LHEEvent > lheEvent_
void setLHEEvent(lhef::LHEEvent *event)
std::auto_ptr< GenEventInfoProduct > & eventInfo()
lhef::LHERunInfo * lheRunInfo()
HepMC::GenEvent * getGenEvent()
GenEventInfoProduct * getGenEventInfo()
void setLHERunInfo(lhef::LHERunInfo *runInfo)
void resetEvent(HepMC::GenEvent *event)
std::auto_ptr< HepMC::GenEvent > genEvent_
boost::shared_ptr< lhef::LHERunInfo > lheRunInfo_
std::auto_ptr< GenEventInfoProduct > genEventInfo_
const boost::shared_ptr< lhef::LHERunInfo > & getLHERunInfo() const
edm::Event & getEDMEvent() const