Changeset 8704 for trunk/MagicSoft/Mars/mranforest
- Timestamp:
- 08/24/07 09:37:31 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mranforest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mranforest/MRanForestCalc.cc
r8698 r8704 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MRanForestCalc.cc,v 1.2 8 2007-08-23 10:25:08 tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MRanForestCalc.cc,v 1.29 2007-08-24 08:33:48 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 63 63 const TString MRanForestCalc::gsDefTitle = "RF for energy estimation"; 64 64 65 const TString MRanForestCalc::gsNameOutput = "RanForestOut"; 65 const TString MRanForestCalc::gsNameOutput = "RanForestOut"; 66 const TString MRanForestCalc::gsNameEvalFunc = "EvalFunction"; 66 67 67 68 MRanForestCalc::MRanForestCalc(const char *name, const char *title) 68 : fData(0), fRFOut(0), fTestMatrix(0), fFunc(" Function", "x"),69 : fData(0), fRFOut(0), fTestMatrix(0), fFunc("x"), 69 70 fNumTrees(-1), fNumTry(-1), fNdSize(-1), fNumObsoleteVariables(1), 70 71 fLastDataColumnHasWeights(kFALSE), … … 73 74 fName = name ? name : gsDefName.Data(); 74 75 fTitle = title ? title : gsDefTitle.Data(); 75 76 gROOT->GetListOfFunctions()->Remove(&fFunc);77 76 78 77 // FIXME: … … 93 92 Bool_t MRanForestCalc::SetFunction(const char *func) 94 93 { 95 return !fFunc. Compile(func);94 return !fFunc.SetRule(func); 96 95 } 97 96 … … 267 266 usedrules.Write("rules"); 268 267 268 fFunc.Write(gsNameEvalFunc); 269 269 270 return kTRUE; 270 271 } … … 302 303 } 303 304 304 if (fileRF.GetListOfKeys()->FindObject("Function")) 305 fFunc.Read("Function"); 305 if (fileRF.GetListOfKeys()->FindObject(gsNameEvalFunc)) 306 { 307 if (fFunc.Read(gsNameEvalFunc)<=0) 308 { 309 *fLog << err << "ERROR - Reading '" << gsNameEvalFunc << "' from file " << fFileName << endl; 310 return kFALSE; 311 } 312 313 *fLog << inf << "Evaluation function found in file: " << fFunc.GetRule() << endl; 314 } 306 315 307 316 return kTRUE; … … 325 334 326 335 *fLog << inf << "RF read from " << fFileName << endl; 336 337 if (!fFunc.PreProcess(plist)) 338 { 339 *fLog << err << "PreProcessing of evaluation function failed... aborting." << endl; 340 return kFALSE; 341 } 327 342 328 343 if (fTestMatrix) -
trunk/MagicSoft/Mars/mranforest/MRanForestCalc.h
r8698 r8704 14 14 #endif 15 15 16 #ifndef ROOT_ TF117 #include <TF1.h>16 #ifndef ROOT_MDataPhrase 17 #include "MDataPhrase.h" 18 18 #endif 19 19 … … 33 33 34 34 private: 35 static const TString gsDefName; //! Default Name 36 static const TString gsDefTitle; //! Default Title 37 static const TString gsNameOutput; //! Default Output name 35 static const TString gsDefName; //! Default Name 36 static const TString gsDefTitle; //! Default Title 37 static const TString gsNameOutput; //! Default Output name 38 static const TString gsNameEvalFunc; //! Evaluation function name 38 39 39 40 MDataArray *fData; //! Used to store the MDataChains to get the event values 40 41 MParameterD *fRFOut; //! Used to store result 41 42 MHMatrix *fTestMatrix; //! Test Matrix used in Process (together with MMatrixLoop) 42 TF1fFunc; //! Function to apply to the result43 MDataPhrase fFunc; //! Function to apply to the result 43 44 44 45 TObjArray fEForests; //! List of forests read or to be written
Note:
See TracChangeset
for help on using the changeset viewer.