MINT2
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
FitAmpPairFitCovariance Class Reference

#include <FitAmpPairFitCovariance.h>

Public Member Functions

 FitAmpPairFitCovariance (const FitAmpPairList *myList, const TMatrixTSym< double > &fitCov)
 
 FitAmpPairFitCovariance (const FitAmpPairFitCovariance &other)
 
bool addLastEventFromList ()
 
bool calculateAll ()
 
double getPairVariance (int i, int j)
 
double getPairError (int i, int j)
 
double getFractionVariance (int i)
 
double getFractionError (int i)
 
double getFractionSumVariance ()
 
double getFractionSumError ()
 
double getInterferenceFracSumVariance ()
 
double getInterferenceFracSumError ()
 
double getTotalFractionSumVariance ()
 
double getTotalFractionSumError ()
 
unsigned int size () const
 
bool isValid () const
 

Private Member Functions

std::string realName (int i) const
 
std::string imagName (int i) const
 
int indexReal (int i)
 
int indexImag (int i)
 
int listPositionFromIndex (int idx)
 
bool make_dFitAmpPair_by_dFitParameters ()
 
bool make_dFraction_by_dFitAmpPair ()
 
bool make_dFractionSum_by_dFraction ()
 
bool make_dInterferenceFracSum_by_dFraction ()
 
bool make_dTotalFractionSum_by_dFraction ()
 
bool resize ()
 
unsigned int maxSize () const
 
bool makeFitAmpPairCov ()
 
bool makeFractionCovariance ()
 
bool makeFractionSumCovariance ()
 
bool makeInterferenceFracSumCovariance ()
 
bool makeTotalFractionSumCovariance ()
 

Private Attributes

const FitAmpPairList_myList
 
TMatrixTSym< double > _fitCov
 
unsigned int _Nevents
 
unsigned int _size
 
bool _needToRecalculate
 
TMatrixTSym< double > _fitResult
 
TMatrixTSym< double > _pairCov
 
TMatrixTSym< double > _pairCorr
 
TMatrixTSym< double > _fractionCov
 
TMatrixTSym< double > _fractionSumCov
 
TMatrixTSym< double > _interferenceFracSumCov
 
TMatrixTSym< double > _totalFractionSumCov
 
TMatrixT< double > _dFitAmpPair_by_dFitParameters
 
TMatrixT< double > _dFraction_by_dFitAmpPair
 
TMatrixT< double > _dFractionSum_by_dFraction
 
TMatrixT< double > _dInterferenceFracSum_by_dFraction
 
TMatrixT< double > _dTotalFractionSum_by_dFraction
 

Static Private Attributes

static unsigned int _maxSize = 1500
 

Detailed Description

Definition at line 11 of file FitAmpPairFitCovariance.h.

Constructor & Destructor Documentation

◆ FitAmpPairFitCovariance() [1/2]

FitAmpPairFitCovariance::FitAmpPairFitCovariance ( const FitAmpPairList myList,
const TMatrixTSym< double > &  fitCov 
)

Definition at line 13 of file FitAmpPairFitCovariance.cpp.

16  : _myList(myList)
17  , _fitCov(fc)
18  , _Nevents(0)
19  , _size(1)
20  , _needToRecalculate(true)
21  , _pairCov(1)
22  , _pairCorr(1)
23  , _fractionCov(1)
24  , _fractionSumCov(1)
27  , _dFitAmpPair_by_dFitParameters(1, fc.GetNcols())
32 {
33  bool dbThis=false;
34  if(0 != _myList && _myList->size() >=1) resize();
35 
36  if(dbThis) {
37  cout << "FitAmpPairFitCovariance constructor called with this cov matrix:"
38  << endl;
39  _fitCov.Print();
40  }
41 }
TMatrixTSym< double > _fitCov
TMatrixTSym< double > _totalFractionSumCov
TMatrixTSym< double > _fractionCov
const FitAmpPairList * _myList
TMatrixTSym< double > _interferenceFracSumCov
TMatrixTSym< double > _pairCorr
TMatrixTSym< double > _pairCov
TMatrixT< double > _dTotalFractionSum_by_dFraction
TMatrixT< double > _dFractionSum_by_dFraction
TMatrixT< double > _dFitAmpPair_by_dFitParameters
unsigned int size() const
TMatrixT< double > _dInterferenceFracSum_by_dFraction
TMatrixTSym< double > _fractionSumCov
TMatrixT< double > _dFraction_by_dFitAmpPair

