English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / DataServer: URANIE::DataServer::TDataServer Class Reference
Uranie / DataServer v4.9.0
/* @license-end */
URANIE::DataServer::TDataServer Class Reference

Description of the class TDataServer. More...

#include <TDataServer.h>

Inheritance diagram for URANIE::DataServer::TDataServer:
Collaboration diagram for URANIE::DataServer::TDataServer:

Public Types

enum  EOrigin { kUnknown , kASCIIFile , kTree , kSQL }
 define the origin of the TDS (how it has been constructed) More...
 
enum  ENormalisation {
  kCR , kCentered , kCenteredSum0fSquareOne , kMinusOneOne ,
  kZeroOne
}
 define the kind of normalisation to be chosen in normalize method More...
 
enum  ECAHMethod {
  kWard , kWardExact , kCentroid , kAverage ,
  kSingle , kComplete
}
 define the method ued to compute CAH More...
 

Public Member Functions

Constructor and Destructor
 TDataServer ()
 Default constructor.
 
 TDataServer (const char *name, const char *title)
 Default constructor with a name and a title.
 
 TDataServer (const TDataServer &tds)
 Copy constructor.
 
virtual ~TDataServer ()
 Default destructor.
 
Loading data

Three ways to load data:

  • From an ASCII file with at least one line in header to size nb of values.
    TDataServer *fServer = new TDataServer();
    tds->fileDataRead("_ntupledataread_.dat");
    Description of the class TDataServer.
    Definition TDataServer.h:86
    TDataServer()
    Default constructor.
    If vectors or string are in the file, a second line is mandatory to explicit this: here is an example of three variable file containing a double x, a string s and a vector v. Element of vectors are slit using commas. A blank line is also mandatory after the header
    #COLUMN_NAMES: x|s|v
    #COLUMN_TYPES: D|S[V
  • From a TDSNtupleD contained in a ROOT file with selection of variable, added with others possible one by formula then
    with deletion of patterns verifying a criterion.
    TDataServer *fServer = new TDataServer();
    tds->ntupleDataRead("hsimple.root","ntuple","pxx*py:*:py*px", "px*px+py*py<2.0");
    Thus, we construct a TDataserver tds from the TNtuple ntuple contained in the file hsimple.root where all original variables are stored from beginning (character *). Two new variables are defined by the following equations "px*py" et "py*px". Points verifying the criterion "px*px+py*py<2.0" are excluded from new data.
Bool_t fileDataRead (const char *name, Bool_t bSave=kTRUE, Bool_t bDontAddAttribute=kFALSE, Option_t *option="")
 Reads a ASCII file with a header.
 
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 loadTree (TTree *tt)
 Load a tree.
 
Export data <br>

Few methods to export the data in order to re-use them

void exportData (const char *filename, const char *varexp="*", const char *select="", Option_t *option="")
 Exports the data in a ASCII file.
 
void exportDataHeader (const char *filename, const char *varexp="*", const char *select="", Option_t *option="")
 Exports the data in a header file ( C / C++)
 
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 exportDataContext (const char *filename, const char *varexp="*", const char *select="")
 Export data in a tex file with a ConTex format.
 
void saveTuple (Option_t *option)
 Save the ntupleD in the archive (ROOT File)
 
Select/Cut/Mix patterns

Criterion to keep/exclude individuals in a database. There is an example:

tds->setSelect("( x1*x1 + x2*x2 < 2.0 ) & ( x1 < 30. )");

or to exclude individuals

tds->setCut("x1 >= 30.");
void setSelect (TString str)
 Specifies the criterion by a string to select individuals.
 
void setCut (TCut cut)
 Specifies the criterion to exclude individuals.
 
void setCut (const char *str)
 Specifies the criterion to exclude individuals.
 
void setCut (TString str)
 Specifies the criterion to exclude individuals.
 
void clearSelect ()
 Clears the selection of patterns.
 
void clearCut ()
 Clears the rejection of patterns.
 
void cleanStatAndQuantiles ()
 Utility function to clean the quantiles and stat of all attribute if needed.
 
void mix ()
 Mix the patterns.
 
Statistical method

The functions developed to perform statistical treatments

TMatrixD computeCAH (const char *varexp="*", ECAHMethod CAHmethod=kWard, const char *selection="", Option_t *option="")
 make a CAH
 
void computeStatistic (const char *varexp="*", const char *selection="", Option_t *option="")
 Computes the statistics features (minimum and maximum values, mean and standard-deviation)
 
TMatrixD computeCorrelationMatrix (const char *varexp="*", const char *selection="", Option_t *option="")
 Computes the correlation matrix.
 
void computeRank (const char *varexp="*", Option_t *option="")
 Computes the rank.
 
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 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)
 
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.
 
double computeQuantile (const char *attName, Double_t proba, Int_t type=7)
 Compute and return quantiles of the empirical distribution of an decimal attribute.
 
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 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 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.
 
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)
 
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.
 
Visualisation

The functions developed to perform visualization of data

Int_t scan (const char *varexp="", const char *selection="", Option_t *option="")
 Scan content of the TDS.
 
Int_t Scan (const char *varexp, const char *selection="", Option_t *option="")
 Scan content of the TDS.
 
void checkCanvasCreation (Option_t *option="")
 Crate a canvas if needed.
 
void draw (const char *varexp, const char *selection="", Option_t *option="", bool internalCall=kFALSE)
 Draws histogram for a given index of a variable.
 
void Draw (const char *varexp, const char *selection="", Option_t *option="")
 Draws histogram for a given index of a variable.
 
void draw (UInt_t nOrder, const char *selection="", Option_t *option="")
 Draw a histogram of the attribute specified by its index in the TDataServer.
 
void drawHistogram (const char *sVar, const char *selection="", Option_t *option="")
 Histogram of a variable.
 
void drawIter (const char *sVar, const char *selection="", Option_t *option="")
 Graph of a variable depanding of his apparition order in the list.
 
void drawECDF (const char *varexp, const char *selection="", Option_t *option="")
 Experimental CDF of a single variable.
 
void drawQQPlot (const char *varexp, const char *laws, int nq, Option_t *option="")
 
void drawPPPlot (const char *varexp, const char *laws, int nq, Option_t *option="")
 
void drawCDF (const char *varexp, const char *selection="", Option_t *option="")
 CDF d'une variable.
 
void drawBoxPlot (const char *varexp, const char *selection="", Option_t *option="")
 
void startViewer ()
 
void StartViewer ()
 
void drawTufte (const char *varexp, const char *selection="", Option_t *option="")
 Draw 2D scatterplots "tufte".
 
void drawScatterplot (const char *varexp, const char *selection="", Option_t *option="")
 Draws Scatterplots.
 
void drawProfile (const char *varexp, const char *selection="", Option_t *option="")
 Draws Profile.
 
void drawPairs (const char *varexp="*", const char *selection="", Option_t *option="")
 draw the scatterplots for each possible pairs $(x_j, x_i)$
 
void drawCopulogram (const char *varexp="*", const char *selection="", Option_t *option="")
 draw the scatterplots for each possible pairs $(x_j, x_i)$ and ranks $(Rk_x_j, Rk_x_i)$
 
void drawCobWeb (const char *varexp, const char *selection="", Option_t *option="")
 Draw a cobweb.
 
Setters

This function are used to change parameters

void SetName (const char *name)
 Change the name.
 
void checkName ()
 Check wether the name exists already

 
void setIterator (TString sname)
 Sets an iterator.
 
void setTuple (TDSNtupleD *ntd, bool newismain=true, const char *att="*")
 Set the TDSNtupleD of _datatree variable.
 
void setTuple (TTree *ntd, bool newismain=true)
 Set the TDSNtupleD of _datatree variable.
 
