Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "Rtypes.h"
41#include "TString.h"
42#include "TMVA/Types.h"
43#include "TNamed.h"
44
45namespace TMVA {
46
47 class VariableInfo:public TNamed {
48
49 public:
50
51 VariableInfo( const TString& expression, const TString& title, const TString& unit,
52 Int_t varCounter, char varType = 'F', void* external = 0,
53 Double_t min = 0, Double_t max = 0, Bool_t normalized=kTRUE );
55 VariableInfo( const VariableInfo& other );
57 const TString& GetExpression() const { return fExpression; }
58 const TString& GetInternalName() const { return fInternalName; }
59 const TString& GetLabel() const { return fLabel; }
60 const TString& GetUnit() const { return fUnit; }
61 char GetVarType() const { return fVarType; }
62
63 Double_t GetMin () const { return fXminNorm; }
64 Double_t GetMax () const { return fXmaxNorm; }
65 Double_t GetMean() const { return fXmeanNorm; }
66 Double_t GetRMS () const { return fXrmsNorm; }
68
69 void SetInternalName(const char *name) { fInternalName = name; }
70
71 void SetMin ( Double_t v ) { fXminNorm = v; }
72 void SetMax ( Double_t v ) { fXmaxNorm = v; }
73 void SetMean ( Double_t v ) { fXmeanNorm = v; }
74 void SetRMS ( Double_t v ) { fXrmsNorm = v; }
75 void SetExternalLink( void* p ) { fExternalData = (char*)p; }
77 void ResetMinMax() { fXminNorm = 1e30; fXmaxNorm = -1e30; }
78
79 void WriteToStream ( std::ostream& o ) const;
80 void ReadFromStream( std::istream& istr );
81 void ReadFromXML ( void* varnode );
82 void AddToXML ( void* varnode );
83 void* GetExternalLink() const { return (void*)fExternalData; }
84
85 // assignment operator (does not copy external link)
87
88 private:
89
90 // should not be set from outside this class
91 void SetExpression ( const TString& s ) { fExpression = s; }
92 void SetLabel ( const TString& s ) { fLabel = s; }
93 void SetUnit ( const TString& s ) { fUnit = s; }
94 void SetInternalVarName( const TString& s ) { fInternalName = s; }
95 void SetVarType ( char c ) { fVarType = c; }
96
97 TString fExpression; // original variable expression (can be a formula)
98 TString fInternalName; // internal variable name (needs to be regular expression)
99 TString fLabel; // variable label, set by "mylabel := var1 + var2", this is a shortcut
100 //TString fTitle; //! title for axis labels in plots; set by second string in AddVariable
101 TString fUnit; // unit for axis labels in plots; set by third string in AddVariable
102 Char_t fVarType; // the variable type to be used internally ('F'-default or 'I')
103 Double_t fXminNorm; // minimum value for correlated/decorrelated/PCA variable
104 Double_t fXmaxNorm; // maximum value for correlated/decorrelated/PCA variable
105 Double_t fXmeanNorm; // mean value for correlated/decorrelated/PCA variable
106 Double_t fXrmsNorm; // rms value for correlated/decorrelated/PCA variable
107 Double_t fXvarianceNorm; // variance value for correlated/decorrelated/PCA variable
108 Bool_t fNormalized; // variable gets normalized
109 void* fExternalData; //! if the variable content is linked to an external pointer
110 TString fExternalDataType;// type of external variable (int, long, double, float) - to be done JS
111 Int_t fVarCounter; // dummy variable
112 public:
113
115 };
116
117}
118
119#endif
#define c(i)
Definition RSha256.hxx:101
char Char_t
Definition RtypesCore.h:37
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
Class for type info of MVA input variable.
void SetMean(Double_t v)
void ReadFromXML(void *varnode)
read VariableInfo from stream
VariableInfo & operator=(const TMVA::VariableInfo &rhs)
comparison operator
void SetUnit(const TString &s)
const TString & GetLabel() const
void SetMax(Double_t v)
void SetVariance(Double_t v)
const TString & GetExpression() const
void SetExpression(const TString &s)
void SetMin(Double_t v)
char GetVarType() const
VariableInfo()
default constructor
void ReadFromStream(std::istream &istr)
read VariableInfo from stream
void SetLabel(const TString &s)
void AddToXML(void *varnode)
write class to XML
void SetInternalName(const char *name)
void SetExternalLink(void *p)
Double_t GetRMS() const
void SetVarType(char c)
Double_t GetMin() const
const TString & GetInternalName() const
void SetInternalVarName(const TString &s)
TString fExternalDataType
if the variable content is linked to an external pointer
Double_t GetVariance() const
Double_t GetMax() const
void SetRMS(Double_t v)
Double_t GetMean() const
void * GetExternalLink() const
const TString & GetUnit() const
void WriteToStream(std::ostream &o) const
write VariableInfo to stream
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Basic string class.
Definition TString.h:136
create variable transformations