English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Launcher: TLauncherFunction.h Source File
Uranie / Launcher  v4.10.0
/* @license-end */
TLauncherFunction.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 
41 #ifndef ULAUNCHERFUNCTION_H
42 #define ULAUNCHERFUNCTION_H
43 
44 #include <iostream>
45 using std::cout;
46 using std::endl;
47 
48 //ROOT
49 #include "Rtypes.h"
50 #include "TNamed.h"
51 #include "TMethodCall.h"
52 
53 // Uranie
54 #include "Launcher.h"
55 #include "TDataServer.h"
56 
57 namespace URANIE
58 {
59 namespace Launcher
60 {
61 class TLauncherFunction: public TNamed
62 {
63 private:
64  TMethodCall *_fMethodCall;
65  void (*_fMethod)(Double_t *gin, Double_t *f);
66  TString _soutput;
67  Int_t _nOutput;
68  URANIE::DataServer::TDataServer *_tds;
70  Bool_t _blog;
72  URANIE::DataServer::TDSNtupleD *_internal;
73 public:
74  //---------------------------------------------
78  TLauncherFunction(URANIE::DataServer::TDataServer *tds, const char* functionanme,
80  TString sinput = "", TString soutput = "");
81 #ifdef ROOT5
82  TLauncherFunction(URANIE::DataServer::TDataServer *tds, void *fcn,
84  TString sinput = "", TString soutput = "");
85 #else
86  TLauncherFunction(URANIE::DataServer::TDataServer *tds, void (*fcn)(Double_t*,Double_t*),
88  TString sinput, TString soutput);
89 #endif
90  virtual ~TLauncherFunction();
93 
94  //---------------------------------------------
98  void setNOutput(Int_t n);
100 
102 
106  void setDrawProgressBar(Bool_t bbool = kTRUE)
107  {
108  _bdrawProgressBar = bbool;
109  }
110 
112 
116  {
117  return _bdrawProgressBar;
118  }
119 
121 
122  //---------------------------------------------
126  virtual void run(TString sinput = "", TString soutput = "",
128  Option_t *option = "");
130 
131  void delOutputAttributes();
132 
133  //---------------------------------------------
137  void setLog()
138  {
139  _blog = kTRUE;
140  }
141  void unsetLog()
142  {
143  _blog = kFALSE;
144  }
145  void changeLog()
146  {
147  _blog = _blog ? kFALSE : kTRUE;
148  }
149  Bool_t getLog()
150  {
151  return _blog;
152  }
153  virtual void printLog(Option_t *option = "");
155 
156  ClassDef(URANIE::Launcher::TLauncherFunction, ID_LAUNCHER)
157  //Classe de
158 };
159 
160 } // Fin du namespace Launcher
161 } // Fin du namespace URANIE
162 
163 #endif
Definition: TCluster.h:66
Bool_t _blog
Boolean to edit the log.
Definition: TLauncherFunction.h:70
Int_t _nOutput
The dimension of the output vector.
Definition: TLauncherFunction.h:67
virtual ~TLauncherFunction()
Default destructor.
Bool_t getDrawProgressBar()
Get the "draw progress bar" flag.
Definition: TLauncherFunction.h:115
Bool_t getLog()
Definition: TLauncherFunction.h:149
Execute an analytical function on a dataserver.
Definition: TLauncherFunction.h:61
TList * _listOfInputAttributes
List of the input branches.
Definition: TLauncherFunction.h:69
virtual void run(TString sinput="", TString soutput="", Option_t *option="")
Runs phase of the code.
virtual void printLog(Option_t *option="")
TString _soutput
Name of the output attributes.
Definition: TLauncherFunction.h:66
void changeLog()
Definition: TLauncherFunction.h:145
TMethodCall * _fMethodCall
Pointer to MethodCall in case of interpreted function.
Definition: TLauncherFunction.h:64
void unsetLog()
Definition: TLauncherFunction.h:141
void setDrawProgressBar(Bool_t bbool=kTRUE)
Set the "draw progress bar" flag.
Definition: TLauncherFunction.h:106
URANIE::DataServer::TDataServer * _tds
Pointer to the DataServer.
Definition: TLauncherFunction.h:68
URANIE::DataServer::TDSNtupleD * _internal
Definition: TLauncherFunction.h:72
TLauncherFunction(URANIE::DataServer::TDataServer *tds, const char *functionanme, TString sinput="", TString soutput="")
Constructor by a TDataServer, the name of the function and a list of inputs (optional). User MUST specify that functionanme IS a TString by forecasting it so as to use the fiest constructor.
void setNOutput(Int_t n)
Sets the number of output.
Bool_t _bdrawProgressBar
Boolean to know if the progress bar has to be drawn.
Definition: TLauncherFunction.h:71
void(* _fMethod)(Double_t *gin, Double_t *f)
Definition: TLauncherFunction.h:65
void setLog()
Definition: TLauncherFunction.h:137