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 * *
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 * (see tmva/doc/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() override;
57 Bool_t PrepareTransformation (const std::vector<Event*>&) override;
58
59 // virtual const Event* Transform(const Event* const, Types::ESBType type = Types::kMaxSBType) const;
60 const Event* Transform(const Event* const, Int_t cls ) const override;
61 const Event* InverseTransform(const Event* const, Int_t cls ) const override;
62
63 void WriteTransformationToStream ( std::ostream& ) const override;
64 void ReadTransformationFromStream( std::istream&, const TString& ) override;
65
66 void AttachXMLTo(void* parent) override;
67 void ReadFromXML( void* trfnode ) override;
68
69 void PrintTransformation( std::ostream & o ) override;
70
71 // writer of function code
72 void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls ) override;
73
74 // provides string vector giving explicit transformation
75 std::vector<TString>* GetTransformationStrings( Int_t cls ) const override;
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 ClassDefOverride(VariableDecorrTransform,0); // Variable transformation: decorrelation
86 };
87
88} // namespace TMVA
89
90#endif
91
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Class that contains all the data information.
Definition DataSetInfo.h:62
Linear interpolation class.
void PrintTransformation(std::ostream &o) override
prints the transformation matrix
virtual ~VariableDecorrTransform(void)
destructor
std::vector< TMatrixD * > fDecorrMatrices
! Decorrelation matrix [class0/class1/.../all classes]
void WriteTransformationToStream(std::ostream &) const override
write the decorrelation matrix to the stream
std::vector< TMatrixDSym * > * CalcCovarianceMatrices(const std::vector< const Event * > &events, Int_t maxCls)
VariableDecorrTransform(DataSetInfo &dsi)
constructor
void ReadTransformationFromStream(std::istream &, const TString &) override
Read the decorellation matrix from an input stream.
const Event * InverseTransform(const Event *const, Int_t cls) const override
apply the inverse decorrelation transformation ... TODO : ... build the inverse transformation
std::vector< TString > * GetTransformationStrings(Int_t cls) const override
creates string with variable transformations applied
void CalcSQRMats(const std::vector< Event * > &, Int_t maxCls)
compute square-root matrices for signal and background
void AttachXMLTo(void *parent) override
node attachment to parent
void ReadFromXML(void *trfnode) override
Read the transformation matrices from the xml node.
void MakeFunction(std::ostream &fout, const TString &fncName, Int_t part, UInt_t trCounter, Int_t cls) override
creates C++ code fragment of the decorrelation transform for inclusion in standalone C++ class
Bool_t PrepareTransformation(const std::vector< Event * > &) override
calculate the decorrelation matrix and the normalization
const Event * Transform(const Event *const, Int_t cls) const override
apply the decorrelation transformation
void Initialize() override
initialisation
Linear interpolation class.
Basic string class.
Definition TString.h:138
create variable transformations