#include <TH1DStat.h>
Public Member Functions | |
| TH1DStat (TH1D *t) | |
| ~TH1DStat () | |
| void | Fill (double v, double w, double s) |
| TH1D * | GetTH1D (int withstats=1) |
| void | Dump () |
Private Attributes | |
| TH1D * | th1d |
| TArrayD | td |
| TArrayD | pw |
| bool | wasErrorAdjusted |
|
|
Definition at line 4 of file TH1DStat.cxx. References pw, td, th1d, and wasErrorAdjusted. 00005 {
00006 th1d = t;
00007
00008 td.Set(t->GetXaxis()->GetNbins()+2);
00009 td.Reset();
00010
00011 pw.Set(t->GetXaxis()->GetNbins()+2);
00012 pw.Reset();
00013
00014 wasErrorAdjusted=false;
00015 }
|
|
|
Definition at line 13 of file TH1DStat.h. 00013 {};
|
|
|
Definition at line 36 of file TH1DStat.cxx. 00037 {
00038 for(int i=0;i<td.GetSize();i++)
00039 {
00040 printf("%d %d %f\n",i,(int)td.At(i),pw.At(i));
00041 }
00042
00043 }
|
|
||||||||||||||||
|
Definition at line 18 of file TH1DStat.cxx. References pw, td, th1d, and wasErrorAdjusted. 00019 {
00020 int b = th1d->Fill(v,w);
00021
00022 if(b<0)
00023 {
00024 b=0; //underflow
00025 if(v>th1d->GetXaxis()->GetXmax())
00026 b=pw.GetSize()-1; //overflow
00027 }
00028
00029
00030 td[b]++;
00031 pw[b]+=s;
00032 wasErrorAdjusted=false;
00033
00034 }
|
|
|
Definition at line 45 of file TH1DStat.cxx. References pw, td, th1d, and wasErrorAdjusted. 00046 {
00047 if(!withstats || wasErrorAdjusted)return th1d;
00048
00049 //put in statistical errors!
00050 for(int i=0;i<td.GetSize();i++)
00051 {
00052 th1d->SetBinError(i,sqrt(td.At(i))*pw.At(i));
00053 }
00054 wasErrorAdjusted=true;
00055 return th1d;
00056 }
|
|
|
Definition at line 23 of file TH1DStat.h. Referenced by Dump(), Fill(), GetTH1D(), and TH1DStat(). |
|
|
Definition at line 22 of file TH1DStat.h. Referenced by Dump(), Fill(), GetTH1D(), and TH1DStat(). |
|
|
Definition at line 20 of file TH1DStat.h. Referenced by Fill(), GetTH1D(), and TH1DStat(). |
|
|
Definition at line 25 of file TH1DStat.h. Referenced by Fill(), GetTH1D(), and TH1DStat(). |
1.3.9.1