![]() |
AmpTools
|
#include <FitResults.h>
Public Member Functions | |
FitResults (ConfigurationInfo *cfgInfo, vector< IntensityManager * > intenManVec, map< string, LikelihoodCalculator * > likCalcMap, map< string, NormIntInterface * > normIntMap, MinuitMinimizationManager *minManager, ParameterManager *parManager) | |
FitResults (const string &inFile) | |
~FitResults () | |
bool | valid () const |
const NormIntInterface * | normInt (const string &reactionName) const |
const ConfigurationInfo * | configInfo () const |
double | likelihood () const |
double | likelihood (const string &reactionName) const |
pair< double, double > | intensity (bool accCorrected=true) const |
pair< double, double > | intensity (const vector< string > &litudes, bool accCorrected=true) const |
pair< double, double > | phaseDiff (const string &1, const string &2) const |
string | realProdParName (const string &litude) const |
string | imagProdParName (const string &litude) const |
string | ampScaleName (const string &litude) const |
double | parValue (const string &parName) const |
double | parError (const string &parName) const |
double | covariance (const string &par1, const string &par2) const |
map< string, complex< double > > | ampProdParMap () const |
map< string, double > | ampScaleParMap () const |
map< string, double > | ampParMap () const |
complex< double > | productionParameter (const string &Name) const |
complex< double > | scaledProductionParameter (const string &Name) const |
double | ampScale (const string &Name) const |
int | eMatrixStatus () const |
int | lastMinuitCommandStatus () const |
int | lastMinuitCommand () const |
double | minuitPrecision () const |
int | minuitStrategy () const |
double | estDistToMinimum () const |
double | bestMinimum () const |
const vector< string > & | parNameList () const |
const vector< double > & | parValueList () const |
const vector< vector< double > > & | errorMatrix () const |
const vector< string > & | reactionList () const |
vector< string > | ampList () const |
vector< string > | ampList (const string &reaction) const |
void | saveResults () |
void | writeResults (const string &fileName) const |
void | writeSeed (const string &fileName) const |
void | loadResults (const string &fileName) |
void | rotateResults () |
void | writeFitResults (const string &fileName) |
Protected Member Functions | |
FitResults (const FitResults &fitResults) | |
FitResults () | |
FitResults & | operator= (const FitResults &results) |
A class for storing the information from a fit and providing an interface to stored information so that subsequent analysis can be performed.
This class captures a snapshot of the relevant information from the AmplitudeManager, LikelihoodCalculator, MinuitMinimizationManager and ParameterManager after a fit. In addition it has the capability to store and redeliver NormIntInterface objects to provide the normalization integrals for the amplitude. It also stores a working copy of the configuration file used to perfrom the fit. The stored config file is not a verbatim copy of the original file, but it functions identically.
Definition at line 70 of file FitResults.h.
FitResults::FitResults | ( | ConfigurationInfo * | cfgInfo, |
vector< IntensityManager * > | intenManVec, | ||
map< string, LikelihoodCalculator * > | likCalcMap, | ||
map< string, NormIntInterface * > | normIntMap, | ||
MinuitMinimizationManager * | minManager, | ||
ParameterManager * | parManager | ||
) |
Constructor for recording results of fits.
This constructor should be used when the FitResults object is going to capture the results of a fit. It needs to have pointers to the various classes that contain critical information. FitResults d does not delete these pointers in its destructor so the calling function is responsible for managing the memory allocated by these objects. The AmpToolsInterface class utilizes this constructor. It is typically not the constructor that a user would use.
[in] | cfgInfo | pointer to ConfigurationInfo class |
[in] | intenManVec | vector of IntensityManager pointers, one for each reaction |
[in] | likCalcMap | map from reaction name to LikelihoodCalculator pointer |
[in] | normIntMap | map from reaction name to NormIntInterface pointer |
[in] | parManager | a pointer to the ParameterManager used in the fit |
Definition at line 52 of file FitResults.cc.
FitResults::FitResults | ( | const string & | inFile | ) |
Constructor for accessing the results of fits.
This constructor will reconstitute a FitResults object from a file. This is the constructor that is most useful for users to open and access saved results of the fit.
[in] | inFile | the name of the input file |
Definition at line 71 of file FitResults.cc.
FitResults::~FitResults | ( | ) |
The destructor.
The FitResults object only cleans up memory that it allocated itself. It will not delete the AmplitudeManagers, LikelihoodCalculator, etc. pointers that were passed in at construction time.
Definition at line 79 of file FitResults.cc.
|
protected |
Copy constructor.
This is disabled to avoid memory handling complications since FitResults may hold pointers to many objects.
|
protected |
Default constructor.
Disabled. The user should use one of the two provided constructors.
vector< string > FitResults::ampList | ( | ) | const |
A single vector of all the amplitude names for all reactions.
Definition at line 574 of file FitResults.cc.
vector< string > FitResults::ampList | ( | const string & | reaction | ) | const |
A vector of amplitude names for a particular reaction.
[in] | reaction | the name of the reaction |
Definition at line 596 of file FitResults.cc.
map< string, double > FitResults::ampParMap | ( | ) | const |
Return a map of parameter names (strings) to the values of the parameters for all amplitude parameters used in the fit.
Definition at line 472 of file FitResults.cc.
map< string, complex< double > > FitResults::ampProdParMap | ( | ) | const |
Return a map of amplitude names (strings) to values for the complex production amplitudes for each amplitude.
Definition at line 440 of file FitResults.cc.
double FitResults::ampScale | ( | const string & | ampName | ) | const |
Return the real-valued scale for the amplitude. The default for this is unity, but some fits may scale amplitudes, e.g., for isospin relations within a fit, or float a common scale for several amplitudes.
[in] | ampName | the name of the amplitude. |
Definition at line 545 of file FitResults.cc.
string FitResults::ampScaleName | ( | const string & | amplitude | ) | const |
Return the name of the parameter for the scale factor for an amplitude
[in] | amplitude | the amplitude name |
Definition at line 410 of file FitResults.cc.
map< string, double > FitResults::ampScaleParMap | ( | ) | const |
Return a map of amplitude names (strings) to values for the scale factors for each amplitude.
Definition at line 456 of file FitResults.cc.
|
inline |
The value of the best minimum found by MINUIT.
Definition at line 354 of file FitResults.h.
|
inline |
Returns a const pointer to the configuration info that is being used in the fit or was read in from the input file.
Definition at line 140 of file FitResults.h.
double FitResults::covariance | ( | const string & | par1, |
const string & | par2 | ||
) | const |
Return the covaraince of two parameters
[in] | par1 | the first parameter |
[in] | par2 | the second parameter |
Definition at line 528 of file FitResults.cc.
|
inline |
Returns the status of the error matrix as reported by MINUIT at the end of the of the fit. The return value has the following meanings:
0 = not calculated at all 1 = approximation only, not accurate 2 = full matrix, but forced positive-definite 3 = full accurate covariance matrix
Definition at line 293 of file FitResults.h.
|
inline |
The covariance matrix of the fit. The order of the rows and columns is as the parameters appear in the parNameList.
Definition at line 381 of file FitResults.h.
|
inline |
The estimated distance to minimum as reported by MINUIT.
Definition at line 349 of file FitResults.h.
string FitResults::imagProdParName | ( | const string & | amplitude | ) | const |
Return the name of the parameter for the imaginary value of the production coefficienct of an amplitude.
[in] | amplitude | the amplitude name |
Definition at line 398 of file FitResults.cc.
pair< double, double > FitResults::intensity | ( | bool | accCorrected = true | ) | const |
Return the intensity (first) and its statistical error (second) for all amplitudes.
[in] | accCorrected | an optional boolean argument that when true (default) will correct the intenisty for acceptance and when false will not perform the correction |
Definition at line 107 of file FitResults.cc.
pair< double, double > FitResults::intensity | ( | const vector< string > & | amplitudes, |
bool | accCorrected = true |
||
) | const |
Return the intensity (first) and its statistical error (second) for a subset of amplitudes. By default this is the acceptenace corrected intensity. To obtain the product of intensity weighted by the efficiency then pass in 'false' to the function.
[in] | amplitudes | a vector of amplitudes names to sum over when calculating the intensity |
[in] | accCorrected | an optional boolean argument that when true (default) will correct the intenisty for acceptance and when false will not perform the correction |
Definition at line 114 of file FitResults.cc.
|
inline |
An integer corresponding to the last command that was executed by the MinuitMinimizationManager. The return value has the following meaning:
0 = unkown 1 = migrad 2 = minos 3 = hesse
Definition at line 325 of file FitResults.h.
|
inline |
Returns the status of the last command executed by MINUIT. It may be useful to use this to verify that minimization did not terminate abnormally. Many of the other potential return values are not possible because the user does not interact with MINUIT directly. The return value has the following meanings:
-1 = undefined status 0 = normal 1 = blank command 2 = unreadable command 3 = unkown command 4 = abnormal termination (e.g., MIGRAD not converged)
Definition at line 311 of file FitResults.h.
|
inline |
Return the global likelihood.
Definition at line 145 of file FitResults.h.
double FitResults::likelihood | ( | const string & | reactionName | ) | const |
Return the contribution the global likelihood from a particular reaction.
[in] | reactionName | the name of the reaction |
Definition at line 93 of file FitResults.cc.
void FitResults::loadResults | ( | const string & | fileName | ) |
Reconstitutues a FitResults object from a file. Users will typically not use this function directly, but instead use the constructor that calls this function. It remains public for convenience.
[in] | fileName | loadResults |
Definition at line 758 of file FitResults.cc.
|
inline |
The value that MINUIT is assuming for the machine precision when performing calculations of the likelihood. This is typically automatically determined by MINUIT, however some fits, especially those that use GPU hardware, may need to specify this precision so MINUIT doesn't try to minimize what are fluctions in the likelihood due to machine precision.
Definition at line 336 of file FitResults.h.
|
inline |
The minimization strategy used by MINUIT. See MINUIT documenation for details. Strategy ranges from 0-2 with 0 being the fastest and 2 being the most robust. Any final fits should be done with strategy 2 to guarantee a proper minium.
Definition at line 344 of file FitResults.h.
const NormIntInterface * FitResults::normInt | ( | const string & | reactionName | ) | const |
Returns a const pointer to the NormIntInterface that is being used in the fit or was reconstructed from the input file.
[in] | reactionName | the name reaction to return the interface for |
Definition at line 366 of file FitResults.cc.
|
protected |
The assignment operator is disabled due to complications with memory handling.
double FitResults::parError | ( | const string & | parName | ) | const |
Return the error on a parameter.
[in] | parName | the name of the parameter |
Definition at line 522 of file FitResults.cc.
|
inline |
A vector of all the names of all of the parameters that used in the fit. These are the actual parameters that MINUIT is manipulating. The values of the parameters can be obtained by the parValueList function and appear in the same order as the names.
Definition at line 365 of file FitResults.h.
double FitResults::parValue | ( | const string & | parName | ) | const |
Return the value of a parameter.
[in] | parName | the name of the parameter |
Definition at line 506 of file FitResults.cc.
|
inline |
A vector of all of the values of the parameters that are used in the fit. The order is as they appear in the parNameList.
Definition at line 373 of file FitResults.h.
pair< double, double > FitResults::phaseDiff | ( | const string & | amp1, |
const string & | amp2 | ||
) | const |
Return the pahse difference (first) and its error (second) in radians for two different amplitudes.
[in] | amp1 | the first amplitude |
[in] | amp2 | the second amplitude |
Definition at line 299 of file FitResults.cc.
complex< double > FitResults::productionParameter | ( | const string & | ampName | ) | const |
Return the value of the complex production parameter for an amplitude.
[in] | ampName | the name of the amplitude |
Definition at line 490 of file FitResults.cc.
|
inline |
A vector of all of the reaction names.
Definition at line 386 of file FitResults.h.
string FitResults::realProdParName | ( | const string & | amplitude | ) | const |
Return the name of the parameter for the real value of the production coefficienct of an amplitude.
[in] | amplitude | the amplitude name |
Definition at line 386 of file FitResults.cc.
void FitResults::rotateResults | ( | ) |
Rotates the results of a fit to have the following phase convention:
Definition at line 969 of file FitResults.cc.
void FitResults::saveResults | ( | ) |
This function fetches the likelihood, parameters, MINUIT status, from all of the various classes and captures this info as member data of this class. It is the function used after a fit to take a snapshot of the results.
Definition at line 610 of file FitResults.cc.
complex< double > FitResults::scaledProductionParameter | ( | const string & | ampName | ) | const |
Return the value of the complex production parameter scaled by the scale factor. This is the actual production amplitude used in the fit.
[in] | ampName | the name of the amplitude. |
Definition at line 500 of file FitResults.cc.
|
inline |
A function to test if the FitResults object is valid. This returns true if the object was successfully constructed from a file
Definition at line 126 of file FitResults.h.
void FitResults::writeFitResults | ( | const string & | fileName | ) |
Definition at line 1149 of file FitResults.cc.
void FitResults::writeResults | ( | const string & | fileName | ) | const |
Writes the current fit results object to a file. It sould typically be called after saveResults.
[in] | fileName | the name of the output file |
Definition at line 622 of file FitResults.cc.
void FitResults::writeSeed | ( | const string & | fileName | ) | const |
Writes a file that is useful for seeding the results of subsequent fits. The file contains commands to initalize the production parameters of the amplitudes to the current values stored in the FitResults object.
[in] | fileName | the name of the output file |
Definition at line 707 of file FitResults.cc.