MakeClass()

From: Monika Sharma <monika_at_rcf.rhic.bnl.gov>
Date: Mon, 05 Feb 2007 10:54:18 +0530

Hi Rooters,

I am trying to use MakeClass function to read a .root file. Following is a typical example of what I am doing :



void analysis()
{

  TFile *f = new TFile("Event_transport.root");   TTree *v = (TTree*)f->Get("VW");
  f->ls();

  v->MakeClass("something");
}


This generates a .C and a .h file, which works fine for me. But now my aim is to increase statistics. Therefore I have two rootfiles each of ~2 GB size, as a result I cannot merge them any further.

I wanted to ask is there anyway that I can still use MakeClass function to read these rootfiles together which would generate one .C and .h file so that I have double the statistics.

I tried doing



void analysis()
{
 

  for(Int_t nFiles=0; nFiles<2; nFiles++)     {

      char fname[150];
      sprintf(fname,"filename_%d.root",nFiles);
      cout<<endl;
      printf(fname,"filename_%d.root",nFiles);
      TFile *file = new TFile(fname,"r");
      TTree *P = (TTree*)file->Get("VW");
      file->ls();
     }

    P->MakeClass("something");
}

But the above method generates .C and .h files taking the last rootfile as the input.

Thanks in advance.
Monika Received on Mon Feb 05 2007 - 06:25:13 CET

This archive was generated by hypermail 2.2.0 : Mon Feb 05 2007 - 11:50:01 CET