Basically, I have a hit class with some data members and an event class with the TClonesArray of hits. I would like to have my event in the tree.
I have followed the example in section 12.17 of the ROOT documentation but I still get segfault during the tree.Fill(). In the attachment there is the full code which shows the problem.
Also I have realized that in the documentation it is done this way:
// create a pointer to an Event object Event *event = new Event(); // create two branches, split one t4.Branch("event_branch", "Event", &event,16000,2);
And I would expect that the ‘Branch’ method takes the pointer (i.e. event, but not &event).
Am I wrong?
eventsInRootTree.tar.gz (1.38 KB)