diff --git a/src/classes/Makefile.PMusr b/src/classes/Makefile.PMusr index d44b9c4d..b1e576a0 100644 --- a/src/classes/Makefile.PMusr +++ b/src/classes/Makefile.PMusr @@ -42,8 +42,7 @@ endif # -- Linux ifeq ($(OS),LINUX) CXX = g++ -#CXXFLAGS = -O3 -Wall -Wno-trigraphs -fPIC -CXXFLAGS = -O1 -Wall -Wno-trigraphs -fPIC +CXXFLAGS = -O3 -Wall -Wno-trigraphs -fPIC PMUSRPATH = ../include MNPATH = $(ROOTSYS)/include GSLPATH = /usr/include/gsl diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 89064a01..a4623052 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -1063,7 +1063,7 @@ int PMsrHandler::ParameterInUse(unsigned int paramNo) * x x x x x -> 5 Parameters, e.g. after a MINOS fit * without boundaries * x x x x -> 4 Parameters, e.g. after MIGRAD fit - * without bounderies, or + * without boundaries, or * when starting * \endcode * @@ -1161,7 +1161,7 @@ bool PMsrHandler::HandleFitParameterEntry(PMsrLines &lines) } } - // 7 values, i.e. No Name Value Neg_Error Pos_Error Lower_Bounderay Upper_Boundary + // 7 values, i.e. No Name Value Neg_Error Pos_Error Lower_Boundary Upper_Boundary if (tokens->GetEntries() == 7) { param.fNoOfParams = 7; diff --git a/src/classes/PTheory.cpp b/src/classes/PTheory.cpp index 6c770999..10914162 100644 --- a/src/classes/PTheory.cpp +++ b/src/classes/PTheory.cpp @@ -1872,6 +1872,25 @@ void PTheory::CalculateDynKTLF(const double *val, int tag) const const double Tmax = 20.0; // 20 usec unsigned int N = static_cast(16.0*Tmax*val[0]); + // check if rate (Delta/a) is very high + if (fabs(val[1]) > 0.1) { + double tmin = 20.0; + switch (tag) { + case 0: // Gauss + tmin = sqrt(3.0)/val[1]; + break; + case 1: // Lorentz + tmin = 2.0/val[1]; + break; + default: + break; + } + unsigned int Nrate = static_cast(25.0 * Tmax / tmin); + if (Nrate > N) { + N = Nrate; + } + } + if (N < 300) // if too view points, i.e. nu0 very small, take 300 points N = 300; diff --git a/src/musrgui/PGetParameterDialog.cpp b/src/musrgui/PGetParameterDialog.cpp index daf02ac4..ec26ed7f 100644 --- a/src/musrgui/PGetParameterDialog.cpp +++ b/src/musrgui/PGetParameterDialog.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include "PGetParameterDialog.h" @@ -43,6 +45,9 @@ */ PGetParameterDialog::PGetParameterDialog() { + // setup event filter + installEventFilter(this); + fValue_lineEdit->setValidator( new QDoubleValidator(fValue_lineEdit) ); fStep_lineEdit->setValidator( new QDoubleValidator(fStep_lineEdit) ); @@ -175,6 +180,30 @@ void PGetParameterDialog::paramAdd() fName_lineEdit->setFocus(); } +//---------------------------------------------------------------------------------------------------- +/** + *

