64 TString trafoDefinition(trafoDefinitionIn);
65 if (trafoDefinition ==
"None")
return;
69 TString trafoDefinitionCheck(trafoDefinitionIn);
71 for (
Int_t pos = 0, siz = trafoDefinition.
Sizeof(); pos < siz; ++pos) {
72 TString ch = trafoDefinition(pos,1);
73 if ( ch ==
"(" ) npartial++;
77 <<
"The use of multiple partial variable transformations during the "
78 "application phase can be properly invoked via the \"Reader\", but "
79 "it is not yet implemented in \"MakeClass\", the creation mechanism "
80 "for standalone C++ application classes. The standalone C++ class "
81 "produced by this training job is thus INCOMPLETE AND MUST NOT BE USED! "
82 "The transformation in question is: " << trafoDefinitionIn <<
Endl;
91 Int_t parenthesisCount = 0;
93 TString ch = trafoDefinition(position,1);
94 if (ch ==
"(") ++parenthesisCount;
95 else if (ch ==
")") --parenthesisCount;
96 else if (ch ==
"," && parenthesisCount == 0) trafoDefinition.
Replace(position,1,
'+');
102 TString tdef = os->GetString();
108 Ssiz_t parLen = tdef.
Index(
")", parStart )-parStart+1;
111 tdef.
Remove(parStart,parLen);
119 log << kFATAL <<
Form(
"Dataset[%s] : ",dataInfo.
GetName())<<
"Incorrect transformation string provided." <<
Endl;
126 if (trCls !=
"AllClasses") {
129 log << kFATAL <<
Form(
"Dataset[%s] : ",dataInfo.
GetName())<<
"Class " << trCls <<
" not known for variable transformation "
130 << trName <<
", please check." <<
Endl;
137 if (trName ==
"I" || trName ==
"Ident" || trName ==
"Identity") {
141 else if (trName ==
"D" || trName ==
"Deco" || trName ==
"Decorrelate") {
145 else if (trName ==
"P" || trName ==
"PCA") {
149 else if (trName ==
"U" || trName ==
"Uniform") {
153 else if (trName ==
"G" || trName ==
"Gauss") {
157 else if (trName ==
"N" || trName ==
"Norm" || trName ==
"Normalise" || trName ==
"Normalize") {
162 log << kFATAL <<
Form(
"Dataset[%s] : ",dataInfo.
GetName())
163 <<
"<ProcessOptions> Variable transform '"
164 << trName <<
"' unknown." <<
Endl;
167 if (transformation) {
170 log << kHEADER <<
Form(
"[%s] : ",dataInfo.
GetName())
171 <<
"Create Transformation \"" << trName <<
"\" with reference class "
174 log << kHEADER <<
Form(
"[%s] : ",dataInfo.
GetName())
175 <<
"Create Transformation \"" << trName <<
"\" with events from all classes."
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual Int_t GetEntries() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
Class that contains all the information of a class.
Class that contains all the data information.
virtual const char * GetName() const
Returns name of object.
ClassInfo * GetClassInfo(Int_t clNum) const
ostringstream derivative to redirect and format output
const char * GetName() const override
Returns name of object.
Collectable string class.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
TString & Remove(Ssiz_t pos)
virtual Int_t Sizeof() const
Returns size string will occupy on I/O buffer.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
create variable transformations
void CreateVariableTransforms(const TString &trafoDefinition, TMVA::DataSetInfo &dataInfo, TMVA::TransformationHandler &transformationHandler, TMVA::MsgLogger &log)
void variables(TString dataset, TString fin="TMVA.root", TString dirName="InputVariables_Id", TString title="TMVA Input Variables", Bool_t isRegression=kFALSE, Bool_t useTMVAStyle=kTRUE)
MsgLogger & Endl(MsgLogger &ml)