simple-tof-analysis
 All Classes Namespaces Functions Variables Groups Pages
TSNuiParam.h
1 /*
2  * TSNuiParam.h
3  *
4  * Created on: Sep 25, 2014
5  * Author: Silvestro di Luise
6  * Silvestro.Di.Luise@cern.ch
7  *
8  */
9 
10 #ifndef TSNUIPARAM_H_
11 #define TSNUIPARAM_H_
12 
13 #include <TRandom.h>
14 #include <TMath.h>
15 #include <TF1.h>
16 
17 #include "TSVariable.h"
18 
19 #include "TSParameter.h"
20 
21 #include "TSCategory.h"
22 #include "TSCategoryCard.h"
23 #include "TSPhaseSpaceVolume.h"
24 
25 
26 /*
27  *
28  */
29 
30 class TSNuiParam: public TSParameter {
31 
32 public:
33 
34  TSNuiParam();
35  TSNuiParam(TString name, TString label, TString title, TString unit="");
36  virtual ~TSNuiParam();
37 
38  void SetCategoryCard(const TSCategoryCard &);
39  void AddControlVar(TSVariable &, double min, double max);
40 
41  int CompareCategory(const TSCategoryCard &, int opt=0);
42 
43  const TSCategoryCard& GetCategoryCard() const {return fCard;}
44 
45  TSVariable* GetControlVariable(int) const;
46  int GetControlVarIdx(const TSVariable &) const;
47 
48  int GetNumOfControlVars() const {return fNumOfControlVars;}
49  TString GetControlVarsLabel() const;
50 
51  double GetPriorValue() const {return fPriorVal;}
52  double GetPriorError() const {return fPriorError;}
53  double GetPriorErrorLow() const {return fPriorErrLow;}
54  double GetPriorErrorUp() const {return fPriorErrUp;}
55 
56  double GetRandom();
57 
58  bool HasCategoryCard() const {return fHasCategory;}
59  bool HasControlVars() const {return fHasControlVars;}
60  bool HasControlVariable(const TSVariable &) const;
61  bool HasPrior() const {return fHasPrior;}
62  bool HasErrorPrior() const {return fHasErrorPrior;}
63  bool HasAsymErrorPrior() const {return fHasAsymErrPrior;}
64  void Init();
65 
66  void Print();
67 
68  void Randomize();
69 
70  void Restore();
71  void SetPriorValue(double);
72  void SetPriorError(double);
73  void SetPriorValueAndError(double v,double e) {SetPriorValue(v);SetPriorError(e);}
74  void SetPriorAsymErrors(double,double);
75 
76 private:
77 
78  bool fHasPrior;
79  bool fHasErrorPrior;
80  bool fHasAsymErrPrior;
81  double fPriorVal;
82  double fPriorError;
83  double fPriorErrLow;
84  double fPriorErrUp;
85 
86  // temp solution, create a
87  //structure for multi var and ranges
88  TSVariable *fVar;
89  TSVariable *fVarLoc;
90 
91  std::vector<TSVariable*> fVarList;
92  std::vector<TSVariable*> fVarLocList;
93 
94 
95  int fNumOfControlVars;
96  bool fHasControlVars;
97 
98  double fVarMin;
99  double fVarMax;
100 
101  TSCategoryCard fCard;
102 
103  bool fHasCategory;
104 
105  TRandom fRand;
106 
107  TF1 fFunc;
108 
109 };
110 
111 #endif /* TSNUIPARAM_H_ */
Definition: TSCategoryCard.h:27
Definition: TSVariable.h:55
Definition: TSNuiParam.h:30
Definition: TSParameter.h:39