tip and tricks

Tips & Tricks

Compiling with RooStats

While trying to compile some c++ code that used RooStats, I encountered a few difficulties.
Firstly, I tried (on Mac OS X 10.9):

clang++ -o CLsLimitSetting CLsLimitSetting.C
'root-config --cflags --libs' 
which usually does the job for code linked to root.
However, this didn't work.
To compile code with RooStats, you will need to include in addition the RooStats & RooFit libraries, and probably Minuit & HistFactory such that the full command becomes:
clang++ -o CLsLimitSetting CLsLimitSetting.C
'root-config --cflags --libs'
-lRooFit -lMinuit -lRooFitCore -lRooStats -lHistFactory
It took me a while to work all of this out especially the
-lRooFitCore
part.