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 Types  
enum  { plainWeights = 0, plainVetoedWeights, reweightedWeights, reweightedVetoedWeights } 
Enumerate the different weight classes.  
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.  
XSecStat &  operator= (const XSecStat &x)=default 
The assignment operator.  
XSecStat &  operator+= (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  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.  
CrossSection  xSec (double att=0) const 
The current estimate of the cross section for the corresponding class of events. More...  
CrossSection  xSecErr (double att=0) const 
The current estimate of the error in the cross section for the corresponding class of events. More...  
CrossSection  xSecNoReweight (double att=0) const 
The current estimate of the cross section for the corresponding class of events, excluding reweighting. More...  
CrossSection  xSecErrNoReweight (double att=0) const 
The current estimate of the error in the cross section for the corresponding class of events, excluding reweighting. More...  
double  attempts () const 
Number of attempts so far.  
double  accepted () const 
Number of accepts so far.  
double  vetoed () const 
Number of vetoes 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.  
double  theAttempts 
Number of attempts so far.  
double  theAccepted 
Number of accepted events so far.  
double  theVetoed 
Number of events vetoed after being accepted.  
array< double, 4 >  theSumWeights 
The sum of the weights so far.  
array< double, 4 >  theSumWeights2 
The sum of the squared weights so far.  
double  theLastWeight 
The last selected weight, ignoring reweighting.  
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.

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.
Referenced by ThePEG::StandardXComb::accept(), and ThePEG::LesHouchesReader::accept().

inline 
Reject the event which was last accepted with accept() or selected with select(double).
The weight should be set to the value, , used in the previous call to select(double), except if the event has been accepted with the probability , in which case weight should be set to .
Definition at line 142 of file XSecStat.h.
References theLastWeight, theSumWeights, theSumWeights2, and theVetoed.
Referenced by ThePEG::StandardXComb::reject(), and ThePEG::LesHouchesReader::reject().

inline 
An event of the corresponding class has been attempted.
It will subsequently be accepted with the given weight.
Definition at line 117 of file XSecStat.h.
References theAttempts, theLastWeight, theSumWeights, and theSumWeights2.
Referenced by ThePEG::StandardXComb::select(), and ThePEG::LesHouchesReader::select().

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 188 of file XSecStat.h.
References attempts(), maxXSec(), and sumWeights().

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 198 of file XSecStat.h.
References attempts(), maxXSec(), sumWeights(), and sumWeights2().

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 222 of file XSecStat.h.
References attempts(), maxXSec(), sumWeights2NoReweight(), and sumWeightsNoReweight().

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 212 of file XSecStat.h.
References attempts(), maxXSec(), and sumWeightsNoReweight().