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 void stat(
bool combine =
true);
57 vector<long>
run(
long nEvents,
function<
void(
Pythia*)> callback);
58 vector<long>
run(
function<
void(
Pythia*)> callback) {
59 return run(
settings.mode(
"Main:numberOfEvents"), callback); }
65 double sigmaGen()
const {
return sigmaGenSave; }
85 double weightSumSave, sigmaGenSave;
94 vector<unique_ptr<Pythia> > pythiaObjects;
bool readString(string line, bool warn=true, int subrun=SUBRUNDEFAULT)
Read in one update for a setting or particle data from a single line.
Definition: Pythia.h:99
Pythia pythiaHelper
Pythia object used for loading data.
Definition: PythiaParallel.h:62
Class for doing Pythia runs in parallel.
Definition: PythiaParallel.h:18
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:68
Settings & settings
The settings that will be used to initialize Pythia instances.
Definition: PythiaParallel.h:71
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(bool combine=true)
Definition: PythiaParallel.cc:278
void foreachAsync(function< void(Pythia *)> action)
Perform the specified action for each instance in parallel.
Definition: PythiaParallel.cc:255
double sigmaGen() const
Weighted average of the generated cross section for each Pythia instance.
Definition: PythiaParallel.h:65
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:72
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
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:423
ParticleData & particleData
The particle database that will be used to initialize Pythia instances.
Definition: PythiaParallel.h:74
Definition: Settings.h:196