added to msr2data the flags --estimateN0 and --per-run-block-chisq. Adopted the musredit dialog accordingly. Removed the first/last option form the msr2data dialog since this is handled by the runlist.
This commit is contained in:
@ -1866,6 +1866,8 @@ void PTextEdit::musrMsr2Data()
|
||||
// init fMsr2DataParam
|
||||
fMsr2DataParam->keepMinuit2Output = fAdmin->getKeepMinuit2OutputFlag();
|
||||
fMsr2DataParam->titleFromDataFile = fAdmin->getTitleFromDataFileFlag();
|
||||
fMsr2DataParam->estimateN0 = fAdmin->getEstimateN0Flag();
|
||||
fMsr2DataParam->perRunBlockChisq = fAdmin->getChisqPerRunBlockFlag();
|
||||
|
||||
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
|
||||
|
||||
@ -1887,6 +1889,8 @@ void PTextEdit::musrMsr2Data()
|
||||
fMsr2DataParam = dlg->getMsr2DataParam();
|
||||
fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output);
|
||||
fAdmin->setTitleFromDataFileFlag(fMsr2DataParam->titleFromDataFile);
|
||||
fAdmin->setEstimateN0Flag(fMsr2DataParam->estimateN0);
|
||||
fAdmin->setChisqPerRunBlockFlag(fMsr2DataParam->perRunBlockChisq);
|
||||
|
||||
// analyze parameters
|
||||
switch (dlg->getRunTag()) {
|
||||
@ -1896,20 +1900,10 @@ void PTextEdit::musrMsr2Data()
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
return;
|
||||
break;
|
||||
case 0: // first last
|
||||
first = QString("%1").arg(fMsr2DataParam->firstRun);
|
||||
last = QString("%1").arg(fMsr2DataParam->lastRun);
|
||||
if (first.isEmpty() || last.isEmpty()) {
|
||||
QMessageBox::critical(this, "**ERROR**",
|
||||
"If you choose the first/last option,\nfirst AND last needs to be provided.",
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 1: // run list
|
||||
case 0: // run list
|
||||
runList = fMsr2DataParam->runList;
|
||||
break;
|
||||
case 2: // run list file name
|
||||
case 1: // run list file name
|
||||
runListFileName = fMsr2DataParam->runListFileName;
|
||||
fi.setFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + runListFileName);
|
||||
if (!fi.exists()) {
|
||||
@ -1936,10 +1930,6 @@ void PTextEdit::musrMsr2Data()
|
||||
// run list argument
|
||||
switch (dlg->getRunTag()) {
|
||||
case 0:
|
||||
cmd.append(first);
|
||||
cmd.append(last);
|
||||
break;
|
||||
case 1:
|
||||
end = 0;
|
||||
while (!runList.section(' ', end, end, QString::SectionSkipEmpty).isEmpty()) {
|
||||
end++;
|
||||
@ -1960,7 +1950,7 @@ void PTextEdit::musrMsr2Data()
|
||||
cmd.append(str);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 1:
|
||||
cmd.append(runListFileName);
|
||||
break;
|
||||
default:
|
||||
@ -2025,6 +2015,16 @@ void PTextEdit::musrMsr2Data()
|
||||
cmd.append("-t");
|
||||
}
|
||||
|
||||
// estimate N0 (makes sence for single histo and muMinus fits only). Add flag only if a fit is done
|
||||
if (fMsr2DataParam->estimateN0 && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
|
||||
cmd.append("-e");
|
||||
}
|
||||
|
||||
// write per-run-block chisq. Add flag only if a fit is done
|
||||
if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
|
||||
cmd.append("-p");
|
||||
}
|
||||
|
||||
// DB output wished
|
||||
if (!fMsr2DataParam->dbOutputFileName.isEmpty()) {
|
||||
str = "-o" + fMsr2DataParam->dbOutputFileName;
|
||||
@ -2068,19 +2068,7 @@ void PTextEdit::musrMsr2Data()
|
||||
|
||||
if (!fMsr2DataParam->global) { // standard fits
|
||||
switch(dlg->getRunTag()) {
|
||||
case 0: // first run / last run list
|
||||
if (fMsr2DataParam->firstRun != -1) {
|
||||
for (int i=fMsr2DataParam->firstRun; i<=fMsr2DataParam->lastRun; i++) {
|
||||
if (fMsr2DataParam->msrFileExtension.isEmpty())
|
||||
fln = QString("%1").arg(i) + ".msr";
|
||||
else
|
||||
fln = QString("%1").arg(i) + fMsr2DataParam->msrFileExtension + ".msr";
|
||||
|
||||
load(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fln);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1: // run list
|
||||
case 0: // run list
|
||||
list = getRunList(runList, ok);
|
||||
if (!ok)
|
||||
return;
|
||||
@ -2094,7 +2082,7 @@ void PTextEdit::musrMsr2Data()
|
||||
load(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fln);
|
||||
}
|
||||
break;
|
||||
case 2: // run list file
|
||||
case 1: // run list file
|
||||
file = new QFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fMsr2DataParam->runListFileName);
|
||||
if (!file->open(QIODevice::ReadOnly)) {
|
||||
str = QString("Couldn't open run list file %1, sorry.").arg(fMsr2DataParam->runListFileName);
|
||||
@ -2130,13 +2118,10 @@ void PTextEdit::musrMsr2Data()
|
||||
// get the first run number needed to build the global fit file name
|
||||
fln = QString("");
|
||||
switch(dlg->getRunTag()) {
|
||||
case 0: // first/last run
|
||||
fln = QString("%1").arg(fMsr2DataParam->firstRun) + QString("+global") + fMsr2DataParam->msrFileExtension + QString(".msr");
|
||||
break;
|
||||
case 1: // run list
|
||||
case 0: // run list
|
||||
fln = runList.section(" ", 0, 0, QString::SectionSkipEmpty) + QString("+global") + fMsr2DataParam->msrFileExtension + QString(".msr");
|
||||
break;
|
||||
case 2: // run list file name
|
||||
case 1: // run list file name
|
||||
file = new QFile(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath() + "/" + fMsr2DataParam->runListFileName);
|
||||
if (!file->open(QIODevice::ReadOnly)) {
|
||||
str = QString("Couldn't open run list file %1, sorry.").arg(fMsr2DataParam->runListFileName);
|
||||
|
Reference in New Issue
Block a user