English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Launcher: TCode.h Source File
Uranie / Launcher v4.9.0
/* @license-end */
TCode.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/>.
17
34#ifndef TCODE_H
35#define TCODE_H
36
37// URANIE
38#include "TAttribute.h"
39#include "TDataServer.h"
40
41#include "TInputFile.h"
42#include "TOutputFile.h"
43
44namespace URANIE {
45namespace Launcher {
46class TCode: public TNamed {
47public:
48 //---------------------------------------------
61 TCode(const TString &name, const TString &title);
67 TCode(URANIE::DataServer::TDataServer *tds, TString scmd);
68
74
78 virtual ~TCode();
80
81 //---------------------------------------------
90 TInputFile * getInputFile(TString sfile);
96 TInputFile * getInputFile(Int_t nfile);
108
114 TOutputFile * getOutputFile(TString sfile);
115
117
118 //---------------------------------------------
126 void setWorkingDirectory(TString sPathName = "");
127
133 return _sWorkingDirectory;
134 };
139 void setReferenceDirectory(TString str) {
141 };
148 };
153 void setCommand(TString str) {
154 _sCommand = str;
155 };
160 TString getCommand() {
161 return _sCommand;
162 };
168 return (Int_t)(_outputFiles.size());
169 };
180 Int_t getNOutputAttributes(Int_t nfile);
186 return (Int_t)(_listOfInputFiles->GetEntries());
187 };
198 Int_t getNInputAttributes(Int_t nfile);
205 URANIE::DataServer::TAttribute * getInputAttribute(Int_t nfile, Int_t natt);
212 URANIE::DataServer::TAttribute * getAttribute(Int_t nfile, Int_t natt);
227 URANIE::DataServer::TDataServer * getTDataServer() {
228 return _tds;
229 };
234 void setTDataServer(URANIE::DataServer::TDataServer *atds) {
235 _tds = atds;
236 // UpdateInputList();
237 };
239
240 //---------------------------------------------
272 virtual void runTest(Option_t *option = "");
277 virtual void initFileType(Option_t *option = "");
282 virtual void init(Option_t *option = "");
290 virtual void preTraitment(Int_t n, Double_t *val, Int_t *index = NULL, Option_t *option = "");
297 virtual void preTraitment(Int_t n, vector<URANIE::DataServer::UEntry*> *input, Option_t *option = "");
302 virtual void run(Option_t *option = "");
311 virtual Bool_t postTraitment(Int_t &nout, Double_t *dvalout, Option_t *option = "", TList *lstOut = NULL);
318 virtual Bool_t postTraitment(vector<URANIE::DataServer::UEntry*> *out, Option_t *option);
323 virtual void terminate(Option_t *option = "");
325
326 //---------------------------------------------
330
337 void createDirectory(TString sPathName, TString sDirectoryName = "");
338
343 virtual void copyFiles(Option_t *option = "");
344
355 virtual void cleanOutputFiles(Option_t *option = "");
357
358 //---------------------------------------------
373 void addInputFile(TString str);
381
382 //---------------------------------------------
389 void setLog() {
390 _blog = kTRUE;
391 }
395 void unsetLog() {
396 _blog = kFALSE;
397 }
401 void changeLog() {
402 _blog = _blog ? kFALSE : kTRUE;
403 }
408 Bool_t getLog() {
409 return _blog;
410 }
415 virtual void printLog(Option_t *option = "");
417
418 ClassDef(URANIE::Launcher::TCode, ID_LAUNCHER)
419
420 //---------------------------------------------
425 protected:
426 vector<TOutputFile *> _outputFiles;
430 TString _sCommand;
432 Int_t _nOfInput;
435 Bool_t _blog;
436 URANIE::DataServer::TDataServer *_tds;
438};
439
440} // End of namespace Launcher
441} // End of namespace URANIE
442
443#endif
444// End of File
Interface of the class URANIE::Launcher::TInputFile.
Interface of the class URANIE::Launcher::TOutputFile.
Description of the class TCode.
Definition TCode.h:46
virtual void printLog(Option_t *option="")
Print the log of the object/class.
Int_t _nCurrentSimulation
The Current number of simulation.
Definition TCode.h:431
virtual void init(Option_t *option="")
Init phase of the code.
protected TList * _listOfInputFiles
< vector of output files
Definition TCode.h:427
virtual ~TCode()
Default destructor.
virtual Bool_t postTraitment(vector< URANIE::DataServer::UEntry * > *out, Option_t *option)
Post-traitment phase of the code that deals with vectors/strings.
void unsetLog()
Force to desable the log.
Definition TCode.h:395
Int_t getNInputAttributes()
Get the number of input attributes.
virtual void cleanOutputFiles(Option_t *option="")
Cleans the output files.
void addOutputFile(TOutputFile *ifile)
Add a TOutputFile file The TOutputFile file contains the output attributes of teh study.
Int_t getNOutputAttributes(Int_t nfile)
Get the number of output attributes in the output file given by his index.
virtual void copyFiles(Option_t *option="")
copyFiles
virtual void preTraitment(Int_t n, Double_t *val, Int_t *index=NULL, Option_t *option="")
Pre-traitment phase of the code.
Int_t getNOutputFiles()
Get the number of output files.
Definition TCode.h:167
URANIE::DataServer::TAttribute * getInputAttribute(Int_t nfile, Int_t natt)
Get an attribute of an input file.
void setWorkingDirectory(TString sPathName="")
Set the working directory.
Int_t _nOfInputToSubstitute
The size of the vector _nIndexOfInputToSubstitute.
Definition TCode.h:433
void createDirectory(TString sPathName, TString sDirectoryName="")
create the directory sPathName+"/"+sDirectoryName
virtual Bool_t postTraitment(Int_t &nout, Double_t *dvalout, Option_t *option="", TList *lstOut=NULL)
Post-traitment phase of the code.
TOutputFile * getOutputFile(TString sfile)
getOutputFile
Int_t getNOutputAttributes()
Get the number of output attributes.
Int_t _nOfInput
The size of the vector listOfInput scanning input files.
Definition TCode.h:432
TCode(const TString &name, const TString &title)
constructor with a name and a title
void setCommand(TString str)
Set the code command.
Definition TCode.h:153
URANIE::DataServer::TDataServer * _tds
Definition TCode.h:436
TString getReferenceDirectory()
Get the reference directory where inputs no change are located.
Definition TCode.h:146
TString getInputVarNames()
Get the names of the input variables separated by ":".
TInputFile * getInputFile(TString sfile)
Get the input file file from his name.
virtual void preTraitment(Int_t n, vector< URANIE::DataServer::UEntry * > *input, Option_t *option="")
Pre-traitment phase of the code that deals with vectors/strings.
URANIE::DataServer::TAttribute * getAttribute(Int_t nfile, Int_t natt)
Get an attribute of an output file.
TInputFile * getInputFile(Int_t nfile)
Get the input file from his index.
void setLog()
Force the log.
Definition TCode.h:389
Int_t getNInputAttributes(Int_t nfile)
Get the number of input attributes in the input file given by his index.
virtual void runTest(Option_t *option="")
Run a test for the code.
virtual void terminate(Option_t *option="")
Terminate phase of the code.
TCode()
Default constructor.
TString getWorkingDirectory()
Get the working directory.
Definition TCode.h:132
Bool_t getLog()
Get the status of the log.
Definition TCode.h:408
TString _sReferenceDirectory
The Working directory.
Definition TCode.h:429
TInputFile * getLastInputFile()
Get the last input file.
TString _sWorkingDirectory
The Working directory.
Definition TCode.h:428
URANIE::DataServer::TDataServer * getTDataServer()
Get the pointer to the TDS.
Definition TCode.h:227
void changeLog()
Swith the status of the log.
Definition TCode.h:401
TString getOutputVarNames()
Get the names of the output variables separated by ":".
TCode(URANIE::DataServer::TDataServer *tds, TString scmd)
Constructor from TDataServer and Command as string.
virtual void initFileType(Option_t *option="")
Init file typing.
TCode(URANIE::Launcher::TCode &mycode)
Copy constructor.
TOutputFile * getOutputFile(Int_t nfile)
Get the output file from his index.
Int_t * _nIndexOfInputToSubstitute
The vector of Index to Substitute.
Definition TCode.h:434
virtual void run(Option_t *option="")
Run the code.
Bool_t _blog
Boolean for edit the log.
Definition TCode.h:435
TString getCommand()
Get the code command.
Definition TCode.h:160
void resetCurrentSimulation()
resetCurrentSimulation
TString _sCommand
The Command of the code.
Definition TCode.h:430
Int_t getNInputFiles()
Get the number of input files.
Definition TCode.h:185
void setReferenceDirectory(TString str)
Set the reference directory where inputs no change are located.
Definition TCode.h:139
void addInputFile(TInputFile *ifile)
Add a TInputFile file.
void addInputFile(TString str)
Add an input file as a TString This input file does not contain input attributes. It is a mandatory i...
void setTDataServer(URANIE::DataServer::TDataServer *atds)
Set the pointer to the TDS.
Definition TCode.h:234
Abstract class for an input file of a code.
Definition TInputFile.h:53
Description of the class TOutputFile.
Definition TOutputFile.h:85
Definition TCluster.h:67