#include <FitAmpPairCovariance.h>
Definition at line 11 of file FitAmpPairCovariance.h.
◆ FitAmpPairCovariance() [1/3]
FitAmpPairCovariance::FitAmpPairCovariance |
( |
const FitAmpPairList * |
myList | ) |
|
Definition at line 18 of file FitAmpPairCovariance.cpp.
TMatrixTSym< float > _fractionCov
TMatrixTSym< float > _cov2N
const FitAmpPairList * _myList
TMatrixTSym< float > _fractionSumCov
TMatrixT< float > _dFractionSum_by_dFraction
TMatrixTSym< float > _sum_xy
TMatrixT< float > _dFraction_by_dN
unsigned int size() const
TMatrixTSym< float > _corr2N
TMatrixT< float > _dN_by_d2N
TMatrixTSym< float > _integralCov
TMatrixT< float > _dIntegral_by_dN
TMatrixTSym< float > _cov
TMatrixTSym< float > _corr
◆ FitAmpPairCovariance() [2/3]
Definition at line 39 of file FitAmpPairCovariance.cpp.
TMatrixTSym< float > _fractionCov
TMatrixTSym< float > _cov2N
const FitAmpPairList * _myList
TMatrixTSym< float > _fractionSumCov
TMatrixT< float > _dFractionSum_by_dFraction
TMatrixTSym< float > _sum_xy
TMatrixT< float > _dFraction_by_dN
TMatrixTSym< float > _corr2N
TMatrixT< float > _dN_by_d2N
TMatrixTSym< float > _integralCov
TMatrixT< float > _dIntegral_by_dN
TMatrixTSym< float > _cov
TMatrixTSym< float > _corr
◆ FitAmpPairCovariance() [3/3]
Definition at line 59 of file FitAmpPairCovariance.cpp.
TMatrixTSym< float > _fractionCov
TMatrixTSym< float > _cov2N
const FitAmpPairList * _myList
TMatrixTSym< float > _fractionSumCov
TMatrixT< float > _dFractionSum_by_dFraction
TMatrixTSym< float > _sum_xy
TMatrixT< float > _dFraction_by_dN
TMatrixTSym< float > _corr2N
TMatrixT< float > _dN_by_d2N
TMatrixTSym< float > _integralCov
TMatrixT< float > _dIntegral_by_dN
TMatrixTSym< float > _cov
TMatrixTSym< float > _corr
◆ ~FitAmpPairCovariance()
FitAmpPairCovariance::~FitAmpPairCovariance |
( |
| ) |
|
|
virtual |
◆ add()
Definition at line 99 of file FitAmpPairCovariance.cpp.
101 cout <<
"WARNING in FitAmpPairCovariance::add: " 102 <<
"trying to add incompatible FitAmpPairCovariances" 103 <<
"\n\t _myListPtr = " <<
_myList <<
" other's: " << other.
_myList 108 cout <<
"WARNING in FitAmpPairCovariance::add: " 109 <<
"trying to add incompatible FitAmpPairCovariances"
const FitAmpPairList * _myList
TMatrixTSym< float > _sum_xy
bool isCompatibleWith(const FitAmpPairCovariance &other) const
◆ addLastEventFromList()
bool FitAmpPairCovariance::addLastEventFromList |
( |
| ) |
|
Definition at line 177 of file FitAmpPairCovariance.cpp.
180 if(dbThis) cout <<
"FitAmpPairCovariance::addLastEventFromList() size() " 182 if(!
resize())
return false;
186 if(dbThis)cout <<
"FitAmpPairCovariance::addLastEventFromList()" 187 <<
" adding event to cov matrix." << endl;
191 if(dbThis) cout <<
" i= " << i << endl;
int indexImag(int listPosition) const
std::complex< double > lastEntry() const
int indexReal(int listPosition) const
const FitAmpPairList * _myList
TMatrixTSym< float > _sum_xy
unsigned int size() const
unsigned int size() const
◆ calculateAll()
bool FitAmpPairCovariance::calculateAll |
( |
| ) |
|
Definition at line 210 of file FitAmpPairCovariance.cpp.
214 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 215 <<
" making dN_by_d2N" << endl;
218 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 219 <<
" making dFraction_by_dN" << endl;
222 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 223 <<
" making dFractionSum_by_dFraction" << endl;
226 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 227 <<
" making dIntegral_by_dN" << endl;
230 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 231 <<
" making 2NCovariance" << endl;
233 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 234 <<
" making NCovariance" << endl;
236 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 237 <<
" making FractionCovariance" << endl;
239 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 240 <<
" making FractionSumCovariance" << endl;
242 if(dbThis) cout <<
"FitAmpPairCovariance::calculateAll" 243 <<
" making IntegralCovariance" << endl;
bool makeIntegralCovariance()
bool makeFractionCovariance()
bool makeFractionSumCovariance()
bool make_dFractionSum_by_dFraction()
bool make_dIntegral_by_dN()
bool make_dFraction_by_dN()
◆ clearAll()
bool FitAmpPairCovariance::clearAll |
( |
| ) |
|
|
private |
◆ dirName()
std::string FitAmpPairCovariance::dirName |
( |
const std::string & |
asSubdirOf = "." | ) |
const |
|
private |
◆ getFractionError()
double FitAmpPairCovariance::getFractionError |
( |
int |
i | ) |
|
Definition at line 501 of file FitAmpPairCovariance.cpp.
504 cout <<
"ERROR in FitAmpPairCovariance::getFractionError" 505 <<
" variance is " << V <<
" which is < 0." 506 <<
" will return -9999." double getFractionVariance(int i)
◆ getFractionSumError()
double FitAmpPairCovariance::getFractionSumError |
( |
| ) |
|
Definition at line 518 of file FitAmpPairCovariance.cpp.
521 cout <<
"ERROR in FitAmpPairCovariance::getFractionSumError" 522 <<
" variance is " << V <<
" which is < 0." double getFractionSumVariance()
◆ getFractionSumVariance()
double FitAmpPairCovariance::getFractionSumVariance |
( |
| ) |
|
◆ getFractionVariance()
double FitAmpPairCovariance::getFractionVariance |
( |
int |
i | ) |
|
◆ getIntegralError()
double FitAmpPairCovariance::getIntegralError |
( |
| ) |
|
Definition at line 537 of file FitAmpPairCovariance.cpp.
540 cout <<
"ERROR in FitAmpPairCovariance::getFractionError" 541 <<
" variance is " << V <<
" which is < 0." 542 <<
" will return -9999." double getIntegralVariance()
◆ getIntegralVariance()
double FitAmpPairCovariance::getIntegralVariance |
( |
| ) |
|
◆ imagName()
std::string FitAmpPairCovariance::imagName |
( |
int |
listPosition | ) |
const |
|
private |
◆ indexImag()
int FitAmpPairCovariance::indexImag |
( |
int |
listPosition | ) |
const |
|
inlineprivate |
◆ indexReal()
int FitAmpPairCovariance::indexReal |
( |
int |
listPosition | ) |
const |
|
inlineprivate |
◆ isCompatibleWith()
Definition at line 84 of file FitAmpPairCovariance.cpp.
93 for(
unsigned int i=0; i < this->
size(); i++){
std::string realName(int listPosition) const
std::string imagName(int listPosition) const
bool isCompatibleWith(const FitAmpPairList &other) const
const FitAmpPairList * _myList
unsigned int size() const
unsigned int size() const
◆ isValid()
bool FitAmpPairCovariance::isValid |
( |
| ) |
const |
Definition at line 549 of file FitAmpPairCovariance.cpp.
551 static int numWarnings=0;
552 const static int maxWarnings=10;
554 cout <<
" FitAmpPairCovariance::isValid() with: " 555 <<
size() <<
" == " <<
_sum_x.GetNcols() <<
" ? " << endl;
558 if(numWarnings < 10){
559 cout <<
"WARNING: FitAmpPairCovariance::isValid returns false" 560 <<
" because size (" <<
size() <<
") is too big" 562 cout <<
" Will print this " << maxWarnings
563 <<
" times (" << numWarnings <<
")." << endl;
568 if(
size() <= 0)
return false;
unsigned int maxSize() const
unsigned int size() const
◆ listPositionFromIndex()
int FitAmpPairCovariance::listPositionFromIndex |
( |
int |
idx | ) |
const |
|
inlineprivate |
◆ make2NCovariance()
bool FitAmpPairCovariance::make2NCovariance |
( |
| ) |
|
|
private |
Definition at line 349 of file FitAmpPairCovariance.cpp.
351 if(dbThis) cout <<
"making 2N covariance" << endl;
365 _cov2N(i, j) = (mean_xy(i,j) - mean_x(i,0)*mean_x(j,0));
375 _cov2N(i, j) *= dN*dN/sfden;
389 cout <<
"After " <<
_Nevents <<
"events" << endl;
390 cout <<
"mean matrix" << endl;
392 cout <<
"Covariance Matrix 2N" << endl;
394 cout <<
"Correlation Matrix 2N" << endl;
TMatrixTSym< float > _cov2N
int listPositionFromIndex(int idx) const
const FitAmpPairList * _myList
TMatrixTSym< float > _sum_xy
unsigned int size() const
TMatrixTSym< float > _corr2N
virtual int numEvents() const
◆ make_dFraction_by_dN()
bool FitAmpPairCovariance::make_dFraction_by_dN |
( |
| ) |
|
|
private |
Definition at line 278 of file FitAmpPairCovariance.cpp.
280 if(dbThis) cout <<
"FitAmpPairCovariance::make_dFraction_by_dN() called" 298 double integ2 = integ*integ;
const FitAmpPairList * _myList
virtual double integral() const
TMatrixT< float > _dFraction_by_dN
unsigned int size() const
◆ make_dFractionSum_by_dFraction()
bool FitAmpPairCovariance::make_dFractionSum_by_dFraction |
( |
| ) |
|
|
private |
Definition at line 326 of file FitAmpPairCovariance.cpp.
328 if(dbThis) cout <<
"FitAmpPairCovariance::make_dFractionSum_by_dFraction()" 329 <<
" called" << endl;
const FitAmpPairList * _myList
TMatrixT< float > _dFractionSum_by_dFraction
unsigned int size() const
◆ make_dIntegral_by_dN()
bool FitAmpPairCovariance::make_dIntegral_by_dN |
( |
| ) |
|
|
private |
Definition at line 309 of file FitAmpPairCovariance.cpp.
311 if(dbThis) cout <<
"FitAmpPairCovariance::make_dIntegral_by_dN() called" const FitAmpPairList * _myList
unsigned int size() const
TMatrixT< float > _dIntegral_by_dN
◆ make_dN_by_d2N()
bool FitAmpPairCovariance::make_dN_by_d2N |
( |
| ) |
|
|
private |
Definition at line 251 of file FitAmpPairCovariance.cpp.
253 if(dbThis) cout <<
"FitAmpPairCovariance::make_dN_by_d2N() called" << endl;
268 complex<double> fpv =
int indexImag(int listPosition) const
std::complex< double > fitParValue() const
int indexReal(int listPosition) const
const FitAmpPairList * _myList
unsigned int size() const
TMatrixT< float > _dN_by_d2N
◆ makeDirectory()
bool FitAmpPairCovariance::makeDirectory |
( |
const std::string & |
asSubdirOf = "." | ) |
const |
|
private |
Definition at line 590 of file FitAmpPairCovariance.cpp.
614 mode_t mode = S_IRWXU | S_IRWXG | S_IRWXO
619 int zeroForSuccess = 0;
620 zeroForSuccess |= mkdir( (asSubdirOf ).c_str(), mode );
621 zeroForSuccess |= mkdir( (
dirName(asSubdirOf) ).c_str(), mode );
622 return (0 == zeroForSuccess);
std::string dirName(const std::string &asSubdirOf=".") const
◆ makeFractionCovariance()
bool FitAmpPairCovariance::makeFractionCovariance |
( |
| ) |
|
|
private |
Definition at line 441 of file FitAmpPairCovariance.cpp.
444 TMatrixT<float> dFraction_by_dN_Transpose(
size(),
size());
448 dFraction_by_dN_Transpose);
451 cout <<
"Correlation Matrix Fractions" << endl;
TMatrixTSym< float > _fractionCov
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
unsigned int size() const
TMatrixT< float > _dFraction_by_dN
TMatrixTSym< float > _cov
◆ makeFractionSumCovariance()
bool FitAmpPairCovariance::makeFractionSumCovariance |
( |
| ) |
|
|
private |
Definition at line 457 of file FitAmpPairCovariance.cpp.
460 TMatrixT<float> dFractionSum_by_dFraction_Transpose(
size(), 1);
465 dFractionSum_by_dFraction_Transpose);
468 cout <<
"After " <<
_Nevents <<
"events" << endl;
469 cout <<
"Covariance Matrix for FractionSum" << endl;
TMatrixTSym< float > _fractionCov
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
TMatrixTSym< float > _fractionSumCov
TMatrixT< float > _dFractionSum_by_dFraction
unsigned int size() const
◆ makeIntegralCovariance()
bool FitAmpPairCovariance::makeIntegralCovariance |
( |
| ) |
|
|
private |
Definition at line 476 of file FitAmpPairCovariance.cpp.
479 TMatrixT<float> dIntegral_by_dN_Transpose(
size(), 1);
484 * dIntegral_by_dN_Transpose);
487 cout <<
"Correlation Matrix Integral" << endl;
TMatrixTSym< float > _fractionCov
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
unsigned int size() const
TMatrixTSym< float > _integralCov
TMatrixT< float > _dIntegral_by_dN
TMatrixTSym< float > _cov
◆ makeNCovariance()
bool FitAmpPairCovariance::makeNCovariance |
( |
| ) |
|
|
private |
Definition at line 401 of file FitAmpPairCovariance.cpp.
408 TMatrixT<float> dN_by_d2N_Transpose(2*
size(),
size());
411 cout <<
"FitAmpPairCovariance::makeNCovariance()" 415 cout <<
"and its transpose:" << endl;
416 dN_by_d2N_Transpose.Print();
422 if(
_cov(i, i) <= 0)
continue;
432 cout <<
"After " <<
_Nevents <<
"events" << endl;
433 cout <<
"Covariance Matrix N" << endl;
435 cout <<
"Correlation Matrix N" << endl;
TMatrixTSym< float > _cov2N
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
const FitAmpPairList * _myList
unsigned int size() const
unsigned int size() const
TMatrixT< float > _dN_by_d2N
TMatrixTSym< float > _cov
TMatrixTSym< float > _corr
◆ matrix_x_fname()
std::string FitAmpPairCovariance::matrix_x_fname |
( |
const std::string & |
asSubdirOf = "." | ) |
const |
|
private |
Definition at line 628 of file FitAmpPairCovariance.cpp.
629 return dirName(asSubdirOf) +
"/" +
"matrix_x.txt";
std::string dirName(const std::string &asSubdirOf=".") const
◆ matrix_xy_fname()
std::string FitAmpPairCovariance::matrix_xy_fname |
( |
const std::string & |
asSubdirOf = "." | ) |
const |
|
private |
Definition at line 631 of file FitAmpPairCovariance.cpp.
632 return dirName(asSubdirOf) +
"/" +
"matrix_xy.txt";
std::string dirName(const std::string &asSubdirOf=".") const
◆ maxSize()
unsigned int FitAmpPairCovariance::maxSize |
( |
| ) |
const |
|
inlineprivate |
◆ Nevents()
int FitAmpPairCovariance::Nevents |
( |
| ) |
const |
|
inline |
◆ operator+()
◆ operator+=()
◆ realName()
std::string FitAmpPairCovariance::realName |
( |
int |
listPosition | ) |
const |
|
private |
◆ reset()
bool FitAmpPairCovariance::reset |
( |
| ) |
|
◆ resize()
bool FitAmpPairCovariance::resize |
( |
| ) |
|
|
private |
Definition at line 124 of file FitAmpPairCovariance.cpp.
127 cout <<
"FitAmpPairCovariance::resize()" 128 <<
" resizing from " <<
size()
130 <<
" with maxSize() = " <<
maxSize()
139 cout <<
"FitAmpPairCovariance::resize size() = " <<
size()
140 <<
" that's too big! won't do it!" << endl;
164 cout <<
"FitAmpPairCovariance::resize() to " 165 <<
size() <<
" done." << endl;
TMatrixTSym< float > _fractionCov
TMatrixTSym< float > _cov2N
const FitAmpPairList * _myList
TMatrixTSym< float > _fractionSumCov
TMatrixT< float > _dFractionSum_by_dFraction
unsigned int maxSize() const
TMatrixTSym< float > _sum_xy
unsigned int size() const
TMatrixT< float > _dFraction_by_dN
unsigned int size() const
TMatrixTSym< float > _corr2N
TMatrixT< float > _dN_by_d2N
TMatrixTSym< float > _integralCov
TMatrixT< float > _dIntegral_by_dN
TMatrixTSym< float > _cov
TMatrixTSym< float > _corr
◆ retrieve()
bool FitAmpPairCovariance::retrieve |
( |
const std::string & |
fromDirectory = "." | ) |
|
Definition at line 711 of file FitAmpPairCovariance.cpp.
712 if(!
resize())
return false;
bool retrieve_sum_xy(const std::string &inDirectory)
bool retrieve_sum_x(const std::string &inDirectory)
◆ retrieve_sum_x()
bool FitAmpPairCovariance::retrieve_sum_x |
( |
const std::string & |
inDirectory | ) |
|
|
private |
Definition at line 719 of file FitAmpPairCovariance.cpp.
723 if(is.bad())
return false;
725 if(dbThis) cout <<
"opened file: " 730 std::map<string, double> map_x;
734 if(dbThis) cout <<
"reading " << counter <<
". line" << endl;
738 cout <<
"just read " << st1 <<
" " <<
_Nevents << endl;
744 cout <<
"just read " << st1 <<
" " << val << endl;
750 if(dbThis)cout <<
"retrieve_sum_x, filling _sum_x for size " 752 for(
unsigned int i=0; i <
size(); i++){
756 cout <<
"Tried to retrieve from map entry for " <<
realName(i)
757 <<
" \n got: " << map_x[
realName(i)] << endl;
762 cout <<
" did so, look at what I got for sum_x" << endl;
int indexImag(int listPosition) const
std::string realName(int listPosition) const
std::string imagName(int listPosition) const
int indexReal(int listPosition) const
unsigned int maxSize() const
unsigned int size() const
std::string matrix_x_fname(const std::string &asSubdirOf=".") const
◆ retrieve_sum_xy()
bool FitAmpPairCovariance::retrieve_sum_xy |
( |
const std::string & |
inDirectory | ) |
|
|
private |
Definition at line 768 of file FitAmpPairCovariance.cpp.
772 if(is.bad())
return false;
773 if(dbThis) cout <<
"opened file: " 776 std::string st1, st2;
778 map< string, map<string, double> > map_xy;
785 is >> st1 >> st2 >> val;
786 map_xy[st1][st2] = val;
787 if(dbThis) cout <<
"just read " << counter <<
". line: " 788 << st1 <<
" " << st2 <<
" " << val << endl;
794 for(
unsigned int i=0; i <
size(); i++){
795 for(
unsigned int j=0; j <
size(); j++){
803 cout <<
"got _sum_xy: " << endl;
int indexImag(int listPosition) const
std::string realName(int listPosition) const
std::string imagName(int listPosition) const
int indexReal(int listPosition) const
unsigned int maxSize() const
TMatrixTSym< float > _sum_xy
unsigned int size() const
std::string matrix_xy_fname(const std::string &asSubdirOf=".") const
◆ save()
bool FitAmpPairCovariance::save |
( |
const std::string & |
asSubdirOf = "." | ) |
const |
Definition at line 635 of file FitAmpPairCovariance.cpp.
638 cout <<
"WARNING FitAmpPairCovariance::save(" << inDirectory <<
")" 639 <<
" I'm not valid, I won't save anything." << endl;
643 cout <<
"saving FitAmpPairCovariance in " << inDirectory <<
"." << endl;
bool makeDirectory(const std::string &asSubdirOf=".") const
bool save_sum_xy(const std::string &inDirectory) const
bool save_sum_x(const std::string &inDirectory) const
◆ save_sum_x()
bool FitAmpPairCovariance::save_sum_x |
( |
const std::string & |
inDirectory | ) |
const |
|
private |
Definition at line 653 of file FitAmpPairCovariance.cpp.
656 cout <<
"WARNING FitAmpPairCovariance::save_sum_x(" << inDirectory <<
")" 657 <<
" I'm not valid, I won't save anything." << endl;
663 cout <<
"about to save: ";
668 os << setprecision(20) <<
realName(i) <<
" " 671 os << setprecision(20) <<
imagName(i) <<
" " int indexImag(int listPosition) const
std::string realName(int listPosition) const
std::string imagName(int listPosition) const
int indexReal(int listPosition) const
const FitAmpPairList * _myList
unsigned int size() const
std::string matrix_x_fname(const std::string &asSubdirOf=".") const
◆ save_sum_xy()
bool FitAmpPairCovariance::save_sum_xy |
( |
const std::string & |
inDirectory | ) |
const |
|
private |
Definition at line 678 of file FitAmpPairCovariance.cpp.
681 cout <<
"WARNING FitAmpPairCovariance::save_sum_xy(" << inDirectory <<
")" 682 <<
" I'm not valid, I won't save anything." << endl;
688 cout <<
"about to save: ";
int indexImag(int listPosition) const
std::string realName(int listPosition) const
std::string imagName(int listPosition) const
int indexReal(int listPosition) const
const FitAmpPairList * _myList
TMatrixTSym< float > _sum_xy
unsigned int size() const
std::string matrix_xy_fname(const std::string &asSubdirOf=".") const
◆ size()
unsigned int FitAmpPairCovariance::size |
( |
| ) |
const |
◆ _corr
TMatrixTSym<float> FitAmpPairCovariance::_corr |
|
private |
◆ _corr2N
TMatrixTSym<float> FitAmpPairCovariance::_corr2N |
|
private |
◆ _cov
TMatrixTSym<float> FitAmpPairCovariance::_cov |
|
private |
◆ _cov2N
TMatrixTSym<float> FitAmpPairCovariance::_cov2N |
|
private |
◆ _dFraction_by_dN
TMatrixT<float> FitAmpPairCovariance::_dFraction_by_dN |
|
private |
◆ _dFractionSum_by_dFraction
TMatrixT<float> FitAmpPairCovariance::_dFractionSum_by_dFraction |
|
private |
◆ _dIntegral_by_dN
TMatrixT<float> FitAmpPairCovariance::_dIntegral_by_dN |
|
private |
◆ _dN_by_d2N
TMatrixT<float> FitAmpPairCovariance::_dN_by_d2N |
|
private |
◆ _fractionCov
TMatrixTSym<float> FitAmpPairCovariance::_fractionCov |
|
private |
◆ _fractionSumCov
TMatrixTSym<float> FitAmpPairCovariance::_fractionSumCov |
|
private |
◆ _integralCov
TMatrixTSym<float> FitAmpPairCovariance::_integralCov |
|
private |
◆ _maxSize
unsigned int FitAmpPairCovariance::_maxSize = 1500 |
|
staticprivate |
◆ _myList
◆ _needToRecalculate
bool FitAmpPairCovariance::_needToRecalculate |
|
private |
◆ _Nevents
unsigned int FitAmpPairCovariance::_Nevents |
|
private |
◆ _size
unsigned int FitAmpPairCovariance::_size |
|
private |
◆ _sum_x
TMatrixT<float> FitAmpPairCovariance::_sum_x |
|
private |
◆ _sum_xy
TMatrixTSym<float> FitAmpPairCovariance::_sum_xy |
|
private |
The documentation for this class was generated from the following files: