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
29Linear 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
45namespace TMVA {
46 class DataSetInfo;
47}
48
50
51////////////////////////////////////////////////////////////////////////////////
52/// constructor
53
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
114void 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}
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
#define ClassImp(name)
Definition: Rtypes.h:364
Class that contains all the data information.
Definition: DataSetInfo.h:62
Singleton class for Global types used by TMVA.
Definition: Types.h:71
virtual void AttachXMLTo(void *parent)
identity transformation to write to XML Log() << kFATAL << "Please implement writing of transformatio...
Bool_t PrepareTransformation(const std::vector< Event * > &)
the identity does not need to be prepared, only calculate the normalization
VariableIdentityTransform(DataSetInfo &dsi)
constructor
virtual const Event * Transform(const Event *const, Int_t cls) const
identity transform returns same event
virtual void ReadFromXML(void *trfnode)
reding the identity transformation from XML
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
void Initialize()
nothing to initialize
Linear interpolation class.
@ kDEBUG
Definition: Types.h:56
@ kFATAL
Definition: Types.h:61
Basic string class.
Definition: TString.h:136
void Initialize(Bool_t useTMVAStyle=kTRUE)
Definition: tmvaglob.cxx:176
create variable transformations
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:148
Double_t Log(Double_t x)
Definition: TMath.h:710