Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
ErrorCalc.h
1/*
2 * StdError.h
3 *
4 * Created on: 21 paź 2023
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#ifndef HAL_FEATURES_STD_STDERRORCALC_H_
10#define HAL_FEATURES_STD_STDERRORCALC_H_
11
12#include "Std.h"
13#include <TNamed.h>
14namespace Hal {
15 class ErrorCalc : public TNamed {
16 Double_t fMeasurement = {0};
17 Double_t fStatisticalUncert = {0};
18 std::vector<std::pair<TString, std::vector<std::pair<Double_t, Double_t>>>> fValues;
19 std::vector<std::pair<Double_t, Double_t>> GetAllUncerts(TString name) const;
20
21 public:
27 ErrorCalc(TString name = "", Double_t val = 0, Double_t err = 0);
32 void SetMeasuredVal(Double_t val) { fMeasurement = val; }
37 void SetStatError(Double_t val) { fStatisticalUncert = val; };
46 void AddSysError(TString name, Double_t value, Double_t uncert = -1);
52 Double_t GetStatError() const;
58 Double_t BarlowTest(Int_t prec = 4) const;
66 Double_t TotalSys(Int_t prec = 4) const;
72 static Double_t SumError(std::initializer_list<Double_t> errs);
73 virtual ~ErrorCalc() = default;
74 ClassDef(ErrorCalc, 0)
75 };
76
77} /* namespace Hal */
78
79#endif /* HAL_FEATURES_STD_STDERRORCALC_H_ */
void AddSysError(TString name, Double_t value, Double_t uncert=-1)
Definition ErrorCalc.cxx:73
Double_t GetStatError() const
Definition ErrorCalc.cxx:16
Double_t BarlowTest(Int_t prec=4) const
Definition ErrorCalc.cxx:18
void SetStatError(Double_t val)
Definition ErrorCalc.h:37
ErrorCalc(TString name="", Double_t val=0, Double_t err=0)
Definition ErrorCalc.cxx:59
Double_t TotalSys(Int_t prec=4) const
Definition ErrorCalc.cxx:92
void SetMeasuredVal(Double_t val)
Definition ErrorCalc.h:32
static Double_t SumError(std::initializer_list< Double_t > errs)