Monday, July 02, 2007

It's been a while...

In the process of doing some thesis corrections I've written a python parser for Les Houche events (more in another post). Anyway it's a nice little utility that writes events into an SQLite database and then make plots using matplotlib. You run it in two ways, first to read the lhe file and then secondly to make the plot.

I've found that the following bash commands are useful when working with the output from Madgraph.

Unzip the unweighted event file for each process:
  • for i in `ls ~/corrections/MadGraph|grep -v tar`; do j=`ls $i/Events/|grep lhe|grep -v gz`; gzip ~/corrections/MadGraph/$i/Events/$j; j=`ls $i/Events/|grep unweighted`; gunzip ~/corrections/MadGraph/$i/Events/$j; done
Run the python parser on the unweighted file:
  • for j in `ls ~/corrections/MadGraph/|grep -v gz`; do python LHEParser.py -f `ls ~/corrections/MadGraph/$j/Events/*.lhe` -d sqlite:////Users/metson/Desktop/$j.db; done; python LHEParser.py -f `ls ~/corrections/Pythia/*.lhe` -d sqlite:////Users/metson/Desktop/Signal.db;
If you delete the text file you may want to skim the output of the parser:
  • for i in `ls ~/Desktop|grep -e "D.db"`; do python LHEParser.py -d sqlite:////Users/metson/Desktop/$i -s; done
Make the plots:
  • python LHEPlotter.py -d ~/Desktop/

No comments: