Slightly changed the behavior of msr2data (see ChangeLog for details)
This commit is contained in:
parent
fa02394364
commit
1e115c7bd3
@ -25,6 +25,10 @@ FIXED bug reported in MUSR-183: missing background for 2nd histo in asymmetry fi
|
|||||||
FIXED Makefiles so that the NeXus support will not be built if it has not been enabled during the configure stage
|
FIXED Makefiles so that the NeXus support will not be built if it has not been enabled during the configure stage
|
||||||
FIXED ASCII export from musrview in case of a Fourier-Power- or Fourier-Phase-difference plot
|
FIXED ASCII export from musrview in case of a Fourier-Power- or Fourier-Phase-difference plot
|
||||||
FIXED bug in asymmetry fit with fixed background
|
FIXED bug in asymmetry fit with fixed background
|
||||||
|
CHANGED the behavior of msr2data so that
|
||||||
|
* it proceeds to the next run if a fit did not converge (and does not stop as before)
|
||||||
|
* it always tries to read the data files if the nosummary option is not present
|
||||||
|
(before this was switched off for the next runs when the data file of the present run could not be read)
|
||||||
CHANGED in case first good bin (fgb) is not given, it is now fgb=t0+(10ns/time resolution) (MUSR-190)
|
CHANGED in case first good bin (fgb) is not given, it is now fgb=t0+(10ns/time resolution) (MUSR-190)
|
||||||
CHANGED improved handling of 'old' ROOT LEM data files (2006 and earlier) for any2many (MUSR-178)
|
CHANGED improved handling of 'old' ROOT LEM data files (2006 and earlier) for any2many (MUSR-178)
|
||||||
CHANGED improved handling of WKM/ASCII in PRunDataHandler for any2many (MUSR-172)
|
CHANGED improved handling of WKM/ASCII in PRunDataHandler for any2many (MUSR-172)
|
||||||
|
@ -513,10 +513,10 @@ PMsrHandler* PMsr2Data::GetSingleRunMsrFile() const
|
|||||||
* <p> Read in a run data-file
|
* <p> Read in a run data-file
|
||||||
*
|
*
|
||||||
* <p><b>return:</b>
|
* <p><b>return:</b>
|
||||||
* - true if everything is OK
|
* - 0 if everything is OK
|
||||||
* - false otherwise
|
* - 1 otherwise
|
||||||
*/
|
*/
|
||||||
bool PMsr2Data::ReadRunDataFile()
|
int PMsr2Data::ReadRunDataFile()
|
||||||
{
|
{
|
||||||
if (fStartupHandler)
|
if (fStartupHandler)
|
||||||
fDataHandler = new PRunDataHandler(fMsrHandler, fStartupHandler->GetDataPathList());
|
fDataHandler = new PRunDataHandler(fMsrHandler, fStartupHandler->GetDataPathList());
|
||||||
@ -528,13 +528,14 @@ bool PMsr2Data::ReadRunDataFile()
|
|||||||
cerr << endl << ">> msr2data: **WARNING** Could not read all data files, will continue without the data file information..." << endl;
|
cerr << endl << ">> msr2data: **WARNING** Could not read all data files, will continue without the data file information..." << endl;
|
||||||
delete fDataHandler;
|
delete fDataHandler;
|
||||||
fDataHandler = 0;
|
fDataHandler = 0;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
return success;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p> Generate a new single run msr-file from a template
|
* <p> Generate a new single-run msr file from a template
|
||||||
*
|
*
|
||||||
* <p><b>return:</b>
|
* <p><b>return:</b>
|
||||||
* - true if everything is OK
|
* - true if everything is OK
|
||||||
@ -623,6 +624,9 @@ bool PMsr2Data::PrepareNewInputFile(unsigned int tempRun, bool calledFromGlobalM
|
|||||||
while (strLine >> firstOnLine)
|
while (strLine >> firstOnLine)
|
||||||
out << " " << firstOnLine;
|
out << " " << firstOnLine;
|
||||||
out << endl;
|
out << endl;
|
||||||
|
} else if (!to_lower_copy(firstOnLine).compare("chisq") || !to_lower_copy(firstOnLine).compare("maxlh")) {
|
||||||
|
out << "*** FIT DID NOT CONVERGE ***" << endl;
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
out << line << endl;
|
out << line << endl;
|
||||||
}
|
}
|
||||||
@ -1525,6 +1529,9 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const string &msrOu
|
|||||||
++fRunVectorIter;
|
++fRunVectorIter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the convergence flag to false because no fit has been performed using the newly generated file
|
||||||
|
fMsrHandler->GetMsrStatistic()->fValid = false;
|
||||||
|
|
||||||
// write the global msr-file
|
// write the global msr-file
|
||||||
status = fMsrHandler->WriteMsrFile(msrOutFile.c_str(), &commentsP, 0, 0, &commentsR);
|
status = fMsrHandler->WriteMsrFile(msrOutFile.c_str(), &commentsP, 0, 0, &commentsR);
|
||||||
|
|
||||||
@ -1619,6 +1626,9 @@ bool PMsr2Data::PrepareNewSortedInputFile(unsigned int tempRun) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the convergence flag to false because no fit has been performed using the newly generated file
|
||||||
|
fMsrHandler->GetMsrStatistic()->fValid = false;
|
||||||
|
|
||||||
// write the msr-file
|
// write the msr-file
|
||||||
int status = fMsrHandler->WriteMsrFile(msrOutFile.str().c_str());
|
int status = fMsrHandler->WriteMsrFile(msrOutFile.str().c_str());
|
||||||
|
|
||||||
@ -1632,7 +1642,7 @@ bool PMsr2Data::PrepareNewSortedInputFile(unsigned int tempRun) const
|
|||||||
titleCopy.Clear();
|
titleCopy.Clear();
|
||||||
|
|
||||||
if (status != PMUSR_SUCCESS) {
|
if (status != PMUSR_SUCCESS) {
|
||||||
cerr << endl << ">> msr2data: **ERROR** Writing the new msr-file has not been successful!";
|
cerr << endl << ">> msr2data: **ERROR** Writing the new msr file has not been successful!";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1643,11 +1653,12 @@ bool PMsr2Data::PrepareNewSortedInputFile(unsigned int tempRun) const
|
|||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p> Append fit parameters of a msr-file to the DB or ASCII file
|
* <p> Append fit parameters of a msr file to the DB or ASCII file
|
||||||
*
|
*
|
||||||
* <p><b>return:</b>
|
* <p><b>return:</b>
|
||||||
* - PMUSR_SUCCESS if everything is OK
|
* - PMUSR_SUCCESS if everything is OK
|
||||||
* - -1 in case of an error
|
* - -1 in case of a fatal error
|
||||||
|
* - -2 if a fit has not converged (and the data is not appended to the output file)
|
||||||
*
|
*
|
||||||
* \param outfile name of the DB/ASCII output file
|
* \param outfile name of the DB/ASCII output file
|
||||||
* \param db DB or plain ASCII output
|
* \param db DB or plain ASCII output
|
||||||
@ -1944,7 +1955,7 @@ int PMsr2Data::WriteOutput(const string &outfile, bool db, unsigned int withHead
|
|||||||
dataParamErr.clear();
|
dataParamErr.clear();
|
||||||
indVarValues.clear();
|
indVarValues.clear();
|
||||||
|
|
||||||
return -1;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// open the DB or dat file and write the data
|
// open the DB or dat file and write the data
|
||||||
|
@ -68,7 +68,7 @@ class PMsr2Data
|
|||||||
|
|
||||||
int ParseXmlStartupFile();
|
int ParseXmlStartupFile();
|
||||||
int ReadMsrFile(const string&) const;
|
int ReadMsrFile(const string&) const;
|
||||||
bool ReadRunDataFile();
|
int ReadRunDataFile();
|
||||||
|
|
||||||
bool PrepareNewInputFile(unsigned int, bool) const; // template
|
bool PrepareNewInputFile(unsigned int, bool) const; // template
|
||||||
bool PrepareGlobalInputFile(unsigned int, const string&, unsigned int) const; // generate msr-input file for a global fit
|
bool PrepareGlobalInputFile(unsigned int, const string&, unsigned int) const; // generate msr-input file for a global fit
|
||||||
|
@ -725,14 +725,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// read data files
|
// read data files
|
||||||
if (writeSummary)
|
if (writeSummary)
|
||||||
writeSummary = msr2dataHandler->ReadRunDataFile();
|
status = msr2dataHandler->ReadRunDataFile();
|
||||||
|
|
||||||
unsigned int counter(0);
|
unsigned int counter(0);
|
||||||
|
|
||||||
while (msr2dataHandler->GetPresentRun()) {
|
while (msr2dataHandler->GetPresentRun()) {
|
||||||
// write DB or dat file
|
// write DB or dat file
|
||||||
status = msr2dataHandler->WriteOutput(outputFile, db, writeHeader, !setNormalMode, counter);
|
status = msr2dataHandler->WriteOutput(outputFile, db, writeHeader, !setNormalMode, counter);
|
||||||
if (status != PMUSR_SUCCESS) {
|
if (status == -1) {
|
||||||
msr2data_cleanup(msr2dataHandler, arg);
|
msr2data_cleanup(msr2dataHandler, arg);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -805,7 +805,7 @@ int main(int argc, char *argv[])
|
|||||||
if (status != PMUSR_SUCCESS) {
|
if (status != PMUSR_SUCCESS) {
|
||||||
// if the msr-file cannot be read, write no output but proceed to the next run
|
// if the msr-file cannot be read, write no output but proceed to the next run
|
||||||
status = msr2dataHandler->WriteOutput("none", db, writeHeader);
|
status = msr2dataHandler->WriteOutput("none", db, writeHeader);
|
||||||
if (status != PMUSR_SUCCESS) {
|
if (status == -1) {
|
||||||
msr2data_cleanup(msr2dataHandler, arg);
|
msr2data_cleanup(msr2dataHandler, arg);
|
||||||
return status;
|
return status;
|
||||||
} else {
|
} else {
|
||||||
@ -816,11 +816,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// read data files
|
// read data files
|
||||||
if (writeSummary)
|
if (writeSummary)
|
||||||
writeSummary = msr2dataHandler->ReadRunDataFile();
|
status = msr2dataHandler->ReadRunDataFile();
|
||||||
|
|
||||||
// write DB or dat file
|
// write DB or dat file
|
||||||
status = msr2dataHandler->WriteOutput(outputFile, db, writeHeader);
|
status = msr2dataHandler->WriteOutput(outputFile, db, writeHeader);
|
||||||
if (status != PMUSR_SUCCESS) {
|
if (status == -1) {
|
||||||
msr2data_cleanup(msr2dataHandler, arg);
|
msr2data_cleanup(msr2dataHandler, arg);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user