Re: [ROOT] Doc error

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Oct 04 2000 - 18:55:14 MEST


Hi Isidro,
Thanks for sending the file with your classes.
The solution is quite simple. You forgot to add
ClassDef(MyEvent,1)     in MyEvent.h
ClassDef(MyParticle,1)  in MyParticle.h
ClassImp(MyEvent)       in MyEvent.C
ClassImp(MyParticle)    in MyParticle.C

With these changes, your program works correctly.

Rene Brun

Isidro.Gonzalez.Caballero@cern.ch wrote:
> 
> Hi,
>         I am starting to play with Trees and Branches, so I decided to
> have a look at the 'How to' documentation, in particular at 'How to Create
> and Fill a Tree'. I follow the example but replaced Event with MyEvent
> (which inherits from TObject). When I try to run my small macro I get:
> 
> Error in <TTree::BranchObject>: Cannot find class:MyEvent
> 
> but if I do '.class MyEvent' I can perfectly see it (this is in a shared
> library produced together with the corresponding dictionary, etc...).
> 
> The offending lines look like:
> 
>   MyEvent* myevent = 0;
>   tree->Branch("myevent","MyEvent", &myevent, bsize,split);
> 
> After going up and down and consulting some expert (Ivana) we removed the
> first string in the second line, therefore becaming:
> 
>   tree->Branch("MyEvent", &myevent, bsize,split);
> 
> and... it works!!!
> 
> The question now is wether this is correct or not. If it *is* correct
> then, could you please correct the web documentation accordingly?... If
> not, could you give me any solution?...
> 
>         Thanks on advance,
> 
>                         Isidro
> 
> +---------------------------+--------------------------------+
> | Isidro González Caballero | mailto:Isidro.Gonzalez@cern.ch |
> | CERN-EP / Mailbox: F28010 | http://home.cern.ch/~iglez/    |
> | 1211 Geneva 23            |               -o-              |
> | Switzerland               | Tel: +41 22 76 73060, 73316    |
> +---------------------------+--------------------------------+



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:34 MET