PYTHIA  8.311
Public Member Functions | List of all members
Settings Class Reference

#include <Settings.h>

Public Member Functions

 Settings ()
 Constructor.
 
void initPtrs (Logger *loggerPtrIn)
 Initialize Logger pointer.
 
bool init (string startFile="../share/Pythia8/xmldoc/Index.xml", bool append=false)
 Read in database from specific file. More...
 
bool init (istream &is, bool append=false)
 Read in database from stream. More...
 
bool reInit (string startFile="../share/Pythia8/xmldoc/Index.xml")
 Overwrite existing database by reading from specific file. More...
 
bool readString (string line, bool warn=true)
 Read in one update from a single line. More...
 
bool registerPluginLibrary (string libName, string startFile="")
 Register the settings from a plugin library. More...
 
bool writeFile (string toFile, bool writeAll=false)
 Write updates or everything to user-defined file or to stream. More...
 
bool writeFile (ostream &os=cout, bool writeAll=false)
 Write updates or everything to user-defined stream (or file). More...
 
bool writeFileXML (ostream &os=cout)
 Write updates or everything to user-defined stream (or file). More...
 
void listAll ()
 
void listChanged ()
 
void list (string match)
 
string output (string keyIn, bool fullLine=true)
 Give back current value(s) as a string, whatever the type. More...
 
vector< string > getReadHistory (int subrun=-999)
 
void resetAll ()
 Reset all values to their defaults. More...
 
bool isFlag (string keyIn)
 Query existence of an entry.
 
bool isMode (string keyIn)
 
bool isParm (string keyIn)
 
bool isWord (string keyIn)
 
bool isFVec (string keyIn)
 
bool isMVec (string keyIn)
 
bool isPVec (string keyIn)
 
bool isWVec (string keyIn)
 
void addFlag (string keyIn, bool defaultIn)
 Add new entry.
 
void addMode (string keyIn, int defaultIn, bool hasMinIn, bool hasMaxIn, int minIn, int maxIn, bool optOnlyIn=false)
 
void addParm (string keyIn, double defaultIn, bool hasMinIn, bool hasMaxIn, double minIn, double maxIn)
 
void addWord (string keyIn, string defaultIn)
 
void addFVec (string keyIn, vector< bool > defaultIn)
 
void addMVec (string keyIn, vector< int > defaultIn, bool hasMinIn, bool hasMaxIn, int minIn, int maxIn)
 
void addPVec (string keyIn, vector< double > defaultIn, bool hasMinIn, bool hasMaxIn, double minIn, double maxIn)
 
void addWVec (string keyIn, vector< string > defaultIn)
 
bool flag (string keyIn)
 Give back current value, with check that key exists.
 
int mode (string keyIn)
 
double parm (string keyIn)
 
string word (string keyIn)
 
vector< bool > fvec (string keyIn)
 
vector< int > mvec (string keyIn)
 
vector< double > pvec (string keyIn)
 
vector< string > wvec (string keyIn)
 
bool flagDefault (string keyIn)
 Give back default value, with check that key exists.
 
int modeDefault (string keyIn)
 
double parmDefault (string keyIn)
 
string wordDefault (string keyIn)
 
vector< bool > fvecDefault (string keyIn)
 
vector< int > mvecDefault (string keyIn)
 
vector< double > pvecDefault (string keyIn)
 
vector< string > wvecDefault (string keyIn)
 
map< string, FlaggetFlagMap (string match)
 Give back a map of all entries whose names match the string "match". More...
 
map< string, ModegetModeMap (string match)
 
map< string, ParmgetParmMap (string match)
 
map< string, WordgetWordMap (string match)
 
map< string, FVecgetFVecMap (string match)
 
map< string, MVecgetMVecMap (string match)
 
map< string, PVecgetPVecMap (string match)
 
map< string, WVecgetWVecMap (string match)
 
void flag (string keyIn, bool nowIn, bool force=false)
 Change current value, respecting limits. More...
 
bool mode (string keyIn, int nowIn, bool force=false)
 
bool parm (string keyIn, double nowIn, bool force=false)
 
void word (string keyIn, string nowIn, bool force=false)
 
void fvec (string keyIn, vector< bool > nowIn, bool force=false)
 
bool mvec (string keyIn, vector< int > nowIn, bool force=false)
 
bool pvec (string keyIn, vector< double > nowIn, bool force=false)
 
void wvec (string keyIn, vector< string > nowIn, bool force=false)
 
void forceMode (string keyIn, int nowIn)
 
void forceParm (string keyIn, double nowIn)
 
void forceMVec (string keyIn, vector< int > nowIn)
 
void forcePVec (string keyIn, vector< double > nowIn)
 
void resetFlag (string keyIn)
 Restore current value to default.
 
