RE: [ROOT] binary output from a TH2F

From: Valeri Fine (fine@bnl.gov)
Date: Wed May 07 2003 - 22:13:15 MEST


> Hello Rooters,
> 
> I would like to know whether there
> is a convenient way to write a 2D sinogram (just the entry values)
>as a raw file.

  Try:

  void writeRaw(TArtrayF *h) {
    FILE *f= fopen("myfile","w");
    fwrite(h->GetArray(),sizeof(float),h->GetSize(),f);
    fclose(f);
  }

The you can use it for any 1/2D histogram;
  
  TH1F *h1;
  writeRaw(h1);

  TH2F *h2;
  writeRaw(h2);


  Hope it helps
                   Valeri
> 
> Thanks
> Fernando



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET