The Professor Rivet(Gun) interface
Event sets can be generated and analysed using a Python script in the package, rivetrunner.py. This script is just a simple wrapper to call the rivetgun program with randomly selected parameters within given ranges, run Rivet analyses on them and to leave behind a directory containing a Rivet-generated AIDA histogram file and a file called used_params which documents the parameter choices which produced that result. It's not at all clever, at least, not yet.
The command line interface is almost non-existent at the moment, but by editing a couple of constants at the top of the script you can choose how many runs to make, how many events per run (this should be about 100000 or more for realistic runs) and the directory to write out the results into. You can also change the rivetgun command to which the parameter variations will be appended.
The program should be run like this:
$ ./rivetrunner.py -h # gives you some help output: This is RivetRunner Usage: rivetrunner.py [options] Options: -h, --help show this help message and exit -V, --verbose print status messages -D, --debug print debug (very verbose) messages -Q, --quiet be very quiet (overrides verbose and debug) -r, --run actually call Rivet rather than just writing out the command -R, --reference make an extra run as a fake reference point --ref-range=REFRANGE specify central fraction of the param range from which to sample the fake reference -p PARAMSFILE, --params=PARAMSFILE file containing the param names and sample ranges -n NUM_EVENTS_PER_RUN, --num-events=NUM_EVENTS_PER_RUN how many events to generate in each run -N NUM_RUNS, --num-runs=NUM_RUNS how many parameter space points to run the generator for --first-run=NUM_FIRST_RUN number given to the first run -o OUT_DIR, --outdir=OUT_DIR directory into which to write the generator output -T NUM_THREADS, --threads=NUM_THREADS max number of threads to be used $ ./rivetrunner.py -n50000 -N30 -R -o parj_41_42_81_82 -T2 -p fpythia.params
where fpythia.params is the name of a file which defines the parameters to be sampled from and the allowed ranges for that sampling. Here's the format of the example params file:
PARJ(82) 0.0 100.0 PARJ(41) 0.0 1.0 PARJ(42) 0.0 2.5 CKIN(3) 5.0 90.0 TMP 1.0 1.0
which defines four Pythia params and some allowed ranges. The TMP parameter is just there to show you that the sampler is okay with the start and end of the range being the same - this is the same as hard-coding that parameter to the rivetgun call.
Generating "reference" data
In developing and testing Professor, it's useful to generate some fake reference data and then see if the interpolation and minimisation will find the correct best-fit tuning. Such a set of reference data is generated by passing the -R or --reference switch to rivetrunner. With this flag set, an extra run will be made, with the same number of events as for the normal MC runs. The "reference" run's parameters are sampled randomly from the param hypercube, but the ranges of the cube sides are reduced, to ensure that the reference sample is well within the MC sample range. By default the range is reduced to 50% in each param, but this can be changed with the --ref-range=REFRANGE flag.
Analysing the output
To analyse the results of a rivetrunner session, you can use aidareader - more about that in AidaReader?.
- Improve interface
- Integrate batch farm support (currently possible just by changing the rivetgun command)