MINT2
DalitzPdfBaseMCInteg.h
Go to the documentation of this file.
1 #ifndef DALITZ_PDF_BASE_MC_INTEG_HH
2 #define DALITZ_PDF_BASE_MC_INTEG_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:18:01 GMT
5 
6 #include "Mint/PdfBase.h"
8 
9 #include "Mint/IEventGenerator.h"
10 #include "Mint/IDalitzEvent.h"
13 #include "Mint/DalitzEvent.h"
15 #include "Mint/DalitzHistoSet.h"
16 
18 
19 #include "Mint/counted_ptr.h"
20 
21 #include <string>
22 
23 //#define CHECK_INTEGRATOR
24 
26 
28 
29 #include "Mint/IDalitzPdf.h"
30 
31 /*
32  As a user, you will need to implement this method:
33 
34  virtual double un_normalised_noPs(IDalitzEvent& evt);
35 
36  it returns the PDF without the phase-space factor,
37  no need for normalisation. Typical implementation if you
38  have a FitAmpSum called _amps:
39 
40  double un_normalised_noPs(IDalitzEvent& evt){
41  return _amps->RealVal(evt);
42  }
43 
44  */
45 
46 namespace MINT{
47  class Minimiser;
48 }
49 
51 : public MINT::PdfBase<IDalitzEvent>
52 , virtual public IDalitzPdf
53 {
54  protected:
57  double _norm;
58  double _precision;
61 
65  double _val;
66 
67  virtual double un_normalised_noPs(IDalitzEvent& evt)=0;
68  // This replaces un_normalised. Make sure it
69  // does not contain the phase space component.
70  // ... turned out that it's important in several
71  // places to separate this out.
72 
73  virtual double phaseSpace(IDalitzEvent& evt);
74  virtual bool getNorm();
75  virtual bool integrating();
76 
78 
80 
81  public:
83  , double precision = 1.e-3
85  );
86 
87 
89 
90  virtual ~DalitzPdfBaseMCInteg();
91 
92  void setIntegrationPrecision(double prec);
96 
97  void parametersChanged();
98  virtual double getVal(IDalitzEvent& evt);
99  virtual double getVal_withPs(IDalitzEvent& evt);
100  virtual double getVal_noPs(IDalitzEvent& evt);
101 
102  virtual double getNewVal(IDalitzEvent& evt){
103  this->parametersChanged();
104  return getVal(evt);
105  };
106 
107  // next 4 for backward compability (will be removed one day):
108  virtual double getVal(IDalitzEvent* evt){
109  if(0 == evt) return 0;
110  return getVal(*evt);
111  }
112  virtual double getVal_withPs(IDalitzEvent* evt){
113  if(0 == evt) return 0;
114  return getVal_withPs(*evt);
115  }
116  virtual double getVal_noPs(IDalitzEvent* evt){
117  if(0 == evt) return 0;
118  return getVal_noPs(*evt);
119  }
120  virtual double getNewVal(IDalitzEvent* evt){
121  this->parametersChanged();
122  if(0 == evt) return 0;
123  return getNewVal(*evt);
124  }
125 
126  virtual double RealVal(IDalitzEvent& evt){return getVal(evt);}
127  // w/o phase space - more robust if your events leak out of
128  // the kinematically allowed region.
129 
131  const MINT::MinuitParameterSet* getMPS() const;
132 
133  virtual DalitzHistoSet histoSet();
134  /*
135  bool makePlots(const std::string& filename) const;
136  virtual DalitzHistoSet histoSet() const;
137  void saveEachAmpsHistograms(const std::string& prefix) const;
138  std::vector<DalitzHistoSet> GetEachAmpsHistograms();
139 
140  virtual DalitzHistoSet interferenceHistoSet() const;
141  virtual DalitzHistoSet interferenceHistoSet();
142  void saveInterferenceHistograms(const std::string& prefix) const;
143  std::vector<DalitzHistoSet> GetInterferenceHistograms();
144  */
146  virtual void endFit();
147 
148  double getIntegralValue() const{
149  return _norm;
150  }
152  if(_norm < 0) getNorm(); return _norm;
153  }
154  double redoIntegrator(){
155  _norm = -1;
156  getNorm();
157  return _norm;
158  }
159 
160  void doFinalStats(MINT::Minimiser* mini=0);
161 };
162 
163 #endif
164 //
virtual double getNewVal(IDalitzEvent &evt)
DalitzMCIntegrator _mcint
IFastAmplitudeIntegrable * getFitAmpSum()
virtual double getVal_withPs(IDalitzEvent &evt)
IFastAmplitudeIntegrable * getAmps()
virtual double getVal_noPs(IDalitzEvent &evt)
virtual double RealVal(IDalitzEvent &evt)
MINT::IEventGenerator< IDalitzEvent > * _generator
void setEventGenerator(MINT::IEventGenerator< IDalitzEvent > *g)
DalitzPdfBaseMCInteg(const DalitzEventPattern &pat, IFastAmplitudeIntegrable *amps, double precision=1.e-3, MINT::IEventGenerator< IDalitzEvent > *generator=0, MINT::MinuitParameterSet *mps=0)
MINT::IEventGenerator< IDalitzEvent > * getEventGenerator()
double getIntegralValue() const
MINT::MinuitParameterSet * _mps
DalitzEventPattern _pat
virtual double getVal_noPs(IDalitzEvent *evt)
MINT::counted_ptr< MINT::IEventGenerator< IDalitzEvent > > _defaultGenerator
void setIntegrationPrecision(double prec)
virtual DalitzHistoSet histoSet()
virtual double getVal(IDalitzEvent &evt)
void doFinalStats(MINT::Minimiser *mini=0)
virtual double getVal_withPs(IDalitzEvent *evt)
static const double g
virtual double getVal(IDalitzEvent *evt)
MINT::MinuitParameterSet * getMPS()
MINT::IEventGenerator< IDalitzEvent > * makeDefaultGenerator()
virtual double un_normalised_noPs(IDalitzEvent &evt)=0
IFastAmplitudeIntegrable * _amps
virtual double phaseSpace(IDalitzEvent &evt)
virtual double getNewVal(IDalitzEvent *evt)