Getter functions
TList * getListOfAttributes (const char *sListOfAttributes="*", bool onlyAttribute=true)
 Gets the list of attributes from a string.
 
string getStringListOfAttributes (bool onlyNumerical=true, bool onlyAttribute=true)
 Gets the list of attributes as a string.
 
int getAttributeIndex (TAttribute *att, bool onlyAttribute=false) const
 Returns the index of the attribute.
 
int getAttributeIndex (TString name, bool onlyAttribute=false) const
 Returns the index of the attribute.
 
TAttributegetAttribute (TString str)
 Returns a pointer of the attribute given by this name.
 
TAttributegetAttribute (Int_t ind, bool onlyAttribute=kTRUE)
 Returns a pointer of the attribute given by this name.
 
Double_t getValue (TString attName, Int_t entry, Int_t ielement=-1)
 Returns the value at index "entry" of the leaf "attName".
 
vector< double > getVector (TString attName, Int_t entry)
 Returns a vector of double for entry "entry" of the leaf "attName".
 
string getString (TString attName, Int_t entry)
 Returns a string for entry "entry" of the leaf "attName".
 
TMatrixD getMatrix (const char *varexp="*", const char *selection="", Option_t *option="")
 Returns the matrix of data.
 
Int_t getNPatterns ()
 Returns the number of patterns in the TDataServer.
 
const char * getIteratorName ()
 Returns the name of the iterator.
 
void changeIteratorName (const char *name)
 
char * getDataTreeName ()
 Returns the name of the tree.
 
char * getDataFileName ()
 Returns the name of the file.
 
char * getArchiveFileName ()
 Returns the name of the archive file.
 
EOrigin getOrigin ()
 Return the origin of the considered TDS.
 
Int_t getNAttributes (bool onlyAttribute=true)
 Returns the number of attributes in the TDataServer.
 
Int_t getNInputAttributes ()
 Return the number of input Attributes.
 
Int_t getNOutputAttributes ()
 Return the number of output Attributes.
 
TCut getCut ()
 Return the selection TCut.
 
TDataSpecificationgetDataSpecification ()
 Return a TDataSpecification pointer.
 
TDSNtupleDGetTuple (Option_t *option="V")
 Returns a pointer to the TDSNtupleD.
 
TDSNtupleDgetTuple (Option_t *option="V")
 Returns a pointer to the TDSNtupleD.
 
Bootstrap methods

The functions developed to perform bootstrap analysis

void bootstrap (Int_t nsize=-1, Option_t *option="")
 Define a bootstrap database.
 
Miscellaneous
void createTuple (Option_t *option="")
 Creates the tuple of the TDataServer.
 
void fillAttribute (TString name, TString formula="", Bool_t update=kTRUE)
 Fills a new Branch for an attribute by applying the given formula.
 
void fillConstantAttribute (TString name, UEntry *ConstUEntry)
 Fills a new Branch for an attribute by copying a constant uentry.
 
Bool_t isAttribute (TString name) const
 Checks if the attribute given by a name exist.
 
void deleteTuple ()
 Delete the TDSNtupleD of _datatree variable.
 
Bool_t hasTuple ()
 Check if the data server contains data.
 
void keepFinalTuple (bool val)
 
Internal methods

The internal functions that are called only by other methods

void drawCDFRaFu (const char *varexp, const char *selection="", Option_t *option="")
 Draw a CDF of a TPossibility attribute (RaFu)
 

Public Attributes

TObjArray * _drawingGarbageCollector
 Garbage collector list for drawing.
 

Printing Log

ClassDef(URANIE::DataServer::TDataServer, ID_DATASERVER) private TDSNtupleD_datatree
 < Specification of data
 
TCanvas * _canvas
 The canvas to work on;.
 
TTree * _friend
 Tree added by friend method.
 
Bool_t _blog
 log printing
 
Bool_t _bQuantVectPrinted
 print the message for the vector quantile calculation only once
 
Bool_t _biteratorNameChanged
 To know whether this iterator name has been changed.
 
Bool_t _bsaveTuple
 
TString _sdatafile
 The original data file (ASCII mode)
 
TString _sarchivefile
 The archive file (.root)
 
TString _shortDataTreeName
 The shortened name of the TDataServer;.
 
TString _siteratorChangedName
 The shortened name of the TDataServer;.
 
TCut _ccut
 Selection of pattern.
 
EOrigin _norigin
 The origin of the dataserver (ASCII File, TTree, SQL...)
 
TPatternsEventList_pelBootstrap
 The bootstrap list of input pattern.
 
URANIE::DataServer::UMessageLogger * _fLogger
 Message logger.
 
void setLog ()
 
void unsetLog ()
 
void changeLog ()
 
Bool_t getLog ()
 
virtual void printLog (Option_t *option="")
 
void drawLegend (const char *varexp, const char *selection="", const char *histname="htemp")
 
void drawQQorPPPlot (const char *varexp, const char *laws, int nq, Option_t *option)
 Internal method, not to be used standalonely.
 
static TString getUranieVersion ()
 
static Int_t doBanner ()
 
static void findParametersLaw (TString soption, vector< double > &vec, bool blog)
 

Manipulate attributs

Several ways for adding/manipulate attributes

  • through a formula of other existing attributes
  • through a TAttribute
  • merge with an other TDataServer
  • using normalisation methods (CenterReduct, transform the range on the intervals $[-1.0, 1.0]$ or $[0.0, 1.0]$)
void addAttribute (TString name, Double_t dmin, Double_t dmax)
 Adds an attribute with the name and the range.
 
void addAttributeUsingData (TString name, double *arr, int size)
 Adds an attribute with the name and the content.
 
void addAttributeByNameTitle (TString name, TString title)
 Adds an attribute with the name and title.
 
void addAttribute (const char *name)
 Adds an attribute with the name only.
 
void addAttribute (TString name, TString formula, TString title="", TString unit="", bool update=true)
 Adds a new attribute defined by an analytical function.
 
void fillOthersAttributes (bool update=kFALSE)
 fill TFormula attributes
 
void addAttribute (URANIE::DataServer::TAttribute *att)
 Adds an attribute from an attribute.
 
void delAttribute (TString name)
 Deletes an attribute given by these name.
 
void merge (TDataServer *tds, const char *varexpinput="*", bool bwithFriend=kFALSE)
 Concatenates the variables of two dataservers.
 
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 $[-1.0, 1.0]$ or $[0.0, 1.0]$)
 
static string checkAttributes (TDataServer *tds, string varexp, map< string, vector< int > > &mAttributeElements)
 check the attribute content
 

Detailed Description

Description of the class TDataServer.

To be written by the developper.

Member Enumeration Documentation

◆ ECAHMethod

define the method ued to compute CAH

Enumerator
kWard 
kWardExact 
kCentroid 
kAverage 
kSingle 
kComplete 

◆ ENormalisation

define the kind of normalisation to be chosen in normalize method

Enumerator
kCR 
kCentered 
kCenteredSum0fSquareOne 
kMinusOneOne 
kZeroOne 

◆ EOrigin

define the origin of the TDS (how it has been constructed)

Enumerator
kUnknown 
kASCIIFile 
kTree 
kSQL 

Constructor & Destructor Documentation

◆ TDataServer() [1/3]

URANIE::DataServer::TDataServer::TDataServer ( )

Default constructor.

Referenced by ClassImp().

◆ TDataServer() [2/3]

URANIE::DataServer::TDataServer::TDataServer ( const char *  name,
const char *  title 
)

Default constructor with a name and a title.

◆ TDataServer() [3/3]

URANIE::DataServer::TDataServer::TDataServer ( const TDataServer tds)

Copy constructor.

◆ ~TDataServer()

virtual URANIE::DataServer::TDataServer::~TDataServer ( )
virtual

Default destructor.

Referenced by ClassImp().

