MINT2
FitFractionList.h
Go to the documentation of this file.
1 #ifndef MINT_DALITZ_FIT_FRACTION_LIST_HH
2 #define MINT_DALITZ_FIT_FRACTION_LIST_HH
3 
4 #include "Mint/FitFraction.h"
5 //#include <vector>
6 #include "Mint/PolymorphVector.h"
7 
8 #include <iostream>
9 #include <cmath>
10 
11 /* this is a dumb class
12  that only stores the result
13  of a fit fraction calculation
14  but doesn not calculate anytthig
15  by itself
16 */
17 
18 class FitFractionList : public MINT::PolymorphVector<FitFraction>{
19  protected:
21  public:
23  FitFractionList(const FitFractionList& other);
24 
25  void add(const FitFraction& f);
26 
27  const FitFraction& sum() const{return _sum;}
28  void setSumFitError(double sfe);
29  void setSumIntegError(double sie);
30 
31  void print(std::ostream& os)const;
32 
33  void sortBySizeAscending();
34  void sortBySizeDecending();
37  void sortByName();
38 
39  // helper classes for sorting:
41  public:
42  bool operator()(const FitFraction& a, const FitFraction& b){
43  return a.frac() < b.frac();
44  }
45  };
47  public:
48  bool operator()(const FitFraction& a, const FitFraction& b){
49  return (a.frac() > b.frac());
50  }
51  };
53  public:
54  bool operator()(const FitFraction& a, const FitFraction& b){
55  return fabs(a.frac()) < fabs(b.frac());
56  }
57  };
59  public:
60  bool operator()(const FitFraction& a, const FitFraction& b){
61  return (fabs(a.frac()) > fabs(b.frac()));
62  }
63  };
65  public:
66  bool operator()(const FitFraction& a, const FitFraction& b){
67  return a.name() < b.name();
68  }
69  };
70 
71 };
72 
73 std::ostream& operator<<(std::ostream& os, const FitFractionList& f);
74 #endif
75 //
void setSumFitError(double sfe)
void setSumIntegError(double sie)
bool operator()(const FitFraction &a, const FitFraction &b)
FitFraction _sum
void sortByMagnitudeAscending()
void add(const FitFraction &f)
bool operator()(const FitFraction &a, const FitFraction &b)
double & frac()
Definition: FitFraction.h:21
void print(std::ostream &os) const
const FitFraction & sum() const
std::ostream & operator<<(std::ostream &os, const FitFractionList &f)
bool operator()(const FitFraction &a, const FitFraction &b)
void sortByMagnitudeDecending()
bool operator()(const FitFraction &a, const FitFraction &b)
bool operator()(const FitFraction &a, const FitFraction &b)
const std::string & name() const
Definition: FitFraction.h:19