GAMBIT WILSON COEFFICIENT TUTORIAL
==================================


Start a GAMBIT Docker container named 'gc'
------------------------------------------

docker run -it --rm --name gc gambitbsm/gambit-tutorial


Copy some files over to the container
-------------------------------------

docker cp WC_lite.yaml gc:/work/gambit/
docker cp WC_lite.pip gc:/work/gambit/


Try the GAMBIT diagnostics system
---------------------------------

./gambit models
./gambit scanners
./gambit diver
./gambit backends
./gambit SuperIso



Take a look at the input YAML file
----------------------------------

less WC_lite.yaml



Run scan and check output
-------------------------

Single thread:
./gambit -f WC_lite.yaml

...Or multiple threads: 
(By adding the restart flag -r we allow GAMBIT to overwrite existing output.)
mpirun -np 2 ./gambit -rf WC_lite.yaml


Try aborting and resuming:
1. press ctrl-c and wait... 
2. resume the scan by calling GAMBIT *without* the restart flag -r:
mpirun -np 2 ./gambit -f WC_lite.yaml


Check the output directories in runs/WC_lite: logs, samples, scanner_plugin
cd runs/WC_lite
ll logs
ll scanner_plugin/Diver
ll samples


h5ls -r samples/WC.hdf5
h5dump --dataset=WC/LogLike samples/WC.hdf5



Parse and plot results with pippi
---------------------------------

(From the main GAMBIT directory)
pippi WC_lite.pip

Check the directories created by pippi: parse, scripts, plots
ll runs/WC_lite/

Take a look at the best-fit point:
less runs/WC_lite/parse/WC.best_all

Copy the plots out from the Docker container: 
(From outside the Docker container)
docker cp gc:/work/gambit/runs/WC_lite/plots .

evince plots/WC_7_like1D.pdf
evince plots/WC_10_like1D.pdf
evince plots/WC_7_10_like2D.pdf



Suggestions for other things to try
===================================

- Run a MultiNest scan.
  (Plotting the results will require some changes to WC_lite.pip)


- Use the GAMBIT diagnostics system to figure out which function
  calculates the b2sll log-likelihood. (Commented out in WC_lite.yaml)

  Take a look at this function in FlavBit/src/FlavBit.cpp
  (A fairly clean illustration of a GAMBIT module function.)


- Take a look at some of the YAML files in the yaml_files/ directory,
  e.g. yaml_files/VectorSingletDM_Z2.yaml. 

  Try changing the printer to 'cout' (comment out the options 
  for the hdf5 printer) and let GAMBIT run a few points for this scan.