Member Function Documentation

◆ addAttribute() [1/4]

void URANIE::DataServer::TDataServer::addAttribute ( const char *  name)

Adds an attribute with the name only.

Parameters
namethe name of the attribute
titlethe title of the attribute

◆ addAttribute() [2/4]

void URANIE::DataServer::TDataServer::addAttribute ( TString  name,
Double_t  dmin,
Double_t  dmax 
)

Adds an attribute with the name and the range.

Parameters
namethe name of the attribute
dminits minimum value
dmaxits maximum value

Referenced by ClassImp(), ClassImp(), and ClassImp().

◆ addAttribute() [3/4]

void URANIE::DataServer::TDataServer::addAttribute ( TString  name,
TString  formula,
TString  title = "",
TString  unit = "",
bool  update = true 
)

Adds a new attribute defined by an analytical function.

This function creates a new TAttributeFormula object and add it to the TDS. If a data tree exist, a new branch is automatically created and filled with the results of the attribute's function.

Parameters
name(TString): the name of the new attribute.
formula(TString): the formula of the new attribute.
title(TString): the label of the new attribute (default = "").
unit(TString): the unit of the new attribute (default = "").
update(TString): update the back up file with resulting tree (default = true).
Exceptions
UErrorExceptionif an attribute with the given name already exist.

◆ addAttribute() [4/4]

void URANIE::DataServer::TDataServer::addAttribute ( URANIE::DataServer::TAttribute att)

Adds an attribute from an attribute.

◆ addAttributeByNameTitle()

void URANIE::DataServer::TDataServer::addAttributeByNameTitle ( TString  name,
TString  title 
)

Adds an attribute with the name and title.

Parameters
namethe name of the attribute
titlethe title of the attribute

Referenced by ClassImp().

◆ addAttributeUsingData()

void URANIE::DataServer::TDataServer::addAttributeUsingData ( TString  name,
double *  arr,
int  size 
)

Adds an attribute with the name and the content.

Parameters
namethe name of the attribute
arraythe array of data
sizethe size of the array

Referenced by ClassImp().

◆ bootstrap()

void URANIE::DataServer::TDataServer::bootstrap ( Int_t  nsize = -1,
Option_t *  option = "" 
)

Define a bootstrap database.

