English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / DataServer: TStochAttribut.h Source File
Uranie / DataServer  v4.10.0
/* @license-end */
TStochAttribut.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
6 // by 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/>.
18 // $Id$
19 // $Author$
20 // $Date$
21 // $Revision$
22 // $State$
24 
36 #ifndef TSTOCHASTICATTRIBUTE_H
37 #define TSTOCHASTICATTRIBUTE_H
38 
39 #include "TString.h"
40 #include <iostream>
41 
42 // Uranie
43 #include "DataServer.h"
44 #include "TAttribute.h"
45 #include "UExceptions.h"
46 
47 namespace URANIE
48 {
49 namespace DataServer
50 {
51 
66 #define THEO_DEF -999.0123456789
67 
69 {
70 public:
71 
73  enum ELawType
74  {
97  };
98 
101  {
103  };
104 
105 protected:
106 
108  Double_t _dtheoreticalMean;
110  Double_t _dtheoreticalMode;
111  Double_t _pmin;
112  Double_t _pmax;
114 
115 public:
116  // -----------------------------------------------------------------------
117  // Constructors
118  // -----------------------------------------------------------------------
121 
123 
126  TStochasticAttribute(TString str);
127 
129 
135  TStochasticAttribute(TString str, ELawType value);
136 
138 
146  TStochasticAttribute(TString str, ELawType value, Double_t min,
147  Double_t max);
148 
150 
159  TStochasticAttribute(TAttribute *object, ELawType value);
160 
162  virtual ~TStochasticAttribute();
163 
164  // -----------------------------------------------------------------------
165  // Getter and setter methods
166  // -----------------------------------------------------------------------
167 
172 
181  virtual void computeTheoreticalInformation() = 0;
182 
184 
190  virtual Double_t getPDF(Double_t x) = 0;
191  double getPDFforTF1(double *x) { return getPDF(x[0]); }
192 
194 
203  virtual Double_t getCDF(Double_t x) = 0;
204  double getCDFforTF1(double *x) { return getCDF(x[0]); }
205 
207 
222  virtual Double_t getInvCDF(Double_t p) = 0;
223  double getInvCDFforTF1(double *x) { return getInvCDF(x[0]); }
224 
226  virtual Double_t getTheoreticalMean();
227 
229  virtual Double_t getTheoreticalStdDev();
230 
232  virtual Double_t getTheoreticalMode();
233 
235 
236  //---------------------------------------------
240 
246  void setLawType(ELawType value)
247  {
248  _lawType = value;
249  }
250 
252 
271  void setLawType(TString name);
272 
274  //const int getLawType() const { return _lawType;}
276  {
277  return _lawType;
278  }
279 
281 
293  {
294  _nStochasticBasis = n;
295  }
296 
298 
308 
310 
335  {
336  return _nStochasticBasis;
337  }
339 
340  //---------------------------------------------
344  virtual Double_t getPMin()
346  {
347  return _pmin;
348  }
350  virtual Double_t getPMax()
351  {
352  return _pmax;
353  }
355 
356 
358  virtual void printLog();
359 
360  ClassDef(TStochasticAttribute, ID_DATASERVER)
361  //Definition of a stochastic variable
362 };
363 
370 {
371 
372  // Attributes
373 protected:
374 
375 public:
376  // -----------------------------------------------------------------------
377  // Constructors
378  // -----------------------------------------------------------------------
381 
383 
386  TInfiniteDistribution(TString str);
387 
389 
395  TInfiniteDistribution(TString str, ELawType value);
396 
398 
407  TInfiniteDistribution(TAttribute *object, ELawType value);
408 
410  virtual ~TInfiniteDistribution();
411 
412  // -----------------------------------------------------------------------
413  // Getter and setter methods
414  // -----------------------------------------------------------------------
415 
419 
433  virtual void setLowerBound(Double_t val);
434 
436 
449  virtual void setUpperBound(Double_t val);
450 
452 
466  virtual void setBounds(Double_t lower, Double_t upper);
468 
469  virtual void printLog();ClassDef(TInfiniteDistribution, ID_DATASERVER)
470  //Definition of an stochastic variable
471 };
472 } // Fin du namespace DataServer
473 } // Fin du namespace URANIE
474 
475 #endif
ROOT.
Definition: TAttribute.h:104
virtual Double_t getTheoreticalMode()
Returns the theoretical value of the mode.
EStochasticBasis getStochasticBasis() const
Returns the orthogonal polynomial which is used to represent the attribute.
Definition: TStochAttribut.h:334
virtual void setUpperBound(Double_t val)
Sets the upper bound of the attribute.
ELawType
The list of laws that a TStochasticAttribute can follow.
Definition: TStochAttribut.h:73
Double_t _pmax
The max value of cumulative density function.
Definition: TStochAttribut.h:112
Definition: TStochAttribut.h:68
virtual void setBounds(Double_t lower, Double_t upper)
Sets the lower and upper bounds of the attribute.
void setStochasticBasis(EStochasticBasis n)
Defines an orthogonal polynomial family to represent the stochastic attribute.
Definition: TStochAttribut.h:292
double getPDFforTF1(double *x)
Definition: TStochAttribut.h:191
Double_t _dtheoreticalMean
The theoretical mean.
Definition: TStochAttribut.h:108
virtual void computeTheoreticalInformation()=0
Computes the theoretical values of various statistical measures, like mean, standard deviation...
virtual void printLog()
Display information specific to this class.
Double_t _dtheoreticalMode
The theoretical mode.
Definition: TStochAttribut.h:110
double getInvCDFforTF1(double *x)
Definition: TStochAttribut.h:223
TStochasticAttribute()
Default Constructor.
virtual Double_t getInvCDF(Double_t p)=0
Returns the value corresponding to the cumulative density p.
void setLawType(ELawType value)
Sets the law type from an integer value.
Definition: TStochAttribut.h:246
virtual ~TInfiniteDistribution()
Default Destructor.
Definition: TStochAttribut.h:369
virtual Double_t getPMax()
Returns the maximum value of the cumulative distribution function.
Definition: TStochAttribut.h:350
TInfiniteDistribution()
Default Constructor.
virtual Double_t getPDF(Double_t x)=0
Returns the probability density for the value x.
virtual Double_t getTheoreticalMean()
Returns the theoretical value of the mean.
Double_t _dtheoreticalStdDev
The theoretical standard deviation.
Definition: TStochAttribut.h:109
ELawType _lawType
The law type ELawType.
Definition: TStochAttribut.h:107
EStochasticBasis _nStochasticBasis
The stochastic representation of an orthogonal basis.
Definition: TStochAttribut.h:113
virtual Double_t getTheoreticalStdDev()
Returns the theoretical value of the standard deviation.
Description of a variable (field).
Definition: TAttribute.h:136
double getCDFforTF1(double *x)
Definition: TStochAttribut.h:204
Double_t _pmin
The min value of cumulative density function.
Definition: TStochAttribut.h:111
int getLawType()
Returns the law type as an integer.
Definition: TStochAttribut.h:275
EStochasticBasis
The list of orthogonal polynomial families that can represent a given TStochasticAttribute.
Definition: TStochAttribut.h:100
virtual Double_t getPMin()
Returns the minimum value of the cumulative distribution function.
Definition: TStochAttribut.h:345
virtual Double_t getCDF(Double_t x)=0
Returns the cumulative distribution for the value x.
virtual void printLog()
Display information specific to this class.
Interface file for the class URANIE::DataServer::TAttribute.
virtual ~TStochasticAttribute()
Default Destructor.
void setDefaultStochasticBasis()
Sets the default orthogonal polynomial family representing the stochastic attribute.
virtual void setLowerBound(Double_t val)
Sets the lower bound of the attribute.