I wrote a script, attached below, that copies the some of the content of a file’s existing tree into another tree in such a way that for branches whose values is a TVectorT, each the entry in the vector get their own event.
makeObEventTree.C (3.95 KB)
To do this, I’m making a lot of calls to TTree::SetBranchAddress,Branch, including for each variable in objVars (lines 37-88). I noticed that if I include all of these variables, there is a segfault. HOWEVER, if I comment out most of them and only leave a couple, the program runs fine and the new tree is created.
Also, if I comment out line 132 treeR->GetEntry(event), then there is no crash. Additionally, running it on different root files generated similar to the attached one, this program often runs fine and creates a good tree. I’m really stumped as to why this is occurring.
histo_TTJets_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_1.root (1.8 MB)