When the size is :

  • equal to 0; the TEventList is put to NULL ( original TEventList = $ {1, 2, 3, \cdots, nS}$
  • is non-positive; the size is given by the size of the TDataServer (nS = tds->getNPatterns())
  • is greate than 1; it is the size which must be lesser than nS = tds->getNPatterns().
Parameters
nsize(Int_t) The size of the bootstrap database [-1]
option(Option_t) The option passed [""]("sort|seed"). If option contains "sort", the TEventList is sorted If option contains "seed=", the seed parameter is passed to the TRandom object

Referenced by ClassImp().

◆ changeIteratorName()

void URANIE::DataServer::TDataServer::changeIteratorName ( const char *  name)
inline

References _biteratorNameChanged, and _siteratorChangedName.

Referenced by ClassImp().

◆ changeLog()

void URANIE::DataServer::TDataServer::changeLog ( )
inline

References _blog.

◆ checkAttributes()

static string URANIE::DataServer::TDataServer::checkAttributes ( TDataServer tds,
string  varexp,
map< string, vector< int > > &  mAttributeElements 
)
static

check the attribute content

Parameters
tdsthe tds
varexplist of variable
fromoptcall from option

Referenced by ClassImp().

◆ checkCanvasCreation()

void URANIE::DataServer::TDataServer::checkCanvasCreation ( Option_t *  option = "")

Crate a canvas if needed.

Referenced by ClassImp().

◆ checkName()

void URANIE::DataServer::TDataServer::checkName ( )

Check wether the name exists already

Referenced by ClassImp().

◆ cleanStatAndQuantiles()

void URANIE::DataServer::TDataServer::cleanStatAndQuantiles ( )
inline

Utility function to clean the quantiles and stat of all attribute if needed.

References URANIE::DataServer::TAttribute::clearVectors(), and getListOfAttributes().

Referenced by clearSelect(), setCut(), setCut(), setCut(), and setSelect().

◆ clearCut()

void URANIE::DataServer::TDataServer::clearCut ( )
inline

Clears the rejection of patterns.

References clearSelect().

◆ clearSelect()

void URANIE::DataServer::TDataServer::clearSelect ( )
inline

Clears the selection of patterns.

References _ccut, and cleanStatAndQuantiles().

Referenced by ClassImp(), and clearCut().

◆ computeCAH()

TMatrixD URANIE::DataServer::TDataServer::computeCAH ( const char *  varexp = "*",
ECAHMethod  CAHmethod = kWard,
const char *  selection = "",
Option_t *  option = "" 
)

make a CAH

Parameters
varexp(const char *) attributes to make CAH. If mass exists, put it at the last attribute after a character "," (as "x1:x2:x3,mass")
CAHmethod(ECAHMethod)[ kWard | kCentroid | kAverage | kSingle | kComplete }(kWard) the method of CAH

Referenced by ClassImp().

◆ computeCorrelationMatrix()

TMatrixD URANIE::DataServer::TDataServer::computeCorrelationMatrix ( const char *  varexp = "*",
const char *  selection = "",
Option_t *  option = "" 
)

Computes the correlation matrix.

Compute the correlation matrix of the list of considered variable. This method deals with both double branch and vectors when their size is constant through patterns. If so every elements is considered as an input of the matrix

Warning
if the vector size is not constant through all considered patterns, no computation is done.
Parameters
varexplist of variable to be used
selectionadditional selection to be used on top of the global one defined by TDataServer::setSelect()
optioncan check correlation on rank if "rank" is used in option.

Referenced by ClassImp().

◆ computeIndexQuantileWilks()

Int_t URANIE::DataServer::TDataServer::computeIndexQuantileWilks ( Double_t  alpha,
Double_t  beta,
Int_t  n 
)

Computes the index of the quantile alpha with a confidence beta (Wilks method)

Description

Given a sorted array of n realizations of a random variable X, a quantile alpha and a confidence level beta, this function returns the index of the realization Q for which P(X <= Q) = alpha with a confidence level beta.

For "large" values of n (i.e n > 1000), in order to reduce numerical errors, an approximation of the Wilks formula is used.

(ref. ?)

Usage
TDataServer* tds = new TDataServer("tdsQuantiles","test for quantiles");
tds->computeQuantile("x",0.95,q);
Parameters
alpha: probability defining the quantile
beta: confidence level
n: sample size

Referenced by ClassImp().

◆ computeInverseNormalCDF()

Double_t URANIE::DataServer::TDataServer::computeInverseNormalCDF ( Double_t  p,
Double_t  mean = 0.0,
Double_t  stddev = 1.0 
)

Computes the inverse of the cumulative of a normal distribution.

Description

For a given normal distribution N(mean, stddev) and a probability p, this function computes the value X for which the integral of N from -Inf to X is equal to p.

By default, mean = 0.0 and stddev = 1.0.

Usage
TDataServer* tds = new TDataServer("tdsInvCDF","test for inverse of normal CDF");
tds->computeInverseNormalCDF(0.5, 5.0, 2.5);
Parameters
p: probability
mean: mean of the normal distribution
stddev: standard deviation of the normal distribution

Referenced by ClassImp().

◆ computeQuantile() [1/3]

void URANIE::DataServer::TDataServer::computeQuantile ( const char *  attName,
Double_t  proba,
Double_t &  quantile,
Int_t  type = 7 
)

Compute a quantile of the empirical distribution of an attribute.

Returns the quantile of the empirical distribution of the attribute "attName". For a given probability p, the corresponding quantile q is given by:

\[ q = (1-p) x_k + p x_{k+1} \]

where $ x_k$ is the kth smallest value of the n attName values. The parameter "type" determines how k is computed.

Warning
if more than one attribute name is given, only the first one will be used !
The result is stored in quantile for double-branch case. In the case of vector, quantile contains only the last element quantile values. In all cases, the quantiles are stored in the attribute itself and can be accessed through getQuantile methods.
Parameters
attName(const char*) name of the attribute.
proba(Double_t) Proba for which the quantile is computed.
quantile(Double_t &) Variable storing the result
type(Int_t) quantile type (Default = 7). Possible values are:
  • Discontinuous cases:
    • 1: k = Int( p * n); if p*n == k, q = x_k; else q = x_{k+1}
    • 2: k = Int( p * n); if p*n == k, q = 0.5(x_k + x_{k+1}); else q = x_{k+1}
    • 3: k = Int( p * n - 0.5); if p*n-0.5 == k and k is even, q = x_k; else q = x_{k+1} (Default in SAS)
  • Piecewise linear interpolations:
    • 4: k = Int( p * n )
    • 5: k = Int( p * n - 0.5 )
    • 6: k = Int( p * (n+1) ) (Default in Minitab and SPSS)
    • 7: k = Int( p * (n-1) + 1) (Default in ROOT, S and R)
    • 8: k = Int( p * (n+1/3) + 1/3 ) (approximately median unbiased)
    • 9: k = Int( p * (n+1/4) + 3/8 ) (approximately unbiased if x is normaly distributed)
NOTE: the notation Int(a) represents the integer part of a >= 0.
References:
  1. Hyndman, R.J and Fan, Y, (1996) "Sample quantiles in statistical packages" American Statistician, 50, 361-365
  2. R Project documentation for the function quantile of package {stats}
  3. ROOT documentation of the TMath::Quantiles function

Referenced by ClassImp().

◆ computeQuantile() [2/3]

double URANIE::DataServer::TDataServer::computeQuantile ( const char *  attName,
Double_t  proba,
Int_t  type = 7 
)

Compute and return quantiles of the empirical distribution of an decimal attribute.

◆ computeQuantile() [3/3]

void URANIE::DataServer::TDataServer::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.

Returns the quantile of the empirical distribution of the attribute "attName", running nProba times the TDataServer::computeQuantile(const char *attName, Double_t proba, Double_t &quantile, Int_t type = 7) method. See its explanation for more details

Parameters
nProbanumber of quantiles to compute
proba(Double_t) Proba for which the quantile is computed.
quantile(Double_t &) Variable storing the result
Warning
The results are stored in quantile for double-branch case. In the case of vector, quantile contains only the last element quantile values. In all cases, the quantiles are stored in the attribute itself and can be accessed through getQuantile methods.

◆ computeQuantileCV()

void URANIE::DataServer::TDataServer::computeQuantileCV ( TString  yname,
Double_t  alpha,
TString  zname,
Double_t  zapha,
Double_t &  quantile,
Double_t &  rho 
)

Compute the quantile alpha by comtrol variate.

Parameters
yname: name of the attribut
alpha: Proba for which the quantile is computed
zname: name of he control variate,
zapha: quantile of the control variate,
quantile: Variable storing the quantile
rho: Variable storing the variance reduction
Description :
The estimation of the quantile is determinate in 4 steps.
  • compute the wj: $ w_j=\frac{\alpha}{N_0} 1\!\!1_{Z_j\le z_\alpha} + \frac{\alpha}{N_1} 1\!\!1_{Z_j>z_\alpha} $
  • compute the sum of wj: $\sum\limits_{i=1}^j w_i \ \  where \ j=1...nS$
  • determinate $ K=inf\left\{j, \sum_{i=0}^{j} w_i > \alpha \right\}  \ \  where \  j=1...nS$
  • determinate the empirique quantile : $ Y_{\alpha,n}=Y_{(K)} $

The coefficient $ \rho_l $ need to compute the reduction of variance is compute thanks to this equation: $\rho_l = \frac{P[Y\le y_\alpha ,Z\le z_\alpha]-\alpha^2}{\alpha-\alpha^2} $

Reminder:
The reduction of variance is $1-{\rho_l}^2 $
Warning
not modified to take into account vectors

Referenced by ClassImp().

◆ computeRank()

void URANIE::DataServer::TDataServer::computeRank ( const char *  varexp = "*",
Option_t *  option = "" 
)

Computes the rank.

Compute the rank of the chosen attribute through the global list of patterns. This method deals with both double branch and vectors when their size is constant through patterns. If so every elements is considered as an input and a vector of rank is created whose elements ith is the ranl of the ith element of the considered vector through all patterns.

Warning
if the vector size is not constant through all considered patterns, no computation is done.
Parameters
varexplist of variable to be used
optionno option implemented so far

Referenced by ClassImp().

◆ computeStatistic()

void URANIE::DataServer::TDataServer::computeStatistic ( const char *  varexp = "*",
const char *  selection = "",
Option_t *  option = "" 
)

Computes the statistics features (minimum and maximum values, mean and standard-deviation)

This method compute the statistical properties of the attribute precised in the varexp list. The results is then stored in the considered attribute itself and can be access through the TAttribute::getX method (where X is Minimum, Maximum, Mean or Std). This method deals with both double branch and vectors when their size is constant through patterns.

Warning
if the vector size is not constant through all considered patterns, no computation is done.
Parameters
varexplist of variable to be used
selectionadditional selection to be used on top of the global one defined by TDataServer::setSelect()
optionno specific option so far

Referenced by ClassImp(), and ClassImp().

◆ createTuple()

void URANIE::DataServer::TDataServer::createTuple ( Option_t *  option = "")

Creates the tuple of the TDataServer.

Referenced by ClassImp().

◆ delAttribute()

void URANIE::DataServer::TDataServer::delAttribute ( TString  name)

Deletes an attribute given by these name.

This methods remove the TAttribute from the list of attribute but the corresponding branch is not destroyed in the tree.

Parameters
name(TString) The name of the attribute to delete
Exceptions
theattribute does not exist

Referenced by ClassImp().

◆ deleteTuple()

void URANIE::DataServer::TDataServer::deleteTuple ( )

Delete the TDSNtupleD of _datatree variable.

Referenced by ClassImp().

◆ doBanner()

static Int_t URANIE::DataServer::TDataServer::doBanner ( )
inlinestatic

◆ Draw()

void URANIE::DataServer::TDataServer::Draw ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)
inline

Draws histogram for a given index of a variable.

Calls TDataServer::draw method

References draw().

Referenced by ClassImp().

◆ draw() [1/2]

void URANIE::DataServer::TDataServer::draw ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "",
bool  internalCall = kFALSE 
)

Draws histogram for a given index of a variable.

Parameters
varexp(const char*) name of the attribute
selection(const char*) the formula to select pattern ("")
option(Option_t*) drawing options ("") The "nclass=" option allows to chose the number of histogram bins. Uranie provides 4 choices:
  • nclass=root: uses the ROOT's default number of bins
  • nclass=sturges: computes the number of bins via struges method
  • nclass=fd: computes the number of bins via fd method
  • nclass=scott: computes the number of bins via scott method
  • nclass=n: uses n bins, where n is a positive integer value

Referenced by ClassImp(), ClassImp(), ClassImp(), and Draw().

◆ draw() [2/2]

void URANIE::DataServer::TDataServer::draw ( UInt_t  nOrder,
const char *  selection = "",
Option_t *  option = "" 
)

Draw a histogram of the attribute specified by its index in the TDataServer.

The index refers to the position at which the attribute was inserted into the TDataServer

Parameters
nOrder(Int_t) Index of the attribute
selection(const char*) the formula to select pattern ("")
option(Option_t*) drawing options ("")

◆ drawBoxPlot()

void URANIE::DataServer::TDataServer::drawBoxPlot ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)

