Hi rooters,
I’m having a serious issue and I’ve been scratching my head for quite a while - so before I lose all my hair here’s my problem.
I have a code that looks like
TCanvas c1;
c1.divide(numbins,1);
j[numbins+1]={1, blah blah…}
TH1D temp[numbins];
for(int i =0; i<numbins; i++){
c1->cd(i+1);
temp[i]=*(h->ProjectionY("",j[i],j[i+1],“o”); //h is some pointer to 2D histogram
temp[i]->draw();
}
If I don’t dereference ProjectionY step then when I refresh the canvas (either trying to save a copy or maximise the window) all that’s left is the same 1D histogram repeated in each of the pads… and if I do then that’s fine… except now I wish to set the x ranges of temp[i] to say 5sigma… and then temp[i]->GetXaxis()->SetRange(-5sigma, 5*sigma) except doing so only rescales the axis and not the data! Probably because it’s no-longer a pointer… and the data is set where it is - no?
But I’m seriously stuck as to what to do…
Cheers.
Mike