◆ FitAmpPairFitCovariance() [2/2]

FitAmpPairFitCovariance::FitAmpPairFitCovariance ( const FitAmpPairFitCovariance other)

Definition at line 42 of file FitAmpPairFitCovariance.cpp.

43  : _myList(other._myList)
44  , _fitCov(other._fitCov)
45  , _Nevents(other._Nevents)
46  , _size(other._size)
47  , _needToRecalculate(false)
48  , _pairCov(other._pairCov)
49  , _pairCorr(other._pairCorr)
50  , _fractionCov(other._fractionCov)
59 {
60 }
TMatrixTSym< double > _fitCov
TMatrixTSym< double > _totalFractionSumCov
TMatrixTSym< double > _fractionCov
const FitAmpPairList * _myList
TMatrixTSym< double > _interferenceFracSumCov
TMatrixTSym< double > _pairCorr
TMatrixTSym< double > _pairCov
TMatrixT< double > _dTotalFractionSum_by_dFraction
TMatrixT< double > _dFractionSum_by_dFraction
TMatrixT< double > _dFitAmpPair_by_dFitParameters
TMatrixT< double > _dInterferenceFracSum_by_dFraction
TMatrixTSym< double > _fractionSumCov
TMatrixT< double > _dFraction_by_dFitAmpPair

Member Function Documentation

◆ addLastEventFromList()

bool FitAmpPairFitCovariance::addLastEventFromList ( )

◆ calculateAll()

bool FitAmpPairFitCovariance::calculateAll ( )

Definition at line 109 of file FitAmpPairFitCovariance.cpp.

109  {
110  bool dbThis=false;
111  bool sc=true;
112  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
113  << " making dFitAmpPair_by_dFitParameters" << endl;
115 
116  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
117  << " making dFraction_by_dFitAmpPair" << endl;
119 
120  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
121  << " making dFractionSum_by_dFraction" << endl;
123 
124  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
125  << " making dInterferenceFrac_by_dFraction" << endl;
127 
128  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
129  << " making dTotalFractionSum_by_dFraction" << endl;
131 
132  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
133  << " making FitAmpPairCov" << endl;
134  sc &= makeFitAmpPairCov();
135  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
136  << " making FractionCovariance" << endl;
137  sc &= makeFractionCovariance();
138  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
139  << " making FractionSumCovariance" << endl;
141  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
142  << " making InterferenceFracSumCovariance" << endl;
144  if(dbThis) cout << "FitAmpPairFitCovariance::calculateAll"
145  << " making TotalFractionSumCovariance" << endl;
147 
148  _needToRecalculate=false;
149  return sc;
150 }

◆ getFractionError()

double FitAmpPairFitCovariance::getFractionError ( int  i)

Definition at line 510 of file FitAmpPairFitCovariance.cpp.

510  {
511  double V = getFractionVariance(i);
512  if(V < 0){
513  cout << "ERROR in FitAmpPairFitCovariance::getFractionError"
514  << " variance is " << V << " which is < 0."
515  << " will return -9999."
516  << endl;
517  return 0;
518  }
519  return sqrt(V);
520 }

◆ getFractionSumError()

double FitAmpPairFitCovariance::getFractionSumError ( )

Definition at line 553 of file FitAmpPairFitCovariance.cpp.

553  {
554  double V = getFractionSumVariance();
555  if(V < 0){
556  cout << "ERROR in FitAmpPairFitCovariance::getFractionSumError"
557  << " variance is " << V << " which is < 0."
558  << " will return 0."
559  << endl;
560  return 0;
561  }
562  return sqrt(V);
563 }

◆ getFractionSumVariance()

double FitAmpPairFitCovariance::getFractionSumVariance ( )

Definition at line 548 of file FitAmpPairFitCovariance.cpp.

548  {
550  return _fractionSumCov(0,0);
551 }
TMatrixTSym< double > _fractionSumCov

◆ getFractionVariance()

double FitAmpPairFitCovariance::getFractionVariance ( int  i)

Definition at line 504 of file FitAmpPairFitCovariance.cpp.

504  {
506  if(i < 0 || i >= _fractionCov.GetNcols() ) return -9999.0;
507  if(i < 0 || i >= _fractionCov.GetNrows() ) return -9999.0;
508  return _fractionCov(i, i);
509 }
TMatrixTSym< double > _fractionCov

◆ getInterferenceFracSumError()

double FitAmpPairFitCovariance::getInterferenceFracSumError ( )

Definition at line 537 of file FitAmpPairFitCovariance.cpp.

537  {
538  double V = getInterferenceFracSumVariance();
539  if(V < 0){
540  cout << "ERROR in FitAmpPairFitCovariance::getInterferenceFracSumError"
541  << " variance is " << V << " which is < 0."
542  << " will return 0."
543  << endl;
544  return 0;
545  }
546  return sqrt(V);
547 }

◆ getInterferenceFracSumVariance()

double FitAmpPairFitCovariance::getInterferenceFracSumVariance ( )

Definition at line 533 of file FitAmpPairFitCovariance.cpp.

◆ getPairError()

double FitAmpPairFitCovariance::getPairError ( int  i,
int  j 
)

Definition at line 492 of file FitAmpPairFitCovariance.cpp.

492  {
493  double V = getPairVariance(i, j);
494  if(V < 0){
495  cout << "ERROR in FitAmpPairFitCovariance::getPairError"
496  << " variance is " << V << " which is < 0."
497  << " will return -9999."
498  << endl;
499  return 0;
500  }
501  return sqrt(V);
502 }
double getPairVariance(int i, int j)

◆ getPairVariance()

double FitAmpPairFitCovariance::getPairVariance ( int  i,
int  j 
)

Definition at line 486 of file FitAmpPairFitCovariance.cpp.

486  {
488  if(i < 0 || i >= _pairCov.GetNrows() ) return -9999.0;
489  if(j < 0 || j >= _fractionCov.GetNcols() ) return -9999.0;
490  return _pairCov(i, j);
491 }
TMatrixTSym< double > _fractionCov
TMatrixTSym< double > _pairCov

◆ getTotalFractionSumError()

double FitAmpPairFitCovariance::getTotalFractionSumError ( )

Definition at line 527 of file FitAmpPairFitCovariance.cpp.

527  {
528  // use for debug only - should always return zero (ish)
529  double V = getTotalFractionSumVariance();
530  if(V < 0) return -sqrt(-V);
531  else return sqrt(V);
532 }

◆ getTotalFractionSumVariance()

double FitAmpPairFitCovariance::getTotalFractionSumVariance ( )

Definition at line 522 of file FitAmpPairFitCovariance.cpp.

522  {
523  // use for debug only - should always return zero (ish)
525  return _totalFractionSumCov(0,0);
526 }
TMatrixTSym< double > _totalFractionSumCov

◆ imagName()

std::string FitAmpPairFitCovariance::imagName ( int  i) const
private

Definition at line 105 of file FitAmpPairFitCovariance.cpp.

105  {
106  return (*_myList)[i].name() + "_imag";
107 }
const FitAmpPairList * _myList

◆ indexImag()

int FitAmpPairFitCovariance::indexImag ( int  i)
inlineprivate

Definition at line 37 of file FitAmpPairFitCovariance.h.

37 {return 2*i + 1;}

◆ indexReal()

int FitAmpPairFitCovariance::indexReal ( int  i)
inlineprivate

Definition at line 36 of file FitAmpPairFitCovariance.h.

36 {return 2*i;}

◆ isValid()

bool FitAmpPairFitCovariance::isValid ( ) const

Definition at line 564 of file FitAmpPairFitCovariance.cpp.

564  {
565  if(size() > maxSize()) return false;
566  if(size() <= 0)return false;
567  if((unsigned int) _pairCov.GetNcols() != size()) return false;
568  return true;
569 }
TMatrixTSym< double > _pairCov
unsigned int maxSize() const

◆ listPositionFromIndex()

int FitAmpPairFitCovariance::listPositionFromIndex ( int  idx)
inlineprivate

Definition at line 38 of file FitAmpPairFitCovariance.h.

38 {return idx/2;}

◆ make_dFitAmpPair_by_dFitParameters()

bool FitAmpPairFitCovariance::make_dFitAmpPair_by_dFitParameters ( )
private

Definition at line 151 of file FitAmpPairFitCovariance.cpp.