Referenced by ClassImp().

◆ drawCDF()

void URANIE::DataServer::TDataServer::drawCDF ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)

CDF d'une variable.

Referenced by ClassImp().

◆ drawCDFRaFu()

void URANIE::DataServer::TDataServer::drawCDFRaFu ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)

Draw a CDF of a TPossibility attribute (RaFu)

Referenced by ClassImp().

◆ drawCobWeb()

void URANIE::DataServer::TDataServer::drawCobWeb ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)

Draw a cobweb.

Referenced by ClassImp().

◆ drawCopulogram()

void URANIE::DataServer::TDataServer::drawCopulogram ( const char *  varexp = "*",
const char *  selection = "",
Option_t *  option = "" 
)

draw the scatterplots for each possible pairs $(x_j, x_i)$ and ranks $(Rk_x_j, Rk_x_i)$

Parameters
varexp(const char*) the list of attributes to draw the pairs ("*"). By default, ("*") all the attributs are used.
selection(const char*) the formula to select pattern ("")
option(Option_t*) drawing options (""). No more ROOT options are treated.

Referenced by ClassImp().

◆ drawECDF()

void URANIE::DataServer::TDataServer::drawECDF ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)

Experimental CDF of a single variable.

This function differs from drawCDF on the fact that it doesn't produce a histogram. Instead, each datum is plotted, which produces a curve that is more accurate but maybe not as smooth as the one given by drawCDF.

Referenced by ClassImp().

◆ drawHistogram()

void URANIE::DataServer::TDataServer::drawHistogram ( const char *  sVar,
const char *  selection = "",
Option_t *  option = "" 
)

Histogram of a variable.

Referenced by ClassImp().

◆ drawIter()

void URANIE::DataServer::TDataServer::drawIter ( const char *  sVar,
const char *  selection = "",
Option_t *  option = "" 
)

Graph of a variable depanding of his apparition order in the list.

Referenced by ClassImp().

◆ drawLegend()

void URANIE::DataServer::TDataServer::drawLegend ( const char *  varexp,
const char *  selection = "",
const char *  histname = "htemp" 
)

Referenced by ClassImp().

◆ drawPairs()

void URANIE::DataServer::TDataServer::drawPairs ( const char *  varexp = "*",
const char *  selection = "",
Option_t *  option = "" 
)

draw the scatterplots for each possible pairs $(x_j, x_i)$

Parameters
varexp(const char*) the list of attributes to draw the pairs ("*"). By default, ("*") all the attributs are used.
selection(const char*) the formula to select pattern ("")
option(Option_t*) drawing options (""). No more ROOT options are treated.

Referenced by ClassImp().

◆ drawPPPlot()

void URANIE::DataServer::TDataServer::drawPPPlot ( const char *  varexp,
const char *  laws,
int  nq,
Option_t *  option = "" 
)

Draw the PP plot of a variable. With "same" in option, the plot is drawn on top of existing one.

Referenced by ClassImp().

◆ drawProfile()

void URANIE::DataServer::TDataServer::drawProfile ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)

Draws Profile.

Draw a profile (mean and sigma) from a scatterplot $ y $ versus $ x $

The profile between (xmin, xmax) value in the first abscissis and (ymin, ymax) ine the second one. where

  • xmin = min(x) + 0.01 [ Max(x) - Min(x) ]
  • xmax = Max(x) + 0.01 [ Max(x) - Min(x) ]
Exceptions
Whenthe number of attributes varexp is different to 2

Referenced by ClassImp().

◆ drawQQorPPPlot()

void URANIE::DataServer::TDataServer::drawQQorPPPlot ( const char *  varexp,
const char *  laws,
int  nq,
Option_t *  option 
)

Internal method, not to be used standalonely.

Draw the QQ plot of a variable. With "same" in option, the plot is drawn on top of existing one.

Referenced by ClassImp().

◆ drawQQPlot()

void URANIE::DataServer::TDataServer::drawQQPlot ( const char *  varexp,
const char *  laws,
int  nq,
Option_t *  option = "" 
)

Draw the QQ plot of a variable. With "same" in option, the plot is drawn on top of existing one.

Referenced by ClassImp().

◆ drawScatterplot()

void URANIE::DataServer::TDataServer::drawScatterplot ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)

Draws Scatterplots.

Referenced by ClassImp().

◆ drawTufte()

void URANIE::DataServer::TDataServer::drawTufte ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)

Draw 2D scatterplots "tufte".

See http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=81

Referenced by ClassImp().

◆ estimateQuantile() [1/2]

void URANIE::DataServer::TDataServer::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)

Returns an estimate of the quantile of the attribute "attName" corresponding to the given probability and confidence level.

Parameters
attName(const char*) name of the attribute.
Warning
if more than one attribute name is given, only the first one will be used !
Parameters
nProbanumber of quantiles to compute
proba(Double_t) Proba for which the quantile is computed.
quantile(Double_t &) Variable storing the result
confidence(Double_t)[0.5] confidence level
option(Option_t)[""] Options passed to the method if option contains "interpolate", use the interpolate method between two values
Warning
The result is stored in quantile for double-branch case. In the case of vector, quantile contains only the last element quantile values. In all cases, the quantiles are stored in the attribute itself and can be accessed through getQuantile methods.

◆ estimateQuantile() [2/2]

void URANIE::DataServer::TDataServer::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)

Returns an estimate of the quantiles of the attribute "attName" corresponding to the given probabilities and confidence level. This method calls TDataServer::estimateQuantile(const char attName, Int_t nProba, Double_t proba, Double_t* quantile, Double_t confidence = 0.5, Option_t *option = ""). See its explanation for more details

Parameters
nProbanumber of quantiles to compute
proba(Double_t) Proba for which the quantile is computed.
quantile(Double_t &) Variable storing the result
Warning
The results are stored in quantile for double-branch case. In the case of vector, quantile contains only the last element quantile values. In all cases, the quantiles are stored in the attribute itself and can be accessed through getQuantile methods.

Referenced by ClassImp().

◆ exportData()

void URANIE::DataServer::TDataServer::exportData ( const char *  filename,
const char *  varexp = "*",
const char *  select = "",
Option_t *  option = "" 
)

Exports the data in a ASCII file.

The ASCII File can be loaded with a TDataServer object

Parameters
filename(const char *) File name
varexp(const char *)["*"] The list of attributes to export separated by the character ":"
select(const char *)[""] The selection of patterns to the export
optioncan precise the precision with which the double are written by typing "precision=" with a digit from 1 to 9

Referenced by ClassImp(), and ClassImp().

◆ exportDataContext()

void URANIE::DataServer::TDataServer::exportDataContext ( const char *  filename,
const char *  varexp = "*",
const char *  select = "" 
)

Export data in a tex file with a ConTex format.

Exports the data in a tex file (not modified to deal with Vectors/Strings)

Parameters
filename(const char *) File name
varexp(const char *)["*"] The list of attributes to export separated by the character ":"
select(const char *)[""] The selection of patterns to the export

Referenced by ClassImp().

◆ exportDataHeader()

void URANIE::DataServer::TDataServer::exportDataHeader ( const char *  filename,
const char *  varexp = "*",
const char *  select = "",
Option_t *  option = "" 
)

Exports the data in a header file ( C / C++)

Export the data as a header file so that they can be included in a C++ code. Vectors used an initialisation style that is only compliant to C++11, but have not yet been tested

Parameters
filename(const char *) File name
varexp(const char *)["*"] The list of attributes to export separated by the character ":"
select(const char *)[""] The selection of patterns to the export
optioncan precise the precision with which the double are written by typing "precision="

Referenced by ClassImp().

◆ exportDataNeMo()

