Hi,
I am trying to read a ROOT file with TTrees in it via TChain. The file is in the castor.
I can set the branch addresses with SetBranchAddress but when I want to retrieve the
TBranch* pointers via
b_RunNumber = fChain->GetBranch(“RunNumber”);
my code crashes and I get:
Error in TFile::TFile: file user.top.TopView1212_StacoTauRec.trig1_misal1_mc12.005200.T1_McAtNlo_Jimmyv12000601.003.AANT0._00001.root does not exist
Error in TFile::TFile: file user.top.TopView1212_StacoTauRec.trig1_misal1_mc12.005200.T1_McAtNlo_Jimmyv12000601.003.AANT0._00001.root does not exist
*** Break *** segmentation violation
Generating stack trace…
0xf6e4768c in TTree::LoadTree(long long) + 0xf0 from /afs/cern.ch/sw/lcg/external/root/5.10.00e/slc3_ia32_gcc323/root/lib/libTree.so
I attached the package that I use. After unpacking it, you only have to run CppAnaMain.C:
root [0] .x CppAnaMain.C
In the CppAnaMain.C file the example 2 root files on the castor are loaded (and the root files on castor are readable so if you are on lxplus you can run it). This root files are a bit large and they were generated by others so I cannot prepare a small one for you but I hope you can run the code on the lxplus as well.
An interesting feature of this problem that the code crashes only if I want to load the root files from castor, otherwise it works. Still, the idea would be to load them all from the castor because after a point I have to load tens or hundreds of such files to get statistics…
I have started investigating the problem but, unfortunately, so far I could not reproduce the segv. However, my attempts to open the files also failed.
The point is that they fail not only within ROOT (both with 5.10.00e and with a more recent version 5.15.04), but also with standard Castor commands. I can in fact list the files
but when I try to copy them locally I get this
(I have enabled tracing to get the details). I get similar messages within ROOT.
Unless this is weirdly related with the fact that I am not part of the ‘zp’, ATLAS, group (but accordingly to ‘nsls’ I should be able to read the file),
this may indicate a problem on the server side. Restaging the files may help in this cases.
A last question: how do you set the environment to use ROOT 5.10.00e ?
Could you post the output of ’ ldd $ROOTSYS/lib/libRFIO.so ’ ?
If you tell me where I can copy a sample file where you would be able to access it (e.g. some public folder in my home dir or else on castor) then I am happy to copy it there.
but it turned out that I don’t need these variables so I just commented out every such call, and now everything works. I can read lot of root files from castor without problem.