English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Calibration: TABC.h Source File
Uranie / Calibration  v4.11.0
/* @license-end */
TABC.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2024 CEA/DES
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or any
7 // later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // TABC
19 // $Id$
20 // $Author$
21 // $Date$
22 // $Revision 1.2 $
23 // $State$
25 
35 #ifndef TABC_H
36 #define TABC_H
37 
39 #include "TTree.h"
40 #include "TMatrixD.h"
41 #include "TRandom3.h"
42 #include "TMath.h"
43 
44 // Uranie
45 #include "TCalibration.h"
46 #include "TDataServer.h"
47 
48 namespace URANIE
49 {
50 namespace Calibration
51 {
52 
54 {
55 public :
56  vector<double> _values;
57  URANIE::DataServer::TDataServer *_tdsPosterior;
58 
59 protected:
60 
61  double _threshold;
62  Int_t _kPosterior;
63  Int_t _kEval;
64 
65  TRandom3 *_rand;
66 
67  Bool_t _boolEpsilon;
68  Double_t _Epsilon;
69 
70 
72 public :
73 
74  //---------------------------------------------
78 
85  TABC(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run, int ns = 100, Option_t *option = "");
86 
95  TABC(URANIE::DataServer::TDataServer *tds, void (*fcn)(Double_t*,Double_t*), const char *varexpinput, const char *varexpoutput, int ns = 100, Option_t *option = "");
96 
105  TABC(URANIE::DataServer::TDataServer *tds, const char *fcn, const char *varexpinput, const char *varexpoutput, int ns = 100, Option_t *option = "");
106 
113  TABC(URANIE::DataServer::TDataServer *tds, URANIE::Launcher::TCode *fcode, int ns = 1, Option_t *option = "");
114 
116  virtual ~TABC();
118 
119  //---------------------------------------------
136  virtual void setDistance(const char *distName, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *reference, const char *weight="");
137 
146  virtual void setDistance(URANIE::Calibration::TDistanceLikelihoodFunction *distFunc, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *reference, const char *weight="");
147 
148 
150  void initABC();
151 
153 
154  //---------------------------------------------
159  //---------------------------------------------
162  void setUpABC();
163 // void evalABC();
164  void computeABC(int nEval);
165  void computeABCscore(Double_t newEpsilon);
166 
167  void posteriorToPar();
168 
173  void checktdsParContent();
174 
176  //---------------------------------------------
183  void setGaussianNoise(const char *stdname);
184 
186  void setPercentile(Double_t eps)
187  {
188  try
189  {
190  if ((eps>1.0) || (eps<0.0))
191  {
192  throw URANIE::Exceptions::UErrorExceptions(__FILE__, __LINE__,
193  Form( "TABC::setPercentile: the percentile must be set between 0 and 1: however it is fix at %4.2f ! ", eps));
194  }
195  }
196  catch (URANIE::Exceptions::UErrorExceptions& ue)
197  {
198  ue.printMessage();
199  throw ue;
200  }
201 
202  _boolEpsilon = true;
203  _Epsilon = eps;
204  }
205 
207  URANIE::DataServer::TDataServer *getTdsPosterior()
208  {
209  return _tdsPosterior;
210  }
212  double getThreshold()
213  {
214  try
215  {
216  if (_threshold==12345678.9)
217  {
218  throw URANIE::Exceptions::UErrorExceptions(__FILE__, __LINE__,
219  "TABC::getThreshold: the threshold is not yet computed");
220  }
221  }
222  catch (URANIE::Exceptions::UErrorExceptions& ue)
223  {
224  ue.printMessage();
225  throw ue;
226  }
227  return _threshold;
228  }
229  int getNEval()
230  {
231  return _kEval;
232  }
233 
234 
235 
236 
238 
239  ClassDef(URANIE::Calibration::TABC, ID_CALIBRATION)
240 
241 };
242 
243 } // End of namespace ABC
244 } // End of namespace URANIE
245 #endif
Definition: TABC.cxx:45
Int_t _kEval
Definition: TABC.h:63
void setPercentile(Double_t eps)
Set the percentile.
Definition: TABC.h:186
Description of the class TDistanceLikelihoodFunction.
Definition: TDistanceLikelihoodFunction.h:67
TABC(URANIE::DataServer::TDataServer *tds, URANIE::Relauncher::TRun *run, int ns=100, Option_t *option="")
Default ABC constructor with the runner argument: it contains the assessor to be used.
Definition: TABC.cxx:55
Definition: TABC.h:53
void setGaussianNoise(const char *stdname)
Definition: TABC.cxx:304
double getThreshold()
Get the posterior tds.
Definition: TABC.h:212
URANIE::DataServer::TDataServer * getTdsPosterior()
Get the posterior tds.
Definition: TABC.h:207
TRandom3 * _rand
Definition: TABC.h:65
int getNEval()
Definition: TABC.h:229
Bool_t _boolEpsilon
Definition: TABC.h:67
virtual ~TABC()
Default destructor.
Definition: TABC.cxx:147
Double_t _Epsilon
Definition: TABC.h:68
void initABC()
Definition: TABC.cxx:180
URANIE::DataServer::TDataServer * _tdsPosterior
TDS containing posterior members for calibration.
Definition: TABC.h:57
Int_t _kPosterior
Definition: TABC.h:62
void checktdsParContent()
Definition: TABC.cxx:100
Interface of class URANIE::Calibration::TCalibration.
Description of the class TCalibration.
Definition: TCalibration.h:64
double _threshold
Definition: TABC.h:61
virtual void setDistance(const char *distName, URANIE::DataServer::TDataServer *tdsRef, const char *input, const char *reference, const char *weight="")
Set the distance function and some needed informations.
Definition: TABC.cxx:174
void setUpABC()
Definition: TABC.cxx:193
void posteriorToPar()
Definition: TABC.cxx:237
void computeABCscore(Double_t newEpsilon)
Definition: TABC.cxx:270
vector< double > _values
Definition: TABC.h:56
void computeABC(int nEval)
Definition: TABC.cxx:210