void resetMode (string keyIn)
 
void resetParm (string keyIn)
 
void resetWord (string keyIn)
 
void resetFVec (string keyIn)
 
void resetMVec (string keyIn)
 
void resetPVec (string keyIn)
 
void resetWVec (string keyIn)
 
bool getIsInit ()
 Check initialisation status.
 
bool readingFailed ()
 Keep track whether any readings have failed, invalidating run setup.
 
bool unfinishedInput ()
 Check whether input openend with { not yet closed with }.
 
bool hasHardProc ()
 Check whether processes other than SoftQCD/LowEnergyQCD are switched on. More...
 

Detailed Description

This class holds info on flags (bool), modes (int), parms (double), words (string), fvecs (vector of bool), mvecs (vector of int), pvecs (vector of double) and wvecs (vector of string).

Member Function Documentation

void flag ( string  keyIn,
bool  nowIn,
bool  force = false 
)

Change current value, respecting limits.

Change current value. Respect limits unless force==true. If key not recognised, add new key if force==true, otherwise ignore.

Print:quiet triggers a whole set of changes.

void forceMode ( string  keyIn,
int  nowIn 
)
inline

Methods kept for backwards compatability with 8.223 and earlier. (To be removed in next major release.)

map< string, Flag > getFlagMap ( string  match)

Give back a map of all entries whose names match the string "match".

Get a map of entries whose names contain the string "match".

Make the match string lower case. Start with an empty map.

Loop over the flag map (using iterator).

map< string, FVec > getFVecMap ( string  match)

Make the match string lower case. Start with an empty map.

Loop over the fvec map (using iterator).

map< string, Mode > getModeMap ( string  match)

Make the match string lower case. Start with an empty map.

Loop over the mode map (using iterator).

map< string, MVec > getMVecMap ( string  match)

Make the match string lower case. Start with an empty map.

Loop over the mvec map (using iterator).

map< string, Parm > getParmMap ( string  match)

Make the match string lower case. Start with an empty map.

Loop over the parm map (using iterator).

map< string, PVec > getPVecMap ( string  match)

Make the match string lower case. Start with an empty map.

Loop over the pvec map (using iterator).

vector<string> getReadHistory ( int  subrun = -999)
inline

Retrieve readString history (e.g., for inspection). Everything (subrun=-999), up to first subrun (=-1), or subrun-specific (>=0).

map< string, Word > getWordMap ( string  match)

Make the match string lower case. Start with an empty map.

Loop over the word map (using iterator).

map< string, WVec > getWVecMap ( string  match)

Make the match string lower case. Start with an empty map.

Loop over the wvec map (using iterator).

bool hasHardProc ( )

Check whether processes other than SoftQCD/LowEnergyQCD are switched on.

Check whether any other processes than SoftQCD and LowEnergyQCD are switched on. Note that Les Houches input has to be checked separately.

List of (most?) process name groups, in lowercase. Special cases.

Loop over the flag map (using iterator), and process names.

Done without having found a non-SoftQCD/LowEnergyQCD process on.

bool init ( string  startFile = "../share/Pythia8/xmldoc/Index.xml",
bool  append = false 
)

Read in database from specific file.

Settings class. This class contains flags, modes, parms and words used in generation.

Don't initialize if it has already been done and not in append mode.

Reset readString history.

List of files to be checked. Start with input file.

If nontrivial startfile path, then use that for other files as well.

Loop over files. Open them for read.

Check that instream is OK.

Read in one line at a time.

Get first word of a line, to interpret it as tag. Remove "more".

Skip ahead if not interesting. Only look for new files in startfile.

Read and append continuation line(s) if line does not contain >.

Remove extra blanks before an = sign.

Add file also to be read.

Find name attribute.

Check that default value attribute present, and whether max and min.

Check for occurence of a bool and add to flag map.

Check for occurence of an int and add to mode map.

Enforce check that only allowed options are accepted.

Check for occurence of a double and add to parm map.

Check for occurence of a string and add to word map.

Check for occurence of a bool vector and add to fvec map.

Check for occurence of an int vector and add to mvec map.

Check for occurence of a double vector and add to pvec map.

Check for occurence of a string vector and add to wvec map.

End of loop over lines in input file and loop over files.

Set up default e+e- and pp tunes, if positive.

Done.

bool init ( istream &  is,
bool  append = false 
)

Read in database from stream.

Read in database from specific stream.

Don't initialize if it has already been done and not in append mode.

Check that instream is OK.

Reset readString history.

Read in one line at a time.

Get first word of a line, to interpret it as tag. Remove "more".

Skip ahead if not interesting. Only look for new files in startfile.

Read and append continuation line(s) if line does not contain >.

