Hey! Greetings of the day,
I do not know if the question is silly, but the same thing works for other trees, in the same root file. Actually, I have a root file in which some trees are saved, one of the trees is E200, when I try to get StdDev and Mean from histograms for some branches, all I get is 0, while the same code works fine for other trees, I can’t figure out what’s wrong.
Obviously, I’ve checked in TBrowser that the histogram for all the branches shows non-zero standard deviation and mean values. Please help…! Thank you in advance…!
TTree *t; TH1D *histo; rootFile->GetObject("E200",t); t->Draw("branch_name>>branch_get"); histo=(TH1D*)gPad->GetPrimitive("branch_get"); std_dev=(histo->GetStdDev())/2; mean=histo->GetMean(); cout<<std_dev<<mean<<endl;
ROOT Version: 6.16
Platform: Ubuntu 18.04.4