CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/GeneratorInterface/Pythia8Interface/interface/Py8GunBase.h

Go to the documentation of this file.
00001 #ifndef gen_Py8GunBase_h
00002 #define gen_Py8GunBase_h
00003 
00004 #include <memory>
00005 
00006 #include <boost/shared_ptr.hpp>
00007 
00008 #include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h"
00009 #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h"
00010 
00011 #include "GeneratorInterface/Pythia8Interface/interface/Py8InterfaceBase.h"
00012 
00013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00014 
00015 #include <Pythia.h>
00016 #include <HepMCInterface.h>
00017 
00018 // foward declarations
00019 namespace edm {
00020   class Event;
00021 }
00022 
00023 namespace gen {
00024 
00025   class Py8GunBase : public Py8InterfaceBase {
00026   public:
00027     Py8GunBase( edm::ParameterSet const& ps );
00028     ~Py8GunBase() {}
00029 
00030     // GenRunInfo and GenEvent passing
00031     GenRunInfoProduct &getGenRunInfo() { return genRunInfo_; }
00032     HepMC::GenEvent *getGenEvent() { return genEvent_.release(); }
00033     GenEventInfoProduct *getGenEventInfo() { return genEventInfo_.release(); }
00034 
00035     void resetEvent(HepMC::GenEvent *event) { genEvent_.reset(event); }
00036     void resetEventInfo(GenEventInfoProduct *eventInfo) { genEventInfo_.reset(eventInfo); }
00037 
00038     // interface for accessing the EDM information from the hadronizer
00039     void setEDMEvent(edm::Event &event) { edmEvent_ = &event; }
00040     edm::Event &getEDMEvent() const { return *edmEvent_; }
00041     virtual bool select(HepMC::GenEvent*) const { return true;}
00042     
00043     virtual bool residualDecay(); // common func
00044     bool initializeForInternalPartons();
00045     void finalizeEvent(); 
00046     void statistics();
00047 
00048   protected:
00049     GenRunInfoProduct& runInfo() { return genRunInfo_; }
00050     std::auto_ptr<HepMC::GenEvent>& event() { return genEvent_; }
00051     std::auto_ptr<GenEventInfoProduct>& eventInfo() { return genEventInfo_; }
00052         
00053     // (some of) PGun parameters
00054     //
00055     std::vector<int> fPartIDs ;
00056     double           fMinPhi ;
00057     double           fMaxPhi ;
00058     
00059   private:
00060     GenRunInfoProduct                   genRunInfo_;
00061     std::auto_ptr<HepMC::GenEvent>      genEvent_;
00062     std::auto_ptr<GenEventInfoProduct>  genEventInfo_;
00063 
00064     edm::Event                          *edmEvent_;
00065 
00066   };
00067 
00068 } // namespace gen
00069 
00070 #endif // gen_Py8GunBase_h