Python scripts that read Les Houches Event (LHE) files and create plots
git clone https://github.com/nplastir/LHE-scripts.git
- Step 1: Read LHE file and convert it in a ROOT tree
python3 LHEReader.py --input input.lhe --output output.root
- Step 2: Read ROOT tree and create plots
python3 LHEplots.py --input output.root --output [DIRECTORY]
python3 LHEReader.py --input example.lhe --output example.root
Running this, will create a root file example.root. Then, simply run
python3 LHEplots.py --input example.root --output example
which will create a directory (if does not already exist) called example where will be created some plots in .png format.
If you have multiple files that you want to convert into ROOT files:
- Create a folder where you will transfer all the
.lhefiles that you want to process. - Run
./batch_convert.sh [DIRECTORY]where the [DIRECTORY] is the argument for the input folder. - This script will then create, according to the input folder name, a directory to store all the ROOT files, will merge them and then create a directory with all the plots.
The script LHEplots.pyis a very simple script that plots only the basic variables from the LHE file. For more complex examples, refer to the scripts inside the tt+bb folder, which contain scripts for the three decay channels of the tt+bb process.