MINT2
ComplexProductForEvent.h
Go to the documentation of this file.
1 #ifndef MINT_COMPLEX_PRODUCT_FOREVENT_HH
2 #define MINT_COMPLEX_PRODUCT_FOREVENT_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:17:55 GMT
5 
6 #include "Mint/ComplexProduct.h"
10 #include "Mint/IFitParRegister.h"
11 #include "Mint/FitParDependent.h"
12 
13 #include "Mint/BasicComplex.h"
14 #include <vector>
15 #include <complex>
16 #include "Mint/counted_ptr.h"
17 
18 namespace MINT{
19  template<typename EVENT_TYPE>
21  : virtual public IComplexForEventFitParDependent<EVENT_TYPE>
22  , public FitParDependent
23  {
25 
26  std::vector< counted_ptr<IReturnComplexForEvent<EVENT_TYPE> > > _evt_dep_factors;
27 
28  inline std::complex<double> event_dependent_complexProduct(EVENT_TYPE& evt){
29  std::complex<double> prod(1,0);
30  for(unsigned i = 0; i < _evt_dep_factors.size(); i++){
31  prod *= (_evt_dep_factors[i])->ComplexVal(evt);
32  }
33  return prod;
34  }
35 
36  public:
38  : FitParDependent(daddy)
39  , _eventIndependentProduct(this){}
40  ComplexProductForEvent(double initVal, IFitParRegister* daddy=0)
41  : FitParDependent(daddy)
42  , _eventIndependentProduct(initVal, this){}
43  ComplexProductForEvent(const std::complex<double>& z, IFitParRegister* daddy=0)
44  : FitParDependent(daddy)
45  , _eventIndependentProduct(z, this){}
47  : FitParDependent(other, newDaddy)
48  , _eventIndependentProduct(other, this){}
50  , IFitParRegister* newDaddy=0)
51  : FitParDependent(other, newDaddy)
54  {}
55 
56  void addTerm(double val){_eventIndependentProduct.addTerm(val);} // by value
57  void addTerm(const std::complex<double>& z){_eventIndependentProduct.addTerm(z);} // by value
59  _eventIndependentProduct.addTerm(irc);} // by reference
61  _eventIndependentProduct.addTerm(irc);} // by reference
64  _evt_dep_factors.push_back(irce);} // by reference
66  _evt_dep_factors.push_back(irce);} // by reference
67 
68  void multiply(const ComplexProductForEvent& other, IFitParRegister* newDaddy=0){
69  registerFitParDependence(other, newDaddy);
71  for(unsigned int i=0; i< other._evt_dep_factors.size(); i++){
72  addTerm(other._evt_dep_factors[i]);
73  }
74  }
75 
77  ComplexProductForEvent& operator*=(const std::complex<double>& z){addTerm(z);}
83 
84  inline std::complex<double> ComplexVal(EVENT_TYPE& evt){
87  }
88 
89  };
90 }
91 #endif
92 //
void addTerm(const counted_ptr< IComplexForEventFitParDependent< EVENT_TYPE > > &irce)
void addTerm(const counted_ptr< IReturnComplexForEvent< EVENT_TYPE > > &irce)
std::complex< double > ComplexVal()
std::vector< counted_ptr< IReturnComplexForEvent< EVENT_TYPE > > > _evt_dep_factors
void multiply(const ComplexProductForEvent &other, IFitParRegister *newDaddy=0)
ComplexProductForEvent(double initVal, IFitParRegister *daddy=0)
ComplexProductForEvent(const ComplexProductForEvent< EVENT_TYPE > &other, IFitParRegister *newDaddy=0)
void multiply(const ComplexProduct &multiplyWith)
virtual bool registerFitParDependence(const IFitParDependent &fpd)
void addTerm(double val)
ComplexProductForEvent & operator *=(double val)
void addTerm(const counted_ptr< IReturnComplex > &irc)
ComplexProductForEvent(const ComplexProduct &other, IFitParRegister *newDaddy=0)
std::complex< double > event_dependent_complexProduct(EVENT_TYPE &evt)
ComplexProductForEvent(IFitParRegister *daddy=0)
std::complex< double > ComplexVal(EVENT_TYPE &evt)
ComplexProductForEvent(const std::complex< double > &z, IFitParRegister *daddy=0)
void addTerm(const std::complex< double > &z)
void addTerm(const counted_ptr< IComplexFitParDependent > &irc)