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  : VariableNormalizeTransform                                            *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Decorrelation of input variables                                          *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
0015  *      Peter Speckmayer <Peter.Speckmayer@cern.ch>  - CERN, Switzerland          *
0016  *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
0017  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0018  *                                                                                *
0019  * Copyright (c) 2005:                                                            *
0020  *      CERN, Switzerland                                                         *
0021  *      U. of Victoria, Canada                                                    *
0022  *      MPI-K Heidelberg, Germany                                                 *
0023  *                                                                                *
0024  * Redistribution and use in source and binary forms, with or without             *
0025  * modification, are permitted according to the terms listed in LICENSE           *
0026  * (see tmva/doc/LICENSE)                                          *
0027  **********************************************************************************/
0028 
0029 #ifndef ROOT_TMVA_VariableNormalizeTransform
0030 #define ROOT_TMVA_VariableNormalizeTransform
0031 
0032 //////////////////////////////////////////////////////////////////////////
0033 //                                                                      //
0034 // VariableNormalizeTransform                                           //
0035 //                                                                      //
0036 // Linear interpolation class                                           //
0037 //                                                                      //
0038 //////////////////////////////////////////////////////////////////////////
0039 
0040 #include "TMatrixDfwd.h"
0041 
0042 #include "TMVA/VariableTransformBase.h"
0043 
0044 #include <vector>
0045 
0046 namespace TMVA {
0047 
0048    class VariableNormalizeTransform : public VariableTransformBase {
0049 
0050    public:
0051 
0052       typedef std::vector<Float_t>       FloatVector;
0053       typedef std::vector< FloatVector > VectorOfFloatVectors;
0054       VariableNormalizeTransform( DataSetInfo& dsi );
0055       virtual ~VariableNormalizeTransform( void );
0056 
0057       void   Initialize();
0058       Bool_t PrepareTransformation (const std::vector<Event*>&);
0059 
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       void BuildTransformationFromVarInfo( const std::vector<TMVA::VariableInfo>& var );
0066 
0067       virtual void AttachXMLTo(void* parent);
0068       virtual void ReadFromXML( void* trfnode );
0069 
0070       virtual void PrintTransformation( std::ostream & o );
0071 
0072       // writer of function code
0073       virtual void MakeFunction( std::ostream& fout, const TString& fncName, Int_t part, UInt_t trCounter, Int_t cls );
0074 
0075       // provides string vector giving explicit transformation
0076       std::vector<TString>* GetTransformationStrings( Int_t cls ) const;
0077 
0078    private:
0079 
0080       void CalcNormalizationParams( const std::vector< Event*>& events);
0081 
0082       //      mutable Event*           fTransformedEvent;
0083 
0084       VectorOfFloatVectors                   fMin;       ///<! Min of source range
0085       VectorOfFloatVectors                   fMax;       ///<! Max of source range
0086 
0087       ClassDef(VariableNormalizeTransform,0); // Variable transformation: normalization
0088    };
0089 
0090 } // namespace TMVA
0091 
0092 #endif