void URANIE::DataServer::TDataServer::exportDataNeMo ( const char *  filename,
const char *  varexpinput,
const char *  varexpoutput,
const char *  select = "" 
)

Exports the data in a ASCII file reading by NeMo.

The ASCII File will be load with the NeMo tool

The format of this file is as the following next

#NombreExemples 53
#NombreEntrees 2
#NombreSorties 1
 
1.800000000e+00 5.400000000e+01 5.400000000e+01 
1.950000000e+00 5.100000000e+01 5.100000000e+01 
1.833000000e+00 5.400000000e+01 5.400000000e+01
...
using
TDataServer *tds = new TDataServer("tdsgeyser", "Data from the geyser");
tds->fileDataRead("geyser.dat");
tds->addAttribute("y", "sqrt(x2) * x1");
tds->exportDataNeMo("geyser.nemo", "x1:x2", "y", "x2<55.0");
void addAttribute(TString name, Double_t dmin, Double_t dmax)
Adds an attribute with the name and the range.
void exportDataNeMo(const char *filename, const char *varexpinput, const char *varexpoutput, const char *select="")
Exports the data in a ASCII file reading by NeMo.
Bool_t fileDataRead(const char *name, Bool_t bSave=kTRUE, Bool_t bDontAddAttribute=kFALSE, Option_t *option="")
Reads a ASCII file with a header.
Parameters
filename(const char *) File name
varexpinput(const char *) The list of input attributes to export separated by the character ":"
varexpoutput(const char *) The list of output attributes to export separated by the character ":"
select(const char *)[""] The selection of patterns to the export

Referenced by ClassImp().

◆ fileDataRead()

Bool_t URANIE::DataServer::TDataServer::fileDataRead ( const char *  name,
Bool_t  bSave = kTRUE,
Bool_t  bDontAddAttribute = kFALSE,
Option_t *  option = "" 
)

Reads a ASCII file with a header.

The format of the ASCII datafile is similar to the format of \salome , except for the line containing titles of variables.

Parameters
name(const char*) The name of the ASCII file
bSave(Bool_t) true if we save the data in a binary file, false else.
bDontAddAttribute(Bool_t) Default is false. If true and an attribute is already found in TDataSpecification with a given name, no new TAttribute is created. With this option one can use fileDataRead with a TDS in which one needs to specify TStochasticAttribute for instance

Referenced by ClassImp(), and ClassImp().

◆ fillAttribute()

void URANIE::DataServer::TDataServer::fillAttribute ( TString  name,
TString  formula = "",
Bool_t  update = kTRUE 
)

Fills a new Branch for an attribute by applying the given formula.

This function takes the name of an existing attribute and creates a new branch for it in the data tree. Then, it fills the branch according to the given formula. If the attribute is a TAttributeFormula, its formula is used.

Parameters
name(TString): name of the attribute.
formula(TString): formula to apply if the attribute isn't a TAttributeFormula (default = "")
update(Bool_t): tells to update the "backup" file of the data server or not. As the operation of writting data on disk can be very slow, it can be useful to set this parameter to kFALSE to disable it (default = kTRUE)
Exceptions
UranieErrorif there is no data tree.
UranieErrorif the attribute doesn't exist
UranieErrorif the attribute is a TAttributeFormula and the formula parameter is not empty.
UranieErrorif the attribute isn't a TAttributeFormula and the formula parameter is empty
UranieErrorif the formula is unvalid.
UranieErrorif the attribute is already filled.

Referenced by ClassImp().

◆ fillConstantAttribute()

void URANIE::DataServer::TDataServer::fillConstantAttribute ( TString  name,
UEntry *  ConstUEntry 
)

Fills a new Branch for an attribute by copying a constant uentry.

Very advanced, this function is mainly used internly to help dealing with constant attribute that could be string or vector and that could be written in the output sample.

Parameters
name(TString): name of the attribute.
ConstUEntry(UEntry*)UEntry containing the information to be stored.
update(Bool_t): tells to update the "backup" file of the data server or not. As the operation of writting data on disk can be very slow, it can be useful to set this parameter to kFALSE to disable it (default = kTRUE)
Exceptions
UranieErrorif there is no data tree.
UranieErrorif the UEntry doesn't contains data
UranieErrorif the attribute is already filled.

Referenced by ClassImp().

◆ fillOthersAttributes()

void URANIE::DataServer::TDataServer::fillOthersAttributes ( bool  update = kFALSE)

fill TFormula attributes

Referenced by ClassImp().

◆ findParametersLaw()

static void URANIE::DataServer::TDataServer::findParametersLaw ( TString  soption,
vector< double > &  vec,
bool  blog 
)
static

Referenced by ClassImp().

◆ getArchiveFileName()

char * URANIE::DataServer::TDataServer::getArchiveFileName ( )

Returns the name of the archive file.

Referenced by ClassImp().

◆ getAttribute() [1/2]

TAttribute * URANIE::DataServer::TDataServer::getAttribute ( Int_t  ind,
bool  onlyAttribute = kTRUE 
)

Returns a pointer of the attribute given by this name.

Parameters
indindex of the attribute
onlyAttributeboolean to specify if the list of attribute should contains only real attribute (kAttribute and kConstant), or all kind of attribute (kInternal and kIterator as well)
Exceptions
Ifan attribute with this name does not exist.

◆ getAttribute() [2/2]

TAttribute * URANIE::DataServer::TDataServer::getAttribute ( TString  str)

Returns a pointer of the attribute given by this name.

Exceptions
Ifan attribute with this name does not exist.

Referenced by ClassImp(), ClassImp(), ClassImp(), and ClassImp().

◆ getAttributeIndex() [1/2]

int URANIE::DataServer::TDataServer::getAttributeIndex ( TAttribute att,
bool  onlyAttribute = false 
) const

Returns the index of the attribute.

Return the index of the attribute under study in the list of attribute

Parameters
attattribute under study
onlyAttributeboolean to specify if the list of attribute should contains only kAttribute and kConstant, or all kind of attribute (kInternal and kIterator as well)

Referenced by ClassImp().

◆ getAttributeIndex() [2/2]

int URANIE::DataServer::TDataServer::getAttributeIndex ( TString  name,
bool  onlyAttribute = false 
) const

Returns the index of the attribute.

Return the index of the attribute under study in the list of attribute

Parameters
attattribute under study
onlyAttributeboolean to specify if the list of attribute should contains only real attribute (kAttribute and kConstant), or all kind of attribute (kInternal and kIterator as well)

◆ getCut()

TCut URANIE::DataServer::TDataServer::getCut ( )
inline

Return the selection TCut.

References _ccut.

◆ getDataFileName()

char * URANIE::DataServer::TDataServer::getDataFileName ( )

Returns the name of the file.

Referenced by ClassImp().

◆ getDataSpecification()

TDataSpecification * URANIE::DataServer::TDataServer::getDataSpecification ( )
inline

Return a TDataSpecification pointer.

◆ getDataTreeName()

char * URANIE::DataServer::TDataServer::getDataTreeName ( )

Returns the name of the tree.

Referenced by ClassImp().

◆ getIteratorName()

const char * URANIE::DataServer::TDataServer::getIteratorName ( )
inline

Returns the name of the iterator.

References _biteratorNameChanged, and _siteratorChangedName.

Referenced by ClassImp(), and ClassImp().

◆ getListOfAttributes()

TList * URANIE::DataServer::TDataServer::getListOfAttributes ( const char *  sListOfAttributes = "*",
bool  onlyAttribute = true 
)

Gets the list of attributes from a string.

Returns the list of attributes. The character "*" means all attributes.

Parameters
onlyAttributeboolean to specify if the list of attribute should contains only kAttribute and kConstant, or all kind of attribute (kInternal and kIterator as well)

Referenced by ClassImp(), and cleanStatAndQuantiles().

◆ getLog()

