6 #ifndef PYTHIA_PARALLEL_H 7 #define PYTHIA_PARALLEL_H 9 #include "Pythia8/Pythia.h" 10 #include "Pythia8/PythiaStdlib.h" 24 bool printBanner =
true);
31 bool readFile(
string fileName,
bool warn =
true,
32 int subrun = SUBRUNDEFAULT);
33 bool readFile(
string fileName,
int subrun) {
34 return readFile(fileName,
true, subrun); }
35 bool readFile(istream& is = cin,
bool warn =
true,
36 int subrun = SUBRUNDEFAULT);
37 bool readFile(istream& is,
int subrun) {
42 bool init(
function<
bool(
Pythia*)> additionalSetup);
45 void foreach(
function<
void(
Pythia*)> action);
54 vector<long>
run(
long nEvents,
function<
void(
Pythia*)> callback);
55 vector<long>
run(
function<
void(
Pythia*)> callback) {
56 return run(
settings.mode(
"Main:numberOfEvents"), callback); }
62 double sigmaGen()
const {
return sigmaGenSave; }
82 double weightSumSave, sigmaGenSave;
91 vector<unique_ptr<Pythia> > pythiaObjects;
Pythia pythiaHelper
Pythia object used for loading data.
Definition: PythiaParallel.h:59
Class for doing Pythia runs in parallel.
Definition: PythiaParallel.h:18
void stat()
Write final statistics, combining errors from each Pythia instance.
Definition: PythiaParallel.h:51
PythiaParallel(string xmlDir="../share/Pythia8/xmldoc", bool printBanner=true)
Constructor.
Definition: PythiaParallel.cc:21
double weightSum() const
Sum of weights from all Pythia instances.
Definition: PythiaParallel.h:65
Settings & settings
The settings that will be used to initialize Pythia instances.
Definition: PythiaParallel.h:68
vector< long > run(long nEvents, function< void(Pythia *)> callback)
Generate events in parallel.
bool init()
Initialize all Pythia objects.
Definition: PythiaParallel.cc:52
void stat()
Main routine to provide final statistics on generation.
Definition: Pythia.cc:1748
void foreachAsync(function< void(Pythia *)> action)
Perform the specified action for each instance in parallel.
Definition: PythiaParallel.cc:254
double sigmaGen() const
Weighted average of the generated cross section for each Pythia instance.
Definition: PythiaParallel.h:62
bool readString(string setting, bool warn=true)
Read in one update for a setting or particle data from a single line.
Definition: PythiaParallel.h:27
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
The Pythia class contains the top-level routines to generate an event.
Definition: Pythia.h:71
bool readFile(string fileName, bool warn=true, int subrun=SUBRUNDEFAULT)
Read in updates for settings or particle data from user-defined file.
Definition: PythiaParallel.cc:30
bool readString(string, bool warn=true, int subrun=SUBRUNDEFAULT)
Read in one update for a setting or particle data from a single line.
Definition: Pythia.cc:365
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
ParticleData & particleData
The particle database that will be used to initialize Pythia instances.
Definition: PythiaParallel.h:71
Definition: Settings.h:195