]>
Commit | Line | Data |
---|---|---|
9419eeef | 1 | <chapter name="Main-Program Settings"> |
2 | ||
3 | <h2>Main-Program Settings</h2> | |
4 | ||
5 | <h3>Introduction</h3> | |
6 | ||
7 | The main program is up to the user to write. However, | |
8 | <aloc href="SampleMainPrograms">sample main programs</aloc> | |
9 | are provided. In one such class of programs, key settings of the run | |
10 | are read in from a "cards file". These commands may be of two types<br/> | |
11 | (a) instructions directly to <code>Pythia</code>, like which | |
12 | processes to generate, and<br/> | |
13 | (b) instructions to the main program for what it should do, | |
14 | like how many events to generate, i.e. how many times | |
15 | <code>pythia.next()</code> should be called.<br/> | |
16 | In principle these two kinds could be kept completely separate. | |
17 | However, to make life simpler, a number of useful main-program | |
18 | settings are defined on this page, so that they are recognized by | |
19 | the <code>Settings</code> machinery. They can thus be put among | |
20 | the other cards without distinction. It is up to you to decide which | |
21 | ones, if any, you actually want to use when you write your main program. | |
22 | For convenience, some in the second section below can also be interpreted | |
23 | directly by <code>Pythia</code>, while the subsequent ones really have | |
24 | to be used in your main program. | |
25 | ||
26 | <p/> | |
27 | Once you have used the <code>pythia.readFile(fileName)</code> method to | |
28 | read in the cards file (alternatively with an <code>istream</code> instead | |
29 | of a <code>fileName</code>), you can interrogate the <code>Settings</code> | |
30 | database to make the values available in your main program. A slight | |
31 | complication is that you need to use a different <code>Settings</code> | |
32 | method for each of the four possible return types that you want to | |
33 | extract. To save some typing the same method names are found directly | |
34 | in the <code>Pythia</code> class, and just send on to the | |
35 | <code>Settings</code> ones to do the job, e.g. | |
36 | <pre> | |
37 | bool showCS = pythia.flag("Main:showChangedSettings"); | |
38 | int nEvent = pythia.mode("Main:numberOfEvents"); | |
39 | double spare1 = pythia.parm("Main:spareParm1"); | |
40 | string file = pythia.word("Main:allSettingsFile"); | |
41 | </pre> | |
42 | ||
43 | <h3>Run settings</h3> | |
44 | ||
45 | Here settings related to how many events to generate and whether | |
46 | to print some information on data used in run. These variables | |
47 | can be set in an input "cards" file, and thereafter read out an used | |
48 | in the user-written main program. Usage is purely optional, but may help | |
49 | you reduce the need to recompile your main program. | |
50 | ||
51 | <modeopen name="Main:numberOfEvents" default="1000" min="0"> | |
52 | The number of events to be generated. | |
53 | </modeopen> | |
54 | ||
55 | <modeopen name="Main:numberToList" default="2" min="0"> | |
56 | The number of events to list. | |
57 | </modeopen> | |
58 | ||
59 | <modeopen name="Main:timesToShow" default="50" min="0"> | |
60 | Print the number of events generated so far, this many times, | |
61 | i.e. once every <code>numberOfEvents/numberToShow</code> events. | |
62 | </modeopen> | |
63 | ||
64 | <modeopen name="Main:timesAllowErrors" default="10" min = "0"> | |
65 | Allow this many times that <code>pythia.next()</code> returns false, | |
66 | i.e. that an event is flawed, before aborting the run. | |
67 | </modeopen> | |
68 | ||
69 | <flag name="Main:showChangedSettings" default="on"> | |
70 | Print a list of the changed flag/mode/parameter/word settings. | |
71 | </flag> | |
72 | ||
73 | <flag name="Main:showAllSettings" default="off"> | |
74 | Print a list of all flag/mode/parameter/word settings. | |
75 | Warning: this will be a long list. | |
76 | </flag> | |
77 | ||
78 | <modeopen name="Main:showOneParticleData" default="0" min="0"> | |
79 | Print particle and decay data for the particle with this particular | |
80 | identity code. Default means that no particle is printed. | |
81 | </flag> | |
82 | ||
83 | <flag name="Main:showChangedParticleData" default="off"> | |
84 | Print a list of particle and decay data for those particles | |
85 | that were changed (one way or another). | |
86 | </flag> | |
87 | ||
88 | <flag name="Main:showChangedResonanceData" default="off"> | |
89 | In the previous listing also include the resonances that are | |
90 | initialized at the beginning of a run and thus get new particle | |
91 | data, even if these may well agree with the default ones. | |
92 | Warning: this will be a rather long list. | |
93 | </flag> | |
94 | ||
95 | <flag name="Main:showAllParticleData" default="off"> | |
96 | Print a list of all particle and decay data. | |
97 | Warning: this will be a long list. | |
98 | </flag> | |
99 | ||
100 | <flag name="Main:writeChangedSettings" default="off"> | |
101 | Write a file with the changed flag/mode/parameter/word settings, in | |
102 | a format appropriate to be read in at the beginning of a new | |
103 | run, using the <code>pythia.readFile(fileName)</code> method. | |
104 | </flag> | |
105 | ||
106 | <word name="Main:changedSettingsFile" default="currentSettings.cmnd"> | |
107 | The name of the file to which the changed flag/mode/parameter/word | |
108 | settings are written if <code>Main:writeChangedSettings</code> | |
109 | is on. | |
110 | </word> | |
111 | ||
112 | <flag name="Main:writeAllSettings" default="off"> | |
113 | Write a file with all flag/mode/parameter/word settings, in | |
114 | a format appropriate to be read in at the beginning of a new | |
115 | run, using the <code>pythia.readFile(fileName)</code> method. | |
116 | </flag> | |
117 | ||
118 | <word name="Main:allSettingsFile" default="allSettings.cmnd"> | |
119 | The name of the file to which a flag/mode/parameter/word | |
120 | settings are written if <code>Main:writeAllSettings</code> | |
121 | is on. | |
122 | </word> | |
123 | ||
124 | <flag name="Main:showAllStatistics" default="off"> | |
125 | Print all available statistics or only the minimal set at the end | |
126 | of the run. | |
127 | </flag> | |
128 | ||
129 | <h3>Subruns</h3> | |
130 | ||
131 | You can use <aloc href="ProgramFlow">subruns</aloc> to carry out | |
132 | several tasks in the same run. In that case you will need repeated | |
133 | instances of the first setting below in your command file, and could | |
134 | additionally use the second and third as well. | |
135 | ||
136 | <modeopen name="Main:subrun" default="-999", min="0"> | |
137 | The number of the current subrun, a non-negative integer, put as | |
138 | first line in a section of lines to be read for this particular subrun. | |
139 | </modeopen> | |
140 | ||
141 | <flag name="Main:LHEFskipInit" default="off"> | |
142 | If you read several Les Houches Event Files that you want to see | |
143 | considered as one single combined event sample you can set this flag | |
144 | <code>on</code> after the first subrun to skip (most of) the | |
145 | (re-)initialization step. | |
146 | </flag> | |
147 | ||
148 | <modeopen name="Main:numberOfSubruns" default="0", min = "0"> | |
149 | The number of subruns you intend to use in your current run. | |
150 | Unlike the two settings above, <code>Pythia</code> itself will not | |
151 | intepret this number, but you could e.g. have a loop in your main | |
152 | program to loop over subruns from 0 through | |
153 | <code>numberOfSubruns - 1</code>. | |
154 | </flag> | |
155 | ||
156 | <h3>Spares</h3> | |
157 | ||
158 | For currently unforeseen purposes, a few dummy settings are made | |
159 | available here. The user can set the desired value in a "cards file" | |
160 | and then use that value in the main program as desired. | |
161 | ||
162 | <flag name="Main:spareFlag1" default="off"> | |
163 | </flag> | |
164 | ||
165 | <flag name="Main:spareFlag2" default="off"> | |
166 | </flag> | |
167 | ||
168 | <flag name="Main:spareFlag3" default="off"> | |
169 | </flag> | |
170 | ||
171 | <modeopen name="Main:spareMode1" default="0"> | |
172 | </modeopen> | |
173 | ||
174 | <modeopen name="Main:spareMode2" default="0"> | |
175 | </modeopen> | |
176 | ||
177 | <modeopen name="Main:spareMode3" default="0"> | |
178 | </modeopen> | |
179 | ||
180 | <parm name="Main:spareParm1" default="0."> | |
181 | </parm> | |
182 | ||
183 | <parm name="Main:spareParm2" default="0."> | |
184 | </parm> | |
185 | ||
186 | <parm name="Main:spareParm3" default="0."> | |
187 | </parm> | |
188 | ||
189 | <word name="Main:spareWord1" default="void"> | |
190 | </word> | |
191 | ||
192 | <word name="Main:spareWord2" default="void"> | |
193 | </word> | |
194 | ||
195 | <word name="Main:spareWord3" default="void"> | |
196 | </word> | |
197 | ||
198 | </chapter> | |
199 | ||
200 | <!-- Copyright (C) 2010 Torbjorn Sjostrand --> |