Hello. I’m very new to ROOT, and in attempting to follow documentation and apply it to the analysis of some data I’m running into errors I can’t understand or seem to correct.
I’ve set up ROOT from ATLASLocalRootBase, i.e. by
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'
setupATLAS
lsetup root
Following the articles
[ul]
root.cern.ch/developing-tselector
root.cern.ch/accessing-ttree-tselector
[/ul]
I’m generating a TSelector from a given TTree as follows -
root [0] TFile *f = new TFile("filename.root")
root [1] TTree *t = (TTree *) f->Get("treename")
root [2] t->MakeSelector("selectorname")
root [3] t->Process("selectorname.C")
At first this works correctly. However if I run the last command again (as I did initially after making changes to selectorname.C), I get
*** Break *** segmentation violation
followed by a very long stack trace. If I run it a third time I get instead
In file included from input_line_179:1:
In file included from /path/selectorname.C:26:
/path/selectorname.h:314:20: error: redefinition of 'Init'
void selectorname::Init(TTree *tree)
/path/selectorname.h:314:20: previous definition is here
void selectorname::Init(TTree *tree)
and the same for Notify, Begin, SlaveBegin, Process, SlaveTerminate and Terminate, followed by another segmentation violation with a much shorter stack trace.
I imagine there is something fundamentally wrong with what I’m doing (and that really I should return to the documentation and work through it more fully), but with limited experience of ROOT (and C++, and Linux…) I’m at a loss as to where to go from here.
Many thanks in advance for your assistance.
Tim