Hi all,
I’m trying to write a program that will add a series of ntuples from several root files to a tree. However, fChain->GetEntriesFast() returns what I think is kBigNumber, 1234567890, although definitely isn’t right number of entries. I’d like to get the right number of entries so I can monitor my progress as I loop through fChain.
I initiate the tree with the following code:
TChain* theChain = new TChain("ntp1",""); //this chain will hold the ntp1 ntuples
theChain->Add("rootfiles/*Moderato.root"); //grabs the ntp1 file from file.root and adds it to the chain
//theChain->Add("rootfiles/B0ToPi0Pi0-Run1-OnPeak-R18b-v04-1Moderato.root"); //This makes things much faster, for testing
fChain = theChain;
TTree* mytree = fChain;
Init(mytree);
This is the init function:
[code]void myclass::Init(TTree *tree)
{
// The Init() function is called when the selector needs to initialize
// a new tree or chain. Typically here the branch addresses of the tree
// will be set. It is normaly not necessary to make changes to the
// generated code, but the routine can be extended by the user if needed.
// Init() will be called many times when running with PROOF.
// Set branch addresses
if (tree == 0) return;
fChain = tree;
fCurrent = -1;
fChain->SetMakeClass(1);
fChain->SetBranchAddress(“runNumber”,&runNumber);
fChain->SetBranchAddress(“platform”,&platform);
fChain->SetBranchAddress(“partition”,&partition);
//and so on…
[/code]
Any ideas?
Edit: my code executes correctly, but I cannot track my progress. Well, there is a segmentation fault that pops up from time to time, but I think I have a problem with one of my arrays somewhere…