CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Py8GunBase.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 //
4 
5 //
6 // This class is a "Hadronizer" template (see GeneratorInterface/Core)
7 //
8 
9 #ifndef gen_Py8GunBase_h
10 #define gen_Py8GunBase_h
11 
12 #include <memory>
13 
14 #include <boost/shared_ptr.hpp>
15 
17 
20 
22 
24 
25 #include <Pythia8/Pythia.h>
26 #include <Pythia8Plugins/HepMC2.h>
27 
28 // foward declarations
29 namespace edm {
30  class Event;
31 }
32 
33 namespace gen {
34 
35  class Py8GunBase : public Py8InterfaceBase {
36  public:
37  Py8GunBase( edm::ParameterSet const& ps );
39 
40  // GenRunInfo and GenEvent passing
42  HepMC::GenEvent *getGenEvent() { return genEvent_.release(); }
44 
45  void resetEvent(HepMC::GenEvent *event) { genEvent_.reset(event); }
47 
48  // interface for accessing the EDM information from the hadronizer
50  edm::Event &getEDMEvent() const { return *edmEvent_; }
51  virtual bool select(HepMC::GenEvent*) const { return true;}
52 
53  virtual bool residualDecay(); // common func
55  void finalizeEvent();
56  void statistics();
57 
58  protected:
60  std::auto_ptr<HepMC::GenEvent>& event() { return genEvent_; }
61  std::auto_ptr<GenEventInfoProduct>& eventInfo() { return genEventInfo_; }
62 
63  // (some of) PGun parameters
64  //
65  std::vector<int> fPartIDs ;
66  double fMinPhi ;
67  double fMaxPhi ;
68 
69  private:
71  std::auto_ptr<HepMC::GenEvent> genEvent_;
72  std::auto_ptr<GenEventInfoProduct> genEventInfo_;
73 
75 
76  };
77 
78 } // namespace gen
79 
80 #endif // gen_BaseHadronizer_h
HepMC::GenEvent * getGenEvent()
Definition: Py8GunBase.h:42
void resetEventInfo(GenEventInfoProduct *eventInfo)
Definition: Py8GunBase.h:46
double fMinPhi
Definition: Py8GunBase.h:66
std::auto_ptr< HepMC::GenEvent > genEvent_
Definition: Py8GunBase.h:71
virtual bool select(HepMC::GenEvent *) const
Definition: Py8GunBase.h:51
bool initializeForInternalPartons()
Definition: Py8GunBase.cc:37
virtual bool residualDecay()
Definition: Py8GunBase.cc:57
std::auto_ptr< GenEventInfoProduct > & eventInfo()
Definition: Py8GunBase.h:61
GenRunInfoProduct genRunInfo_
Definition: Py8GunBase.h:70
void finalizeEvent()
Definition: Py8GunBase.cc:134
std::auto_ptr< GenEventInfoProduct > genEventInfo_
Definition: Py8GunBase.h:72
edm::Event * edmEvent_
Definition: Py8GunBase.h:74
std::vector< int > fPartIDs
Definition: Py8GunBase.h:65
std::auto_ptr< HepMC::GenEvent > & event()
Definition: Py8GunBase.h:60
void setEDMEvent(edm::Event &event)
Definition: Py8GunBase.h:49
edm::Event & getEDMEvent() const
Definition: Py8GunBase.h:50
GenRunInfoProduct & getGenRunInfo()
Definition: Py8GunBase.h:41
GenEventInfoProduct * getGenEventInfo()
Definition: Py8GunBase.h:43
void resetEvent(HepMC::GenEvent *event)
Definition: Py8GunBase.h:45
double fMaxPhi
Definition: Py8GunBase.h:67
Py8GunBase(edm::ParameterSet const &ps)
Definition: Py8GunBase.cc:7
GenRunInfoProduct & runInfo()
Definition: Py8GunBase.h:59