151  {
152  bool dbThis=false;
153  if(dbThis) cout << "FitAmpPairFitCovariance::"
154  << "make_dFitAmpPair_by_dFitParameters called" << endl;
155  /*
156  each FitAmpPair is evaluated as the real part of
157  the product of three complex numbers, times other factors (f)
158 
159  p = z1 z2* a * f, p* = z1* z2 a f*
160 
161  The paramters are:
162  o The product of fit parameters z1 z2* = fitParValue()
163  o The integral: a
164 
165  Each FitAmpPair returns real(p) = 0.5(p + p*);
166  The total integral is the sum of these.
167 
168  z1 is either given as
169  o z1 = (x1 + iy1) or as
170  o z1 = r1 exp(i phi1)
171 
172  We want to transform from the fit parameters to p. We'll need
173 
174  dp/d(x1) = z2* a f = p/z1
175  dp/d(y1) = iz2* a f = i p/z1
176  dp/d(r1) = exp(i degFac phi1) z2* a f = p/r1
177  dp/d(phi1) = i degFac r1 exp(i phi1) z2* a f = i p
178 
179  dp/d(x2) = z1 a f = p/z2*
180  dp/d(y2) = -iz1 a f = -i p/z2*
181  dp/d(r2) = exp(-i degFac phi2) z1 a f = p/r2
182  dp/d(phi2) = -i degFac r2 exp(-i degFac phi2) z1 a f = -i p
183  */
184  for(int i=0; i < _dFitAmpPair_by_dFitParameters.GetNrows(); i++){
185  for(int j=0; j < _dFitAmpPair_by_dFitParameters.GetNcols(); j++){
187  }
188  }
189  for(unsigned int i=0; i < _myList->size(); i++){
190  complex<double> p = (*_myList)[i].complexVal();
191  complex<double> z1 = (*_myList)[i].fitAmp1().FitAmpPhase();
192  complex<double> z2 = (*_myList)[i].fitAmp2().FitAmpPhase();
193  complex<double> z2star(conj(z2));
194  complex<double> number_i(0, 1);
195 
196  FitComplex::TYPE t1 = (*_myList)[i].fitAmp1().FitAmpPhase().type();
197 
198  int index_1a = (*_myList)[i].fitAmp1().FitAmpPhase().p1().parSetIndex();
199  int index_1b = (*_myList)[i].fitAmp1().FitAmpPhase().p2().parSetIndex();
200 
201  if(FitComplex::CARTESIAN == t1){
202  complex<double> dpdx1 = p/z1;
203  complex<double> dpdy1 = number_i * p / z1;
204 
205  _dFitAmpPair_by_dFitParameters(i, index_1a) += dpdx1.real();
206  _dFitAmpPair_by_dFitParameters(i, index_1b) += dpdy1.real();
207  }else if(FitComplex::POLAR == t1){
208 
209  double degFac =
210  ((const FitComplexPolar&) ((*_myList)[i].fitAmp1().FitAmpPhase())
211  ).degFac();
212 
213  complex<double> r1 = abs(z1);
214 
215  complex<double> dpdr1 = p/r1;
216  complex<double> dpdphi1 = number_i * p * degFac;
217  _dFitAmpPair_by_dFitParameters(i, index_1a) += dpdr1.real();
218  _dFitAmpPair_by_dFitParameters(i, index_1b) += dpdphi1.real();
219  }else{
220  cout << "ERROR in FitAmpPairFitCovariance::"
221  << "make_dFitAmpPair_by_dFitParameters()"
222  << " don't know type of FitComplex in "
223  << (*_myList)[i].fitAmp1()
224  << endl;
225  throw "shouldn't be possible";
226  }
227  FitComplex::TYPE t2 = (*_myList)[i].fitAmp2().FitAmpPhase().type();
228 
229  int index_2a = (*_myList)[i].fitAmp2().FitAmpPhase().p1().parSetIndex();
230  int index_2b = (*_myList)[i].fitAmp2().FitAmpPhase().p2().parSetIndex();
231 
232  /*
233  dp/d(x2) = z1 a = p/z2*
234  dp/d(y2) = -iz1 a = -i p/z2*
235  dp/d(r2) = exp(-i degFac phi2) z1 a = p/r2
236  dp/d(phi2) = -i degFac r2 exp(-i phi2) z2 a = -i p
237  */
238 
239  if(FitComplex::CARTESIAN == t2){
240  complex<double> dpdx2 = p/z2star;
241  complex<double> dpdy2 = - number_i * p / z2star;
242 
243  _dFitAmpPair_by_dFitParameters(i, index_2a) += dpdx2.real();
244  _dFitAmpPair_by_dFitParameters(i, index_2b) += dpdy2.real();
245  }else if(FitComplex::POLAR == t2){
246  double degFac =
247  ((const FitComplexPolar&) ((*_myList)[i].fitAmp1().FitAmpPhase())
248  ).degFac();
249 
250  complex<double> r2 = abs(z2);
251 
252  complex<double> dpdr2 = p/r2;
253  complex<double> dpdphi2 = - number_i * p *degFac;
254  _dFitAmpPair_by_dFitParameters(i, index_2a) += dpdr2.real();
255  _dFitAmpPair_by_dFitParameters(i, index_2b) += dpdphi2.real();
256  }else{
257  cout << "ERROR in FitAmpPairFitCovariance::"
258  << "make_dFitAmpPair_by_dFitParameters()"
259  << " don't know type of FitComplex in " << (*_myList)[i].fitAmp2()
260  << endl;
261  throw "shouldn't be possible";
262  }
263  }
264  return true;
265 }
const FitAmpPairList * _myList
TMatrixT< double > _dFitAmpPair_by_dFitParameters
unsigned int size() const

