[ROOT] TBranch Name with dot at the end ...

From: Patrice Lebrun (lebrun@in2p3.fr)
Date: Mon Mar 26 2001 - 18:49:15 MEST


Hi,

I use the following code, to create a TTree with four branches, each
branch is one object
of the same class.
In this case the data members cannot  be accessed for each layer object.

To solve this problem we can add a dot at the end of the branch name.
For instance :

TBranch *branch = tree->Branch("layer1.", "ICLayer", &layer1, 64000,1);

but now it is impossible to call a method of these objects like
layer1.GetNumberOfCells();
Do you have any idea to to solve this problem ?

The root version used is 2.25.

Thank you.


   ICLayer* layer1 = new ICLayer;
   ICLayer* layer2 = new ICLayer;
   ICLayer* layer3 = new ICLayer;
   ICLayer* layer4 = new ICLayer;

   hfile = new TFile("layer.root","RECREATE","layer ROOT file");
   hfile->SetCompressionLevel(1);

   TTree *tree = new TTree("layer","layer events");
   tree->SetAutoSave(100000000); // 100 Mo
   TBranch *branch = tree->Branch("layer1", "ICLayer", &layer1,
64000,1);
   TBranch *branch = tree->Branch("layer2", "ICLayer", &layer2,
64000,1);
   TBranch *branch = tree->Branch("layer3", "ICLayer", &layer3,
64000,1);
   TBranch *branch = tree->Branch("layer4", "ICLayer", &layer4,
64000,1);




--
Patrice Lebrun                   L3-D0
Institut de Physique Nucleaire de Lyon
Phone: 04 72 44 84 43
Fax:   04 72 43 14 52



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:40 MET