MINT2
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
FitAmpListBase Class Reference

#include <FitAmpListBase.h>

Inheritance diagram for FitAmpListBase:
FitAmpList MultiTopHat FitAmpIncoherentSum FitAmpIncoherentSumEvtGen FitAmpSum

Public Member Functions

 FitAmpListBase ()
 
 FitAmpListBase (const FitAmpListBase &other)
 
 FitAmpListBase (const FitAmpListBase &other, std::string name)
 
virtual int addCopyWithSameFitParameters (const FitAmpListBase &other, double factor=1)
 
virtual int addCopyOfSubsetWithSameFitParameters (const FitAmpListBase &other, std::string name, double factor=1)
 
virtual bool addAmplitude (FitAmplitude *fa)
 
virtual int add (const FitAmpListBase &other, double factor=1)
 
virtual int addAsList (const FitAmpListBase &other, double factor=1)
 
virtual unsigned int size () const
 
virtual FitAmplitudegetAmpPtr (unsigned int i)
 
const FitAmplitudegetAmpPtr (unsigned int i) const
 
virtual bool CPConjugateSameFitParameters ()
 
virtual MINT::counted_ptr< FitAmpListBaseGetCPConjugateSameFitParameters () const
 
virtual bool CConjugateFinalStateSameFitParameters ()
 
virtual MINT::counted_ptr< FitAmpListBaseGetCConjugateFinalStateSameFitParameters () const
 
virtual bool CConjugateInitialStateSameFitParameters ()
 
virtual MINT::counted_ptr< FitAmpListBaseGetCConjugateInitialStateSameFitParameters () const
 
virtual bool setLSameFitParameters (int L)
 
virtual MINT::counted_ptr< FitAmpListBaseGetDifferentLSameFitParameters (int L) const
 
virtual MINT::counted_ptr< FitAmpListBaseGetCloneSameFitParameters () const
 
virtual MINT::counted_ptr< FitAmpListBaseGetCloneOfSubsetSameFitParameters (std::string name) const
 
virtual MINT::counted_ptr< FitAmpPairListmakeFitAmpPairList ()
 
virtual MINT::counted_ptr< IIntegrationCalculatormakeIntegrationCalculator ()
 
virtual MINT::counted_ptr< IntegCalculatormakeIntegCalculator ()
 
DalitzBoxSet makeBoxes (const DalitzEventPattern &pat, MINT::IReturnRealForEvent< IDalitzEvent > *pdf, double nSigma=2)
 
DalitzBWBoxSet makeBWBoxes (const DalitzEventPattern &pat, MINT::IReturnRealForEvent< IDalitzEvent > *pdf, TRandom *rnd=gRandom)
 
void setAllAmpsTo (const std::complex< double > z)
 
virtual ~FitAmpListBase ()
 
virtual void printLargestAmp (IDalitzEvent &evt, std::ostream &os=std::cout)
 
virtual void printAllAmps (std::ostream &os=std::cout) const
 
virtual void printAllAmps (IDalitzEvent &evt, std::ostream &os=std::cout)
 
virtual void printNonZeroWithValue (IDalitzEvent &evt, std::ostream &os=std::cout)
 
virtual void printNonZero (std::ostream &os=std::cout) const
 
virtual void print (std::ostream &os=std::cout) const
 
void setEfficiency (const MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > &eff)
 
double efficiency (IDalitzEvent &evt)
 
virtual void multiply (double r)
 
virtual void multiply (const std::complex< double > &z)
 
virtual void multiply (const MINT::counted_ptr< MINT::IReturnComplex > irc)
 
virtual void multiply (MINT::counted_ptr< MINT::IReturnComplexForEvent< IDalitzEvent > > irc)
 
FitAmpListBaseoperator *= (double r)
 
FitAmpListBaseoperator *= (const std::complex< double > &z)
 
FitAmpListBaseoperator *= (const MINT::counted_ptr< MINT::IReturnComplex > &irc)
 
FitAmpListBase operator * (double r) const
 
FitAmpListBase operator * (const std::complex< double > &z) const
 
FitAmpListBase operator * (const MINT::counted_ptr< MINT::IReturnComplex > &irc) const
 
void normalizeAmps (DalitzEventList &evtList)
 
std::vector< double > normFactors (DalitzEventList &evtList)
 
void randomizeStartVals (int seed=0)
 
void randomizePhaseStartVals (int seed=0)
 
void setTag (int tag)
 
FitAmpListBaseoperator= (const FitAmpListBase &other)
 
FitAmpListBaseoperator+= (const FitAmpListBase &other)
 
FitAmpListBase operator+ (const FitAmpListBase &other) const
 

Protected Member Functions

virtual void deleteAll ()
 

Protected Attributes

std::vector< FitAmplitude * > _fitAmps
 
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists
 
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency
 

Friends

class FitAmplitude
 

Detailed Description

Definition at line 26 of file FitAmpListBase.h.

