ROOT Version: 6.06.01
Platform: Ubuntu 16.04
Hi, I recently changed the my root file’s hist’s Y axis() threshold from 20.0->12.0 with help of the two links below.
Following the answers above with the code,
your_histogram->GetXaxis()->IsVariableBinSize() (bool) true (*(TArrayD*)NUM_LooseID_DEN_genTracks_eta_pt->GetYaxis()->GetXbins()) = 12.;
When I look at the Second bin’s lower Edge with GetBinLowEdge(), It shows expected behavior with RunGH_SF_ID.root showing 20, Run_SF_ID.root showing 12.
root  NUM_LooseID_DEN_genTracks_eta_pt->GetYaxis()->GetBinLowEdge(1) (Double_t) 12.0000
However, my code tries to get content of bin using this mechanism.
Int_t tmpbinx = your_histogram->GetXaxis()->FindBin( mueta ); Int_t tmpbiny = your_histogram->GetYaxis()->FindBin( mupt ); Int_t tmpbin = your_histogram->GetBin( tmpbinx, tmpbiny ); tmpweight = your_histogram-->GetBinContent(tmpbin);}
However, when I use the FindBin() function at 12.0 for Run_SF_ID.root, it gives me the value of 0 instead of 1, which is the supposed value for my hist w/ the new threshold.
root  NUM_LooseID_DEN_genTracks_eta_pt->GetYaxis()->FindBin(12) (Int_t) 0
It returns the value of 1, only when it is above 20, which was the original threshold.
What is happening and how can I fix the bug?