ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
VariableInfo.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : Option *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Variable type info *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
16  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
17  * *
18  * Copyright (c) 2006: *
19  * CERN, Switzerland *
20  * U. of Victoria, Canada *
21  * MPI-K Heidelberg, Germany *
22  * LAPP, Annecy, France *
23  * *
24  * Redistribution and use in source and binary forms, with or without *
25  * modification, are permitted according to the terms listed in LICENSE *
26  * (http://mva.sourceforge.net/license.txt) *
27  **********************************************************************************/
28 
29 #ifndef ROOT_TMVA_VariableInfo
30 #define ROOT_TMVA_VariableInfo
31 
32 //////////////////////////////////////////////////////////////////////////
33 // //
34 // VariableInfo //
35 // //
36 // Class for type info of MVA input variable //
37 // //
38 //////////////////////////////////////////////////////////////////////////
39 
40 #ifndef ROOT_Rtypes
41 #include "Rtypes.h"
42 #endif
43 #ifndef ROOT_TString
44 #include "TString.h"
45 #endif
46 #ifndef ROOT_TMVA_Types
47 #include "TMVA/Types.h"
48 #endif
49 
50 namespace TMVA {
51 
52  class VariableInfo {
53 
54  public:
55 
56  VariableInfo( const TString& expression, const TString& title, const TString& unit,
57  Int_t varCounter, char varType = 'F', void* external = 0,
58  Double_t min = 0, Double_t max = 0, Bool_t normalized=kTRUE );
59  VariableInfo();
60  VariableInfo( const VariableInfo& other );
62  const TString& GetExpression() const { return fExpression; }
63  const TString& GetInternalName() const { return fInternalName; }
64  const TString& GetLabel() const { return fLabel; }
65  const TString& GetTitle() const { return fTitle; }
66  const TString& GetUnit() const { return fUnit; }
67  char GetVarType() const { return fVarType; }
68 
69  Double_t GetMin () const { return fXminNorm; }
70  Double_t GetMax () const { return fXmaxNorm; }
71  Double_t GetMean() const { return fXmeanNorm; }
72  Double_t GetRMS () const { return fXrmsNorm; }
73 
74  void SetMin ( Double_t v ) { fXminNorm = v; }
75  void SetMax ( Double_t v ) { fXmaxNorm = v; }
76  void SetMean ( Double_t v ) { fXmeanNorm = v; }
77  void SetRMS ( Double_t v ) { fXrmsNorm = v; }
78  void SetExternalLink( void* p ) { fExternalData = p; }
79  void ResetMinMax() { fXminNorm = 1e30; fXmaxNorm = -1e30; }
80 
81  void WriteToStream ( std::ostream& o ) const;
82  void ReadFromStream( std::istream& istr );
83  void ReadFromXML ( void* varnode );
84  void AddToXML ( void* varnode );
85  void* GetExternalLink() const { return fExternalData; }
86 
87  // assignment operator (does not copy external link)
89 
90  private:
91 
92  // should not be set from outside this class
93  void SetExpression ( const TString& s ) { fExpression = s; }
94  void SetLabel ( const TString& s ) { fLabel = s; }
95  void SetTitle ( const TString& s ) { fTitle = s; }
96  void SetUnit ( const TString& s ) { fUnit = s; }
97  void SetInternalVarName( const TString& s ) { fInternalName = s; }
98  void SetVarType ( char c ) { fVarType = c; }
99 
100  TString fExpression; //! original variable expression (can be a formula)
101  TString fInternalName; //! internal variable name (needs to be regular expression)
102  TString fLabel; //! variable label, set by "mylabel := var1 + var2", this is a shortcut
103  TString fTitle; //! title for axis labels in plots; set by second string in AddVariable
104  TString fUnit; //! unit for axis labels in plots; set by third string in AddVariable
105  Char_t fVarType; //! the variable type to be used internally ('F'-default or 'I')
106  Double_t fXminNorm; //! minimum value for correlated/decorrelated/PCA variable
107  Double_t fXmaxNorm; //! maximum value for correlated/decorrelated/PCA variable
108  Double_t fXmeanNorm; //! mean value for correlated/decorrelated/PCA variable
109  Double_t fXrmsNorm; //! rms value for correlated/decorrelated/PCA variable
110  Bool_t fNormalized; //! variable gets normalized
111  void* fExternalData; //! if the variable content is linked to an external pointer
112  TString fExternalDataType;//! type of external variable (int, long, double, float) - to be done JS
113  Int_t fVarCounter; //! dummy variable
114  };
115 
116 }
117 
118 #endif
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Definition: vector.h:433
Double_t GetRMS() const
Definition: VariableInfo.h:72
TString fInternalName
original variable expression (can be a formula)
Definition: VariableInfo.h:101
return c
Double_t GetMin() const
Definition: VariableInfo.h:69
const TString & GetExpression() const
Definition: VariableInfo.h:62
void SetUnit(const TString &s)
Definition: VariableInfo.h:96
Bool_t fNormalized
rms value for correlated/decorrelated/PCA variable
Definition: VariableInfo.h:110
void SetTitle(const TString &s)
Definition: VariableInfo.h:95
Double_t GetMax() const
Definition: VariableInfo.h:70
VariableInfo & operator=(const TMVA::VariableInfo &rhs)
comparison operator
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Double_t fXmeanNorm
maximum value for correlated/decorrelated/PCA variable
Definition: VariableInfo.h:108
void SetLabel(const TString &s)
Definition: VariableInfo.h:94
const TString & GetInternalName() const
Definition: VariableInfo.h:63
void SetRMS(Double_t v)
Definition: VariableInfo.h:77
TString fExternalDataType
if the variable content is linked to an external pointer
Definition: VariableInfo.h:112
void SetMin(Double_t v)
Definition: VariableInfo.h:74
void SetMean(Double_t v)
Definition: VariableInfo.h:76
Double_t fXminNorm
the variable type to be used internally ('F'-default or 'I')
Definition: VariableInfo.h:106
Double_t fXmaxNorm
minimum value for correlated/decorrelated/PCA variable
Definition: VariableInfo.h:107
char GetVarType() const
Definition: VariableInfo.h:67
void SetInternalVarName(const TString &s)
Definition: VariableInfo.h:97
SVector< double, 2 > v
Definition: Dict.h:5
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
const TString & GetTitle() const
Definition: VariableInfo.h:65
const TString & GetUnit() const
Definition: VariableInfo.h:66
void * fExternalData
variable gets normalized
Definition: VariableInfo.h:111
TString fTitle
variable label, set by "mylabel := var1 + var2", this is a shortcut
Definition: VariableInfo.h:103
Char_t fVarType
unit for axis labels in plots; set by third string in AddVariable
Definition: VariableInfo.h:105
void ReadFromXML(void *varnode)
read VariableInfo from stream
VariableInfo()
default constructor
Int_t fVarCounter
type of external variable (int, long, double, float) - to be done JS
Definition: VariableInfo.h:113
Double_t fXrmsNorm
mean value for correlated/decorrelated/PCA variable
Definition: VariableInfo.h:109
void SetMax(Double_t v)
Definition: VariableInfo.h:75
double Double_t
Definition: RtypesCore.h:55
TString fLabel
internal variable name (needs to be regular expression)
Definition: VariableInfo.h:102
Double_t GetMean() const
Definition: VariableInfo.h:71
void WriteToStream(std::ostream &o) const
write VariableInfo to stream
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Definition: vector.h:440
TString fUnit
title for axis labels in plots; set by second string in AddVariable
Definition: VariableInfo.h:104
void SetExpression(const TString &s)
Definition: VariableInfo.h:93
void * GetExternalLink() const
Definition: VariableInfo.h:85
char Char_t
Definition: RtypesCore.h:29
void ReadFromStream(std::istream &istr)
void AddToXML(void *varnode)
write class to XML
void SetVarType(char c)
Definition: VariableInfo.h:98
const TString & GetLabel() const
Definition: VariableInfo.h:64
const Bool_t kTRUE
Definition: Rtypes.h:91
void SetExternalLink(void *p)
Definition: VariableInfo.h:78