added some information about elapsed fitting times. Corrected some outdated online helps.
This commit is contained in:
parent
55eeeeb740
commit
459a36fa79
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
changes since 0.11.0
|
changes since 0.11.0
|
||||||
===================================
|
===================================
|
||||||
|
NEW 2013-01-07 print out the estimated time needed for the Minimize,Minos, etc.
|
||||||
|
both, to the stdout and to the MINUIT2.OUTPUT file.
|
||||||
NEW 2012-11-19 added a flag in the Fourier block (dc-corrected) which can
|
NEW 2012-11-19 added a flag in the Fourier block (dc-corrected) which can
|
||||||
be used to subtract a potential DC-offset before the Fourier
|
be used to subtract a potential DC-offset before the Fourier
|
||||||
transform is carried out.
|
transform is carried out.
|
||||||
|
@ -4,19 +4,19 @@ FITPARAMETER
|
|||||||
# No Name Value Step Pos_Error Boundaries
|
# No Name Value Step Pos_Error Boundaries
|
||||||
1 field 94.717 0 none
|
1 field 94.717 0 none
|
||||||
2 deadlayer 10.5 0 none
|
2 deadlayer 10.5 0 none
|
||||||
3 lambda 115.947 -0.91963 none
|
3 lambda 115.96 -0.92 0.88
|
||||||
|
|
||||||
# E = 22keV
|
# E = 22keV
|
||||||
|
|
||||||
4 phase22 25.4956 0 none
|
4 phase22 25.4956 0 none
|
||||||
5 asym22 0.104724 -0.00293244 none 0 0.3
|
5 asym22 0.1047 -0.0029 0.0030 0 0.3
|
||||||
6 rate22 0.558459 -0.0323891 none
|
6 rate22 0.558 -0.032 0.033
|
||||||
7 NormL22 753.067 -0.86835 none
|
7 NormL22 753.00 -0.87 0.87
|
||||||
8 BGL22 51.0796 -0.132894 none
|
8 BGL22 51.08 -0.13 0.13
|
||||||
9 NormR22 545.968 -0.762193 none
|
9 NormR22 545.93 -0.77 0.76
|
||||||
10 BGR22 38.5992 -0.115679 none
|
10 BGR22 38.60 -0.12 0.12
|
||||||
11 relasyR22 1.0697 -0.0377904 none 0.2 2
|
11 relasyR22 1.068 -0.038 0.039 0.2 2
|
||||||
12 relphaR22 162.711 -1.53722 none 110 210
|
12 relphaR22 162.8 -1.5 1.5 110 210
|
||||||
13 energy22 22 0 none
|
13 energy22 22 0 none
|
||||||
|
|
||||||
14 one 1 0 none
|
14 one 1 0 none
|
||||||
@ -41,11 +41,11 @@ norm 7
|
|||||||
backgr.fit 8
|
backgr.fit 8
|
||||||
lifetimecorrection
|
lifetimecorrection
|
||||||
map 4 5 6 14 15 13 0 0 0 0
|
map 4 5 6 14 15 13 0 0 0 0
|
||||||
forward 1
|
forward 1
|
||||||
background 65000 66500
|
background 65000 66500
|
||||||
data 3419 63000
|
data 3419 63000
|
||||||
t0 3419
|
t0 3419.0
|
||||||
fit 0.15 10.00
|
fit 0.15 10
|
||||||
packing 150
|
packing 150
|
||||||
|
|
||||||
RUN data/lem09_his_0916 MUE4 PSI ROOT-NPP (name beamline institute data-file-format)
|
RUN data/lem09_his_0916 MUE4 PSI ROOT-NPP (name beamline institute data-file-format)
|
||||||
@ -54,21 +54,17 @@ norm 9
|
|||||||
backgr.fit 10
|
backgr.fit 10
|
||||||
lifetimecorrection
|
lifetimecorrection
|
||||||
map 4 5 6 11 12 13 0 0 0 0
|
map 4 5 6 11 12 13 0 0 0 0
|
||||||
forward 3
|
forward 3
|
||||||
background 65000 66500
|
background 65000 66500
|
||||||
data 3419 63000
|
data 3419 63000
|
||||||
t0 3419
|
t0 3419.0
|
||||||
fit 0.15 10.00
|
fit 0.15 10
|
||||||
packing 150
|
packing 150
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
COMMANDS
|
COMMANDS
|
||||||
MINIMIZE
|
MINIMIZE
|
||||||
#HESSE
|
MINOS
|
||||||
#MINOS
|
|
||||||
#SCAN 3
|
|
||||||
CONTOURS 2 3
|
|
||||||
MNPLOT
|
|
||||||
SAVE
|
SAVE
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
@ -78,13 +74,13 @@ fourier_power 10
|
|||||||
apodization WEAK # NONE, WEAK, MEDIUM, STRONG
|
apodization WEAK # NONE, WEAK, MEDIUM, STRONG
|
||||||
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
|
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
|
||||||
phase par4
|
phase par4
|
||||||
range 0.00 200.00
|
range 0 200
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
PLOT 0 (single histo plot)
|
PLOT 0 (single histo plot)
|
||||||
runs 1 2
|
runs 1 2
|
||||||
range 0.00 4.00 -0.25 0.25
|
range 0 4 -0.25 0.25
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
STATISTIC --- 2010-03-12 11:22:43
|
STATISTIC --- 2013-01-07 11:11:17
|
||||||
*** FIT DID NOT CONVERGE ***
|
chisq = 696.9, NDF = 663, chisq/NDF = 1.051076
|
||||||
|
@ -78,10 +78,12 @@ void any2many_syntax()
|
|||||||
cout << endl << " year, i.e. [yyyy] will result in something like 1999.";
|
cout << endl << " year, i.e. [yyyy] will result in something like 1999.";
|
||||||
cout << endl << " -c <convert-options> : <inFormat> <outFormat>";
|
cout << endl << " -c <convert-options> : <inFormat> <outFormat>";
|
||||||
cout << endl << " <inFormat> : input data file format. Supported formats are:";
|
cout << endl << " <inFormat> : input data file format. Supported formats are:";
|
||||||
cout << endl << " MusrRoot, PSI-BIN, ROOT (LEM), MUD, NeXus1, NeXus2, PSI-MDU, WKM";
|
cout << endl << " MusrRoot, PSI-BIN, ROOT (LEM), MUD, NeXus, PSI-MDU, WKM";
|
||||||
cout << endl << " <outFormat> : ouput data file format. Supported formats are:";
|
cout << endl << " <outFormat> : ouput data file format. Supported formats are:";
|
||||||
cout << endl << " PSI-BIN, MusrRoot, MUD, NeXus1-HDF4, NeXus1-HDF5, NeXus1-XML,";
|
cout << endl << " PSI-BIN, MusrRoot, ROOT, MUD, NeXus1-HDF4, NeXus1-HDF5, NeXus1-XML,";
|
||||||
cout << endl << " NeXus2-HDF4, NeXus2-HDF5, NeXus2-XML, WKM, ASCII";
|
cout << endl << " NeXus2-HDF4, NeXus2-HDF5, NeXus2-XML, WKM, ASCII";
|
||||||
|
cout << endl << " Comment: ROOT is superseeded by MusrRoot. If there is not a very good";
|
||||||
|
cout << endl << " reason, avoid it!";
|
||||||
cout << endl << " -p <output-path> : where <output-path> is the output path for the";
|
cout << endl << " -p <output-path> : where <output-path> is the output path for the";
|
||||||
cout << endl << " converted files. If nothing is given, the current directory";
|
cout << endl << " converted files. If nothing is given, the current directory";
|
||||||
cout << endl << " will be used, unless the option '-s' is used.";
|
cout << endl << " will be used, unless the option '-s' is used.";
|
||||||
|
@ -38,11 +38,14 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include <math.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include "Minuit2/FunctionMinimum.h"
|
#include "Minuit2/FunctionMinimum.h"
|
||||||
#include "Minuit2/MnContours.h"
|
#include "Minuit2/MnContours.h"
|
||||||
@ -136,6 +139,8 @@ PFitter::~PFitter()
|
|||||||
|
|
||||||
fScanData.clear();
|
fScanData.clear();
|
||||||
|
|
||||||
|
fElapsedTime.clear();
|
||||||
|
|
||||||
if (fFcnMin) {
|
if (fFcnMin) {
|
||||||
delete fFcnMin;
|
delete fFcnMin;
|
||||||
fFcnMin = 0;
|
fFcnMin = 0;
|
||||||
@ -1127,10 +1132,15 @@ Bool_t PFitter::ExecuteHesse()
|
|||||||
UInt_t maxfcn = numeric_limits<UInt_t>::max();
|
UInt_t maxfcn = numeric_limits<UInt_t>::max();
|
||||||
|
|
||||||
// call hesse
|
// call hesse
|
||||||
|
Double_t start=0.0, end=0.0;
|
||||||
|
start=MilliTime();
|
||||||
ROOT::Minuit2::MnUserParameterState mnState = hesse((*fFitterFcn), fMnUserParams, maxfcn);
|
ROOT::Minuit2::MnUserParameterState mnState = hesse((*fFitterFcn), fMnUserParams, maxfcn);
|
||||||
|
end=MilliTime();
|
||||||
|
cout << ">> PFitter::ExecuteMinimize(): execution time for Hesse = " << setprecision(3) << (end-start)/1.0e3 << " sec." << endl;
|
||||||
|
TString str = TString::Format("Hesse: %.3f sec", (end-start)/1.0e3);
|
||||||
|
fElapsedTime.push_back(str);
|
||||||
if (!mnState.IsValid()) {
|
if (!mnState.IsValid()) {
|
||||||
cerr << endl << "**WARNING** PFitter::ExecuteHesse(): Hesse encountered some problems!";
|
cerr << endl << ">> PFitter::ExecuteHesse(): **WARNING** Hesse encountered some problems!";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1168,9 +1178,16 @@ Bool_t PFitter::ExecuteMigrad()
|
|||||||
UInt_t maxfcn = numeric_limits<UInt_t>::max();
|
UInt_t maxfcn = numeric_limits<UInt_t>::max();
|
||||||
// tolerance = MINUIT2 Default tolerance
|
// tolerance = MINUIT2 Default tolerance
|
||||||
Double_t tolerance = 0.1;
|
Double_t tolerance = 0.1;
|
||||||
|
// keep track of elapsed time
|
||||||
|
Double_t start=0.0, end=0.0;
|
||||||
|
start=MilliTime();
|
||||||
ROOT::Minuit2::FunctionMinimum min = migrad(maxfcn, tolerance);
|
ROOT::Minuit2::FunctionMinimum min = migrad(maxfcn, tolerance);
|
||||||
|
end=MilliTime();
|
||||||
|
cout << ">> PFitter::ExecuteMinimize(): execution time for Migrad = " << setprecision(3) << (end-start)/1.0e3 << " sec." << endl;
|
||||||
|
TString str = TString::Format("Migrad: %.3f sec", (end-start)/1.0e3);
|
||||||
|
fElapsedTime.push_back(str);
|
||||||
if (!min.IsValid()) {
|
if (!min.IsValid()) {
|
||||||
cerr << endl << "**WARNING**: PFitter::ExecuteMigrad(): Fit did not converge, sorry ...";
|
cerr << endl << ">> PFitter::ExecuteMigrad(): **WARNING**: Fit did not converge, sorry ...";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
fIsValid = false;
|
fIsValid = false;
|
||||||
return false;
|
return false;
|
||||||
@ -1237,9 +1254,16 @@ Bool_t PFitter::ExecuteMinimize()
|
|||||||
|
|
||||||
// tolerance = MINUIT2 Default tolerance
|
// tolerance = MINUIT2 Default tolerance
|
||||||
Double_t tolerance = 0.1;
|
Double_t tolerance = 0.1;
|
||||||
|
// keep track of elapsed time
|
||||||
|
Double_t start=0.0, end=0.0;
|
||||||
|
start = MilliTime();
|
||||||
ROOT::Minuit2::FunctionMinimum min = minimize(maxfcn, tolerance);
|
ROOT::Minuit2::FunctionMinimum min = minimize(maxfcn, tolerance);
|
||||||
|
end = MilliTime();
|
||||||
|
cout << ">> PFitter::ExecuteMinimize(): execution time for Minimize = " << setprecision(3) << (end-start)/1.0e3 << " sec." << endl;
|
||||||
|
TString str = TString::Format("Minimize: %.3f sec", (end-start)/1.0e3);
|
||||||
|
fElapsedTime.push_back(str);
|
||||||
if (!min.IsValid()) {
|
if (!min.IsValid()) {
|
||||||
cerr << endl << "**WARNING**: PFitter::ExecuteMinimize(): Fit did not converge, sorry ...";
|
cerr << endl << ">> PFitter::ExecuteMinimize(): **WARNING**: Fit did not converge, sorry ...";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
fIsValid = false;
|
fIsValid = false;
|
||||||
return false;
|
return false;
|
||||||
@ -1311,7 +1335,13 @@ Bool_t PFitter::ExecuteMinos()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make minos analysis
|
// make minos analysis
|
||||||
|
Double_t start=0.0, end=0.0;
|
||||||
|
start=MilliTime();
|
||||||
ROOT::Minuit2::MnMinos minos((*fFitterFcn), (*fFcnMin));
|
ROOT::Minuit2::MnMinos minos((*fFitterFcn), (*fFcnMin));
|
||||||
|
end=MilliTime();
|
||||||
|
cout << ">> PFitter::ExecuteMinimize(): execution time for Minos = " << setprecision(3) << (end-start)/1.0e3 << " sec." << endl;
|
||||||
|
TString str = TString::Format("Minos: %.3f sec", (end-start)/1.0e3);
|
||||||
|
fElapsedTime.push_back(str);
|
||||||
|
|
||||||
for (UInt_t i=0; i<fParams.size(); i++) {
|
for (UInt_t i=0; i<fParams.size(); i++) {
|
||||||
// only try to call minos if the parameter is not fixed!!
|
// only try to call minos if the parameter is not fixed!!
|
||||||
@ -1529,7 +1559,7 @@ Bool_t PFitter::ExecuteSave(Bool_t firstSave)
|
|||||||
|
|
||||||
// check if the user parameter state is valid
|
// check if the user parameter state is valid
|
||||||
if (!mnState.IsValid()) {
|
if (!mnState.IsValid()) {
|
||||||
cerr << endl << "**WARNING** Minuit2 User Parameter State is not valid, i.e. nothing to be saved";
|
cerr << endl << ">> PFitter::ExecuteSave: **WARNING** Minuit2 User Parameter State is not valid, i.e. nothing to be saved";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1616,10 +1646,21 @@ Bool_t PFitter::ExecuteSave(Bool_t firstSave)
|
|||||||
fout << endl << "*************************************************************************";
|
fout << endl << "*************************************************************************";
|
||||||
fout << endl;
|
fout << endl;
|
||||||
|
|
||||||
|
// write elapsed times
|
||||||
|
fout << endl << " elapsed times:";
|
||||||
|
for (UInt_t i=0; i<fElapsedTime.size(); i++) {
|
||||||
|
fout << endl << " " << fElapsedTime[i];
|
||||||
|
}
|
||||||
|
fout << endl;
|
||||||
|
fout << endl << "*************************************************************************";
|
||||||
|
fout << endl;
|
||||||
|
fElapsedTime.clear();
|
||||||
|
|
||||||
// write global informations
|
// write global informations
|
||||||
fout << endl << " Fval() = " << mnState.Fval() << ", Edm() = " << mnState.Edm() << ", NFcn() = " << mnState.NFcn();
|
fout << endl << " Fval() = " << mnState.Fval() << ", Edm() = " << mnState.Edm() << ", NFcn() = " << mnState.NFcn();
|
||||||
fout << endl;
|
fout << endl;
|
||||||
fout << endl << "*************************************************************************";
|
fout << endl << "*************************************************************************";
|
||||||
|
fout << endl;
|
||||||
|
|
||||||
// identifiy the longest variable name for proper formating reasons
|
// identifiy the longest variable name for proper formating reasons
|
||||||
Int_t maxLength = 10;
|
Int_t maxLength = 10;
|
||||||
@ -1868,9 +1909,16 @@ Bool_t PFitter::ExecuteSimplex()
|
|||||||
UInt_t maxfcn = numeric_limits<UInt_t>::max();
|
UInt_t maxfcn = numeric_limits<UInt_t>::max();
|
||||||
// tolerance = MINUIT2 Default tolerance
|
// tolerance = MINUIT2 Default tolerance
|
||||||
Double_t tolerance = 0.1;
|
Double_t tolerance = 0.1;
|
||||||
|
// keep track of elapsed time
|
||||||
|
Double_t start=0.0, end=0.0;
|
||||||
|
start=MilliTime();
|
||||||
ROOT::Minuit2::FunctionMinimum min = simplex(maxfcn, tolerance);
|
ROOT::Minuit2::FunctionMinimum min = simplex(maxfcn, tolerance);
|
||||||
|
end=MilliTime();
|
||||||
|
cout << ">> PFitter::ExecuteMinimize(): execution time for Simplex = " << setprecision(3) << (end-start)/1.0e3 << " sec." << endl;
|
||||||
|
TString str = TString::Format("Simplex: %.3f sec", (end-start)/1.0e3);
|
||||||
|
fElapsedTime.push_back(str);
|
||||||
if (!min.IsValid()) {
|
if (!min.IsValid()) {
|
||||||
cerr << endl << "**WARNING**: PFitter::ExecuteSimplex(): Fit did not converge, sorry ...";
|
cerr << endl << ">> PFitter::ExecuteSimplex(): **WARNING**: Fit did not converge, sorry ...";
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
fIsValid = false;
|
fIsValid = false;
|
||||||
return false;
|
return false;
|
||||||
@ -1915,6 +1963,22 @@ Bool_t PFitter::ExecuteSimplex()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
// MilliTime
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* <b>return:</b>
|
||||||
|
*/
|
||||||
|
Double_t PFitter::MilliTime()
|
||||||
|
{
|
||||||
|
struct timeval now;
|
||||||
|
gettimeofday(&now, 0);
|
||||||
|
|
||||||
|
return ((Double_t)now.tv_sec * 1.0e6 + (Double_t)now.tv_usec)/1.0e3;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------
|
||||||
// end
|
// end
|
||||||
//-------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------
|
||||||
|
@ -108,6 +108,8 @@ class PFitter
|
|||||||
|
|
||||||
PDoublePairVector fOriginalFitRange; ///< keeps the original fit range in case there is a range command in the COMMAND block
|
PDoublePairVector fOriginalFitRange; ///< keeps the original fit range in case there is a range command in the COMMAND block
|
||||||
|
|
||||||
|
PStringVector fElapsedTime;
|
||||||
|
|
||||||
// commands
|
// commands
|
||||||
Bool_t CheckCommands();
|
Bool_t CheckCommands();
|
||||||
Bool_t SetParameters();
|
Bool_t SetParameters();
|
||||||
@ -126,6 +128,8 @@ class PFitter
|
|||||||
Bool_t ExecuteScan();
|
Bool_t ExecuteScan();
|
||||||
Bool_t ExecuteSave(Bool_t first);
|
Bool_t ExecuteSave(Bool_t first);
|
||||||
Bool_t ExecuteSimplex();
|
Bool_t ExecuteSimplex();
|
||||||
|
|
||||||
|
Double_t MilliTime();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _PFITTER_H_
|
#endif // _PFITTER_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user