Home · Overview · Users Guide · Reference Guide

EventGeneratorSettings Class Reference

EventGeneratorSettings holds Sartre's run and configuration parameters. More...

 #include "EventGeneratorSettings.h"

Inheritance

Inherits from virtual class Settings.


Public Member Functions

static EventGeneratorSettings* instance()
void setVerbose(bool)
bool verbose() const
void setVerboseLevel(int)
int verboseLevel() const
void setNumberOfEvents(unsigned long)
unsigned long numberOfEvents() const
void setTimesToShow(unsigned int)
unsigned int timesToShow() const
void setQ2min(double)
double Q2min() const
double Qmin() const
void setQ2max(double)
double Q2max() const
double Qmax() const
void setWmin(double)
void setW2min(double)
double Wmin() const
double W2min() const
void setWmax(double)
void setW2max(double)
double Wmax() const
double W2max() const
int vectorMesonId() const
void setVectorMesonId(int)
double electronBeamEnergy() const
void setElectronBeamEnergy(double)
double hadronBeamEnergy() const
void setHadronBeamEnergy(double)
TLorentzVector eBeam() const
TLorentzVector hBeam() const
string dipoleModelName() const
DipoleModelType dipoleModelType() const
void setDipoleModelType(DipoleModelType)
string rootfile() const
void setRootfile(const char*)
unsigned int A() const
void setA(unsigned int)
bool correctForRealAmplitude() const
void setCorrectForRealAmplitude(bool)
bool correctSkewedness() const
void setCorrectSkewedness(bool)
bool enableNuclearBreakup() const
void setEnableNuclearBreakup(bool)
double maxNuclearExcitationEnergy() const
void setMaxNuclearExcitationEnergy(double)
double maxLambdaUsedInCorrections() const
void setMaxLambdaUsedInCorrections(double)
bool applyPhotonFlux() const
void setApplyPhotonFlux(bool)
bool UPC() const
void setUPC(bool)
unsigned int UPCA() const
void setUPCA(unsigned int)

Inherited Public Member Functions

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 main API for event generation is class Sartre. However, Sartre does not handle its settings parameters at all but defers that job to the "Settings" classes. These classes are not only simple containers for parameters but provide lots of functionality to load, print, and manage parameters and also provide some particle lookup features. The basic functionality is provided by the Settings class, inherited by the EventGeneratorSettings class. For creating the amplitude table a separate class needs to be used (TableGeneratorSettings), EventGeneratorSettings only deals with the parameter needed for generating events and/or calculating cross-sections.

EventGeneratorSettings is a singleton class, i.e., only one instance exist at any time. One can always obtain the actual instance using the static instance() method. For example:

            // somewhere in your code
            EventGeneratorSettings* mySettings = EventGeneratorSettings::instance();

The more conventional (and preferred) way of obtaining the actual instance is through your instance of Sartre.

            Sartre mySartre;
            EventGeneratorSettings* mySettings = mySartre::runSettings();

EventGeneratorSettings (via Settings) also provides the "runcard" mechanism, that is the possibility to store all parameters to run Sartre in a text file (the runcard) and read them in (see Sartre::init() for details).

Parameters managed by EventGeneratorSettings can be set and used via access functions. Each access function has an equivalent runcard name. For more on see the detailed documentation on the Sartre class page where also the default values for all parameters are listed.

Several of the parameters listed here are strictly not mandatory to run Sartre. The are only provided for convenience to allow the user to control his program through a runcard allowing multiple runs with different parameters without the need to recompile. Two examples are the "number of events" and the "times to show" parameter. Here is an example on how to make effective use of them:

            int nPrint;   
            if (settings->timesToShow())   
            nPrint = settings->numberOfEvents()/settings->timesToShow();   
            else    
            nPrint = 0;   
            
            
            for (unsigned long iEvent = 0; iEvent < settings->numberOfEvents(); iEvent++) {   
                //   
                //  Generate one event   
                //   
                Event *event = sartre.generateEvent();   
                if (nPrint && iEvent%nPrint == 0 && iEvent != 0) {   
                cout << "processed " << iEvent << " events" << endl;   
                }
                // you code here
                }

