RE: TreePlayer parser confusion?

From: Philippe Canal <>
Date: Wed, 05 Jan 2005 14:34:39 -0600

Hi Troy,


   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,

-----Original Message-----
From: [] On Behalf Of troy d. straszheim
Sent: Sunday, December 19, 2004 6:05 PM
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++)


  t->Draw("plot_my_i.B<void>.i:against_my_i.B<void>.i");   t->StartViewer();

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?


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