[Frost] Question about loading files in a rootbeer macro
Brian Morrison
btmorr at jlab.org
Wed Sep 1 16:39:18 EDT 2010
Hey All,
I'm trying to get a .root file to load in the midst of a rootbeer macro so
that I can call some weights that I generate from a previous macro. The
trouble that I run into is that whenever I do this it either works but
100000x slower than normal or it closes the file without doing anything.
The situation where it closes the file I have it coded like this right
where I declare the histograms:
TFile f1("~/Desktop/Eta/pi0_weights.root");
TH2F *butanol_weights = (TH2F*)f1.Get("butanol_weights");
TH2F *ch2_weights = (TH2F*)f1.Get("ch2_weights");
f1.Close();
If I leave the .Close() statement in there then the macro opens the first
file then immediately kills the program, giving me no events sorted. If I
leave out the .Close() (or even place it where we close everything else
later one) I get no saved histograms at the end of my iteration
(essentially it does not close out the files from what I understand).
Idealay this would be the best way for me to do this if I can get it
working, otherwise I end up opening and closing this root file a ton when
making a function for it or passing very large arrays that take up a lot
of processing power (or so it seems). If anyone has some experience with
this or knows how to get this working it would be a great help to me and
save me a lot of headache with playing around with this. Thanks.
-Brian
More information about the Frost
mailing list