Re: Problem reading TTree in script

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 21 Aug 2008 15:07:42 -0500


Hi James,

 > is it safe in all cases to have N*double followed by M*int?

Yes it is.

 > I have lots of data members so I am loath to branch all of them...

You probably would be better off moving from the leaflist branch creation method
to the object branch creation.

I.e. If you can have a compiled version of your struct and a dictionary (which you can easily get by simply putting the class/struct declaration in its own file and loading it via ACLiC). Then you would simplify greatly the branch declaration:

   mystruct *ptr_to_struct = new mystruct;    ...
   tree->Branch("mybranhc",&ptr_to_struct);

Cheers,
Philippe

James Jackson wrote:
> Hi Philippe,
>
>> You must either put those variable in 3 different branches (recommended)
>> or sort them in decreaseing size order (i.e:
>> XSec/D:ProcessId/I:NumEvents/I)
>
> Damn, time for a big data re-run! I have a few structures that may
> suffer this effect, is it safe in all cases to have N*double followed
> by M*int? I have lots of data members so I am loath to branch all of
> them...
>
>>> For information, sometimes when using a
>>> TBrowser, trees just vanish from the left hand heirarchical view - I
>>> wonder if this build is actually unstable?
>>
>> Under what circunstances? The TTree object is associated with the TFile
>> object and thus if the TFile is deleted the TTree will also be deleted.
>
> If I run:
>
> james-jacksons-macbook-pro:PhotonJets_120_170 jamesjackson$ root
> clusterHistos_1.root
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 5.20/00 24 June 2008 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> ROOT 5.20/00 (trunk_at_24524, Aug 13 2008, 13:17:00 on macosx64)
>
> CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0]
> Attaching file clusterHistos_1.root as _file0...
> root [1] TBrowser b
>
> and then double click on ROOT Files, then double-click on
> clusterHistos_1.root, then on diEmAnalysis (a TDirectory containing
> the trees). A subsequent click on 'Events' (a TTree) results in it
> vanishing from the Browser. The same then occurs for the next
> 'clicked' tree, but not for the last (I have 3) - however the last
> tree can not be browsed.
>
> I have put an example ROOT file showing this behavior at
> /afs/cern.ch/user/j/jacksonj/public/clusterHistos_1.root
>
> I have many ROOT files created with identical code and they all
> exhibit this problem.
>
> Regards,
> James.
Received on Thu Aug 21 2008 - 22:07:47 CEST

This archive was generated by hypermail 2.2.0 : Fri Aug 22 2008 - 17:50:02 CEST