#include <Phojet.hh>
Public Types | |
enum | Result { SUCCESS = 1, FAILURE = 0 } |
Really just syntactic sugar for bool returns from setParam. More... | |
Public Member Functions | |
Phojet () | |
Standard constructor. | |
virtual | ~Phojet () |
Destructor. | |
void | setGenSpecificInitialState (PdgCode p1=PROTON, double e1=7000.0, PdgCode p2=PROTON, double e2=7000.0) |
Set up initial state from supplied params. | |
const string | getName () const |
Get the generator name. | |
void | makeEvent (HepMC::GenEvent &evt) |
Run the generator for one event. | |
virtual void | setSeed (const int value) |
Set the random number generator seed. | |
virtual bool | setParam (const string &name, const string &value) |
Pass an string parameter to the generator. | |
string | getPDFSet (PdgCode pid) |
int | getPDFMember (PdgCode pid) |
Get the PDF id number for a given particle. | |
string | getPDFScheme (PdgCode pid) const |
Get the PDF scheme used by the generator (LHAPDF or other). | |
virtual const double | getCrossSection () |
Return the generated cross section in pb. | |
virtual const string | getVersion () |
Get the generator version. This implementation is used as a last resort to determine the generator version. Ideally a specific generator will know its own version and overwrite this. Some generators (e.g. FHerwig) don't know this. | |
void | finalize () |
Tidy up after ourselves. | |
void | setInitialState (int p1=PROTON, double e1=7000.0, int p2=PROTON, double e2=7000.0) |
Define initial state. | |
virtual const GeneratorState & | getState () |
Get a generator state object. | |
virtual void | setState (const GeneratorState &state) |
Setup the generator from a generator state object. | |
virtual void | setVersion (const std::string &version) |
Set the generator version. | |
virtual bool | setParam (const std::string &name, const int &value) |
Pass an int-valued parameter to the generator. | |
virtual bool | setParam (const std::string &name, const unsigned int &value) |
Pass an int-valued parameter to the generator. | |
virtual bool | setParam (const std::string &name, const long &value) |
Pass an int-valued parameter to the generator. | |
virtual bool | setParam (const std::string &name, const unsigned long &value) |
Pass an int-valued parameter to the generator. | |
virtual bool | setParam (const std::string &name, const double &value) |
Pass a double/float-valued parameter to the generator. | |
virtual bool | setParam (const std::string &name, const float &value) |
Pass a double/float-valued parameter to the generator. | |
virtual bool | setParam (const std::string &name, const bool &value) |
Pass a bool-valued parameter to the generator. | |
virtual bool | setParam (const std::string &name, const std::string &value) |
Pass a string-valued parameter to the generator. | |
Protected Member Functions | |
void | initialize () |
Set up default params etc. | |
void | fillEvent (HepMC::GenEvent &evt) |
Fill a HepMC event. | |
Log & | getLog () const |
Get named logger. | |
virtual void | clearEvent (HepMC::GenEvent &evt) |
Clear the supplied event. | |
Protected Attributes | |
string | _particleName1 |
Internal storage of initial state params. | |
string | _particleName2 |
double | _e1 |
double | _e2 |
double * | _p1 |
double * | _p2 |
int | _nevt |
Event counter. | |
double | _pz |
HepMC::IO_HEPEVT | _hepevt |
HEPEVT->HepMC converter. | |
double | _crossSection |
bool | _initialstateset |
Flag for detecting whether the setInitialState method has run. | |
bool | _initialized |
Flag for detecting whether the initialization method has run. | |
map< PdgCode, std::string > | _particleNames |
Collection of translated names for particles. | |
string | _myName |
Generator name. |
Abstract base class for the Fortran-based Phojet generator
Definition at line 11 of file Phojet.hh.
enum Result [inherited] |
Really just syntactic sugar for bool returns from setParam.
Definition at line 37 of file Generator.hh.
Phojet | ( | ) |
Standard constructor.
Pythia uses HEPEVT with 4000/10000 entries and 8-byte floats
For Pythia, other "normal" particles are: gamma/e-, gamma/e+, gamma/mu-, gamma/mu+, gamma/tau-, gamma/tau+, pi0 Also, with crappy PDF parameterisations and other defects: K+, K-, KS0, KL0, Lambda0, Sigma-, Sigma0, Sigma+, Xi-, Xi0, Omega And, not useable at the moment: pomeron, reggeon
Definition at line 15 of file Phojet.cc.
References Phojet::_nevt, Generator::_particleNames, AGILe::ANTIMUON, AGILe::ANTINEUTRON, AGILe::ANTIPROTON, call_pyhepc(), AGILe::ELECTRON, FC_INITPYDATA, FC_PHO_INIT, FC_PYDAT1, FC_PYJETS, AGILe::MUON, AGILe::NEUTRON, AGILe::NU_E, AGILe::NU_EBAR, AGILe::NU_MU, AGILe::NU_MUBAR, AGILe::NU_TAU, AGILe::NU_TAUBAR, AGILe::PHOTON, AGILe::PIMINUS, AGILe::PIPLUS, AGILe::POSITRON, and AGILe::PROTON.
00015 { 00017 FC_PYJETS.n = 0; //< Ensure dummyness of the next call 00018 call_pyhepc(1); 00019 //HepMC::HEPEVT_Wrapper::set_max_number_entries(4000); 00020 //HepMC::HEPEVT_Wrapper::set_sizeof_real(8); 00021 HepMC::HEPEVT_Wrapper::set_max_number_entries(FC_PYDAT1.mstu[8-1]); 00022 //HepMC::HEPEVT_Wrapper::set_max_number_entries(10000); 00023 HepMC::HEPEVT_Wrapper::set_sizeof_real(8); 00024 00025 // Start counting events at 1. 00026 _nevt = 1; 00027 00028 // Initialize Phojet 00029 int irej=0; 00030 int mode = -1; 00031 FC_PHO_INIT(&mode,&irej); 00032 00033 // Initialize Pythia PYDATA block data as external 00034 FC_INITPYDATA(); 00035 00036 // Write the full shower structure 00037 //setParam("MSTP(125)", 2); 00038 00039 // Tell Pythia not to write multiple copies of particles in event record. 00040 //setParam("MSTP(128)", 2); 00041 00042 // Set up particle names map 00044 _particleNames[ELECTRON] = "e-"; 00045 _particleNames[POSITRON] = "e+"; 00046 _particleNames[PROTON] = "p+"; 00047 _particleNames[ANTIPROTON] = "pbar-"; 00048 _particleNames[NEUTRON] = "n0"; 00049 _particleNames[ANTINEUTRON] = "nbar0"; 00050 _particleNames[PHOTON] = "gamma"; 00051 _particleNames[MUON] = "mu-"; 00052 _particleNames[ANTIMUON] = "mu+"; 00053 // TAU, ANTITAU 00054 _particleNames[NU_E] = "nu_e"; 00055 _particleNames[NU_EBAR] = "nu_ebar"; 00056 _particleNames[NU_MU] = "nu_mu"; 00057 _particleNames[NU_MUBAR] = "nu_mubar"; 00058 _particleNames[NU_TAU] = "nu_tau"; 00059 _particleNames[NU_TAUBAR] = "nu_taubar"; 00060 _particleNames[PIPLUS] = "pi+"; 00061 _particleNames[PIMINUS] = "pi-"; 00062 // PIZERO 00063 // PHOTOELECTRON, PHOTOPOSITRON, 00064 // PHOTOMUON, PHOTOANTIMUON, 00065 // PHOTOTAU, PHOTOANTITAU, 00072 }
virtual ~Phojet | ( | ) | [inline, virtual] |
virtual void clearEvent | ( | HepMC::GenEvent & | evt | ) | [inline, protected, virtual, inherited] |
Clear the supplied event.
Definition at line 275 of file Generator.hh.
Referenced by Generator::makeEvent(), FHerwigJimmy::makeEvent(), and AlpGenFHerwigJimmy::makeEvent().
void fillEvent | ( | HepMC::GenEvent & | evt | ) | [protected] |
Fill a HepMC event.
Definition at line 236 of file Phojet.cc.
References Phojet::_hepevt, Log::DEBUG, FC_PYPARS, AGILe::fixHepMCUnitsFromGeVmm(), Phojet::getCrossSection(), Generator::getLog(), and xsec.
Referenced by Phojet::makeEvent().
00236 { 00237 00238 // check event first 00239 // bool iok = HepMC::HEPEVT_Wrapper::check_hepevt_consistency(); 00240 00241 _hepevt.fill_next_event(&evt); 00242 fixHepMCUnitsFromGeVmm(evt); 00243 #ifdef HEPMC_HAS_CROSS_SECTION 00244 HepMC::GenCrossSection xsec; 00245 const double xsecval = getCrossSection(); 00246 const double xsecerr = getCrossSection() / std::sqrt(FC_PYPARS.msti[4]); 00247 getLog() << Log::DEBUG << "Writing cross-section = " << xsecval << " +- " << xsecerr << endl; 00248 xsec.set_cross_section(xsecval, xsecerr); 00249 evt.set_cross_section(xsec); 00250 #endif 00251 }
void finalize | ( | ) | [virtual] |
Tidy up after ourselves.
Implements Generator.
Definition at line 335 of file Phojet.cc.
References Phojet::_p1, Phojet::_p2, FC_PHO_EVENT, Generator::getLog(), and Log::INFO.
00335 { 00336 getLog() << Log::INFO << "Finalising..." << endl; 00337 // Print out stats from run 00338 double sig=0.; 00339 int irej=0; 00340 int mod = -2; 00341 FC_PHO_EVENT(&mod,_p1,_p2, &sig, &irej); 00342 }
const double getCrossSection | ( | ) | [virtual] |
Return the generated cross section in pb.
Reimplemented from Generator.
Definition at line 322 of file Phojet.cc.
References Generator::_crossSection, and FC_PYPARS.
Referenced by Phojet::fillEvent().
00322 { 00323 // _crossSection = FC_PYINT5.xsec[2][0] * 1e09; 00324 _crossSection = FC_PYPARS.pari[0] * 1e09; 00325 return _crossSection; 00326 }
Log& getLog | ( | ) | const [inline, protected, inherited] |
Get named logger.
Definition at line 257 of file Generator.hh.
References Generator::getName().
Referenced by Rapgap::fillEvent(), Phojet::fillEvent(), Cascade::fillEvent(), Ariadne::fillEvent(), Rapgap::finalize(), Phojet::finalize(), Cascade::finalize(), Ariadne::finalize(), Rapgap::initialize(), Cascade::initialize(), Cascade::makeEvent(), Rapgap::setGenSpecificInitialState(), Phojet::setGenSpecificInitialState(), Cascade::setGenSpecificInitialState(), Ariadne::setGenSpecificInitialState(), Rapgap::setParam(), Cascade::setParam(), and AlpGen::setParam().
00257 { 00258 return Log::getLog("AGILe." + getName()); 00259 }
const string getName | ( | ) | const [inline, virtual] |
int getPDFMember | ( | PdgCode | pid | ) | [virtual] |
Get the PDF id number for a given particle.
Reimplemented from Generator.
Definition at line 280 of file Phojet.cc.
References AGILe::ANTIPROTON, AGILe::ELECTRON, FC_PYPARS, AGILe::POSITRON, and AGILe::PROTON.
00280 { 00281 switch(pid) { 00282 case PROTON: 00283 case ANTIPROTON: 00284 return FC_PYPARS.mstp[50]; 00285 break; 00286 case ELECTRON: 00287 case POSITRON: 00288 return FC_PYPARS.mstp[54]; 00289 break; 00290 default: 00291 break; 00292 } 00293 throw runtime_error("Unknown particle for PDF Set"); 00294 }
string getPDFScheme | ( | PdgCode | pid | ) | const [virtual] |
Get the PDF scheme used by the generator (LHAPDF or other).
Reimplemented from Generator.
Definition at line 297 of file Phojet.cc.
References AGILe::ANTIPROTON, AGILe::ELECTRON, FC_PYPARS, AGILe::POSITRON, and AGILe::PROTON.
00297 { 00298 switch(pid){ 00299 case PROTON: 00300 case ANTIPROTON: 00301 if (FC_PYPARS.mstp[51]==1) { 00302 return "PYINTERNAL"; 00303 } else if(FC_PYPARS.mstp[51]==2) { 00304 return "LHAPDF"; 00305 } 00306 break; 00307 case ELECTRON: 00308 case POSITRON: 00309 if (FC_PYPARS.mstp[55]==1) { 00310 return "PYINTERNAL"; 00311 } else if(FC_PYPARS.mstp[55]==2) { 00312 return "LHAPDF"; 00313 } 00314 break; 00315 default: 00316 break; 00317 } 00318 throw runtime_error("Unknown particle for PDF Set"); 00319 }
string getPDFSet | ( | PdgCode | pid | ) | [virtual] |
Get the PDF set used by the generator, e.g. HWLHAPDF (for herwig) or one of the default sets.
Reimplemented from Generator.
Definition at line 254 of file Phojet.cc.
References AGILe::ANTIPROTON, AGILe::ELECTRON, FC_PYPARS, AGILe::POSITRON, and AGILe::PROTON.
00254 { 00255 switch(pid) { 00256 case PROTON: 00257 case ANTIPROTON: 00258 if (FC_PYPARS.mstp[51] == 1) { 00259 return "PYINTERNAL"; 00260 } else if(FC_PYPARS.mstp[51] == 2) { 00261 return "PYLHAPDF"; 00262 } 00263 break; 00264 00265 case ELECTRON: 00266 case POSITRON: 00267 if (FC_PYPARS.mstp[55] == 1) { 00268 return "PYINTERNAL"; 00269 } else if(FC_PYPARS.mstp[55] == 2) { 00270 return "PYLHAPDF"; 00271 } 00272 break; 00273 default: 00274 break; 00275 } 00276 throw runtime_error("Unknown particle for PDF Set"); 00277 }
virtual const GeneratorState& getState | ( | ) | [inline, virtual, inherited] |
Get a generator state object.
Definition at line 72 of file Generator.hh.
References Generator::_myState, GeneratorState::addPDF(), GeneratorState::getBeams(), Generator::getCrossSection(), Generator::getName(), Generator::getPDFMember(), Generator::getPDFScheme(), Generator::getPDFSet(), Generator::getVersion(), PDF::member, Beam::name, PDF::particleId, PDF::scheme, PDF::set, GeneratorState::setCrossSection(), GeneratorState::setName(), and GeneratorState::setVersion().
00072 { 00073 string myName = getName(); 00074 _myState.setName(myName); 00075 _myState.setVersion(getVersion()); 00076 _myState.setCrossSection(getCrossSection()); 00077 PDF pdf; 00078 foreach (Beam b, _myState.getBeams()) { 00079 pdf.particleId = b.name; 00080 pdf.set = getPDFSet(b.name); 00081 pdf.member = getPDFMember(b.name); 00082 pdf.scheme = getPDFScheme(b.name); 00083 _myState.addPDF(pdf); 00084 } 00085 return _myState; 00086 }
const string getVersion | ( | ) | [virtual] |
Get the generator version. This implementation is used as a last resort to determine the generator version. Ideally a specific generator will know its own version and overwrite this. Some generators (e.g. FHerwig) don't know this.
Reimplemented from Generator.
Definition at line 328 of file Phojet.cc.
References FC_PYPARS.
void initialize | ( | ) | [protected, virtual] |
Set up default params etc.
Reimplemented from Generator.
Definition at line 92 of file Phojet.cc.
References Generator::_initialized, Phojet::_p1, Phojet::_p2, Phojet::_pz, FC_PHO_EVENT, and FC_PHO_SETPAR.
00092 { 00093 Generator::initialize(); 00094 00095 double zero=0.; 00096 00097 // hardcoded input ! 00098 int i1=1; 00099 int i2=2; 00100 int id=2212; 00101 int mode = 0; 00102 FC_PHO_SETPAR(&i1,&id,&mode,&zero); 00103 FC_PHO_SETPAR(&i2,&id,&mode,&zero); 00104 00105 double m = 0.93827; 00106 double m2 = m*m; 00107 double e = _p1[3]; 00108 _pz = sqrt(e*e - m2); 00109 00110 (_p1)[2]= _pz; 00111 (_p2)[2]=-_pz; 00112 00113 double sigmax=0.; 00114 int irej=0; 00115 int mod0 = -1; 00116 00117 FC_PHO_EVENT(&mod0,_p1,_p2, &sigmax, &irej); 00118 00119 _initialized = true; 00120 00121 }
void makeEvent | ( | HepMC::GenEvent & | evt | ) | [virtual] |
Run the generator for one event.
Reimplemented from Generator.
Definition at line 214 of file Phojet.cc.
References Phojet::_nevt, Phojet::_p1, Phojet::_p2, FC_PHO_EVENT, and Phojet::fillEvent().
00214 { 00215 Generator::makeEvent(evt); 00217 // Generate one event. 00218 // run Phojet 00219 double sigcur = 0.; 00220 int irej = 0; 00221 int mod = 1; 00222 00223 FC_PHO_EVENT(&mod,_p1,_p2,&sigcur,&irej); 00224 00225 //FC_PHO_HEPEVT(); 00226 00227 // Increment an event counter (Pythia does not count for itself). 00228 _nevt++; 00229 // fill the event using HepMC 00230 fillEvent(evt); 00231 evt.set_event_number(_nevt); 00232 }
void setGenSpecificInitialState | ( | PdgCode | p1 = PROTON , |
|
double | e1 = 7000.0 , |
|||
PdgCode | p2 = PROTON , |
|||
double | e2 = 7000.0 | |||
) | [virtual] |
Set up initial state from supplied params.
Implements Generator.
Definition at line 75 of file Phojet.cc.
References Phojet::_p1, Phojet::_p2, Phojet::_particleName1, Phojet::_particleName2, Generator::_particleNames, Generator::getLog(), and Log::INFO.
00075 { 00076 getLog() << Log::INFO << "Setting initial state..." << endl; 00077 // For Pythia, we have to hold on to this state until initialize() is called. 00078 _particleName1 = _particleNames[id1]; 00079 _particleName2 = _particleNames[id2]; 00080 00081 _p1 = new double[4]; 00082 _p2 = new double[4]; 00083 00084 (_p1)[0]=0.; (_p1)[1]=0.; 00085 (_p2)[0]=0.; (_p2)[1]=0.; 00086 (_p1)[3]=e1; (_p2)[3]=e2; 00087 00088 }
void setInitialState | ( | int | p1 = PROTON , |
|
double | e1 = 7000.0 , |
|||
int | p2 = PROTON , |
|||
double | e2 = 7000.0 | |||
) | [inline, inherited] |
Define initial state.
Definition at line 54 of file Generator.hh.
References Generator::_initialstateset, Generator::_myState, Beam::energy, Beam::name, Beam::position, GeneratorState::setBeams(), and Generator::setGenSpecificInitialState().
Referenced by Generator::initialize().
00056 { 00057 setGenSpecificInitialState(p1, e1, p2, e2); 00059 _initialstateset = true; 00060 Beam beam1, beam2; 00061 beam1.name = p1; 00062 beam2.name = p2; 00063 beam1.energy = e1; 00064 beam2.energy = e2; 00065 beam1.position = 1; 00066 beam2.position = 2; 00067 _myState.setBeams(beam1, beam2); 00068 }
virtual bool setParam | ( | const std::string & | name, | |
const std::string & | value | |||
) | [inline, virtual, inherited] |
Pass a string-valued parameter to the generator.
Definition at line 224 of file Generator.hh.
References Generator::_initialized, Generator::_myState, MSG_ERROR, and GeneratorState::setParam().
00224 { 00225 if (_initialized) { 00226 MSG_ERROR("Can't set parameter " << name << ": generator has already been initialized"); 00227 throw runtime_error("Tried to set param after generator initialization"); 00228 } 00229 _myState.setParam(name, value); 00230 return true; 00231 }
virtual bool setParam | ( | const std::string & | name, | |
const bool & | value | |||
) | [inline, virtual, inherited] |
Pass a bool-valued parameter to the generator.
Definition at line 214 of file Generator.hh.
References Generator::_initialized, MSG_ERROR, Generator::setParam(), and AGILe::toString().
00214 { 00215 if (_initialized) { 00216 MSG_ERROR("Can't set parameter " << name << ": generator has already been initialized"); 00217 throw runtime_error("Tried to set param after generator initialization"); 00218 } 00219 return setParam(name, toString(value)); 00220 }
virtual bool setParam | ( | const std::string & | name, | |
const float & | value | |||
) | [inline, virtual, inherited] |
Pass a double/float-valued parameter to the generator.
Definition at line 204 of file Generator.hh.
References Generator::_initialized, MSG_ERROR, Generator::setParam(), and AGILe::toString().
00204 { 00205 if (_initialized) { 00206 MSG_ERROR("Can't set parameter " << name << ": generator has already been initialized"); 00207 throw runtime_error("Tried to set param after generator initialization"); 00208 } 00209 return setParam(name, toString(value)); 00210 }
virtual bool setParam | ( | const std::string & | name, | |
const double & | value | |||
) | [inline, virtual, inherited] |
Pass a double/float-valued parameter to the generator.
Definition at line 194 of file Generator.hh.
References Generator::_initialized, MSG_ERROR, Generator::setParam(), and AGILe::toString().
00194 { 00195 if (_initialized) { 00196 MSG_ERROR("Can't set parameter " << name << ": generator has already been initialized"); 00197 throw runtime_error("Tried to set param after generator initialization."); 00198 } 00199 return setParam(name, toString(value)); 00200 }
virtual bool setParam | ( | const std::string & | name, | |
const unsigned long & | value | |||
) | [inline, virtual, inherited] |
Pass an int-valued parameter to the generator.
Definition at line 184 of file Generator.hh.
References Generator::_initialized, MSG_ERROR, Generator::setParam(), and AGILe::toString().
00184 { 00185 if (_initialized) { 00186 MSG_ERROR("Can't set parameter " << name << ": generator has already been initialized"); 00187 throw runtime_error("Tried to set param after generator initialization"); 00188 } 00189 return setParam(name, toString(value)); 00190 }
virtual bool setParam | ( | const std::string & | name, | |
const long & | value | |||
) | [inline, virtual, inherited] |
Pass an int-valued parameter to the generator.
Definition at line 174 of file Generator.hh.
References Generator::_initialized, MSG_ERROR, Generator::setParam(), and AGILe::toString().
00174 { 00175 if (_initialized) { 00176 MSG_ERROR("Can't set parameter " << name << ": generator has already been initialized"); 00177 throw runtime_error("Tried to set param after generator initialization"); 00178 } 00179 return setParam(name, toString(value)); 00180 }
virtual bool setParam | ( | const std::string & | name, | |
const unsigned int & | value | |||
) | [inline, virtual, inherited] |
Pass an int-valued parameter to the generator.
Definition at line 164 of file Generator.hh.
References Generator::_initialized, MSG_ERROR, Generator::setParam(), and AGILe::toString().
00164 { 00165 if (_initialized) { 00166 MSG_ERROR("Can't set parameter " << name << ": generator has already been initialized"); 00167 throw runtime_error("Tried to set param after generator initialization"); 00168 } 00169 return setParam(name, toString(value)); 00170 }
virtual bool setParam | ( | const std::string & | name, | |
const int & | value | |||
) | [inline, virtual, inherited] |
Pass an int-valued parameter to the generator.
Definition at line 154 of file Generator.hh.
References Generator::_initialized, MSG_ERROR, and AGILe::toString().
Referenced by Generator::setParam().
00154 { 00155 if (_initialized) { 00156 MSG_ERROR("Can't set parameter " << name << ": generator has already been initialized"); 00157 throw runtime_error("Tried to set param after generator initialization"); 00158 } 00159 return setParam(name, toString(value)); 00160 }
bool setParam | ( | const string & | name, | |
const string & | value | |||
) | [virtual] |
Pass an string parameter to the generator.
Definition at line 124 of file Phojet.cc.
References call_pygive(), FC_PHO_RNDIN, FC_POMDLS, FC_POPRCS, Generator::SUCCESS, and AGILe::toUpper().
Referenced by Phojet::setSeed().
00124 { 00125 Generator::setParam(name, value); 00126 00127 if (name.substr(0,5) == "IPRON" || name.substr(0,5) == "ipron") { 00128 size_t il = 0; size_t ir = 0; size_t ic = 0; 00129 while (il<name.size() && name.substr(il,1)!="(") il++; 00130 while (ic<name.size() && name.substr(ic,1)!=",") ic++; 00131 while (ir<name.size() && name.substr(ir,1)!=")") ir++; 00132 size_t ip1 = 0; size_t ip2 = 0; 00133 if (il > 3 && ic > il) { 00134 const string& num1 = name.substr(il+1,ic-il-1); 00135 ip1 = std::atoi(num1.c_str()); 00136 } 00137 if (ic > 3 && ir > ic) { 00138 const string& num2 = name.substr(ic+1,ir-ic-1); 00139 ip2 = std::atoi(num2.c_str()); 00140 } 00141 double val = std::atof(value.c_str()); 00142 00143 //std::cout <<"old value:"<<FC_POPRCS.ipron[ip1-1][ip2-1]<<std::endl; 00144 FC_POPRCS.ipron[ip1-1][ip2-1] = int(val); 00145 //std::cout <<"new value:"<<FC_POPRCS.ipron[ip1-1][ip2-1]<<std::endl; 00146 } else if (name.substr(0,6)=="ISWMDL" || name.substr(0,6)=="iswmdl" ) { 00147 size_t il = 0; size_t ir = 0; 00148 while (il<name.size() && name.substr(il,1)!="(") il++; 00149 while (ir<name.size() && name.substr(ir,1)!=")") ir++; 00150 size_t ip = 0; 00151 if (il>3 && ir>il ) { 00152 const string& num = name.substr(il+1,ir-il-1); 00153 ip = std::atoi(num.c_str()); 00154 } 00155 double val = std::atof(value.c_str()); 00156 00157 //std::cout <<"old value:"<<FC_POMDLS.iswmdl[ip-1]<<std::endl; 00158 FC_POMDLS.iswmdl[ip-1] = int(val); 00159 //std::cout <<"new value:"<<FC_POMDLS.iswmdl[ip-1]<<std::endl; 00160 } else if (name.substr(0,6)=="IPAMDL" || name.substr(0,6)=="ipamdl" ) { 00161 size_t il =0; size_t ir = 0; 00162 while (il<name.size() && name.substr(il,1)!="(") il++; 00163 while (ir<name.size() && name.substr(ir,1)!=")") ir++; 00164 size_t ip=0; 00165 if (il>3 && ir>il ) { 00166 const string& num= name.substr(il+1,ir-il-1); 00167 ip = std::atoi(num.c_str()); 00168 } 00169 double val = std::atof(value.c_str()); 00170 00171 //std::cout <<"old value:"<<FC_POMDLS.ipamdl[ip-1]<<std::endl; 00172 FC_POMDLS.ipamdl[ip-1] = int(val); 00173 //std::cout <<"new value:"<<FC_POMDLS.ipamdl[ip-1]<<std::endl; 00174 } else if (name.substr(0,6)=="PARMDL" || name.substr(0,6)=="parmdl" ) { 00175 size_t il = 0; size_t ir = 0; 00176 while (il<name.size() && name.substr(il,1)!="(") il++; 00177 while (ir<name.size() && name.substr(ir,1)!=")") ir++; 00178 size_t ip = 0; 00179 if (il>3 && ir>il ) { 00180 const string& num= name.substr(il+1,ir-il-1); 00181 ip = std::atoi(num.c_str()); 00182 } 00183 double val = std::atof(value.c_str()); 00184 00185 //std::cout <<"old value:"<<FC_POMDLS.parmdl[ip-1]<<std::endl; 00186 FC_POMDLS.parmdl[ip-1] = val; 00187 //std::cout <<"new value:"<<FC_POMDLS.parmdl[ip-1]<<std::endl; 00188 } else if (name.substr(0,4)=="RNDM" || name.substr(0,4)=="rndm" ) { 00189 00190 double val = std::atof(value.c_str()); 00191 int ir1=int(val/100.); 00192 int rndm1=int(val-100*ir1); 00193 int ir2=int(ir1/100.); 00194 int rndm2=int(ir1-100*ir2); 00195 int ir3=int(ir2/100.); 00196 int rndm3=int(ir2-100*ir3); 00197 int rndm4=ir3; 00198 rndm1 = max(rndm1,1); 00199 rndm2 = max(rndm2,1); 00200 rndm3 = max(rndm3,1); 00201 rndm4 = max(rndm4,1); 00202 rndm4 = min(rndm4,178); 00203 //std::cout << " RNDM init with input:"<<rndm1<<":"<<rndm2<<":"<<rndm3<<":"<<rndm4 << std::endl; 00204 FC_PHO_RNDIN(&rndm1,&rndm2,&rndm3,&rndm4); 00205 00206 } else { 00207 const string pygive_input(toUpper(name) + "=" + value); 00208 call_pygive(pygive_input.c_str()); 00209 } 00210 return SUCCESS; 00211 }
virtual void setSeed | ( | const int | value | ) | [inline, virtual] |
Set the random number generator seed.
Reimplemented from Generator.
Definition at line 33 of file Phojet.hh.
References Phojet::setParam().
00033 { 00034 setParam("MRPY(1)", value); 00035 }
virtual void setState | ( | const GeneratorState & | state | ) | [inline, virtual, inherited] |
Setup the generator from a generator state object.
Definition at line 90 of file Generator.hh.
virtual void setVersion | ( | const std::string & | version | ) | [inline, virtual, inherited] |
Set the generator version.
Definition at line 102 of file Generator.hh.
References Generator::_myVersion, and Generator::_versionSet.
Referenced by AGILe::Loader::createGen().
00102 { 00103 _myVersion = version; 00104 _versionSet = true; 00105 }
double _crossSection [protected, inherited] |
Definition at line 282 of file Generator.hh.
Referenced by Rapgap::getCrossSection(), Phojet::getCrossSection(), Generator::getCrossSection(), FPythia::getCrossSection(), FHerwig::getCrossSection(), Cascade::getCrossSection(), and Ariadne::getCrossSection().
HepMC::IO_HEPEVT _hepevt [protected] |
HEPEVT->HepMC converter.
Definition at line 76 of file Phojet.hh.
Referenced by Phojet::fillEvent().
bool _initialized [protected, inherited] |
Flag for detecting whether the initialization method has run.
Definition at line 288 of file Generator.hh.
Referenced by Rapgap::initialize(), Phojet::initialize(), FPythia::initialize(), FHerwigJimmy::initialize(), FHerwig::initialize(), Cascade::initialize(), Ariadne::initialize(), Generator::makeEvent(), Generator::setParam(), and Generator::setSeed().
bool _initialstateset [protected, inherited] |
Flag for detecting whether the setInitialState method has run.
Definition at line 285 of file Generator.hh.
Referenced by Generator::initialize(), and Generator::setInitialState().
string _myName [protected, inherited] |
Generator name.
Definition at line 294 of file Generator.hh.
Referenced by AlpGenFHerwig::AlpGenFHerwig(), AlpGenFPythia::AlpGenFPythia(), CharybdisFHerwig::CharybdisFHerwig(), CharybdisFHerwigJimmy::CharybdisFHerwigJimmy(), CharybdisFPythia::CharybdisFPythia(), FHerwig::FHerwig(), FHerwigJimmy::FHerwigJimmy(), FPythia::FPythia(), and Generator::getName().
int _nevt [protected] |
Event counter.
Definition at line 71 of file Phojet.hh.
Referenced by Phojet::makeEvent(), and Phojet::Phojet().
double* _p1 [protected] |
Definition at line 67 of file Phojet.hh.
Referenced by Phojet::finalize(), Phojet::initialize(), Phojet::makeEvent(), and Phojet::setGenSpecificInitialState().
double* _p2 [protected] |
Definition at line 68 of file Phojet.hh.
Referenced by Phojet::finalize(), Phojet::initialize(), Phojet::makeEvent(), and Phojet::setGenSpecificInitialState().
string _particleName1 [protected] |
Internal storage of initial state params.
Definition at line 65 of file Phojet.hh.
Referenced by Phojet::setGenSpecificInitialState().
string _particleName2 [protected] |
Definition at line 65 of file Phojet.hh.
Referenced by Phojet::setGenSpecificInitialState().
map<PdgCode, std::string> _particleNames [protected, inherited] |
Collection of translated names for particles.
Definition at line 291 of file Generator.hh.
Referenced by FHerwig::_beamNumber(), Ariadne::Ariadne(), FHerwig::FHerwig(), FPythia::FPythia(), Phojet::Phojet(), Rapgap::Rapgap(), Phojet::setGenSpecificInitialState(), FPythia::setGenSpecificInitialState(), FHerwig::setGenSpecificInitialState(), and Ariadne::setGenSpecificInitialState().
double _pz [protected] |
Definition at line 73 of file Phojet.hh.
Referenced by Phojet::initialize().