Save a histogram as a text file on disk

From: Ida Häggström <ida.haggstrom_at_radfys.umu.se>
Date: Tue, 27 Sep 2011 07:39:56 +0200


Dear Rooters,

I'm making a little script that stores data in a histogram. Now I want to save this data as a text file (to open in another program, e.g. Matlab) with bin in one column and number in a second column. I cannot really find any examples of this in the users guide... Is there a good way to do this? Below are some relevant pieces of my code. Thanks! /Ida



TH1F *myHist= new TH1F("myHist","Sensitivity",100,-200.,+200.);

for (Int_t i=0; i<nentries;i++) {

   //Long loop...
   myHist->Fill(z);
}


Received on Tue Sep 27 2011 - 07:40:03 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 27 2011 - 11:50:01 CEST