This event filter is filtering out the return key, and if present adds the current parameters + * to the parameter list. + */ +bool PGetParameterDialog::eventFilter( QObject *obj, QEvent *ev ) +{ + if (obj == this) { + if (ev->type() == QEvent::KeyPress) { + QKeyEvent *k = (QKeyEvent*)ev; + if (k->key() == Qt::Key_Return) { + paramAdd(); + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } +} + //---------------------------------------------------------------------------------------------------- // END //---------------------------------------------------------------------------------------------------- diff --git a/src/musrgui/PGetParameterDialog.h b/src/musrgui/PGetParameterDialog.h index 87588f1a..1f305dcc 100644 --- a/src/musrgui/PGetParameterDialog.h +++ b/src/musrgui/PGetParameterDialog.h @@ -43,6 +43,9 @@ class PGetParameterDialog : public PGetParameterDialogBase public slots: void paramAdd(); + + protected: + bool eventFilter( QObject *obj, QEvent *ev ); }; #endif // _PGETPARAMETERDIALOG_H_ diff --git a/src/musrgui/PTextEdit.cpp b/src/musrgui/PTextEdit.cpp index 4f145ca7..81db5b0d 100644 --- a/src/musrgui/PTextEdit.cpp +++ b/src/musrgui/PTextEdit.cpp @@ -272,14 +272,15 @@ void PTextEdit::setupMusrActions() a->addTo( tb ); a->addTo( menu ); - a = new QAction( QPixmap::fromMimeSource( "musrsinglehisto.xpm" ), tr( "Single &Histo Default" ), ALT + Key_H, this, "musrGetSinglHistoDefault" ); + a = new QAction( QPixmap::fromMimeSource( "musrsinglehisto.xpm" ), tr( "Single &Histogram Default" ), ALT + Key_H, this, "musrGetSinglHistoDefault" ); connect( a, SIGNAL( activated() ), this, SLOT( musrGetSingleHistoDefault() ) ); a->addTo( tb ); a->addTo( menu ); menu->insertSeparator(); + tb->addSeparator(); - a = new QAction( QPixmap::fromMimeSource( "musrcalcchisq.xpm" ), tr( "Calc Chisq" ), ALT + Key_C, this, "cacluates for the given parameters chiSq/maxLH" ); + a = new QAction( QPixmap::fromMimeSource( "musrcalcchisq.xpm" ), tr( "Calculate Chisq" ), ALT + Key_C, this, "cacluates for the given parameters chiSq/maxLH" ); connect( a, SIGNAL( activated() ), this, SLOT( musrCalcChisq() ) ); a->addTo( tb ); a->addTo( menu ); @@ -300,6 +301,7 @@ void PTextEdit::setupMusrActions() a->addTo( menu ); menu->insertSeparator(); + tb->addSeparator(); a = new QAction( QPixmap::fromMimeSource( "musrview.xpm" ), tr( "&View" ), ALT + Key_V, this, "musrView" ); connect( a, SIGNAL( activated() ), this, SLOT( musrView() ) ); @@ -553,7 +555,7 @@ void PTextEdit::fileClose() if (fTabWidget->label(idx).find("*")>0) { int result = QMessageBox::warning(this, "**WARNING**", "Do you really want to close this file.\nChanges will be lost", - "Exit", "Cancel"); + "Close", "Cancel"); if (result == 1) // Cancel return; } @@ -863,7 +865,7 @@ void PTextEdit::musrGetSingleHistoDefault() file.close(); } else { QMessageBox::critical(this, "**ERROR**", - "Couldn't find default single histo file template :-(", + "Couldn't find default single histogram file template :-(", QMessageBox::Ok, QMessageBox::NoButton); } diff --git a/src/musrgui/asymDefault.msr b/src/musrgui/asymDefault.msr index 4aca2c7f..b486c1ba 100644 --- a/src/musrgui/asymDefault.msr +++ b/src/musrgui/asymDefault.msr @@ -1,7 +1,7 @@ TITLE ############################################################### FITPARAMETER -# Nr. Name Value Step Pos_Error Bounderies +# Nr. Name Value Step Pos_Error Boundaries 1 alpha 0.989765 1.0 none 0 none 2 asy 0.26 0.1 none 0 0.33 3 phase 8.5 1.0 none diff --git a/src/musrgui/forms/PGetParameterDialogBase.ui b/src/musrgui/forms/PGetParameterDialogBase.ui index 68f6524f..c5d36464 100644 --- a/src/musrgui/forms/PGetParameterDialogBase.ui +++ b/src/musrgui/forms/PGetParameterDialogBase.ui @@ -264,32 +264,6 @@ Alt+A - - - fParam_textEdit - - - - 10 - 110 - 640 - 270 - - - - - Courier - - - - ############################################################### -FITPARAMETER -# Nr. Name Value Step Pos_Error Bounderies - - - WidgetWidth - - fCancel_pushButton @@ -362,6 +336,32 @@ FITPARAMETER true + + + fParam_textEdit + + + + 10 + 110 + 640 + 270 + + + + + Courier + + + + ############################################################### +FITPARAMETER +# Nr. Name Value Step Pos_Error Boundaries + + + WidgetWidth + + @@ -371,7 +371,7 @@ FITPARAMETER fOk_PushButton - clicked() + released() PGetParameterDialogBase accept() diff --git a/src/musrgui/forms/PMsr2DataDialogBase.ui b/src/musrgui/forms/PMsr2DataDialogBase.ui index 6c515189..d769a3f6 100644 --- a/src/musrgui/forms/PMsr2DataDialogBase.ui +++ b/src/musrgui/forms/PMsr2DataDialogBase.ui @@ -382,54 +382,6 @@ - - - fDbOutputFileName_groupBox - - - - 10 - 325 - 580 - 65 - - - - DB output file name - - - - fDbOutputFileName_textLabel - - - - 10 - 30 - 150 - 20 - - - - DB Output File Name - - - - - fDbOutputFileName_lineEdit - - - - 170 - 25 - 350 - 24 - - - - e.g. MyPrefectFitCollection.db - - - fOptions_groupBox @@ -464,25 +416,6 @@ will keep the Minuit2 output files - - - fWriteDbHeader_checkBox - - - - 20 - 30 - 150 - 22 - - - - Write DB Header - - - will add a default header to the DB-file - - fSummaryPresent_checkBox @@ -521,6 +454,25 @@ will write the output data in column like format, to be read by gnuplot ... + + + fWriteDbHeader_checkBox + + + + 20 + 30 + 150 + 22 + + + + Write Data Header + + + will add a default header to the DB-file + + fRecreateDbFile_checkBox @@ -529,18 +481,66 @@ 230 50 - 140 + 150 22 - Recreate DB File + Recreate Data File will recreate the db-file. Default (unchecked) will append data + + + fDbOutputFileName_groupBox + + + + 10 + 325 + 580 + 65 + + + + Data output file name + + + + fDbOutputFileName_lineEdit + + + + 170 + 25 + 350 + 24 + + + + e.g. MyPrefectFitCollection.db + + + + + fDbOutputFileName_textLabel + + + + 10 + 30 + 160 + 20 + + + + Data Output File Name + + + diff --git a/src/musrgui/musrgui_startup.xml b/src/musrgui/musrgui_startup.xml index 968686e1..a0179129 100644 --- a/src/musrgui/musrgui_startup.xml +++ b/src/musrgui/musrgui_startup.xml @@ -45,7 +45,7 @@ 2 - simplGss + simpleGss (rate) simpleGauss.png @@ -82,14 +82,14 @@ statExpKTLF (frequency damping) - + 2 dynExpKTLF (frequency damping hopping-rate) - + 3 diff --git a/src/musrgui/singleHistoDefault.msr b/src/musrgui/singleHistoDefault.msr index 263d48d5..0f0632c1 100644 --- a/src/musrgui/singleHistoDefault.msr +++ b/src/musrgui/singleHistoDefault.msr @@ -1,7 +1,7 @@ TITLE ############################################################### FITPARAMETER -# Nr. Name Value Step Pos_Error Bounderies +# Nr. Name Value Step Pos_Error Boundaries 1 Asy 0.26 0.01 none 0 0.33 2 Rate 0.36 0.01 none 3 Field 100.0 1.0 none 0 200