agile is hosted by Hepforge, IPPP Durham

FHerwig Class Reference

#include <FHerwig.hh>

Inheritance diagram for FHerwig:
Collaboration diagram for FHerwig:

List of all members.

Public Types

enum  Result { SUCCESS = 1, FAILURE = 0 }
 

Really just syntactic sugar for bool returns from setParam.

More...

Public Member Functions

 FHerwig ()
 Standard constructor.
virtual ~FHerwig ()
 Destructor.
virtual void setGenSpecificInitialState (PdgCode p1=PROTON, double e1=7000.0, PdgCode p2=PROTON, double e2=7000.0)
 Set up initial state from supplied params.
virtual 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 a parameter to the generator.
virtual void finalize ()
 Tidy up after ourselves.
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.
void setInitialState (int p1=PROTON, double e1=7000.0, int p2=PROTON, double e2=7000.0)
 Define initial state.
virtual const GeneratorStategetState ()
 Get a generator state object.
virtual void setState (const GeneratorState &state)
 Setup the generator from a generator state object.
virtual const std::string getName () const
 Get the generator name.
virtual void setVersion (const std::string &version)
 Set the generator version.
virtual const std::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.
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

virtual void initialize ()
 Set up default params etc.
virtual void fillEvent (HepMC::GenEvent &evt)
 Fill a HepMC event.
LoggetLog () const
 Get named logger.
virtual void clearEvent (HepMC::GenEvent &evt)
 Clear the supplied event.

Protected Attributes

bool _doHadronise
 Flag to determine if the hadronisation process will be run.
bool _unitWeight
 Flag to determine if weighted or unweighted events are to be generated.
bool _iprocset
 Flag to determine if the process code has been set.
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.

Private Member Functions

int _beamNumber (PdgCode pid)
 Get a beam particle code for a given PID code. Return the beam number (0 or 1) of a particle. Return -1 if not a beam particle.
bool _processParams ()
 Process store parameters HWIGIN needs IPROC to be set before being called, AND when called it will overwrite all other common block values! So we need to store the params provided by the user (other than IPROC) and then apply all these en-masse in the initialize() method, just after HWIGIN has been called. *sigh*.

Private Attributes

map< string, string > _storedParams
 Map of params and values used by _processParams.
int _nevt
 Event counter.

Detailed Description

Abstract base class for the Fortran-based Herwig generator series

Author:
Andy Buckley

Definition at line 11 of file FHerwig.hh.


Member Enumeration Documentation

enum Result [inherited]

Really just syntactic sugar for bool returns from setParam.

Enumerator:
SUCCESS 
FAILURE 

Definition at line 37 of file Generator.hh.

00037 { SUCCESS=1, FAILURE=0 };


Constructor & Destructor Documentation

FHerwig (  ) 

Standard constructor.

Herwig 6.5 uses HEPEVT with 4000/10000 entries and 8-byte floats

Definition at line 17 of file FHerwig.cc.

References Generator::_myName, FHerwig::_nevt, Generator::_particleNames, AGILe::ANTIMUON, AGILe::ANTINEUTRON, AGILe::ANTIPROTON, AGILe::ELECTRON, FC_HWGETHEPEVTSIZE, 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.

00018     : _doHadronise(true), _unitWeight(true), _iprocset(false)
00019   {
00020     _myName = "Herwig";
00021 
00023     HepMC::HEPEVT_Wrapper::set_max_number_entries(FC_HWGETHEPEVTSIZE());
00024     HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
00025 
00026     // Set up particle names map: note that they must be 8 characters long
00027     _particleNames[ELECTRON]    = "E-      ";
00028     _particleNames[POSITRON]    = "E+      ";
00029     _particleNames[PROTON]      = "P       ";
00030     _particleNames[ANTIPROTON]  = "PBAR    ";
00031     _particleNames[NEUTRON]     = "N       ";
00032     _particleNames[ANTINEUTRON] = "NBAR    ";
00033     _particleNames[PHOTON]      = "GAMMA   ";
00034     _particleNames[MUON]        = "MU-     ";
00035     _particleNames[ANTIMUON]    = "MU+     ";
00036     // TAU, ANTITAU
00037     _particleNames[NU_E]        = "NU_E    ";
00038     _particleNames[NU_EBAR]     = "NU_EBAR ";
00039     _particleNames[NU_MU]       = "NU_MU   ";
00040     _particleNames[NU_MUBAR]    = "NU_MUBAR";
00041     _particleNames[NU_TAU]      = "NU_TAU  ";
00042     _particleNames[NU_TAUBAR]   = "NU_TAUBR";
00043     _particleNames[PIPLUS]      = "PI+     ";
00044     _particleNames[PIMINUS]     = "PI-     ";
00045     // PIZERO
00046     // PHOTOELECTRON, PHOTOPOSITRON,
00047     // PHOTOMUON,     PHOTOANTIMUON,
00048     // PHOTOTAU,      PHOTOANTITAU,
00049 
00050     // Start counting events at 1.
00051     _nevt = 1;
00052   }

virtual ~FHerwig (  )  [inline, virtual]

Destructor.

Definition at line 17 of file FHerwig.hh.

00017 {}


Member Function Documentation

int _beamNumber ( PdgCode  pid  )  [private]

Get a beam particle code for a given PID code. Return the beam number (0 or 1) of a particle. Return -1 if not a beam particle.

Definition at line 604 of file FHerwig.cc.

References Generator::_particleNames, and FC_HWBMCH.

Referenced by FHerwig::getPDFMember(), and FHerwig::getPDFSet().

00604                                       {
00605     string pName = _particleNames[pid];
00606     string beamName = "";
00607     for (int i = 0; i < 8; ++i) {
00608       beamName += FC_HWBMCH.PART1[i];
00609     }
00610     if (beamName.compare(pName) == 0) return 0;
00611 
00612     for (int i = 0; i < 8; ++i) {
00613       beamName += FC_HWBMCH.PART2[i];
00614     }
00615     if (beamName.compare(pName) == 0) return 1;
00616     return -1;
00617   }

