3 <title>Main-Program Settings</title>
4 <link rel="stylesheet" type="text/css" href="pythia.css"/>
5 <link rel="shortcut icon" href="pythia32.gif"/>
9 <script language=javascript type=text/javascript>
10 function stopRKey(evt) {
11 var evt = (evt) ? evt : ((event) ? event : null);
12 var node = (evt.target) ? evt.target :((evt.srcElement) ? evt.srcElement : null);
13 if ((evt.keyCode == 13) && (node.type=="text"))
17 document.onkeypress = stopRKey;
20 if($_POST['saved'] == 1) {
21 if($_POST['filepath'] != "files/") {
22 echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; }
24 echo "<font color='red'>NO FILE SELECTED YET.. PLEASE DO SO </font><a href='SaveSettings.php'>HERE</a><br/><br/>"; }
28 <form method='post' action='MainProgramSettings.php'>
30 <h2>Main-Program Settings</h2>
34 The main program is up to the user to write. However,
35 <?php $filepath = $_GET["filepath"];
36 echo "<a href='SampleMainPrograms.php?filepath=".$filepath."' target='page'>";?>sample main programs</a>
37 are provided. In one such class of programs, key settings of the run
38 are read in from a "cards file". These commands may be of two types<br/>
39 (a) instructions directly to <code>Pythia</code>, like which
40 processes to generate, and<br/>
41 (b) instructions to the main program for what it should do,
42 like how many events to generate, i.e. how many times
43 <code>pythia.next()</code> should be called.<br/>
44 In principle these two kinds could be kept completely separate.
45 However, to make life simpler, a number of useful main-program
46 settings are defined on this page, so that they are recognized by
47 the <code>Settings</code> machinery. They can thus be put among
48 the other cards without distinction. It is up to you to decide which
49 ones, if any, you actually want to use when you write your main program.
50 For convenience, some in the second section below can also be interpreted
51 directly by <code>Pythia</code>, while the subsequent ones really have
52 to be used in your main program.
55 Once you have used the <code>pythia.readFile(fileName)</code> method to
56 read in the cards file (alternatively with an <code>istream</code> instead
57 of a <code>fileName</code>), you can interrogate the <code>Settings</code>
58 database to make the values available in your main program. A slight
59 complication is that you need to use a different <code>Settings</code>
60 method for each of the four possible return types that you want to
61 extract. To save some typing the same method names are found directly
62 in the <code>Pythia</code> class, and just send on to the
63 <code>Settings</code> ones to do the job, e.g.
65 bool showCS = pythia.flag("Main:showChangedSettings");
66 int nEvent = pythia.mode("Main:numberOfEvents");
67 double spare1 = pythia.parm("Main:spareParm1");
68 string file = pythia.word("Main:allSettingsFile");
73 Here settings related to how many events to generate and whether
74 to print some information on data used in run. These variables
75 can be set in an input "cards" file, and thereafter read out an used
76 in the user-written main program. Usage is purely optional, but may help
77 you reduce the need to recompile your main program.
79 <br/><br/><table><tr><td><strong>Main:numberOfEvents </td><td></td><td> <input type="text" name="1" value="1000" size="20"/> (<code>default = <strong>1000</strong></code>; <code>minimum = 0</code>)</td></tr></table>
80 The number of events to be generated.
83 <br/><br/><table><tr><td><strong>Main:numberToList </td><td></td><td> <input type="text" name="2" value="2" size="20"/> (<code>default = <strong>2</strong></code>; <code>minimum = 0</code>)</td></tr></table>
84 The number of events to list.
87 <br/><br/><table><tr><td><strong>Main:timesToShow </td><td></td><td> <input type="text" name="3" value="50" size="20"/> (<code>default = <strong>50</strong></code>; <code>minimum = 0</code>)</td></tr></table>
88 Print the number of events generated so far, this many times,
89 i.e. once every <code>numberOfEvents/numberToShow</code> events.
92 <br/><br/><table><tr><td><strong>Main:timesAllowErrors </td><td></td><td> <input type="text" name="4" value="10" size="20"/> (<code>default = <strong>10</strong></code>)</td></tr></table>
93 Allow this many times that <code>pythia.next()</code> returns false,
94 i.e. that an event is flawed, before aborting the run.
97 <br/><br/><strong>Main:showChangedSettings</strong> <input type="radio" name="5" value="on" checked="checked"><strong>On</strong>
98 <input type="radio" name="5" value="off"><strong>Off</strong>
99 (<code>default = <strong>on</strong></code>)<br/>
100 Print a list of the changed flag/mode/parameter/word settings.
103 <br/><br/><strong>Main:showAllSettings</strong> <input type="radio" name="6" value="on"><strong>On</strong>
104 <input type="radio" name="6" value="off" checked="checked"><strong>Off</strong>
105 (<code>default = <strong>off</strong></code>)<br/>
106 Print a list of all flag/mode/parameter/word settings.
107 Warning: this will be a long list.
110 <br/><br/><table><tr><td><strong>Main:showOneParticleData </td><td></td><td> <input type="text" name="7" value="0" size="20"/> (<code>default = <strong>0</strong></code>; <code>minimum = 0</code>)</td></tr></table>
111 Print particle and decay data for the particle with this particular
112 identity code. Default means that no particle is printed.
115 <br/><br/><strong>Main:showChangedParticleData</strong> <input type="radio" name="8" value="on"><strong>On</strong>
116 <input type="radio" name="8" value="off" checked="checked"><strong>Off</strong>
117 (<code>default = <strong>off</strong></code>)<br/>
118 Print a list of particle and decay data for those particles
119 that were changed (one way or another).
122 <br/><br/><strong>Main:showChangedResonanceData</strong> <input type="radio" name="9" value="on"><strong>On</strong>
123 <input type="radio" name="9" value="off" checked="checked"><strong>Off</strong>
124 (<code>default = <strong>off</strong></code>)<br/>
125 In the previous listing also include the resonances that are
126 initialized at the beginning of a run and thus get new particle
127 data, even if these may well agree with the default ones.
128 Warning: this will be a rather long list.
131 <br/><br/><strong>Main:showAllParticleData</strong> <input type="radio" name="10" value="on"><strong>On</strong>
132 <input type="radio" name="10" value="off" checked="checked"><strong>Off</strong>
133 (<code>default = <strong>off</strong></code>)<br/>
134 Print a list of all particle and decay data.
135 Warning: this will be a long list.
138 <br/><br/><strong>Main:writeChangedSettings</strong> <input type="radio" name="11" value="on"><strong>On</strong>
139 <input type="radio" name="11" value="off" checked="checked"><strong>Off</strong>
140 (<code>default = <strong>off</strong></code>)<br/>
141 Write a file with the changed flag/mode/parameter/word settings, in
142 a format appropriate to be read in at the beginning of a new
143 run, using the <code>pythia.readFile(fileName)</code> method.
146 <br/><br/><table><tr><td><strong>Main:changedSettingsFile </td><td></td><td> <input type="text" name="12" value="currentSettings.cmnd" size="20"/> (<code>default = <strong>currentSettings.cmnd</strong></code>)</td></tr></table>
147 The name of the file to which the changed flag/mode/parameter/word
148 settings are written if <code>Main:writeChangedSettings</code>
152 <br/><br/><strong>Main:writeAllSettings</strong> <input type="radio" name="13" value="on"><strong>On</strong>
153 <input type="radio" name="13" value="off" checked="checked"><strong>Off</strong>
154 (<code>default = <strong>off</strong></code>)<br/>
155 Write a file with all flag/mode/parameter/word settings, in
156 a format appropriate to be read in at the beginning of a new
157 run, using the <code>pythia.readFile(fileName)</code> method.
160 <br/><br/><table><tr><td><strong>Main:allSettingsFile </td><td></td><td> <input type="text" name="14" value="allSettings.cmnd" size="20"/> (<code>default = <strong>allSettings.cmnd</strong></code>)</td></tr></table>
161 The name of the file to which a flag/mode/parameter/word
162 settings are written if <code>Main:writeAllSettings</code>
166 <br/><br/><strong>Main:showAllStatistics</strong> <input type="radio" name="15" value="on"><strong>On</strong>
167 <input type="radio" name="15" value="off" checked="checked"><strong>Off</strong>
168 (<code>default = <strong>off</strong></code>)<br/>
169 Print all available statistics or only the minimal set at the end
175 You can use <?php $filepath = $_GET["filepath"];
176 echo "<a href='ProgramFlow.php?filepath=".$filepath."' target='page'>";?>subruns</a> to carry out
177 several tasks in the same run. In that case you will need repeated
178 instances of the first setting below in your command file, and could
179 additionally use the second and third as well.
181 <br/><br/><table><tr><td><strong>Main:subrun </td><td></td><td> <input type="text" name="16" value="-999" size="20"/> (<code>default = <strong>-999</strong></code>; <code>minimum = 0</code>)</td></tr></table>
182 The number of the current subrun, a non-negative integer, put as
183 first line in a section of lines to be read for this particular subrun.
186 <br/><br/><strong>Main:LHEFskipInit</strong> <input type="radio" name="17" value="on"><strong>On</strong>
187 <input type="radio" name="17" value="off" checked="checked"><strong>Off</strong>
188 (<code>default = <strong>off</strong></code>)<br/>
189 If you read several Les Houches Event Files that you want to see
190 considered as one single combined event sample you can set this flag
191 <code>on</code> after the first subrun to skip (most of) the
192 (re-)initialization step.
195 <br/><br/><table><tr><td><strong>Main:numberOfSubruns </td><td></td><td> <input type="text" name="18" value="0" size="20"/> (<code>default = <strong>0</strong></code>)</td></tr></table>
196 The number of subruns you intend to use in your current run.
197 Unlike the two settings above, <code>Pythia</code> itself will not
198 intepret this number, but you could e.g. have a loop in your main
199 program to loop over subruns from 0 through
200 <code>numberOfSubruns - 1</code>.
205 For currently unforeseen purposes, a few dummy settings are made
206 available here. The user can set the desired value in a "cards file"
207 and then use that value in the main program as desired.
209 <br/><br/><strong>Main:spareFlag1</strong> <input type="radio" name="19" value="on"><strong>On</strong>
210 <input type="radio" name="19" value="off" checked="checked"><strong>Off</strong>
211 (<code>default = <strong>off</strong></code>)<br/>
214 <br/><br/><strong>Main:spareFlag2</strong> <input type="radio" name="20" value="on"><strong>On</strong>
215 <input type="radio" name="20" value="off" checked="checked"><strong>Off</strong>
216 (<code>default = <strong>off</strong></code>)<br/>
219 <br/><br/><strong>Main:spareFlag3</strong> <input type="radio" name="21" value="on"><strong>On</strong>
220 <input type="radio" name="21" value="off" checked="checked"><strong>Off</strong>
221 (<code>default = <strong>off</strong></code>)<br/>
224 <br/><br/><table><tr><td><strong>Main:spareMode1 </td><td></td><td> <input type="text" name="22" value="0" size="20"/> (<code>default = <strong>0</strong></code>)</td></tr></table>
227 <br/><br/><table><tr><td><strong>Main:spareMode2 </td><td></td><td> <input type="text" name="23" value="0" size="20"/> (<code>default = <strong>0</strong></code>)</td></tr></table>
230 <br/><br/><table><tr><td><strong>Main:spareMode3 </td><td></td><td> <input type="text" name="24" value="0" size="20"/> (<code>default = <strong>0</strong></code>)</td></tr></table>
233 <br/><br/><table><tr><td><strong>Main:spareParm1 </td><td></td><td> <input type="text" name="25" value="0." size="20"/> (<code>default = <strong>0.</strong></code>)</td></tr></table>
236 <br/><br/><table><tr><td><strong>Main:spareParm2 </td><td></td><td> <input type="text" name="26" value="0." size="20"/> (<code>default = <strong>0.</strong></code>)</td></tr></table>
239 <br/><br/><table><tr><td><strong>Main:spareParm3 </td><td></td><td> <input type="text" name="27" value="0." size="20"/> (<code>default = <strong>0.</strong></code>)</td></tr></table>
242 <br/><br/><table><tr><td><strong>Main:spareWord1 </td><td></td><td> <input type="text" name="28" value="void" size="20"/> (<code>default = <strong>void</strong></code>)</td></tr></table>
245 <br/><br/><table><tr><td><strong>Main:spareWord2 </td><td></td><td> <input type="text" name="29" value="void" size="20"/> (<code>default = <strong>void</strong></code>)</td></tr></table>
248 <br/><br/><table><tr><td><strong>Main:spareWord3 </td><td></td><td> <input type="text" name="30" value="void" size="20"/> (<code>default = <strong>void</strong></code>)</td></tr></table>
251 <input type="hidden" name="saved" value="1"/>
254 echo "<input type='hidden' name='filepath' value='".$_GET["filepath"]."'/>"?>
256 <table width="100%"><tr><td align="right"><input type="submit" value="Save Settings" /></td></tr></table>
261 if($_POST["saved"] == 1)
263 $filepath = $_POST["filepath"];
264 $handle = fopen($filepath, 'a');
266 if($_POST["1"] != "1000")
268 $data = "Main:numberOfEvents = ".$_POST["1"]."\n";
269 fwrite($handle,$data);
271 if($_POST["2"] != "2")
273 $data = "Main:numberToList = ".$_POST["2"]."\n";
274 fwrite($handle,$data);
276 if($_POST["3"] != "50")
278 $data = "Main:timesToShow = ".$_POST["3"]."\n";
279 fwrite($handle,$data);
281 if($_POST["4"] != "10")
283 $data = "Main:timesAllowErrors = ".$_POST["4"]."\n";
284 fwrite($handle,$data);
286 if($_POST["5"] != "on")
288 $data = "Main:showChangedSettings = ".$_POST["5"]."\n";
289 fwrite($handle,$data);
291 if($_POST["6"] != "off")
293 $data = "Main:showAllSettings = ".$_POST["6"]."\n";
294 fwrite($handle,$data);
296 if($_POST["7"] != "0")
298 $data = "Main:showOneParticleData = ".$_POST["7"]."\n";
299 fwrite($handle,$data);
301 if($_POST["8"] != "off")
303 $data = "Main:showChangedParticleData = ".$_POST["8"]."\n";
304 fwrite($handle,$data);
306 if($_POST["9"] != "off")
308 $data = "Main:showChangedResonanceData = ".$_POST["9"]."\n";
309 fwrite($handle,$data);
311 if($_POST["10"] != "off")
313 $data = "Main:showAllParticleData = ".$_POST["10"]."\n";
314 fwrite($handle,$data);
316 if($_POST["11"] != "off")
318 $data = "Main:writeChangedSettings = ".$_POST["11"]."\n";
319 fwrite($handle,$data);
321 if($_POST["12"] != "currentSettings.cmnd")
323 $data = "Main:changedSettingsFile = ".$_POST["12"]."\n";
324 fwrite($handle,$data);
326 if($_POST["13"] != "off")
328 $data = "Main:writeAllSettings = ".$_POST["13"]."\n";
329 fwrite($handle,$data);
331 if($_POST["14"] != "allSettings.cmnd")
333 $data = "Main:allSettingsFile = ".$_POST["14"]."\n";
334 fwrite($handle,$data);
336 if($_POST["15"] != "off")
338 $data = "Main:showAllStatistics = ".$_POST["15"]."\n";
339 fwrite($handle,$data);
341 if($_POST["16"] != "-999")
343 $data = "Main:subrun = ".$_POST["16"]."\n";
344 fwrite($handle,$data);
346 if($_POST["17"] != "off")
348 $data = "Main:LHEFskipInit = ".$_POST["17"]."\n";
349 fwrite($handle,$data);
351 if($_POST["18"] != "0")
353 $data = "Main:numberOfSubruns = ".$_POST["18"]."\n";
354 fwrite($handle,$data);
356 if($_POST["19"] != "off")
358 $data = "Main:spareFlag1 = ".$_POST["19"]."\n";
359 fwrite($handle,$data);
361 if($_POST["20"] != "off")
363 $data = "Main:spareFlag2 = ".$_POST["20"]."\n";
364 fwrite($handle,$data);
366 if($_POST["21"] != "off")
368 $data = "Main:spareFlag3 = ".$_POST["21"]."\n";
369 fwrite($handle,$data);
371 if($_POST["22"] != "0")
373 $data = "Main:spareMode1 = ".$_POST["22"]."\n";
374 fwrite($handle,$data);
376 if($_POST["23"] != "0")
378 $data = "Main:spareMode2 = ".$_POST["23"]."\n";
379 fwrite($handle,$data);
381 if($_POST["24"] != "0")
383 $data = "Main:spareMode3 = ".$_POST["24"]."\n";
384 fwrite($handle,$data);
386 if($_POST["25"] != "0.")
388 $data = "Main:spareParm1 = ".$_POST["25"]."\n";
389 fwrite($handle,$data);
391 if($_POST["26"] != "0.")
393 $data = "Main:spareParm2 = ".$_POST["26"]."\n";
394 fwrite($handle,$data);
396 if($_POST["27"] != "0.")
398 $data = "Main:spareParm3 = ".$_POST["27"]."\n";
399 fwrite($handle,$data);
401 if($_POST["28"] != "void")
403 $data = "Main:spareWord1 = ".$_POST["28"]."\n";
404 fwrite($handle,$data);
406 if($_POST["29"] != "void")
408 $data = "Main:spareWord2 = ".$_POST["29"]."\n";
409 fwrite($handle,$data);
411 if($_POST["30"] != "void")
413 $data = "Main:spareWord3 = ".$_POST["30"]."\n";
414 fwrite($handle,$data);
423 <!-- Copyright (C) 2010 Torbjorn Sjostrand -->