1 #ifndef SUM_PDF_sums_two_normalised_pdfs_HH 2 #define SUM_PDF_sums_two_normalised_pdfs_HH 16 template<
typename EVENT_TYPE>
40 virtual double getVal(EVENT_TYPE & evt){
42 if(dbThis) std::cout <<
"SumPdf::getVal(): you called?" << std::endl;
43 double f = (double)
_f1;
45 if(dbThis) std::cout <<
"SumPdf::getVal(): returning " << returnVal
52 if(dbThis) std::cout <<
"SumPdf::beginFit(): you called?" << std::endl;
53 if(dbThis) std::cout <<
"... calling beginFit PDF 1" << std::endl;
55 if(dbThis) std::cout <<
"... calling beginFit PDF 2" << std::endl;
57 if(dbThis) std::cout <<
"SumPdf::beginFit(): returning" << std::endl;
61 if(dbThis) std::cout <<
"SumPdf::parametersChanged you called?" 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." 76 std::vector<double> grad_1(mps->
size());
77 std::vector<double> grad_2(mps->
size());
79 if(grad.size() != mps->
size()){
80 std::cout <<
"size-mismatch in SumPdf::Gradient" << std::endl;
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;
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);
virtual bool useAnalyticGradient()
SumPdf(FitParameter &f1, IPdf< EVENT_TYPE > &pdf_1, IPdf< EVENT_TYPE > &pdf_2)
virtual void parametersChanged()=0
virtual void Gradient(EVENT_TYPE &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
unsigned int size() const
virtual double getVal(EVENT &EVT)=0
virtual double getVal(EVENT_TYPE &evt)
SumPdf(const SumPdf &other)
IPdf< EVENT_TYPE > & _pdf_1
virtual bool useAnalyticGradient()
virtual void parametersChanged()
virtual void Gradient(EVENT &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
virtual void beginFit()=0
IPdf< EVENT_TYPE > & _pdf_2