bool _processParams (  )  [private]

Process store parameters HWIGIN needs IPROC to be set before being called, AND when called it will overwrite all other common block values! So we need to store the params provided by the user (other than IPROC) and then apply all these en-masse in the initialize() method, just after HWIGIN has been called. *sigh*.

Todo:
Add meaning of param (Higgs mixing angle?)
Todo:
Add meaning of param (??? mixing angle?)

Definition at line 157 of file FHerwig.cc.

References FHerwig::_doHadronise, FHerwig::_storedParams, FHerwig::_unitWeight, AGILe::asBool(), AGILe::asDouble(), AGILe::asInt(), Generator::FAILURE, FC_HW6506, FC_HWDIST, FC_HWEVNT, FC_HWHARD, FC_HWPRAM, FC_HWPRCH, FC_HWPROP, FC_HWUCLU, MSG_ERROR, MSG_INFO, and Generator::SUCCESS.

Referenced by FHerwig::initialize().

00157                                {
00158     typedef pair<string,string> strpair;
00159     foreach (const strpair& kv, _storedParams) {
00160       const string& name = kv.first;
00161       const string& value = kv.second;
00162 
00163       // Strings
00164       if (name.find("AUTPDF") != string::npos) {
00165         if (name == "AUTPDF(1)" || name == "AUTPDF") {
00166           MSG_INFO("Setting AUTPDF(1) = " << value);
00167           const size_t nch = (value.size() < AUTPDF_LENGTH) ? value.size() : AUTPDF_LENGTH-1;
00168           for (size_t i = 0; i < AUTPDF_LENGTH; ++i) {
00169             if (i < nch) {
00170               FC_HWPRCH.AUTPDF[0][i] = value.data()[i];
00171             } else {
00172               FC_HWPRCH.AUTPDF[0][i] = ' ';
00173             }
00174           }
00175         }
00176         if (name == "AUTPDF(2)" || name == "AUTPDF") {
00177           MSG_INFO("Setting AUTPDF(2) = " << value);
00178           const size_t nch = (value.size() < AUTPDF_LENGTH) ? value.size() : AUTPDF_LENGTH-1;
00179           for (size_t i = 0; i < AUTPDF_LENGTH; ++i) {
00180             if (i < nch) {
00181               FC_HWPRCH.AUTPDF[1][i] = value.data()[i];
00182             } else {
00183               FC_HWPRCH.AUTPDF[1][i] = ' ';
00184             }
00185           }
00186         }
00187       }
00188 
00189       // Integers (other than IPROC)
00190       else if (name == "SEED") {
00191         const int baseseed = asInt(value);
00192         MSG_INFO("Setting random seeds based on this value (SEED) = " << baseseed);
00193         FC_HWEVNT.NRN[0] = baseseed;
00194         FC_HWEVNT.NRN[1] = baseseed + SEED_OFFSET;
00195         FC_HWHARD.IBRN[0] = baseseed + 2*SEED_OFFSET;
00196         FC_HWHARD.IBRN[1] = baseseed + 3*SEED_OFFSET;
00197       } else if (name == "MAXPR") {
00198         MSG_INFO("Setting max event printouts (MAXPR) = " << asInt(value));
00199         FC_HWEVNT.MAXPR = asInt(value);
00200       } else if (name == "IPRINT") {
00201         MSG_INFO("Setting printout info code (IPRINT) = " << asInt(value));
00202         FC_HWPRAM.IPRINT = asInt(value);
00203       } else if (name == "CLDIR1") {
00204         MSG_INFO("Setting smearing of perturbative quark pT in light cluster fission (CLDIR(1)) = " << asInt(value));
00205         FC_HWPRAM.CLDIR[0] = asInt(value);
00206       } else if (name == "CLDIR2") {
00207         MSG_INFO("Setting smearing of perturbative quark pT in b cluster fission (CLDIR(2)) = " << asInt(value));
00208         FC_HWPRAM.CLDIR[1] = asInt(value);
00209       } else if (name == "IOPREM") {
00210         MSG_INFO("Setting model for treatment of remnant clusters (IOPREM) = " << asInt(value));
00211         FC_HWPRAM.IOPREM = asInt(value);
00212       } else if (name == "ISPAC") {
00213         MSG_INFO("Setting ISR forced branching IR behaviour (ISPAC) = " << asInt(value));
00214         FC_HWPRAM.ISPAC = asInt(value);
00215       } else if (name == "NFLAV") {
00216         MSG_INFO("Setting number of flavours (NFLAV) = " << asInt(value));
00217         FC_HWPRAM.NFLAV = asInt(value);
00218       } else if (name == "NSTRU") {
00219         MSG_INFO("Setting internal PDF ID... are you sure? (NSTRU) = " << asInt(value));
00220         FC_HWPRAM.NSTRU = asInt(value);
00221       } else if (name == "MODPDF") {
00222         MSG_INFO("Setting PDFLIB IDs for both beams (MODPDF(1&2)) = " << asInt(value));
00223         FC_HWPRAM.MODPDF[0] = asInt(value);
00224         FC_HWPRAM.MODPDF[1] = asInt(value);
00225       } else if (name == "MODPDF(1)") {
00226         MSG_INFO("Setting PDFLIB ID for beam 1 (MODPDF(1)) = " << asInt(value));
00227         FC_HWPRAM.MODPDF[0] = asInt(value);
00228       } else if (name == "MODPDF(2)") {
00229         MSG_INFO("Setting PDFLIB ID for beam 2 (MODPDF(2)) = " << asInt(value));
00230         FC_HWPRAM.MODPDF[1] = asInt(value);
00231       } else if (name == "IFLMAX") {
00232         MSG_INFO("Setting max quark flavour in photoproduction (IFLMAX) = " << asInt(value));
00233         FC_HWHARD.IFLMAX = asInt(value);
00234       } else if (name == "LRSUD") {
00235         MSG_INFO("Setting unit for reading Sudakov table (LRSUD) = " << asInt(value));
00236         FC_HWPRAM.LRSUD = asInt(value);
00237       } else if (name == "LWSUD") {
00238         MSG_INFO("Setting unit for writing Sudakov table (LWSUD) = " << asInt(value));
00239         FC_HWPRAM.LWSUD = asInt(value);
00240       } else if (name == "IAPHIG") {
00241         MSG_INFO("Setting gg->H top loop param (IAPHIG) = " << asInt(value));
00242         FC_HWHARD.IAPHIG = asInt(value);
00243       // } else if (name == "MODBOS") {
00244       //   MSG_INFO("Setting MODBOS = " << asInt(value));
00245       //   FC_HWBOSC.MODBOS[0] = asInt(value);
00246 
00247       // Doubles
00248       } else if (name == "ALPHEM") {
00249         MSG_INFO("Setting alpha_EM (ALPHEM) = " << asDouble(value));
00250         FC_HWPRAM.ALPHEM = asDouble(value);
00251       } else if (name == "PTMIN") {
00252         MSG_INFO("Setting minimum hard pt (PTMIN) = " << asDouble(value));
00253         FC_HWHARD.PTMIN = asDouble(value);
00254       } else if (name == "PTMAX") {
00255         MSG_INFO("Setting maximum hard pt (PTMAX) = " << asDouble(value));
00256         FC_HWHARD.PTMAX = asDouble(value);
00257       } else if (name == "PTPOW") {
00258         MSG_INFO("Setting power for reweight (PTPOW) = " << asDouble(value));
00259         FC_HWHARD.PTPOW = asDouble(value);
00260       } else if (name == "Q2WWMN") {
00261         MSG_INFO("Setting minimum Q2 in equivalent photon approximation (Q2WWMN) = " << asDouble(value));
00262         FC_HWHARD.Q2WWMN = asDouble(value);
00263       } else if (name == "Q2WWMX") {
00264         MSG_INFO("Setting maximum Q2 in equivalent photon approximation (Q2WWMX) = " << asDouble(value));
00265         FC_HWHARD.Q2WWMX = asDouble(value);
00266       } else if (name == "YWWMIN") {
00267         MSG_INFO("Setting minimum photon light-cone fraction in equivalent photon approximation (YWWMIN) = " << asDouble(value));
00268         FC_HWHARD.YWWMIN = asDouble(value);
00269       } else if (name == "YWWMAX") {
00270         MSG_INFO("Setting maximum photon light-cone fraction in equivalent photon approximation (YWWMAX) = " << asDouble(value));
00271         FC_HWHARD.YWWMAX = asDouble(value);
00272       } else if ( name =="WHMIN") {
00273         MSG_INFO("Setting min hadronic mass in photon-induced (DIS) processes (WHMIN) = " << asDouble(value));
00274         FC_HWHARD.WHMIN = asDouble(value);
00275       } else if ( name =="EMMIN") {
00276         MSG_INFO("Setting minimum DY boson mass (EMMIN) = "<< asDouble(value));
00277         FC_HWHARD.EMMIN = asDouble(value);
00278       } else if ( name =="EMMAX") {
00279         MSG_INFO("Setting maximum DY boson mass (EMMIN) = "<< asDouble(value));
00280         FC_HWHARD.EMMAX = asDouble(value);
00281       } else if ( name =="EMPOW") {
00282         MSG_INFO("Setting power for EM reweighting (EMPOW) = "<< asDouble(value));
00283         FC_HWHARD.EMPOW = asDouble(value);
00284       } else if ( name =="EMSCA") {
00285         MSG_INFO("Setting ??? for EM (EMSCA) = "<< asDouble(value));
00286         FC_HWHARD.EMSCA = asDouble(value);
00287       } else if (name == "PRECO") {
00288         MSG_INFO("Setting probability of cluster colour reassignment (PRECO) = " << asDouble(value));
00289         FC_HWUCLU.PRECO = asDouble(value);
00290       } else if (name == "PDFX0") {
00291         MSG_INFO("Setting maximum x for saturation effects (PDFX0) = " << asDouble(value));
00292         FC_HW6506.PDFX0 = asDouble(value);
00293       } else if (name == "PDFPOW") {
00294         MSG_INFO("Setting suppression of PDFs below x0 (PDFPOW) = " << asDouble(value));
00295         FC_HW6506.PDFPOW = asDouble(value);
00296       } else if (name == "BTCLM") {
00297         MSG_INFO("Setting remnant cluster mass param adjustment (BTCLM) = " << asDouble(value));
00298         FC_HWPRAM.BTCLM = asDouble(value);
00299       } else if (name == "CLMAX") {
00300         MSG_INFO("Setting cluster mass offset (CLMAX) = " << asDouble(value));
00301         FC_HWPRAM.CLMAX = asDouble(value);
00302       } else if (name == "CLPOW") {
00303         MSG_INFO("Setting exponent of cluster fission (CLPOW) = " << asDouble(value));
00304         FC_HWPRAM.CLPOW = asDouble(value);
00305       } else if (name == "CLSMR1") {
00306         MSG_INFO("Setting Gaussian quark pT smearing width for light clusters (CLSMR(1)) = " << asDouble(value));
00307         FC_HWPRAM.CLSMR[0] = asDouble(value);
00308       } else if (name == "CLSMR2") {
00309         MSG_INFO("Setting Gaussian quark pT smearing width for b clusters (CLSMR(2)) = " << asDouble(value));
00310         FC_HWPRAM.CLSMR[1] = asDouble(value);
00311       } else if (name == "PRSOF") {
00312         MSG_INFO("Setting probablility of soft scatters (PRSOF) = " << asDouble(value));
00313         FC_HWPRAM.PRSOF = asDouble(value);
00314       } else if (name == "PSPLT1") {
00315         MSG_INFO("Setting cluster mass spectrum exponent for light clusters (PSPLT(1)) = " << asDouble(value));
00316         FC_HWPRAM.PSPLT[0] = asDouble(value);
00317       } else if (name == "PSPLT2") {
00318         MSG_INFO("Setting cluster mass spectrum exponent for b clusters (PSPLT(2)) = " << asDouble(value));
00319         FC_HWPRAM.PSPLT[1] = asDouble(value);
00320       }
00321       // Following params are useful for MPI/ISR tunes:
00322       else if (name == "PTRMS") {
00323         MSG_INFO("Setting intrinsic kT (PTRMS) = " << asDouble(value));
00324         FC_HWPRAM.PTRMS = asDouble(value);
00325       } else if (name == "QCDLAM") {
00326         MSG_INFO("Setting Lambda_QCD for alpha_s running (QCDLAM) = " << asDouble(value));
00327         FC_HWPRAM.QCDLAM = asDouble(value);
00328       } else if (name == "QSPAC") {
00329         MSG_INFO("Setting Q cutoff for spacelike (ISR) shower (QSPAC) = " << asDouble(value));
00330         FC_HWPRAM.QSPAC = asDouble(value);
00331       } else if (name == "VGCUT") {
00332         MSG_INFO("Setting gluon virtuality cutoff in parton showers (VGCUT) = " << asDouble(value));
00333         FC_HWPRAM.VGCUT = asDouble(value);
00334       } else if (name == "VQCUT") {
00335         MSG_INFO("Setting quark virtuality cutoff in parton showers (VQCUT) = " << asDouble(value));
00336         FC_HWPRAM.VQCUT = asDouble(value);
00337       } else if (name == "ZMXISR") {
00338         MSG_INFO("Setting max. momentum fraction for photon ISR (ZMXISR) = " << asDouble(value));
00339         FC_HWHARD.ZMXISR = asDouble(value);
00340       }
00341       // End MPI/ISR tune params
00342       else if (name == "VPCUT") {
00343         MSG_INFO("Setting photon virtuality cutoff (VPCUT) = " << asDouble(value));
00344         FC_HWPRAM.VPCUT = asDouble(value);
00345       } else if (name == "OMEGA0") {
00346         MSG_INFO("Setting omega_0 param in Mueller-Tang pomeron for IPROC=2400 (OMEGA0) = " << asDouble(value));
00347         FC_HWHARD.OMEGA0 = asDouble(value);
00348       } else if (name == "ASFIXD") {
00349         MSG_INFO("Setting a_s param in Mueller-Tang pomeron for IPROC=2400 (ASFIXD) = " << asDouble(value));
00350         FC_HWHARD.ASFIXD = asDouble(value);
00351       } else if (name == "Q2MIN") {
00352         MSG_INFO("Setting minimum DIS Q2 (Q2MIN) = " << asDouble(value));
00353         FC_HWHARD.Q2MIN = asDouble(value);
00354       } else if (name == "Q2MAX") {
00355         MSG_INFO("Setting maximum DIS Q2 (Q2MAX) = " << asDouble(value));
00356         FC_HWHARD.Q2MAX = asDouble(value);
00357       } else if (name == "Q2POW") {
00358         MSG_INFO("Setting reweighting power in DIS Q2 (Q2POW) = " << asDouble(value));
00359         FC_HWHARD.Q2POW = asDouble(value);
00360       } else if (name == "Q2WWMN") {
00361         MSG_INFO("Setting Q2WWMN (Q2WWMN) = " << asDouble(value));
00362         FC_HWHARD.Q2WWMN = asDouble(value);
00363       } else if (name == "Q2WWMX") {
00364         MSG_INFO("Setting Q2WWMX (Q2WWMX) = " << asDouble(value));
00365         FC_HWHARD.Q2WWMX = asDouble(value);
00366       } else if (name == "QLIM") {
00367         MSG_INFO("Setting QLIM (QLIM) = " << asDouble(value));
00368         FC_HWHARD.QLIM = asDouble(value);
00369       } else if (name == "YBMIN") {
00370         MSG_INFO("Setting minimum Bjorken y=Q2/xs (YBMIN) = " << asDouble(value));
00371         FC_HWHARD.YBMIN = asDouble(value);
00372       } else if (name == "YBMAX") {
00373         MSG_INFO("Setting maximum Bjorken y=Q2/xs (YBMAX) = " << asDouble(value));
00374         FC_HWHARD.YBMAX = asDouble(value);
00375       } else if (name == "YJMIN") {
00376         MSG_INFO("Setting minimum ??? (YJMIN) = " << asDouble(value));
00377         FC_HWHARD.YJMIN = asDouble(value);
00378       } else if (name == "YJMAX") {
00379         MSG_INFO("Setting maximum ??? (YJMAX) = " << asDouble(value));
00380         FC_HWHARD.YJMAX = asDouble(value);
00381       } else if (name == "YWWMIN") {
00382         MSG_INFO("Setting minimum ??? (YWWMIN) = " << asDouble(value));
00383         FC_HWHARD.YWWMIN = asDouble(value);
00384       } else if (name == "YWWMAX") {
00385         MSG_INFO("Setting maximum ??? (YWWMAX) = " << asDouble(value));
00386         FC_HWHARD.YWWMAX = asDouble(value);
00387       } else if (name == "XX1") {
00388         MSG_INFO("Setting ??? (XX(1)) = " << asDouble(value));
00389         FC_HWHARD.XX[0] = asDouble(value);
00390       } else if (name == "XX2") {
00391         MSG_INFO("Setting ??? (XX(2)) = " << asDouble(value));
00392         FC_HWHARD.XX[1] = asDouble(value);
00393       } else if (name == "XLMIN") {
00394         MSG_INFO("Setting minimum ??? (XLMIN) = " << asDouble(value));
00395         FC_HWHARD.XLMIN = asDouble(value);
00396       } else if (name == "XXMIN") {
00397         MSG_INFO("Setting minimum ??? (XXMIN) = " << asDouble(value));
00398         FC_HWHARD.XXMIN = asDouble(value);
00399       } else if (name == "WHMIN") {
00400         MSG_INFO("Setting minimum ??? (WHMIN) = " << asDouble(value));
00401         FC_HWHARD.WHMIN = asDouble(value);
00402       } else if (name == "ZJMAX") {
00403         MSG_INFO("Setting maximum ??? (ZJMAX) = " << asDouble(value));
00404         FC_HWHARD.ZJMAX = asDouble(value);
00405       } else if (name == "TMNISR") {
00406         MSG_INFO("Setting minimum ??? (TMNISR) = " << asDouble(value));
00407         FC_HWHARD.TMNISR = asDouble(value);
00408       } else if (name == "ZMXISR") {
00409         MSG_INFO("Setting maximum ??? in ISR (ZMXISR) = " << asDouble(value));
00410         FC_HWHARD.ZMXISR = asDouble(value);
00411       } else if (name == "THMAX") {
00412         MSG_INFO("Setting maximum ??? (THMAX) = " << asDouble(value));
00413         FC_HWHARD.THMAX = asDouble(value);
00414       } else if (name == "Y4JT") {
00415         MSG_INFO("Setting ??? (Y4JT) = " << asDouble(value));
00416         FC_HWHARD.Y4JT = asDouble(value);
00417       } else if (name == "SINS") {
00418         MSG_INFO("Setting ??? (SINS) = " << asDouble(value));
00419         FC_HWHARD.SINS = asDouble(value);
00420       } else if (name == "PLTCUT") {
00421         MSG_INFO("Setting lifetime cut (PLTCUT) = " << asDouble(value));
00422         FC_HWDIST.PLTCUT = asDouble(value);
00423       } else if (name == "GAMW") {
00424         MSG_INFO("Setting W width (GAMW) = " << asDouble(value));
00425         FC_HWPRAM.GAMW = asDouble(value);
00426       } else if (name == "GAMZ") {
00427         MSG_INFO("Setting Z0 width (GAMZ) = " << asDouble(value));
00428         FC_HWPRAM.GAMZ = asDouble(value);
00429       } else if (name == "GAMZP") {
00430         MSG_INFO("Setting Z0/gamma width (GAMZP) = " << asDouble(value));
00431         FC_HWPRAM.GAMZP = asDouble(value);
00432       } else if (name == "H1MIX") {
00434         MSG_INFO("Setting H1MIX (H1MIX) = " << asDouble(value));
00435         FC_HWPRAM.H1MIX = asDouble(value);
00436       } else if (name == "PHIMIX") {
00438         MSG_INFO("Setting PHIMIX (PHIMIX) = " << asDouble(value));
00439         FC_HWPRAM.PHIMIX = asDouble(value);
00440       }
00441       // NB. The -1 C-Fortran array offset does not apply for RMASS, which is declared as (0:NMXRES).
00442       else if (name == "RMASS(1)") {
00443         MSG_INFO("Setting down mass (RMASS(1)) = " << asDouble(value));
00444         FC_HWPROP.RMASS[1] = asDouble(value);
00445       } else if (name == "RMASS(2)") {
00446         MSG_INFO("Setting up mass (RMASS(2)) = " << asDouble(value));
00447         FC_HWPROP.RMASS[2] = asDouble(value);
00448       } else if (name == "RMASS(3)") {
00449         MSG_INFO("Setting strange mass (RMASS(3)) = " << asDouble(value));
00450         FC_HWPROP.RMASS[3] = asDouble(value);
00451       } else if (name == "RMASS(4)") {
00452         MSG_INFO("Setting charm mass (RMASS(4)) = " << asDouble(value));
00453         FC_HWPROP.RMASS[4] = asDouble(value);
00454       } else if (name == "RMASS(5)") {
00455         MSG_INFO("Setting bottom mass (RMASS(5)) = " << asDouble(value));
00456         FC_HWPROP.RMASS[5] = asDouble(value);
00457       } else if (name == "RMASS(6)") {
00458         MSG_INFO("Setting top mass (RMASS(6)) = " << asDouble(value));
00459         FC_HWPROP.RMASS[6] = asDouble(value);
00460       } else if (name == "RMASS(198)") {
00461         MSG_INFO("Setting W+ mass (RMASS(198)) = " << asDouble(value));
00462         FC_HWPROP.RMASS[198] = asDouble(value);
00463       } else if (name == "RMASS(199)") {
00464         MSG_INFO("Setting W- mass (RMASS(199)) = " << asDouble(value));
00465         FC_HWPROP.RMASS[199] = asDouble(value);
00466       } else if (name == "RMASS(200)") {
00467         MSG_INFO("Setting Z0 mass (RMASS(200)) = " << asDouble(value));
00468         FC_HWPROP.RMASS[200] = asDouble(value);
00469       } else if (name == "RMASS(201)") {
00470         MSG_INFO("Setting H mass (RMASS(201)) = " << asDouble(value));
00471         FC_HWPROP.RMASS[201] = asDouble(value);
00472       } //...
00473 
00474       // Booleans (done as ints in Fortran)
00475       else if (name == "GENSOF") {
00476         MSG_INFO("Setting ... (GENSOF) = " << asInt(value));
00477         FC_HWEVNT.GENSOF = asInt(value);
00478       } else if (name == "AZSOFT") {
00479         MSG_INFO("Setting use of soft gluon azimuthal corellations on/off (AZSOFT) = " << asInt(value));
00480         FC_HWPRAM.AZSOFT = asInt(value);
00481       } else if (name == "CLRECO") {
00482         MSG_INFO("Setting inclusion of colour rearrangement on/off (CLRECO) = " << asInt(value));
00483         FC_HWUCLU.CLRECO = asInt(value);
00484       } else if (name == "AZSPIN") {
00485         MSG_INFO("Setting use of gloun spin azimuthal correlations on/off (AZSPIN) = " << asInt(value));
00486         FC_HWPRAM.AZSPIN = asInt(value);
00487       } else if (name == "ZPRIME") {
00488         MSG_INFO("Setting Z' flag (ZPRIME) = " << asInt(value));
00489         FC_HWPRAM.ZPRIME = asInt(value);
00490       } else if (name == "HARDME") {
00491         MSG_INFO("Setting hard matrix element flag (HARDME) = " << asInt(value));
00492         FC_HWPRAM.HARDME = asInt(value);
00493       } else if (name == "SOFTME") {
00494         MSG_INFO("Setting soft matrix element flag (SOFTME) = " << asInt(value));
00495         FC_HWPRAM.SOFTME = asInt(value);
00496       } else if (name == "NOSPAC") {
00497         MSG_INFO("Setting spacelike showers on/off (NOSPAC) = " << asInt(value));
00498         FC_HWPRAM.NOSPAC = asInt(value);
00499       } else if (name == "PRVTX") {
00500         MSG_INFO("Setting inclusion of vertex info in event printout on/off (PRVTX) = " << asInt(value));
00501         FC_HWPRAM.PRVTX = asInt(value);
00502       } else if (name == "PRNDEC") {
00503         MSG_INFO("Setting use of decimal in event printout (PRNDEC) = " << asInt(value));
00504         FC_HWPRAM.PRNDEC = asInt(value);
00505       } else if (name == "PRNDEF") {
00506         MSG_INFO("Setting stdout printout on/off (PRNDEF) = " << asInt(value));
00507         FC_HWPRAM.PRNDEF = asInt(value);
00508       } else if (name == "PRNTEX") {
00509         MSG_INFO("Setting LaTeX output on/off (PRNTEX) = " << asInt(value));
00510         FC_HWPRAM.PRNTEX = asInt(value);
00511       } else if (name == "PRNWEB") {
00512         MSG_INFO("Setting HTML output on/off (PRNWEB) = " << asInt(value));
00513         FC_HWPRAM.PRNWEB = asInt(value);
00514       } else if (name == "MIXING") {
00515         MSG_INFO("Setting neutral B mixing on/off (MIXING) = " << asInt(value));
00516         FC_HWDIST.MIXING = asInt(value);
00517       } else if (name == "NOWGT") {
00518         MSG_INFO("Setting unweighted generation (NOWGT) = " << asInt(value));
00519         FC_HWEVNT.NOWGT = asInt(value);
00520       } else if (name == "DoHadronisation") {
00521         MSG_INFO("Do hadronisation = " << value);
00522         _doHadronise = asBool(value);//...
00523       } else if (name == "unitWeight") {
00524         MSG_INFO("Using a weight value of 1 in unweighted events = " << value);
00525         _unitWeight = asBool(value);
00526         // Error
00527       } else {
00528         MSG_ERROR("Herwig doesn't have a parameter called " << name);
00529         return FAILURE;
00530       }
00531 
00532     }
00533     return SUCCESS;
00534   }

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().