Remove extra blanks before an = sign.

Find name attribute.

Check that default value attribute present, and whether max and min.

Check for occurence of a bool and add to flag map.

Check for occurence of an int and add to mode map.

Enforce check that only allowed options are accepted.

Check for occurence of a double and add to parm map.

Check for occurence of a string and add to word map.

Check for occurence of a bool vector and add to fvec map.

Check for occurence of an int vector and add to mvec map.

Check for occurence of a double vector and add to pvec map.

Check for occurence of a string vector and add to word map.

End of loop over lines in input file and loop over files.

Set up default e+e- and pp tunes, if positive.

Done.

void listAll ( )
inline

Print out table of database, either all or only changed ones, or ones containing a given string.

bool mode ( string  keyIn,
int  nowIn,
bool  force = false 
)

Fail if values are outside range.

Tune:ee and Tune:pp each trigger a whole set of changes.

string output ( string  keyIn,
bool  fullLine = true 
)

Give back current value(s) as a string, whatever the type.

Default string echoes input key =.

Identify flag, mode, parm or word, and convert to string.

Identify fvec, mvec, pvec or wvec, and convert to string.

Default value, possible endline and done.

bool readString ( string  line,
bool  warn = true 
)

Read in one update from a single line.

Read in updates from a character string, like a line of a file. Is used by readString (and readFile) in Pythia.

If empty line then done.

If unfinished line then add new to existing, else use input line as is.

If first character is not a letter, then taken to be a comment line.

Allow the += notation to add to a settings vector.

Replace an equal sign by a blank to make parsing simpler, except after {.

Get first word of a line.

Replace two colons by one (:: -> :) to allow for such mistakes.

Check whether this is in the database.

Warn and done if not in database.

Find value. Warn if none found.

If value is a ? then echo the current value.

Check for FORCE= statements (to ignore min/max values)

Read value from next word

If string begins with { then find matching } and extract contents.

If not } on same line then must append next line and try again.

Update flag map; allow many ways to say yes.

Update mode map.

Update parm map.

Update word map.

Update fvec map.

Update mvec map.

Update pvec map.

Update wvec map.

Store history of valid readString statements

Done.

bool registerPluginLibrary ( string  libName,
string  startFile = "" 
)

Register the settings from a plugin library.

Load a plugin library, and register any settings.

Check if already loaded.

Load the plugin library.

Check if XML index has been specified.

Find the path to the XML, first PYTHIA8CONTRIB, then Pythia XML path.

Load the XML files, if specified.

Load the settings registration symbol.

bool reInit ( string  startFile = "../share/Pythia8/xmldoc/Index.xml")

Overwrite existing database by reading from specific file.

Reset maps to empty.

Then let normal init do the rest.

void resetAll ( )

Reset all values to their defaults.

Loop through the flags table, resetting all entries.

Loop through the modes table, resetting all entries.

Loop through the parms table, resetting all entries.

Loop through the words table, resetting all entries.

Loop through the fvecs table, resetting all entries.

Loop through the mvecs table, resetting all entries.

Loop through the pvecs table, resetting all entries.

Loop through the wvecs table, resetting all entries.

void resetMode ( string  keyIn)

For Tune:ee and Tune:pp must also restore variables involved in tunes.

bool writeFile ( string  toFile,
bool  writeAll = false 
)

Write updates or everything to user-defined file or to stream.

Write updates or everything to user-defined file.

Open file for writing.

Hand over real work to next method.

bool writeFile ( ostream &  os = cout,
bool  writeAll = false 
)

Write updates or everything to user-defined stream (or file).

Write simple header as comment.

Iterators for the flag, mode and parm tables.

Loop while there is something left to do.

Check if a flag is next in lexigraphical order; if so print it.

Else check if mode is next, and if so print it.

Else check if parm is next, and if so print it; fixed or scientific.

Else check if word is next, and if so print it.

Else check if fvec is next, and if so print it.

Else check if mvec is next, and if so print it.

Else check if pvec is next; print fixed or scientific.

Else print wvec.

Done.

bool writeFileXML ( ostream &  os = cout)

Write updates or everything to user-defined stream (or file).

Iterators for the flag, mode and parm tables.

Loop while there is something left to do.

Check if a flag is next in lexigraphical order; if so print it.

Else check if mode is next, and if so print it.

Else check if parm is next, and if so print it; fixed or scientific.

Else check if word is next, and if so print it.

Else check if fvec is next, and if so print it.

Else check if mvec is next, and if so print it.

Else check if pvec is next; print fixed or scientific.

Else print wvec.

Done.

void wvec ( string  keyIn,
vector< string >  nowIn,
bool  force = false 
)

Register settings from plugin libraries immediately.


The documentation for this class was generated from the following files: