I think segmentation violation was caused by my typo in code. But now after adding TFile *out
in MyProcess.h the same error appears:
Error in <TTree::Fill>: Failed filling branch:Selected.mpair, nbytes=-1, entry=35458
This error is symptomatic of a Tree created as a memory-resident Tree
Instead of doing:
TTree *T = new TTree(...)
TFile *f = new TFile(...)
you should do:
TFile *f = new TFile(...)
TTree *T = new TTree(...)
Error in <TTree::Fill>: Failed filling branch:Selected.mtriple, nbytes=-1, entry=35458
public :
TFile *out;
TTree *fChain; //!pointer to the analyzed TTree or TChain
Int_t fCurrent; //!current Tree number in a TChain
...
MyProcess::MyProcess(TTree *tree) : out(0), fChain(0)
As a side note, fChain is a TSelector is usually for the input. For the output you likely need to create a different data member (so that, at least, to avoid confusion).