00275                                                 {
00276       evt.clear();
00277     }

void fillEvent ( HepMC::GenEvent &  evt  )  [protected, virtual]

Fill a HepMC event.

Definition at line 564 of file FHerwig.cc.

References FHerwig::_nevt, FHerwig::_unitWeight, FC_HWEVNT, AGILe::fixHepMCUnitsFromGeVmm(), FHerwig::getCrossSection(), MSG_DEBUG, p, and xsec.

Referenced by FHerwigJimmy::makeEvent(), FHerwig::makeEvent(), AlpGenFHerwigJimmy::makeEvent(), and AlpGenFHerwig::makeEvent().

00564                                             {
00565     HepMC::IO_HERWIG hepevt;
00566     hepevt.fill_next_event(&evt);
00567     fixHepMCUnitsFromGeVmm(evt);
00568     evt.set_event_number(_nevt);
00569 
00570     // Set beam particle status = 4
00571     if (evt.valid_beam_particles()) {
00572       evt.beam_particles().first->set_status(4);
00573       evt.beam_particles().second->set_status(4);
00574     }
00575 
00576     // Rewrite status codes to match HepMC standard (2 -> 3, 195-199 -> 2)
00577     for (HepMC::GenEvent::particle_const_iterator p = evt.particles_begin(); p != evt.particles_end(); ++p) {
00578       if ((*p)->status() == 2) (*p)->set_status(3);
00579       if ((*p)->status() >= 195 && (*p)->status() <= 199) (*p)->set_status(2);
00580     }
00581 
00582     //IO_HERWIG::fillEvent does not fill the weight
00583     evt.weights().clear();
00584     if(FC_HWEVNT.NOWGT == 0 || !_unitWeight){
00585       evt.weights().push_back(FC_HWEVNT.EVWGT);
00586     }else{
00587       evt.weights().push_back(1.0);
00588     }
00589 
00590     // Cross-section
00591     #ifdef HEPMC_HAS_CROSS_SECTION
00592     HepMC::GenCrossSection xsec;
00593     const double xsecval = getCrossSection();
00594     const double xsecerr = getCrossSection() / std::sqrt(_nevt);
00595     MSG_DEBUG("Writing cross-section = " << xsecval << " +- " << xsecerr);
00596     xsec.set_cross_section(xsecval, xsecerr);
00597     evt.set_cross_section(xsec);
00598     #endif
00599   }

