English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / DataServer: TDataServer.h Source File
Uranie / DataServer v4.9.0
/* @license-end */
TDataServer.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
44#ifndef TDATASERVER_H
45#define TDATASERVER_H
46
47#ifndef ROOT_TCut
48#include "TCut.h"
49#endif
50#ifndef ROOT_TGraph
51#include "TGraph.h"
52#endif
53#ifndef ROOT_TMatrixD
54#include "TMatrixD.h"
55#endif
56#ifndef ROOT_TNtupleD
57#include "TNtupleD.h"
58#endif
59
60// Uranie
61#include "DataServer.h"
62#include "TDSNtupleD.h"
63#include "TAttribute.h"
64#include "TStochAttribut.h"
65#include "TDataSpecification.h"
66#include "TPatternsEventList.h"
67#include "UMessageLogger.h"
68
69#include <iostream>
70#include <fstream>
71#include <sstream>
72#include <map>
73
74using std::cout;
75using std::endl;
76using std::string;
77using std::map;
78using std::vector;
79using std::ios;
80
81namespace URANIE
82{
83namespace DataServer
84{
85class TDataServer: public TNamed
86{
87
88 // Attributes
89 public:
102
105
106 //---------------------------------------------
110
113 TDataServer(const char *name, const char* title);
117 virtual ~TDataServer();
119
120 //---------------------------------------------
155
164 Bool_t fileDataRead(const char* name, Bool_t bSave = kTRUE, Bool_t bDontAddAttribute = kFALSE, Option_t *option="");
165
166#ifdef WITH_JSONCPP
167 Bool_t fileDataReadJSon(const char* name, Bool_t bSave = kTRUE);
168#endif
169
171
180 Bool_t ntupleDataRead(const char* file, const char *tree, const char* svar =
181 "*", const char *cut = "");
183 /*
184 This method takes a tree and investigate its content to rebuild a TDS from it.
185 TDataSpecification and TDSNtupleD are rebuilt completly deleting all possible previous information
186 \param tt: the tree to be read
187 */
188 Bool_t loadTree(TTree* tt);
190
191 //---------------------------------------------
196
205 void exportData(const char *filename, const char *varexp = "*",
206 const char *select = "", Option_t *option = "");
207
209
217 void exportDataHeader(const char *filename, const char *varexp = "*",
218 const char *select = "", Option_t *option = "");
219
221
251 void exportDataNeMo(const char *filename, const char *varexpinput,
252 const char *varexpoutput, const char *select = "");
253
255
261 void exportDataContext(const char *filename, const char *varexp = "*",
262 const char *select = "");
263
264#ifdef WITH_JSONCPP
265 void exportDataJSon(const char *filename, const char *varexp = "*",
266 const char *select = "", Option_t *option = "");
267#endif
268
270
274 void saveTuple(Option_t* option);
276
277
278 //---------------------------------------------
287
289
294 static string checkAttributes(TDataServer *tds, string varexp, map<string, vector<int> > &mAttributeElements);
295
297
302 void addAttribute(TString name, Double_t dmin, Double_t dmax);
303
305
310 void addAttributeUsingData(TString name, double *arr, int size);
311
313
317 void addAttributeByNameTitle(TString name, TString title);
318
320
324 void addAttribute(const char *name);
325
327
338 void addAttribute(TString name, TString formula, TString title = "",TString unit = "", bool update=true);
339
341 void fillOthersAttributes(bool update=kFALSE);
342
345
347
352 void delAttribute(TString name);
353
355
386 void merge(TDataServer *tds, const char* varexpinput="*", bool bwithFriend=kFALSE);
388
416 void normalize(const char* varexp = "", const char* suffix = "_CR",
417 ENormalisation method = kCR, bool global=true);
418
420
421 //---------------------------------------------
434
440 void setSelect(TString str)
441 {
442 if( str.EqualTo(TString(_ccut.GetTitle())) )
443 return;
444 _ccut = TCut(str);
446 }
447
449 /*
450 The cut is tested and if it differs from the previous one (currently used) the quantiles and statistical caracteristic
451 of the attributes are cleared.
452 \param cut (TCut): A TCut to reject event
453 */
454 void setCut(TCut cut)
455 {
456 string thecut = "!("+string(cut.GetTitle())+")";
457 if( string(_ccut.GetTitle())==thecut )
458 return;
459 _ccut = !cut;
461 }
462
464 /*
465 The cut is tested and if it differs from the previous one (currently used) the quantiles and statistical caracteristic
466 of the attributes are cleared.
467 \param cut (TCut): A TCut to reject event
468 */
469 void setCut(const char * str)
470 {
471 string thecut = "!("+string(str)+")";
472 if( string(_ccut.GetTitle())==thecut )
473 return;
474 _ccut = !TCut(str);
476 }
477
479
484 void setCut(TString str)
485 {
486 string thecut = "!("+string(str)+")";
487 if( string(_ccut.GetTitle())==thecut )
488 return;
489 _ccut = !TCut(str);
491 }
492
495 {
496 if( string(_ccut.GetTitle())=="" )
497 return;
498 _ccut = "";
500 }
501
503 void clearCut()
504 {
505 clearSelect();
506 }
507
509 /*
510 Not to be calles by users
511 */
513 {
514 if ( gErrorIgnoreLevel < kWarning-1 )
515 (*_fLogger) << " Selection is changing ==> clearing the TAttribute computed statistics and quantiles" << Endl;
516 TList *listOfAtt = getListOfAttributes("*",false);
517 TIter next(listOfAtt);
518 TAttribute *att;
519 while ((att = (TAttribute*) next()))
520 att->clearVectors();
521
522 if(listOfAtt!=NULL)
523 delete listOfAtt;
524 }
525
527
530 void mix();
532
533
534 //---------------------------------------------
539
545 TMatrixD computeCAH(const char *varexp = "*", ECAHMethod CAHmethod = kWard,
546 const char *selection = "", Option_t *option = "");
547
549
558 void computeStatistic(const char *varexp = "*", const char *selection = "", Option_t *option = "");
559
561
570 TMatrixD computeCorrelationMatrix(const char *varexp = "*", const char *selection = "", Option_t *option = "");
572
581 void computeRank(const char *varexp = "*", Option_t *option = "");
582
584
596 void estimateQuantile(const char *attName, Int_t nProba, Double_t* proba,
597 Double_t* quantile, Double_t confidence = 0.5,
598 Option_t *option = "");
600
616 void estimateQuantile(const char *attName, Double_t proba,
617 Double_t &quantile, Double_t confidence = 0.5,
618 Option_t *option = "");
619
621
664 void computeQuantile(const char *attName, Double_t proba,
665 Double_t &quantile, Int_t type = 7);
666
668 double computeQuantile(const char *attName, Double_t proba, Int_t type = 7);
669
671
682 void computeQuantile(const char *attName, Int_t nProba, Double_t* proba,
683 Double_t* quantiles, Int_t type = 7);
684 //Add by MSA
686
710 void computeQuantileCV(TString yname, Double_t alpha, TString zname,
711 Double_t zapha, Double_t &quantile, Double_t & rho);
712
714
725 void internalQuantilesComputation(Int_t nData, Int_t nProba, Double_t* data,
726 Double_t* quantiles, Double_t* proba, Bool_t isSorted = kTRUE,
727 Int_t* index = 0, Int_t type = 7);
728
730
753 Int_t computeIndexQuantileWilks(Double_t alpha, Double_t beta, Int_t n);
754
756
776 Double_t computeInverseNormalCDF(Double_t p, Double_t mean = 0.0, Double_t stddev = 1.0);
777
779
780
781 //---------------------------------------------
786
793 Int_t scan(const char *varexp = "", const char *selection = "",
794 Option_t *option = "");
796
799 Int_t Scan(const char *varexp, const char *selection = "",
800 Option_t *option = "")
801 {
802 return scan(varexp, selection, option);
803 }
804
806 void checkCanvasCreation(Option_t *option="");
808
819 void draw(const char* varexp, const char* selection = "", Option_t* option = "", bool internalCall=kFALSE);
821
824 void Draw(const char* varexp, const char* selection = "", Option_t* option =
825 "")
826 {
827 draw(varexp, selection, option);
828 }
829
831
837 void draw(UInt_t nOrder, const char* selection = "", Option_t* option = "");
838
840 void drawHistogram(const char* sVar, const char* selection = "",
841 Option_t* option = "");
843 void drawIter(const char* sVar, const char* selection = "",
844 Option_t* option = "");
846
851 void drawECDF(const char* varexp, const char* selection = "",
852 Option_t* option = "");
853
857 void drawQQPlot(const char* varexp, const char* laws, int nq, Option_t* option = "");
858
862 void drawPPPlot(const char* varexp, const char* laws, int nq, Option_t* option = "");
863
865 void drawCDF(const char* varexp, const char* selection = "",
866 Option_t* option = "");
867
868 void drawBoxPlot(const char* varexp, const char* selection = "",
869 Option_t* option = "");
870
873 {
874 startViewer();
875 }
876
878
881 void drawTufte(const char* varexp, const char* selection = "",
882 Option_t* option = "");
884 void drawScatterplot(const char* varexp, const char* selection = "",
885 Option_t* option = "");
887
897 void drawProfile(const char* varexp, const char* selection = "",
898 Option_t* option = "");
900
905 void drawPairs(const char* varexp = "*", const char* selection = "",
906 Option_t* option = "");
908
913 void drawCopulogram(const char* varexp = "*", const char* selection = "",
914 Option_t* option = "");
916 /*
917 This graph is as \b TParallelCoordonate in ROOT but is called \b cobweb in the uncertainty community (book of Saltelli).
918 */
919 void drawCobWeb(const char* varexp, const char* selection = "",
920 Option_t* option = "");
922
923
924 //---------------------------------------------
929
931
934 void SetName(const char *name);
936 void checkName();
937
939
943 void setIterator(TString sname);
944
946
950 void setTuple(TDSNtupleD *ntd, bool newismain=true, const char* att="*")
951 {
952 _datatree = ((ntd==NULL) ? NULL : new TDSNtupleD(ntd, att, "", newismain));
953 }
955
959 void setTuple(TTree *ntd, bool newismain=true)
960 {
961 _datatree = ((ntd==NULL)? NULL :new TDSNtupleD(ntd,"*","",newismain));
962 }
963
965
966
967 //---------------------------------------------
971
973
978 TList * getListOfAttributes(const char* sListOfAttributes = "*", bool onlyAttribute=true);
979
981
987 string getStringListOfAttributes(bool onlyNumerical=true, bool onlyAttribute=true);
988
990
997 int getAttributeIndex(TAttribute * att, bool onlyAttribute=false) const;
998
1000
1007 int getAttributeIndex(TString name, bool onlyAttribute=false) const;
1008
1010
1014
1015
1017
1023 TAttribute *getAttribute(Int_t ind, bool onlyAttribute=kTRUE);
1024
1026
1031 Double_t getValue(TString attName, Int_t entry, Int_t ielement=-1);
1032
1034
1038 vector<double> getVector(TString attName, Int_t entry);
1040
1044 string getString(TString attName, Int_t entry);
1045
1047
1050 TMatrixD getMatrix(const char* varexp = "*", const char* selection = "",
1051 Option_t* option = "");
1052
1054
1058
1060 const char *getIteratorName()
1061 {
1062 return ((_biteratorNameChanged) ? _siteratorChangedName.Data() : Form("%s__n__iter__", GetName()) );
1063 }
1064
1065 void changeIteratorName(const char *name)
1066 {
1067 _siteratorChangedName=TString(name);
1069 }
1070
1077
1080 {
1081 return _norigin;
1082 }
1083
1085
1090 Int_t getNAttributes(bool onlyAttribute=true);
1091
1093
1097
1099
1103
1105 TCut getCut()
1106 {
1107 return _ccut;
1108 }
1109
1112 {
1113 return _dataSpecification;
1114 }
1115
1117
1120 TDSNtupleD *GetTuple(Option_t *option = "V")
1121 {
1122 return getTuple(option);
1123 }
1125
1128 TDSNtupleD *getTuple(Option_t *option = "V");
1129
1131
1132 //---------------------------------------------
1137
1149 void bootstrap(Int_t nsize = -1, Option_t *option = "");
1151
1152
1153 //---------------------------------------------
1157
1159 void createTuple(Option_t *option = "");
1160
1162
1184 void fillAttribute(TString name, TString formula = "", Bool_t update = kTRUE);
1185
1186
1188
1203 void fillConstantAttribute(TString name, UEntry *ConstUEntry);
1204
1206
1209 Bool_t isAttribute(TString name) const;
1210
1211
1214
1216
1220 Bool_t hasTuple()
1221 {
1222 return _datatree != NULL;
1223 }
1224
1225 void keepFinalTuple(bool val)
1226 {
1227 _bsaveTuple = val;
1228 }
1230
1231 //---------------------------------------------
1235 void setLog()
1236 {
1237 _blog = kTRUE;
1238 }
1240 {
1241 _blog = kFALSE;
1242 }
1244 {
1245 _blog = _blog ? kFALSE : kTRUE;
1246 }
1247 Bool_t getLog()
1248 {
1249 return _blog;
1250 }
1251 virtual void printLog(Option_t *option = "");
1252
1253 static TString getUranieVersion(){ return TString("Uranie v")+TString(URANIE_RELEASE);}
1254 static Int_t doBanner(){
1255 string bold_on, bold_off;
1256#ifndef WIN32
1257 bold_on = "\033[1m";
1258 bold_off = "\033[0m";
1259#endif
1260 cout << "\n" << bold_on << "--- Uranie v" << URANIE_RELEASE
1261 << " --- Developed with ROOT (" << gROOT->GetVersion() << ")" << bold_off << "\n"
1262 << " Copyright (C) 2013-2024 CEA/DES " << "\n"
1263 << " Contact: support-uranie@cea.fr " << "\n"
1264 << " Date: " << URANIE_RELEASE_DATE
1265 << "\n\n";
1266 return 0;
1267 }
1268
1269
1271
1272 static void findParametersLaw(TString soption, vector<double> &vec, bool blog);
1273
1274
1275 ClassDef(URANIE::DataServer::TDataServer, ID_DATASERVER)
1276
1277 private:
1278 TDataSpecification* _dataSpecification;
1280 TCanvas *_canvas;
1281 TTree* _friend;
1282 Bool_t _blog;
1286 TString _sdatafile;
1290 TCut _ccut;
1291
1292 void drawLegend(const char* varexp, const char* selection = "",
1293 const char * histname = "htemp");
1294
1296
1299 void drawQQorPPPlot(const char* varexp, const char* laws, int nq, Option_t* option );
1300
1302
1304
1305 URANIE::DataServer::UMessageLogger *_fLogger;
1306
1307 //---------------------------------------------
1312
1313 void drawCDFRaFu(const char* varexp, const char* selection = "",
1314 Option_t* option = "");
1315
1317
1318
1319};
1320
1321} // Fin du namespace DataServer
1322} // Fin du namespace URANIE
1323#endif
Interface file for the class URANIE::DataServer::TAttribute.
Interface of the class URANIE::DataServer::TDataSpecification.
Interface of the class URANIE::DataServer::TPatternsEventList.
Class of attributes following a probability density function.
Description of a variable (field).
Definition TAttribute.h:138
Definition TDSNtupleD.h:36
Description of the class TDataServer.
Definition TDataServer.h:86
EOrigin getOrigin()
Return the origin of the considered TDS.
Definition TDataServer.h:1079
Int_t getNAttributes(bool onlyAttribute=true)
Returns the number of attributes in the TDataServer.
void merge(TDataServer *tds, const char *varexpinput="*", bool bwithFriend=kFALSE)
Concatenates the variables of two dataservers.
void computeQuantileCV(TString yname, Double_t alpha, TString zname, Double_t zapha, Double_t &quantile, Double_t &rho)
Compute the quantile alpha by comtrol variate.
void drawProfile(const char *varexp, const char *selection="", Option_t *option="")
Draws Profile.
URANIE::DataServer::UMessageLogger * _fLogger
Message logger.
Definition TDataServer.h:1305
Bool_t _bQuantVectPrinted
print the message for the vector quantile calculation only once
Definition TDataServer.h:1283
const char * getIteratorName()
Returns the name of the iterator.
Definition TDataServer.h:1060
char * getArchiveFileName()
Returns the name of the archive file.
void drawTufte(const char *varexp, const char *selection="", Option_t *option="")
Draw 2D scatterplots "tufte".
void keepFinalTuple(bool val)
Definition TDataServer.h:1225
void exportDataContext(const char *filename, const char *varexp="*", const char *select="")
Export data in a tex file with a ConTex format.
TMatrixD getMatrix(const char *varexp="*", const char *selection="", Option_t *option="")
Returns the matrix of data.
TDataServer(const char *name, const char *title)
Default constructor with a name and a title.
void checkName()
Check wether the name exists already
void drawPairs(const char *varexp="*", const char *selection="", Option_t *option="")
draw the scatterplots for each possible pairs
EOrigin _norigin
The origin of the dataserver (ASCII File, TTree, SQL...)
Definition TDataServer.h:1301
Int_t computeIndexQuantileWilks(Double_t alpha, Double_t beta, Int_t n)
Computes the index of the quantile alpha with a confidence beta (Wilks method)
void changeIteratorName(const char *name)
Definition TDataServer.h:1065
void drawLegend(const char *varexp, const char *selection="", const char *histname="htemp")
Bool_t getLog()
Definition TDataServer.h:1247
void setCut(const char *str)
Specifies the criterion to exclude individuals.
Definition TDataServer.h:469
void exportDataHeader(const char *filename, const char *varexp="*", const char *select="", Option_t *option="")
Exports the data in a header file ( C / C++)
void clearCut()
Clears the rejection of patterns.
Definition TDataServer.h:503
void mix()
Mix the patterns.
void setSelect(TString str)
Specifies the criterion by a string to select individuals.
Definition TDataServer.h:440
void estimateQuantile(const char *attName, Double_t proba, Double_t &quantile, Double_t confidence=0.5, Option_t *option="")
Estimates quantiles of attribute "attName" with confidence level (Wilks method)
TTree * _friend
Tree added by friend method.
Definition TDataServer.h:1281
void drawPPPlot(const char *varexp, const char *laws, int nq, Option_t *option="")
double computeQuantile(const char *attName, Double_t proba, Int_t type=7)
Compute and return quantiles of the empirical distribution of an decimal attribute.
char * getDataTreeName()
Returns the name of the tree.
int getAttributeIndex(TAttribute *att, bool onlyAttribute=false) const
Returns the index of the attribute.
void internalQuantilesComputation(Int_t nData, Int_t nProba, Double_t *data, Double_t *quantiles, Double_t *proba, Bool_t isSorted=kTRUE, Int_t *index=0, Int_t type=7)
Computes the value of quantile alpha.
void StartViewer()
Definition TDataServer.h:872
void deleteTuple()
Delete the TDSNtupleD of _datatree variable.
void drawCDFRaFu(const char *varexp, const char *selection="", Option_t *option="")
Draw a CDF of a TPossibility attribute (RaFu)
void drawQQorPPPlot(const char *varexp, const char *laws, int nq, Option_t *option)
Internal method, not to be used standalonely.
void addAttribute(TString name, Double_t dmin, Double_t dmax)
Adds an attribute with the name and the range.
void exportData(const char *filename, const char *varexp="*", const char *select="", Option_t *option="")
Exports the data in a ASCII file.
static TString getUranieVersion()
Definition TDataServer.h:1253
void computeQuantile(const char *attName, Double_t proba, Double_t &quantile, Int_t type=7)
Compute a quantile of the empirical distribution of an attribute.
TString _siteratorChangedName
The shortened name of the TDataServer;.
Definition TDataServer.h:1289
TDataServer()
Default constructor.
void drawECDF(const char *varexp, const char *selection="", Option_t *option="")
Experimental CDF of a single variable.
void addAttribute(URANIE::DataServer::TAttribute *att)
Adds an attribute from an attribute.
static string checkAttributes(TDataServer *tds, string varexp, map< string, vector< int > > &mAttributeElements)
check the attribute content
TList * getListOfAttributes(const char *sListOfAttributes="*", bool onlyAttribute=true)
Gets the list of attributes from a string.
TString _sarchivefile
The archive file (.root)
Definition TDataServer.h:1287
void addAttribute(const char *name)
Adds an attribute with the name only.
TAttribute * getAttribute(Int_t ind, bool onlyAttribute=kTRUE)
Returns a pointer of the attribute given by this name.
ENormalisation
define the kind of normalisation to be chosen in normalize method
Definition TDataServer.h:95
@ kCentered
Definition TDataServer.h:96
@ kZeroOne
Definition TDataServer.h:96
@ kCenteredSum0fSquareOne
Definition TDataServer.h:96
@ kCR
Definition TDataServer.h:96
@ kMinusOneOne
Definition TDataServer.h:96
void Draw(const char *varexp, const char *selection="", Option_t *option="")
Draws histogram for a given index of a variable.
Definition TDataServer.h:824
void drawQQPlot(const char *varexp, const char *laws, int nq, Option_t *option="")
void fillOthersAttributes(bool update=kFALSE)
fill TFormula attributes
void exportDataNeMo(const char *filename, const char *varexpinput, const char *varexpoutput, const char *select="")
Exports the data in a ASCII file reading by NeMo.
TCanvas * _canvas
The canvas to work on;.
Definition TDataServer.h:1280
void checkCanvasCreation(Option_t *option="")
Crate a canvas if needed.
string getStringListOfAttributes(bool onlyNumerical=true, bool onlyAttribute=true)
Gets the list of attributes as a string.
void fillConstantAttribute(TString name, UEntry *ConstUEntry)
Fills a new Branch for an attribute by copying a constant uentry.
void drawScatterplot(const char *varexp, const char *selection="", Option_t *option="")
Draws Scatterplots.
static void findParametersLaw(TString soption, vector< double > &vec, bool blog)
Bool_t loadTree(TTree *tt)
Load a tree.
void draw(UInt_t nOrder, const char *selection="", Option_t *option="")
Draw a histogram of the attribute specified by its index in the TDataServer.
EOrigin
define the origin of the TDS (how it has been constructed)
Definition TDataServer.h:91
@ kTree
Definition TDataServer.h:92
@ kASCIIFile
Definition TDataServer.h:92
@ kUnknown
Definition TDataServer.h:92
@ kSQL
Definition TDataServer.h:92
TDSNtupleD * GetTuple(Option_t *option="V")
Returns a pointer to the TDSNtupleD.
Definition TDataServer.h:1120
void draw(const char *varexp, const char *selection="", Option_t *option="", bool internalCall=kFALSE)
Draws histogram for a given index of a variable.
void computeStatistic(const char *varexp="*", const char *selection="", Option_t *option="")
Computes the statistics features (minimum and maximum values, mean and standard-deviation)
Int_t getNOutputAttributes()
Return the number of output Attributes.
void setCut(TCut cut)
Specifies the criterion to exclude individuals.
Definition TDataServer.h:454
Int_t scan(const char *varexp="", const char *selection="", Option_t *option="")
Scan content of the TDS.
void computeQuantile(const char *attName, Int_t nProba, Double_t *proba, Double_t *quantiles, Int_t type=7)
Compute quantiles of the empirical distribution of an attribute.
void estimateQuantile(const char *attName, Int_t nProba, Double_t *proba, Double_t *quantile, Double_t confidence=0.5, Option_t *option="")
Estimates quantiles of attribute "attName" with confidence level (Wilks method)
void drawCopulogram(const char *varexp="*", const char *selection="", Option_t *option="")
draw the scatterplots for each possible pairs and ranks
TCut getCut()
Return the selection TCut.
Definition TDataServer.h:1105
Int_t getNPatterns()
Returns the number of patterns in the TDataServer.
TString _shortDataTreeName
The shortened name of the TDataServer;.
Definition TDataServer.h:1288
void addAttributeByNameTitle(TString name, TString title)
Adds an attribute with the name and title.
int getAttributeIndex(TString name, bool onlyAttribute=false) const
Returns the index of the attribute.
virtual ~TDataServer()
Default destructor.
void saveTuple(Option_t *option)
Save the ntupleD in the archive (ROOT File)
void computeRank(const char *varexp="*", Option_t *option="")
Computes the rank.
Double_t computeInverseNormalCDF(Double_t p, Double_t mean=0.0, Double_t stddev=1.0)
Computes the inverse of the cumulative of a normal distribution.
Double_t getValue(TString attName, Int_t entry, Int_t ielement=-1)
Returns the value at index "entry" of the leaf "attName".
void fillAttribute(TString name, TString formula="", Bool_t update=kTRUE)
Fills a new Branch for an attribute by applying the given formula.
void bootstrap(Int_t nsize=-1, Option_t *option="")
Define a bootstrap database.
char * getDataFileName()
Returns the name of the file.
void setCut(TString str)
Specifies the criterion to exclude individuals.
Definition TDataServer.h:484
void addAttributeUsingData(TString name, double *arr, int size)
Adds an attribute with the name and the content.
Bool_t fileDataRead(const char *name, Bool_t bSave=kTRUE, Bool_t bDontAddAttribute=kFALSE, Option_t *option="")
Reads a ASCII file with a header.
void unsetLog()
Definition TDataServer.h:1239
void SetName(const char *name)
Change the name.
vector< double > getVector(TString attName, Int_t entry)
Returns a vector of double for entry "entry" of the leaf "attName".
void clearSelect()
Clears the selection of patterns.
Definition TDataServer.h:494
void delAttribute(TString name)
Deletes an attribute given by these name.
void drawCobWeb(const char *varexp, const char *selection="", Option_t *option="")
Draw a cobweb.
void drawBoxPlot(const char *varexp, const char *selection="", Option_t *option="")
virtual void printLog(Option_t *option="")
void setLog()
Definition TDataServer.h:1235
TDataServer(const TDataServer &tds)
Copy constructor.
Bool_t _bsaveTuple
Definition TDataServer.h:1285
static Int_t doBanner()
Definition TDataServer.h:1254
TDSNtupleD * getTuple(Option_t *option="V")
Returns a pointer to the TDSNtupleD.
Bool_t isAttribute(TString name) const
Checks if the attribute given by a name exist.
Bool_t _biteratorNameChanged
To know whether this iterator name has been changed.
Definition TDataServer.h:1284
void drawCDF(const char *varexp, const char *selection="", Option_t *option="")
CDF d'une variable.
TMatrixD computeCAH(const char *varexp="*", ECAHMethod CAHmethod=kWard, const char *selection="", Option_t *option="")
make a CAH
ECAHMethod
define the method ued to compute CAH
Definition TDataServer.h:99
@ kWard
Definition TDataServer.h:100
@ kAverage
Definition TDataServer.h:100
@ kComplete
Definition TDataServer.h:100
@ kCentroid
Definition TDataServer.h:100
@ kSingle
Definition TDataServer.h:100
@ kWardExact
Definition TDataServer.h:100
TCut _ccut
Selection of pattern.
Definition TDataServer.h:1290
TString _sdatafile
The original data file (ASCII mode)
Definition TDataServer.h:1286
ClassDef(URANIE::DataServer::TDataServer, ID_DATASERVER) private TDSNtupleD * _datatree
< Specification of data
Definition TDataServer.h:1275
TPatternsEventList * _pelBootstrap
The bootstrap list of input pattern.
Definition TDataServer.h:1303
void drawIter(const char *sVar, const char *selection="", Option_t *option="")
Graph of a variable depanding of his apparition order in the list.
Bool_t ntupleDataRead(const char *file, const char *tree, const char *svar="*", const char *cut="")
Reads data from a TDSNtupleD in a ROOT file.
Bool_t _blog
log printing
Definition TDataServer.h:1282
TObjArray * _drawingGarbageCollector
Garbage collector list for drawing.
Definition TDataServer.h:104
void cleanStatAndQuantiles()
Utility function to clean the quantiles and stat of all attribute if needed.
Definition TDataServer.h:512
void changeLog()
Definition TDataServer.h:1243
string getString(TString attName, Int_t entry)
Returns a string for entry "entry" of the leaf "attName".
TMatrixD computeCorrelationMatrix(const char *varexp="*", const char *selection="", Option_t *option="")
Computes the correlation matrix.
void createTuple(Option_t *option="")
Creates the tuple of the TDataServer.
void normalize(const char *varexp="", const char *suffix="_CR", ENormalisation method=kCR, bool global=true)
Normalize attributes by several methods of normalisation (CenterReduct, on the intervals or )
Int_t getNInputAttributes()
Return the number of input Attributes.
void addAttribute(TString name, TString formula, TString title="", TString unit="", bool update=true)
Adds a new attribute defined by an analytical function.
Int_t Scan(const char *varexp, const char *selection="", Option_t *option="")
Scan content of the TDS.
Definition TDataServer.h:799
void drawHistogram(const char *sVar, const char *selection="", Option_t *option="")
Histogram of a variable.
void setTuple(TDSNtupleD *ntd, bool newismain=true, const char *att="*")
Set the TDSNtupleD of _datatree variable.
Definition TDataServer.h:950
TAttribute * getAttribute(TString str)
Returns a pointer of the attribute given by this name.
TDataSpecification * getDataSpecification()
Return a TDataSpecification pointer.
Definition TDataServer.h:1111
void setIterator(TString sname)
Sets an iterator.
void setTuple(TTree *ntd, bool newismain=true)
Set the TDSNtupleD of _datatree variable.
Definition TDataServer.h:959
Bool_t hasTuple()
Check if the data server contains data.
Definition TDataServer.h:1220
The collection of attributes specifying how to interpret the input data attributes.
Definition TDataSpecification.h:64
Description of the class TPatternsEventList.
Definition TPatternsEventList.h:63
ROOT.
Definition TAttribute.h:106