ROOTPWA
|
#include <TPWALikelihood.h>
Classes | |
struct | functionCallInfo |
Public Types | |
enum | functionCallEnum { FDF = 0, GRADIENT = 1, DOEVAL = 2, DODERIVATIVE = 3, NMB_FUNCTIONCALLENUM = 4 } |
typedef complexT::value_type | value_type |
typedef boost::multi_array < std::string, 2 > | waveNameArrayType |
typedef boost::multi_array < double, 2 > | waveThrArrayType |
typedef boost::multi_array < unsigned int, 2 > | waveToIntMapType |
typedef boost::multi_array < unsigned int, 2 > | waveToListMapType |
typedef boost::multi_array < boost::tuple< int, int >, 3 > | ampToParMapType |
typedef boost::multi_array < complexT, 3 > | ampsArrayType |
typedef boost::multi_array < complexT, 4 > | normMatrixArrayType |
typedef boost::multi_array < value_type, 2 > | phaseSpaceIntType |
Public Member Functions | |
TPWALikelihood () | |
~TPWALikelihood () | |
virtual TPWALikelihood * | Clone () const |
clones the function using the default copy constructor | |
virtual unsigned int | NDim () const |
returns total number of function parameters (= dimension of the function) | |
virtual void | FdF (const double *par, double &funcVal, double *gradient) const |
optimized method to evaluate function value and derivative at a point defined by par at the same time | |
virtual void | Gradient (const double *par, double *gradient) const |
calculates gradient (vector of partial derivatives) of function at point defined by par | |
virtual double | DoEval (const double *par) const |
virtual double | DoDerivative (const double *par, unsigned int derivativeIndex) const |
unsigned int | nmbEvents () const |
returns number of events that enter in the likelihood | |
unsigned int | rank () const |
returns rank of spin density matrix | |
unsigned int | nmbWaves (const int reflectivity=0) const |
returns total number of waves (reflectivity == 0) or number or number of waves with positive/negative reflectivity; flat wave is not counted! | |
unsigned int | nmbPars () const |
returns total number of parameters | |
std::vector< std::string > | waveNames () const |
returns vector with all wave names ordered like in input wave list | |
std::string | parName (const unsigned int parIndex) const |
returns name of likelihood parameter at parIndex | |
double | parThreshold (const unsigned int parIndex) const |
returns threshold in GeV/c^2 above which likelihood parameter at parIndex becomes free | |
double | dLcache (const unsigned int i) const |
unsigned int | ncalls (const functionCallEnum func=FDF) const |
double | Ltime (const functionCallEnum func=FDF) const |
double | Ntime (const functionCallEnum func=FDF) const |
void | enableCuda (const bool enableCuda=true) |
bool | cudaEnabled () const |
void | useNormalizedAmps (const bool useNorm=true) |
void | init (const unsigned int rank, const std::string &waveListFileName, const std::string &normIntFileName, const std::string &accIntFileName, const std::string &DirName=".", const unsigned int numbAccEvents=0, const bool useRootAmps=false) |
prepares all internal data structures | |
void | getIntegralMatrices (TCMatrix &normMatrix, TCMatrix &accMatrix, std::vector< double > &phaseSpaceIntegral) const |
void | buildProdAmpArrays (const double *inPar, std::vector< std::complex< double > > &prodAmps, std::vector< std::pair< int, int > > &parIndices, std::vector< std::string > &prodAmpNames, const bool withFlat=false) const |
std::ostream & | print (std::ostream &out=std::cout) const |
std::ostream & | printFuncInfo (std::ostream &out=std::cout) const |
std::vector< unsigned int > | orderedParIndices () const |
void | copyFromParArray (const double *inPar, ampsArrayType &outVal, value_type &outFlatVal) const |
void | copyToParArray (const ampsArrayType &inVal, const value_type inFlatVal, double *outPar) const |
Static Public Member Functions | |
static void | setQuiet (const bool flag=true) |
Private Member Functions | |
void | readWaveList (const std::string &waveListFileName) |
reads wave names and thresholds from wave list file | |
void | buildParDataStruct (const unsigned int rank) |
builds parameter data structures | |
void | readIntegrals (const std::string &normIntFileName, const std::string &accIntFileName, const std::string &integralTKeyName="integral") |
reads normalization and acceptance integrals from file | |
void | readDecayAmplitudes (const std::string &DirName=".", const bool useRootAmps=false, const std::string &LeafName="amplitude") |
reads decay amplitudes from files in specified directory | |
void | clear () |
void | reorderIntegralMatrix (integral &integral, normMatrixArrayType &reorderedMatrix) const |
void | reorderIntegralMatrix (const rpwa::ampIntegralMatrix &integral, normMatrixArrayType &reorderedMatrix) const |
void | resetFuncCallInfo () const |
Static Private Member Functions | |
static int | getReflectivity (const TString &waveName) |
Private Attributes | |
unsigned int | _nmbEvents |
unsigned int | _rank |
unsigned int | _nmbWaves |
unsigned int | _nmbWavesRefl [2] |
unsigned int | _nmbWavesReflMax |
unsigned int | _nmbPars |
bool | _useNormalizedAmps |
unsigned int | _numbAccEvents |
double | _totAcc |
waveNameArrayType | _waveNames |
waveThrArrayType | _waveThresholds |
waveToListMapType | _waveToWaveIndex |
std::vector< std::string > | _parNames |
std::vector< double > | _parThresholds |
ampToParMapType | _prodAmpToFuncParMap |
ampsArrayType | _decayAmps |
std::vector< double > | _parCache |
std::vector< double > | _derivCache |
normMatrixArrayType | _normMatrix |
normMatrixArrayType | _accMatrix |
phaseSpaceIntType | _phaseSpaceIntegral |
functionCallInfo | _funcCallInfo [NMB_FUNCTIONCALLENUM] |
Static Private Attributes | |
static bool | _debug = true |
Friends | |
std::ostream & | operator<< (std::ostream &out, const TPWALikelihood &func) |
Definition at line 65 of file TPWALikelihood.h.
typedef boost::multi_array<complexT, 3> TPWALikelihood< complexT >::ampsArrayType |
Definition at line 77 of file TPWALikelihood.h.
typedef boost::multi_array<boost::tuple<int, int>, 3> TPWALikelihood< complexT >::ampToParMapType |
Definition at line 76 of file TPWALikelihood.h.
typedef boost::multi_array<complexT, 4> TPWALikelihood< complexT >::normMatrixArrayType |
Definition at line 78 of file TPWALikelihood.h.
typedef boost::multi_array<value_type, 2> TPWALikelihood< complexT >::phaseSpaceIntType |
Definition at line 79 of file TPWALikelihood.h.
typedef complexT::value_type TPWALikelihood< complexT >::value_type |
Definition at line 69 of file TPWALikelihood.h.
typedef boost::multi_array<std::string, 2> TPWALikelihood< complexT >::waveNameArrayType |
Definition at line 72 of file TPWALikelihood.h.
typedef boost::multi_array<double, 2> TPWALikelihood< complexT >::waveThrArrayType |
Definition at line 73 of file TPWALikelihood.h.
typedef boost::multi_array<unsigned int, 2> TPWALikelihood< complexT >::waveToIntMapType |
Definition at line 74 of file TPWALikelihood.h.
typedef boost::multi_array<unsigned int, 2> TPWALikelihood< complexT >::waveToListMapType |
Definition at line 75 of file TPWALikelihood.h.
enum TPWALikelihood::functionCallEnum |
Definition at line 85 of file TPWALikelihood.h.
TPWALikelihood< complexT >::TPWALikelihood | ( | ) |
Definition at line 74 of file TPWALikelihood.cc.
References TPWALikelihood< complexT >::_nmbWavesRefl, and TPWALikelihood< complexT >::resetFuncCallInfo().
Referenced by TPWALikelihood< complexT >::Clone().
TPWALikelihood< complexT >::~TPWALikelihood | ( | ) |
Definition at line 98 of file TPWALikelihood.cc.
|
private |
builds parameter data structures
Definition at line 631 of file TPWALikelihood.cc.
void TPWALikelihood< complexT >::buildProdAmpArrays | ( | const double * | inPar, |
std::vector< std::complex< double > > & | prodAmps, | ||
std::vector< std::pair< int, int > > & | parIndices, | ||
std::vector< std::string > & | prodAmpNames, | ||
const bool | withFlat = false |
||
) | const |
Definition at line 1045 of file TPWALikelihood.cc.
Referenced by main().
|
private |
Definition at line 1087 of file TPWALikelihood.cc.
|
inlinevirtual |
clones the function using the default copy constructor
Definition at line 108 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::TPWALikelihood().
void TPWALikelihood< complexT >::copyFromParArray | ( | const double * | inPar, |
ampsArrayType & | outVal, | ||
value_type & | outFlatVal | ||
) | const |
Definition at line 1126 of file TPWALikelihood.cc.
Referenced by main().
void TPWALikelihood< complexT >::copyToParArray | ( | const ampsArrayType & | inVal, |
const value_type | inFlatVal, | ||
double * | outPar | ||
) | const |
Definition at line 1160 of file TPWALikelihood.cc.
bool TPWALikelihood< complexT >::cudaEnabled | ( | ) | const |
Definition at line 530 of file TPWALikelihood.cc.
|
inline |
Definition at line 133 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_derivCache, and i.
|
virtual |
Definition at line 330 of file TPWALikelihood.cc.
References i.
|
virtual |
void TPWALikelihood< complexT >::enableCuda | ( | const bool | enableCuda = true | ) |
Definition at line 524 of file TPWALikelihood.cc.
Referenced by main().
|
virtual |
optimized method to evaluate function value and derivative at a point defined by par at the same time
Definition at line 107 of file TPWALikelihood.cc.
Referenced by main().
void TPWALikelihood< complexT >::getIntegralMatrices | ( | TCMatrix & | normMatrix, |
TCMatrix & | accMatrix, | ||
std::vector< double > & | phaseSpaceIntegral | ||
) | const |
Definition at line 1010 of file TPWALikelihood.cc.
References TCMatrix::set().
Referenced by main().
|
staticprivate |
Definition at line 1097 of file TPWALikelihood.cc.
|
virtual |
calculates gradient (vector of partial derivatives) of function at point defined by par
Definition at line 365 of file TPWALikelihood.cc.
Referenced by main().
void TPWALikelihood< complexT >::init | ( | const unsigned int | rank, |
const std::string & | waveListFileName, | ||
const std::string & | normIntFileName, | ||
const std::string & | accIntFileName, | ||
const std::string & | ampDirName = "." , |
||
const unsigned int | numbAccEvents = 0 , |
||
const bool | useRootAmps = false |
||
) |
prepares all internal data structures
Definition at line 542 of file TPWALikelihood.cc.
Referenced by main().
|
inline |
Definition at line 136 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_funcCallInfo.
|
inline |
Definition at line 134 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_funcCallInfo, and TPWALikelihood< complexT >::functionCallInfo::nmbCalls.
|
inlinevirtual |
returns total number of function parameters (= dimension of the function)
Definition at line 110 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::nmbPars().
Referenced by main().
|
inline |
returns number of events that enter in the likelihood
Definition at line 124 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_nmbEvents.
Referenced by main().
|
inline |
returns total number of parameters
Definition at line 127 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_nmbPars.
Referenced by TPWALikelihood< complexT >::NDim().
unsigned int TPWALikelihood< complexT >::nmbWaves | ( | const int | reflectivity = 0 | ) | const |
returns total number of waves (reflectivity == 0) or number or number of waves with positive/negative reflectivity; flat wave is not counted!
Definition at line 505 of file TPWALikelihood.cc.
Referenced by main().
|
inline |
Definition at line 138 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_funcCallInfo.
vector< unsigned int > TPWALikelihood< complexT >::orderedParIndices | ( | ) | const |
Definition at line 1226 of file TPWALikelihood.cc.
Referenced by main().
|
inline |
returns name of likelihood parameter at parIndex
Definition at line 130 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_parNames.
Referenced by main().
|
inline |
returns threshold in GeV/c^2 above which likelihood parameter at parIndex becomes free
Definition at line 131 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_parThresholds.
Referenced by main().
ostream & TPWALikelihood< complexT >::print | ( | std::ostream & | out = std::cout | ) | const |
Definition at line 1179 of file TPWALikelihood.cc.
ostream & TPWALikelihood< complexT >::printFuncInfo | ( | std::ostream & | out = std::cout | ) | const |
|
inline |
returns rank of spin density matrix
Definition at line 125 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_rank.
|
private |
reads decay amplitudes from files in specified directory
Definition at line 855 of file TPWALikelihood.cc.
References rpwa::amplitudeTreeLeaf::incohSubAmp(), and rpwa::amplitudeTreeLeaf::nmbIncohSubAmps().
|
private |
reads normalization and acceptance integrals from file
Definition at line 759 of file TPWALikelihood.cc.
References integral::events(), integral::nevents(), and integral::scan().
|
private |
reads wave names and thresholds from wave list file
Definition at line 566 of file TPWALikelihood.cc.
References getReflectivity().
|
private |
Definition at line 696 of file TPWALikelihood.cc.
References matrix< T >::element(), integral::files(), integral::index(), and integral::mat().
|
private |
Definition at line 740 of file TPWALikelihood.cc.
References rpwa::ampIntegralMatrix::element().
|
private |
Definition at line 1274 of file TPWALikelihood.cc.
References i.
Referenced by TPWALikelihood< complexT >::TPWALikelihood().
|
inlinestatic |
Definition at line 146 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_debug.
Referenced by main().
|
inline |
Definition at line 145 of file TPWALikelihood.h.
References TPWALikelihood< complexT >::_useNormalizedAmps.
Referenced by main().
vector< string > TPWALikelihood< complexT >::waveNames | ( | ) | const |
returns vector with all wave names ordered like in input wave list
Definition at line 1260 of file TPWALikelihood.cc.
Referenced by main().
|
friend |
Definition at line 170 of file TPWALikelihood.h.
|
private |
Definition at line 244 of file TPWALikelihood.h.
|
staticprivate |
Definition at line 222 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::setQuiet().
|
private |
Definition at line 237 of file TPWALikelihood.h.
|
mutableprivate |
Definition at line 240 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::dLcache().
|
mutableprivate |
Definition at line 247 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::Ltime(), TPWALikelihood< complexT >::ncalls(), and TPWALikelihood< complexT >::Ntime().
|
private |
Definition at line 211 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::nmbEvents().
|
private |
Definition at line 216 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::nmbPars().
|
private |
Definition at line 213 of file TPWALikelihood.h.
|
private |
Definition at line 214 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::TPWALikelihood().
|
private |
Definition at line 215 of file TPWALikelihood.h.
|
private |
Definition at line 243 of file TPWALikelihood.h.
|
private |
Definition at line 224 of file TPWALikelihood.h.
|
mutableprivate |
Definition at line 239 of file TPWALikelihood.h.
|
private |
Definition at line 230 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::parName().
|
private |
Definition at line 231 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::parThreshold().
|
private |
Definition at line 245 of file TPWALikelihood.h.
|
private |
Definition at line 232 of file TPWALikelihood.h.
|
private |
Definition at line 212 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::rank().
|
private |
Definition at line 225 of file TPWALikelihood.h.
|
private |
Definition at line 221 of file TPWALikelihood.h.
Referenced by TPWALikelihood< complexT >::useNormalizedAmps().
|
private |
Definition at line 227 of file TPWALikelihood.h.
|
private |
Definition at line 228 of file TPWALikelihood.h.
|
private |
Definition at line 229 of file TPWALikelihood.h.