simple-tof-analysis
 All Classes Namespaces Functions Variables Groups Pages
TSNuiParamSet.h
1 /*
2  * TSNuiParamSet.h
3  *
4  * Created on: Sep 29, 2014
5  * Author: Silvestro di Luise
6  * Silvestro.Di.Luise@cern.ch
7  *
8  */
9 
10 #ifndef TSNUIPARAMSET_H_
11 #define TSNUIPARAMSET_H_
12 
13 #include <vector>
14 #include <map>
15 
16 #include <TObject.h>
17 #include <TH1F.h>
18 #include <TH2F.h>
19 
20 #include "TSNuiParam.h"
21 
22 #include "TSParamList.h"
23 #include "TSArgList.h"
24 
25 #include "TSRespFunc.h"
26 
27 /*
28  *
29  */
30 
31 class TSNuiParamSet;
32 
34 
35 
36 class TSNuiParamSet: public TSParamList {
37 
38 public:
39 
40  TSNuiParamSet();
41  virtual ~TSNuiParamSet();
42 
43  void AddResponseFunctionToPar(const TSRespFunc &, const TSNuiParam &);
44  void AddResponseFunctionToPar(const TSRespFunc &, int);
45 
46  void BuildCategoryCardHisto(int opt=0);
47 
48  double ComputeWeight(int opt=1);
49  double ComputeWeightFromPrior();
50 
51  bool HasParameter(const TSNuiParam &) const;
52 
53  bool HasResponseFunctions() const {return fHasRespFuncs;}
54 
55  TH2F& GetCategoryCardHisto() {return fCategCardHisto;}
56  TH1F& GetHistoOfParams(TString opt="");
57  TH1F& GetHistoOfPriors(TString opt="");
58 
59  TSRespFunc* GetParamRespFunc(const TSNuiParam &) const;
60  TSRespFunc* GetParamRespFunc(int) const;
61 
62  int GetParamIdx(const TSNuiParam &) const;
63 
64  double GetWeight() const {return fWeight;}
65 
66  void Init();
67 
68 //moved in TSArgList
69 // int LoopStart();
70 // int LoopNext();
71 // TObject* LoopAt();
72 
73  void Print() const;
74  void PrintDifferences(TSNuiParamSet &);
75  void PrintLong() const;
76  void PrintNameSeq() const;
77  void Randomize();
78  void Restore();
79 
80  void SetWeight(double w) {fWeight=w;}
81 
82 private:
83 
84  bool fHasRespFuncs;
85  mutable double fWeight;
86 
87  std::map<int,TSRespFunc*> fRespFuncList;
88  std::map<int,bool> fParHasRespFunc;//this not really needed
89 
90  TH1F fHistoParams;
91  TH1F fHistoPriors;
92 
93  TH2F fCategCardHisto;
94 
95  TObjLink *objLink;
96  bool fLoopStart;
97 
98 };
99 
100 
101 
102 
103 
104 #endif /* TSNUIPARAMSET_H_ */
Definition: TSRespFunc.h:28
Definition: TSParamList.h:29
void PrintLong() const
Definition: TSNuiParamSet.cc:598
Definition: TSNuiParam.h:30
Definition: TSNuiParamSet.h:36
double ComputeWeight(int opt=1)
Definition: TSNuiParamSet.cc:331
void BuildCategoryCardHisto(int opt=0)
Definition: TSNuiParamSet.cc:68