added the option to write the content of the MINUIT2.OUTPUT ascii file as yaml. This extends the previous commit from Ryan M.L. McFadden.
This commit is contained in:
@@ -160,6 +160,8 @@ bool PAdminXMLParser::startElement()
|
||||
fKeyWord = eDumpRoot;
|
||||
} else if (qName == "estimate_n0") {
|
||||
fKeyWord = eEstimateN0;
|
||||
} else if (qName == "yaml_out") {
|
||||
fKeyWord = eYamlOut;
|
||||
} else if (qName == "chisq_per_run_block") {
|
||||
fKeyWord = eChisqPreRunBlock;
|
||||
} else if (qName == "path_file_name") {
|
||||
@@ -389,6 +391,14 @@ bool PAdminXMLParser::characters()
|
||||
fAdmin->fMsr2DataParam.estimateN0 = flag;
|
||||
fAdmin->setEstimateN0Flag(flag);
|
||||
break;
|
||||
case eYamlOut:
|
||||
if (str == "y")
|
||||
flag = true;
|
||||
else
|
||||
flag = false;
|
||||
fAdmin->fMsr2DataParam.yamlOut = flag;
|
||||
fAdmin->setYamlOutFlag(flag);
|
||||
break;
|
||||
case eChisqPreRunBlock:
|
||||
if (str == "y")
|
||||
flag = true;
|
||||
@@ -608,6 +618,7 @@ void PAdminXMLParser::dump()
|
||||
std::cout << "debug> title_from_data_file : " << fAdmin->getTitleFromDataFileFlag() << std::endl;
|
||||
std::cout << "debug> chisq_per_run_block : " << fAdmin->getChisqPerRunBlockFlag() << std::endl;
|
||||
std::cout << "debug> estimate_n0 : " << fAdmin->getEstimateN0Flag() << std::endl;
|
||||
std::cout << "debug> yaml_out : " << fAdmin->getYamlOutFlag() << std::endl;
|
||||
std::cout << "debug> musrview_show_fourier : " << fAdmin->getMusrviewShowFourierFlag() << std::endl;
|
||||
std::cout << "debug> musrview_show_avg : " << fAdmin->getMusrviewShowAvgFlag() << std::endl;
|
||||
std::cout << "debug> enable_musrt0 : " << fAdmin->getEnableMusrT0Flag() << std::endl;
|
||||
@@ -746,6 +757,7 @@ PAdmin::PAdmin() : QObject()
|
||||
fEnableMusrT0 = false;
|
||||
fLifetimeCorrection = true;
|
||||
fEstimateN0 = true;
|
||||
fYamlOut = false;
|
||||
fChisqPreRunBlock = false;
|
||||
|
||||
fEditWidth = 900;
|
||||
@@ -760,6 +772,7 @@ PAdmin::PAdmin() : QObject()
|
||||
fMsr2DataParam.ignoreDataHeaderInfo = false;
|
||||
fMsr2DataParam.keepMinuit2Output = false;
|
||||
fMsr2DataParam.estimateN0 = fEstimateN0;
|
||||
fMsr2DataParam.yamlOut = false;
|
||||
fMsr2DataParam.writeColumnData = false;
|
||||
fMsr2DataParam.recreateDbFile = false;
|
||||
fMsr2DataParam.chainFit = true;
|
||||
@@ -996,6 +1009,12 @@ int PAdmin::savePrefs(QString pref_fln)
|
||||
else
|
||||
data[i] = " <estimate_n0>n</estimate_n0>";
|
||||
}
|
||||
if (data[i].contains("<yaml_out>") && data[i].contains("</yaml_out>")) {
|
||||
if (fYamlOut)
|
||||
data[i] = " <yaml_out>y</yaml_out>";
|
||||
else
|
||||
data[i] = " <yaml_out>n</yaml_out>";
|
||||
}
|
||||
if (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
|
||||
if (fMusrviewShowFourier)
|
||||
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";
|
||||
|
||||
@@ -71,7 +71,7 @@ class PAdminXMLParser
|
||||
|
||||
private:
|
||||
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
|
||||
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0,
|
||||
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut,
|
||||
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
|
||||
eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eEditW, eEditH,
|
||||
eFontName, eFontSize, eExecPath, eDefaultSavePath,
|
||||
@@ -129,6 +129,7 @@ class PAdmin : public QObject
|
||||
bool getDumpAsciiFlag() { return fDumpAscii; }
|
||||
bool getDumpRootFlag() { return fDumpRoot; }
|
||||
bool getEstimateN0Flag() { return fEstimateN0; }
|
||||
bool getYamlOutFlag() { return fYamlOut; }
|
||||
bool getChisqPerRunBlockFlag() { return fChisqPreRunBlock; }
|
||||
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu; }
|
||||
bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar; }
|
||||
@@ -157,6 +158,7 @@ class PAdmin : public QObject
|
||||
void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; }
|
||||
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; }
|
||||
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; }
|
||||
void setYamlOutFlag(const bool flag) { fYamlOut = flag; }
|
||||
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; }
|
||||
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; }
|
||||
void setDarkThemeIconsToolbarFlag(const bool flag) { fDarkThemeIconsToolbar = flag; }
|
||||
@@ -205,6 +207,7 @@ class PAdmin : public QObject
|
||||
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes).
|
||||
bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
|
||||
bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
|
||||
bool fYamlOut; ///< flag indicating if the MINUIT2.OUTPUT file should also be written as <msr-file>.yaml output. (default: no).
|
||||
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
|
||||
bool fDarkThemeIconsMenu; ///< flag indicating if dark theme icons shall be used in the menu (default: no)
|
||||
bool fDarkThemeIconsToolbar; ///< flag indicating if dark theme icons shall be used in the toolbar (default: no)
|
||||
|
||||
@@ -84,6 +84,7 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he
|
||||
fIgnoreDataHeaderInfo_checkBox->setChecked(fMsr2DataParam->ignoreDataHeaderInfo);
|
||||
fKeepMinuit2Output_checkBox->setChecked(fMsr2DataParam->keepMinuit2Output);
|
||||
fEstimateN0_checkBox->setChecked(fMsr2DataParam->estimateN0);
|
||||
fYamlOut_checkBox->setChecked(fMsr2DataParam->yamlOut);
|
||||
fWriteColumnData_checkBox->setChecked(fMsr2DataParam->writeColumnData);
|
||||
fRecreateDataFile_checkBox->setChecked(fMsr2DataParam->recreateDbFile);
|
||||
fChainFit_checkBox->setChecked(fMsr2DataParam->chainFit);
|
||||
@@ -121,6 +122,7 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
|
||||
fMsr2DataParam->ignoreDataHeaderInfo = fIgnoreDataHeaderInfo_checkBox->isChecked();
|
||||
fMsr2DataParam->keepMinuit2Output = fKeepMinuit2Output_checkBox->isChecked();
|
||||
fMsr2DataParam->estimateN0 = fEstimateN0_checkBox->isChecked();
|
||||
fMsr2DataParam->yamlOut = fYamlOut_checkBox->isChecked();
|
||||
fMsr2DataParam->writeColumnData = fWriteColumnData_checkBox->isChecked();
|
||||
fMsr2DataParam->recreateDbFile = fRecreateDataFile_checkBox->isChecked();
|
||||
fMsr2DataParam->chainFit = fChainFit_checkBox->isChecked();
|
||||
|
||||
@@ -76,6 +76,7 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
|
||||
fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag());
|
||||
fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag());
|
||||
fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag());
|
||||
fYamlOut_checkBox->setChecked(fAdmin->getYamlOutFlag());
|
||||
fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag());
|
||||
fAvg_checkBox->setChecked(fAdmin->getMusrviewShowAvgFlag());
|
||||
fOneToOne_checkBox->setChecked(fAdmin->getMusrviewShowOneToOneFlag());
|
||||
|
||||
@@ -54,6 +54,7 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
|
||||
bool getEnableMusrT0Flag() { return fEnableMusrT0_checkBox->isChecked(); }
|
||||
bool getKeepRunPerBlockChisqFlag() { return fPerRunBlockChisq_checkBox->isChecked(); }
|
||||
bool getEstimateN0Flag() { return fEstimateN0_checkBox->isChecked(); }
|
||||
bool getYamlOutFlag() { return fYamlOut_checkBox->isChecked(); }
|
||||
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu_checkBox->isChecked(); }
|
||||
bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar_checkBox->isChecked(); }
|
||||
bool getOneToOneFlag() { return fOneToOne_checkBox->isChecked(); }
|
||||
|
||||
@@ -2104,6 +2104,11 @@ void PTextEdit::musrFit()
|
||||
cmd.append("--estimateN0");
|
||||
}
|
||||
|
||||
// check yamlOut flag
|
||||
if (fAdmin->getYamlOutFlag()) {
|
||||
cmd.append("--yaml");
|
||||
}
|
||||
|
||||
// check per-run-block-chisq flag
|
||||
if (fAdmin->getChisqPerRunBlockFlag()) {
|
||||
cmd.append("--per-run-block-chisq");
|
||||
@@ -2336,6 +2341,11 @@ void PTextEdit::musrMsr2Data()
|
||||
cmd.append("-e");
|
||||
}
|
||||
|
||||
// yaml out. Add flag only if a fit is done
|
||||
if (fMsr2DataParam->yamlOut && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
|
||||
cmd.append("-y");
|
||||
}
|
||||
|
||||
// write per-run-block chisq. Add flag only if a fit is done
|
||||
if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
|
||||
cmd.append("-p");
|
||||
@@ -2731,6 +2741,7 @@ void PTextEdit::musrPrefs()
|
||||
fAdmin->setTimeout(dlg->getTimeout());
|
||||
fAdmin->setChisqPerRunBlockFlag(dlg->getKeepRunPerBlockChisqFlag());
|
||||
fAdmin->setEstimateN0Flag(dlg->getEstimateN0Flag());
|
||||
fAdmin->setYamlOutFlag(dlg->getYamlOutFlag());
|
||||
}
|
||||
|
||||
delete dlg;
|
||||
|
||||
@@ -338,7 +338,7 @@
|
||||
<x>6</x>
|
||||
<y>20</y>
|
||||
<width>560</width>
|
||||
<height>131</height>
|
||||
<height>135</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
@@ -456,6 +456,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="fYamlOut_checkBox">
|
||||
<property name="text">
|
||||
<string>yaml out</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="fTabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="fGeneral_tab">
|
||||
<attribute name="title">
|
||||
@@ -152,9 +152,9 @@
|
||||
<widget class="QCheckBox" name="fTitleFromData_checkBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<x>170</x>
|
||||
<y>10</y>
|
||||
<width>241</width>
|
||||
<width>161</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -165,9 +165,9 @@
|
||||
<widget class="QCheckBox" name="fPerRunBlockChisq_checkBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<x>170</x>
|
||||
<y>35</y>
|
||||
<width>241</width>
|
||||
<width>181</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -178,9 +178,9 @@
|
||||
<widget class="QCheckBox" name="fEstimateN0_checkBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<x>170</x>
|
||||
<y>60</y>
|
||||
<width>241</width>
|
||||
<width>171</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -188,6 +188,19 @@
|
||||
<string>estimate N0</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="fYamlOut_checkBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>350</x>
|
||||
<y>10</y>
|
||||
<width>85</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>yaml out</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="fMusrview_tab">
|
||||
<attribute name="title">
|
||||
|
||||
@@ -56,6 +56,7 @@ struct PMsr2DataParam {
|
||||
bool openFilesAfterFitting; ///< flag: true = open msr-file after fit in musredit. false = do not open msr-file after fit.
|
||||
bool titleFromDataFile; ///< flag indicating if the title for the msr-file shall be extracted from the data-file ('-t' in msr2data)
|
||||
bool estimateN0; ///< flag indicating if the N0 shall be estimated for single histogram fitting
|
||||
bool yamlOut; ///< flag indicating if the MINUIT2.OUTPUT content should be written to <msr-file>.yaml
|
||||
bool perRunBlockChisq; ///< flag indicating if per-run-block-chisq shall be dumped into the msr-file
|
||||
bool createMsrFileOnly; ///< flag: true = just create the msr-files without any fitting ('msr-<template>' in msr2data)
|
||||
bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<title_from_data_file>y</title_from_data_file>
|
||||
<chisq_per_run_block>n</chisq_per_run_block>
|
||||
<estimate_n0>y</estimate_n0>
|
||||
<yaml_out>n</yaml_out>
|
||||
<musrview_show_fourier>n</musrview_show_fourier>
|
||||
<musrview_show_avg>n</musrview_show_avg>
|
||||
<musrview_show_one_to_one>n</musrview_show_one_to_one>
|
||||
|
||||
Reference in New Issue
Block a user