I am using root 5.28/00, trunk@37585.
I am using TProofOutputFile to store histograms in the output file, and it works fine.
The problem is that I can create new directories, but using the SetDirectory( TDirectory* ) method seems to produce no effect, and the histograms are saved outside the directory, although it is always present in the output file. I create dirs in the SlaveBegin() method, soon after the histos have been created.
Is it possible that somehow the information of the SetDirectory gets lost outside the SlaveBegin method?
Thank you very much in advance.
You should provide an example of what you are doing so that we can understand what, in your opinion, does not work.
Also, if the problem is with saving objects in different directories inside a file, maybe, if you have not already done it, you can try the same thing on a local session and see if you get the expected behavior.
because of a TProofOutputFile “bug” when accessing files via gpfs.
as you can see, I create 2 histograms and a TDirectory inside the output file.
The file, the directory and the histograms are correctly created, merged and saved, but the h_beta histogram is in the same root directory h_test is, and not inside “myDirectory” as I expected.
The result is invariant if you create the TH1Fs before or after the TProofOutputFile is created.
the problem is I cannot run the program locally.
Anyway, I have tried your suggestion, which does not work.
At the SlaveTerminte() level the histogram is saved as follows:
I found a partial solution.
Instead of setting the directory in the SlaveBegin method, I moved to it just before Writing objects in the SlaveTerminate():
This way, I obtain the histogram inside “myDirectory”; using SetDirectory method does results in nothing, I must admit. Can anybody explain why or how?
SetDirectory controls where the object is registered in memory, but you will always write in the directory you are in. And this is controlled by cd(…) .