Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
VariableDecorrTransform.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 : VariableDecorrTransform *
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  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
16  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
17  * *
18  * Copyright (c) 2005: *
19  * CERN, Switzerland *
20  * U. of Victoria, Canada *
21  * MPI-K Heidelberg, Germany *
22  * *
23  * Redistribution and use in source and binary forms, with or without *
24  * modification, are permitted according to the terms listed in LICENSE *
25  * (http://tmva.sourceforge.net/LICENSE) *
26  **********************************************************************************/
27 
28 #ifndef ROOT_TMVA_VariableDecorrTransform
29 #define ROOT_TMVA_VariableDecorrTransform
30 
31 //////////////////////////////////////////////////////////////////////////
32 // //
33 // VariableDecorrTransform //
34 // //
35 // Linear interpolation class //
36 // //
37 //////////////////////////////////////////////////////////////////////////
38 
39 #include "TMatrixDfwd.h"
40 
41 #include "TMatrixDSymfwd.h"
42 
44 
45 namespace TMVA {
46 
47  class VariableDecorrTransform : public VariableTransformBase {
48 
49  public:
50 
51  VariableDecorrTransform( DataSetInfo& dsi );
52  virtual ~VariableDecorrTransform( void );
53 
54  void Initialize();
55  Bool_t PrepareTransformation (const std::vector<Event*>&);
56 
57  // virtual const Event* Transform(const Event* const, Types::ESBType type = Types::kMaxSBType) const;
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 
64  virtual void AttachXMLTo(void* parent);
65  virtual void ReadFromXML( void* trfnode );
66 
67  virtual void PrintTransformation( std::ostream & o );
68 
69  // writer of function code
70  virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
71 
72  // provides string vector giving explicit transformation
73  std::vector<TString>* GetTransformationStrings( Int_t cls ) const;
74 
75  private:
76 
77  // mutable Event* fTransformedEvent; //! local event copy
78  std::vector<TMatrixD*> fDecorrMatrices; //! Decorrelation matrix [class0/class1/.../all classes]
79 
80  void CalcSQRMats( const std::vector< Event*>&, Int_t maxCls );
81  std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector<const Event*>& events, Int_t maxCls );
82 
83  ClassDef(VariableDecorrTransform,0); // Variable transformation: decorrelation
84  };
85 
86 } // namespace TMVA
87 
88 #endif
89