1 | <chapter name="Main-Program and Related Settings"> |
---|
2 | |
---|
3 | <h2>Main-Program and Related 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". For experimental collaborations |
---|
11 | this is actually the most common way to run a program like PYTHIA. |
---|
12 | The commands in such a file may be of two types<br/> |
---|
13 | (a) instructions directly to <code>Pythia</code>, like which |
---|
14 | processes to generate, and<br/> |
---|
15 | (b) instructions to the main program for what it should do, |
---|
16 | like how many events to generate, and how many events should |
---|
17 | be listed.<br/> |
---|
18 | In principle these two kinds could be kept completely separate. |
---|
19 | However, to make life simpler, a number of useful main-program |
---|
20 | settings are defined on this page, so that they are recognized by |
---|
21 | the <code>Settings</code> machinery. They can thus be put among |
---|
22 | the other cards without distinction. It is up to you to decide which |
---|
23 | ones, if any, you actually want to use when you write your main program. |
---|
24 | |
---|
25 | <p/> |
---|
26 | To further reduce the necessary amount of main-program code, some of |
---|
27 | the tasks that you can steer from your main program can also be done |
---|
28 | internally. This in particular relates to some information printing. |
---|
29 | To give an example, the <code>Main:numberToList</code> mode can be |
---|
30 | used by you in your main program to decide to list a few of the |
---|
31 | generated events, whereas <code>Next:numberListEvent</code> is used |
---|
32 | internally in a <code>pythia.next()</code> call to do such a listing |
---|
33 | automatically. Ultimately, in both cases, a |
---|
34 | <code>pythia.event.list()</code> call is the one that generates |
---|
35 | the listing, explicitly in the main program in the former case, |
---|
36 | implicitly called from <code>pythia.next()</code> in the latter. |
---|
37 | |
---|
38 | <p/> |
---|
39 | The settings names on this page thus fall into four main groups |
---|
40 | <ul> |
---|
41 | <li><code>Init:...</code> denote actions that automatically may be |
---|
42 | taken during the <code>pythia.init()</code> call.</li> |
---|
43 | <li><code>Next:...</code> denote actions that automatically may be |
---|
44 | taken during the <code>pythia.next()</code> call.</li> |
---|
45 | <li><code>Stat:...</code> denote actions that automatically may be |
---|
46 | taken during the <code>pythia.stat()</code> call.</li> |
---|
47 | <li><code>Main:...</code> denote actions that you yourself |
---|
48 | have the freedom to make use of in your main program.</li> |
---|
49 | </ul> |
---|
50 | The use of several of the <code>Main:...</code> options is deprecated |
---|
51 | in favour of the other possibilities. |
---|
52 | |
---|
53 | <p/> |
---|
54 | The <code>Main:...</code> options works like this. Once you have used |
---|
55 | the <code>pythia.readFile(fileName)</code> method to read in the cards |
---|
56 | file, where the values have been set, you can interrogate the |
---|
57 | <code>Settings</code> database to make the values available in your |
---|
58 | main program. A slight complication is that you need to use a different |
---|
59 | <code>Settings</code> method for each of the four possible return types |
---|
60 | that you want to extract. To save some typing the same method names are |
---|
61 | found directly in the <code>Pythia</code> class, and just send on to the |
---|
62 | <code>Settings</code> ones to do the job, e.g. |
---|
63 | <pre> |
---|
64 | bool showCS = pythia.flag("Main:showChangedSettings"); |
---|
65 | int nEvent = pythia.mode("Main:numberOfEvents"); |
---|
66 | double spare1 = pythia.parm("Main:spareParm1"); |
---|
67 | string file = pythia.word("Main:allSettingsFile"); |
---|
68 | </pre> |
---|
69 | |
---|
70 | <h3>Main-program settings</h3> |
---|
71 | |
---|
72 | The settings in this section <i>must</i> be under the control of the |
---|
73 | user, i.e. there are no internal equivalents. |
---|
74 | |
---|
75 | <modeopen name="Main:numberOfEvents" default="1000" min="0"> |
---|
76 | The number of events to be generated. |
---|
77 | </modeopen> |
---|
78 | |
---|
79 | <modeopen name="Main:timesAllowErrors" default="10" min = "0"> |
---|
80 | Allow this many times that <code>pythia.next()</code> returns false, |
---|
81 | i.e. that an event is flawed, before aborting the run. |
---|
82 | </modeopen> |
---|
83 | |
---|
84 | <h3>Initialization settings</h3> |
---|
85 | |
---|
86 | <flag name="Init:showProcesses" default="on"> |
---|
87 | Print a list of all processes that will be simulated, with |
---|
88 | their estimated cross section maxima, as used for the |
---|
89 | subsequent Monte Carlo selection. Also print corresponding |
---|
90 | Les Houches initialization data, where relevant. |
---|
91 | </flag> |
---|
92 | |
---|
93 | <flag name="Init:showMultipartonInteractions" default="on"> |
---|
94 | Print initialization information for the multiparton interactions |
---|
95 | machinery. |
---|
96 | </flag> |
---|
97 | |
---|
98 | <flag name="Init:showChangedSettings" default="on"> |
---|
99 | Print a list of the changed flag/mode/parameter/word settings. |
---|
100 | </flag> |
---|
101 | |
---|
102 | <flag name="Init:showAllSettings" default="off"> |
---|
103 | Print a list of all flag/mode/parameter/word settings. |
---|
104 | Warning: this will be a long list. |
---|
105 | </flag> |
---|
106 | |
---|
107 | <flag name="Init:showChangedParticleData" default="on"> |
---|
108 | Print a list of particle and decay data for those particles |
---|
109 | that were changed (one way or another). |
---|
110 | </flag> |
---|
111 | |
---|
112 | <flag name="Init:showChangedResonanceData" default="off"> |
---|
113 | In the previous listing also include the resonances that are |
---|
114 | initialized at the beginning of a run and thus get new particle |
---|
115 | data, even if these may well agree with the default ones. |
---|
116 | Warning: this will be a rather long list. |
---|
117 | </flag> |
---|
118 | |
---|
119 | <flag name="Init:showAllParticleData" default="off"> |
---|
120 | Print a list of all particle and decay data. |
---|
121 | Warning: this will be a long list. |
---|
122 | </flag> |
---|
123 | |
---|
124 | <modeopen name="Init:showOneParticleData" default="0" min="0"> |
---|
125 | Print particle and decay data for the particle with this particular |
---|
126 | identity code. Default means that no particle is printed. |
---|
127 | </modeopen> |
---|
128 | |
---|
129 | <flag name="Main:showChangedSettings" default="on"> |
---|
130 | Deprecated. Print a list of the changed flag/mode/parameter/word settings. |
---|
131 | </flag> |
---|
132 | |
---|
133 | <flag name="Main:showAllSettings" default="off"> |
---|
134 | Deprecated. Print a list of all flag/mode/parameter/word settings. |
---|
135 | Warning: this will be a long list. |
---|
136 | </flag> |
---|
137 | |
---|
138 | <flag name="Main:showChangedParticleData" default="off"> |
---|
139 | Deprecated. Print a list of particle and decay data for those particles |
---|
140 | that were changed (one way or another). |
---|
141 | </flag> |
---|
142 | |
---|
143 | <flag name="Main:showChangedResonanceData" default="off"> |
---|
144 | Deprecated. In the previous listing also include the resonances that are |
---|
145 | initialized at the beginning of a run and thus get new particle |
---|
146 | data, even if these may well agree with the default ones. |
---|
147 | Warning: this will be a rather long list. |
---|
148 | </flag> |
---|
149 | |
---|
150 | <flag name="Main:showAllParticleData" default="off"> |
---|
151 | Deprecated. Print a list of all particle and decay data. |
---|
152 | Warning: this will be a long list. |
---|
153 | </flag> |
---|
154 | |
---|
155 | <modeopen name="Main:showOneParticleData" default="0" min="0"> |
---|
156 | Deprecated. Print particle and decay data for the particle with this |
---|
157 | particular identity code. Default means that no particle is printed. |
---|
158 | </modeopen> |
---|
159 | |
---|
160 | <flag name="Main:writeChangedSettings" default="off"> |
---|
161 | Write a file with the changed flag/mode/parameter/word settings, in |
---|
162 | a format appropriate to be read in at the beginning of a new |
---|
163 | run, using the <code>pythia.readFile(fileName)</code> method. |
---|
164 | </flag> |
---|
165 | |
---|
166 | <word name="Main:changedSettingsFile" default="currentSettings.cmnd"> |
---|
167 | The name of the file to which the changed flag/mode/parameter/word |
---|
168 | settings are written if <code>Main:writeChangedSettings</code> |
---|
169 | is on. |
---|
170 | </word> |
---|
171 | |
---|
172 | <flag name="Main:writeAllSettings" default="off"> |
---|
173 | Write a file with all flag/mode/parameter/word settings, in |
---|
174 | a format appropriate to be read in at the beginning of a new |
---|
175 | run, using the <code>pythia.readFile(fileName)</code> method. |
---|
176 | </flag> |
---|
177 | |
---|
178 | <word name="Main:allSettingsFile" default="allSettings.cmnd"> |
---|
179 | The name of the file to which a flag/mode/parameter/word |
---|
180 | settings are written if <code>Main:writeAllSettings</code> |
---|
181 | is on. |
---|
182 | </word> |
---|
183 | |
---|
184 | <h3>Event-generation settings</h3> |
---|
185 | |
---|
186 | <modeopen name="Next:numberCount" default="1000" min="0"> |
---|
187 | Print a line telling how many events have been generated so far, |
---|
188 | once every <code>numberCount</code> events. If set zero then no |
---|
189 | lines are ever printed. |
---|
190 | |
---|
191 | <modeopen name="Next:numberShowLHA" default="1" min="0"> |
---|
192 | The number of events to list the Les Houches input information for, |
---|
193 | where relevant. |
---|
194 | </modeopen> |
---|
195 | |
---|
196 | <modeopen name="Next:numberShowInfo" default="1" min="0"> |
---|
197 | The number of events to list the <code>Info</code> information for, |
---|
198 | where relevant. |
---|
199 | </modeopen> |
---|
200 | |
---|
201 | <modeopen name="Next:numberShowProcess" default="1" min="0"> |
---|
202 | The number of events to list the <code>process</code> record for, |
---|
203 | where relevant. |
---|
204 | </modeopen> |
---|
205 | |
---|
206 | <modeopen name="Next:numberShowEvent" default="1" min="0"> |
---|
207 | The number of events to list the <code>event</code> record for, |
---|
208 | where relevant. |
---|
209 | </modeopen> |
---|
210 | |
---|
211 | <flag name="Next:showScaleAndVertex" default="off"> |
---|
212 | In addition to the normal information in the listing of the |
---|
213 | <code>process</code> and <code>event</code> records, a second line |
---|
214 | per particle provides information on the production scale, |
---|
215 | particle polarization and production vertex. |
---|
216 | </flag> |
---|
217 | |
---|
218 | <flag name="Next:showMothersAndDaughters" default="off"> |
---|
219 | In addition to the normal information in the listing of the |
---|
220 | <code>process</code> and <code>event</code> records, further lines |
---|
221 | list all the mothers and daughters of each particle. |
---|
222 | </flag> |
---|
223 | |
---|
224 | <modeopen name="Main:numberToList" default="2" min="0"> |
---|
225 | Deprecated. The number of events to list. |
---|
226 | </modeopen> |
---|
227 | |
---|
228 | <modeopen name="Main:timesToShow" default="50" min="0"> |
---|
229 | Deprecated. Print the number of events generated so far, this many times, |
---|
230 | i.e. once every <code>numberOfEvents/numberToShow</code> events. |
---|
231 | </modeopen> |
---|
232 | |
---|
233 | <h3>Statistics</h3> |
---|
234 | |
---|
235 | <flag name="Stat:showProcessLevel" default="on"> |
---|
236 | Print the available statistics on number of generated events and |
---|
237 | cross sections, where relevant. |
---|
238 | </flag> |
---|
239 | |
---|
240 | <flag name="Stat:showPartonLevel" default="off"> |
---|
241 | Print the available statistics on number and types of multiparton |
---|
242 | interactions, where relevant. |
---|
243 | </flag> |
---|
244 | |
---|
245 | <flag name="Stat:showErrors" default="on"> |
---|
246 | Print the available statistics on number and types of |
---|
247 | aborts, errors and warnings. |
---|
248 | </flag> |
---|
249 | |
---|
250 | <flag name="Stat:reset" default="off"> |
---|
251 | Reset the statistics of the above three kinds. The default is that |
---|
252 | all stored statistics information is unaffected by the |
---|
253 | <code>pythia.stat()</code> call. Counters are automatically reset |
---|
254 | in each new <code>pythia.init()</code> call, however, so the only time |
---|
255 | the reset option makes a difference is if <code>stat()</code> |
---|
256 | is called several times in a (sub)run. |
---|
257 | </flag> |
---|
258 | |
---|
259 | <flag name="Main:showAllStatistics" default="off"> |
---|
260 | Print all available statistics or only the minimal set at the end |
---|
261 | of the run. |
---|
262 | </flag> |
---|
263 | |
---|
264 | <h3>Subruns</h3> |
---|
265 | |
---|
266 | You can use <aloc href="ProgramFlow">subruns</aloc> to carry out |
---|
267 | several tasks in the same run. In that case you will need repeated |
---|
268 | instances of the first setting below in your command file, and could |
---|
269 | additionally use the second and third as well. |
---|
270 | |
---|
271 | <modeopen name="Main:subrun" default="-999", min="0"> |
---|
272 | The number of the current subrun, a non-negative integer, put as |
---|
273 | first line in a section of lines to be read for this particular subrun. |
---|
274 | </modeopen> |
---|
275 | |
---|
276 | <flag name="Main:LHEFskipInit" default="off"> |
---|
277 | If you read several Les Houches Event Files that you want to see |
---|
278 | considered as one single combined event sample you can set this flag |
---|
279 | <code>on</code> after the first subrun to skip (most of) the |
---|
280 | (re-)initialization step. |
---|
281 | </flag> |
---|
282 | |
---|
283 | <modeopen name="Main:numberOfSubruns" default="0", min = "0"> |
---|
284 | The number of subruns you intend to use in your current run. |
---|
285 | Unlike the two settings above, <code>Pythia</code> itself will not |
---|
286 | intepret this number, but you could e.g. have a loop in your main |
---|
287 | program to loop over subruns from 0 through |
---|
288 | <code>numberOfSubruns - 1</code>. |
---|
289 | </flag> |
---|
290 | |
---|
291 | <h3>Spares</h3> |
---|
292 | |
---|
293 | For currently unforeseen purposes, a few dummy settings are made |
---|
294 | available here. The user can set the desired value in a "cards file" |
---|
295 | and then use that value in the main program as desired. |
---|
296 | |
---|
297 | <flag name="Main:spareFlag1" default="off"> |
---|
298 | </flag> |
---|
299 | |
---|
300 | <flag name="Main:spareFlag2" default="off"> |
---|
301 | </flag> |
---|
302 | |
---|
303 | <flag name="Main:spareFlag3" default="off"> |
---|
304 | </flag> |
---|
305 | |
---|
306 | <modeopen name="Main:spareMode1" default="0"> |
---|
307 | </modeopen> |
---|
308 | |
---|
309 | <modeopen name="Main:spareMode2" default="0"> |
---|
310 | </modeopen> |
---|
311 | |
---|
312 | <modeopen name="Main:spareMode3" default="0"> |
---|
313 | </modeopen> |
---|
314 | |
---|
315 | <parm name="Main:spareParm1" default="0."> |
---|
316 | </parm> |
---|
317 | |
---|
318 | <parm name="Main:spareParm2" default="0."> |
---|
319 | </parm> |
---|
320 | |
---|
321 | <parm name="Main:spareParm3" default="0."> |
---|
322 | </parm> |
---|
323 | |
---|
324 | <word name="Main:spareWord1" default="void"> |
---|
325 | </word> |
---|
326 | |
---|
327 | <word name="Main:spareWord2" default="void"> |
---|
328 | </word> |
---|
329 | |
---|
330 | <word name="Main:spareWord3" default="void"> |
---|
331 | </word> |
---|
332 | |
---|
333 | </chapter> |
---|
334 | |
---|
335 | <!-- Copyright (C) 2012 Torbjorn Sjostrand --> |
---|