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. More... | |
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. | |
void | select (double weight) |
An event of the corresponding class has been attempted. | |
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). | |
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. | |
CrossSection | xSecErr (double att=0) const |
The current estimate of the error in the cross section for the corresponding class of events. | |
CrossSection | xSecNoReweight (double att=0) const |
The current estimate of the cross section for the corresponding class of events, excluding reweighting. | |
CrossSection | xSecErrNoReweight (double att=0) const |
The current estimate of the error in the cross section for the corresponding class of events, excluding reweighting. | |
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 | |
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. | |
void | output (PersistentOStream &os) const |
Output to a persistent stream. | |
void | input (PersistentIStream &is) |
Input from a persistent stream. | |
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.
anonymous enum |
Enumerate the different weight classes.
Definition at line 43 of file XSecStat.h.
|
inline |
The default constructor.
Definition at line 55 of file XSecStat.h.
|
inlineexplicit |
Constructor taking the overestimated cross section, xsecmax, as argument.
Definition at line 64 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 |
Number of accepts so far.
Definition at line 240 of file XSecStat.h.
References theAccepted, and theVetoed.
Referenced by ThePEG::MadGraphReader::dofinish().
|
inline |
Number of attempts so far.
Definition at line 235 of file XSecStat.h.
References theAttempts.
Referenced by xSec(), xSecErr(), xSecErrNoReweight(), and xSecNoReweight().
|
inline |
The overestimated cross section.
Definition at line 153 of file XSecStat.h.
References theMaxXSec.
Referenced by xSec(), xSecErr(), xSecErrNoReweight(), and xSecNoReweight().
|
inline |
Set the overestimated cross section.
Definition at line 250 of file XSecStat.h.
References theMaxXSec.
Add the contents of another XSecStat.
Definition at line 77 of file XSecStat.h.
References theAccepted, theAttempts, theLastWeight, theSumWeights, theSumWeights2, and theVetoed.
|
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 142 of file XSecStat.h.
References ThePEG::sqr(), theLastWeight, theSumWeights, theSumWeights2, and theVetoed.
Referenced by ThePEG::LesHouchesReader::reject(), and ThePEG::StandardXComb::reject().
|
inline |
Reset the statistics.
Definition at line 92 of file XSecStat.h.
References theAccepted, theAttempts, theLastWeight, theSumWeights, theSumWeights2, and theVetoed.
Referenced by ThePEG::StandardXComb::reset().
|
inline |
Reweight a selected and accepted event.
Definition at line 129 of file XSecStat.h.
References ThePEG::sqr(), theSumWeights, and theSumWeights2.
Referenced by ThePEG::StandardXComb::reweight().
|
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 ThePEG::sqr(), theAttempts, theLastWeight, theSumWeights, and theSumWeights2.
Referenced by ThePEG::StandardXComb::select(), and ThePEG::LesHouchesReader::select().
|
inline |
|
inline |
The sum of the squared weights so far.
Definition at line 165 of file XSecStat.h.
References theSumWeights2.
Referenced by xSecErr().
|
inline |
The sum of the squared weights so far, excluding reweighting.
Definition at line 179 of file XSecStat.h.
References theSumWeights2.
Referenced by xSecErrNoReweight().
|
inline |
The sum of the weights so far, excluding reweighting.
Definition at line 172 of file XSecStat.h.
References theSumWeights.
Referenced by xSecErrNoReweight(), and xSecNoReweight().
|
inline |
|
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(), ThePEG::sqr(), 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(), ThePEG::sqr(), 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().
|
private |
Number of accepted events so far.
Definition at line 283 of file XSecStat.h.
Referenced by accept(), accepted(), operator+=(), and reset().
|
private |
Number of attempts so far.
Definition at line 278 of file XSecStat.h.
Referenced by attempts(), operator+=(), reset(), and select().
|
private |
The last selected weight, ignoring reweighting.
Definition at line 303 of file XSecStat.h.
Referenced by operator+=(), reject(), reset(), and select().
|
private |
The overestimated cross section.
Definition at line 273 of file XSecStat.h.
Referenced by maxXSec().
|
private |
The sum of the weights so far.
Definition at line 293 of file XSecStat.h.
Referenced by operator+=(), reject(), reset(), reweight(), select(), sumWeights(), and sumWeightsNoReweight().
|
private |
The sum of the squared weights so far.
Definition at line 298 of file XSecStat.h.
Referenced by operator+=(), reject(), reset(), reweight(), select(), sumWeights2(), and sumWeights2NoReweight().
|
private |
Number of events vetoed after being accepted.
Definition at line 288 of file XSecStat.h.
Referenced by accepted(), operator+=(), reject(), reset(), and vetoed().