Bool_t URANIE::DataServer::TDataServer::getLog ( )
inline

References _blog.

◆ getMatrix()

TMatrixD URANIE::DataServer::TDataServer::getMatrix ( const char *  varexp = "*",
const char *  selection = "",
Option_t *  option = "" 
)

Returns the matrix of data.

Works only

Referenced by ClassImp().

◆ getNAttributes()

Int_t URANIE::DataServer::TDataServer::getNAttributes ( bool  onlyAttribute = true)

Returns the number of attributes in the TDataServer.

Returns the number of attributes

Parameters
onlyAttributeboolean to specify if the list of attribute should contains only real attribute (kAttribute and kConstant), or all kind of attribute (kInternal and kIterator as well)

Referenced by ClassImp(), and ClassImp().

◆ getNInputAttributes()

Int_t URANIE::DataServer::TDataServer::getNInputAttributes ( )

Return the number of input Attributes.

Return the number of attributes which are Input attributes

Referenced by ClassImp().

◆ getNOutputAttributes()

Int_t URANIE::DataServer::TDataServer::getNOutputAttributes ( )

Return the number of output Attributes.

Return the number of attributes which are Ouput attributes

Referenced by ClassImp().

◆ getNPatterns()

Int_t URANIE::DataServer::TDataServer::getNPatterns ( )

Returns the number of patterns in the TDataServer.

Exceptions
theTNtuple is NULL

Referenced by ClassImp(), and ClassImp().

◆ getOrigin()

EOrigin URANIE::DataServer::TDataServer::getOrigin ( )
inline

Return the origin of the considered TDS.

References _norigin.

◆ getString()

string URANIE::DataServer::TDataServer::getString ( TString  attName,
Int_t  entry 
)

Returns a string for entry "entry" of the leaf "attName".

Exceptions
ifattribute is a vector or double
ifattribute is not existing

Referenced by ClassImp(), and ClassImp().

◆ getStringListOfAttributes()

string URANIE::DataServer::TDataServer::getStringListOfAttributes ( bool  onlyNumerical = true,
bool  onlyAttribute = true 
)

Gets the list of attributes as a string.

Returns the list of attributes as a string in classical uranie format.

Parameters
onlyNumericalboolean to specify if the list of attribute should contains only kDouble and kVector, or whether it should include kString as well.
onlyAttributeboolean to specify if the list of attribute should contains only kAttribute and kConstant, or all kind of attribute (kInternal and kIterator as well)

Referenced by ClassImp().

◆ GetTuple()

TDSNtupleD * URANIE::DataServer::TDataServer::GetTuple ( Option_t *  option = "V")
inline

Returns a pointer to the TDSNtupleD.

Parameters
optionuseless so far

References getTuple().

Referenced by ClassImp().

◆ getTuple()

TDSNtupleD * URANIE::DataServer::TDataServer::getTuple ( Option_t *  option = "V")

Returns a pointer to the TDSNtupleD.

Parameters
optionuseless so far

Referenced by ClassImp(), ClassImp(), ClassImp(), ClassImp(), and GetTuple().

◆ getUranieVersion()

static TString URANIE::DataServer::TDataServer::getUranieVersion ( )
inlinestatic

◆ getValue()

Double_t URANIE::DataServer::TDataServer::getValue ( TString  attName,
Int_t  entry,
Int_t  ielement = -1 
)

Returns the value at index "entry" of the leaf "attName".

If ielement != -1 it returns the ielement-th of the vector, if the concerned attribute is a vector

Exceptions
ifattribute is a string
ifattribute is a string and ielement == -1 or ielement > vector.size()

Referenced by ClassImp(), and ClassImp().

◆ getVector()

vector< double > URANIE::DataServer::TDataServer::getVector ( TString  attName,
Int_t  entry 
)

Returns a vector of double for entry "entry" of the leaf "attName".

Exceptions
ifattribute is a string or double
ifattribute is not existing

Referenced by ClassImp().

◆ hasTuple()

Bool_t URANIE::DataServer::TDataServer::hasTuple ( )
inline

Check if the data server contains data.

This function returns TRUE if the data server contains a TDSNtupleD. It returns FALSE otherwise.

References _datatree.

◆ internalQuantilesComputation()

void URANIE::DataServer::TDataServer::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.

Description

This is a rewriting of the ROOT::TMath::Quantiles() function which was found buggy as of February 2010. The present algorithm is derived from http://mathworld.wolfram.com/Quantile.html. The function prototype is the same as ROOT::TMath::Quantiles.

Warning
Internal method not to be called by users

Referenced by ClassImp().

◆ isAttribute()

Bool_t URANIE::DataServer::TDataServer::isAttribute ( TString  name) const

Checks if the attribute given by a name exist.

Returns
kTRUE if an attribute given by the name exist, else kFALSE

Referenced by ClassImp(), ClassImp(), ClassImp(), and ClassImp().

◆ keepFinalTuple()

void URANIE::DataServer::TDataServer::keepFinalTuple ( bool  val)
inline

References _bsaveTuple.

◆ loadTree()

Bool_t URANIE::DataServer::TDataServer::loadTree ( TTree *  tt)

Load a tree.

Referenced by ClassImp().

◆ merge()

void URANIE::DataServer::TDataServer::merge ( TDataServer tds,
const char *  varexpinput = "*",
bool  bwithFriend = kFALSE 
)

Concatenates the variables of two dataservers.

Both dataservers must have the name numbers of entries. Variables names are tested before considering their value, so if a variable already exists in both tables the second one is copied as well, changing its name to "tdsname.variablename"

dot_inline_dotgraph_1.png

One of the optional argument set the use of ROOT::AddFriend method (previous default). This method does not make the new variable visible from a TTree::Scan or when looking at list of Attributes available in the TDS. The new default (bwithFriend==false) is a proper concatenation that allows to close and delete the second tds once the merging is done.

Parameters
tds(TDataServer *) pointer of the DataServer to be merged into the original tds.
varexpinputlist of attribute from the second tds to be merged
bwithFriendsuse ROOT friend method or copy the information completely in the original tds
Exceptions
ifboth dataservers have not the same number of patterns

Referenced by ClassImp().

◆ mix()

void URANIE::DataServer::TDataServer::mix ( )

Mix the patterns.

To mix the patterns

Referenced by ClassImp().

◆ normalize()

void URANIE::DataServer::TDataServer::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 $[-1.0, 1.0]$ or $[0.0, 1.0]$)

Several methods of normalisation are provided:

  • CenterReduct : kCR [Default]

    \[
\tilde{x} = \frac{x - \mu_{x}}{\sigma_{x}}
\]

  • Centered : kCentered

    \[
\tilde{x} = x - \mu_{x}
\]

  • transform $x$ on the interval $[-1.0, 1.0]$ : kMinusOneOne

    \[
\tilde{x} = 2.0 * \frac{ x - x_{Min}}{x_{Max} - x_{Min}} -1.0
\]

  • transform $x$ on the interval $[0.0, 1.0]$ : kZeroOne

    \[
\tilde{x} = \frac{ x - x_{Min}}{x_{Max} - x_{Min}}
\]

The name of the normalized attribute is given by the name of the original attribute and the suffix string.

Parameters
varexp(const char*) The list of attributes
suffix(const char*)["CR"] The suffix caracter to add of each attributes to create the normalize attribute
method(ENormalisation)[kCR] the method of normalisation
global(bool)[true]: Use only in the case of vector, this boolean explicitely state whether the min, max, mean and std are the global one (only one for all patterns and all vector elements) or not (then specific min, max, mean and std are used for every component of the vector)

Referenced by ClassImp().

◆ ntupleDataRead()

Bool_t URANIE::DataServer::TDataServer::ntupleDataRead ( const char *  file,
const char *  tree,
const char *  svar = "*",
const char *  cut = "" 
)

