ndmspc  v1.2.0-0.1.rc3
NParameters.h
1 #ifndef Ndmspc_NParameters_H
2 #define Ndmspc_NParameters_H
3 #include <TH1D.h>
4 
5 namespace Ndmspc {
6 
13 class NParameters : public TNamed {
14  public:
15  NParameters();
16  NParameters(std::vector<std::string> paramNames, const char * name = "parameters",
17  const char * title = "Parameters");
18  virtual ~NParameters();
19 
25  virtual void Print(Option_t * option = "") const override;
26 
35  bool SetParameter(int bin, Double_t value, Double_t error = 0.);
36 
45  bool SetParameter(const char * parName, Double_t value, Double_t error = 0.);
46 
53  Double_t GetParameter(int bin) const;
54 
61  Double_t GetParameter(const char * parName) const;
62 
69  Double_t GetParameterError(int bin) const;
70 
77  Double_t GetParameterError(const char * parName) const;
78 
84  TH1D * GetHisto() const { return fHisto; }
85 
86  std::vector<std::string> GetNames() const { return fNames; }
87 
88  private:
89  TH1D * fHisto{nullptr};
90  std::vector<std::string> fNames{};
91 
93  ClassDefOverride(NParameters, 2);
95 };
96 } // namespace Ndmspc
97 #endif
NParameters object.
Definition: NParameters.h:13
std::vector< std::string > fNames
Names of parameters.
Definition: NParameters.h:90
Double_t GetParameter(int bin) const
Get the value of a parameter by bin index.
Definition: NParameters.cxx:83
Double_t GetParameterError(int bin) const
Get the error of a parameter by bin index.
virtual ~NParameters()
Definition: NParameters.cxx:39
TH1D * GetHisto() const
Returns the associated histogram.
Definition: NParameters.h:84
TH1D * fHisto
Histogram with parameters.
Definition: NParameters.h:89
bool SetParameter(int bin, Double_t value, Double_t error=0.)
Set the value and error of a parameter by bin index.
Definition: NParameters.cxx:55
virtual void Print(Option_t *option="") const override
Print the parameters.
Definition: NParameters.cxx:47