[BLAST_ANAWARE] question about storing non-class values in a root file

From: Aaron Joseph Maschinot (ajmasch@MIT.EDU)
Date: Tue Sep 21 2004 - 17:28:49 EDT


in addition to storing a histogram in a root file, i would like to also
store the charge for the histogram also in the root file. the charge
would simply be a Float_t or Double_t. however, since neither or these
are explicitly root classes, they do not have a Write() function and thus
can't be written to file per norm:

{
  TH1F *hist;
  Float_t charge;

  f=new TFile("crap.root","recreate");

  hist->Write(); //good!
  charge->Write(); //hogwash! (that's the kentucky in me coming out :^) )

  f->Close();
}

does anyone know how to write Float_t's, Int_t's, etc. to root files? i'm
sure it's a simple answer that i'm just not thinking about...

aaron



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:31 EST