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.10.0
/* @license-end */
TDataServer.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 
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 
74 using std::cout;
75 using std::endl;
76 using std::string;
77 using std::map;
78 using std::vector;
79 using std::ios;
80 
81 namespace URANIE
82 {
83 namespace DataServer
84 {
85 class TDataServer: public TNamed
86 {
87 
88  // Attributes
89  public:
90  enum EOrigin
91  {
93  };
95  {
97  };
98  enum ECAHMethod
99  {
101  };
102 
105 
106  //---------------------------------------------
110  TDataServer();
113  TDataServer(const char *name, const char* title);
115  TDataServer(const TDataServer &tds);
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 
167  Bool_t fileDataReadCSV(const char* name, string delimiter = ",", Bool_t bSave = kTRUE, Bool_t bDontAddAttribute = kFALSE, Option_t *option="");
168 
169 #ifdef WITH_JSONCPP
170  Bool_t fileDataReadJSon(const char* name, Bool_t bSave = kTRUE);
171 #endif
172 
174 
183  Bool_t ntupleDataRead(const char* file, const char *tree, const char* svar =
184  "*", const char *cut = "");
186  /*
187  This method takes a tree and investigate its content to rebuild a TDS from it.
188  TDataSpecification and TDSNtupleD are rebuilt completly deleting all possible previous information
189  \param tt: the tree to be read
190  */
191  Bool_t loadTree(TTree* tt);
193 
194  //---------------------------------------------
199 
208  void exportData(const char *filename, const char *varexp = "*",
209  const char *select = "", Option_t *option = "");
210 
212 
220  void exportDataCSV(const char *filename, const char *varexp = "*",
221  const char *select = "", string delimiter = ",", Option_t *option = "");
222 
223 
225 
233  void exportDataHeader(const char *filename, const char *varexp = "*",
234  const char *select = "", Option_t *option = "");
235 
237 
267  void exportDataNeMo(const char *filename, const char *varexpinput,
268  const char *varexpoutput, const char *select = "");
269 
271 
277  void exportDataContext(const char *filename, const char *varexp = "*",
278  const char *select = "");
279 
280 #ifdef WITH_JSONCPP
281  void exportDataJSon(const char *filename, const char *varexp = "*",
282  const char *select = "", Option_t *option = "");
283 #endif
284 
286 
290  void saveTuple(Option_t* option);
292 
293 
294  //---------------------------------------------
303 
305 
310  static string checkAttributes(TDataServer *tds, string varexp, map<string, vector<int> > &mAttributeElements);
311 
313 
318  void addAttribute(TString name, Double_t dmin, Double_t dmax);
319 
321 
326  void addAttributeUsingData(TString name, double *arr, int size);
327 
329 
333  void addAttributeByNameTitle(TString name, TString title);
334 
336 
340  void addAttribute(const char *name);
341 
343 
354  void addAttribute(TString name, TString formula, TString title = "",TString unit = "", bool update=true);
355 
357  void fillOthersAttributes(bool update=kFALSE);
358 
361 
363 
368  void delAttribute(TString name);
369 
371 
402  void merge(TDataServer *tds, const char* varexpinput="*", bool bwithFriend=kFALSE);
404 
432  void normalize(const char* varexp = "", const char* suffix = "_CR",
433  ENormalisation method = kCR, bool global=true);
434 
436 
437  //---------------------------------------------
450 
456  void setSelect(TString str)
457  {
458  if( str.EqualTo(TString(_ccut.GetTitle())) )
459  return;
460  _ccut = TCut(str);
462  }
463 
465  /*
466  The cut is tested and if it differs from the previous one (currently used) the quantiles and statistical caracteristic
467  of the attributes are cleared.
468  \param cut (TCut): A TCut to reject event
469  */
470  void setCut(TCut cut)
471  {
472  string thecut = "!("+string(cut.GetTitle())+")";
473  if( string(_ccut.GetTitle())==thecut )
474  return;
475  _ccut = !cut;
477  }
478 
480  /*
481  The cut is tested and if it differs from the previous one (currently used) the quantiles and statistical caracteristic
482  of the attributes are cleared.
483  \param cut (TCut): A TCut to reject event
484  */
485  void setCut(const char * str)
486  {
487  string thecut = "!("+string(str)+")";
488  if( string(_ccut.GetTitle())==thecut )
489  return;
490  _ccut = !TCut(str);
492  }
493 
495 
500  void setCut(TString str)
501  {
502  string thecut = "!("+string(str)+")";
503  if( string(_ccut.GetTitle())==thecut )
504  return;
505  _ccut = !TCut(str);
507  }
508 
510  void clearSelect()
511  {
512  if( string(_ccut.GetTitle())=="" )
513  return;
514  _ccut = "";
516  }
517 
519  void clearCut()
520  {
521  clearSelect();
522  }
523 
525  /*
526  Not to be calles by users
527  */
529  {
530  if ( gErrorIgnoreLevel < kWarning-1 )
531  (*_fLogger) << " Selection is changing ==> clearing the TAttribute computed statistics and quantiles" << Endl;
532  TList *listOfAtt = getListOfAttributes("*",false);
533  TIter next(listOfAtt);
534  TAttribute *att;
535  while ((att = (TAttribute*) next()))
536  att->clearVectors();
537 
538  if(listOfAtt!=NULL)
539  delete listOfAtt;
540  }
541 
543 
546  void mix();
548 
549 
550  //---------------------------------------------
555 
561  TMatrixD computeCAH(const char *varexp = "*", ECAHMethod CAHmethod = kWard,
562  const char *selection = "", Option_t *option = "");
563 
565 
574  void computeStatistic(const char *varexp = "*", const char *selection = "", Option_t *option = "");
575 
577 
586  TMatrixD computeCorrelationMatrix(const char *varexp = "*", const char *selection = "", Option_t *option = "");
588 
597  void computeRank(const char *varexp = "*", Option_t *option = "");
598 
600 
612  void estimateQuantile(const char *attName, Int_t nProba, Double_t* proba,
613  Double_t* quantile, Double_t confidence = 0.5,
614  Option_t *option = "");
616 
632  void estimateQuantile(const char *attName, Double_t proba,
633  Double_t &quantile, Double_t confidence = 0.5,
634  Option_t *option = "");
635 
637 
680  void computeQuantile(const char *attName, Double_t proba,
681  Double_t &quantile, Int_t type = 7);
682 
684  double computeQuantile(const char *attName, Double_t proba, Int_t type = 7);
685 
687 
698  void computeQuantile(const char *attName, Int_t nProba, Double_t* proba,
699  Double_t* quantiles, Int_t type = 7);
700  //Add by MSA
702 
726  void computeQuantileCV(TString yname, Double_t alpha, TString zname,
727  Double_t zapha, Double_t &quantile, Double_t & rho);
728 
730 
741  void internalQuantilesComputation(Int_t nData, Int_t nProba, Double_t* data,
742  Double_t* quantiles, Double_t* proba, Bool_t isSorted = kTRUE,
743  Int_t* index = 0, Int_t type = 7);
744 
746 
769  Int_t computeIndexQuantileWilks(Double_t alpha, Double_t beta, Int_t n);
770 
772 
792  Double_t computeInverseNormalCDF(Double_t p, Double_t mean = 0.0, Double_t stddev = 1.0);
793 
795 
796 
797  //---------------------------------------------
802 
809  Int_t scan(const char *varexp = "", const char *selection = "",
810  Option_t *option = "");
812 
815  Int_t Scan(const char *varexp, const char *selection = "",
816  Option_t *option = "")
817  {
818  return scan(varexp, selection, option);
819  }
820 
822  void checkCanvasCreation(Option_t *option="");
824 
835  void draw(const char* varexp, const char* selection = "", Option_t* option = "", bool internalCall=kFALSE);
837 
840  void Draw(const char* varexp, const char* selection = "", Option_t* option =
841  "")
842  {
843  draw(varexp, selection, option);
844  }
845 
847 
853  void draw(UInt_t nOrder, const char* selection = "", Option_t* option = "");
854 
856  void drawHistogram(const char* sVar, const char* selection = "",
857  Option_t* option = "");
859  void drawIter(const char* sVar, const char* selection = "",
860  Option_t* option = "");
862 
867  void drawECDF(const char* varexp, const char* selection = "",
868  Option_t* option = "");
869 
873  void drawQQPlot(const char* varexp, const char* laws, int nq, Option_t* option = "");
874 
878  void drawPPPlot(const char* varexp, const char* laws, int nq, Option_t* option = "");
879 
881  void drawCDF(const char* varexp, const char* selection = "",
882  Option_t* option = "");
883 
884  void drawBoxPlot(const char* varexp, const char* selection = "",
885  Option_t* option = "");
886 
887  void startViewer();
888  void StartViewer()
889  {
890  startViewer();
891  }
892 
894 
897  void drawTufte(const char* varexp, const char* selection = "",
898  Option_t* option = "");
900  void drawScatterplot(const char* varexp, const char* selection = "",
901  Option_t* option = "");
903 
913  void drawProfile(const char* varexp, const char* selection = "",
914  Option_t* option = "");
916 
921  void drawPairs(const char* varexp = "*", const char* selection = "",
922  Option_t* option = "");
924 
929  void drawCopulogram(const char* varexp = "*", const char* selection = "",
930  Option_t* option = "");
932  /*
933  This graph is as \b TParallelCoordonate in ROOT but is called \b cobweb in the uncertainty community (book of Saltelli).
934  */
935  void drawCobWeb(const char* varexp, const char* selection = "",
936  Option_t* option = "");
938 
939 
940  //---------------------------------------------
945 
947 
950  void SetName(const char *name);
952  void checkName();
953 
955 
959  void setIterator(TString sname);
960 
962 
966  void setTuple(TDSNtupleD *ntd, bool newismain=true, const char* att="*")
967  {
968  _datatree = ((ntd==NULL) ? NULL : new TDSNtupleD(ntd, att, "", newismain));
969  }
971 
975  void setTuple(TTree *ntd, bool newismain=true)
976  {
977  _datatree = ((ntd==NULL)? NULL :new TDSNtupleD(ntd,"*","",newismain));
978  }
979 
981 
982 
983  //---------------------------------------------
987 
989 
994  TList * getListOfAttributes(const char* sListOfAttributes = "*", bool onlyAttribute=true);
995 
997 
1003  string getStringListOfAttributes(bool onlyNumerical=true, bool onlyAttribute=true);
1004 
1006 
1013  int getAttributeIndex(TAttribute * att, bool onlyAttribute=false) const;
1014 
1016 
1023  int getAttributeIndex(TString name, bool onlyAttribute=false) const;
1024 
1026 
1029  TAttribute *getAttribute(TString str);
1030 
1031 
1033 
1039  TAttribute *getAttribute(Int_t ind, bool onlyAttribute=kTRUE);
1040 
1042 
1047  Double_t getValue(TString attName, Int_t entry, Int_t ielement=-1);
1048 
1050 
1054  vector<double> getVector(TString attName, Int_t entry);
1056 
1060  string getString(TString attName, Int_t entry);
1061 
1063 
1066  TMatrixD getMatrix(const char* varexp = "*", const char* selection = "",
1067  Option_t* option = "");
1068 
1070 
1073  Int_t getNPatterns();
1074 
1076  const char *getIteratorName()
1077  {
1078  return ((_biteratorNameChanged) ? _siteratorChangedName.Data() : Form("%s__n__iter__", GetName()) );
1079  }
1080 
1081  void changeIteratorName(const char *name)
1082  {
1083  _siteratorChangedName=TString(name);
1084  _biteratorNameChanged=kTRUE;
1085  }
1086 
1088  char * getDataTreeName();
1090  char * getDataFileName();
1092  char * getArchiveFileName();
1093 
1096  {
1097  return _norigin;
1098  }
1099 
1101 
1106  Int_t getNAttributes(bool onlyAttribute=true);
1107 
1109 
1112  Int_t getNInputAttributes();
1113 
1115 
1118  Int_t getNOutputAttributes();
1119 
1121  TCut getCut()
1122  {
1123  return _ccut;
1124  }
1125 
1128  {
1129  return _dataSpecification;
1130  }
1131 
1133 
1136  TDSNtupleD *GetTuple(Option_t *option = "V")
1137  {
1138  return getTuple(option);
1139  }
1141 
1144  TDSNtupleD *getTuple(Option_t *option = "V");
1145 
1147 
1148  //---------------------------------------------
1153 
1165  void bootstrap(Int_t nsize = -1, Option_t *option = "");
1167 
1168 
1169  //---------------------------------------------
1173 
1175  void createTuple(Option_t *option = "");
1176 
1178 
1200  void fillAttribute(TString name, TString formula = "", Bool_t update = kTRUE);
1201 
1202 
1204 
1219  void fillConstantAttribute(TString name, UEntry *ConstUEntry);
1220 
1222 
1225  Bool_t isAttribute(TString name) const;
1226 
1227 
1229  void deleteTuple();
1230 
1232 
1236  Bool_t hasTuple()
1237  {
1238  return _datatree != NULL;
1239  }
1240 
1241  void keepFinalTuple(bool val)
1242  {
1243  _bsaveTuple = val;
1244  }
1246 
1247  //---------------------------------------------
1251  void setLog()
1252  {
1253  _blog = kTRUE;
1254  }
1255  void unsetLog()
1256  {
1257  _blog = kFALSE;
1258  }
1259  void changeLog()
1260  {
1261  _blog = _blog ? kFALSE : kTRUE;
1262  }
1263  Bool_t getLog()
1264  {
1265  return _blog;
1266  }
1267  virtual void printLog(Option_t *option = "");
1268 
1269  static TString getUranieVersion(){ return TString("Uranie v")+TString(URANIE_RELEASE);}
1270  static Int_t doBanner(){
1271  string bold_on, bold_off;
1272 #ifndef WIN32
1273  bold_on = "\033[1m";
1274  bold_off = "\033[0m";
1275 #endif
1276  cout << "\n" << bold_on << "--- Uranie v" << URANIE_RELEASE
1277  << " --- Developed with ROOT (" << gROOT->GetVersion() << ")" << bold_off << "\n"
1278  << " Copyright (C) 2013-2024 CEA/DES " << "\n"
1279  << " Contact: support-uranie@cea.fr " << "\n"
1280  << " Date: " << URANIE_RELEASE_DATE
1281  << "\n\n";
1282  return 0;
1283  }
1284 
1285 
1287 
1288  static void findParametersLaw(TString soption, vector<double> &vec, bool blog);
1289 
1290 
1291  ClassDef(URANIE::DataServer::TDataServer, ID_DATASERVER)
1292 
1293  private:
1294  TDataSpecification* _dataSpecification;
1296  TCanvas *_canvas;
1297  TTree* _friend;
1298  Bool_t _blog;
1301  Bool_t _bsaveTuple;
1302  TString _sdatafile;
1303  TString _sarchivefile;
1306  TCut _ccut;
1307 
1308  void drawLegend(const char* varexp, const char* selection = "",
1309  const char * histname = "htemp");
1310 
1312 
1315  void drawQQorPPPlot(const char* varexp, const char* laws, int nq, Option_t* option );
1316 
1318 
1320 
1321  URANIE::DataServer::UMessageLogger *_fLogger;
1322 
1323  //---------------------------------------------
1328  void drawCDFRaFu(const char* varexp, const char* selection = "",
1330  Option_t* option = "");
1331 
1333 
1334 
1335 };
1336 
1337 } // Fin du namespace DataServer
1338 } // Fin du namespace URANIE
1339 #endif
ROOT.
Definition: TAttribute.h:104
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.
Bool_t getLog()
Definition: TDataServer.h:1263
void setLog()
Definition: TDataServer.h:1251
void fillConstantAttribute(TString name, UEntry *ConstUEntry)
Fills a new Branch for an attribute by copying a constant uentry.
Int_t getNOutputAttributes()
Return the number of output Attributes.
void drawQQPlot(const char *varexp, const char *laws, int nq, Option_t *option="")
virtual void printLog(Option_t *option="")
void setCut(const char *str)
Specifies the criterion to exclude individuals.
Definition: TDataServer.h:485
void checkCanvasCreation(Option_t *option="")
Crate a canvas if needed.
void unsetLog()
Definition: TDataServer.h:1255
void drawCDF(const char *varexp, const char *selection="", Option_t *option="")
CDF d&#39;une variable.
Definition: TDataServer.h:92
TMatrixD getMatrix(const char *varexp="*", const char *selection="", Option_t *option="")
Returns the matrix of data.
Definition: TDataServer.h:100
TCut _ccut
Selection of pattern.
Definition: TDataServer.h:1306
TDSNtupleD * GetTuple(Option_t *option="V")
Returns a pointer to the TDSNtupleD.
Definition: TDataServer.h:1136
Bool_t _bQuantVectPrinted
print the message for the vector quantile calculation only once
Definition: TDataServer.h:1299
void setCut(TString str)
Specifies the criterion to exclude individuals.
Definition: TDataServer.h:500
void fillAttribute(TString name, TString formula="", Bool_t update=kTRUE)
Fills a new Branch for an attribute by applying the given formula.
void addAttributeUsingData(TString name, double *arr, int size)
Adds an attribute with the name and the content.
void bootstrap(Int_t nsize=-1, Option_t *option="")
Define a bootstrap database.
void drawTufte(const char *varexp, const char *selection="", Option_t *option="")
Draw 2D scatterplots "tufte".
TDSNtupleD * getTuple(Option_t *option="V")
Returns a pointer to the TDSNtupleD.
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.
void changeLog()
Definition: TDataServer.h:1259
const char * getIteratorName()
Returns the name of the iterator.
Definition: TDataServer.h:1076
void saveTuple(Option_t *option)
Save the ntupleD in the archive (ROOT File)
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 exportDataCSV(const char *filename, const char *varexp="*", const char *select="", string delimiter=",", Option_t *option="")
Exports the data in a CSV file.
Bool_t _biteratorNameChanged
To know whether this iterator name has been changed.
Definition: TDataServer.h:1300
void clearSelect()
Clears the selection of patterns.
Definition: TDataServer.h:510
TCanvas * _canvas
The canvas to work on;.
Definition: TDataServer.h:1296
Definition: TDataServer.h:100
static TString getUranieVersion()
Definition: TDataServer.h:1269
Bool_t hasTuple()
Check if the data server contains data.
Definition: TDataServer.h:1236
void addAttribute(TString name, Double_t dmin, Double_t dmax)
Adds an attribute with the name and the range.
Definition: TDataServer.h:100
TString _sdatafile
The original data file (ASCII mode)
Definition: TDataServer.h:1302
EOrigin _norigin
The origin of the dataserver (ASCII File, TTree, SQL...)
Definition: TDataServer.h:1317
void fillOthersAttributes(bool update=kFALSE)
fill TFormula attributes
TCut getCut()
Return the selection TCut.
Definition: TDataServer.h:1121
TString _shortDataTreeName
The shortened name of the TDataServer;.
Definition: TDataServer.h:1304
string getStringListOfAttributes(bool onlyNumerical=true, bool onlyAttribute=true)
Gets the list of attributes as a string.
static Int_t doBanner()
Definition: TDataServer.h:1270
Definition: TDataServer.h:100
Definition: TDataServer.h:100
TPatternsEventList * _pelBootstrap
The bootstrap list of input pattern.
Definition: TDataServer.h:1319
void createTuple(Option_t *option="")
Creates the tuple of the TDataServer.
void SetName(const char *name)
Change the name.
void drawPairs(const char *varexp="*", const char *selection="", Option_t *option="")
draw the scatterplots for each possible pairs
Definition: TDataServer.h:92
Definition: TDataServer.h:100
Int_t getNInputAttributes()
Return the number of input Attributes.
EOrigin
define the origin of the TDS (how it has been constructed)
Definition: TDataServer.h:90
void drawCDFRaFu(const char *varexp, const char *selection="", Option_t *option="")
Draw a CDF of a TPossibility attribute (RaFu)
ECAHMethod
define the method ued to compute CAH
Definition: TDataServer.h:98
void deleteTuple()
Delete the TDSNtupleD of _datatree variable.
Int_t Scan(const char *varexp, const char *selection="", Option_t *option="")
Scan content of the TDS.
Definition: TDataServer.h:815
EOrigin getOrigin()
Return the origin of the considered TDS.
Definition: TDataServer.h:1095
Int_t getNPatterns()
Returns the number of patterns in the TDataServer.
Double_t getValue(TString attName, Int_t entry, Int_t ielement=-1)
Returns the value at index "entry" of the leaf "attName".
string getString(TString attName, Int_t entry)
Returns a string for entry "entry" of the leaf "attName".
Definition: TDataServer.h:96
char * getDataFileName()
Returns the name of the file.
void exportData(const char *filename, const char *varexp="*", const char *select="", Option_t *option="")
Exports the data in a ASCII file.
int getAttributeIndex(TAttribute *att, bool onlyAttribute=false) const
Returns the index of the attribute.
void Draw(const char *varexp, const char *selection="", Option_t *option="")
Draws histogram for a given index of a variable.
Definition: TDataServer.h:840
Definition: TDataServer.h:96
void addAttributeByNameTitle(TString name, TString title)
Adds an attribute with the name and title.
void clearCut()
Clears the rejection of patterns.
Definition: TDataServer.h:519
Bool_t fileDataRead(const char *name, Bool_t bSave=kTRUE, Bool_t bDontAddAttribute=kFALSE, Option_t *option="")
Reads a ASCII file with a header.
ClassDef(URANIE::DataServer::TDataServer, ID_DATASERVER) private TDSNtupleD * _datatree
< Specification of data
Definition: TDataServer.h:1291
void draw(const char *varexp, const char *selection="", Option_t *option="", bool internalCall=kFALSE)
Draws histogram for a given index of a variable.
Bool_t _bsaveTuple
Definition: TDataServer.h:1301
The collection of attributes specifying how to interpret the input data attributes.
Definition: TDataSpecification.h:63
Interface of the class URANIE::DataServer::TPatternsEventList.
void drawECDF(const char *varexp, const char *selection="", Option_t *option="")
Experimental CDF of a single variable.
void exportDataHeader(const char *filename, const char *varexp="*", const char *select="", Option_t *option="")
Exports the data in a header file ( C / C++)
Int_t getNAttributes(bool onlyAttribute=true)
Returns the number of attributes in the TDataServer.
Bool_t fileDataReadCSV(const char *name, string delimiter=",", Bool_t bSave=kTRUE, Bool_t bDontAddAttribute=kFALSE, Option_t *option="")
TString _siteratorChangedName
The shortened name of the TDataServer;.
Definition: TDataServer.h:1305
Definition: TDataServer.h:92
void setIterator(TString sname)
Sets an iterator.
void drawHistogram(const char *sVar, const char *selection="", Option_t *option="")
Histogram of a variable.
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)
char * getDataTreeName()
Returns the name of the tree.
ENormalisation
define the kind of normalisation to be chosen in normalize method
Definition: TDataServer.h:94
Description of the class TPatternsEventList.
Definition: TPatternsEventList.h:62
Bool_t loadTree(TTree *tt)
Load a tree.
char * getArchiveFileName()
Returns the name of the archive file.
static string checkAttributes(TDataServer *tds, string varexp, map< string, vector< int > > &mAttributeElements)
check the attribute content
void setTuple(TDSNtupleD *ntd, bool newismain=true, const char *att="*")
Set the TDSNtupleD of _datatree variable.
Definition: TDataServer.h:966
TDataSpecification * getDataSpecification()
Return a TDataSpecification pointer.
Definition: TDataServer.h:1127
void drawLegend(const char *varexp, const char *selection="", const char *histname="htemp")
TAttribute * getAttribute(TString str)
Returns a pointer of the attribute given by this name.
Class of attributes following a probability density function.
Description of the class TDataServer.
Definition: TDataServer.h:85
void drawProfile(const char *varexp, const char *selection="", Option_t *option="")
Draws Profile.
void cleanStatAndQuantiles()
Utility function to clean the quantiles and stat of all attribute if needed.
Definition: TDataServer.h:528
Bool_t isAttribute(TString name) const
Checks if the attribute given by a name exist.
TObjArray * _drawingGarbageCollector
Garbage collector list for drawing.
Definition: TDataServer.h:104
void drawIter(const char *sVar, const char *selection="", Option_t *option="")
Graph of a variable depanding of his apparition order in the list.
void drawCobWeb(const char *varexp, const char *selection="", Option_t *option="")
Draw a cobweb.
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 setCut(TCut cut)
Specifies the criterion to exclude individuals.
Definition: TDataServer.h:470
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 drawQQorPPPlot(const char *varexp, const char *laws, int nq, Option_t *option)
Internal method, not to be used standalonely.
void exportDataContext(const char *filename, const char *varexp="*", const char *select="")
Export data in a tex file with a ConTex format.
Interface of the class URANIE::DataServer::TDataSpecification.
TMatrixD computeCorrelationMatrix(const char *varexp="*", const char *selection="", Option_t *option="")
Computes the correlation matrix.
Bool_t ntupleDataRead(const char *file, const char *tree, const char *svar="*", const char *cut="")
Reads data from a TDSNtupleD in a ROOT file.
void setTuple(TTree *ntd, bool newismain=true)
Set the TDSNtupleD of _datatree variable.
Definition: TDataServer.h:975
void computeRank(const char *varexp="*", Option_t *option="")
Computes the rank.
virtual ~TDataServer()
Default destructor.
Bool_t _blog
log printing
Definition: TDataServer.h:1298
void drawCopulogram(const char *varexp="*", const char *selection="", Option_t *option="")
draw the scatterplots for each possible pairs and ranks
void exportDataNeMo(const char *filename, const char *varexpinput, const char *varexpoutput, const char *select="")
Exports the data in a ASCII file reading by NeMo.
void delAttribute(TString name)
Deletes an attribute given by these name.
Description of a variable (field).
Definition: TAttribute.h:136
TMatrixD computeCAH(const char *varexp="*", ECAHMethod CAHmethod=kWard, const char *selection="", Option_t *option="")
make a CAH
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 ) ...
URANIE::DataServer::UMessageLogger * _fLogger
Message logger.
Definition: TDataServer.h:1321
TString _sarchivefile
The archive file (.root)
Definition: TDataServer.h:1303
TTree * _friend
Tree added by friend method.
Definition: TDataServer.h:1297
Definition: TDSNtupleD.h:35
vector< double > getVector(TString attName, Int_t entry)
Returns a vector of double for entry "entry" of the leaf "attName".
void merge(TDataServer *tds, const char *varexpinput="*", bool bwithFriend=kFALSE)
Concatenates the variables of two dataservers.
void computeStatistic(const char *varexp="*", const char *selection="", Option_t *option="")
Computes the statistics features (minimum and maximum values, mean and standard-deviation) ...
TList * getListOfAttributes(const char *sListOfAttributes="*", bool onlyAttribute=true)
Gets the list of attributes from a string.
TDataServer()
Default constructor.
void setSelect(TString str)
Specifies the criterion by a string to select individuals.
Definition: TDataServer.h:456
void mix()
Mix the patterns.
Interface file for the class URANIE::DataServer::TAttribute.
Int_t scan(const char *varexp="", const char *selection="", Option_t *option="")
Scan content of the TDS.
void drawBoxPlot(const char *varexp, const char *selection="", Option_t *option="")
void drawPPPlot(const char *varexp, const char *laws, int nq, Option_t *option="")
void drawScatterplot(const char *varexp, const char *selection="", Option_t *option="")
Draws Scatterplots.
void keepFinalTuple(bool val)
Definition: TDataServer.h:1241
void checkName()
Check wether the name exists already.
Definition: TDataServer.h:96
static void findParametersLaw(TString soption, vector< double > &vec, bool blog)
void StartViewer()
Definition: TDataServer.h:888
void changeIteratorName(const char *name)
Definition: TDataServer.h:1081