Slight improvement when an empty MUSRFITPATH environment variable is set
This commit is contained in:
@ -14,6 +14,7 @@ NEW any2many: an attempt to write the universial musr-data-file converter. Just
|
|||||||
NEW musrt0: added the possibility to show the t0 saved in the data file 's'. Furthermore added the option
|
NEW musrt0: added the possibility to show the t0 saved in the data file 's'. Furthermore added the option
|
||||||
--getT0FromPromptPeak, -g with <firstGoodBinOffset>: will, in non-interactive mode estimate the t0's from
|
--getT0FromPromptPeak, -g with <firstGoodBinOffset>: will, in non-interactive mode estimate the t0's from
|
||||||
the prompt peak and write it into the msr-file (MUSR-133).
|
the prompt peak and write it into the msr-file (MUSR-133).
|
||||||
|
FIXED accidental casting of a NULL pointer in msr2data
|
||||||
FIXED crash of musrfit if a run-data-files is not found (MUSR-176)
|
FIXED crash of musrfit if a run-data-files is not found (MUSR-176)
|
||||||
FIXED corrected time resolution for WKM from (ns) -> (us)
|
FIXED corrected time resolution for WKM from (ns) -> (us)
|
||||||
FIXED the formating of fixed parameters (step=0) where wrongly formatted (connected to MUSR-167). This
|
FIXED the formating of fixed parameters (step=0) where wrongly formatted (connected to MUSR-167). This
|
||||||
|
@ -1305,13 +1305,16 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const string &msrOu
|
|||||||
// and do the fitting
|
// and do the fitting
|
||||||
// check if MUSRFITPATH is set, if not issue a warning
|
// check if MUSRFITPATH is set, if not issue a warning
|
||||||
string path("");
|
string path("");
|
||||||
|
bool pathSet(false);
|
||||||
char *pathPtr(getenv("MUSRFITPATH"));
|
char *pathPtr(getenv("MUSRFITPATH"));
|
||||||
if (pathPtr) {
|
if (pathPtr) {
|
||||||
path = boost::lexical_cast<string>(pathPtr);
|
path = boost::lexical_cast<string>(pathPtr);
|
||||||
if (!path.empty()) {
|
if (!path.empty()) {
|
||||||
|
pathSet = true;
|
||||||
path.append("/");
|
path.append("/");
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
if (!pathSet) {
|
||||||
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!";
|
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!";
|
||||||
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@ PStartupHandler::PStartupHandler()
|
|||||||
Char_t *home;
|
Char_t *home;
|
||||||
Char_t musrpath[128];
|
Char_t musrpath[128];
|
||||||
Char_t startup_path_name[128];
|
Char_t startup_path_name[128];
|
||||||
|
Bool_t pmusrpathfound = false;
|
||||||
|
|
||||||
// check if the startup file is found in the current directory
|
// check if the startup file is found in the current directory
|
||||||
strcpy(startup_path_name, "./musrfit_startup.xml");
|
strcpy(startup_path_name, "./musrfit_startup.xml");
|
||||||
@ -67,7 +68,12 @@ PStartupHandler::PStartupHandler()
|
|||||||
} else { // startup file is not found in the current directory
|
} else { // startup file is not found in the current directory
|
||||||
// check if the MUSRFITPATH system variable is set
|
// check if the MUSRFITPATH system variable is set
|
||||||
pmusrpath = getenv("MUSRFITPATH");
|
pmusrpath = getenv("MUSRFITPATH");
|
||||||
if (pmusrpath == 0) { // not set, will try default one
|
if (pmusrpath != 0) {
|
||||||
|
if (strcmp(pmusrpath, "")) { // MUSRFITPATH variable set but empty
|
||||||
|
pmusrpathfound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!pmusrpathfound) { // MUSRFITPATH not set or empty, will try default one
|
||||||
home = getenv("ROOTSYS");
|
home = getenv("ROOTSYS");
|
||||||
sprintf(musrpath, "%s/bin", home);
|
sprintf(musrpath, "%s/bin", home);
|
||||||
cerr << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl;
|
cerr << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl;
|
||||||
|
@ -690,13 +690,16 @@ int main(int argc, char *argv[])
|
|||||||
if (!onlyInputCreation) {
|
if (!onlyInputCreation) {
|
||||||
// check if MUSRFITPATH is set, if not issue a warning
|
// check if MUSRFITPATH is set, if not issue a warning
|
||||||
string path("");
|
string path("");
|
||||||
|
bool pathSet(false);
|
||||||
char *pathPtr(getenv("MUSRFITPATH"));
|
char *pathPtr(getenv("MUSRFITPATH"));
|
||||||
if (pathPtr) {
|
if (pathPtr) {
|
||||||
path = boost::lexical_cast<string>(pathPtr);
|
path = boost::lexical_cast<string>(pathPtr);
|
||||||
if (!path.empty()) {
|
if (!path.empty()) {
|
||||||
|
pathSet = true;
|
||||||
path.append("/");
|
path.append("/");
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
if (!pathSet) {
|
||||||
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!";
|
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!";
|
||||||
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||||
}
|
}
|
||||||
@ -776,13 +779,16 @@ int main(int argc, char *argv[])
|
|||||||
if (!onlyInputCreation) {
|
if (!onlyInputCreation) {
|
||||||
// check if MUSRFITPATH is set, if not issue a warning
|
// check if MUSRFITPATH is set, if not issue a warning
|
||||||
string path("");
|
string path("");
|
||||||
|
bool pathSet(false);
|
||||||
char *pathPtr(getenv("MUSRFITPATH"));
|
char *pathPtr(getenv("MUSRFITPATH"));
|
||||||
if (pathPtr) {
|
if (pathPtr) {
|
||||||
path = boost::lexical_cast<string>(pathPtr);
|
path = boost::lexical_cast<string>(pathPtr);
|
||||||
if (!path.empty()) {
|
if (!path.empty()) {
|
||||||
|
pathSet = true;
|
||||||
path.append("/");
|
path.append("/");
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
if (!pathSet) {
|
||||||
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!";
|
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!";
|
||||||
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user