void finalize (  )  [virtual]

Tidy up after ourselves.

Tidy up, print out run stats, etc.

Implements Generator.

Reimplemented in FHerwigJimmy.

Definition at line 655 of file FHerwig.cc.

References FC_HWEFIN, and MSG_DEBUG.

00655                          {
00656     MSG_DEBUG("Finalising...");
00657     FC_HWEFIN();
00658   }

const double getCrossSection (  )  [virtual]

Return the generated cross section in pb.

Reimplemented from Generator.

Definition at line 648 of file FHerwig.cc.

References Generator::_crossSection, and FC_HWEVNT.

Referenced by FHerwig::fillEvent().

00648                                        {
00649     _crossSection = 1000.0 * FC_HWEVNT.WGTSUM / ((float)FC_HWEVNT.NWGTS);
00650     return _crossSection;
00651   }

virtual const std::string getName (  )  const [inline, virtual, inherited]

Get the generator name.

Reimplemented in Ariadne, Cascade, FHerwigJimmy, FPythia, Phojet, and Rapgap.

Definition at line 96 of file Generator.hh.

References Generator::_myName.

Referenced by Generator::getCrossSection(), Generator::getLog(), Generator::getPDFMember(), Generator::getPDFScheme(), Generator::getPDFSet(), and Generator::getState().

