English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Sampler: TSampler.h Source File
Uranie / Sampler v4.9.0
/* @license-end */
TSampler.h
Go to the documentation of this file.
1
2// 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
33#ifndef TSampler_H
34#define TSampler_H
35
36// Writes log
37#include <iostream>
38
40#include "Rtypes.h"
41#include "TNamed.h"
42#include "TString.h"
43
44// Uranie
45#include "TDataServer.h"
46#include "TDSNtupleD.h"
47#include "UExceptions.h"
48#include "Sampler.h"
49
89using std::cout;
90using std::endl;
91
92namespace URANIE
93{
94namespace Sampler
95{
96class TSampler: public TNamed
97{
98
99 // Attributes
100public:
101 Int_t _nS;
102 Int_t _nX;
103 URANIE::DataServer::TDSNtupleD* _ntsample;
104 TString _sMethod;
105 Bool_t _blog;
107 URANIE::DataServer::TDataServer *_tds;
109
110 // Operations
111public:
112 //---------------------------------------------
116
117 TSampler(URANIE::DataServer::TDataServer *tds, Option_t *option,
118 Int_t nCalcul);
120 virtual ~TSampler();
122
123 //---------------------------------------------
127
131 Int_t GetID()
132 {
133 return ID_SAMPLER;
134 }
136 void setMethodName(TString str)
137 {
138 _sMethod = str;
139 }
142 {
143 return _sMethod;
144 }
146
149 virtual URANIE::DataServer::TDataServer *getTDS()
150 {
151 return _tds;
152 }
153
155 void parseOption(Option_t * option);
157
158 //---------------------------------------------
162
163 virtual void generateSample(Option_t *option = "") = 0;
165
166 //---------------------------------------------
170
173 virtual void createTuple();
175 URANIE::DataServer::TDSNtupleD * getTuple()
176 {
177 return _ntsample;
178 }
180 virtual void fillOtherAttributes();
182
183 //---------------------------------------------
187 void setLog()
188 {
189 _blog = kTRUE;
190 }
191 void unsetLog()
192 {
193 _blog = kFALSE;
194 }
196 {
197 _blog = _blog ? kFALSE : kTRUE;
198 }
199 Bool_t getLog()
200 {
201 return _blog;
202 }
203 virtual void printLog(Option_t *option = "");
205
206 ClassDef(URANIE::Sampler::TSampler, ID_SAMPLER)
207};
208
209} // Fin du namespace Sampler
210} // Fin du namespace URANIE
211#endif
212// fin du fichier $RCSfile$.
Abstraite class for sampling methods
Definition TSampler.h:97
Bool_t getLog()
Definition TSampler.h:199
void parseOption(Option_t *option)
Parse the option.
TString _sMethod
The title of the sampler method.
Definition TSampler.h:104
Int_t _nS
The size of the sample.
Definition TSampler.h:101
void setLog()
Definition TSampler.h:187
Int_t _nX
The size of attributes to sample.
Definition TSampler.h:102
Int_t GetID()
Returns the ID of the class.
Definition TSampler.h:131
Bool_t _blog
Log Printing.
Definition TSampler.h:105
TList * _lstOfAttributesToSample
The list of Stochastic Attributes to sample.
Definition TSampler.h:108
URANIE::DataServer::TDataServer * _tds
Pointer to a TDS.
Definition TSampler.h:107
void unsetLog()
Definition TSampler.h:191
TString getMethodName()
Gets the method name.
Definition TSampler.h:141
virtual void printLog(Option_t *option="")
virtual void createTuple()
Creates the TDSNtupleD of data with only the TStochasticAttributes.
virtual void createListOfAttributes()
Creates the List of attributes to simulate.
URANIE::DataServer::TDSNtupleD * getTuple()
Returns the TDSNtupleD of data.
Definition TSampler.h:175
URANIE::DataServer::TDSNtupleD * _ntsample
the tntuple of data
Definition TSampler.h:103
virtual void fillOtherAttributes()
Fills the TDSNtupleD of data with other TFormulaAttributes.
virtual ~TSampler()
Default destructor.
Bool_t _bupdateFile
Update the back up file when generating the attributeformula if there is some.
Definition TSampler.h:106
TSampler(URANIE::DataServer::TDataServer *tds, Option_t *option, Int_t nCalcul)
Constructor with a TDataServer, the options and the size of the sample.
void setMethodName(TString str)
Sets the method name in a global variable.
Definition TSampler.h:136
virtual void generateSample(Option_t *option="")=0
Generates the Sample.
virtual URANIE::DataServer::TDataServer * getTDS()
Return the TDS filling by the sampling algorithm.
Definition TSampler.h:149
void changeLog()
Definition TSampler.h:195
Definition TAMHCopula.h:60