Main-Program Settings
Introduction
The main program is up to the user to write. However, 
sample main programs 
are provided. In one such class of programs, key settings of the run 
are read in from a "cards file". These commands may be of two types
(a) instructions directly to Pythia, like which 
processes to generate, and
(b) instructions to the main program for what it should do, 
like how many events to generate, i.e. how many times 
pythia.next() should be called.
In principle these two kinds could be kept completely separate. 
However, to make life simpler, a number of useful main-program 
settings are defined on this page, so that they are recognized by 
the Settings machinery. They can thus be put among 
the other cards without distinction. It is up to you to decide which 
ones, if any, you actually want to use when you write your main program.
For convenience, some in the second section below can also be interpreted 
directly by Pythia, while the subsequent ones really have 
to be used in your main program. 
Once you have used the pythia.readFile(fileName) method to
read in the cards file, you can interrogate the Settings
database to make the values available in your main program. A slight
complication is that you need to use a different  Settings
method for each of the four possible return types that you want to 
extract. To save some typing the same method names are found directly 
in the Pythia class, and just send on to the
Settings ones to do the job, e.g.
  bool   showCS = pythia.flag("Main:showChangedSettings");
  int    nEvent = pythia.mode("Main:numberOfEvents");
  double spare1 = pythia.parm("Main:spareParm1");
  string file   = pythia.word("Main:allSettingsFile"); 
Run settings
Here settings related to how many events to generate and whether
to print some information on data used in run. These variables 
can be set in an input "cards" file, and thereafter read out an used 
in the user-written main program. Usage is purely optional, but may help
you reduce the need to recompile your main program. 
mode   Main:numberOfEvents   
 (default = 1000; minimum = 0)
The number of events to be generated.
  
mode   Main:numberToList   
 (default = 2; minimum = 0)
The number of events to list.
  
mode   Main:timesToShow   
 (default = 50; minimum = 0)
Print the number of events generated so far, this many times, 
i.e. once every numberOfEvents/numberToShow events.
  
mode   Main:timesAllowErrors   
 (default = 10)
Allow this many times that pythia.next() returns false, 
i.e. that an event is flawed, before aborting the run.
  
flag   Main:showChangedSettings   
 (default = on)
Print a list of the changed flag/mode/parameter/word settings.
  
flag   Main:showAllSettings   
 (default = off)
Print a list of all flag/mode/parameter/word settings.
Warning: this will be a long list.
  
mode   Main:showOneParticleData   
 (default = 0; minimum = 0)
Print particle and decay data for the particle with this particular 
identity code. Default means that no particle is printed.
  
flag   Main:showChangedParticleData   
 (default = off)
Print a list of particle and decay data for those particles 
that were changed (one way or another).
  
flag   Main:showChangedResonanceData   
 (default = off)
In the previous listing also include the resonances that are 
initialized at the beginning of a run and thus get new particle
data, even if these may well agree with the default ones. 
Warning: this will be a rather long list.
  
flag   Main:showAllParticleData   
 (default = off)
Print a list of all particle and decay data.
Warning: this will be a long list.
  
flag   Main:writeChangedSettings   
 (default = off)
Write a file with the changed flag/mode/parameter/word settings, in
a format appropriate to be read in at the beginning of a new  
run, using the pythia.readFile(fileName) method. 
  
word   Main:changedSettingsFile   
 (default = currentSettings.cmnd)
The name of the file to which the changed flag/mode/parameter/word
settings are written if Main:writeChangedSettings
is on. 
  
flag   Main:writeAllSettings   
 (default = off)
Write a file with all flag/mode/parameter/word settings, in
a format appropriate to be read in at the beginning of a new  
run, using the pythia.readFile(fileName) method. 
  
word   Main:allSettingsFile   
 (default = allSettings.cmnd)
The name of the file to which a flag/mode/parameter/word 
settings are written if Main:writeAllSettings
is on. 
  
flag   Main:showAllStatistics   
 (default = off)
Print all available statistics or only the minimal set at the end 
of the run.
  
Subruns
You can use subruns to carry out
several tasks in the same run. In that case you will need repeated
instances of the first setting below in your command file, and could
additionally use the second and third as well.
mode   Main:subrun   
 (default = -999; minimum = 0)
The number of the current subrun, a non-negative integer, put as
first line in a section of lines to be read for this particular subrun.
  
flag   Main:LHEFskipInit   
 (default = off)
If you read several Les Houches Event Files that you want to see 
considered as one single combined event sample you can set this flag
on after the first subrun to skip (most of) the  
(re-)initialization step.
  
mode   Main:numberOfSubruns   
 (default = 0)
The number of subruns you intend to use in your current run.  
Unlike the two settings above, Pythia itself will not
intepret this number, but you could e.g. have a loop in your main
program to loop over subruns from 0 through 
numberOfSubruns - 1. 
  
Spares
For currently unforeseen purposes, a few dummy settings are made 
available here. The user can set the desired value in a "cards file"
and then use that value in the main program as desired.
flag   Main:spareFlag1   
 (default = off)
  
flag   Main:spareFlag2   
 (default = off)
  
flag   Main:spareFlag3   
 (default = off)
  
mode   Main:spareMode1   
 (default = 0)
  
mode   Main:spareMode2   
 (default = 0)
  
mode   Main:spareMode3   
 (default = 0)
  
parm   Main:spareParm1   
 (default = 0.)
  
parm   Main:spareParm2   
 (default = 0.)
  
parm   Main:spareParm3   
 (default = 0.)
  
word   Main:spareWord1   
 (default = void)
  
word   Main:spareWord2   
 (default = void)
  
word   Main:spareWord3   
 (default = void)