added swap msr-, mlog-file switch
This commit is contained in:
parent
1d99c0e673
commit
5497ca2c2b
@ -57,17 +57,21 @@ using namespace std;
|
|||||||
*/
|
*/
|
||||||
void musrfit_syntax()
|
void musrfit_syntax()
|
||||||
{
|
{
|
||||||
cout << endl << "usage: musrfit [<msr-file> [-k, --keep-mn2-ouput] [-c, --chisq-only] [--debug] [--dump <type>]] | --version | --help";
|
cout << endl << "usage: musrfit [<msr-file> [-k, --keep-mn2-ouput] [-c, --chisq-only]";
|
||||||
|
cout << endl << " [-s, --swap-msr-mlog] [--debug] [--dump <type>]] |";
|
||||||
|
cout << endl << " --version | --help";
|
||||||
cout << endl << " <msr-file>: msr input file";
|
cout << endl << " <msr-file>: msr input file";
|
||||||
cout << endl << " 'musrfit <msr-file>' will execute musrfit";
|
cout << endl << " 'musrfit <msr-file>' will execute musrfit";
|
||||||
cout << endl << " 'musrfit' or 'musrfit --help' will show this help";
|
cout << endl << " 'musrfit' or 'musrfit --help' will show this help";
|
||||||
cout << endl << " 'musrfit --version' will print the musrfit version";
|
cout << endl << " 'musrfit --version' will print the musrfit version";
|
||||||
cout << endl << " -k, --keep-mn2-output: will rename the files MINUIT2.OUTPUT and ";
|
cout << endl << " -k, --keep-mn2-output: will rename the files MINUIT2.OUTPUT and ";
|
||||||
cout << endl << " MINUIT2.root to <msr-file>-mn2.output and <msr-file>-mn2.root, repectively,";
|
cout << endl << " MINUIT2.root to <msr-file>-mn2.output and <msr-file>-mn2.root,";
|
||||||
|
cout << endl << " respectively,";
|
||||||
cout << endl << " e.g. <msr-file> = 147.msr -> 147-mn2.output, 147-mn2.root";
|
cout << endl << " e.g. <msr-file> = 147.msr -> 147-mn2.output, 147-mn2.root";
|
||||||
cout << endl << " -c, --chisq-only: instead of fitting the data, chisq is just calculated";
|
cout << endl << " -c, --chisq-only: instead of fitting the data, chisq is just calculated";
|
||||||
cout << endl << " once and the result is set to the stdout. This feature is useful";
|
cout << endl << " once and the result is set to the stdout. This feature is useful";
|
||||||
cout << endl << " to adjust initial parameters.";
|
cout << endl << " to adjust initial parameters.";
|
||||||
|
cout << endl << " -s, --swap-msr-mlog: will swap msr-, mlog-file at the end of execution";
|
||||||
cout << endl << " --debug is used to print additional infos";
|
cout << endl << " --debug is used to print additional infos";
|
||||||
cout << endl << " --dump <type> is writing a data file with the fit data and the theory";
|
cout << endl << " --dump <type> is writing a data file with the fit data and the theory";
|
||||||
cout << endl << " <type> can be 'ascii', 'root'";
|
cout << endl << " <type> can be 'ascii', 'root'";
|
||||||
@ -483,6 +487,7 @@ int main(int argc, char *argv[])
|
|||||||
bool debug = false;
|
bool debug = false;
|
||||||
bool keep_mn2_output = false;
|
bool keep_mn2_output = false;
|
||||||
bool chisq_only = false;
|
bool chisq_only = false;
|
||||||
|
bool swap_msr_mlog = false;
|
||||||
TString dump("");
|
TString dump("");
|
||||||
char filename[256];
|
char filename[256];
|
||||||
|
|
||||||
@ -527,6 +532,8 @@ int main(int argc, char *argv[])
|
|||||||
show_syntax = true;
|
show_syntax = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--swap-msr-mlog")) {
|
||||||
|
swap_msr_mlog = true;
|
||||||
} else {
|
} else {
|
||||||
show_syntax = true;
|
show_syntax = true;
|
||||||
break;
|
break;
|
||||||
@ -679,6 +686,23 @@ int main(int argc, char *argv[])
|
|||||||
gSystem->CopyFile("MINUIT2.root", fln.Data(), kTRUE);
|
gSystem->CopyFile("MINUIT2.root", fln.Data(), kTRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// swap msr-, mlog-file if wished
|
||||||
|
if (swap_msr_mlog) {
|
||||||
|
cout << endl << ">> swapping msr-, mlog-file ..." << endl;
|
||||||
|
// copy msr-file -> __temp.msr
|
||||||
|
gSystem->CopyFile(filename, "__temp.msr", kTRUE);
|
||||||
|
// copy mlog-file -> msr-file
|
||||||
|
TString fln = TString(filename);
|
||||||
|
char ext[32];
|
||||||
|
strcpy(ext, ".mlog");
|
||||||
|
fln.ReplaceAll(".msr", 4, ext, strlen(ext));
|
||||||
|
gSystem->CopyFile(fln.Data(), filename, kTRUE);
|
||||||
|
// copy __temp.msr -> mlog-file
|
||||||
|
gSystem->CopyFile("__temp.msr", fln.Data(), kTRUE);
|
||||||
|
// delete __temp.msr
|
||||||
|
gSystem->Exec("rm __temp.msr");
|
||||||
|
}
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
if (startupHandler) {
|
if (startupHandler) {
|
||||||
delete startupHandler;
|
delete startupHandler;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user