MINT2
Public Member Functions | Protected Attributes | List of all members
MINT::SumPdf< EVENT_TYPE > Class Template Reference

#include <SumPdf.h>

Inheritance diagram for MINT::SumPdf< EVENT_TYPE >:
MINT::PdfBase< EVENT_TYPE > MINT::IPdf< EVENT_TYPE > MINT::IReturnRealForEvent< EVENT_TYPE > MINT::IReturnRealForEvent< EVENT_TYPE >

Public Member Functions

 SumPdf (FitParameter &f1, IPdf< EVENT_TYPE > &pdf_1, IPdf< EVENT_TYPE > &pdf_2)
 
 SumPdf (const SumPdf &other)
 
virtual double getVal (EVENT_TYPE &evt)
 
virtual void beginFit ()
 
virtual void parametersChanged ()
 
virtual void endFit ()
 
virtual void Gradient (EVENT_TYPE &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
 
virtual bool useAnalyticGradient ()
 
virtual ~SumPdf ()
 
- Public Member Functions inherited from MINT::PdfBase< EVENT_TYPE >
 PdfBase ()
 
 PdfBase (const PdfBase< EVENT_TYPE > &)
 
virtual double RealVal (EVENT_TYPE &evt)
 
virtual double getNewVal (EVENT_TYPE &evt)
 
virtual ~PdfBase ()
 
- Public Member Functions inherited from MINT::IReturnRealForEvent< EVENT_TYPE >
virtual ~IReturnRealForEvent ()
 

Protected Attributes

FitParameter_f1
 
IPdf< EVENT_TYPE > & _pdf_1
 
IPdf< EVENT_TYPE > & _pdf_2
 

Additional Inherited Members

- Protected Member Functions inherited from MINT::IReturnRealForEvent< EVENT_TYPE >
 IReturnRealForEvent ()
 

Detailed Description

template<typename EVENT_TYPE>
class MINT::SumPdf< EVENT_TYPE >

Definition at line 17 of file SumPdf.h.

Constructor & Destructor Documentation

◆ SumPdf() [1/2]

template<typename EVENT_TYPE>
MINT::SumPdf< EVENT_TYPE >::SumPdf ( FitParameter f1,
IPdf< EVENT_TYPE > &  pdf_1,
IPdf< EVENT_TYPE > &  pdf_2 
)
inline

Definition at line 24 of file SumPdf.h.

27  : PdfBase<EVENT_TYPE>()
28  , _f1(f1), _pdf_1(pdf_1), _pdf_2(pdf_2)
29  {
30  }
IPdf< EVENT_TYPE > & _pdf_1
Definition: SumPdf.h:20
FitParameter & _f1
Definition: SumPdf.h:19
IPdf< EVENT_TYPE > & _pdf_2
Definition: SumPdf.h:21

◆ SumPdf() [2/2]

template<typename EVENT_TYPE>
MINT::SumPdf< EVENT_TYPE >::SumPdf ( const SumPdf< EVENT_TYPE > &  other)
inline

Definition at line 32 of file SumPdf.h.

33  : IReturnRealForEvent<EVENT_TYPE>()
34  , IPdf<EVENT_TYPE>()
35  , PdfBase<EVENT_TYPE>()
36  , _f1(other._f1), _pdf_1(other._pdf_1), _pdf_2(other._pdf_2)
37  {
38  }
IPdf< EVENT_TYPE > & _pdf_1
Definition: SumPdf.h:20
FitParameter & _f1
Definition: SumPdf.h:19
IPdf< EVENT_TYPE > & _pdf_2
Definition: SumPdf.h:21

◆ ~SumPdf()

template<typename EVENT_TYPE>
virtual MINT::SumPdf< EVENT_TYPE >::~SumPdf ( )
inlinevirtual

Definition at line 99 of file SumPdf.h.

99 {}

Member Function Documentation

◆ beginFit()

template<typename EVENT_TYPE>
virtual void MINT::SumPdf< EVENT_TYPE >::beginFit ( )
inlinevirtual

Reimplemented from MINT::PdfBase< EVENT_TYPE >.

Definition at line 50 of file SumPdf.h.

50  {
51  bool dbThis=false;
52  if(dbThis) std::cout << "SumPdf::beginFit(): you called?" << std::endl;
53  if(dbThis) std::cout << "... calling beginFit PDF 1" << std::endl;
54  _pdf_1.beginFit();
55  if(dbThis) std::cout << "... calling beginFit PDF 2" << std::endl;
56  _pdf_2.beginFit();
57  if(dbThis) std::cout << "SumPdf::beginFit(): returning" << std::endl;
58  }
IPdf< EVENT_TYPE > & _pdf_1
Definition: SumPdf.h:20
virtual void beginFit()=0
IPdf< EVENT_TYPE > & _pdf_2
Definition: SumPdf.h:21

◆ endFit()

template<typename EVENT_TYPE>
virtual void MINT::SumPdf< EVENT_TYPE >::endFit ( )
inlinevirtual

Reimplemented from MINT::PdfBase< EVENT_TYPE >.

Definition at line 70 of file SumPdf.h.

70  {
71  _pdf_1.endFit();
72  _pdf_2.endFit();
73  }
IPdf< EVENT_TYPE > & _pdf_1
Definition: SumPdf.h:20
virtual void endFit()=0
IPdf< EVENT_TYPE > & _pdf_2
Definition: SumPdf.h:21

◆ getVal()

template<typename EVENT_TYPE>
virtual double MINT::SumPdf< EVENT_TYPE >::getVal ( EVENT_TYPE &  evt)
inlinevirtual

Implements MINT::PdfBase< EVENT_TYPE >.

Reimplemented in DalitzSumPdf.

Definition at line 40 of file SumPdf.h.

40  {
41  bool dbThis=false;
42  if(dbThis) std::cout << "SumPdf::getVal(): you called?" << std::endl;
43  double f = (double) _f1;
44  double returnVal = f * _pdf_1.getVal(evt) + (1.0 - f) * _pdf_2.getVal(evt);
45  if(dbThis) std::cout << "SumPdf::getVal(): returning " << returnVal
46  << std::endl;
47  return returnVal;
48  }
virtual double getVal(EVENT &EVT)=0
IPdf< EVENT_TYPE > & _pdf_1
Definition: SumPdf.h:20
FitParameter & _f1
Definition: SumPdf.h:19
IPdf< EVENT_TYPE > & _pdf_2
Definition: SumPdf.h:21

◆ Gradient()

template<typename EVENT_TYPE>
virtual void MINT::SumPdf< EVENT_TYPE >::Gradient ( EVENT_TYPE &  evt,
std::vector< double > &  grad,
MINT::MinuitParameterSet mps 
)
inlinevirtual

Reimplemented from MINT::IPdf< EVENT_TYPE >.

Definition at line 75 of file SumPdf.h.

75  {
76  std::vector<double> grad_1(mps->size());
77  std::vector<double> grad_2(mps->size());
78 
79  if(grad.size() != mps->size()){
80  std::cout << "size-mismatch in SumPdf::Gradient" << std::endl;
81  throw "bugger";
82  }
83  for(unsigned int j=0; j < grad_1.size(); j++) grad_1[j]=0;
84  for(unsigned int j=0; j < grad_2.size(); j++) grad_2[j]=0;
85 
86  _pdf_1.Gradient(evt, grad_1,mps);
87  _pdf_2.Gradient(evt, grad_2,mps);
88 
89  for(unsigned int j=0; j < grad.size(); j++){
90  grad.at(j)= _f1 * grad_1.at(j) + (1.0 - _f1) * grad_2.at(j);
91  }
92 
93  }
unsigned int size() const
IPdf< EVENT_TYPE > & _pdf_1
Definition: SumPdf.h:20
FitParameter & _f1
Definition: SumPdf.h:19
virtual void Gradient(EVENT &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
Definition: IPdf.h:23
IPdf< EVENT_TYPE > & _pdf_2
Definition: SumPdf.h:21

◆ parametersChanged()

template<typename EVENT_TYPE>
virtual void MINT::SumPdf< EVENT_TYPE >::parametersChanged ( )
inlinevirtual

Reimplemented from MINT::PdfBase< EVENT_TYPE >.

Definition at line 59 of file SumPdf.h.

59  {
60  bool dbThis=false;
61  if(dbThis) std::cout << "SumPdf::parametersChanged you called?"
62  << std::endl;
63  if(dbThis) std::cout << "... parametersChanged pdf 1" << std::endl;
65  if(dbThis) std::cout << "... parametersChanged pdf 2" << std::endl;
67  if(dbThis) std::cout << "SumPdf::parametersChanged: done."
68  << std::endl;
69  }
virtual void parametersChanged()=0
IPdf< EVENT_TYPE > & _pdf_1
Definition: SumPdf.h:20
IPdf< EVENT_TYPE > & _pdf_2
Definition: SumPdf.h:21

◆ useAnalyticGradient()

template<typename EVENT_TYPE>
virtual bool MINT::SumPdf< EVENT_TYPE >::useAnalyticGradient ( )
inlinevirtual

Reimplemented from MINT::IPdf< EVENT_TYPE >.

Definition at line 95 of file SumPdf.h.

95  {
97  }
IPdf< EVENT_TYPE > & _pdf_1
Definition: SumPdf.h:20
virtual bool useAnalyticGradient()
Definition: IPdf.h:30
IPdf< EVENT_TYPE > & _pdf_2
Definition: SumPdf.h:21

Member Data Documentation

◆ _f1

template<typename EVENT_TYPE>
FitParameter& MINT::SumPdf< EVENT_TYPE >::_f1
protected

Definition at line 19 of file SumPdf.h.

◆ _pdf_1

template<typename EVENT_TYPE>
IPdf<EVENT_TYPE>& MINT::SumPdf< EVENT_TYPE >::_pdf_1
protected

Definition at line 20 of file SumPdf.h.

◆ _pdf_2

template<typename EVENT_TYPE>
IPdf<EVENT_TYPE>& MINT::SumPdf< EVENT_TYPE >::_pdf_2
protected

Definition at line 21 of file SumPdf.h.


The documentation for this class was generated from the following file: