Event Statistics
At the end of the run you will want to write out the final statistics
on number of events generated, the corresponding cross sections and
the number of errors encountered. This is done with
pythia.statistics();
assuming pythia
is an instance of the Pythia
class. The statistics
method in its turn calls on the
methods below.
Cross-section statistics
The ProcessLevel::statistics()
member will loop over the
list of existing processes, and for each write out name, code,
the number of tried and accepted events (in the sense that the
Monte Carlo integration involves an initial upper estimate of the
cross section, that then is compensated by the try-accept/reject
step), the cross section and the estimated error on the latter.
If PYTHIA 6 is used to generate the hard processes, instead the
Fortran PYSTAT
method is called.
Error messages
When Pythia is run, errors may occur, and give rise to warning messages.
These may be of varying severity, as follows:
Abort means things went seriously wrong, and the
initialization or event generation failed. In the former case it is
not possible to generate events at all, in the latter the current
event is flawed and should be skipped. In either case the respective
method, pythia.init(...)
or pythia.next()
,
then also returns the value false
. There are occasions
where an abort may be deliberate, such as when a file of Les Houches
Events is read and the end of the file is reached.
Error normally is less severe. Typically the program will
back up one step and try again. There are cases where this is not possible,
in particular during the initailization and the generation of a hard
process, and then the error may be followed by an abort as a direct
consequence (with two separate messages).
Warning is even less severe. In some cases the program will
try again, with good chances of success, in others no measure at all
need to be taken.
The ErrorMessages
class is rather small. It is handed any
abort, error or warning messages during the event generation phase, and
will store each distinct message, with a counter for how many times it is
issued. Thus it is possible to limit the number of identical messages
issued. The summary table printed by pythia.statistics()
provides a table with all the different messages issued, in
alphabetical order, with the total number of times each was generated.
There is only one mode affecting its operation:
mode name="ErrorMessages:timesToPrint" default="1" min="0"
The number of times each distinct message is printed. Thit is, by
default, each new kind of error/warning is only printed once.