◆ make_dFraction_by_dFitAmpPair()

bool FitAmpPairFitCovariance::make_dFraction_by_dFitAmpPair ( )
private

Definition at line 267 of file FitAmpPairFitCovariance.cpp.

267  {
268  bool dbThis=false;
269  if(dbThis) cout << "FitAmpPairFitCovariance::make_dFraction_by_dFitAmpPair()"
270  << " called" << endl;
271  /*
272  We are calculating trafo matrix for the following trafo:
273 
274  f_a = a/(a + b + c...)
275 
276 
277  diagonal terms:
278 
279  d(f_a)/d(a) = 1/(a + b + c +...) - a/(a + b + c ...)^2
280 
281  off-diagonal terms:
282 
283  d(f_a)/d(b) = -a/(a + b + c ...)^2
284  */
285 
286  double integ = _myList->integral();
287  double integ2 = integ*integ;
288 
289  for(int i=0; i < _dFraction_by_dFitAmpPair.GetNrows(); i++){
290  for(int j=0; j < _dFraction_by_dFitAmpPair.GetNcols(); j++){
292  }
293  }
294  for(unsigned int i=0; i < _myList->size(); i++){
295  double num = (*_myList)[i].integral();
296  for(unsigned int j=0; j < _myList->size(); j++){
297  _dFraction_by_dFitAmpPair(i,j) = -num/integ2;
298  }
299  _dFraction_by_dFitAmpPair(i, i) += 1.0/integ;
300  }
301  return true;
302 }
const FitAmpPairList * _myList
virtual double integral() const
unsigned int size() const
TMatrixT< double > _dFraction_by_dFitAmpPair

◆ make_dFractionSum_by_dFraction()

bool FitAmpPairFitCovariance::make_dFractionSum_by_dFraction ( )
private

Definition at line 304 of file FitAmpPairFitCovariance.cpp.

304  {
305  bool dbThis=false;
306  if(dbThis) cout << "FitAmpPairFitCovariance::make_dFractionSum_by_dFraction()"
307  << " called" << endl;
308  /*
309  We are calculating trafo matrix for the trafo to the sum
310  of all terms entering the fraction calculation, this
311  excludes the terms for interference effect.
312 
313  It's just ones (those included) and zeros (for those not included)
314  */
315 
316  for(unsigned int i=0; i < _myList->size(); i++){
317  if((*_myList)[i].isSingleAmp()){
318  _dFractionSum_by_dFraction(0, i) = 1.0;
319  }else{
320  _dFractionSum_by_dFraction(0, i) = 0.0;
321  }
322  }
323  return true;
324 }
const FitAmpPairList * _myList
TMatrixT< double > _dFractionSum_by_dFraction
unsigned int size() const

◆ make_dInterferenceFracSum_by_dFraction()

bool FitAmpPairFitCovariance::make_dInterferenceFracSum_by_dFraction ( )
private

Definition at line 326 of file FitAmpPairFitCovariance.cpp.

326  {
327  bool dbThis=false;
328  if(dbThis) cout << "FitAmpPairFitCovariance::make_dInterferenceFracSum_by_dFraction()"
329  << " called" << endl;
330  /*
331  We are calculating trafo matrix for the trafo to the sum
332  of all terms entering the interference calculation, this
333  excludes all the usual fraction terms.
334 
335  It's just ones (those included) and zeros (for those not included)
336  */
337 
338  for(unsigned int i=0; i < _myList->size(); i++){
339  if((*_myList)[i].isSingleAmp()){
341  }else{
343  }
344  }
345  return true;
346 }
const FitAmpPairList * _myList
unsigned int size() const
TMatrixT< double > _dInterferenceFracSum_by_dFraction

◆ make_dTotalFractionSum_by_dFraction()