Reads data from a TDSNtupleD in a ROOT file.

This methods takes an existing file and read the tree to load it. On the contrary to loadTree, TDataSpecification is assumed to be empty while the TDSNtupleD is rebuilt completly deleting.

Parameters
fileThe name of the root file
treeThe name of the TDSNtupleD
svarThe list of attributes. Formula are possible
cutThe selection of patterns. Points that verify this criterion are excluded (as explicitely said by the name cut)
Exceptions
Can'topen a file, the tree is not found in the input file or is empty, the TDS is not empty,

Referenced by ClassImp().

◆ printLog()

virtual void URANIE::DataServer::TDataServer::printLog ( Option_t *  option = "")
virtual

Referenced by ClassImp(), and ClassImp().

◆ saveTuple()

void URANIE::DataServer::TDataServer::saveTuple ( Option_t *  option)

Save the ntupleD in the archive (ROOT File)

The name of the ROOT file is given by the name of

Parameters
option(Option_t*) [""] The option is the second argument of TFile::Open method (UPDATE|NEW|RECREATE)

Referenced by ClassImp().

◆ Scan()

Int_t URANIE::DataServer::TDataServer::Scan ( const char *  varexp,
const char *  selection = "",
Option_t *  option = "" 
)
inline

Scan content of the TDS.

Calls TDataServer::scan method

References scan().

Referenced by ClassImp().

◆ scan()

Int_t URANIE::DataServer::TDataServer::scan ( const char *  varexp = "",
const char *  selection = "",
Option_t *  option = "" 
)

Scan content of the TDS.

Print out the content of the tree given the parameter requested

Parameters
varexplist of attribute to be dumped
selectionselection criterion to be applied on top of the global one
optionoption to be passed to ROOT::TTree::Scan method (which is call at the end)

Referenced by ClassImp(), and Scan().

◆ setCut() [1/3]

void URANIE::DataServer::TDataServer::setCut ( const char *  str)
inline

Specifies the criterion to exclude individuals.

References _ccut, and cleanStatAndQuantiles().

◆ setCut() [2/3]

void URANIE::DataServer::TDataServer::setCut ( TCut  cut)
inline

Specifies the criterion to exclude individuals.

References _ccut, and cleanStatAndQuantiles().

◆ setCut() [3/3]

void URANIE::DataServer::TDataServer::setCut ( TString  str)
inline

Specifies the criterion to exclude individuals.

The cut is tested and if it differs from the previous one (currently used) the quantiles and statistical caracteristic of the attributes are cleared.

Parameters
str(TString) A string to define rejection criterion.

References _ccut, and cleanStatAndQuantiles().

◆ setIterator()

void URANIE::DataServer::TDataServer::setIterator ( TString  sname)

Sets an iterator.

Defines the attribute named sname as an index.

Parameters
sname(TString) The name of the attribute which is defined as an index

Referenced by ClassImp().

◆ setLog()

void URANIE::DataServer::TDataServer::setLog ( )
inline

References _blog.

◆ SetName()

void URANIE::DataServer::TDataServer::SetName ( const char *  name)

Change the name.

Method added to deal with the registration of the dataserver in gROOT; It overwrite the TObject one.

Referenced by ClassImp().

◆ setSelect()

void URANIE::DataServer::TDataServer::setSelect ( TString  str)
inline

Specifies the criterion by a string to select individuals.

The selection is tested and if it differs from the previous one (currently used) the quantiles and statistical caracteristic of the attributes are cleared.

Parameters
str(TString) A string to define selection criterion.

References _ccut, and cleanStatAndQuantiles().

◆ setTuple() [1/2]

void URANIE::DataServer::TDataServer::setTuple ( TDSNtupleD ntd,
bool  newismain = true,
const char *  att = "*" 
)
inline

Set the TDSNtupleD of _datatree variable.

Parameters
ntd(TDSNtupleD *) a pointer on a TDSNtupleD. The pointer is not deleted before the (new) value is set. If _datatree has already been initialized, you might want to use the deleteTuple method before to avoid memory leak.

References _datatree.

◆ setTuple() [2/2]

void URANIE::DataServer::TDataServer::setTuple ( TTree *  ntd,
bool  newismain = true 
)
inline

Set the TDSNtupleD of _datatree variable.

Parameters
ntd(TTree *) a pointer on a TTree. The pointer is not deleted before the (new) value is set. If _datatree has already been initialized, you might want to use the deleteTuple method before to avoid memory leak.

References _datatree.

◆ startViewer()

void URANIE::DataServer::TDataServer::startViewer ( )

Referenced by ClassImp(), and StartViewer().

◆ StartViewer()

void URANIE::DataServer::TDataServer::StartViewer ( )
inline

References startViewer().

Referenced by ClassImp().

◆ unsetLog()

void URANIE::DataServer::TDataServer::unsetLog ( )
inline

References _blog.

Member Data Documentation

◆ _biteratorNameChanged

Bool_t URANIE::DataServer::TDataServer::_biteratorNameChanged

To know whether this iterator name has been changed.

Referenced by changeIteratorName(), and getIteratorName().

◆ _blog

Bool_t URANIE::DataServer::TDataServer::_blog

log printing

Referenced by changeLog(), ClassImp(), getLog(), setLog(), and unsetLog().

◆ _bQuantVectPrinted

Bool_t URANIE::DataServer::TDataServer::_bQuantVectPrinted

print the message for the vector quantile calculation only once

Referenced by ClassImp().

◆ _bsaveTuple

Bool_t URANIE::DataServer::TDataServer::_bsaveTuple

Referenced by ClassImp(), and keepFinalTuple().

◆ _canvas

TCanvas* URANIE::DataServer::TDataServer::_canvas

The canvas to work on;.

Referenced by ClassImp().

◆ _ccut

TCut URANIE::DataServer::TDataServer::_ccut

Selection of pattern.

Referenced by ClassImp(), clearSelect(), getCut(), setCut(), setCut(), setCut(), and setSelect().

◆ _datatree

ClassDef (URANIE::DataServer::TDataServer, ID_DATASERVER) private TDSNtupleD* URANIE::DataServer::TDataServer::_datatree

< Specification of data

Tree with data

Referenced by ClassImp(), hasTuple(), setTuple(), and setTuple().

◆ _drawingGarbageCollector

TObjArray* URANIE::DataServer::TDataServer::_drawingGarbageCollector

Garbage collector list for drawing.

Referenced by ClassImp().

◆ _fLogger

URANIE::DataServer::UMessageLogger* URANIE::DataServer::TDataServer::_fLogger

Message logger.

Referenced by ClassImp().

◆ _friend

TTree* URANIE::DataServer::TDataServer::_friend

Tree added by friend method.

Referenced by ClassImp().

◆ _norigin

EOrigin URANIE::DataServer::TDataServer::_norigin

The origin of the dataserver (ASCII File, TTree, SQL...)

Referenced by ClassImp(), and getOrigin().

◆ _pelBootstrap

TPatternsEventList* URANIE::DataServer::TDataServer::_pelBootstrap

The bootstrap list of input pattern.

Referenced by ClassImp().

◆ _sarchivefile

TString URANIE::DataServer::TDataServer::_sarchivefile

The archive file (.root)

Referenced by ClassImp().

◆ _sdatafile

TString URANIE::DataServer::TDataServer::_sdatafile

The original data file (ASCII mode)

Referenced by ClassImp().

◆ _shortDataTreeName

TString URANIE::DataServer::TDataServer::_shortDataTreeName

The shortened name of the TDataServer;.

Referenced by ClassImp().

◆ _siteratorChangedName

TString URANIE::DataServer::TDataServer::_siteratorChangedName

The shortened name of the TDataServer;.

Referenced by changeIteratorName(), and getIteratorName().