If the timesToShow parameter was set to 20, the status is printed out exactly 20 times independent of the number of events. The number of events to process can be controlled through the runcard.

Note that parameters should not be changed after the call to Sartre::init().


Public Member Function Documentation

static EventGeneratorSettings* instance()

Static method returning a pointer to self. Note, that there is no public constructor for EventGeneratorSettings. The only way to get an instance is through this method.

void setVerbose(bool value)

Switches verbosity on or off. Equivalent runcard entry is verbose.

bool verbose() const

Returns verbosity flag.

void setVerboseLevel(int value)

Sets the verbosity level to value. Higher values than 1 or 2 are for debugging purposes only. If > 0 automatically sets the verbose flag (see above) to true. Equivalent runcard entry is verboseLevel.

int verboseLevel() const

Returns the verbosity level (0,1,2,...).

void setNumberOfEvents(unsigned long value)

Set number of events to generate to value. Equivalent runcard entry is numberOfEvents. Note that this is a user parameter and is only added for convenience since it allows to set the number of events to generate through a runcard. See example program sartreMain.cpp for how to use.

unsigned long numberOfEvents() const

Returns the number of events to generate. See setNumberOfEvents().

void setTimesToShow(unsigned int value)

Defines how many times the current status (number of events generated so far) should be printed. Equivalent runcard entry is timesToShow. Note that this is a user parameter and is only added for convenience since it allows to set this useful parameter through a runcard. See example program sartreMain.cpp for how to use, or example above.

unsigned int timesToShow() const

Returns user parameter meant to control status-printouts. See setTimesToShow().

void setQ2min(double value)

Sets the minimum Q2 in GeV2 to generate to value. If Q2min > Q2max then the largest available range is used, either given by kinematics or the range of the available tables. Equivalent runcard entry is Q2min.

double Q2min() const

Returns minimum Q2 to generate (in GeV2). See also setQ2min(). Note that this is the parameter set by the user and is not necessarily the actual value used (see here for details).

double Qmin() const

Returns minimum Q to generate (in GeV). See also setQ2min() and Q2min(). Alternative form to above using Q not Q2. Note that this is the parameter set by the user and is not necessarily the actual value used (see here for details).

void setQ2max(double value)

Sets the maximum Q2 in GeV2 to generate to value. If Q2min > Q2max then the largest available range is used, either given by kinematics or the range of the available tables. Equivalent runcard entry is Q2max.

double Q2max() const

Returns maximum Q2 to generate (in GeV2). See also setQ2max(). Note that this is the parameter set by the user and is not necessarily the actual value used (see here for details).

double Qmax() const

Returns maximum Q to generate (in GeV). Alternative form to above using Q not Q2. See also setQ2max() and Q2max(). Note that this is the parameter set by the user and is not necessarily the actual value used (see here for details).

void setWmin(double value)

Sets the minimum W to generate (in GeV) to value. If Wmin > Wmax then the largest available range is used, either given by kinematics or the range of the available tables. Equivalent runcard entry is Wmin.

void setW2min(double value)

Alternative form to above using W2 not W. No runcard equivalent.

double Wmin() const

Returns minimum W to generate (in GeV). Note that this is the parameter set by the user and is not necessarily the actual value used (see here for details).

double W2min() const

Returns minimum W2 to generate (in GeV2). See also setW2min() and Wmin(). Note that this is the parameter set by the user and is not necessarily the actual value used (see here for details).

void setWmax(double value)

Sets the maximum W to generate (in GeV) to value. If Wmin > Wmax then the largest available range is used, either given by kinematics or the range of the available tables. Equivalent runcard entry is Wmax.

void setW2max(double value)

Alternative form to above using W2 not W. No equivalent runcard. See also setWmax().

double Wmax() const

Returns maximum W to generate (in GeV). Note that this is the parameter set by the user and is not necessarily the actual value used (see here for details).

double W2max() const

Returns maximum W2 to generate (in GeV2). Note that this is the parameter set by the user and is not necessarily the actual value used (see here for details).

int vectorMesonId() const

Returns PDG value of vector meson to be generated.

