Hi Troy,
Indeed,
t->Draw("plot_my_i.B<void>.i:against_my_i.B<void>.i"); Does not work (and updating Tformula to fix this problem is non-trivial).
However, you simply use:
t->Draw("plot_my_i.i:against_my_i.i");
Cheers,
Philippe.
-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch]
On Behalf Of troy d. straszheim
Sent: Sunday, December 19, 2004 6:05 PM
To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] TreePlayer parser confusion?
Hi roottalk:
I'm trying to compare some classes in trees. This code shows the problem:
#include <TTree.h>
#include <TFile.h>
template <class T>
struct B { int i; };
struct C : B<void> { };
void plot_my_i()
{
C c, *cp(&c);
TTree *t = new TTree("mytree", "Icecube", 10000);
t->Branch("plot_my_i.", "C", &cp);
t->Branch("against_my_i.", "C", &cp);
for (int i=0; i<100; i++)
{
c.i=i*13; t->Fill();
So when a class further up in the inheritance hierarchy is a template, the angle-brackets get into the branch path, the treeplayer sees them as comparisions and things dont work. I have tried intermediate typedefs to outsmart rootcint:
template <class T> struct B { int i; };
typedef B<void> B_void;
struct C : B_void { };
but rootcint goes around them and the typedeffed name does not appear in the branch path. Any ideas?
Thanks,
troy d. straszheim Received on Wed Jan 05 2005 - 21:36:12 MET
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET