MINT2
FitAmpPairCovariance.h
Go to the documentation of this file.
1 #ifndef FIT_AMP_PAIR_COVARIANCE_HH
2 #define FIT_AMP_PAIR_COVARIANCE_HH
3 
4 #include <map>
5 #include <string>
6 #include "TMatrixT.h"
7 #include "TMatrixTSym.h"
8 
9 class FitAmpPairList;
10 
12  static unsigned int _maxSize;
13 
15  unsigned int _Nevents;
16  unsigned int _size;
18 
19  TMatrixT<float> _sum_x;
20  TMatrixTSym<float> _sum_xy;
21 
22  TMatrixTSym<float> _cov2N, _corr2N, _cov, _corr;
23  TMatrixTSym<float> _fractionCov;
24  TMatrixTSym<float> _fractionSumCov;
25  TMatrixTSym<float> _integralCov;
26 
27  TMatrixT<float> _dN_by_d2N;
28  TMatrixT<float> _dFraction_by_dN;
29  TMatrixT<float> _dFractionSum_by_dFraction;
30  TMatrixT<float> _dIntegral_by_dN;
31 
32  std::string realName(int listPosition) const;
33  std::string imagName(int listPosition) const;
34 
35  inline int indexReal(int listPosition)const{return 2*listPosition;}
36  inline int indexImag(int listPosition)const{return 2*listPosition + 1;}
37  inline int listPositionFromIndex(int idx)const {return idx/2;}
38 
39  bool make_dN_by_d2N();
40  bool make_dFraction_by_dN();
42  bool make_dIntegral_by_dN();
43 
44  bool resize();
45  unsigned int maxSize()const{return _maxSize;}
46  bool make2NCovariance();
47  bool makeNCovariance();
51 
52  bool clearAll();
53 
54  bool makeDirectory(const std::string& asSubdirOf=".") const;
55  std::string dirName(const std::string& asSubdirOf=".") const;
56  std::string matrix_x_fname(const std::string& asSubdirOf=".") const;
57  std::string matrix_xy_fname(const std::string& asSubdirOf=".") const;
58  bool save_sum_x(const std::string& inDirectory) const;
59  bool save_sum_xy(const std::string& inDirectory) const;
60  bool retrieve_sum_x(const std::string& inDirectory);
61  bool retrieve_sum_xy(const std::string& inDirectory);
62 
63  bool isCompatibleWith(const FitAmpPairCovariance& other) const;
64  public:
65  FitAmpPairCovariance(const FitAmpPairList* myList);
68  , const FitAmpPairList* newList);
69 
70  virtual ~FitAmpPairCovariance();
71 
72  bool add(const FitAmpPairCovariance& other);
73  bool reset();
74 
75  bool addLastEventFromList();
76  bool calculateAll();
77 
78  double getFractionVariance(int i);
79  double getFractionError(int i);
80 
81  double getFractionSumVariance();
82  double getFractionSumError();
83 
84  double getIntegralVariance();
85  double getIntegralError();
86 
87  unsigned int size() const;
88  bool isValid() const;
89 
90 
91  bool save(const std::string& asSubdirOf=".")const;
92  bool retrieve(const std::string& fromDirectory=".");
93 
94  int Nevents()const{return _Nevents;}
95 
98 };
99 
100 #endif
101 //
int indexImag(int listPosition) const
std::string realName(int listPosition) const
TMatrixT< float > _sum_x
TMatrixTSym< float > _fractionCov
TMatrixTSym< float > _cov2N
std::string imagName(int listPosition) const
bool makeDirectory(const std::string &asSubdirOf=".") const
std::string dirName(const std::string &asSubdirOf=".") const
bool retrieve_sum_xy(const std::string &inDirectory)
static unsigned int _maxSize
int listPositionFromIndex(int idx) const
int indexReal(int listPosition) const
bool retrieve_sum_x(const std::string &inDirectory)
const FitAmpPairList * _myList
TMatrixTSym< float > _fractionSumCov
TMatrixT< float > _dFractionSum_by_dFraction
FitAmpPairCovariance(const FitAmpPairList *myList)
unsigned int maxSize() const
TMatrixTSym< float > _sum_xy
unsigned int size() const
FitAmpPairCovariance & operator+=(const FitAmpPairCovariance &other)
FitAmpPairCovariance operator+(const FitAmpPairCovariance &other) const
TMatrixT< float > _dFraction_by_dN
bool retrieve(const std::string &fromDirectory=".")
bool add(const FitAmpPairCovariance &other)
std::string matrix_xy_fname(const std::string &asSubdirOf=".") const
TMatrixTSym< float > _corr2N
TMatrixT< float > _dN_by_d2N
TMatrixTSym< float > _integralCov
bool save_sum_xy(const std::string &inDirectory) const
TMatrixT< float > _dIntegral_by_dN
bool save_sum_x(const std::string &inDirectory) const
bool isCompatibleWith(const FitAmpPairCovariance &other) const
TMatrixTSym< float > _cov
bool save(const std::string &asSubdirOf=".") const
TMatrixTSym< float > _corr
std::string matrix_x_fname(const std::string &asSubdirOf=".") const