00096                                             {
00097       return _myName;
00098     }

int getPDFMember ( PdgCode  pid  )  [virtual]

Get the PDF id number for a given particle.

Reimplemented from Generator.

Definition at line 633 of file FHerwig.cc.

References FHerwig::_beamNumber(), and FC_HWPRAM.

00633                                       {
00634     const int beamNum = _beamNumber(pid);
00635     if (beamNum < 0) {
00636       throw runtime_error("PDFMember unknown for PDG code "+ pid);
00637     }
00638     const int member = FC_HWPRAM.MODPDF[beamNum];
00639     return member;
00640   }

string getPDFScheme ( PdgCode  pid  )  const [virtual]

Get the PDF scheme used by the generator (LHAPDF or other).

Reimplemented from Generator.

Definition at line 643 of file FHerwig.cc.

00643                                                 {
00644     return "LHAPDF";
00645   }

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 620 of file FHerwig.cc.

References FHerwig::_beamNumber(), and FC_HWPRCH.

00620                                       {
00621     const int beamNum = _beamNumber(pid);
00622     if (beamNum < 0) {
00623       throw runtime_error("PDFSet unknown for PDG code " + pid);
00624     }
00625     string autString = "";
00626     for (size_t ii = 0; ii != AUTPDF_LENGTH; ++ii) {
00627       autString += FC_HWPRCH.AUTPDF[beamNum][ii];
00628     }
00629     return autString;
00630   }

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     }

