diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index dec301bb..69ccc20a 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -325,7 +325,7 @@ cout << endl; /** *
*/
-int PMsrHandler::WriteMsrLogFile(TString ext)
+int PMsrHandler::WriteMsrLogFile(const bool messages)
{
const unsigned int prec = 6; // output precision for float/doubles
@@ -350,13 +350,7 @@ int PMsrHandler::WriteMsrLogFile(TString ext)
// remove extension
str = fFileName;
str.Remove(idx+1);
-
- // add new extension
- if (ext.Length() != 0)
- str += ext;
- else
- str += "mlog";
-
+ str += "mlog";
ifstream fin;
ofstream fout;
@@ -826,10 +820,12 @@ int PMsrHandler::WriteMsrLogFile(TString ext)
str += ", chisq/NDF = ";
str += fStatistic.fMin / fStatistic.fNdf;
fout << str.Data() << endl;
- cout << endl << str.Data() << endl;
+ if (messages)
+ cout << endl << str.Data() << endl;
} else {
fout << "*** FIT DID NOT CONVERGE ***" << endl;
- cout << endl << "*** FIT DID NOT CONVERGE ***" << endl;
+ if (messages)
+ cout << endl << "*** FIT DID NOT CONVERGE ***" << endl;
}
} else if (sstr.BeginsWith("maxLH")) {
if (fStatistic.fValid) { // valid fit result
@@ -840,10 +836,12 @@ int PMsrHandler::WriteMsrLogFile(TString ext)
str += ", maxLH/NDF = ";
str += fStatistic.fMin / fStatistic.fNdf;
fout << str.Data() << endl;
- cout << endl << str.Data() << endl;
+ if (messages)
+ cout << endl << str.Data() << endl;
} else {
fout << "*** FIT DID NOT CONVERGE ***" << endl;
- cout << endl << "*** FIT DID NOT CONVERGE ***" << endl;
+ if (messages)
+ cout << endl << "*** FIT DID NOT CONVERGE ***" << endl;
}
} else if (sstr.BeginsWith("*** FIT DID NOT CONVERGE ***")) {
if (fStatistic.fValid) { // valid fit result
@@ -855,7 +853,8 @@ int PMsrHandler::WriteMsrLogFile(TString ext)
str += ", chisq/NDF = ";
str += fStatistic.fMin / fStatistic.fNdf;
fout << str.Data() << endl;
- cout << endl << str.Data() << endl;
+ if (messages)
+ cout << endl << str.Data() << endl;
} else { // max. log. liklihood
str = " maxLH = ";
str += fStatistic.fMin;
@@ -864,11 +863,13 @@ int PMsrHandler::WriteMsrLogFile(TString ext)
str += ", maxLH/NDF = ";
str += fStatistic.fMin / fStatistic.fNdf;
fout << str.Data() << endl;
- cout << endl << str.Data() << endl;
+ if (messages)
+ cout << endl << str.Data() << endl;
}
} else {
fout << "*** FIT DID NOT CONVERGE ***" << endl;
- cout << endl << "*** FIT DID NOT CONVERGE ***" << endl;
+ if (messages)
+ cout << endl << "*** FIT DID NOT CONVERGE ***" << endl;
}
} else {
fout << str.Data() << endl;
diff --git a/src/include/PMsrHandler.h b/src/include/PMsrHandler.h
index 8886e4f0..94ffeeb1 100644
--- a/src/include/PMsrHandler.h
+++ b/src/include/PMsrHandler.h
@@ -51,7 +51,7 @@ class PMsrHandler
virtual ~PMsrHandler();
virtual int ReadMsrFile();
- virtual int WriteMsrLogFile(TString ext=TString(""));
+ virtual int WriteMsrLogFile(const bool messages = true);
virtual TString* GetMsrTitle() { return &fTitle; }
virtual PMsrParamList* GetMsrParamList() { return &fParam; }
diff --git a/src/musrfit.cpp b/src/musrfit.cpp
index 6050a3fd..abd5ad8f 100644
--- a/src/musrfit.cpp
+++ b/src/musrfit.cpp
@@ -490,7 +490,7 @@ int main(int argc, char *argv[])
bool keep_mn2_output = false;
bool chisq_only = false;
TString dump("");
- char filename[256];
+ char filename[1024];
// check syntax
if (argc < 2) {
diff --git a/src/musrt0.cpp b/src/musrt0.cpp
index 468fcaf1..da894421 100644
--- a/src/musrt0.cpp
+++ b/src/musrt0.cpp
@@ -39,6 +39,7 @@ using namespace std;
#include