Tuesday, September 13, 2005

Deleting empty directories

FOund this to be hand, especially after iTunes (or similar) buggers up the filestructure of your mp3 colleciton...

find . -type d -empty -exec rmdir {} \;

or if you are a bit more cautious

find . -type d -empty -ok rmdir {} \;

Works in cygwin, might need some more escaping etc for other *nix's

Monday, September 05, 2005

Debugging ROOT macro's

Sometimes you need to debug a ROOT macro. Often you'll end up putting in loads of cout statements and solving it that way, but its also possible to use the cint debugger to solve your issues. Below is an example of how to do this.

.L libPhysics.so
.L libRFIO.so
.L libQqHinvisible.so
.L Utilities.C
.L L1JetCalibration.C
.L MetDifference.C
.L JetResolution.C
.L JetPlots.C
.L JetPairs.C
.L VBFCuts.C
.L CutPlots.C
.L Analysis.C
TString NumberEvents = "1000";
TString FirstEvent = "0";
double limit = 0.9;
VBFCuts * theCuts = new VBFCuts();
TFile * calibrations = new TFile("InvHalfStatCorr2.root");
L1JetCalibration * jetetcalibration = new L1JetCalibration(calibrations);
.b Analysis::184
.b Analysis::run
.b Analysis::~Analysis
Analysis * qqh120 = new Analysis("hg03_qq_qqh120_inv", NumberEvents, FirstEvent, limit, theCuts, jetetcalibration);
qqh120->run()
.c or .s


Run: S : step over function/loop
s : step into function/loop
i : ignore and step over
c <[line]>: continue
e : step out from function
f [file] : select file to debug
b [line] : set break point
db [line] : delete break point
a [assert]: break only if assertion is true
O [0~4] : Set bytecode compiler mode
debug : bytecode status display on/off
dasm : disassembler