Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
VariableNormalizeTransform.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 : VariableNormalizeTransform *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Decorrelation of input variables *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland *
16  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
17  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
18  * *
19  * Copyright (c) 2005: *
20  * CERN, Switzerland *
21  * U. of Victoria, Canada *
22  * MPI-K Heidelberg, Germany *
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://tmva.sourceforge.net/LICENSE) *
27  **********************************************************************************/
28 
29 #ifndef ROOT_TMVA_VariableNormalizeTransform
30 #define ROOT_TMVA_VariableNormalizeTransform
31 
32 //////////////////////////////////////////////////////////////////////////
33 // //
34 // VariableNormalizeTransform //
35 // //
36 // Linear interpolation class //
37 // //
38 //////////////////////////////////////////////////////////////////////////
39 
40 #include "TMatrixDfwd.h"
41 
43 
44 namespace TMVA {
45 
46  class VariableNormalizeTransform : public VariableTransformBase {
47 
48  public:
49 
50  typedef std::vector<Float_t> FloatVector;
51  typedef std::vector< FloatVector > VectorOfFloatVectors;
52  VariableNormalizeTransform( DataSetInfo& dsi );
53  virtual ~VariableNormalizeTransform( void );
54 
55  void Initialize();
56  Bool_t PrepareTransformation (const std::vector<Event*>&);
57 
58  virtual const Event* Transform(const Event* const, Int_t cls ) const;
59  virtual const Event* InverseTransform( const Event* const, Int_t cls ) const;
60 
61  void WriteTransformationToStream ( std::ostream& ) const;
62  void ReadTransformationFromStream( std::istream&, const TString& );
63  void BuildTransformationFromVarInfo( const std::vector<TMVA::VariableInfo>& var );
64 
65  virtual void AttachXMLTo(void* parent);
66  virtual void ReadFromXML( void* trfnode );
67 
68  virtual void PrintTransformation( std::ostream & o );
69 
70  // writer of function code
71  virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
72 
73  // provides string vector giving explicit transformation
74  std::vector<TString>* GetTransformationStrings( Int_t cls ) const;
75 
76  private:
77 
78  void CalcNormalizationParams( const std::vector< Event*>& events);
79 
80  // mutable Event* fTransformedEvent;
81 
82  VectorOfFloatVectors fMin; //! Min of source range
83  VectorOfFloatVectors fMax; //! Max of source range
84 
85  ClassDef(VariableNormalizeTransform,0); // Variable transformation: normalization
86  };
87 
88 } // namespace TMVA
89 
90 #endif