bool FitAmpPairFitCovariance::make_dTotalFractionSum_by_dFraction ( )
private

Definition at line 348 of file FitAmpPairFitCovariance.cpp.

348  {
349  // used for debugging only
350  bool dbThis=false;
351  if(dbThis) cout << "FitAmpPairFitCovariance::"
352  << "make_dTotalFractionSum_by_dFraction()"
353  << " called" << endl;
354  /*
355  We are calculating trafo matrix for the trafo to the sum
356  of all terms entering the fraction calculation, this
357  excludes the terms for interference effect.
358 
359  It's just ones (those included - here all)
360  and zeros (for those not included - here none)
361  */
362 
363  for(unsigned int i=0; i < _myList->size(); i++){
365  }
366  return true;
367 }
const FitAmpPairList * _myList
TMatrixT< double > _dTotalFractionSum_by_dFraction
unsigned int size() const

◆ makeFitAmpPairCov()

bool FitAmpPairFitCovariance::makeFitAmpPairCov ( )
private

Definition at line 370 of file FitAmpPairFitCovariance.cpp.

370  {
371  bool dbThis=false;
372 
373  bool success = true;
374 
375  TMatrixT<double> dFitAmpPair_by_dFitParameters_Transpose(_dFitAmpPair_by_dFitParameters.GetNcols()
376  , _dFitAmpPair_by_dFitParameters.GetNrows());
377  dFitAmpPair_by_dFitParameters_Transpose.Transpose(_dFitAmpPair_by_dFitParameters);
378  if(dbThis){
379  cout << "FitAmpPairFitCovariance::makeFitAmpPairCov()"
380  << " _dFitAmpPair_by_dFitParameters(): "
381  << endl;
383  cout << "and its transpose:" << endl;
384  dFitAmpPair_by_dFitParameters_Transpose.Print();
385  }
386 
388  _fitCov *
389  dFitAmpPair_by_dFitParameters_Transpose);
390 
391  for(unsigned int i=0; i < _myList->size(); i++){
392  if(_pairCov(i, i) <= 0) continue;
393  for(unsigned int j=i; j < _myList->size(); j++){
394  double densq = _pairCov(i,i)*_pairCov(j,j);
395  if(densq > 0){
396  _pairCorr(i,j) = _pairCov(i,j)/sqrt(densq);
397  }
398  }
399  }
400 
401  if(dbThis){
402  cout << "After " << _Nevents << "events" << endl;
403  cout << "Covariance Matrix N" << endl;
404  _pairCov.Print();
405  cout << "Correlation Matrix N" << endl;
406  _pairCorr.Print();
407  }
408  return success;
409 }
TMatrixTSym< double > _fitCov
const FitAmpPairList * _myList
TMatrixTSym< double > _pairCorr
TMatrixTSym< double > _pairCov
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
Definition: Utils.h:45
TMatrixT< double > _dFitAmpPair_by_dFitParameters
unsigned int size() const

◆ makeFractionCovariance()

bool FitAmpPairFitCovariance::makeFractionCovariance ( )
private

Definition at line 411 of file FitAmpPairFitCovariance.cpp.

411  {
412  bool dbThis=false;
413 
414  int cols=_dFraction_by_dFitAmpPair.GetNcols();
415  int rows=_dFraction_by_dFitAmpPair.GetNrows();
416  TMatrixT<double> dFraction_by_dFitAmpPair_Transpose(cols,rows);
417  dFraction_by_dFitAmpPair_Transpose.Transpose(_dFraction_by_dFitAmpPair);
418 
420  _pairCov *
421  dFraction_by_dFitAmpPair_Transpose);
422 
423  if(dbThis){
424  cout << "Correlation Matrix Fractions" << endl;
425  _fractionCov.Print();
426  }
427 
428  return true;
429 }
TMatrixTSym< double > _fractionCov
TMatrixTSym< double > _pairCov
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
Definition: Utils.h:45
TMatrixT< double > _dFraction_by_dFitAmpPair

◆ makeFractionSumCovariance()

bool FitAmpPairFitCovariance::makeFractionSumCovariance ( )
private

Definition at line 430 of file FitAmpPairFitCovariance.cpp.

