[ROOT] how to copy a histogram from 1 root file to another?

From: Ivan Glushkov (glushkov@mail.desy.de)
Date: Wed Oct 20 2004 - 15:51:58 MEST


Hello,

So, what I want to do is to take some histogram, saved in a root file, 
and use it in my program, and save it in the new output file from my 
program.  Looks easy.  Here is my code:

int main(int argc, char* argv[])
{
TFile *flMC_file = new TFile("mc.root"); //the file in which I already 
have my histogram (h1dNN) stored
TFile* file = TFile::Open("data.root", "RECREATE");  // my output file
TH1D* h1dMC_NN = (TH1D*)flMC_file->Get("h1dNN");
....
file->Write();
file->Close();

And the histogram is not in the file (but all other histograms created 
later are there)

Do you have an idea what is the problem?

      Cheers, Ivan



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET