added msr-file-directory-path-handling. Rigorous tests still due
This commit is contained in:
@ -52,10 +52,9 @@ using namespace std;
|
|||||||
*
|
*
|
||||||
* \param fileName
|
* \param fileName
|
||||||
*/
|
*/
|
||||||
PMsrHandler::PMsrHandler(char *fileName)
|
PMsrHandler::PMsrHandler(char *fileName) : fFileName(fileName)
|
||||||
{
|
{
|
||||||
// init variables
|
// init variables
|
||||||
fFileName = fileName;
|
|
||||||
fMsrBlockCounter = 0;
|
fMsrBlockCounter = 0;
|
||||||
|
|
||||||
fTitle = "";
|
fTitle = "";
|
||||||
@ -66,6 +65,17 @@ PMsrHandler::PMsrHandler(char *fileName)
|
|||||||
fStatistic.fNdf = 0;
|
fStatistic.fNdf = 0;
|
||||||
|
|
||||||
fFuncHandler = 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
|
else
|
||||||
str += "mlog";
|
str += "mlog";
|
||||||
|
|
||||||
|
str = fMsrFileDirectoryPath + str;
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
if (tokens) {
|
if (tokens) {
|
||||||
delete tokens;
|
delete tokens;
|
||||||
|
@ -271,6 +271,15 @@ bool PRunDataHandler::FileExistsCheck(PMsrRunStructure &runInfo, const unsigned
|
|||||||
pathName = str;
|
pathName = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if the file is found in the <msr-file-directory>
|
||||||
|
if (pathName.CompareTo("???") == 0) { // not found in local directory search
|
||||||
|
str = *fMsrInfo->GetMsrFileDirectoryPath();
|
||||||
|
str += runInfo.fRunName[idx] + TString(".") + ext;
|
||||||
|
if (gSystem->AccessPathName(str.Data())!=true) { // found
|
||||||
|
pathName = str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check if the file is found in the directory given in the startup file
|
// check if the file is found in the directory given in the startup file
|
||||||
if (pathName.CompareTo("???") == 0) { // not found in local directory search
|
if (pathName.CompareTo("???") == 0) { // not found in local directory search
|
||||||
for (unsigned int i=0; i<fDataPath.size(); i++) {
|
for (unsigned int i=0; i<fDataPath.size(); i++) {
|
||||||
|
@ -63,6 +63,8 @@ class PMsrHandler
|
|||||||
virtual PMsrPlotList* GetMsrPlotList() { return &fPlots; }
|
virtual PMsrPlotList* GetMsrPlotList() { return &fPlots; }
|
||||||
virtual PMsrStatisticStructure* GetMsrStatistic() { return &fStatistic; }
|
virtual PMsrStatisticStructure* GetMsrStatistic() { return &fStatistic; }
|
||||||
|
|
||||||
|
virtual TString* GetMsrFileDirectoryPath() { return &fMsrFileDirectoryPath; }
|
||||||
|
|
||||||
virtual unsigned int GetNoOfParams() { return fParam.size(); }
|
virtual unsigned int GetNoOfParams() { return fParam.size(); }
|
||||||
virtual const TString& GetFileName() const { return fFileName; }
|
virtual const TString& GetFileName() const { return fFileName; }
|
||||||
|
|
||||||
@ -95,6 +97,7 @@ class PMsrHandler
|
|||||||
private:
|
private:
|
||||||
PMsrLines fComments; ///< holds the comments of the msr-file
|
PMsrLines fComments; ///< holds the comments of the msr-file
|
||||||
TString fFileName; ///< file name of the msr-file
|
TString fFileName; ///< file name of the msr-file
|
||||||
|
TString fMsrFileDirectoryPath; ///< msr-file directory path
|
||||||
TString fTitle; ///< holds the title string of the msr-file
|
TString fTitle; ///< holds the title string of the msr-file
|
||||||
PMsrParamList fParam; ///< holds a list of the fit parameters
|
PMsrParamList fParam; ///< holds a list of the fit parameters
|
||||||
PMsrLines fTheory; ///< holds the theory definition
|
PMsrLines fTheory; ///< holds the theory definition
|
||||||
|
Reference in New Issue
Block a user