]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8145/phpdoc/MainProgramSettings.php
New pythia8 version
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8145 / phpdoc / MainProgramSettings.php
1 <html>
2 <head>
3 <title>Main-Program Settings</title>
4 <link rel="stylesheet" type="text/css" href="pythia.css"/>
5 <link rel="shortcut icon" href="pythia32.gif"/>
6 </head>
7 <body>
8
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"))
14 {return false;}
15 }
16
17 document.onkeypress = stopRKey;
18 </script>
19 <?php
20 if($_POST['saved'] == 1) {
21 if($_POST['filepath'] != "files/") {
22 echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; }
23 else {
24 echo "<font color='red'>NO FILE SELECTED YET.. PLEASE DO SO </font><a href='SaveSettings.php'>HERE</a><br/><br/>"; }
25 }
26 ?>
27
28 <form method='post' action='MainProgramSettings.php'>
29
30 <h2>Main-Program Settings</h2>
31
32 <h3>Introduction</h3>
33
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. 
53
54 <p/>
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.
64 <pre>
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"); 
69 </pre>
70
71 <h3>Run settings</h3>
72
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. 
78
79 <br/><br/><table><tr><td><strong>Main:numberOfEvents  </td><td></td><td> <input type="text" name="1" value="1000" size="20"/>  &nbsp;&nbsp;(<code>default = <strong>1000</strong></code>; <code>minimum = 0</code>)</td></tr></table>
80 The number of events to be generated.
81   
82
83 <br/><br/><table><tr><td><strong>Main:numberToList  </td><td></td><td> <input type="text" name="2" value="2" size="20"/>  &nbsp;&nbsp;(<code>default = <strong>2</strong></code>; <code>minimum = 0</code>)</td></tr></table>
84 The number of events to list.
85   
86
87 <br/><br/><table><tr><td><strong>Main:timesToShow  </td><td></td><td> <input type="text" name="3" value="50" size="20"/>  &nbsp;&nbsp;(<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.
90   
91
92 <br/><br/><table><tr><td><strong>Main:timesAllowErrors  </td><td></td><td> <input type="text" name="4" value="10" size="20"/>  &nbsp;&nbsp;(<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.
95   
96
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  &nbsp;&nbsp;(<code>default = <strong>on</strong></code>)<br/>
100 Print a list of the changed flag/mode/parameter/word settings.
101   
102
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  &nbsp;&nbsp;(<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.
108   
109
110 <br/><br/><table><tr><td><strong>Main:showOneParticleData  </td><td></td><td> <input type="text" name="7" value="0" size="20"/>  &nbsp;&nbsp;(<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.
113   
114
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  &nbsp;&nbsp;(<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).
120   
121
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  &nbsp;&nbsp;(<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.
129   
130
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  &nbsp;&nbsp;(<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.
136   
137
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  &nbsp;&nbsp;(<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. 
144   
145
146 <br/><br/><table><tr><td><strong>Main:changedSettingsFile  </td><td></td><td> <input type="text" name="12" value="currentSettings.cmnd" size="20"/>  &nbsp;&nbsp;(<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>
149 is on. 
150   
151
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  &nbsp;&nbsp;(<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. 
158   
159
160 <br/><br/><table><tr><td><strong>Main:allSettingsFile  </td><td></td><td> <input type="text" name="14" value="allSettings.cmnd" size="20"/>  &nbsp;&nbsp;(<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>
163 is on. 
164   
165
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  &nbsp;&nbsp;(<code>default = <strong>off</strong></code>)<br/>
169 Print all available statistics or only the minimal set at the end 
170 of the run.
171   
172
173 <h3>Subruns</h3>
174
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.
180
181 <br/><br/><table><tr><td><strong>Main:subrun  </td><td></td><td> <input type="text" name="16" value="-999" size="20"/>  &nbsp;&nbsp;(<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.
184   
185
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  &nbsp;&nbsp;(<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.
193   
194
195 <br/><br/><table><tr><td><strong>Main:numberOfSubruns  </td><td></td><td> <input type="text" name="18" value="0" size="20"/>  &nbsp;&nbsp;(<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>. 
201   
202
203 <h3>Spares</h3>
204
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.
208
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  &nbsp;&nbsp;(<code>default = <strong>off</strong></code>)<br/>
212   
213
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  &nbsp;&nbsp;(<code>default = <strong>off</strong></code>)<br/>
217   
218
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  &nbsp;&nbsp;(<code>default = <strong>off</strong></code>)<br/>
222   
223
224 <br/><br/><table><tr><td><strong>Main:spareMode1  </td><td></td><td> <input type="text" name="22" value="0" size="20"/>  &nbsp;&nbsp;(<code>default = <strong>0</strong></code>)</td></tr></table>
225   
226
227 <br/><br/><table><tr><td><strong>Main:spareMode2  </td><td></td><td> <input type="text" name="23" value="0" size="20"/>  &nbsp;&nbsp;(<code>default = <strong>0</strong></code>)</td></tr></table>
228   
229
230 <br/><br/><table><tr><td><strong>Main:spareMode3  </td><td></td><td> <input type="text" name="24" value="0" size="20"/>  &nbsp;&nbsp;(<code>default = <strong>0</strong></code>)</td></tr></table>
231   
232
233 <br/><br/><table><tr><td><strong>Main:spareParm1 </td><td></td><td> <input type="text" name="25" value="0." size="20"/>  &nbsp;&nbsp;(<code>default = <strong>0.</strong></code>)</td></tr></table>
234   
235
236 <br/><br/><table><tr><td><strong>Main:spareParm2 </td><td></td><td> <input type="text" name="26" value="0." size="20"/>  &nbsp;&nbsp;(<code>default = <strong>0.</strong></code>)</td></tr></table>
237   
238
239 <br/><br/><table><tr><td><strong>Main:spareParm3 </td><td></td><td> <input type="text" name="27" value="0." size="20"/>  &nbsp;&nbsp;(<code>default = <strong>0.</strong></code>)</td></tr></table>
240   
241
242 <br/><br/><table><tr><td><strong>Main:spareWord1  </td><td></td><td> <input type="text" name="28" value="void" size="20"/>  &nbsp;&nbsp;(<code>default = <strong>void</strong></code>)</td></tr></table>
243   
244
245 <br/><br/><table><tr><td><strong>Main:spareWord2  </td><td></td><td> <input type="text" name="29" value="void" size="20"/>  &nbsp;&nbsp;(<code>default = <strong>void</strong></code>)</td></tr></table>
246   
247
248 <br/><br/><table><tr><td><strong>Main:spareWord3  </td><td></td><td> <input type="text" name="30" value="void" size="20"/>  &nbsp;&nbsp;(<code>default = <strong>void</strong></code>)</td></tr></table>
249   
250
251 <input type="hidden" name="saved" value="1"/>
252
253 <?php
254 echo "<input type='hidden' name='filepath' value='".$_GET["filepath"]."'/>"?>
255
256 <table width="100%"><tr><td align="right"><input type="submit" value="Save Settings" /></td></tr></table>
257 </form>
258
259 <?php
260
261 if($_POST["saved"] == 1)
262 {
263 $filepath = $_POST["filepath"];
264 $handle = fopen($filepath, 'a');
265
266 if($_POST["1"] != "1000")
267 {
268 $data = "Main:numberOfEvents = ".$_POST["1"]."\n";
269 fwrite($handle,$data);
270 }
271 if($_POST["2"] != "2")
272 {
273 $data = "Main:numberToList = ".$_POST["2"]."\n";
274 fwrite($handle,$data);
275 }
276 if($_POST["3"] != "50")
277 {
278 $data = "Main:timesToShow = ".$_POST["3"]."\n";
279 fwrite($handle,$data);
280 }
281 if($_POST["4"] != "10")
282 {
283 $data = "Main:timesAllowErrors = ".$_POST["4"]."\n";
284 fwrite($handle,$data);
285 }
286 if($_POST["5"] != "on")
287 {
288 $data = "Main:showChangedSettings = ".$_POST["5"]."\n";
289 fwrite($handle,$data);
290 }
291 if($_POST["6"] != "off")
292 {
293 $data = "Main:showAllSettings = ".$_POST["6"]."\n";
294 fwrite($handle,$data);
295 }
296 if($_POST["7"] != "0")
297 {
298 $data = "Main:showOneParticleData = ".$_POST["7"]."\n";
299 fwrite($handle,$data);
300 }
301 if($_POST["8"] != "off")
302 {
303 $data = "Main:showChangedParticleData = ".$_POST["8"]."\n";
304 fwrite($handle,$data);
305 }
306 if($_POST["9"] != "off")
307 {
308 $data = "Main:showChangedResonanceData = ".$_POST["9"]."\n";
309 fwrite($handle,$data);
310 }
311 if($_POST["10"] != "off")
312 {
313 $data = "Main:showAllParticleData = ".$_POST["10"]."\n";
314 fwrite($handle,$data);
315 }
316 if($_POST["11"] != "off")
317 {
318 $data = "Main:writeChangedSettings = ".$_POST["11"]."\n";
319 fwrite($handle,$data);
320 }
321 if($_POST["12"] != "currentSettings.cmnd")
322 {
323 $data = "Main:changedSettingsFile = ".$_POST["12"]."\n";
324 fwrite($handle,$data);
325 }
326 if($_POST["13"] != "off")
327 {
328 $data = "Main:writeAllSettings = ".$_POST["13"]."\n";
329 fwrite($handle,$data);
330 }
331 if($_POST["14"] != "allSettings.cmnd")
332 {
333 $data = "Main:allSettingsFile = ".$_POST["14"]."\n";
334 fwrite($handle,$data);
335 }
336 if($_POST["15"] != "off")
337 {
338 $data = "Main:showAllStatistics = ".$_POST["15"]."\n";
339 fwrite($handle,$data);
340 }
341 if($_POST["16"] != "-999")
342 {
343 $data = "Main:subrun = ".$_POST["16"]."\n";
344 fwrite($handle,$data);
345 }
346 if($_POST["17"] != "off")
347 {
348 $data = "Main:LHEFskipInit = ".$_POST["17"]."\n";
349 fwrite($handle,$data);
350 }
351 if($_POST["18"] != "0")
352 {
353 $data = "Main:numberOfSubruns = ".$_POST["18"]."\n";
354 fwrite($handle,$data);
355 }
356 if($_POST["19"] != "off")
357 {
358 $data = "Main:spareFlag1 = ".$_POST["19"]."\n";
359 fwrite($handle,$data);
360 }
361 if($_POST["20"] != "off")
362 {
363 $data = "Main:spareFlag2 = ".$_POST["20"]."\n";
364 fwrite($handle,$data);
365 }
366 if($_POST["21"] != "off")
367 {
368 $data = "Main:spareFlag3 = ".$_POST["21"]."\n";
369 fwrite($handle,$data);
370 }
371 if($_POST["22"] != "0")
372 {
373 $data = "Main:spareMode1 = ".$_POST["22"]."\n";
374 fwrite($handle,$data);
375 }
376 if($_POST["23"] != "0")
377 {
378 $data = "Main:spareMode2 = ".$_POST["23"]."\n";
379 fwrite($handle,$data);
380 }
381 if($_POST["24"] != "0")
382 {
383 $data = "Main:spareMode3 = ".$_POST["24"]."\n";
384 fwrite($handle,$data);
385 }
386 if($_POST["25"] != "0.")
387 {
388 $data = "Main:spareParm1 = ".$_POST["25"]."\n";
389 fwrite($handle,$data);
390 }
391 if($_POST["26"] != "0.")
392 {
393 $data = "Main:spareParm2 = ".$_POST["26"]."\n";
394 fwrite($handle,$data);
395 }
396 if($_POST["27"] != "0.")
397 {
398 $data = "Main:spareParm3 = ".$_POST["27"]."\n";
399 fwrite($handle,$data);
400 }
401 if($_POST["28"] != "void")
402 {
403 $data = "Main:spareWord1 = ".$_POST["28"]."\n";
404 fwrite($handle,$data);
405 }
406 if($_POST["29"] != "void")
407 {
408 $data = "Main:spareWord2 = ".$_POST["29"]."\n";
409 fwrite($handle,$data);
410 }
411 if($_POST["30"] != "void")
412 {
413 $data = "Main:spareWord3 = ".$_POST["30"]."\n";
414 fwrite($handle,$data);
415 }
416 fclose($handle);
417 }
418
419 ?>
420 </body>
421 </html>
422
423 <!-- Copyright (C) 2010 Torbjorn Sjostrand -->