File indexing completed on 2025-01-18 10:11:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef ROOT_TMVA_VariableInfo
0030 #define ROOT_TMVA_VariableInfo
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #include "Rtypes.h"
0041 #include "TString.h"
0042 #include "TMVA/Types.h"
0043 #include "TNamed.h"
0044
0045 namespace TMVA {
0046
0047 class VariableInfo:public TNamed {
0048
0049 public:
0050
0051 VariableInfo( const TString& expression, const TString& title, const TString& unit,
0052 Int_t varCounter, char varType = 'F', void* external = nullptr,
0053 Double_t min = 0, Double_t max = 0, Bool_t normalized=kTRUE );
0054 VariableInfo();
0055 VariableInfo( const VariableInfo& other );
0056 ~VariableInfo() {}
0057 const TString& GetExpression() const { return fExpression; }
0058 const TString& GetInternalName() const { return fInternalName; }
0059 const TString& GetLabel() const { return fLabel; }
0060 const TString& GetUnit() const { return fUnit; }
0061 char GetVarType() const { return fVarType; }
0062
0063 Double_t GetMin () const { return fXminNorm; }
0064 Double_t GetMax () const { return fXmaxNorm; }
0065 Double_t GetMean() const { return fXmeanNorm; }
0066 Double_t GetRMS () const { return fXrmsNorm; }
0067 Double_t GetVariance() const { return fXvarianceNorm; }
0068
0069 void SetInternalName(const char *name) { fInternalName = name; }
0070
0071 void SetMin ( Double_t v ) { fXminNorm = v; }
0072 void SetMax ( Double_t v ) { fXmaxNorm = v; }
0073 void SetMean ( Double_t v ) { fXmeanNorm = v; }
0074 void SetRMS ( Double_t v ) { fXrmsNorm = v; }
0075 void SetExternalLink( void* p ) { fExternalData = (char*)p; }
0076 void SetVariance ( Double_t v ) { fXvarianceNorm= v; }
0077 void ResetMinMax() { fXminNorm = 1e30; fXmaxNorm = -1e30; }
0078
0079 void WriteToStream ( std::ostream& o ) const;
0080 void ReadFromStream( std::istream& istr );
0081 void ReadFromXML ( void* varnode );
0082 void AddToXML ( void* varnode );
0083 void* GetExternalLink() const { return (void*)fExternalData; }
0084
0085
0086 VariableInfo& operator=(const TMVA::VariableInfo& rhs);
0087
0088 private:
0089
0090
0091 void SetExpression ( const TString& s ) { fExpression = s; }
0092 void SetLabel ( const TString& s ) { fLabel = s; }
0093 void SetUnit ( const TString& s ) { fUnit = s; }
0094 void SetInternalVarName( const TString& s ) { fInternalName = s; }
0095 void SetVarType ( char c ) { fVarType = c; }
0096
0097 TString fExpression;
0098 TString fInternalName;
0099 TString fLabel;
0100
0101 TString fUnit;
0102 Char_t fVarType;
0103 Double_t fXminNorm;
0104 Double_t fXmaxNorm;
0105 Double_t fXmeanNorm;
0106 Double_t fXrmsNorm;
0107 Double_t fXvarianceNorm;
0108 Bool_t fNormalized;
0109 void* fExternalData;
0110 TString fExternalDataType;
0111 Int_t fVarCounter;
0112 public:
0113
0114 ClassDef(VariableInfo,1);
0115 };
0116
0117 }
0118
0119 #endif