ThePEG::XSecStat Class Reference

XSecStat is a concrete helper class used to collect statistics about the cross section for a specific process or group of processes. More...

#include <XSecStat.h>

List of all members.

Public Member Functions

Standard constructors, destructor and assignment operator.
 XSecStat ()
 The default constructor.
 XSecStat (CrossSection xsecmax)
 Constructor taking the overestimated cross section, xsecmax, as argument.
XSecStatoperator= (const XSecStat &x)
 The assignment operator.
XSecStatoperator+= (const XSecStat &x)
 Add the contents of another XSecStat.
void reset ()
 Reset the statistics.
Simple access functions
void accept ()
 An event of the corresponding class has been accepted.
void select (double weight)
 An event of the corresponding class has been attempted.
void reject (double weight=1.0)
 Reject the event which was last accepted with accept() or selected with select(double).
CrossSection xSec () const
 The current estimate of the cross section for the corresponding class of events.
CrossSection xSecErr () const
 The current estimate of the error in the cross section for the corresponding class of events.
CrossSection maxXSec () const
 The overestimated cross section.
double sumWeights () const
 The sum of the weights so far.
double sumWeights2 () const
 The sum of the squared weights so far.
long attempts () const
 Number of attempts so far.
long accepted () const
 Number of attempts so far.
void maxXSec (CrossSection x)
 Set the overestimated cross section.
I/O functions
void output (PersistentOStream &os) const
 Output to a persistent stream.
void input (PersistentIStream &is)
 Input from a persistent stream.

Private Attributes

CrossSection theMaxXSec
 The overestimated cross section.
long theAttempts
 Number of attempts so far.
long theAccepted
 Number of accepted events so far.
double theSumWeights
 The sum of the weights so far.
double theSumWeights2
 The sum of the squared weights so far.


Detailed Description

XSecStat is a concrete helper class used to collect statistics about the cross section for a specific process or group of processes.

It contains an overestimated cross section and information about the number of times the process has been used to generate an event and how many times this event has been accepted.

An object of this class must initially be given an overestimated cross section in the constructor or with the maxXSec(CrossSection) function. Each time the corresponding process is selected (according to maxXSec()), the select(double) function should be called giving the weight with which the event will be accepted as argument. If the event is then accepted, the accept() function should be called. If an event is later vetoed, the reject() function should be called.

Definition at line 36 of file XSecStat.h.


Member Function Documentation

void ThePEG::XSecStat::accept (  )  [inline]

An event of the corresponding class has been accepted.

The select() method must have been called before.

Definition at line 100 of file XSecStat.h.

References theAccepted.

Referenced by ThePEG::StandardXComb::accept(), and ThePEG::LesHouchesReader::accept().

void ThePEG::XSecStat::select ( double  weight  )  [inline]

An event of the corresponding class has been attempted.

It will subsequently be accepted with the given weight.

Definition at line 106 of file XSecStat.h.

References theAttempts, theSumWeights, and theSumWeights2.

Referenced by ThePEG::StandardXComb::select(), and ThePEG::LesHouchesReader::select().

void ThePEG::XSecStat::reject ( double  weight = 1.0  )  [inline]

Reject the event which was last accepted with accept() or selected with select(double).

The weight should be set to the value, $w$, used in the previous call to select(double), except if the event has been accepted with the probability $w$, in which case weight should be set to $sign(1, w)$.

Definition at line 120 of file XSecStat.h.

References theAccepted, theSumWeights, and theSumWeights2.

Referenced by ThePEG::StandardXComb::reject(), and ThePEG::LesHouchesReader::reject().

CrossSection ThePEG::XSecStat::xSec (  )  const [inline]

The current estimate of the cross section for the corresponding class of events.

If no events have been generated, maxXSec() will be returned.

Definition at line 131 of file XSecStat.h.

References attempts(), maxXSec(), and sumWeights().

CrossSection ThePEG::XSecStat::xSecErr (  )  const [inline]

The current estimate of the error in the cross section for the corresponding class of events.

If no events have been generated, maxXSec() will be returned.

Definition at line 141 of file XSecStat.h.

References attempts(), maxXSec(), and sumWeights2().


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

Generated on Thu Apr 29 12:43:25 2010 for ThePEG by  doxygen 1.5.5