virtual const std::string getVersion (  )  [inline, virtual, inherited]

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.

Todo:
This getName() doesn't get used polymophically: fix it!

Reimplemented in Ariadne, FPythia, and Phojet.

Definition at line 112 of file Generator.hh.

References Generator::_myVersion, Generator::_versionSet, and MSG_ERROR.

Referenced by Generator::getState().

00112                                          {
00113       if (!_versionSet) {
00115         MSG_ERROR("You asked the generator " //<< getName()
00116                   << " what version it is, but it doesn't know!\n"
00117                   << "You should set the version with a call to setVersion(string)");
00118         throw runtime_error("Version unknown for generator");
00119       }
00120       return _myVersion;
00121     }

void initialize (  )  [protected, virtual]

Set up default params etc.

Reimplemented from Generator.

Reimplemented in FHerwigJimmy.

Definition at line 75 of file FHerwig.cc.

References Generator::_initialized, FHerwig::_iprocset, FHerwig::_processParams(), FC_HWEINI, FC_HWEVNT, FC_HWIGIN, FC_HWPRAM, FC_HWPROC, and FC_HWUINC.

00075                            {
00076     Generator::initialize();
00077 
00078     // Use QCD 2->2 as the default process
00079     if (!_iprocset) FC_HWPROC.IPROC = 1500;
00080 
00081     // Print banner and initialise common blocks (requires initial state and IPROC to have been set)
00082     FC_HWIGIN();
00083 
00084     // for (size_t idhw = 1; idhw <= 458; ++idhw) {
00085     //  std::cout << idhw << "  " << FC_HWPROP.IDPDG[idhw] << std::endl;
00086     // }
00087 
00088     // Set banner printout control params
00089     FC_HWPRAM.IPRINT = 1; // Type of info to print
00090     FC_HWPRAM.PRNDEF = 1; // Enable/disable ASCII output
00091 
00092     // Set some system params which HWIGIN has initialised to silly values
00093     FC_HWPROC.MAXEV = 10000000; // Maximum number of events (irrelevant!)
00094     FC_HWEVNT.MAXER = 10000000; // Maximum number of allowed errors
00095     FC_HWEVNT.MAXPR = 0; // Number of events to print
00096 
00097     // Apply stored parameters
00098     _processParams();
00099 
00100     // Compute parameter-dependent constants
00101     FC_HWUINC();
00102 
00103     // Initialise elementary process
00104     FC_HWEINI();
00105 
00106     _initialized = true;
00107   }

