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