Constructor & Destructor Documentation

◆ FitAmpListBase() [1/3]

FitAmpListBase::FitAmpListBase ( )

Definition at line 18 of file FitAmpListBase.cpp.

19  : _efficiency(0)
20 {
21 }
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency

◆ FitAmpListBase() [2/3]

FitAmpListBase::FitAmpListBase ( const FitAmpListBase other)

Definition at line 23 of file FitAmpListBase.cpp.

24  : _efficiency(other._efficiency)
25 {
26  bool dbThis=false;
27  this->deleteAll();
28  if(dbThis)cout << "copy-ctor FitAmpListBase, done deleteAll()" << endl;
29  /*
30  There'll be 'physical' copies of all Amplitudes, but the
31  FitParameters remain the same (pointers to the same
32  FitParameter Object). This is useful for the CP-con coding
33  as it is now, but perhaps a bit counter-intuitive. Needs to
34  be reviewed at some point. This behaviour is defined in the
35  copy construcopy-ctor of the FitAmplitude class.
36  */
37 
39 }
virtual int addCopyWithSameFitParameters(const FitAmpListBase &other, double factor=1)
virtual void deleteAll()
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency

◆ FitAmpListBase() [3/3]

FitAmpListBase::FitAmpListBase ( const FitAmpListBase other,
std::string  name 
)

◆ ~FitAmpListBase()

FitAmpListBase::~FitAmpListBase ( )
virtual

Definition at line 528 of file FitAmpListBase.cpp.

528  {
529  deleteAll();
530 }
virtual void deleteAll()

Member Function Documentation

◆ add()

int FitAmpListBase::add ( const FitAmpListBase other,
double  factor = 1 
)
virtual

Definition at line 66 of file FitAmpListBase.cpp.

66  {
67  return addCopyWithSameFitParameters(other, factor);
68 }
virtual int addCopyWithSameFitParameters(const FitAmpListBase &other, double factor=1)

◆ addAmplitude()

bool FitAmpListBase::addAmplitude ( FitAmplitude fa)
virtual

Definition at line 258 of file FitAmpListBase.cpp.

258  {
259  bool dbThis=false;
260  if(0 == fa) return false;
261  if(dbThis) cout << "check init values: " << *fa << endl;
262  _fitAmps.push_back(fa);
263  return true;
264 }
std::vector< FitAmplitude * > _fitAmps

◆ addAsList()

int FitAmpListBase::addAsList ( const FitAmpListBase other,
double  factor = 1 
)
virtual

Definition at line 69 of file FitAmpListBase.cpp.

69  {
70  if(0 == other.size()) return size();
71  // keeps them together
72  //cout << "Hello from FitAmpListBase::addAsList" << endl;
74  if(1.0 != factor) newList->multiply(factor);
75  _fitAmpLists.push_back(newList);
76  //cout << "all done in FitAmpListBase::addAsList" << endl;
77  return size();
78 }
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists
virtual unsigned int size() const

◆ addCopyOfSubsetWithSameFitParameters()

int FitAmpListBase::addCopyOfSubsetWithSameFitParameters ( const FitAmpListBase other,
std::string  name,
double  factor = 1 
)
virtual

Definition at line 95 of file FitAmpListBase.cpp.

95  {
96  for(unsigned int i=0; i < other._fitAmps.size(); i++){
97  if(! A_is_in_B(name,other._fitAmps[i]->name()))continue;
98  FitAmplitude* fa = other._fitAmps[i];
99  FitAmplitude* newFa = new FitAmplitude(*fa);
100  if(1.0 != factor) newFa->multiply(factor);
101  this->addAmplitude(newFa);
102  }
103  for(unsigned int i=0; i < other._fitAmpLists.size(); i++){
104  this->addAsList(*(other._fitAmpLists[i]->GetCloneOfSubsetSameFitParameters(name)));
105  }
106  return this->size();
107 }
virtual bool addAmplitude(FitAmplitude *fa)
virtual int addAsList(const FitAmpListBase &other, double factor=1)
bool A_is_in_B(const std::string &a, const std::string &b)
Definition: Utils.cpp:34
std::vector< FitAmplitude * > _fitAmps
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists
friend class FitAmplitude
virtual unsigned int size() const
void multiply(double r)

◆ addCopyWithSameFitParameters()

int FitAmpListBase::addCopyWithSameFitParameters ( const FitAmpListBase other,
double  factor = 1 
)
virtual

Definition at line 80 of file FitAmpListBase.cpp.

