MINT2
IntegCalculator.h
Go to the documentation of this file.
1 #ifndef INTEG_CALCULATOR_HH
2 #define INTEG_CALCULATOR_HH
3 
5 #include "Mint/FitAmpPairList.h"
6 #include "Mint/counted_ptr.h"
7 #include "Mint/DalitzHistoSet.h"
8 #include "Mint/IDalitzEvent.h"
10 #include "Mint/FitFractionList.h"
11 #include <iostream>
12 #include <vector>
13 
14 namespace MINT{
15  class Minimiser;
16 }
17 
18 class IntegCalculator : public virtual IIntegrationCalculator{
19  protected:
22 
25 
26  static std::string dirNameWithEff();
27  static std::string dirNameNoEff();
28  bool makeDirectories(const std::string& asSubdirOf=".")const;
29  public:
31  IntegCalculator(const IntegCalculator& other);
32  IntegCalculator(const FitAmpPairList& wEff);
35 
36  const FitAmpPairList& withEff()const {return _withEff;}
37  const FitAmpPairList& noEff()const {return _noEff;}
38 
40  void unsetEfficiency();
41  double efficiency(IDalitzEvent* evtPtr);
42 
43  virtual void addAmps(FitAmplitude* a1, FitAmplitude* a2);
44  virtual void addEvent(IDalitzEvent* evtPtr, double weight=1); // << for compatibility
45  virtual void addEvent(IDalitzEvent& evt, double weight=1); // << default
46  virtual void addEvent(MINT::counted_ptr<IDalitzEvent> evtPtr
47  , double weight=1);
48 
49  virtual void reAddEvent(IDalitzEvent* evtPtr, double weight=1);
50  virtual void reAddEvent(IDalitzEvent& evt, double weight=1); // <<< default
52  , double weight=1);
53 
54  virtual bool add(const IntegCalculator& other);
55  virtual bool add(const IntegCalculator* other);
56  virtual bool add(const MINT::const_counted_ptr<IntegCalculator>& other);
57 
58  virtual bool append(const IntegCalculator& other);
59  virtual bool append(const IntegCalculator* other);
60  virtual bool append(const MINT::const_counted_ptr<IntegCalculator>& other);
61 
62  virtual int numEvents() const;
63  virtual double integral() const;
64  virtual double variance() const;
65 
66  virtual std::complex<double> ComplexSum() const;
67 
68  virtual void Gradient(MINT::MinuitParameterSet* mps, std::vector<double>& grad){
69  withEff().Gradient(mps,grad);
70  }
71  virtual void GradientForLasso(MINT::MinuitParameterSet* mps, std::vector<double>& grad){
72  withEff().GradientForLasso(mps,grad);
73  }
74 
75  double sumOfFitFractions() {
76  return withEff().sumOfFitFractions();
77  }
78 
81  }
82 
85  }
86 
88  return withEff().sumOfSqrtFitFractions();
89  }
90 
93  }
94 
95  virtual bool makeAndStoreFractions(MINT::Minimiser* mini=0);
96  virtual double getFractionChi2() const;
97 
98  virtual DalitzHistoSet histoSet() const;
101  virtual void saveEachAmpsHistograms(const std::string& prefix) const;
102  virtual std::vector<DalitzHistoSet> GetEachAmpsHistograms();
103 
104  virtual DalitzHistoSet interferenceHistoSet() const;
105  virtual void saveInterferenceHistograms(const std::string& prefix) const;
106  virtual std::vector<DalitzHistoSet> GetInterferenceHistograms();
107 
108  virtual void doFinalStats(MINT::Minimiser* mini=0);
109 
110  virtual bool save(const std::string& dirname) const;
111  virtual bool retrieve(const std::string& commaSeparatedList);
112  virtual bool retrieveSingle(const std::string& dirname);
113 
114  virtual FitFractionList getFractions() const;
115 
116  virtual void print(std::ostream& os=std::cout) const;
117 
118  bool needToReIntegrate() const;
119  void startIntegration();
120  void startReIntegration();
121  void endIntegration();
122 
123  virtual ~IntegCalculator(){}
124 
125 };
126 
127 #endif
128 //
virtual bool append(const IntegCalculator &other)
const FitAmpPairList & withEff() const
virtual bool retrieve(const std::string &commaSeparatedList)
virtual DalitzHistoSet interferenceHistoSet() const
virtual void saveInterferenceHistograms(const std::string &prefix) const
virtual DalitzHistoSet histoSet() const
virtual double integral() const
virtual bool save(const std::string &dirname) const
int numberOfFitFractionsLargerThanThreshold(double threshold)
virtual FitFractionList getFractions() const
virtual DalitzHistoSet un_normalised_histoSetRe() const
virtual void GradientForLasso(MINT::MinuitParameterSet *mps, std::vector< double > &grad)
virtual void print(std::ostream &os=std::cout) const
virtual DalitzHistoSet un_normalised_histoSetIm() const
virtual std::vector< DalitzHistoSet > GetInterferenceHistograms()
const FitAmpPairList & noEff() const
virtual void Gradient(MINT::MinuitParameterSet *mps, std::vector< double > &grad)
static std::string dirNameWithEff()
double sumOfSqrtFitFractions()
FitAmpPairList & noEff()
virtual std::vector< DalitzHistoSet > GetEachAmpsHistograms()
virtual bool add(const IntegCalculator &other)
double absSumOfSqrtInterferenceFractions()
virtual void addAmps(FitAmplitude *a1, FitAmplitude *a2)
int numberOfFitFractionsLargerThanThreshold(double threshold)
double absSumOfInterferenceFractions()
virtual bool makeAndStoreFractions(MINT::Minimiser *mini=0)
virtual int numEvents() const
virtual MINT::counted_ptr< IIntegrationCalculator > clone_IIntegrationCalculator() const
double sumOfFitFractions()
virtual double variance() const
virtual void GradientForLasso(MINT::MinuitParameterSet *mps, std::vector< double > &grad)
virtual void doFinalStats(MINT::Minimiser *mini=0)
double sumOfFitFractions()
virtual void addEvent(IDalitzEvent *evtPtr, double weight=1)
virtual void Gradient(MINT::MinuitParameterSet *mps, std::vector< double > &grad)
virtual bool retrieveSingle(const std::string &dirname)
bool makeDirectories(const std::string &asSubdirOf=".") const
virtual void saveEachAmpsHistograms(const std::string &prefix) const
static std::string dirNameNoEff()
virtual std::complex< double > ComplexSum() const
virtual double getFractionChi2() const
double efficiency(IDalitzEvent *evtPtr)
virtual ~IntegCalculator()
FitAmpPairList _withEff
bool needToReIntegrate() const
double sumOfSqrtFitFractions()
void setEfficiency(MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > eff)
FitAmpPairList _noEff
double absSumOfSqrtInterferenceFractions()
double absSumOfInterferenceFractions()
FitAmpPairList & withEff()
virtual void reAddEvent(IDalitzEvent *evtPtr, double weight=1)