Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include <vector>
46
47namespace TMVA {
48
50
51 public:
52
54 virtual ~VariableDecorrTransform( void );
55
56 void Initialize();
57 Bool_t PrepareTransformation (const std::vector<Event*>&);
58
59 // virtual const Event* Transform(const Event* const, Types::ESBType type = Types::kMaxSBType) const;
60 virtual const Event* Transform(const Event* const, Int_t cls ) const;
61 virtual const Event* InverseTransform(const Event* const, Int_t cls ) const;
62
63 void WriteTransformationToStream ( std::ostream& ) const;
64 void ReadTransformationFromStream( std::istream&, const TString& );
65
66 virtual void AttachXMLTo(void* parent);
67 virtual void ReadFromXML( void* trfnode );
68
69 virtual void PrintTransformation( std::ostream & o );
70
71 // writer of function code
72 virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
73
74 // provides string vector giving explicit transformation
75 std::vector<TString>* GetTransformationStrings( Int_t cls ) const;
76
77 private:
78
79 // mutable Event* fTransformedEvent; //! local event copy
80 std::vector<TMatrixD*> fDecorrMatrices; //! Decorrelation matrix [class0/class1/.../all classes]
81
82 void CalcSQRMats( const std::vector< Event*>&, Int_t maxCls );
83 std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector<const Event*>& events, Int_t maxCls );
84
85 ClassDef(VariableDecorrTransform,0); // Variable transformation: decorrelation
86 };
87
88} // namespace TMVA
89
90#endif
91
#define ClassDef(name, id)
Definition Rtypes.h:325
Class that contains all the data information.
Definition DataSetInfo.h:62
Linear interpolation class.
virtual void PrintTransformation(std::ostream &o)
prints the transformation matrix
virtual void MakeFunction(std::ostream &fout, const TString &fncName, Int_t part, UInt_t trCounter, Int_t cls)
creates C++ code fragment of the decorrelation transform for inclusion in standalone C++ class
virtual ~VariableDecorrTransform(void)
destructor
std::vector< TMatrixD * > fDecorrMatrices
Bool_t PrepareTransformation(const std::vector< Event * > &)
calculate the decorrelation matrix and the normalization
std::vector< TMatrixDSym * > * CalcCovarianceMatrices(const std::vector< const Event * > &events, Int_t maxCls)
void CalcSQRMats(const std::vector< Event * > &, Int_t maxCls)
Decorrelation matrix [class0/class1/.../all classes].
virtual void ReadFromXML(void *trfnode)
Read the transformation matrices from the xml node.
std::vector< TString > * GetTransformationStrings(Int_t cls) const
creates string with variable transformations applied
void WriteTransformationToStream(std::ostream &) const
write the decorrelation matrix to the stream
virtual void AttachXMLTo(void *parent)
node attachment to parent
virtual const Event * Transform(const Event *const, Int_t cls) const
apply the decorrelation transformation
void ReadTransformationFromStream(std::istream &, const TString &)
Read the decorellation matrix from an input stream.
virtual const Event * InverseTransform(const Event *const, Int_t cls) const
apply the inverse decorrelation transformation ... TODO : ... build the inverse transformation
Linear interpolation class.
Basic string class.
Definition TString.h:136
create variable transformations