00001 // -------------------------------------------------- 00002 // 00003 // File: GeneratorModule/GenModule.h 00004 // Description: 00005 // This class is the base class used to specify the behavior of all 00006 // event generator module and is meant to capture the common behavior 00007 // of these modules. GenModule inherits the Algorithm interface. 00008 // 00009 // The common behavior currently consists of: 00010 // - Providing a facility for generating multiple generator events 00011 // within a single physics event (to mimic multiple interactions). 00012 // - Providing the access to the HepMC ParticleProperties Table 00013 // - Creating the McEvent and if necessary the McEventCollection 00014 // In the future, this module will also provide the common interface to 00015 // special purpose decay packages such as QQ (for B decays) and Tauola 00016 // (for tau decays) 00017 // 00018 // The following virtual methods should be overloaded from the child class: 00019 // StatusCode genInitialize() 00020 // StatusCode callGenerator() 00021 // StatusCode genFinalize() 00022 // StatusCode fillEvt(GeneratorEvent* evt) 00023 // 00024 00025 #ifndef GENERATORMODULEGENMODULE_H 00026 #define GENERATORMODULEGENMODULE_H 00027 00028 #include "GaudiKernel/Algorithm.h" 00029 #include "HepPDT/ParticleDataTable.hh" 00030 //#include "BesHepMC/GenEvent.h" 00031 #include "HepMC/GenEvent.h" 00032 #include "CLHEP/Random/RandomEngine.h" 00033 #include "CLHEP/Random/RandPoisson.h" 00034 00035 // The following line should replace the 00036 // above one when using CLHEP/HepMC 00037 // #include "CLHEP/HepMC/GenEvent.h" 00038 00039 using HepMC::GenEvent; 00040 00041 class GenModule:public Algorithm { 00042 public: 00043 GenModule(const std::string& name, ISvcLocator* pSvcLocator); 00044 virtual ~GenModule(); 00045 StatusCode initialize(); 00046 StatusCode execute(); 00047 StatusCode finalize(); 00048 00049 virtual StatusCode genInitialize(); 00050 virtual StatusCode genuserInitialize(); 00051 virtual StatusCode callGenerator(); 00052 virtual StatusCode genFinalize(); 00053 virtual StatusCode fillEvt(GenEvent* evt); 00054 00055 protected: 00056 // Here are setable properties:- 00057 bool m_fixedMode; 00058 double m_meanInteractions; 00059 int m_randomSeed; 00060 std::vector<int> m_AllPartons; 00061 std::vector<int> m_StripVector; 00062 bool m_StripPartonSwitch; 00063 void StripPartonsInit(void); 00064 void StripPartons(GenEvent* evt); 00065 00066 // Here are local class data members:- 00067 CLHEP::HepRandomEngine* m_pRandomEngine; 00068 CLHEP::RandPoisson* m_pPoissonGenerator; 00069 00070 // The following is temporary. The particle properties should come 00071 // from the ParticlePropertiesService, but that means replacing the 00072 // Gaudi one with the BES one 00073 HepPDT::ParticleDataTable* m_particleTable; 00074 }; 00075 #endif 00076