ROOT  6.06/09
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 #include <iostream>
28 
30 
31 #ifndef ROOT_TMVA_MsgLogger
32 #include "TMVA/MsgLogger.h"
33 #endif
34 
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// constructor
39 
40  TMVA::VariableIdentityTransform::VariableIdentityTransform( DataSetInfo& dsi )
41  : VariableTransformBase( dsi, Types::kIdentity, "Id" )
42 {
43 }
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// nothing to initialize
47 
49 {
50 }
51 
52 ////////////////////////////////////////////////////////////////////////////////
53 /// the identity does not need to be prepared, only calculate the normalization
54 
56 {
57  Initialize();
58 
59  if (!IsEnabled() || IsCreated()) return kTRUE;
60 
61  Log() << kINFO << "Preparing the Identity transformation..." << Endl;
62 
63  if( fGet.size() < events[0]->GetNVariables() )
64  Log() << kFATAL << "Identity transform does not allow for a selection of input variables. Please remove the variable selection option and put only 'I'." << Endl;
65 
66  SetNVariables(events[0]->GetNVariables());
67 
68  SetCreated( kTRUE );
69 
70  return kTRUE;
71 }
72 
73 ////////////////////////////////////////////////////////////////////////////////
74 /// identity transformation to write to XML
75 ///Log() << kFATAL << "Please implement writing of transformation as XML" << Endl;
76 
78 {
79 }
80 
81 ////////////////////////////////////////////////////////////////////////////////
82 /// reding the identity transformation from XML
83 
85 {
86  return;
87 }
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// identity transform returns same event
91 
93 {
94  return ev;
95 }
96 
97 ////////////////////////////////////////////////////////////////////////////////
98 /// creates C++ code fragment of the indentity transform for inclusion in standalone C++ class
99 
100 void TMVA::VariableIdentityTransform::MakeFunction( std::ostream& fout, const TString& fncName,
101  Int_t , UInt_t trCounter, Int_t )
102 {
103  fout << "inline void " << fncName << "::InitTransform_Identity_" << trCounter << "() {}" << std::endl;
104  fout << std::endl;
105  fout << "inline void " << fncName << "::Transform_Identity_" << trCounter << "(const std::vector<double> &, int) const {}" << std::endl;
106 }
Bool_t PrepareTransformation(const std::vector< Event * > &)
the identity does not need to be prepared, only calculate the normalization
void Initialize()
nothing to initialize
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:162
virtual const Event * Transform(const Event *const, Int_t cls) const
identity transform returns same event
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void MakeFunction(std::ostream &fout, const TString &fncName, Int_t part, UInt_t trCounter, Int_t cls)
creates C++ code fragment of the indentity transform for inclusion in standalone C++ class ...
virtual void ReadFromXML(void *trfnode)
reding the identity transformation from XML
void Initialize(Bool_t useTMVAStyle=kTRUE)
Definition: tmvaglob.cxx:176
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void AttachXMLTo(void *parent)
identity transformation to write to XML Log() << kFATAL << "Please implement writing of transformatio...
Abstract ClassifierFactory template that handles arbitrary types.
ClassImp(TMVA::VariableIdentityTransform) TMVA
constructor
const Bool_t kTRUE
Definition: Rtypes.h:91
Definition: math.cpp:60