<chapter name="Save Settings"> 
 
<h2>Save Settings</h2> 
 
The information on this webpage is only valid if you access the PHP 
dynamic webpages via a web browser, and does not apply to the static 
HTML equivalents. With PHP, all of the settings in the PYTHIA program 
are represented by radio buttons or fill-in boxes, that makes it easy 
for you to  construct a file with your desired changes. This file can 
then be read into PYTHIA by your main program to steer the whole run. 
 
<h3>Basic instructions</h3> 
 
The functionality of the PHP option is described in the following. 
 
<p/> 
<table border="2" cellpadding="5"><td> 
<PHPFILECODE/> 
</td></table> 
 
<ul> 
 
<p/><li> 
To begin with, you must specify a <b>(temporary) file name</b> in the 
box above. If the filename already exists on the server, you will be 
requested to pick a new name.</li> 
 
<p/><li> 
Once you have <b>Submit</b>ted your filename, you can browse through the 
pages and make your selections. The values currently selected when you 
load the page are the default values.</li> 
 
<p/><li> 
When you have finished making your changes to a particular page, 
you <b>must</b> click on <b>Save Settings</b> at the <b>bottom</b> of 
the page. This will write the changes to your temporary file. If you make 
a mistake, just repeat the procedure for that category again.</li> 
 
<p/><li> 
When you have finished all the changes you need, return to this page 
and click <b>Finish File</b>.</li> 
 
<p/><li> 
You will then get up a link, that you are asked to <b>right-click</b> 
with your mouse (or equivalent).</li> 
 
<p/><li> 
In the menu that appears, pick the option <b>Save Link As</b> 
(or equivalent).</li> 
 
<p/><li> 
You will now get up a file browser, for you to pick and <b>Save</b> 
the location and file name (the latter by default the same as the 
temporary file name).</li> 
 
<p/><li> 
At any time, if you click the <b>RESET</b> button, your temporary 
file will be erased and you can start anew.</li> 
 
<p/><li> 
Before you use a file, be sure to <b>check it visually</b> to confirm 
that you saved what you intended to. Minor corrections are easily made 
in a text editor. 
</li> 
 
</ul> 
 
<p/> 
<h3>Supplementary notes</h3> 
 
 
The documentation files exist in three versions. 
<ol> 
 
<p/><li> 
As a set of <code>.xml</code> files, in the <code>xmldoc/</code> 
subdirectory. These are the master copies that no user ever should 
touch, but that are used to generate the variants below.</li> 
 
<p/><li> 
As a set of <code>.html</code> files, in the <code>htmldoc/</code> 
subdirectory. You can open your own locally installed copy of the 
<code>Welcome.html</code> file in your web browser and thereafter 
navigate among all the pages. You can learn which parameters are free 
to be changed, but not change anything, except by brute-force 
cut-and-paste to a file of your own.</li> 
 
<p/><li> 
As a set of <code>.php</code> files, in the <code>phpdoc/</code> 
subdirectory. For these files to provide the functionality described 
above they have to accessed via a webserver. The one where you have 
your homepage should work fine. Alternatively you can use pages already 
available on another server.</li> 
 
</ol> 
 
<p/> 
A few further comments about the operation of the PHP option: 
<ul> 
 
<p/><li> 
To set up the PHP files on your webserver, you have to install the whole 
<code>phpdoc/</code> subdirectory there. In addition to the 
<code>.php</code> code this includes a few more files, plus a 
subdirectory named <code>files</code> where the temporary files 
are stored. This subdirectory must have public write access to work 
(<code>chmod a+w files</code> if not).</li> 
 
<p/><li> 
The "temporary" files stored in <code>files</code> actually remain 
unless the RESET button is used. The good news is that this makes 
it possible to recover a file that otherwise might be lost. The bad 
news is that the <code>files</code> directory may need to be cleaned 
up from time to time. (But typically the files are pretty small, so 
this should not be a major problem.)</li> 
 
<p/><li> 
When you click the <b>Save Settings</b> button on the bottom of a page 
all changed settings are written on the temporary file in the format 
<pre> 
name-of-flag/mode/parameter/word = value 
</pre> 
with one variable per line. Thereafter all the settings on the page 
are restored to their default values.</li> 
 
<p/><li> 
You can return to a page to do some further changes and save those. 
If you change the same parameter twice, it is the last value that 
counts. (Both values are stored in the file, with the more recent 
lower down, and then PYTHIA does the changes sequentially.) However 
remember that unchanged values are not stored, so if you want to 
restore some default value it may be simpler to edit the file 
afterwards.</li> 
 
<p/><li> 
The changeable flags/modes/parameters/words are mainly in the 
"Setup Run Tasks" section of the index, but a few (less 
frequently used ones) can also be found lower down, in the 
"Study Output" and "Link to Other Programs" pages.</li> 
 
<p/><li> 
It is not (yet) possible to modify particle data within the PHP-based 
setup approach. This is a more difficult task, since e.g. the 
modifications one may want to do in a decay table can be quite 
interrelated.</li> 
 
</ul> 
 
</chapter> 
 
<!-- Copyright (C) 2020 Torbjorn Sjostrand --> 