430  {
431  bool dbThis=false;
432 
433  TMatrixT<double> dFractionSum_by_dFraction_Transpose(size(), 1);
434  dFractionSum_by_dFraction_Transpose.Transpose(_dFractionSum_by_dFraction);
435 
437  _fractionCov *
438  dFractionSum_by_dFraction_Transpose);
439 
440  if(dbThis){
441  cout << "After " << _Nevents << "events" << endl;
442  cout << "Covariance Matrix for FractionSum" << endl;
443  _fractionSumCov.Print();
444  }
445 
446  return true;
447 }
TMatrixTSym< double > _fractionCov
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
Definition: Utils.h:45
TMatrixT< double > _dFractionSum_by_dFraction
TMatrixTSym< double > _fractionSumCov

◆ makeInterferenceFracSumCovariance()

bool FitAmpPairFitCovariance::makeInterferenceFracSumCovariance ( )
private

Definition at line 448 of file FitAmpPairFitCovariance.cpp.

448  {
449  bool dbThis=false;
450 
451  TMatrixT<double> dInterferenceFracSum_by_dFraction_Transpose(size(), 1);
452  dInterferenceFracSum_by_dFraction_Transpose.Transpose(_dInterferenceFracSum_by_dFraction);
453 
455  _fractionCov *
456  dInterferenceFracSum_by_dFraction_Transpose);
457 
458  if(dbThis){
459  cout << "After " << _Nevents << "events" << endl;
460  cout << "Covariance Matrix for FractionSum" << endl;
461  _interferenceFracSumCov.Print();
462  }
463 
464  return true;
465 }
TMatrixTSym< double > _fractionCov
TMatrixTSym< double > _interferenceFracSumCov
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
Definition: Utils.h:45
TMatrixT< double > _dInterferenceFracSum_by_dFraction

◆ makeTotalFractionSumCovariance()

bool FitAmpPairFitCovariance::makeTotalFractionSumCovariance ( )
private

Definition at line 466 of file FitAmpPairFitCovariance.cpp.

466  {
467  // used for debug only (should make a 1x1 matrix with 0 +/- numerical error)
468  bool dbThis=false;
469 
470  TMatrixT<double> dTotalFractionSum_by_dFraction_Transpose(size(), 1);
471  dTotalFractionSum_by_dFraction_Transpose.Transpose(_dTotalFractionSum_by_dFraction);
472 
474  _fractionCov *
475  dTotalFractionSum_by_dFraction_Transpose);
476 
477  if(dbThis){
478  cout << "After " << _Nevents << "events" << endl;
479  cout << "Covariance Matrix for TotalFractionSum" << endl;
480  _totalFractionSumCov.Print();
481  }
482 
483  return true;
484 }
TMatrixTSym< double > _totalFractionSumCov
TMatrixTSym< double > _fractionCov
TMatrixTSym< T > makeTMatrixTSym(const TMatrixT< T > &m)
Definition: Utils.h:45
TMatrixT< double > _dTotalFractionSum_by_dFraction

◆ maxSize()

unsigned int FitAmpPairFitCovariance::maxSize ( ) const
inlineprivate

Definition at line 47 of file FitAmpPairFitCovariance.h.

47 {return _maxSize;}

◆ realName()

std::string FitAmpPairFitCovariance::realName ( int  i) const
private

Definition at line 102 of file FitAmpPairFitCovariance.cpp.

102  {
103  return (*_myList)[i].name() + "_real";
104 }
const FitAmpPairList * _myList

◆ resize()

bool FitAmpPairFitCovariance::resize ( )
private

Definition at line 65 of file FitAmpPairFitCovariance.cpp.

65  {
66  bool dbThis=false;
67  if(dbThis){
68  cout << "FitAmpPairFitCovariance::resize()"
69  << " resizing from " << size()
70  << " to " << _myList->size()
71  << " with maxSize() = " << maxSize() << "."
72  << endl;
73  }
74 
75  _needToRecalculate=true;
76 
77  _size = _myList->size();
78 
79  if(size() > maxSize()){
80  cout << "FitAmpPairFitCovariance::resize size() = " << size()
81  << " that's too big! won't do it!" << endl;
82  return false;
83  }
84 
85  _pairCov. ResizeTo(size(), size());
86  _pairCorr. ResizeTo(size(), size());
87 
88  _fractionCov. ResizeTo(size(), size());
89  _fractionSumCov. ResizeTo(1,1);
90  _interferenceFracSumCov. ResizeTo(1,1);
91  _totalFractionSumCov. ResizeTo(1,1);
92  _dFitAmpPair_by_dFitParameters. ResizeTo(size(), _fitCov.GetNcols());
93  _dFraction_by_dFitAmpPair. ResizeTo(size(), size());
94 
95  _dFractionSum_by_dFraction.ResizeTo(1, size());
98 
99  return true;
100 }
TMatrixTSym< double > _fitCov
TMatrixTSym< double > _totalFractionSumCov
TMatrixTSym< double > _fractionCov
const FitAmpPairList * _myList
TMatrixTSym< double > _interferenceFracSumCov
TMatrixTSym< double > _pairCorr
TMatrixTSym< double > _pairCov
TMatrixT< double > _dTotalFractionSum_by_dFraction
TMatrixT< double > _dFractionSum_by_dFraction
unsigned int maxSize() const
TMatrixT< double > _dFitAmpPair_by_dFitParameters
unsigned int size() const
TMatrixT< double > _dInterferenceFracSum_by_dFraction
TMatrixTSym< double > _fractionSumCov
TMatrixT< double > _dFraction_by_dFitAmpPair

