Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:23:05

0001 // @(#)root/tmva $Id$
0002 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : VariableDecorrTransform                                               *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Decorrelation of input variables                                          *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
0015  *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
0016  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0017  *                                                                                *
0018  * Copyright (c) 2005:                                                            *
0019  *      CERN, Switzerland                                                         *
0020  *      U. of Victoria, Canada                                                    *
0021  *      MPI-K Heidelberg, Germany                                                 *
0022  *                                                                                *
0023  * Redistribution and use in source and binary forms, with or without             *
0024  * modification, are permitted according to the terms listed in LICENSE           *
0025  * (see tmva/doc/LICENSE)                                          *
0026  **********************************************************************************/
0027 
0028 #ifndef ROOT_TMVA_VariableDecorrTransform
0029 #define ROOT_TMVA_VariableDecorrTransform
0030 
0031 //////////////////////////////////////////////////////////////////////////
0032 //                                                                      //
0033 // VariableDecorrTransform                                              //
0034 //                                                                      //
0035 // Linear interpolation class                                           //
0036 //                                                                      //
0037 //////////////////////////////////////////////////////////////////////////
0038 
0039 #include "TMatrixDfwd.h"
0040 
0041 #include "TMatrixDSymfwd.h"
0042 
0043 #include "TMVA/VariableTransformBase.h"
0044 
0045 #include <vector>
0046 
0047 namespace TMVA {
0048 
0049    class VariableDecorrTransform : public VariableTransformBase {
0050 
0051    public:
0052 
0053       VariableDecorrTransform( DataSetInfo& dsi );
0054       virtual ~VariableDecorrTransform( void );
0055 
0056       void   Initialize();
0057       Bool_t PrepareTransformation (const std::vector<Event*>&);
0058 
0059       //      virtual const Event* Transform(const Event* const, Types::ESBType type = Types::kMaxSBType) const;
0060       virtual const Event* Transform(const Event* const, Int_t cls ) const;
0061       virtual const Event* InverseTransform(const Event* const, Int_t cls ) const;
0062 
0063       void WriteTransformationToStream ( std::ostream& ) const;
0064       void ReadTransformationFromStream( std::istream&, const TString& );
0065 
0066       virtual void AttachXMLTo(void* parent);
0067       virtual void ReadFromXML( void* trfnode );
0068 
0069       virtual void PrintTransformation( std::ostream & o );
0070 
0071       // writer of function code
0072       virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
0073 
0074       // provides string vector giving explicit transformation
0075       std::vector<TString>* GetTransformationStrings( Int_t cls ) const;
0076 
0077    private:
0078 
0079       //      mutable Event*          fTransformedEvent;   ///<! local event copy
0080       std::vector<TMatrixD*>  fDecorrMatrices;     ///<! Decorrelation matrix [class0/class1/.../all classes]
0081 
0082       void CalcSQRMats( const std::vector< Event*>&, Int_t maxCls );
0083       std::vector<TMatrixDSym*>* CalcCovarianceMatrices( const std::vector<const Event*>& events, Int_t maxCls );
0084 
0085       ClassDef(VariableDecorrTransform,0); // Variable transformation: decorrelation
0086    };
0087 
0088 } // namespace TMVA
0089 
0090 #endif
0091