Re: XML in a TFile

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 9 Sep 2010 12:37:11 -0500


  > But I'm not able to Write a TXMLFile *inside* a TFile

You should not :). A TXmlFile is a representation of a physical file.

 > My solution now is to just save the xml as the title of a TNamed which seems to work fine.

This is a code solution. Another alternative is to use a TMacro object.

 > I would like define arbitrary metadata about contained TTrees

If the information is about a single TTree, I recommend storing it along side the TTree by adding the xml information (TNamed or TMacro) in the list of user info:

     mytree->GetUserInfo()->Add(myxmldata);

Cheers,
Philippe.

On 9/9/10 10:17 AM, Noel Dawe wrote:
> But I'm not able to Write a TXMLFile *inside* a TFile (containing some TTrees)? My solution now is to just save the xml as the
> title of a TNamed which seems to work fine.
>
> Noel
>
> On Thu, Sep 9, 2010 at 2:13 AM, John Idarraga <idarraga_at_lal.in2p3.fr <mailto:idarraga_at_lal.in2p3.fr>> wrote:
>
> How about this ?
>
> http://root.cern.ch/root/html/TXMLFile.html
>
> John
>
>
> Noel Dawe wrote:
>
> Is there any way to embed xml in a TFile? I would like define arbitrary metadata about contained TTrees with xml.
>
> Noel
>
>
>
Received on Thu Sep 09 2010 - 19:37:18 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 09 2010 - 23:50:01 CEST