Home · Overview · Users Guide · Reference Guide

Settings Class Reference

Settings is the virtual base class for the EventGeneratorSettings and TableGeneratorSettings classes. More...

 #include "Settings.h"

Inheritance

Inherited by EventGeneratorSettings, TableGeneratorSettings.

Public Member Functions

Settings()
virtual ~Settings()
bool readSettingsFromFile(const char*)
virtual bool list(ostream& = cout)
TParticlePDG* lookupPDG(int) const
string particleName(int pdgID)
static TRandom3* randomGenerator()
unsigned int seed() const
void setSeed(unsigned int)
int userInt() const
double userDouble() const
string userString() const
void setUserInt(int)
void setUserDouble(double)
void setUserString(const string&)

Detailed Description

The Settings class is the virtual base class for the EventGeneratorSettings and TableGeneratorSettings classes. It is not directly used in Sartre but defines the basic features of the "Settings" mechanism in Sartre.


Public Member Function Documentation

Settings()

Constructor.

virtual ~Settings()

Destructor.

bool readSettingsFromFile(const char* file)

Reads and sets all parameters from file (runcard). For file format and syntax see the runcard reference page. Returns false if file does not exist or could not be read, otherwise return true.

virtual bool list(ostream& os = cout)

Prints all parameter with their current value. Useful to call after Sartre::init() to verify that all parameters are set and to keep log.

TParticlePDG* lookupPDG(int pdgID) const

Return pointer to TParticlePDG, a ROOT class that provides PDG information (e.g. mass, spin, etc.) on particle pdgId.

string particleName(int pdgId)

Returns name of the particle for given PDG identifier pdgId.

static TRandom3* randomGenerator()

Static method. Returns pointer to the main random generator used in Sartre. Note that there is only one instance of TRandom3 in Sartre.

unsigned int seed() const

Returns the set seed for Sartre's random number generator. Note that it is not the current seed at the time when the method is used but the original seed defined, that is the one set in Sartre::init().

void setSeed(unsigned int value)

Sets the seed for Sartre's random number generator to value. Be aware that when called after Sartre::init() this method will set the new seed, ignoring previously defined seeds. The equivalent runcard entry is seed.

int userInt() const

Returns integer user variable. See also setUserInt(). Main advantage of adding variables to the "Settings" mechanism is to give the user some parameters to use in his application that can be set via runcards.

double userDouble() const

Returns floating point user variable. See also setUserDouble(). Main advantage of adding variables to the "Settings" mechanism is to give the user some parameters to use in his application that can be set via runcards.

string userString() const

Returns string user variable. See also setUserString(). Main advantage of adding variables to the "Settings" mechanism is to give the user some parameters to use in his application that can be set via runcards.

void setUserInt(int val)

Sets user integer parameter to val. See also userInt(). The equivalent runcard entry is userInt.

void setUserDouble(double val)

Sets user floating point parameter to val. See also userDouble(). The equivalent runcard entry is userDouble.

void setUserString(const string&val)

Sets user string parameter to val. See also userString(). The equivalent runcard entry is userString.

 

   

Last Update: January 8, 2013