@@ -1957,10 +1957,12 @@ TDirectory* TMVA::MethodBase::BaseDir() const
1957
1957
sdir = methodDir->mkdir (defaultDir);
1958
1958
sdir->cd ();
1959
1959
// write weight file name into target file
1960
- TObjString wfilePath ( gSystem ->WorkingDirectory () );
1961
- TObjString wfileName ( GetWeightFileName () );
1962
- wfilePath.Write ( " TrainingPath" );
1963
- wfileName.Write ( " WeightFileName" );
1960
+ if (fModelPersistence ) {
1961
+ TObjString wfilePath ( gSystem ->WorkingDirectory () );
1962
+ TObjString wfileName ( GetWeightFileName () );
1963
+ wfilePath.Write ( " TrainingPath" );
1964
+ wfileName.Write ( " WeightFileName" );
1965
+ }
1964
1966
}
1965
1967
1966
1968
Log ()<<kDEBUG <<Form (" Dataset[%s] : " ,DataInfo ().GetName ())<<" Base Directory for " << GetMethodTypeName () << " existed, return it.." <<Endl;
@@ -2026,11 +2028,13 @@ TString TMVA::MethodBase::GetWeightFileName() const
2026
2028
// directory/jobname_methodname_suffix.extension.{root/txt}
2027
2029
TString suffix = " " ;
2028
2030
TString wFileDir (GetWeightFileDir ());
2031
+ TString wFileName = GetJobName () + " _" + GetMethodName () +
2032
+ suffix + " ." + gConfig ().GetIONames ().fWeightFileExtension + " .xml" ;
2033
+ if (wFileDir.IsNull () ) return wFileName;
2034
+ // add weight file directory of it is not null
2029
2035
return ( wFileDir + (wFileDir[wFileDir.Length ()-1 ]==' /' ? " " : " /" )
2030
- + GetJobName () + " _" + GetMethodName () +
2031
- suffix + " ." + gConfig ().GetIONames ().fWeightFileExtension + " .xml" );
2036
+ + wFileName );
2032
2037
}
2033
-
2034
2038
// //////////////////////////////////////////////////////////////////////////////
2035
2039
// / writes all MVA evaluation histograms to file
2036
2040
0 commit comments