Logo ROOT  
Reference Guide
VariableIdentityTransform.cxx
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 : VariableIdentityTransform *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Implementation (see header for description) *
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  * MPI-K Heidelberg, Germany *
21  * *
22  * Redistribution and use in source and binary forms, with or without *
23  * modification, are permitted according to the terms listed in LICENSE *
24  * (http://tmva.sourceforge.net/LICENSE) *
25  **********************************************************************************/
26 
27 /*! \class TMVA::VariableIdentityTransform
28 \ingroup TMVA
29 Linear interpolation class
30 */
31 
33 
34 #include "TMVA/Event.h"
35 #include "TMVA/MsgLogger.h"
36 #include "TMVA/SVEvent.h"
37 #include "TMVA/Types.h"
39 
40 #include "Rtypes.h"
41 #include "TString.h"
42 
43 #include <iostream>
44 
45 namespace TMVA {
46  class DataSetInfo;
47 }
48 
50 
51 ////////////////////////////////////////////////////////////////////////////////
52 /// constructor
53 
55 : VariableTransformBase( dsi, Types::kIdentity, "Id" )
56 {
57 }
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 /// nothing to initialize
61 
63 {
64 }
65 
66 ////////////////////////////////////////////////////////////////////////////////
67 /// the identity does not need to be prepared, only calculate the normalization
68 
70 {
71  Initialize();
72 
73  if (!IsEnabled() || IsCreated()) return kTRUE;
74 
75  Log() << kDEBUG << "Preparing the Identity transformation..." << Endl;
76 
77  if( fGet.size() < events[0]->GetNVariables() )
78  Log() << kFATAL << "Identity transform does not allow for a selection of input variables. Please remove the variable selection option and put only 'I'." << Endl;
79 
80  SetNVariables(events[0]->GetNVariables());
81 
82  SetCreated( kTRUE );
83 
84  return kTRUE;
85 }
86 
87 ////////////////////////////////////////////////////////////////////////////////
88 /// identity transformation to write to XML
89 ///Log() << kFATAL << "Please implement writing of transformation as XML" << Endl;
90 
92 {
93 }
94 
95 ////////////////////////////////////////////////////////////////////////////////
96 /// reding the identity transformation from XML
97 
99 {
100  return;
101 }
102 
103 ////////////////////////////////////////////////////////////////////////////////
104 /// identity transform returns same event
105 
107 {
108  return ev;
109 }
110 
111 ////////////////////////////////////////////////////////////////////////////////
112 /// creates C++ code fragment of the identity transform for inclusion in standalone C++ class
113 
114 void TMVA::VariableIdentityTransform::MakeFunction( std::ostream& fout, const TString& fncName,
115  Int_t , UInt_t trCounter, Int_t )
116 {
117  fout << "inline void " << fncName << "::InitTransform_Identity_" << trCounter << "() {}" << std::endl;
118  fout << std::endl;
119  fout << "inline void " << fncName << "::Transform_Identity_" << trCounter << "(const std::vector<double> &, int) const {}" << std::endl;
120 }
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TMVA::VariableIdentityTransform::Transform
virtual const Event * Transform(const Event *const, Int_t cls) const
identity transform returns same event
Definition: VariableIdentityTransform.cxx:106
TMVA::VariableIdentityTransform
Linear interpolation class.
Definition: VariableIdentityTransform.h:45
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TMath::Log
Double_t Log(Double_t x)
Definition: TMath.h:760
VariableIdentityTransform.h
TMVA::VariableTransformBase
Linear interpolation class.
Definition: VariableTransformBase.h:54
VariableTransformBase.h
TString
Basic string class.
Definition: TString.h:136
TString.h
bool
TMVA::DataSetInfo
Class that contains all the data information.
Definition: DataSetInfo.h:62
MsgLogger.h
TMVA::VariableIdentityTransform::AttachXMLTo
virtual void AttachXMLTo(void *parent)
identity transformation to write to XML Log() << kFATAL << "Please implement writing of transformatio...
Definition: VariableIdentityTransform.cxx:91
Event.h
TMVA::VariableIdentityTransform::MakeFunction
virtual void MakeFunction(std::ostream &fout, const TString &fncName, Int_t part, UInt_t trCounter, Int_t cls)
creates C++ code fragment of the identity transform for inclusion in standalone C++ class
Definition: VariableIdentityTransform.cxx:114
TMVA::VariableIdentityTransform::Initialize
void Initialize()
nothing to initialize
Definition: VariableIdentityTransform.cxx:62
TMVA::Types
Singleton class for Global types used by TMVA.
Definition: Types.h:73
Types.h
TMVA::VariableIdentityTransform::PrepareTransformation
Bool_t PrepareTransformation(const std::vector< Event * > &)
the identity does not need to be prepared, only calculate the normalization
Definition: VariableIdentityTransform.cxx:69
TMVA::VariableIdentityTransform::VariableIdentityTransform
VariableIdentityTransform(DataSetInfo &dsi)
constructor
Definition: VariableIdentityTransform.cxx:54
TMVA::Endl
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:158
unsigned int
TMVA::TMVAGlob::Initialize
void Initialize(Bool_t useTMVAStyle=kTRUE)
Definition: tmvaglob.cxx:176
TMVA::VariableIdentityTransform::ReadFromXML
virtual void ReadFromXML(void *trfnode)
reding the identity transformation from XML
Definition: VariableIdentityTransform.cxx:98
TMVA::Event
Definition: Event.h:51
TMVA::DNN::EActivationFunction::kIdentity
@ kIdentity
SVEvent.h
Rtypes.h
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
int