Hi Root users,
In my attempt to tabulate the number of entries versus Ntuple variable value, i wrote the following code, which is err.
could any one suggest, what is wrong with this code.
Sincerely,
Navneet
{
gROOT->Reset();
filename ="gamma_5.000_3.5_0_20_5_90_10000_ntp.root";
TFile *r = new TFile(filename);
TTree *Tree = (TTree*)r->Get("t1");
Tree.Draw("Trig_Bits>>hist");
Int_t numBins =hist->GetNbinsX();
Double_t binContent[100];
Int_t bin[100];
printf("%s\n\n",filename);
printf("Bin: Trig_Bits: Events\n");
for(int i =0; i<numBins;i++)
{
bin[i] =hist->GetXaxis()->FindBin(i);
binContent[i]=hist->GetBinContent(bin[i]);
printf(" %d \t %f\n "bin[i],binContent[i]);
}
}
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:52 MET