23 ,
const std::string& prefix
24 ,
const std::string& lineshapePrefix
25 ,
const std::string& opt
27 :
FitAmpList(pat, fname, pset, prefix, lineshapePrefix, opt)
28 , _useAnalyticGradient(
"useAnalyticGradient",0)
40 ,
const std::string& prefix
41 ,
const std::string& lineshapePrefix
42 ,
const std::string& opt
44 :
FitAmpList(pat, pset, prefix, lineshapePrefix, opt)
45 , _useAnalyticGradient(
"useAnalyticGradient",0)
58 ,
const std::string& prefix
59 ,
const std::string& lineshapePrefix
60 ,
const std::string& opt
62 :
FitAmpList(pat, prefix, lineshapePrefix, opt)
63 , _useAnalyticGradient(
"useAnalyticGradient",0)
79 , _useAnalyticGradient(
"useAnalyticGradient",0)
95 , _useAnalyticGradient(
"useAnalyticGradient",0)
106 if(&other ==
this)
return *
this;
111 if(&other ==
this)
return *
this;
123 if(dbThis) cout <<
"FitAmpSum::GetCloneSameFitParameters()" << endl;
141 if(dbThis) cout <<
"FitAmpSum::GetCloneSameFitParameters() made ptr" << endl;
143 if(dbThis) cout <<
"cloning FitAmpSum " << newList->
size() << endl;
154 if(dbThis) cout <<
"FitAmpSum::GetCloneOfSubsetSameFitParameters()" << endl;
172 if(dbThis) cout <<
"FitAmpSum::GetCloneOfSubsetSameFitParameters() made ptr" << endl;
174 if(dbThis) cout <<
"cloning subset of FitAmpSum " << newList->
size() << endl;
185 std::complex<double> sum(0);
187 for(
unsigned int i=0; i< this->
size(); i++){
196 std::complex<double> result(sqrt(fabs(
efficiency(evt)))*sum);
217 std::complex<double> sum(0);
219 for(
unsigned int i=0; i< this->
size(); i++){
220 for (
unsigned int n=0; n <ampNames.size(); n++) {
223 if(dbThis) cout <<
"found amp " << this->
getAmpPtr(i)->
name() << endl;
228 std::complex<double> result(sqrt(fabs(
efficiency(evt)))*sum);
235 std::complex<double> val =
getVal(evt);
236 std::complex<double> valConj= conj(val);
238 for (
unsigned int i=0; i<mps->
size(); i++) {
242 if(name_i.find(
"Inco")!=std::string::npos)
continue;
244 if(name_i.find(
"_Re")!=std::string::npos){
249 name_i.replace(name_i.find(
"_Re"),3,
"");
250 for(
unsigned int j=0; j< this->
size(); j++){
252 if(i+1 >= grad.size()){
253 cout <<
"WARNING in FitAmpSum::Gradient" 254 <<
" have to increase size of grad to avoid memory issues" << endl;
260 grad[i+1]= -tmp.imag();
284 std::cout <<
"FitAmpSum::Gradient() called. Sorry, I don't know how to calculate the derivative with respect to the fit parameter " << mps->
getParPtr(i)->
name() <<
" ! Please implement me or set useAnalytic Gradient to 0 in your options file. I'll crash now. " << std::endl;
294 os <<
"FitAmpSum::print " << this->
size() <<
" amplitude components \n" 295 <<
"======================================================" << endl;
297 for(
unsigned int i=0; i< this->
size(); i++){
299 cout <<
"ampPtr( " << i <<
" ): " << endl;
307 os <<
"FitAmpSum::print\n====================";
309 for(
unsigned int i=0; i< this->
size(); i++){
317 os <<
"FitAmpSum::print\n====================";
319 for(
unsigned int i=0; i< this->
size(); i++){
323 if(norm(val) > 1.e10) os <<
" HUGE!!!" << endl;
335 for(
unsigned int i=0; i <
_fitAmps.size(); i++){
336 if(
_fitAmps[i]->canBeIgnored())
continue;
337 for(
unsigned int j=i; j <
_fitAmps.size(); j++){
338 if(
_fitAmps[j]->canBeIgnored())
continue;
344 for(
unsigned int l=0; l <
_fitAmpLists[k]->size(); l++){
359 for(
unsigned int j=0; j < i; j++){
360 for(
unsigned int ki = 0; ki <
_fitAmpLists[i]->size(); ki++){
362 for(
unsigned int kj = 0; kj <
_fitAmpLists[j]->size(); kj++){
380 cout <<
"FitAmpSum: setting efficiency POINTER " 381 <<
" in integCalculator to " 384 cout <<
" (0 means no pointer, 100% efficiency).";
391 cout <<
"this->size()" << this->
size() << endl;
392 cout <<
"_fitAmpLists.size()" <<
_fitAmpLists.size() << endl;
394 cout <<
"printing list number " << i << endl;
398 cout <<
" the pair list: " << endl;
406 for(
unsigned int i=0; i <
_fitAmps.size(); i++){
407 if(
_fitAmps[i]->canBeIgnored())
continue;
408 for(
unsigned int j=i; j <
_fitAmps.size(); j++){
409 if(
_fitAmps[j]->canBeIgnored())
continue;
415 for(
unsigned int l=0; l <
_fitAmpLists[k]->size(); l++){
430 for(
unsigned int j=0; j < i; j++){
431 for(
unsigned int ki = 0; ki <
_fitAmpLists[i]->size(); ki++){
433 for(
unsigned int kj = 0; kj <
_fitAmpLists[j]->size(); kj++){
451 cout <<
"FitAmpSum: setting efficiency POINTER " 452 <<
" in integCalculator to " 455 cout <<
" (0 means no pointer, 100% efficiency).";
478 if(dbThis) cout <<
"FitAmpSum::~FitAmpSum() " << endl;
480 if(dbThis) cout <<
"FitAmpSum::~FitAmpSum() done" << endl;
virtual bool append(const IntegCalculator &other)
FitAmpSum operator+(const FitAmpSum &other) const
virtual MINT::counted_ptr< FitAmpListBase > GetCloneOfSubsetSameFitParameters(std::string name) const
virtual bool append(const FitAmpPairList &otherListPtr)
virtual int add(const FitAmpListBase &other, double factor=1)
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual void print(std::ostream &os=std::cout) const
virtual MINT::counted_ptr< FitAmpPairList > makeFitAmpPairList()
virtual int iFixInit() const =0
bool canBeIgnored() const
virtual std::complex< double > getVal(IDalitzEvent &evt)
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const
virtual void addAmps(FitAmplitude *a1, FitAmplitude *a2)
virtual void Gradient(IDalitzEvent &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
IMinuitParameter * getParPtr(unsigned int i)
FitAmpSum & operator=(const FitAmpSum &other)
unsigned int size() const
virtual void print(std::ostream &os=std::cout) const
virtual std::complex< double > getValWithoutFitParameters(IDalitzEvent &evt)
virtual std::complex< double > getVal(IDalitzEvent &evt)
DecayTree theBareDecay() const
virtual const std::string & name() const =0
virtual int addCopyOfSubsetWithSameFitParameters(const FitAmpListBase &other, std::string name, double factor=1)
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency
FitAmpSum(const DalitzEventPattern &pat, const char *fname=0, MINT::MinuitParameterSet *pset=0, const std::string &prefix="", const std::string &lineshapePrefix="", const std::string &opt="")
FitAmpSum operator *(double r, const FitAmpSum &rhs)
bool A_is_in_B(const std::string &a, const std::string &b)
std::vector< FitAmplitude * > _fitAmps
void setEfficiency(MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > eff)
double efficiency(IDalitzEvent &evt)
virtual void addAmps(FitAmplitude *a1, FitAmplitude *a2)
virtual bool hidden() const =0
FitAmpList(const DalitzEventPattern &pat, const char *fname=0, MINT::MinuitParameterSet *pset=0, const std::string &prefix="", const std::string &lineshapePrefix="", const std::string &opt="")
virtual const DalitzEventPattern & eventPattern() const =0
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists
virtual MINT::counted_ptr< IntegCalculator > makeIntegCalculator()
FitAmpSum & operator+=(const FitAmpSum &other)
virtual MINT::counted_ptr< IIntegrationCalculator > makeIntegrationCalculator()
virtual void printNonZero(std::ostream &os=std::cout) const
virtual void printValues(IDalitzEvent &evt, std::ostream &os=std::cout)
double getAmpSqr(IDalitzEvent &evt, std::vector< std::string > ampNames, bool CC=false)
void oneLiner(std::stringstream &seam, int generation=0) const
FitAmpSum operator *(double r) const
FitAmpSum & operator *=(double r)
virtual unsigned int size() const
void setEfficiency(MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > eff)
virtual bool createAllAmps(const DalitzEventPattern &thePattern, const std::string &prefix="", const std::string &lineshapePrefix="")
virtual void multiply(double r)