This script is a helper function for the python scripts. It loads the hardcoded paths from Paths.hpp and returns them as a string based on the specified options.
Before compiling this, one has to go to Utils.hpp and comment out functions getResult
, getVarFromResult
and getBplusMeanFromResult
. This is due to the fact it is a header file: it cannot properly link the RooFit functions. If the function was properly defined and compiled, runinng the scripts from the ROOT shell would be a living hell. Without running in the ROOT shell, one would have to constantly change the main file and recompile everything 400 times a day, so this is the price to pay.
The code has to be compiled in the same enviroment as we run the python in, hence we need to source it
First, compile the script to be a standalone executable that can be called by python:
cd Code/Selection/ComparisonTool
g++ getPathForPython.cc `root-config --libs --cflags` -o getPathForPython
The executable takes arguments in this order
- command (can be either "input", "BDTinput", "inputBkg" or "BDToutput"
- year
- Run
- magnet ("down", "up", "both")
- Preselected (1 or 0)
- MC (1 or 0)
- ReferenceChannel (1 or 0)
- PHSP (1 or 0)
- KshortDecayInVelo (1 or 0)
- Selection (not used anymore)
- UseLowQ2Range (1 or 0, effectively obsolete)
So to get the path of the signal MC 2011 sample, magnet down, after the MVA selection, do
getPathForPython "BDToutput 2011 1 "down" 1 1 0 0 0 0 0
The executable returns 0 if everything is okay, 1 if something fails. Which is the standard actually.