void setVectorMesonId(int ID)

Sets ID of vector meson to generate. Mesons are given using their PDG values. Equivalent runcard entry is vectorMesonId.

double electronBeamEnergy() const

Electron beam energy in GeV.

void setElectronBeamEnergy(double E)

Sets electron beam energy to E (in GeV). Equivalent runcard entry is eBeamEnergy.

double hadronBeamEnergy() const

Hadron beam energy on GeV.

void setHadronBeamEnergy(double E)

Sets electron beam energy to E (in GeV). Equivalent runcard entry is hBeamEnergy.

TLorentzVector eBeam() const

Returns electron beam 4-vector. See ROOT documentation for TLorentzVector.

TLorentzVector hBeam() const

Returns hadron beam 4-vector. See ROOT documentation for TLorentzVector.

string dipoleModelName() const

Returns name of dipole Model used.

DipoleModelType dipoleModelType() const

Returns dipole model used.

void setDipoleModelType(DipoleModelType model)

Sets dipole model to be used. Equivalent runcard entry is dipoleModel.

string rootfile() const

Returns name of root file (or any output file name). See also setRootfile().

void setRootfile(const char* filename)

Sets name of root file (or any output file name). Note that this is a user parameter and is only added for convenience since it allows to set the name of the output file via runcards. See example program sartreMain.cpp on how to use. Equivalent runcard entry is rootfile.

unsigned int A() const

Returns the (integer) mass of the hadron beam particle.

void setA(unsigned int value)

Returns the mass of the hadron beam particle to value (1=proton beam). Not that not all nuclei are implemented (see class Nuclei for details). Equivalent runcard entry is A.

bool correctForRealAmplitude() const

Whether the correction for the missing real amplitude is switched on or off.

void setCorrectForRealAmplitude(bool value)

Switch correction for real amplitude not being taken into account or or off. Equivalent runcard entry is correctForRealAmplitude.

bool correctSkewedness() const

Whether the skewedness correction switched on or off.

void setCorrectSkewedness(bool value)

Switch skewedness on or off. Equivalent runcard entry is correctSkewedness.

bool enableNuclearBreakup() const

Returns if nuclear break up for incoherent events is switched on or off.

void setEnableNuclearBreakup(bool value)

Switch nuclear break up for incoherent events on or off. Equivalent runcard entry is enableNuclearBreakup. Note that switching nuclear breakup on slows event generation down significantly.

double maxNuclearExcitationEnergy() const

Maximum excitation energy of nuclei in incoherent events.

void setMaxNuclearExcitationEnergy(double E)

Sets the maximum excitation energy of nuclei in incoherent events to E (in GeV). This is necessary since the underlying evaporation engine (Gemini) cannot handle too large energies. Equivalent runcard entry is maxNuclearExcitationEnergy.

double maxLambdaUsedInCorrections() const

Maximum log derivate of the amplitude used in corrections.

void setMaxLambdaUsedInCorrections(double value)

Sets the maximum log derivate of the amplitude used in corrections. See setCorrectSkewedness() and setCorrectForRealAmplitude(). Equivalent runcard entry is maxLambdaUsedInCorrections.

bool applyPhotonFlux() const

Returns flag that controls if the photon flux is applied to the cross-section or not.

void setApplyPhotonFlux(bool value)

Sets flag to control if the photon flux is applied in the cross-section calculation or not. This should be always on in generator mode. There are few cases (see example program heraCompare.cpp) when Sartre is used to calculate cross-sections only, where this might be useful. For experts only. Equivalent runcard entry is applyPhotonFlux.

bool UPC() const

Returns flag that controls weather to use UPC.

void setUPC(bool value)

Set flag to tell the program to simulate ultra peripheral collisions by using a photon flux from a proton or a nucleus, depending on the value of UPCA. Default value is false.

unsigned int UPCA() const

Returns the atomic number of the beam-particle that emits a (virtual) photon in UPC events. If UPC=false, this variable has no effect.

void setUPCA(unsigned int value)

Sets the atomic number of the beam-particle that emits a (virtual) photon in a UPC event.

 

   

Last Update: January 11, 2013