1 |
sixie |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// $Id: TH3DAsymErr.h,v 1.3 2009/10/21 15:04:06 sixie Exp $
|
3 |
|
|
//
|
4 |
|
|
// TH3DAsymErr
|
5 |
|
|
//
|
6 |
|
|
// Histogram that stores separate asymmetric statistical and systematic errors. It is
|
7 |
|
|
// derived from TH3D.
|
8 |
|
|
//
|
9 |
|
|
// Authors: S.Xie
|
10 |
|
|
//--------------------------------------------------------------------------------------------------
|
11 |
|
|
|
12 |
|
|
#ifndef MITCOMMON_DATAFORMATS_HIST3DASYMERROR_H
|
13 |
|
|
#define MITCOMMON_DATAFORMATS_HIST3DASYMERROR_H
|
14 |
|
|
|
15 |
|
|
#include <TH3D.h>
|
16 |
|
|
#include "TH2DAsymErr.h"
|
17 |
|
|
|
18 |
|
|
namespace mithep
|
19 |
|
|
{
|
20 |
|
|
class TH3DAsymErr : public TH3D
|
21 |
|
|
{
|
22 |
|
|
public:
|
23 |
|
|
|
24 |
|
|
TH3DAsymErr() {}
|
25 |
|
|
TH3DAsymErr(const char *name, const char *title,
|
26 |
|
|
Int_t nbinsx, Double_t xlow, Double_t xup,
|
27 |
|
|
Int_t nbinsy, Double_t ylow, Double_t yup,
|
28 |
|
|
Int_t nbinsz, Double_t zlow, Double_t zup);
|
29 |
|
|
TH3DAsymErr(const TH3D &h3d);
|
30 |
|
|
~TH3DAsymErr() {}
|
31 |
|
|
|
32 |
|
|
using TH3D::GetBinContent;
|
33 |
|
|
Double_t GetError(Double_t x, Double_t y, Double_t z, TH2DAsymErr::EErrType t);
|
34 |
|
|
Double_t GetBinError(Int_t b, Int_t c, Int_t d, TH2DAsymErr::EErrType t);
|
35 |
|
|
Double_t GetStatErrorLow(Double_t x, Double_t y, Double_t z);
|
36 |
|
|
Double_t GetBinStatErrorLow(Int_t b, Int_t c, Int_t d);
|
37 |
|
|
Double_t GetStatErrorHigh(Double_t x, Double_t y, Double_t z);
|
38 |
|
|
Double_t GetBinStatErrorHigh(Int_t b, Int_t c, Int_t d);
|
39 |
|
|
Double_t GetSysErrorLow(Double_t x, Double_t y, Double_t z);
|
40 |
|
|
Double_t GetBinSysErrorLow(Int_t b, Int_t c, Int_t d);
|
41 |
|
|
Double_t GetSysErrorHigh(Double_t x, Double_t y, Double_t z);
|
42 |
|
|
Double_t GetBinSysErrorHigh(Int_t b, Int_t c, Int_t d);
|
43 |
|
|
using TH3D::SetBinContent;
|
44 |
|
|
void SetBinContent(Int_t binx, Int_t biny, Int_t binz, Double_t value,
|
45 |
|
|
Double_t statErrorLow, Double_t statErrorHigh,
|
46 |
|
|
Double_t sysErrorLow, Double_t sysErrorHigh);
|
47 |
|
|
using TH3D::SetBinError;
|
48 |
|
|
void SetBinError(Int_t binx, Int_t biny, Int_t binz,
|
49 |
|
|
Double_t statErrorLow, Double_t statErrorHigh,
|
50 |
|
|
Double_t sysErrorLow, Double_t sysErrorHigh);
|
51 |
|
|
|
52 |
|
|
protected:
|
53 |
|
|
|
54 |
|
|
TArrayD fStatErrorLow; //array to store statistical low errors
|
55 |
|
|
TArrayD fStatErrorHigh; //array to store statistical high errors
|
56 |
|
|
TArrayD fSysErrorLow; //array to store systematic low errors
|
57 |
|
|
TArrayD fSysErrorHigh; //array to store systematic high errors
|
58 |
|
|
|
59 |
|
|
ClassDef(TH3DAsymErr, 1) // Histogram for storage of seperate asymmetric errors
|
60 |
|
|
};
|
61 |
|
|
}
|
62 |
|
|
|
63 |
|
|
//--------------------------------------------------------------------------------------------------
|
64 |
|
|
inline Double_t mithep::TH3DAsymErr::GetStatErrorLow(Double_t x, Double_t y, Double_t z)
|
65 |
|
|
{
|
66 |
|
|
// Get Upper Statistical Uncertainty
|
67 |
|
|
return GetError(x,y,z,TH2DAsymErr::kStatErrLow);
|
68 |
|
|
}
|
69 |
|
|
|
70 |
|
|
//--------------------------------------------------------------------------------------------------
|
71 |
|
|
inline Double_t mithep::TH3DAsymErr::GetStatErrorHigh(Double_t x, Double_t y, Double_t z)
|
72 |
|
|
{
|
73 |
|
|
// Get Upper Statistical Uncertainty
|
74 |
|
|
return GetError(x,y,z,TH2DAsymErr::kStatErrHigh);
|
75 |
|
|
}
|
76 |
|
|
|
77 |
|
|
//--------------------------------------------------------------------------------------------------
|
78 |
|
|
inline Double_t mithep::TH3DAsymErr::GetBinStatErrorLow(Int_t b, Int_t c, Int_t d)
|
79 |
|
|
{
|
80 |
|
|
// Get Upper Statistical Uncertainty
|
81 |
|
|
return GetBinError(b,c,d,TH2DAsymErr::kStatErrLow);
|
82 |
|
|
}
|
83 |
|
|
|
84 |
|
|
//--------------------------------------------------------------------------------------------------
|
85 |
|
|
inline Double_t mithep::TH3DAsymErr::GetBinStatErrorHigh(Int_t b, Int_t c, Int_t d)
|
86 |
|
|
{
|
87 |
|
|
// Get Upper Statistical Uncertainty
|
88 |
|
|
return GetBinError(b,c,d,TH2DAsymErr::kStatErrHigh);
|
89 |
|
|
}
|
90 |
|
|
|
91 |
|
|
//--------------------------------------------------------------------------------------------------
|
92 |
|
|
inline Double_t mithep::TH3DAsymErr::GetSysErrorLow(Double_t x, Double_t y, Double_t z)
|
93 |
|
|
{
|
94 |
|
|
// Get Upper Sysistical Uncertainty
|
95 |
|
|
return GetError(x,y,z,TH2DAsymErr::kSysErrLow);
|
96 |
|
|
}
|
97 |
|
|
|
98 |
|
|
//--------------------------------------------------------------------------------------------------
|
99 |
|
|
inline Double_t mithep::TH3DAsymErr::GetSysErrorHigh(Double_t x, Double_t y, Double_t z)
|
100 |
|
|
{
|
101 |
|
|
// Get Upper Sysistical Uncertainty
|
102 |
|
|
return GetError(x,y,z,TH2DAsymErr::kSysErrHigh);
|
103 |
|
|
}
|
104 |
|
|
|
105 |
|
|
//--------------------------------------------------------------------------------------------------
|
106 |
|
|
inline Double_t mithep::TH3DAsymErr::GetBinSysErrorLow(Int_t b, Int_t c, Int_t d)
|
107 |
|
|
{
|
108 |
|
|
// Get Upper Sysistical Uncertainty
|
109 |
|
|
return GetBinError(b,c,d,TH2DAsymErr::kSysErrLow);
|
110 |
|
|
}
|
111 |
|
|
|
112 |
|
|
//--------------------------------------------------------------------------------------------------
|
113 |
|
|
inline Double_t mithep::TH3DAsymErr::GetBinSysErrorHigh(Int_t b, Int_t c, Int_t d)
|
114 |
|
|
{
|
115 |
|
|
// Get Upper Sysistical Uncertainty
|
116 |
|
|
return GetBinError(b,c,d,TH2DAsymErr::kSysErrHigh);
|
117 |
|
|
}
|
118 |
|
|
|
119 |
|
|
#endif
|