00001 #ifndef gen_Pythia6Service_h 00002 #define gen_Pythia6Service_h 00003 00004 #include <vector> 00005 00006 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h" 00007 #include "FWCore/Utilities/interface/Exception.h" 00008 00009 #include "GeneratorInterface/Core/interface/FortranInstance.h" 00010 00011 // #include "HepMC/PythiaWrapper6_2.h" 00012 00013 namespace CLHEP 00014 { 00015 class HepRandomEngine; 00016 } 00017 00018 namespace gen 00019 { 00020 00021 // the callbacks from Pythia which are passed on to the Pythia6Service 00022 extern "C" { 00023 double pyr_(int* idummy); 00024 } 00025 00026 class Pythia6Service : public FortranInstance 00027 { 00028 public: 00029 // ctor & dtor 00030 Pythia6Service(); 00031 Pythia6Service( edm::ParameterSet const& ); 00032 ~Pythia6Service() ; 00033 00034 void setGeneralParams(); 00035 void setCSAParams(); 00036 void setSLHAParams(); 00037 void setPYUPDAParams(bool afterPyinit); 00038 void setSLHAFromHeader( const std::vector<std::string> &lines ); 00039 00040 void openSLHA( const char* ); 00041 void closeSLHA(); 00042 void openPYUPDA( const char*, bool write_file ); 00043 void closePYUPDA(); 00044 00045 // initialise Pythia on first call from "dummy" instance 00046 virtual void enter(); 00047 00048 private: 00049 friend double gen::pyr_(int*); 00050 00051 bool fInitialising; 00052 00053 CLHEP::HepRandomEngine* fRandomEngine; 00054 00055 std::vector<std::string> fParamGeneral; 00056 std::vector<std::string> fParamCSA; 00057 std::vector<std::string> fParamSLHA; 00058 std::vector<std::string> fParamPYUPDA; 00059 int fUnitSLHA; 00060 int fUnitPYUPDA; 00061 00062 static Pythia6Service *fPythia6Owner; 00063 }; 00064 00065 } 00066 00067 #endif