Error in <HandleInterpreterException>: Trying to access a pointer that points to an invalid memory address..
Execution of your code was aborted.
In file included from input_line_51:1:
/home/sikach/Diploma/Analysis/KinFitter/Selector.C:122:2: warning: invalid memory pointer passed to a callee:
Selected->Fill();
^~~~~~~~
Seems like it solved old problem. But now there is one new:
root [2] tr_ph->Process("Selector.C")
Error in <TTree::Fill>: Failed filling branch:Selected.p_prj, nbytes=-1, entry=2660
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.p_prj, nbytes=-1, entry=5320
This error is symptomatic of a Tree created as a memory-resident Tree
Instead of doing:
This message repeats for each Branch and I do not even know where I use TFile at all!
Surprisingly, It works. TTree Selected was written to file I created. But there is another problem: some branches did not filled (actually, filled with very small numbers). Exactly, it were branches that initial tree has. I.e. phen,phth and phphi. I think I am not able just write:
We don’t have enough info. I don’t see where phen is declared. I don’t understand why you fill a tree (TTree::Branch()) and read it using the TTreeReader seemingly at the same time (a TSelector is used to read, not to fill).