81  {
82  for(unsigned int i=0; i < other._fitAmps.size(); i++){
83  FitAmplitude* fa = other._fitAmps[i];
84  FitAmplitude* newFa = new FitAmplitude(*fa);
85  if(1.0 != factor) newFa->multiply(factor);
86  //_fitAmps.push_back(newFa);
87  this->addAmplitude(newFa);
88  }
89  for(unsigned int i=0; i < other._fitAmpLists.size(); i++){
90  this->addAsList(*(other._fitAmpLists[i]->GetCloneSameFitParameters()));
91  }
92  return this->size();
93 }
virtual bool addAmplitude(FitAmplitude *fa)
virtual int addAsList(const FitAmpListBase &other, double factor=1)
std::vector< FitAmplitude * > _fitAmps
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists
friend class FitAmplitude
virtual unsigned int size() const
void multiply(double r)

◆ CConjugateFinalStateSameFitParameters()

bool FitAmpListBase::CConjugateFinalStateSameFitParameters ( )
virtual

Definition at line 157 of file FitAmpListBase.cpp.

157  {
158  bool dbThis=false;
159  if(dbThis) cout << "FitAmpListBase::CConjugateFinalStateSameFitParameters()" << endl;
160 
161  bool success=true;
162  for(unsigned int i=0; i< this->size(); i++){
164  }
165  return success;
166 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
bool CConjugateFinalStateSameFitParameters()
virtual unsigned int size() const

◆ CConjugateInitialStateSameFitParameters()

bool FitAmpListBase::CConjugateInitialStateSameFitParameters ( )
virtual

Definition at line 168 of file FitAmpListBase.cpp.

168  {
169  bool dbThis=false;
170  if(dbThis) cout << "FitAmpListBase::CConjugateFinalStateSameFitParameters()" << endl;
171 
172  bool success=true;
173  for(unsigned int i=0; i< this->size(); i++){
175  }
176  return success;
177 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
bool CConjugateInitialStateSameFitParameters()
virtual unsigned int size() const

◆ CPConjugateSameFitParameters()

bool FitAmpListBase::CPConjugateSameFitParameters ( )
virtual

Definition at line 146 of file FitAmpListBase.cpp.

146  {
147  bool dbThis=false;
148  if(dbThis) cout << "FitAmpListBase::CPConjugateSameFitParameters()" << endl;
149 
150  bool success=true;
151  for(unsigned int i=0; i< this->size(); i++){
152  success &= getAmpPtr(i)->CPConjugateSameFitParameters();
153  }
154  return success;
155 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
bool CPConjugateSameFitParameters()
virtual unsigned int size() const

◆ deleteAll()

void FitAmpListBase::deleteAll ( )
protectedvirtual

Definition at line 433 of file FitAmpListBase.cpp.

433  {
434  bool dbThis=false;
435  if(dbThis) cout << "Hello from FitAmpListBase::deleteAll()" << endl;
436  for(unsigned int i=0; i<_fitAmps.size(); i++){
437  if(0 != (_fitAmps[i])){
438  delete (_fitAmps[i]);
439  _fitAmps[i]=0;
440  }
441  }
442  for(unsigned int i=0; i < _fitAmpLists.size(); i++){
443  if(0 != _fitAmpLists[i]){
444  _fitAmpLists[i]->deleteAll();
445  }
446  }
447 
448  _fitAmps.clear();
449  _fitAmpLists.clear();
450  if(dbThis) cout << "all fine in FitAmpListBase::deleteAll()" << endl;
451 }
std::vector< FitAmplitude * > _fitAmps
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists

◆ efficiency()

double FitAmpListBase::efficiency ( IDalitzEvent evt)

Definition at line 456 of file FitAmpListBase.cpp.

456  {
457  if(0 == _efficiency) return 1.0;
458  double eff = _efficiency->RealVal(evt);
459  if(eff < 0) return 0;
460  return eff;
461 }
virtual double RealVal(EVENT_TYPE &evt)=0
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency

◆ getAmpPtr() [1/2]

FitAmplitude * FitAmpListBase::getAmpPtr ( unsigned int  i)
virtual

Definition at line 117 of file FitAmpListBase.cpp.

117  {
118 
119  if(in < _fitAmps.size()) return _fitAmps[in];
120  unsigned int sz = _fitAmps.size();
121  for(unsigned int i = 0; i < _fitAmpLists.size(); i++){
122  int index = in - sz;
123  if(index >= 0 && static_cast<unsigned int>(index) < _fitAmpLists[i]->size()) return _fitAmpLists[i]->getAmpPtr(index);
124  sz += _fitAmpLists[i]->size();
125  }
126 
127  cout << " FitAmpListBase::getAmp index out of range"
128  << endl;
129  return 0;
130 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
std::vector< FitAmplitude * > _fitAmps
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists

◆ getAmpPtr() [2/2]

const FitAmplitude * FitAmpListBase::getAmpPtr ( unsigned int  i) const

Definition at line 131 of file FitAmpListBase.cpp.

131  {
132 
133  if(in < _fitAmps.size()) return _fitAmps[in];
134  unsigned int sz = _fitAmps.size();
135  for(unsigned int i = 0; i < _fitAmpLists.size(); i++){
136  int index = in - sz;
137  if(index >= 0 && static_cast<unsigned int>(index) < _fitAmpLists[i]->size()) return _fitAmpLists[i]->getAmpPtr(index);
138  sz += _fitAmpLists[i]->size();
139  }
140 
141  cout << " FitAmpListBase::getAmp index out of range"
142  << endl;
143  return 0;
144 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
std::vector< FitAmplitude * > _fitAmps
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists

◆ GetCConjugateFinalStateSameFitParameters()

counted_ptr< FitAmpListBase > FitAmpListBase::GetCConjugateFinalStateSameFitParameters ( ) const
virtual

Definition at line 231 of file FitAmpListBase.cpp.

231  {
232  bool dbThis=false;
233  if(dbThis) cout << "FitAmpListBase::GetCConjugateFinalStateSameFitParameters()" << endl;
234 
237  return newList;
238 }
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const
virtual bool CConjugateFinalStateSameFitParameters()

◆ GetCConjugateInitialStateSameFitParameters()

counted_ptr< FitAmpListBase > FitAmpListBase::GetCConjugateInitialStateSameFitParameters ( ) const
virtual

Definition at line 240 of file FitAmpListBase.cpp.

240  {
241  bool dbThis=false;
242  if(dbThis) cout << "FitAmpListBase::GetCConjugateFinalStateSameFitParameters()" << endl;
243 
246  return newList;
247 }
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const
virtual bool CConjugateInitialStateSameFitParameters()

◆ GetCloneOfSubsetSameFitParameters()

counted_ptr< FitAmpListBase > FitAmpListBase::GetCloneOfSubsetSameFitParameters ( std::string  name) const
virtual

Reimplemented in FitAmpSum.

Definition at line 206 of file FitAmpListBase.cpp.

206  {
207  bool dbThis=false;
208  if(dbThis) cout << "FitAmpListBase::GetCloneSameFitParameters()" << endl;
209  /*
210  There'll be 'physical' copies of all Amplitudes, but the
211  FitParameters remain the same (pointers to the same
212  FitParameter Object). This is useful for the CP-con coding
213  as it is now, but perhaps a bit counter-intuitive. needs to
214  be reviewed at some point. This behaviour is defined in the
215  copy constructor of the FitAmplitude class.
216  */
217 
218  counted_ptr<FitAmpListBase> newList(new FitAmpListBase(*this,name));
219  return newList;
220 }

◆ GetCloneSameFitParameters()

counted_ptr< FitAmpListBase > FitAmpListBase::GetCloneSameFitParameters ( ) const
virtual

Reimplemented in FitAmpList, FitAmpSum, FitAmpIncoherentSum, FitAmpIncoherentSumEvtGen, and MultiTopHat.

Definition at line 190 of file FitAmpListBase.cpp.

190  {
191  bool dbThis=false;
192  if(dbThis) cout << "FitAmpListBase::GetCloneSameFitParameters()" << endl;
193  /*
194  There'll be 'physical' copies of all Amplitudes, but the
195  FitParameters remain the same (pointers to the same
196  FitParameter Object). This is useful for the CP-con coding
197  as it is now, but perhaps a bit counter-intuitive. needs to
198  be reviewed at some point. This behaviour is defined in the
199  copy constructor of the FitAmplitude class.
200  */
201 
202  counted_ptr<FitAmpListBase> newList(new FitAmpListBase(*this));
203  return newList;
204 }

◆ GetCPConjugateSameFitParameters()

counted_ptr< FitAmpListBase > FitAmpListBase::GetCPConjugateSameFitParameters ( ) const
virtual

Reimplemented in FitAmpList.

Definition at line 222 of file FitAmpListBase.cpp.

222  {
223  bool dbThis=false;
224  if(dbThis) cout << "FitAmpListBase::GetCPConjugateSameFitParameters()" << endl;
225 
227  newList->CPConjugateSameFitParameters();
228  return newList;
229 }
virtual bool CPConjugateSameFitParameters()
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const

◆ GetDifferentLSameFitParameters()

counted_ptr< FitAmpListBase > FitAmpListBase::GetDifferentLSameFitParameters ( int  L) const
virtual

Definition at line 249 of file FitAmpListBase.cpp.

249  {
250  bool dbThis=false;
251  if(dbThis) cout << "FitAmpListBase::GetDifferentLSameFitParameters()" << endl;
252 
254  newList->setLSameFitParameters(L);
255  return newList;
256 }
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const
virtual bool setLSameFitParameters(int L)

◆ makeBoxes()

DalitzBoxSet FitAmpListBase::makeBoxes ( const DalitzEventPattern pat,
MINT::IReturnRealForEvent< IDalitzEvent > *  pdf,
double  nSigma = 2 
)

Definition at line 374 of file FitAmpListBase.cpp.

376  {
377  DalitzBoxSet boxes;
378  DalitzBox phaseSpaceBox(pat);
379  boxes.add(phaseSpaceBox);
380 
381  for(unsigned int i=0; i< this->size(); i++){
382  boxes.add( getAmpPtr(i)->MakeBoxes(pat, nSigma) );
383  }
384  boxes.setPDF(pdf);
385  return boxes;
386 }
void setPDF(MINT::IReturnRealForEvent< IDalitzEvent > *amps)
virtual FitAmplitude * getAmpPtr(unsigned int i)
void add(const DalitzBox &box)
virtual unsigned int size() const

◆ makeBWBoxes()

DalitzBWBoxSet FitAmpListBase::makeBWBoxes ( const DalitzEventPattern pat,
MINT::IReturnRealForEvent< IDalitzEvent > *  pdf,
TRandom *  rnd = gRandom 
)

Definition at line 388 of file FitAmpListBase.cpp.

391  {
392  DalitzBWBoxSet boxes(pdf, rnd);
393  // DalitzBox phaseSpaceBox(pat);
394  // boxes.add(phaseSpaceBox);
395 
396  for(unsigned int i=0; i< this->size(); i++){
397  DalitzBWBoxSet oneAmpsBox(getAmpPtr(i)->MakeBWBoxes(pat, rnd));
398  boxes.add(oneAmpsBox);
399  }
400  return boxes;
401 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual unsigned int size() const

◆ makeFitAmpPairList()

virtual MINT::counted_ptr<FitAmpPairList> FitAmpListBase::makeFitAmpPairList ( )
inlinevirtual

Reimplemented in FitAmpSum, FitAmpIncoherentSum, FitAmpIncoherentSumEvtGen, and MultiTopHat.

Definition at line 84 of file FitAmpListBase.h.

84  {
85  return 0;
86  }

◆ makeIntegCalculator()

virtual MINT::counted_ptr<IntegCalculator> FitAmpListBase::makeIntegCalculator ( )
inlinevirtual

Reimplemented in FitAmpSum, FitAmpIncoherentSum, FitAmpIncoherentSumEvtGen, and MultiTopHat.

Definition at line 90 of file FitAmpListBase.h.

90  {
91  return 0;
92  }

◆ makeIntegrationCalculator()

virtual MINT::counted_ptr<IIntegrationCalculator> FitAmpListBase::makeIntegrationCalculator ( )
inlinevirtual

Reimplemented in FitAmpSum, FitAmpIncoherentSum, FitAmpIncoherentSumEvtGen, and MultiTopHat.

Definition at line 87 of file FitAmpListBase.h.

87  {
88  return 0;
89  }

◆ multiply() [1/4]

void FitAmpListBase::multiply ( double  r)
virtual

Definition at line 404 of file FitAmpListBase.cpp.

404  {
405  for(unsigned int i=0; i< this->size(); i++){
406  if(0 != getAmpPtr(i)){
407  getAmpPtr(i)->multiply(r);
408  }
409  }
410 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual unsigned int size() const
void multiply(double r)

◆ multiply() [2/4]

void FitAmpListBase::multiply ( const std::complex< double > &  z)
virtual

Definition at line 411 of file FitAmpListBase.cpp.

411  {
412  for(unsigned int i=0; i< this->size(); i++){
413  if(0 != getAmpPtr(i)){
414  getAmpPtr(i)->multiply(z);
415  }
416  }
417 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual unsigned int size() const
void multiply(double r)

◆ multiply() [3/4]

void FitAmpListBase::multiply ( const MINT::counted_ptr< MINT::IReturnComplex irc)
virtual

Definition at line 418 of file FitAmpListBase.cpp.

418  {
419  for(unsigned int i=0; i< this->size(); i++){
420  if(0 != getAmpPtr(i)){
421  getAmpPtr(i)->multiply(irc);
422  }
423  }
424 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual unsigned int size() const
void multiply(double r)

◆ multiply() [4/4]

void FitAmpListBase::multiply ( MINT::counted_ptr< MINT::IReturnComplexForEvent< IDalitzEvent > >  irc)
virtual

Definition at line 425 of file FitAmpListBase.cpp.

425  {
426  for(unsigned int i=0; i< this->size(); i++){
427  if(0 != getAmpPtr(i)){
428  getAmpPtr(i)->multiply(irc);
429  }
430  }
431 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual unsigned int size() const
void multiply(double r)

◆ normalizeAmps()

void FitAmpListBase::normalizeAmps ( DalitzEventList evtList)

Definition at line 463 of file FitAmpListBase.cpp.

463  {
464 
465  for(unsigned int i=0; i< this->size(); i++){
466  if(0 == getAmpPtr(i))continue;
467  double integral=0.;
468  double weight_sum=0.;
469  for (unsigned int j=0; j<evtList.size(); j++) {
470  double weight = evtList[j].getWeight()/evtList[j].getGeneratorPdfRelativeToPhaseSpace();
471  weight_sum += weight;
472  integral += weight * std::norm(getAmpPtr(i)->getValWithoutFitParameters(evtList[j]));
473  }
474  if(weight_sum==0)weight_sum = evtList.size();
475  if(integral>0)(getAmpPtr(i))->multiply(sqrt(weight_sum/integral));
476  }
477 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual unsigned int size() const
Definition: EventList.h:59
virtual unsigned int size() const
virtual void multiply(double r)

◆ normFactors()

vector< double > FitAmpListBase::normFactors ( DalitzEventList evtList)

Definition at line 479 of file FitAmpListBase.cpp.

479  {
480 
481  vector<double> tmp;
482  for(unsigned int i=0; i< this->size(); i++){
483  if(0 == getAmpPtr(i))continue;
484  double integral=0.;
485  double weight_sum=0.;
486  for (unsigned int j=0; j<evtList.size(); j++) {
487  double weight = evtList[j].getWeight()/evtList[j].getGeneratorPdfRelativeToPhaseSpace();
488  weight_sum += weight;
489  integral += weight * std::norm(getAmpPtr(i)->amp().getNewVal(evtList[j]));
490  }
491  if(weight_sum==0)weight_sum = evtList.size();
492  if(integral>0)tmp.push_back(sqrt(weight_sum/integral));
493  }
494  return tmp;
495 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual unsigned int size() const
Definition: EventList.h:59
virtual unsigned int size() const

◆ operator *() [1/3]

FitAmpListBase FitAmpListBase::operator * ( double  r) const

Definition at line 556 of file FitAmpListBase.cpp.

556  {
557  FitAmpListBase fas(*this);
558  fas.multiply(r);
559  return fas;
560 }

◆ operator *() [2/3]

FitAmpListBase FitAmpListBase::operator * ( const std::complex< double > &  z) const

◆ operator *() [3/3]

FitAmpListBase FitAmpListBase::operator * ( const MINT::counted_ptr< MINT::IReturnComplex > &  irc) const

Definition at line 566 of file FitAmpListBase.cpp.

566  {
567  FitAmpListBase fas(*this);
568  fas.multiply(irc);
569  return fas;
570 }

◆ operator *=() [1/3]

FitAmpListBase & FitAmpListBase::operator *= ( double  r)

Definition at line 543 of file FitAmpListBase.cpp.

543  {
544  multiply(r);
545  return *this;
546 }
virtual void multiply(double r)

◆ operator *=() [2/3]

FitAmpListBase& FitAmpListBase::operator *= ( const std::complex< double > &  z)

◆ operator *=() [3/3]

FitAmpListBase & FitAmpListBase::operator *= ( const MINT::counted_ptr< MINT::IReturnComplex > &  irc)

Definition at line 551 of file FitAmpListBase.cpp.

551  {
552  multiply(irc);
553  return *this;
554 }
virtual void multiply(double r)

◆ operator+()

FitAmpListBase FitAmpListBase::operator+ ( const FitAmpListBase other) const

Definition at line 536 of file FitAmpListBase.cpp.

536  {
537  FitAmpListBase fas(*this);
538  fas.add(rhs);
539  return fas;
540 }

◆ operator+=()

FitAmpListBase & FitAmpListBase::operator+= ( const FitAmpListBase other)

Definition at line 532 of file FitAmpListBase.cpp.

532  {
533  add(other);
534  return *this;
535 }
virtual int add(const FitAmpListBase &other, double factor=1)

◆ operator=()

FitAmpListBase & FitAmpListBase::operator= ( const FitAmpListBase other)

Definition at line 59 of file FitAmpListBase.cpp.

59  {
60  if(&other == this) return *this;
61  _efficiency = other._efficiency;
62  deleteAll();
64  return *this;
65 }
virtual int addCopyWithSameFitParameters(const FitAmpListBase &other, double factor=1)
virtual void deleteAll()
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency

◆ print()

void FitAmpListBase::print ( std::ostream &  os = std::cout) const
virtual

Reimplemented in FitAmpSum, FitAmpIncoherentSum, FitAmpIncoherentSumEvtGen, and MultiTopHat.

Definition at line 350 of file FitAmpListBase.cpp.

350  {
351  os << "FitAmpListBase::print\n====================";
352 
353  for(unsigned int i=0; i< this->size(); i++){
354  os << "\n\t" << getAmpPtr(i)->theBareDecay().oneLiner()
355  << endl;
356  }
357 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
DecayTree theBareDecay() const
Definition: FitAmplitude.h:166
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
virtual unsigned int size() const

◆ printAllAmps() [1/2]

void FitAmpListBase::printAllAmps ( std::ostream &  os = std::cout) const
virtual

Reimplemented in FitAmpList.

Definition at line 313 of file FitAmpListBase.cpp.

313  {
314  bool dbThis=false;
315  if(size() == 0){
316  os << "FitAmpListBase::printAllAmps: list is empty" << endl;
317  return;
318  }
319 
320  std::string largestName = "none";
321  if(dbThis) cout << "Debug mode for FitAmpListBase::printAllAmps" << endl;
322 
323  os << "FitAmpListBase::printAllAmps()\n====================";
324 
325  for(unsigned int i=0; i< this->size(); i++){
326  os << "\n\t" << getAmpPtr(i)->theBareDecay().oneLiner()
327  << endl;
328  }
329 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
DecayTree theBareDecay() const
Definition: FitAmplitude.h:166
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
virtual unsigned int size() const

◆ printAllAmps() [2/2]

void FitAmpListBase::printAllAmps ( IDalitzEvent evt,
std::ostream &  os = std::cout 
)
virtual

Reimplemented in FitAmpList.

Definition at line 295 of file FitAmpListBase.cpp.

295  {
296  bool dbThis=false;
297  if(size()==0){
298  os << "FitAmpListBase::printAllAmps: list is empty" << endl;
299  return;
300  }
301 
302  std::string largestName = "none";
303  if(dbThis) cout << "Debug mode for FitAmpListBase::printAllAmps" << endl;
304 
305  os << "FitAmpListBase::printAllAmps()\n====================";
306 
307  for(unsigned int i=0; i< this->size(); i++){
308  os << "\n\t" << getAmpPtr(i)->theBareDecay().oneLiner()
309  << " \t" << getAmpPtr(i)->getVal(evt)
310  << endl;
311  }
312 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual std::complex< double > getVal(IDalitzEvent &evt)
DecayTree theBareDecay() const
Definition: FitAmplitude.h:166
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
virtual unsigned int size() const

◆ printLargestAmp()

void FitAmpListBase::printLargestAmp ( IDalitzEvent evt,
std::ostream &  os = std::cout 
)
virtual

Reimplemented in FitAmpIncoherentSum, FitAmpIncoherentSumEvtGen, and FitAmpList.

Definition at line 265 of file FitAmpListBase.cpp.

265  {
266  bool dbthis=false;
267  if(size()==0){
268  os << "FitAmpListBase::printLargestAmp: list is empty" << endl;
269  return;
270  }
271 
272  double largestValue = -9999;
273  std::string largestName = "none";
274 
275  for(unsigned int i=0; i< this->size(); i++){
276  if(dbthis){
277  cout << "FitAmpListBase::printLargestAmp()"
278  << "\n > for " << getAmpPtr(i)->theBareDecay().oneLiner()
279  << "\n > I get " << getAmpPtr(i)->getVal(evt)
280  << endl;
281  }
282  double val = norm(getAmpPtr(i)->getVal(evt));
283  if(val > largestValue){
284  largestValue = val;
285  largestName = getAmpPtr(i)->name();
286  }
287  }
288  os << "largest amp for event " << evt
289  << "\n is " << largestName
290  << " with value " << largestValue
291  << endl;
292 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
std::string name() const
Definition: FitAmplitude.h:213
virtual std::complex< double > getVal(IDalitzEvent &evt)
DecayTree theBareDecay() const
Definition: FitAmplitude.h:166
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
virtual unsigned int size() const

◆ printNonZero()

void FitAmpListBase::printNonZero ( std::ostream &  os = std::cout) const
virtual

Reimplemented in FitAmpSum, FitAmpIncoherentSum, FitAmpIncoherentSumEvtGen, FitAmpList, and MultiTopHat.

Definition at line 358 of file FitAmpListBase.cpp.

358  {
359  os << "FitAmpListBase::printNonZero\n====================";
360 
361  for(unsigned int i=0; i< this->size(); i++){
362  if(getAmpPtr(i)->isZero()) continue;
363  os << "\n\t" << getAmpPtr(i)->theBareDecay().oneLiner()
364  << endl;
365  }
366 }
bool isZero() const
Definition: FitAmplitude.h:98
virtual FitAmplitude * getAmpPtr(unsigned int i)
DecayTree theBareDecay() const
Definition: FitAmplitude.h:166
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
virtual unsigned int size() const

◆ printNonZeroWithValue()

void FitAmpListBase::printNonZeroWithValue ( IDalitzEvent evt,
std::ostream &  os = std::cout 
)
virtual

Reimplemented in FitAmpList.

Definition at line 331 of file FitAmpListBase.cpp.

331  {
332  bool dbThis=false;
333  if(size() == 0){
334  os << "FitAmpListBase::printNonZeroWithValue: list is empty" << endl;
335  return;
336  }
337 
338  std::string largestName = "none";
339  if(dbThis) cout << "Debug mode for FitAmpListBase::printAllAmps" << endl;
340 
341  os << "FitAmpListBase::printNonZeroWithValue\n====================\n";
342 
343  for(unsigned int i=0; i < this->size(); i++){
344  if(getAmpPtr(i)->isZero()) continue;
345  os << "\t" << getAmpPtr(i)->theBareDecay().oneLiner()
346  << " \t" << getAmpPtr(i)->getVal(evt)
347  << endl;
348  }
349 }
bool isZero() const
Definition: FitAmplitude.h:98
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual std::complex< double > getVal(IDalitzEvent &evt)
DecayTree theBareDecay() const
Definition: FitAmplitude.h:166
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
virtual unsigned int size() const

◆ randomizePhaseStartVals()

void FitAmpListBase::randomizePhaseStartVals ( int  seed = 0)

Definition at line 512 of file FitAmpListBase.cpp.

512  {
513  TRandom3* r = new TRandom3(seed);
514 
515  for(unsigned int i=0; i< this->size(); i++){
516  //if(0 == getAmpPtr(i))continue;
517  double phase = r->Uniform(-pi,pi);
518  if(!(getAmpPtr(i)->FitAmpPhase().isConstant()))getAmpPtr(i)->FitAmpPhase().set( polar(getAmpPtr(i)->FitAmpPhase().getAmp(),phase) );
519  }
520 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
static const double pi
MINT::FitComplex & FitAmpPhase()
Definition: FitAmplitude.h:147
virtual void set(std::complex< double > z)=0
virtual unsigned int size() const

◆ randomizeStartVals()

void FitAmpListBase::randomizeStartVals ( int  seed = 0)

Definition at line 497 of file FitAmpListBase.cpp.

497  {
498  TRandom3* r = new TRandom3(seed);
499 
500  for(unsigned int i=0; i< this->size(); i++){
501  //if(0 == getAmpPtr(i))continue;
502  double mag = r->Uniform(0.,1.);
503  double re,im;
504  r->Circle(re,im,mag);
505  complex<double> c(re,im);
506  //getAmpPtr(i)->multiply(c);
507  if(!(getAmpPtr(i)->FitAmpPhase().isConstant()))getAmpPtr(i)->FitAmpPhase().set(c);
508  }
509 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
MINT::FitComplex & FitAmpPhase()
Definition: FitAmplitude.h:147
virtual void set(std::complex< double > z)=0
virtual unsigned int size() const

◆ setAllAmpsTo()

void FitAmpListBase::setAllAmpsTo ( const std::complex< double >  z)

Definition at line 368 of file FitAmpListBase.cpp.

368  {
369  for(unsigned int i=0; i< this->size(); i++){
370  getAmpPtr(i)->FitAmpPhase().set(z);
371  }
372 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
MINT::FitComplex & FitAmpPhase()
Definition: FitAmplitude.h:147
virtual void set(std::complex< double > z)=0
virtual unsigned int size() const

◆ setEfficiency()

void FitAmpListBase::setEfficiency ( const MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > &  eff)

Definition at line 453 of file FitAmpListBase.cpp.

453  {
454  _efficiency=eff;
455 }
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency

◆ setLSameFitParameters()

bool FitAmpListBase::setLSameFitParameters ( int  L)
virtual

Definition at line 179 of file FitAmpListBase.cpp.

179  {
180  bool dbThis=false;
181  if(dbThis) cout << "FitAmpListBase::setLSameFitParameters()" << endl;
182 
183  bool success=true;
184  for(unsigned int i=0; i< this->size(); i++){
185  success &= getAmpPtr(i)->setLSameFitParameters(L);
186  }
187  return success;
188 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
bool setLSameFitParameters(int L)
virtual unsigned int size() const

◆ setTag()

void FitAmpListBase::setTag ( int  tag)

Definition at line 522 of file FitAmpListBase.cpp.

522  {
523  for(unsigned int i=0; i< this->size(); i++){
524  this->getAmpPtr(i)->setTag(tag);
525  }
526 }
virtual FitAmplitude * getAmpPtr(unsigned int i)
void setTag(int tag)
Definition: FitAmplitude.h:128
virtual unsigned int size() const

◆ size()

unsigned int FitAmpListBase::size ( ) const
virtual

Definition at line 109 of file FitAmpListBase.cpp.

109  {
110  unsigned int sz(_fitAmps.size());
111  for(unsigned int i=0; i < _fitAmpLists.size(); i++){
112  sz += _fitAmpLists[i]->size();
113  }
114  return sz;
115 }
std::vector< FitAmplitude * > _fitAmps
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists

Friends And Related Function Documentation

◆ FitAmplitude

friend class FitAmplitude
friend

Definition at line 145 of file FitAmpListBase.h.

Member Data Documentation

◆ _efficiency

MINT::counted_ptr<MINT::IReturnRealForEvent<IDalitzEvent> > FitAmpListBase::_efficiency
protected

Definition at line 35 of file FitAmpListBase.h.

◆ _fitAmpLists

std::vector<MINT::counted_ptr<FitAmpListBase> > FitAmpListBase::_fitAmpLists
protected

Definition at line 30 of file FitAmpListBase.h.

◆ _fitAmps

std::vector<FitAmplitude*> FitAmpListBase::_fitAmps
protected

Definition at line 29 of file FitAmpListBase.h.


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