Hi John,
Try calling Sumw2() on the histogram you create before calling
SetBinError.
Regards,
Suyong Choi
-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch] On Behalf Of Dr. John Krane
Sent: Thursday, July 24, 2003 11:42 AM
To: roottalk@cern.ch
Subject: [ROOT] SetBinError giving me trouble
Hi,
I'm trying to use my own histogram division function and the errors keep
coming out as 1.0. That's using Linux version 3.05/06 of ROOT, and
ACLiC-compiled code. When in trace mode, interpreted mode, I'm getting
the most interesting crash, which I include below (no crash when
compiled, only error=1.0 for every histo bin).
I have taken steps to ensure there were no invisible or special
characters in my code: I did a "cat" of my file to the screen and
copy-pasted it into a fresh emacs window for that file. I also simply
deleted the line and retyped it.
Note below that "cerr <<" of my variables shows valid numbers. Line 37
is *supposed* to read:
(cc!=0.0 && bc!=0.0) ? a->SetBinError(i,err) :
a->SetBinError(i,0.0);
...yet ROOT seems not to think I have a valid expression. Any advice?
I hope I'm just doing something dumb...but I can't spot it!
- John
28 hbd::dhiste(TH1F *a, TH1F *b, TH1F *c){
29 Double_t bc,cc,be,err=0.0;
30 for (Int_t i=1; i< b->GetNbinsX(); i++){
31 bc=b->GetBinContent(i);
32 cc=c->GetBinContent(i);
33 be=b->GetBinError(i);
34 if (cc!=0.0 && bc!=0.0) err=(be/bc)*(bc/cc);
35 if (cc!=0.0) a->SetBinContent(i,bc/cc);
36 cerr<<"i "<<i<<" err "<<err<<endl;i 1 err 0
# _iostream
3 operator<<(std::ostream& ostr,std::G__CINT_ENDL& i)
4 {return(std::endl(ostr));}
}
# /data/analysis/003-fitting/./../001-raw_hist/histo_bin_def.h
37 (cc!=0.0 && bc!=0.0) ? a->SetBinError(i,Error: Can't call
TH1F::SetBinError(i in current scope
FILE:/data/analysis/003-fitting/./../001-raw_hist/histo_bin_def.h
LINE:37
Possible candidates are...
filename line:size busy function type and name (in TH1F)
filename line:size busy function type and name (in TH1)
(compiled) 0:0 0 public: virtual void SetBinError(Int_t
bin,Stat_t error);
(compiled) 0:0 0 public: virtual void SetBinError(Int_t
binx,Int_t biny,Stat_t error);
(compiled) 0:0 0 public: virtual void SetBinError(Int_t
binx,Int_t biny,Int_t binz,Stat_t error);
filename line:size busy function type and name (in TNamed)
filename line:size busy function type and name (in TObject)
filename line:size busy function type and name (in TAttLine)
filename line:size busy function type and name (in TAttFill)
filename line:size busy function type and name (in TAttMarker)
filename line:size busy function type and name (in TArrayF)
filename line:size busy function type and name (in TArray)
Error: Symbol X? is not defined in current scope
FILE:/data/analysis/003-fitting/./../001-raw_hist/histo_bin_def.h
LINE:37
Error: Symbol iX is not defined in current scope
FILE:/data/analysis/003-fitting/./../001-raw_hist/histo_bin_def.h
LINE:37
Error: Symbol is not defined in current scope
FILE:/data/analysis/003-fitting/./../001-raw_hist/histo_bin_def.h
LINE:37
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:13 MET