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 
31 class TSFunc1DGaussPdf: public TSFunction1D {
32 
33 public:
34  TSFunc1DGaussPdf(TString name, TString title
35  ,const TSVariable &var_x, const TSParameter &mean, const TSParameter &sigma);
36 
37 
38  virtual ~TSFunc1DGaussPdf();
39 
40  virtual double Evaluate() const;
41 
42 
43  void SetSigmaSpread(double v) const {fsigma_spread=v;}
44  virtual double GetSigmaSpread() const {cout<<"gatspr:"<<this<<endl;return fsigma_spread;}
45 
46  //for direct access
47  double GetMean() const {return GetMeanX(); }
48  double GetMeanX() const { return fMean ? fMean->GetValue(): 0; }
49  double GetSigma() const { return GetSigmaX(); }
50  double GetSigmaX() const {
51  return fSigma ? TMath::Sqrt( TMath::Power(fSigma->GetValue(),2)+TMath::Power(fsigma_spread,2) ): 0;
52  }
53 
54  const TSParameter *GetParamMean() const {return fMean;}
55  const TSParameter *GetParamMeanX() const {return fMean;}
56  const TSParameter *GetParamSigma() const {return fSigma;}
57  const TSParameter *GetParamSigmaX() const {return fSigma;}
58 
59 protected:
60 
61  const TSParameter *fMean;
62  const TSParameter *fSigma;
63 
64 
65  mutable double fsigma_spread;
66 
67 };
68 
69 #endif /* TSFUNC1DGAUSSPDF_H_ */
Definition: TSFunc1DGaussPdf.h:31
Definition: TSVariable.h:55
Definition: TSFunction1D.h:43
Definition: TSParameter.h:39