Hello,
I’m trying to use TSelector to automate comparison of two trees/chains.
The trees I would like to compare contain a super branch based on a class.
I would like to be able to call methods of that class while processing entries of the tree.
When I use TTree::MakeSelector method, to generate a skeleton that will be used to process entries, I get following list of leaves:
// Declaration of leave types
//Event *Event;
UInt_t fUniqueID;
UInt_t fBits;
Int_t value;
vector<int> array;
As one can see leaf that corresponds to my class is commented out.
I looked through TTreePlayer::MakeClass and I found there:
[code]const char *headOK = " “;
const char *headcom = " //”;
const char *head;
…
if (!leafobj->GetClass()) {leafStatus[l] = 1; head = headcom;}[/code]
So if TLeafObject::GetClass will return NULL, then such leaf will be commented out, and no branch pointer will be created for it.
I was only able to make TLeafObject::GetClass return proper TClass pointer, when I created the branch with TTree::BranchOld method. But then TTree::MakeSelector does not create an variable for my Event leaf and it also skips the std::vector leaf.
So how should I create the tree so that TTree::MakeSelector will enable me to access my Event object directly?
Of course I could simply edit resulting .h and .C files to make it happen. But I would like to use TTree::MakeSelector inside a script which would automatically fill Begin, Process and Terminate methods. After which it would run TTree::Process.
It would be a lot easier if I wouldn’t have to duplicate TTree::MakeSelector functionality
Regards,
Konrad