Merged muonspin/musrfit into master
This commit is contained in:
commit
737f3dfaa4
@ -13,6 +13,7 @@ NEW 2016-04-22 Added the theory function muMinusExpTF for mu minus fits
|
||||
NEW 2016-02-23 It is now possible to export the averaged data/Fourier
|
||||
CHANGED 2016-04-26 start-/endTimeBin are now class members. This reduces
|
||||
the number of recalculations.
|
||||
FIXED 2016-08-02 run lists are now properly loaded if containing nS-nE elements.
|
||||
|
||||
changes since 0.16.0
|
||||
===================================
|
||||
|
@ -1870,6 +1870,8 @@ void PTextEdit::musrMsr2Data()
|
||||
QFileInfo fi;
|
||||
QString str;
|
||||
int i, end;
|
||||
QStringList list;
|
||||
bool ok;
|
||||
|
||||
fMsr2DataParam = dlg->getMsr2DataParam();
|
||||
fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output);
|
||||
@ -2069,12 +2071,11 @@ void PTextEdit::musrMsr2Data()
|
||||
}
|
||||
break;
|
||||
case 1: // run list
|
||||
end = 0;
|
||||
while (!runList.section(' ', end, end, QString::SectionSkipEmpty).isEmpty()) {
|
||||
end++;
|
||||
}
|
||||
for (int i=0; i<end; i++) {
|
||||
fln = runList.section(' ', i, i, QString::SectionSkipEmpty);
|
||||
list = getRunList(runList, ok);
|
||||
if (!ok)
|
||||
return;
|
||||
for (int i=0; i<list.size(); i++) {
|
||||
fln = list[i];
|
||||
if (fMsr2DataParam->msrFileExtension.isEmpty())
|
||||
fln += ".msr";
|
||||
else
|
||||
@ -2644,6 +2645,58 @@ void PTextEdit::fillRecentFiles()
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> run list is split (space separated) and expanded (start-end -> start, start+1, ..., end) to a list
|
||||
*
|
||||
* \param runListStr list to be split and expanded
|
||||
* \param ok true if everything is fine; false if an error has been encountered
|
||||
*
|
||||
* \return fully expanded run list
|
||||
*/
|
||||
QStringList PTextEdit::getRunList(QString runListStr, bool &ok)
|
||||
{
|
||||
QStringList result;
|
||||
bool isInt;
|
||||
QString str;
|
||||
|
||||
ok = true;
|
||||
|
||||
// first split space separated parts
|
||||
QStringList tok = runListStr.split(' ', QString::SkipEmptyParts);
|
||||
for (int i=0; i<tok.size(); i++) {
|
||||
if (tok[i].contains('-')) { // list given, hence need to expand
|
||||
QStringList runListTok = tok[i].split('-', QString::SkipEmptyParts);
|
||||
if (runListTok.size() != 2) { // error
|
||||
ok = false;
|
||||
result.clear();
|
||||
return result;
|
||||
}
|
||||
int start=0, end=0;
|
||||
start = runListTok[0].toInt(&isInt);
|
||||
if (!isInt) {
|
||||
ok = false;
|
||||
result.clear();
|
||||
return result;
|
||||
}
|
||||
end = runListTok[1].toInt(&isInt);
|
||||
if (!isInt) {
|
||||
ok = false;
|
||||
result.clear();
|
||||
return result;
|
||||
}
|
||||
for (int i=start; i<=end; i++) {
|
||||
str = QString("%1").arg(i);
|
||||
result << str;
|
||||
}
|
||||
} else { // keep it
|
||||
result << tok[i];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// END
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
@ -31,6 +31,8 @@
|
||||
#define _PTEXTEDIT_H_
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QMap>
|
||||
#include <QTimer>
|
||||
#include <QString>
|
||||
@ -175,6 +177,7 @@ private:
|
||||
QAction *fRecentFilesAction[MAX_RECENT_FILES]; ///< array of the recent file actions
|
||||
|
||||
void fillRecentFiles();
|
||||
QStringList getRunList(QString runListStr, bool &ok);
|
||||
};
|
||||
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QTextEdit>
|
||||
#include <QStatusBar>
|
||||
#include <QAction>
|
||||
@ -1868,6 +1870,8 @@ void PTextEdit::musrMsr2Data()
|
||||
QFileInfo fi;
|
||||
QString str;
|
||||
int i, end;
|
||||
QStringList list;
|
||||
bool ok;
|
||||
|
||||
fMsr2DataParam = dlg->getMsr2DataParam();
|
||||
fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output);
|
||||
@ -2052,7 +2056,6 @@ void PTextEdit::musrMsr2Data()
|
||||
QTextStream *stream;
|
||||
|
||||
if (!fMsr2DataParam->global) { // standard fits
|
||||
|
||||
switch(dlg->getRunTag()) {
|
||||
case 0: // first run / last run list
|
||||
if (fMsr2DataParam->firstRun != -1) {
|
||||
@ -2067,12 +2070,11 @@ void PTextEdit::musrMsr2Data()
|
||||
}
|
||||
break;
|
||||
case 1: // run list
|
||||
end = 0;
|
||||
while (!runList.section(' ', end, end, QString::SectionSkipEmpty).isEmpty()) {
|
||||
end++;
|
||||
}
|
||||
for (int i=0; i<end; i++) {
|
||||
fln = runList.section(' ', i, i, QString::SectionSkipEmpty);
|
||||
list = getRunList(runList, ok);
|
||||
if (!ok)
|
||||
return;
|
||||
for (int i=0; i<list.size(); i++) {
|
||||
fln = list[i];
|
||||
if (fMsr2DataParam->msrFileExtension.isEmpty())
|
||||
fln += ".msr";
|
||||
else
|
||||
@ -2642,6 +2644,58 @@ void PTextEdit::fillRecentFiles()
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p> run list is split (space separated) and expanded (start-end -> start, start+1, ..., end) to a list
|
||||
*
|
||||
* \param runListStr list to be split and expanded
|
||||
* \param ok true if everything is fine; false if an error has been encountered
|
||||
*
|
||||
* \return fully expanded run list
|
||||
*/
|
||||
QStringList PTextEdit::getRunList(QString runListStr, bool &ok)
|
||||
{
|
||||
QStringList result;
|
||||
bool isInt;
|
||||
QString str;
|
||||
|
||||
ok = true;
|
||||
|
||||
// first split space separated parts
|
||||
QStringList tok = runListStr.split(' ', QString::SkipEmptyParts);
|
||||
for (int i=0; i<tok.size(); i++) {
|
||||
if (tok[i].contains('-')) { // list given, hence need to expand
|
||||
QStringList runListTok = tok[i].split('-', QString::SkipEmptyParts);
|
||||
if (runListTok.size() != 2) { // error
|
||||
ok = false;
|
||||
result.clear();
|
||||
return result;
|
||||
}
|
||||
int start=0, end=0;
|
||||
start = runListTok[0].toInt(&isInt);
|
||||
if (!isInt) {
|
||||
ok = false;
|
||||
result.clear();
|
||||
return result;
|
||||
}
|
||||
end = runListTok[1].toInt(&isInt);
|
||||
if (!isInt) {
|
||||
ok = false;
|
||||
result.clear();
|
||||
return result;
|
||||
}
|
||||
for (int i=start; i<=end; i++) {
|
||||
str = QString("%1").arg(i);
|
||||
result << str;
|
||||
}
|
||||
} else { // keep it
|
||||
result << tok[i];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// END
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
@ -31,6 +31,8 @@
|
||||
#define _PTEXTEDIT_H_
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QMap>
|
||||
#include <QTimer>
|
||||
#include <QString>
|
||||
@ -175,6 +177,7 @@ private:
|
||||
QAction *fRecentFilesAction[MAX_RECENT_FILES]; ///< array of the recent file actions
|
||||
|
||||
void fillRecentFiles();
|
||||
QStringList getRunList(QString runListStr, bool &ok);
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user