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 #include <string>
14 #include <vector>
15 
16 #include <boost/shared_ptr.hpp>
17 
19 
22 
24 
26 
27 #include <Pythia8/Pythia.h>
28 #include <Pythia8Plugins/HepMC2.h>
29 
30 // foward declarations
31 namespace edm {
32  class Event;
33 }
34 
35 namespace CLHEP {
36  class HepRandomEngine;
37 }
38 
39 namespace gen {
40 
41  class Py8GunBase : public Py8InterfaceBase {
42  public:
43  Py8GunBase( edm::ParameterSet const& ps );
45 
46  // GenRunInfo and GenEvent passing
48  HepMC::GenEvent *getGenEvent() { return genEvent_.release(); }
50 
51  void resetEvent(HepMC::GenEvent *event) { genEvent_.reset(event); }
53 
54  // interface for accessing the EDM information from the hadronizer
56  edm::Event &getEDMEvent() const { return *edmEvent_; }
57  virtual bool select(HepMC::GenEvent*) const { return true;}
58 
59  virtual bool residualDecay(); // common func
61  void finalizeEvent();
62  void statistics();
63 
64  void setRandomEngine(CLHEP::HepRandomEngine* v) { p8SetRandomEngine(v); }
65  std::vector<std::string> const& sharedResources() const { return p8SharedResources; }
66 
67  protected:
69  std::auto_ptr<HepMC::GenEvent>& event() { return genEvent_; }
70  std::auto_ptr<GenEventInfoProduct>& eventInfo() { return genEventInfo_; }
71 
72  // (some of) PGun parameters
73  //
74  std::vector<int> fPartIDs ;
75  double fMinPhi ;
76  double fMaxPhi ;
77 
78  private:
80  std::auto_ptr<HepMC::GenEvent> genEvent_;
81  std::auto_ptr<GenEventInfoProduct> genEventInfo_;
82 
84 
85  static const std::vector<std::string> p8SharedResources;
86  };
87 
88 } // namespace gen
89 
90 #endif // gen_BaseHadronizer_h
HepMC::GenEvent * getGenEvent()
Definition: Py8GunBase.h:48
std::vector< std::string > const & sharedResources() const
Definition: Py8GunBase.h:65
void resetEventInfo(GenEventInfoProduct *eventInfo)
Definition: Py8GunBase.h:52
void p8SetRandomEngine(CLHEP::HepRandomEngine *v)
double fMinPhi
Definition: Py8GunBase.h:75
std::auto_ptr< HepMC::GenEvent > genEvent_
Definition: Py8GunBase.h:80
virtual bool select(HepMC::GenEvent *) const
Definition: Py8GunBase.h:57
bool initializeForInternalPartons()
Definition: Py8GunBase.cc:42
virtual bool residualDecay()
Definition: Py8GunBase.cc:62
double v[5][pyjets_maxn]
std::auto_ptr< GenEventInfoProduct > & eventInfo()
Definition: Py8GunBase.h:70
GenRunInfoProduct genRunInfo_
Definition: Py8GunBase.h:79
void finalizeEvent()
Definition: Py8GunBase.cc:114
std::auto_ptr< GenEventInfoProduct > genEventInfo_
Definition: Py8GunBase.h:81
edm::Event * edmEvent_
Definition: Py8GunBase.h:83
static const std::vector< std::string > p8SharedResources
Definition: Py8GunBase.h:85
std::vector< int > fPartIDs
Definition: Py8GunBase.h:74
std::auto_ptr< HepMC::GenEvent > & event()
Definition: Py8GunBase.h:69
void setEDMEvent(edm::Event &event)
Definition: Py8GunBase.h:55
edm::Event & getEDMEvent() const
Definition: Py8GunBase.h:56
GenRunInfoProduct & getGenRunInfo()
Definition: Py8GunBase.h:47
GenEventInfoProduct * getGenEventInfo()
Definition: Py8GunBase.h:49
void resetEvent(HepMC::GenEvent *event)
Definition: Py8GunBase.h:51
double fMaxPhi
Definition: Py8GunBase.h:76
void setRandomEngine(CLHEP::HepRandomEngine *v)
Definition: Py8GunBase.h:64
Py8GunBase(edm::ParameterSet const &ps)
Definition: Py8GunBase.cc:12
GenRunInfoProduct & runInfo()
Definition: Py8GunBase.h:68