Stats from TTree->Draw

Hi,

I have this code running under root enviroment:

Archive->Draw("(10^gv_offset*1300^gv_slope)",“pmt_name==840&&gv_1e6>500&&gv_1e6<2100&&alpha<40&&alpha>25&&darkrate_25<10000”);
Double_t mean1300 = htemp->GetMean();

But I can’t compile it because it says that htemp doesn’t exist, so I did this:

TCanvas *c1 = new TCanvas(“c1”,“c1”,1);
gStyle->SetOptStat(1010);
TH1F h1 = new TH1F(“h1”,“Stability”,100,2e5,2e6);
h1->SetMinimum(0);
h1->SetMaximum(100);
h1->Draw();
Archive->Draw("(10^gv_offset
1300^gv_slope)",“pmt_name==840&&gv_1e6>500&&gv_1e6<2100&&alpha<40&&alpha>25&&darkrate_25<10000”,“sames”);
Double_t mean1300 = h1->GetMean();

But It didn’t work because mean1300 =0. So, I guess it get the mean for h1, and not for the histogram drawn in the second Draw command.

How do I pass all the htemp stats to h1? or How can I get the htemp stats after compiling?

Thanks in advance.

DoArchive->Draw("(10^gv_offset*1300^gv_slope)>>h1","pmt_name==840&&gv_1e6>500&&gv_1e6<2100&&alpha<40&&alpha>25&&darkrate_25<10000","sames");

Cheers,
Philippe.