Hello,
I have a root file That I access like so:
TFile *file_in1 = new TFile("input.root", "READ");
TNtuple *t1 = (TNtuple*)file_in1->Get("ntuple2");
float ntuple2[4] = { 0 };
t1->SetBranchAddress("x", &ntuple2[0]);
t1->SetBranchAddress("y", &ntuple2[1]);
t1->SetBranchAddress("t", &ntuple2[2]);
t1->SetBranchAddress("N", &ntuple2[3]);
int N_enteries_t1 = int(t1->GetEntries());
here is how does the root file look that I am reading:https://drive.google.com/folderview?id=0BzqCm2jza4M_cWtFeDQtcVEzdzQ&usp=sharing
I want to construct from this a new TH3 Histogram and fill it with data from the root file and I did that like this:( not sure if this is a right way though, correct me if it’s not)
TH3D *Kaon = new TH3D("kaon", "Kaon_test", 80, -0.5, 799.5, 12, -0.5, 127.5, 56, 12., 26.);
for (int i = 0; i < N_enteries_t1; i++)
{
t1->GetEntry();
Kaon->Fill(ntuple2[0], ntuple2[1],ntuple2[2]);
}
what I want is to divide this histogram by the number of bins N to get pdf/normalize it.
how can I get the number of bins of ntuple[3]?
and then how can I divide the histogram with that number?
Thanks.