Re: text-to-histogram tool?

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Mon, 18 Jun 2007 10:16:08 +0200


Hi Gero,

If you are an XML fan, you can use the ROOT I/O XML driver. To see how it works,
run for instance the small script below
{

   TFile *f = TFile::Open("gero.xml","recreate");    TH1F *h = new TH1F("h","test",100,-3,3);    h->FillRandom("gaus",1000);
   h->Write();
   delete f;
}

You can read it gero.xml in ROOT with

   TFile *f = TFile::Open("gero.xml");
   h->Draw();

If you are not interested by the automatic schema evolution, you do not need to generate
the <StreamerInfos> block at the end of the file.

Rene Brun

Gero Flucke wrote:
> Hi all,
> does ROOT (or something/-one else) provide a tool that can read in a
> (specially formated) text file and convert it into one (or better several)
> histograms with title, axis labels, axis titles etc.?
> I need something like that for a standalone program that outputs some
> monitoring histogram information, but must not link to ROOT or something
> else, but I have control over the format of the text output. Easiest would
> be some xml-like syntax...
>
> Thanks for help
>
> Gero Flucke
>
> --
> -----------------------------------------------------------------------
> Gero Flucke office: DESY, Bldg. 67b, room 24
> Inst. f. Experimentalphysik fon: +49 (0)40 8998 4743
> Universitaet Hamburg fax: +49 (0)40 8998 2959
> Luruper Chaussee 149 at CERN: Bldg. 32 office 3-B20
> 22761 Hamburg fon: +41 (0)22 76-77557
> Germany
>
> --
> A: Because it messes up the order in which people normally read text.
> Q: Why is it such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet and in e-mail?
>
Received on Mon Jun 18 2007 - 10:16:14 CEST

This archive was generated by hypermail 2.2.0 : Mon Jun 18 2007 - 11:50:02 CEST