ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
28 
29 #include "TMVA/Event.h"
30 #include "TMVA/MsgLogger.h"
31 #include "TMVA/SVEvent.h"
32 #include "TMVA/Types.h"
33 
34 #include "Rtypes.h"
35 
36 #include <iostream>
37 
38 namespace TMVA {
39  class DataSetInfo;
40 }
41 
43 
44 ////////////////////////////////////////////////////////////////////////////////
45 /// constructor
46 
47  TMVA::VariableIdentityTransform::VariableIdentityTransform( DataSetInfo& dsi )
48  : VariableTransformBase( dsi, Types::kIdentity, "Id" )
49 {
50 }
51 
52 ////////////////////////////////////////////////////////////////////////////////
53 /// nothing to initialize
54 
56 {
57 }
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 /// the identity does not need to be prepared, only calculate the normalization
61 
63 {
64  Initialize();
65 
66  if (!IsEnabled() || IsCreated()) return kTRUE;
67 
68  Log() << kINFO << "Preparing the Identity transformation..." << Endl;
69 
70  if( fGet.size() < events[0]->GetNVariables() )
71  Log() << kFATAL << "Identity transform does not allow for a selection of input variables. Please remove the variable selection option and put only 'I'." << Endl;
72 
73  SetNVariables(events[0]->GetNVariables());
74 
75  SetCreated( kTRUE );
76 
77  return kTRUE;
78 }
79 
80 ////////////////////////////////////////////////////////////////////////////////
81 /// identity transformation to write to XML
82 ///Log() << kFATAL << "Please implement writing of transformation as XML" << Endl;
83 
85 {
86 }
87 
88 ////////////////////////////////////////////////////////////////////////////////
89 /// reding the identity transformation from XML
90 
92 {
93  return;
94 }
95 
96 ////////////////////////////////////////////////////////////////////////////////
97 /// identity transform returns same event
98 
100 {
101  return ev;
102 }
103 
104 ////////////////////////////////////////////////////////////////////////////////
105 /// creates C++ code fragment of the indentity transform for inclusion in standalone C++ class
106 
107 void TMVA::VariableIdentityTransform::MakeFunction( std::ostream& fout, const TString& fncName,
108  Int_t , UInt_t trCounter, Int_t )
109 {
110  fout << "inline void " << fncName << "::InitTransform_Identity_" << trCounter << "() {}" << std::endl;
111  fout << std::endl;
112  fout << "inline void " << fncName << "::Transform_Identity_" << trCounter << "(const std::vector<double> &, int) const {}" << std::endl;
113 }
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...
ClassImp(TMVA::VariableIdentityTransform) TMVA
constructor
const Bool_t kTRUE
Definition: Rtypes.h:91
Definition: math.cpp:60