void makeEvent ( HepMC::GenEvent &  evt  )  [virtual]

Run the generator for one event.

Reimplemented from Generator.

Reimplemented in AlpGenFHerwig, AlpGenFHerwigJimmy, and FHerwigJimmy.

Definition at line 538 of file FHerwig.cc.

References FHerwig::_doHadronise, FHerwig::_nevt, FC_HWBGEN, FC_HWCDEC, FC_HWCFOR, FC_HWDHAD, FC_HWDHOB, FC_HWDHVY, FC_HWEPRO, FC_HWEVNT, FC_HWMEVT, FC_HWUFNE, FC_HWUINE, and FHerwig::fillEvent().

00538                                             {
00539     // Loop until event works
00540     while (true) {
00541       Generator::makeEvent(evt);
00542       FC_HWUINE();  // Initialize event
00543       FC_HWEPRO();  // Generate hard subprocess
00544       FC_HWBGEN();  // Generate parton cascade
00545       FC_HWDHOB();  // Do heavy quark decays
00546       if(_doHadronise){
00547         FC_HWCFOR();  // Do cluster formation
00548         FC_HWCDEC();  // Do cluster decays
00549         FC_HWDHAD();  // Do unstable particle decays
00550         FC_HWDHVY();  // Do heavy flavor decays
00551         FC_HWMEVT();  // Add soft underlying event
00552       }
00553       FC_HWUFNE();  // Finish event
00554       if (FC_HWEVNT.IERROR == 0) break;
00555     }
00556     // Fill event from HEPEVT
00557     fillEvent(evt);
00558     // Increment an event counter (Pythia does not count for itself).
00559     _nevt++;
00560   }

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 56 of file FHerwig.cc.

References Generator::_particleNames, AGILe::ANTIPROTON, FC_HWBMCH, FC_HWPROC, MSG_DEBUG, AGILe::NEUTRON, and AGILe::PROTON.

