simple-tof-analysis
 All Classes Namespaces Functions Variables Groups Pages
TSFitResults.h
1 /*
2  * TSFitResults.h
3  *
4  * Created on: Aug 22, 2014
5  * Author: Silvestro di Luise
6  * Silvestro.Di.Luise@cern.ch
7  *
8  */
9 
10 #ifndef TSFITRESULTS_H_
11 #define TSFITRESULTS_H_
12 
13 #include <vector>
14 #include <utility>
15 #include <map>
16 
17 #include <TString.h>
18 #include <TList.h>
19 
20 #include <TGraph.h>
21 #include <TH1F.h>
22 #include <TH2F.h>
23 #include <TTree.h>
24 
25 #include <TVectorD.h>
26 #include <TMatrixD.h>
27 
28 #include "TSArgList.h"
29 #include "TSParamList.h"
30 
31 
32 #include <TString.h>
33 
34 #include "TSNamed.h"
35 #include "MessageMgr.h"
36 
37 #include "TSMinimizer.h"
38 
39 
40 
41 /*
42  *
43  */
44 
45 class TSFitResults: public TSNamed {
46 
47 
48 public:
49 
50  TSFitResults();
51  TSFitResults(TString name, TString title, TString tag="");
52  virtual ~TSFitResults();
53 
54  void ClearContourGraphs();
55 
56  int GetIteration() const {return fIteration;}
57  int GetNumOfCalls() const {return fNumOfCalls;}
58  int GetNumOfPars() const {return fNumOfPars;}
59  int GetNumOfFreePars() const {return fNumOfFreePars;}
60  double GetMinValue() const {return fMinValue;}
61  int GetStatusCode() const {return fStatusCode;}
62  TString GetTag() const {return fTag;}
63  float GetCPUTime() const {return fCPUTime;}
64  float GetRealTime() const {return fRealTime;}
65 
66  TList* GetListOfHistos() {return &hList;}
67  TObject* GetHisto(TString tag) const;
68 
69  bool HasTag() const {return fHasTag;}
70 
71  void ImportMinimizationResults(const TSMinimizer &);
72 
73  void Init();
74 
75  void SetCPUTime(float t) {fCPUTime=t;}
76  void SetIteration(int i) {fIteration=i;}
77  void SetListOfTrueParams(const TSParamList &);
78  void SetListOfInputParams(const TSParamList &);
79  void SetListOfFitParams(const TSParamList &);
80 
81  void SetRealTime(float t) {fRealTime=t;}
82  void SetTag(TString);
83 
84  void WriteHistos();
85 
86 private:
87 
88  TString fTag;
89  bool fHasTag;
90  int fNumOfCalls;
91  int fNumOfPars;
92  int fNumOfFreePars;
93  double fMinValue;
94  int fStatusCode;
95  int fIteration;
96  float fCPUTime;
97  float fRealTime;
98 
99  TSParamList fInputParamList;
100  TSParamList fTrueParamList;
101  TSParamList fFitParamList;
102 
103 
104  //
105  // Vectors/Matrices
106  //
107  TMatrixD fCovMatrix;
108  TMatrixD fCorrMatrix;
109  TMatrixD fHesseMatrix;
110 
111  TVectorD fGCC;
112  TVectorD fTrueValues;
113  TVectorD fFitValues;
114  TVectorD fErrors;
115  TVectorD fErrorFrac;
116  TVectorD fResid;
117  TVectorD fPull;
118  TVectorD fErrLow;
119  TVectorD fErrUp;
120 
121  //
122  // Histograms
123  //
124 
125  TList hList;
126 
127  TH2F hCovMatrix;
128  TH2F hCorrMatrix;
129  TH2F hHesseMatrix;
130 
131  TH1F hGCC;
132  TH1F hError;
133  TH1F hErrLow;
134  TH1F hErrUp;
135  TH1F hErrorFrac;
136  TH1F hLimitLow;
137  TH1F hLimitUp;
138 
139  TH1F hTrueVal;
140  TH1F hInputVal;
141  TH1F hFitVal;
142  TH1F hResid;
143  TH1F hPull;
144 
145  TString hBaseName;
146  TString kCovMatrix;
147  TString kCorrMatrix;
148  TString kHesseMatrix;
149 
150  TString kGCC;
151  TString kError;
152  TString kErrLow;
153  TString kErrUp;
154  TString kErrorFrac;
155  TString kLimitLow;
156  TString kLimitUp;
157 
158  TString kTrueValue;
159  TString kInputValue;
160  TString kFitValue;
161  TString kResid;
162  TString kPull;
163 
164  //
165  //
166 
167  std::map<std::pair<TString,TString>, TGraph* > fContourGraphList;
168  std::vector< std::pair<TString,TString> > fContourParamPairs;
169 
170  std::map<TString, TGraph* > fScanGraphList;
171 
172  void fBuildHistos();
173  void fFillPulls();
174  void fImportHisto1D(TH1F* h, TH1F* hnew);
175  void fImportHisto2D(TH2F* h, TH2F* hnew);
176 
177 
178  TTree *fHistoryTree;
179 };
180 
181 #endif /* TSFITRESULTS_H_ */
Definition: TSMinimizer.h:56
Definition: TSParamList.h:29
Definition: TSFitResults.h:45
Definition: TSNamed.h:38