Hey all… I am trying to divide some histograms and I have created arrays. So, for the division I use this:
for(j=0; j<7; j++)
{
pt_mad_divs[j]=(TH1F*)pt_mad_hist[j+1]->Clone();
pt_mad_divs[j]->Reset();
pt_mad_divs[j]->Divide(pt_mad_hist[j+1], pt_mad_hist[0]);
pt_axi_divs[j]=(TH1F*)pt_axi_hist[j+1]->Clone();
pt_axi_divs[j]->Reset();
pt_axi_divs[j]->Divide(pt_axi_divs[j+1], pt_axi_divs[0]);
}
This code crashes!! It compiles but it crashes at the execution. If I use:
pt_mad_divs[0]=(TH1F*)pt_mad_hist[1]->Clone();
pt_mad_divs[0]->Reset();
pt_mad_divs[0]->Divide(pt_mad_hist[1], pt_mad_hist[0]);
pt_axi_divs[0]=(TH1F*)pt_axi_hist[1]->Clone();
pt_axi_divs[0]->Reset();
pt_axi_divs[0]->Divide(pt_axi_divs[1], pt_axi_divs[0]);
it works fine!!! But it doesn’t make sense!!! It isn’t different from the other above!
Please… any help about these errors??