◆ size()

unsigned int FitAmpPairFitCovariance::size ( ) const

Definition at line 62 of file FitAmpPairFitCovariance.cpp.

62  {
63  return _size;
64 }

Member Data Documentation

◆ _dFitAmpPair_by_dFitParameters

TMatrixT<double> FitAmpPairFitCovariance::_dFitAmpPair_by_dFitParameters
private

Definition at line 27 of file FitAmpPairFitCovariance.h.

◆ _dFraction_by_dFitAmpPair

TMatrixT<double> FitAmpPairFitCovariance::_dFraction_by_dFitAmpPair
private

Definition at line 28 of file FitAmpPairFitCovariance.h.

◆ _dFractionSum_by_dFraction

TMatrixT<double> FitAmpPairFitCovariance::_dFractionSum_by_dFraction
private

Definition at line 29 of file FitAmpPairFitCovariance.h.

◆ _dInterferenceFracSum_by_dFraction

TMatrixT<double> FitAmpPairFitCovariance::_dInterferenceFracSum_by_dFraction
private

Definition at line 30 of file FitAmpPairFitCovariance.h.

◆ _dTotalFractionSum_by_dFraction

TMatrixT<double> FitAmpPairFitCovariance::_dTotalFractionSum_by_dFraction
private

Definition at line 31 of file FitAmpPairFitCovariance.h.

◆ _fitCov

TMatrixTSym<double> FitAmpPairFitCovariance::_fitCov
private

Definition at line 14 of file FitAmpPairFitCovariance.h.

◆ _fitResult

TMatrixTSym<double> FitAmpPairFitCovariance::_fitResult
private

Definition at line 19 of file FitAmpPairFitCovariance.h.

◆ _fractionCov

TMatrixTSym<double> FitAmpPairFitCovariance::_fractionCov
private

Definition at line 22 of file FitAmpPairFitCovariance.h.

◆ _fractionSumCov

TMatrixTSym<double> FitAmpPairFitCovariance::_fractionSumCov
private

Definition at line 23 of file FitAmpPairFitCovariance.h.

◆ _interferenceFracSumCov

TMatrixTSym<double> FitAmpPairFitCovariance::_interferenceFracSumCov
private

Definition at line 24 of file FitAmpPairFitCovariance.h.

◆ _maxSize

unsigned int FitAmpPairFitCovariance::_maxSize = 1500
staticprivate

Definition at line 12 of file FitAmpPairFitCovariance.h.

◆ _myList

const FitAmpPairList* FitAmpPairFitCovariance::_myList
private

Definition at line 13 of file FitAmpPairFitCovariance.h.

◆ _needToRecalculate

bool FitAmpPairFitCovariance::_needToRecalculate
private

Definition at line 17 of file FitAmpPairFitCovariance.h.

◆ _Nevents

unsigned int FitAmpPairFitCovariance::_Nevents
private

Definition at line 15 of file FitAmpPairFitCovariance.h.

◆ _pairCorr

TMatrixTSym<double> FitAmpPairFitCovariance::_pairCorr
private

Definition at line 21 of file FitAmpPairFitCovariance.h.

◆ _pairCov

TMatrixTSym<double> FitAmpPairFitCovariance::_pairCov
private

Definition at line 21 of file FitAmpPairFitCovariance.h.

◆ _size

unsigned int FitAmpPairFitCovariance::_size
private

Definition at line 16 of file FitAmpPairFitCovariance.h.

◆ _totalFractionSumCov

TMatrixTSym<double> FitAmpPairFitCovariance::_totalFractionSumCov
private

Definition at line 25 of file FitAmpPairFitCovariance.h.


The documentation for this class was generated from the following files: