simple-tof-analysis
 All Classes Namespaces Functions Variables Groups Pages
TSFunc1DGaussPdf.h
1 /*
2  * TSFunc1DGaussPdf.h
3  *
4  * Created on: Aug 4, 2014
5  * Author: Silvestro di Luise
6  * Silvestro.Di.Luise@cern.ch
7  *
8  *
9  *
10  */
11 
12 #ifndef TSFUNC1DGAUSSPDF_H_
13 #define TSFUNC1DGAUSSPDF_H_
14 
15 #include <iostream>
16 
17 #include <TMath.h>
18 
19 
20 #include "TSFunction1D.h"
21 
22 
23 
24 using std::cout;
25 using std::endl;
26 /*
27  *
28  */
29 
30 
32 
33 public:
34  TSFunc1DGaussPdf(TString name, TString title
35  ,const TSVariable &var_x, const TSParameter &mean, const TSParameter &sigma);
36 
37 
38  TSFunc1DGaussPdf() {};
39  virtual ~TSFunc1DGaussPdf();
40 
41  virtual double Evaluate() const;
42 
43 
44  void SetSigmaSpread(double v) const {fsigma_spread=v;}
45  virtual double GetSigmaSpread() const {cout<<"gatspr:"<<this<<endl;return fsigma_spread;}
46 
47  //for direct access
48  double GetMean() const {return GetMeanX(); }
49  double GetMeanX() const { return fMean ? fMean->GetValue(): 0; }
50  double GetSigma() const { return GetSigmaX(); }
51  double GetSigmaX() const {
52  return fSigma ? TMath::Sqrt( TMath::Power(fSigma->GetValue(),2)+TMath::Power(fsigma_spread,2) ): 0;
53  }
54 
55  const TSParameter *GetParamMean() const {return fMean;}
56  const TSParameter *GetParamMeanX() const {return fMean;}
57  const TSParameter *GetParamSigma() const {return fSigma;}
58  const TSParameter *GetParamSigmaX() const {return fSigma;}
59 
60 protected:
61 
62  const TSParameter *fMean;
63  const TSParameter *fSigma;
64 
65 
66  mutable double fsigma_spread;
67 
68 };
69 
70 #endif /* TSFUNC1DGAUSSPDF_H_ */
Definition: TSFunc1DGaussPdf.h:31
Definition: TSVariable.h:55
Definition: TSFunction1D.h:43
Definition: TSParameter.h:39