HI all,
I don’t understand what is the way to access the information in a branch.
I have I root file, see the picture, with some variables and two branch, Met and Header.
Now to take info for the variable I use the method:
You best bet is to use the result of tree->MakeSelector(“mysel”); which will set properly the branch addresses (or possibly better yet the result of TTree::MakeProxy).
The short answer is that you need to do:tree->SetMakeClass(1); // Use the decomposed object mode.
tree->SetBranchAddress("Met.MetSig",&MetSig);
tree->SetMakeClass(1); // Use the decomposed object mode.
tree->SetBranchAddress("Met.MetSig",&MetSig);
but I obtain this error:
so I tried to use: tree->MakeSelector(“mysel”); and I obtain the 2 files: mysel.C, mysel.h
what is the way to use information in these files?
Thank you
Ciccio
[quote]Error in TTree::SetBranchAddress: unknown branch -> Met.MetSig [/quote]Well I was guessing on the name of the branch …
[quote]what is the way to use information in these files?
[/quote]See the User’s guide and the documentation in the reference’s guide for MakeSelector and TSelector.
You will need to look at the content of mysel.h to see the name used for your variable the you should edit the file mysel.C to create your histogram in the routine mysel::SlaveBegin, fill then in the routine mysel::Process and draw then in the routine mysel::Terminate.
[quote]and in mysel.h about MetSig I have only this: [/quote]There should also a SetBranchAddress … If not this is strange and I would need your file to investigate further.