added msr-file-directory-path-handling. Rigorous tests still due

This commit is contained in:
nemu
2009-04-30 08:23:51 +00:00
parent c196c66b4e
commit 28c9ff7784
3 changed files with 26 additions and 2 deletions

View File

@ -52,10 +52,9 @@ using namespace std;
*
* \param fileName
*/
PMsrHandler::PMsrHandler(char *fileName)
PMsrHandler::PMsrHandler(char *fileName) : fFileName(fileName)
{
// init variables
fFileName = fileName;
fMsrBlockCounter = 0;
fTitle = "";
@ -66,6 +65,17 @@ PMsrHandler::PMsrHandler(char *fileName)
fStatistic.fNdf = 0;
fFuncHandler = 0;
if (fFileName.Contains("/")) {
Int_t idx = -1;
while (fFileName.Index("/", idx+1) != -1) {
idx = fFileName.Index("/", idx);
}
fMsrFileDirectoryPath = fFileName;
fMsrFileDirectoryPath.Remove(idx+1);
} else {
fMsrFileDirectoryPath = "./";
}
}
//--------------------------------------------------------------------------
@ -337,6 +347,8 @@ int PMsrHandler::WriteMsrLogFile(TString ext)
else
str += "mlog";
str = fMsrFileDirectoryPath + str;
// clean up
if (tokens) {
delete tokens;