00056                                                                                {
00057     MSG_DEBUG("Setting initial state...");
00058     // Herwig's initial state particles specification must be 8 chars long
00059     for (size_t i = 0; i < 8; ++i) {
00060       FC_HWBMCH.PART1[i] = _particleNames[ParticleName(p1)].c_str()[i];
00061       FC_HWBMCH.PART2[i] = _particleNames[ParticleName(p2)].c_str()[i];
00062     }
00063     // Set momenta / energies
00064     // NB. Beam ordering is significant (segfault if "wrong") for HERA-like initial states
00065     // Subtraction of (very rough!) beam particle masses to get momenta rather than energies
00066     if (p1 == PROTON || p1 == ANTIPROTON || p1 == NEUTRON) e1 = sqrt(e1*e1 - 1.0);
00067     if (p2 == PROTON || p2 == ANTIPROTON || p2 == NEUTRON) e2 = sqrt(e2*e2 - 1.0);
00068     // And set the common block values
00069     FC_HWPROC.PBEAM1 = e1;
00070     FC_HWPROC.PBEAM2 = e2;
00071   }

void setInitialState ( int  p1 = PROTON,
double  e1 = 7000.0,
int  p2 = PROTON,
double  e2 = 7000.0 
) [inline, inherited]

Define initial state.

Todo:
Make sure it was successful - exception handling

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 a parameter to the generator.

Reimplemented in AlpGenFHerwig, AlpGenFHerwigJimmy, CharybdisFHerwig, CharybdisFHerwigJimmy, and FHerwigJimmy.

Definition at line 118 of file FHerwig.cc.

References FHerwig::_iprocset, FHerwig::_storedParams, AGILe::asDouble(), AGILe::asInt(), call_lhefopen(), FC_HWPROC, MSG_INFO, and Generator::SUCCESS.

Referenced by FHerwigJimmy::setParam(), and FHerwig::setSeed().

00118                                                                 {
00119     Generator::setParam(name, value);
00120     if (name == "IPROC") {
00121       // 1610 = gg -> H -> WW; 1706 = qq -> ttbar; 2510 = ttH -> ttWW, ...
00122       MSG_INFO("Setting process code (IPROC) = " << asInt(value));
00123       FC_HWPROC.IPROC = asInt(value);
00124       _iprocset = true;
00125     } else if (name == "PBEAM1") {
00126       MSG_INFO("Setting beam 1 momentum (PBEAM1) = " << asDouble(value));
00127       FC_HWPROC.PBEAM1 = asDouble(value);
00128     } else if (name == "PBEAM2") {
00129       MSG_INFO("Setting beam 2 momentum (PBEAM2) = " << asDouble(value));
00130       FC_HWPROC.PBEAM2 = asDouble(value);
00131     // } else if (name == "EBEAM1") {
00132     //   MSG_INFO("Setting beam 1 energy (EBEAM1) = " << asDouble(value));
00133     //   FC_HWPROC.EBEAM1 = asDouble(value);
00134     // } else if (name == "EBEAM2") {
00135     //   MSG_INFO("Setting beam 2 energy (EBEAM2) = " << asDouble(value));
00136     //   FC_HWPROC.EBEAM2 = asDouble(value);
00137     } else if (name == "LHEF") {
00138       if(FC_HWPROC.IPROC>0) {
00139     FC_HWPROC.IPROC = -FC_HWPROC.IPROC;
00140     _iprocset=true;
00141     MSG_INFO("LHEF meta-param has been set: turn IPROC negative = "<< FC_HWPROC.IPROC);
00142       } else if (!_iprocset) {
00143     FC_HWPROC.IPROC = -1;
00144     _iprocset=true;
00145     MSG_INFO("LHEF meta-param has been set: set IPROC = "<< FC_HWPROC.IPROC);
00146       }
00147       MSG_INFO("LHEF meta-param has been set: calling OPEN *now* for LHE file = " << value);
00148       call_lhefopen(value.c_str());
00149     } else {
00150       _storedParams[name] = value;
00151     }
00152     return SUCCESS;
00153   }

void setSeed ( const int  value  )  [virtual]

Set the random number generator seed.

Reimplemented from Generator.

Definition at line 111 of file FHerwig.cc.

References FHerwig::setParam().

00111                                        {
00112     Generator::setSeed(value);
00113     setParam("SEED", value);
00114   }

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.

00090                                                        {
00091       throw runtime_error("This ain't ready yet, it's just here as an interface placeholder. Sorry.");
00092     }

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     }


Member Data Documentation

bool _doHadronise [protected]

Flag to determine if the hadronisation process will be run.

Definition at line 54 of file FHerwig.hh.

Referenced by FHerwig::_processParams(), FHerwigJimmy::makeEvent(), FHerwig::makeEvent(), AlpGenFHerwigJimmy::makeEvent(), and AlpGenFHerwig::makeEvent().

bool _initialized [protected, inherited]
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().

bool _iprocset [protected]

Flag to determine if the process code has been set.

Definition at line 60 of file FHerwig.hh.

Referenced by AlpGenFHerwig::AlpGenFHerwig(), AlpGenFHerwigJimmy::AlpGenFHerwigJimmy(), FHerwig::initialize(), and FHerwig::setParam().

int _nevt [private]

Event counter.

Definition at line 81 of file FHerwig.hh.

Referenced by FHerwig::FHerwig(), FHerwig::fillEvent(), and FHerwig::makeEvent().

map<string,string> _storedParams [private]

Map of params and values used by _processParams.

Definition at line 78 of file FHerwig.hh.

Referenced by FHerwig::_processParams(), and FHerwig::setParam().

bool _unitWeight [protected]

Flag to determine if weighted or unweighted events are to be generated.

Definition at line 57 of file FHerwig.hh.

Referenced by FHerwig::_processParams(), and FHerwig::fillEvent().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 10:39:40 2012 for AGILe - A Generator Interface Library (+ executable) by  doxygen 1.6.3