Creating Branches

Maarten Bruinsma (t26@nikhef.nl)
Thu, 26 Jun 1997 14:04:19 +0200 (MET DST)


Dear fellow ROOT users,

I just made my first TTree, but when compiling I keep getting a parse
error. I have tried several things, as it seems there are many ways to
create branches, but alas, all in vain. Could anyone tell me what's wrong
with the following?

TROOT simple("simple","Test of histogramming and I/O");
TFile hfile("mijnhistos.root","RECREATE","ROOT with all info on muons");

typedef struct {Float_t x,y,z;} POINT;
POINT begin_vertex;
static POINT end_vertex;
static POINT momentum;
static Int_t mother;
static Float_t p;
static Float_t pt;
static Float_t track_length;

// this tree contain momenta etc. of several types of muons

TTree *muontree = new TTree("muontree","Data for all muons");

muontree->Branch("Momentum",&momentum,"Px:Py:Pz");
muontree->Branch("Begin_Vertex",&begin_vertex,"Xvert:Yvert:Zvert");
muontree->Branch("EndVertex".&end_vertex,"Xvert2:Yvert2:Zvert2");
muontree->Branch("Tracklength",&track_length,"Tracklength");
muontree->Branch("P",&p,"P");
muontree->Branch("Pt",&pt,"Pt");
muontree->Branch("Mother",&mother,"Mother/I");

I get a parse error at the line creating the first branch.

Thanks in advance,

Maarten