Creating Ntuple File from your Root Analysis

One uses the TNtuple class to create the ntuple, and can create it in any of the histogram definition member functions of RootTreeAnalysis

eg in ReconCalHistDefine() one could have the ntuple definition:

TNtuple* cTuple = new TNtuple("cTuple","Ntuple for CAL Threshold Studies",
"run:event:eDepMC:eDepCal:mcFX:mcFY:mcFZ");

in this example, an ntuple named cTuple is created with 7 columns - run, event, etc.

As for the RootTreeAnalysis histograms, one has to get the pointer to the ntuple, so in the analysis part of your code, fill all the ntuple columns at the same time:

((TNtuple*)GetObjectPtr("cTuple"))->Fill(reconRunNum,reconEventId,eTotCal,c->

    getEnergySum(),mcTermX,mcTermY,mcTermZ);

The ntuple is contained in the default histogram file, so when you write that out, you'll get the ntuple along with it.

In Root CINT analysis, you can examine your ntuple as in:

TFile* f = new TFile("myHistos.root");

cTuple->Draw("eDepCal");


R.Dubois Last Modified: 2004-08-04 15:40:16 -0700