ThePEG  1.8.0
Private Attributes | List of all members
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>

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. More...
 
void select (double weight)
 An event of the corresponding class has been attempted. More...
 
void reweight (double oldWeight, double newWeight)
 Reweight a selected and accepted event.
 
void reject (double weight=1.0)
 Reject the event which was last accepted with accept() or selected with select(double). More...
 
CrossSection xSec () const
 The current estimate of the cross section for the corresponding class of events. More...
 
CrossSection xSecErr () const
 The current estimate of the error in the cross section for the corresponding class of events. More...
 
CrossSection xSecNoReweight () const
 The current estimate of the cross section for the corresponding class of events, excluding reweighting. More...
 
CrossSection xSecErrNoReweight () const
 The current estimate of the error in the cross section for the corresponding class of events, excluding reweighting. More...
 
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.
 
double sumWeightsNoReweight () const
 The sum of the weights so far, excluding reweighting.
 
double sumWeights2NoReweight () const
 The sum of the squared weights so far, excluding reweighting.
 
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.
 
long theVetoed
 Number of events vetoed after being accepted.
 
vector< double > theSumWeights
 The sum of the weights so far.
 
vector< double > theSumWeights2
 The sum of the squared weights so far.
 
double theLastWeight
 The last selected weight, ignoring reweighting.
 

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

◆ accept()

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 109 of file XSecStat.h.

References theAccepted, theSumWeights, and theSumWeights2.

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

◆ reject()

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 144 of file XSecStat.h.

References theLastWeight, theSumWeights, theSumWeights2, and theVetoed.

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

◆ select()

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 119 of file XSecStat.h.

References theAttempts, theLastWeight, theSumWeights, and theSumWeights2.

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

◆ xSec()

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 159 of file XSecStat.h.

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

◆ xSecErr()

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 168 of file XSecStat.h.

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

◆ xSecErrNoReweight()

CrossSection ThePEG::XSecStat::xSecErrNoReweight ( ) const
inline

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

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

Definition at line 187 of file XSecStat.h.

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

◆ xSecNoReweight()

CrossSection ThePEG::XSecStat::xSecNoReweight ( ) const
inline

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

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

Definition at line 178 of file XSecStat.h.

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


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