MINT2
FitAmpIncoherentSum.h
Go to the documentation of this file.
1 #ifndef FITAMPINCOHERENTSUM_HH
2 #define FITAMPINCOHERENTSUM_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:18:03 GMT
5 
6 #include <iostream>
7 
8 #include "Mint/counted_ptr.h"
9 
10 #include "Mint/DalitzBoxSet.h"
11 #include "Mint/DalitzBWBoxSet.h"
12 #include "Mint/IntegCalculator.h"
13 
18 
20 
21 #include "Mint/FitAmpList.h"
22 #include <vector>
23 
25 : virtual public MINT::IReturnRealForEvent<IDalitzEvent>
26 , virtual public IFastAmplitudeIntegrable
27 , virtual public ILookLikeFitAmpSum
28 , public FitAmpList
29 {
30  protected:
32  static std::string IncPrefix();
33  public:
35  , const char* fname=0
36  , MINT::MinuitParameterSet* pset=0
37  , const std::string& prefix=""
38  , const std::string& lineshapePrefix=""
39  , const std::string& opt=""
40  );
41 
44  , const std::string& prefix=""
45  , const std::string& lineshapePrefix=""
46  , const std::string& opt=""
47  );
49  , const std::string& prefix
50  , const std::string& lineshapePrefix=""
51  , const std::string& opt=""
52  );
53 
55  FitAmpIncoherentSum(const FitAmpList& other);
56  /*
57  The copy constructor copies like this: There'll be 'physical'
58  copies of all Amplitudes, but the FitParameters remain the
59  same (pointers to the same FitParameter Object). This is
60  useful for the CP-conj coding as it is now, but perhaps a bit
61  counter-intuitive. needs to be reviewed at some point. This
62  behaviour is defined in the copy constructor of the
63  FitAmplitude class.
64  */
66 
67 
69  , double nSigma=2){
70  return FitAmpList::makeBoxes(pat, this, nSigma);}
71 
73  , TRandom* rnd=gRandom){
74  return FitAmpList::makeBWBoxes(pat, this, rnd);}
75 
76 
77  double getVal(IDalitzEvent& evt);
78  double getVal(IDalitzEvent* evtPtr){
79  if(0 == evtPtr) return 0;
80  return getVal(*evtPtr);
81  }
82 
83  virtual void Gradient(IDalitzEvent& evt,std::vector<double>& grad, MINT::MinuitParameterSet* mps);
84  virtual bool useAnalyticGradient() {return _useAnalyticGradient;}
85 
86  /*
87  double getSmootherLargerVal();
88  double getSmootherLargerVal(IDalitzEvent* evt);
89  */
90 
94 
95  virtual double Prob(IDalitzEvent& evt){
96  return getVal(evt);
97  }
98 
99  /*
100  virtual double SmootherLargerProb(){
101  return getSmootherLargerVal();
102  }
103  */
104 
105  virtual double RealVal(IDalitzEvent& evt){
106  return Prob(evt);
107  }
108 
109  /*
110  virtual double SmootherLargerRealVal(){
111  return SmootherLargerProb();
112  }
113  */
114 
116  makeEventGenerator(const DalitzEventPattern& pat, TRandom* rnd=gRandom){
118  ptr(new DalitzBWBoxSet(makeBWBoxes(pat, rnd)));
119  return ptr;
120  }
121 
122  virtual ~FitAmpIncoherentSum();
123 
124  void printLargestAmp(std::ostream& os = std::cout);
125  virtual void printLargestAmp(IDalitzEvent& evt, std::ostream& os = std::cout){
126  FitAmpList::printLargestAmp(evt, os);}
127 
128  virtual void print(std::ostream& os=std::cout) const;
129  virtual void printNonZero(std::ostream& os=std::cout) const;
130 
131  friend class FitAmplitude;
132 
133  FitAmpIncoherentSum& operator*=(double r);
134  FitAmpIncoherentSum& operator*=(const std::complex<double>& z);
136 
137  FitAmpIncoherentSum operator*(double r) const;
138  FitAmpIncoherentSum operator*(const std::complex<double>& z) const;
140 
141 
146 
147 };
148 
150 FitAmpIncoherentSum operator*(const std::complex<double>& z, const FitAmpIncoherentSum& rhs);
152  , const FitAmpIncoherentSum& rhs);
153 
154 
155 #endif
156 //
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const
FitAmpIncoherentSum operator *(double r) const
void printLargestAmp(std::ostream &os=std::cout)
virtual MINT::counted_ptr< IIntegrationCalculator > makeIntegrationCalculator()
virtual void printLargestAmp(IDalitzEvent &evt, std::ostream &os=std::cout)
Definition: FitAmpList.cpp:231
DalitzBWBoxSet makeBWBoxes(const DalitzEventPattern &pat, MINT::IReturnRealForEvent< IDalitzEvent > *pdf, TRandom *rnd=gRandom)
FitAmpIncoherentSum & operator+=(const FitAmpIncoherentSum &other)
DalitzBoxSet makeBoxes(const DalitzEventPattern &pat, MINT::IReturnRealForEvent< IDalitzEvent > *pdf, double nSigma=2)
virtual double Prob(IDalitzEvent &evt)
static std::string IncPrefix()
virtual DalitzBWBoxSet makeBWBoxes(const DalitzEventPattern &pat, TRandom *rnd=gRandom)
virtual void printNonZero(std::ostream &os=std::cout) const
virtual void printLargestAmp(IDalitzEvent &evt, std::ostream &os=std::cout)
FitAmpIncoherentSum & operator *=(double r)
virtual void Gradient(IDalitzEvent &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
double getVal(IDalitzEvent &evt)
virtual DalitzBoxSet makeBoxes(const DalitzEventPattern &pat, double nSigma=2)
FitAmpIncoherentSum & operator=(const FitAmpIncoherentSum &other)
FitAmpIncoherentSum operator *(double r, const FitAmpIncoherentSum &rhs)
virtual MINT::counted_ptr< IntegCalculator > makeIntegCalculator()
double getVal(IDalitzEvent *evtPtr)
virtual double RealVal(IDalitzEvent &evt)
FitAmpIncoherentSum operator+(const FitAmpIncoherentSum &other) const
virtual MINT::counted_ptr< FitAmpPairList > makeFitAmpPairList()
virtual void print(std::ostream &os=std::cout) const
virtual MINT::counted_ptr< MINT::IUnweightedEventGenerator< IDalitzEvent > > makeEventGenerator(const DalitzEventPattern &pat, TRandom *rnd=gRandom)
virtual bool useAnalyticGradient()
FitAmpIncoherentSum(const DalitzEventPattern &pat, const char *fname=0, MINT::MinuitParameterSet *pset=0, const std::string &prefix="", const std::string &lineshapePrefix="", const std::string &opt="")
MINT::NamedParameter< int > _useAnalyticGradient