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

#include <Amplitude.h>

Inheritance diagram for Amplitude:
MINT::IReturnComplexForEvent< IDalitzEvent > CachedByEvent< std::complex< double > > MINT::FitParDependent MINT::IFitParDependent MINT::IFitParRegister MINT::PolymorphVector< FitParRef > MINT::IFitParDependent

Public Member Functions

 Amplitude (const DecayTree &decay, const std::string &namePrefix="", const std::string &lineshapePrefix="", char SPD_Wave='?', const std::string &opt="", const std::vector< double > &numOpt=std::vector< double >(), IFitParRegister *daddy=0)
 
 Amplitude (const AmpInitialiser &ampInit, IFitParRegister *daddy=0)
 
 Amplitude (const Amplitude &other, IFitParRegister *newDaddy=0)
 
bool resetTree (const DecayTree &dt)
 
bool CPConjugate ()
 
bool CConjugateFinalState ()
 
bool CConjugateInitialState ()
 
bool setL (int L)
 
virtual std::complex< double > getVal (IDalitzEvent &evt)
 
virtual std::complex< double > getVal (IDalitzEvent *evt)
 
virtual std::complex< double > getNewVal (IDalitzEvent &evt)
 
double Prob (IDalitzEvent &evt)
 
virtual std::complex< double > ComplexVal (IDalitzEvent &evt)
 
const AssociatedDecayTreetheDecay (const DalitzEventPattern &pat) const
 
const AssociatedDecayTreetheDecay (IDalitzEvent &evt) const
 
void CheckAndMatchPattern (const DalitzEventPattern &pat) const
 
void CheckAndMatchPattern (IDalitzEvent &evt) const
 
DecayTree theBareDecay () const
 
DalitzEventPattern getTreePattern () const
 
std::string name () const
 
void print (std::ostream &out=std::cout) const
 
ISpinFactorspinFactor ()
 
virtual DalitzBoxSet MakeBox (const DalitzEventPattern &pat, const Permutation &perm, double nSigma=3)
 
virtual DalitzBoxSet MakeBoxes (const DalitzEventPattern &pat, double nSigma=3)
 
virtual DalitzBWBox MakeBWBox (const DalitzEventPattern &pat, const Permutation &perm, TRandom *rnd=gRandom)
 
virtual DalitzBWBoxSet MakeBWBoxes (const DalitzEventPattern &pat, TRandom *rnd=gRandom)
 
virtual ~Amplitude ()
 
- Public Member Functions inherited from MINT::IReturnComplexForEvent< IDalitzEvent >
virtual ~IReturnComplexForEvent ()
 
- Public Member Functions inherited from CachedByEvent< std::complex< double > >
 CachedByEvent ()
 
 CachedByEvent (const CachedByEvent &)
 
std::complex< double > getValWithCaching (IDalitzEvent &evt)
 
std::complex< double > getValWithCachingPermutation (IDalitzEvent &evt)
 
- Public Member Functions inherited from MINT::FitParDependent
virtual unsigned int size () const
 
virtual const FitParRefoperator[] (unsigned int i) const
 
virtual FitParRefoperator[] (unsigned int i)
 
virtual bool changedSinceLastCall () const
 
virtual void rememberFitParValues ()
 
virtual bool registerFitParDependence (const IFitParDependent &fpd)
 
bool registerFitParDependence (const FitParRef &fpr)
 
void removeAllFitParDependencies ()
 
 FitParDependent (IFitParRegister *daddy=0)
 
 FitParDependent (const FitParDependent &other, IFitParRegister *newDaddy=0)
 
void listFitParDependencies (std::ostream &os=std::cout) const
 
- Public Member Functions inherited from MINT::PolymorphVector< FitParRef >
 PolymorphVector ()
 
 PolymorphVector (unsigned int N)
 
 PolymorphVector (unsigned int N, const FitParRef &c)
 
 PolymorphVector (const PolymorphVector &other)
 
 PolymorphVector (const typename std::vector< FitParRef > &other)
 
virtual ~PolymorphVector ()
 
std::vector< FitParRef > & theVector ()
 
const std::vector< FitParRef > & theVector () const
 
FitParRefoperator[] (unsigned int i)
 
const FitParRefoperator[] (unsigned int i) const
 
FitParRefat (unsigned int i)
 
const FitParRefat (unsigned int i) const
 
std::vector< FitParRef >::iterator begin ()
 
std::vector< FitParRef >::const_iterator begin () const
 
std::vector< FitParRef >::iterator end ()
 
std::vector< FitParRef >::const_iterator end () const
 
std::vector< FitParRef >::iterator find (const FitParRef &c)
 
std::vector< FitParRef >::const_iterator find (const FitParRef &c) const
 
FitParReffront ()
 
const FitParReffront () const
 
FitParRefback ()
 
const FitParRefback () const
 
unsigned int size () const
 
bool empty () const
 
void push_back (const FitParRef &c)
 
void pop_back ()
 
void erase (typename std::vector< FitParRef >::iterator pos)
 
void erase (typename std::vector< FitParRef >::iterator first, typename std::vector< FitParRef >::iterator last)
 
PolymorphVector< FitParRef > & operator= (const PolymorphVector< FitParRef > &other)
 
void clear ()
 
void resize (unsigned int N)
 
void resize (unsigned int N, const FitParRef &c)
 
 operator const typename std::vector< FitParRef > & () const
 
 operator typename std::vector< FitParRef > & ()
 
bool operator== (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator!= (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator< (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator> (const MINT::PolymorphVector< FitParRef > &v2) const
 

Protected Member Functions

const std::string & prefix () const
 
std::string & prefix ()
 
const std::string & lsPrefix () const
 
std::string & lsPrefix ()
 
bool addLineshape (ILineshape *ls)
 
virtual double boxFactor ()
 
bool createLineshapes (const MINT::const_counted_ptr< AssociatedDecayTree > &counted_tree_ptr)
 
bool createLineshapes (const AssociatedDecayTree *treePtr=0)
 
bool deleteLineshapes ()
 
bool deleteDependants ()
 
bool createDependants ()
 
bool renew ()
 
bool initialised () const
 
bool initialise (const DalitzEventPattern &pat)
 
bool initialiseIfNeeded (const DalitzEventPattern &pat)
 
std::complex< double > LineshapeProduct (IDalitzEvent &evt)
 
std::complex< double > SpinFactorValue (IDalitzEvent &evt)
 
std::complex< double > getOnePermutationsVal (IDalitzEvent &evt)
 
- Protected Member Functions inherited from MINT::IReturnComplexForEvent< IDalitzEvent >
 IReturnComplexForEvent ()
 
- Protected Member Functions inherited from CachedByEvent< std::complex< double > >
long int rememberNumber ()
 
long int rememberNumberPermutation (IDalitzEvent &evt)
 
long int configNumber ()
 
std::complex< double > recalculate (IDalitzEvent &evt)
 
std::complex< double > recalculatePermutation (IDalitzEvent &evt)
 

Protected Attributes

AssociatingDecayTree _associatingDecayTree
 
ISpinFactor_spinFactor
 
std::string _prefix
 
std::string _lsPrefix
 
char _spd
 
std::string _lopt
 
std::vector< double > _numOpts
 
DalitzEventPattern _pat
 
bool _init
 
std::vector< ILineshape * > _LineshapeList
 
- Protected Attributes inherited from CachedByEvent< std::complex< double > >
long int _rememberNumber
 
std::vector< long int > _rememberNumberPermutation
 
long int _configNumber
 
- Protected Attributes inherited from MINT::PolymorphVector< FitParRef >
std::vector< FitParRef_vec
 

Friends

class FitAmplitude
 

Detailed Description

Definition at line 40 of file Amplitude.h.

Constructor & Destructor Documentation

◆ Amplitude() [1/3]

Amplitude::Amplitude ( const DecayTree decay,
const std::string &  namePrefix = "",
const std::string &  lineshapePrefix = "",
char  SPD_Wave = '?',
const std::string &  opt = "",
const std::vector< double > &  numOpt = std::vector< double >(),
IFitParRegister *  daddy = 0 
)

◆ Amplitude() [2/3]

Amplitude::Amplitude ( const AmpInitialiser ampInit,
IFitParRegister *  daddy = 0 
)

◆ Amplitude() [3/3]

Amplitude::Amplitude ( const Amplitude other,
IFitParRegister *  newDaddy = 0 
)

◆ ~Amplitude()

Amplitude::~Amplitude ( )
virtual

Definition at line 74 of file Amplitude.cpp.

74  {
76 }
bool deleteDependants()
Definition: Amplitude.cpp:78

Member Function Documentation

◆ addLineshape()

bool Amplitude::addLineshape ( ILineshape ls)
protected

Definition at line 148 of file Amplitude.cpp.

148  {
149  if(0 == lsPtr) return false;
150  this->registerFitParDependence(*lsPtr);
151  _LineshapeList.push_back(lsPtr);
152  return true;
153 }
std::vector< ILineshape * > _LineshapeList
Definition: Amplitude.h:58
virtual bool registerFitParDependence(const IFitParDependent &fpd)

◆ boxFactor()

virtual double Amplitude::boxFactor ( )
inlineprotectedvirtual

Definition at line 68 of file Amplitude.h.

68 { return 1;}

◆ CConjugateFinalState()

bool Amplitude::CConjugateFinalState ( )

Definition at line 129 of file Amplitude.cpp.

129  {
130  DecayTree dt = theBareDecay();
131  anti(dt);
132  dt.getVal().antiThis();
133  return resetTree(dt);
134 }
void anti(DecayTree &dt)
Definition: DecayTree.cpp:16
const ValueType & getVal() const
Definition: DDTree.h:102
bool resetTree(const DecayTree &dt)
Definition: Amplitude.cpp:117
DecayTree theBareDecay() const
Definition: Amplitude.h:157

◆ CConjugateInitialState()

bool Amplitude::CConjugateInitialState ( )

Definition at line 136 of file Amplitude.cpp.

136  {
137  DecayTree dt = theBareDecay();
138  dt.getVal().antiThis();
139  return resetTree(dt);
140 }
const ValueType & getVal() const
Definition: DDTree.h:102
bool resetTree(const DecayTree &dt)
Definition: Amplitude.cpp:117
DecayTree theBareDecay() const
Definition: Amplitude.h:157

◆ CheckAndMatchPattern() [1/2]

void Amplitude::CheckAndMatchPattern ( const DalitzEventPattern pat) const
inline

Definition at line 149 of file Amplitude.h.

149  {
150  theDecay(pat);// happens automatically, here.
151  }
const AssociatedDecayTree & theDecay(const DalitzEventPattern &pat) const
Definition: Amplitude.h:143

◆ CheckAndMatchPattern() [2/2]

void Amplitude::CheckAndMatchPattern ( IDalitzEvent evt) const
inline

Definition at line 152 of file Amplitude.h.

152  {
154  }
virtual const DalitzEventPattern & eventPattern() const =0
void CheckAndMatchPattern(const DalitzEventPattern &pat) const
Definition: Amplitude.h:149

◆ ComplexVal()

virtual std::complex<double> Amplitude::ComplexVal ( IDalitzEvent evt)
inlinevirtual

Implements MINT::IReturnComplexForEvent< IDalitzEvent >.

Definition at line 141 of file Amplitude.h.

141 {return getVal(evt);}
virtual std::complex< double > getVal(IDalitzEvent &evt)
Definition: Amplitude.h:122

◆ CPConjugate()

bool Amplitude::CPConjugate ( )

Definition at line 123 of file Amplitude.cpp.

123  {
124  DecayTree dt = theBareDecay();
125  anti(dt);
126  return resetTree(dt);
127 }
void anti(DecayTree &dt)
Definition: DecayTree.cpp:16
bool resetTree(const DecayTree &dt)
Definition: Amplitude.cpp:117
DecayTree theBareDecay() const
Definition: Amplitude.h:157

◆ createDependants()

bool Amplitude::createDependants ( )
protected

Definition at line 89 of file Amplitude.cpp.

89  {
90  bool dbThis=false;
91  if(dbThis){
92  cout << "Amplitude::createDependants, for " << name()
93  << ". Calling SpinFactorMake with _spd = " << _spd
94  << " and _lopt = " << _lopt << endl;
95  }
96  //_spinFactor = SpinFactorMaker(theBareDecay(), _spd, _lopt);
98  if(dbThis) cout << "got this spin factor: " << _spinFactor->name() << endl;
99  if(0 == _spinFactor) return false;
100  bool cl = createLineshapes();
101 
102  cout << "Amplitude::createDependants() after creating lineshape, I depend on these fitParameters:"
103  << endl;
104  this->listFitParDependencies(cout);
105 
106  if(0 == cl) return false;
107  return true;
108 }
std::string name() const
Definition: Amplitude.cpp:446
DalitzEventPattern _pat
Definition: Amplitude.h:55
virtual std::string name() const =0
char _spd
Definition: Amplitude.h:51
bool createLineshapes(const MINT::const_counted_ptr< AssociatedDecayTree > &counted_tree_ptr)
Definition: Amplitude.cpp:155
const AssociatedDecayTree & theDecay(const DalitzEventPattern &pat) const
Definition: Amplitude.h:143
std::string _lopt
Definition: Amplitude.h:52
ISpinFactor * _spinFactor
Definition: Amplitude.h:48
ISpinFactor * SpinFactorMaker(const AssociatedDecayTree &thisDcy, char SPD_Wave='?', const std::string &lopt="")
void listFitParDependencies(std::ostream &os=std::cout) const

◆ createLineshapes() [1/2]

bool Amplitude::createLineshapes ( const MINT::const_counted_ptr< AssociatedDecayTree > &  counted_tree_ptr)
protected

Definition at line 155 of file Amplitude.cpp.

156  {
157  return createLineshapes(counted_tree_ptr.get());
158 }
const X * get() const
Definition: counted_ptr.h:217
bool createLineshapes(const MINT::const_counted_ptr< AssociatedDecayTree > &counted_tree_ptr)
Definition: Amplitude.cpp:155

◆ createLineshapes() [2/2]

bool Amplitude::createLineshapes ( const AssociatedDecayTree treePtr = 0)
protected

Definition at line 159 of file Amplitude.cpp.

159  {
160  bool dbThis=false;
161  if(0==treePtr) {
162  /*
163  cout << "Amplitude::createLineshapes for treePtr: \n"
164  << theDecay()
165  << "\n first call in recursive operation" << endl;
166  */
167  if(_pat.empty()){
168  cout << "Amplitude::createLineshapes: cannot create line-shapes"
169  << " unless _pat is set. Bailing out."
170  << endl;
171  throw "no lineshapes without pattern";
172  }
173  return createLineshapes(& theDecay(_pat));
174  }
175  // cout << " >> " << treePtr->oneLiner() << endl;
176 
177  bool success=true;
178  if(treePtr->nDgtr() >= 2){
180  // LineshapeList.push_back(LineshapeMaker(treePtr, _lopt));
181  if(dbThis){
182  cout << "Amplitude::createLineshapes: just added lineshape: ";
183  _LineshapeList.back()->print(cout);
184  cout << endl;
185  }
186  }
187  for(int i=0; i< treePtr->nDgtr(); i++){
188  success &= createLineshapes(treePtr->getDgtrTreePtr(i));
189  }
190  return success;
191 }
DalitzEventPattern _pat
Definition: Amplitude.h:55
bool createLineshapes(const MINT::const_counted_ptr< AssociatedDecayTree > &counted_tree_ptr)
Definition: Amplitude.cpp:155
std::vector< ILineshape * > _LineshapeList
Definition: Amplitude.h:58
const std::string & lsPrefix() const
Definition: Amplitude.h:62
ILineshape * LineshapeMaker(const AssociatedDecayTree *tree, const std::string &lineshapePrefix, const std::string &lopt, const std::vector< double > &numOptions=std::vector< double >())
bool addLineshape(ILineshape *ls)
Definition: Amplitude.cpp:148
MINT::const_counted_ptr< DDTree< ValueType > > getDgtrTreePtr(int i) const
Definition: DDTree.h:114
std::vector< double > _numOpts
Definition: Amplitude.h:53
const AssociatedDecayTree & theDecay(const DalitzEventPattern &pat) const
Definition: Amplitude.h:143
std::string _lopt
Definition: Amplitude.h:52
int nDgtr() const
Definition: DDTree.h:96

◆ deleteDependants()

bool Amplitude::deleteDependants ( )
protected

Definition at line 78 of file Amplitude.cpp.

78  {
79  bool dbThis=false;
80  if(dbThis) cout << "Amplitude::deleteDependants()" << endl;
81  _init=false;
82  this->removeAllFitParDependencies(); // risky
84  if(0 != _spinFactor) delete _spinFactor;
85  _spinFactor=0;
86  if(dbThis) cout << "Amplitude::deleteDependants() done" << endl;
87  return true;
88 }
bool _init
Definition: Amplitude.h:56
bool deleteLineshapes()
Definition: Amplitude.cpp:192
ISpinFactor * _spinFactor
Definition: Amplitude.h:48

◆ deleteLineshapes()

bool Amplitude::deleteLineshapes ( )
protected

Definition at line 192 of file Amplitude.cpp.

192  {
193  bool dbThis=false;
194  if(dbThis) cout << "Amplitude::deleteLineshapes()" << endl;
195  for(std::vector<ILineshape*>::iterator it = _LineshapeList.begin();
196  it != _LineshapeList.end(); it++){
197  if(0 != *it) delete (*it);
198  }
199  _LineshapeList.clear();
200 
201  if(dbThis) cout << "Amplitude::deleteLineshapes() done" << endl;
202  return true;
203 }
std::vector< ILineshape * > _LineshapeList
Definition: Amplitude.h:58

◆ getNewVal()

std::complex< double > Amplitude::getNewVal ( IDalitzEvent evt)
virtual

Implements CachedByEvent< std::complex< double > >.

Definition at line 401 of file Amplitude.cpp.

401  {
402  //bool dbThis=false;
403 
404  //initialiseIfNeeded(evt.eventPattern());
406  complex<double> sum=0;
407 
408  //if(! evt.eventPattern().compatibleWithFinalState(getTreePattern())) return 0;
409 
410 // if(dbThis) cout << "num permutations: " << evt.numPermutations() << endl;
411  for(int i=0; i < evt.numPermutations(); i++){
412  evt.setPermutationIndex(i);
413  //complex<double> thisVal= getOnePermutationsVal(evt);
414 
415 /* if(dbThis){
416  cout << " permutation " << i
417  << " makes event look like this: ";
418  evt.print();
419  cout << "\n gets thisVal " << thisVal << endl;
420  }*/
421 
422  sum += getOnePermutationsVal(evt);
423  }
424  evt.setPermutationIndex(0);
425  sum /= sqrt((double) evt.numPermutations());
426 
427 // if(dbThis) cout << "returning " << sum << endl;
428  /*
429  if(dbThis && abs(sum) > sqrt((double) 1000)){
430  cout << " Amplitude : " << (*this)
431  << " returning a large value: " << sum
432  << endl;
433  }
434 
435  if(dbThis){
436  cout << "Amplitude::getVal() for "
437  << name() << endl;
438  cout << " returning " << sum << endl;
439  cout << "==========================================" << endl;
440  }
441  */
442  return sum;
443 }
std::complex< double > getOnePermutationsVal(IDalitzEvent &evt)
Definition: Amplitude.cpp:366
virtual void setPermutationIndex(int i)=0
virtual int numPermutations() const =0
void CheckAndMatchPattern(const DalitzEventPattern &pat) const
Definition: Amplitude.h:149

◆ getOnePermutationsVal()

std::complex< double > Amplitude::getOnePermutationsVal ( IDalitzEvent evt)
protected

Definition at line 366 of file Amplitude.cpp.

366  {
367  //bool dbThis=false;
368 
369  std::complex<double> sf = SpinFactorValue(evt);
370  complex<double> ls = LineshapeProduct(evt);
371 
372  /*
373  complex<double> returnVal = sf*ls;
374  if(dbThis){
375  //if(LineshapeList.size() >=2){
376  // complex<double> evtGen = LineshapeList[1]->EvtGenValue();
377  // complex<double> diff = returnVal - evtGen;
378  // if(abs(diff) > 1.e-10){
379  // cout << " EvtGenCheck: " << returnVal << " - " << evtGen
380  // << " = " << diff << endl;
381  // }
382  // }
383 
384  cout << theBareDecay().oneLiner() << ":"
385  << "\n > spinFactor " << sf
386  << "\n > LineshapeProduct " << ls
387  << "\n > Returning: " << returnVal
388  << endl;
389  cout << "-----------------------------------------" << endl;
390  }
391  return returnVal;
392  */
393  return sf*ls;
394 }
std::complex< double > SpinFactorValue(IDalitzEvent &evt)
Definition: Amplitude.cpp:205
std::complex< double > LineshapeProduct(IDalitzEvent &evt)
Definition: Amplitude.cpp:224

◆ getTreePattern()

DalitzEventPattern Amplitude::getTreePattern ( ) const
inline

Definition at line 161 of file Amplitude.h.

161  {
163  }
AssociatingDecayTree _associatingDecayTree
Definition: Amplitude.h:47
const DalitzEventPattern & getTreePattern() const

◆ getVal() [1/2]

virtual std::complex<double> Amplitude::getVal ( IDalitzEvent evt)
inlinevirtual

Definition at line 122 of file Amplitude.h.

122  {
123  //return getNewVal(evt);// (for debugging)
124  return getValWithCaching(evt);
125  }
std::complex< double > getValWithCaching(IDalitzEvent &evt)
Definition: CachedByEvent.h:66

◆ getVal() [2/2]

std::complex< double > Amplitude::getVal ( IDalitzEvent evt)
virtual

Definition at line 396 of file Amplitude.cpp.

396  {
397  if(0 == evt) return 0;
398  return this->getVal(*evt);
399 }
virtual std::complex< double > getVal(IDalitzEvent &evt)
Definition: Amplitude.h:122

◆ initialise()

bool Amplitude::initialise ( const DalitzEventPattern pat)
inlineprotected

Definition at line 85 of file Amplitude.h.

85  {
86  _pat = pat;
87  return renew();
88  }
DalitzEventPattern _pat
Definition: Amplitude.h:55
bool renew()
Definition: Amplitude.cpp:109

◆ initialised()

bool Amplitude::initialised ( ) const
inlineprotected

Definition at line 80 of file Amplitude.h.

80  {
81  if(! _init) return false;
82  if(_pat.empty()) return false;
83  return true;
84  }
DalitzEventPattern _pat
Definition: Amplitude.h:55
bool _init
Definition: Amplitude.h:56

◆ initialiseIfNeeded()

bool Amplitude::initialiseIfNeeded ( const DalitzEventPattern pat)
inlineprotected

Definition at line 89 of file Amplitude.h.

89  {
90  if(initialised()) return true;
91  return initialise(pat);
92  }
bool initialised() const
Definition: Amplitude.h:80
bool initialise(const DalitzEventPattern &pat)
Definition: Amplitude.h:85

◆ LineshapeProduct()

std::complex< double > Amplitude::LineshapeProduct ( IDalitzEvent evt)
protected

Definition at line 224 of file Amplitude.cpp.

224  {
225  //bool dbThis=false;
226  std::complex<double> prod(1.,0.);
227  /*
228  if(dbThis){
229  cout << "Amplitude::LineshapeProduct() for " << name() << endl;
230  cout << " ...calling lineshapes: " << endl;
231  }
232  */
233  for(std::vector<ILineshape*>::iterator it = _LineshapeList.begin();
234  it != _LineshapeList.end(); it++){
235  //if(dbThis && 0 != *it) cout << (*it)->name() << ", " << (*it)->getVal(evt);
236  if(0 != *it) prod *= (*it)->getVal(evt);
237  }
238  //if(dbThis) cout << " done. Returning " << prod << endl;
239  return prod;
240 }
std::vector< ILineshape * > _LineshapeList
Definition: Amplitude.h:58

◆ lsPrefix() [1/2]

const std::string& Amplitude::lsPrefix ( ) const
inlineprotected

Definition at line 62 of file Amplitude.h.

62 {return _lsPrefix;}
std::string _lsPrefix
Definition: Amplitude.h:50

◆ lsPrefix() [2/2]

std::string& Amplitude::lsPrefix ( )
inlineprotected

Definition at line 63 of file Amplitude.h.

63 {return _lsPrefix;}
std::string _lsPrefix
Definition: Amplitude.h:50

◆ MakeBox()

DalitzBoxSet Amplitude::MakeBox ( const DalitzEventPattern pat,
const Permutation perm,
double  nSigma = 3 
)
virtual

Definition at line 255 of file Amplitude.cpp.

258  {
259  cout << "making box for " << (*this) << endl;
260  DalitzBoxSet v;
261  double maxHeight = 1;// norm(this->getValAtResonance());
262  double maxHeight_2 = maxHeight;
263  if(_LineshapeList.size() >= 2){
264  maxHeight_2 *= exp(-0.5*(nSigma*nSigma*0.75));
265  }
266  std::vector<DalitzCoordinate> limits;
267  for(std::vector<ILineshape*>::iterator it = _LineshapeList.begin();
268  it != _LineshapeList.end(); it++){
269  DalitzCoordinate coord ((*it)->getDalitzCoordinate(nSigma).mapMe(perm) );
270  if(coord.size() <= 3){ // otherwise it's the D itself
271  DalitzBox box(pat, coord);
272  box.setName(this->theBareDecay().oneLiner()
273  + " limit: " + coord.name()
274  + " " + anythingToString((int)nSigma) + " sigma");
275  box.encloseInPhaseSpaceArea();
276  box.setGuessedHeight(maxHeight_2);
277  v.push_back(box);
278 
279  limits.push_back( coord );
280  }
281  }
282  DalitzBox lastBox(pat, limits);
283  lastBox.setGuessedHeight(1);//norm(this->getValAtResonance()));
284  cout << " just set box height, it's " << lastBox.guessedHeight() << endl;
285  lastBox.setName(this->theBareDecay().oneLiner()
286  + " all limits"
287  + " " + anythingToString((int)nSigma) + " sigma");
288  cout << " .. now it is " << lastBox.guessedHeight() << endl;
289  lastBox.encloseInPhaseSpaceArea();
290  cout << "Amp " << name() << " made box with guessed height "
291  << 1//norm(1)//this->getValAtResonance())
292  << " = " << lastBox.guessedHeight()
293  << "\n that's the one" << lastBox
294  << endl;
295  v.push_back(lastBox);
296  return v;
297 }
std::string name() const
Definition: Amplitude.cpp:446
void push_back(const T &c)
std::vector< ILineshape * > _LineshapeList
Definition: Amplitude.h:58
std::string anythingToString(const T &anything)
Definition: Utils.h:62
DecayTree theBareDecay() const
Definition: Amplitude.h:157

◆ MakeBoxes()

DalitzBoxSet Amplitude::MakeBoxes ( const DalitzEventPattern pat,
double  nSigma = 3 
)
virtual

Definition at line 242 of file Amplitude.cpp.

243  {
244  Permutator perms(pat);
245  DalitzBoxSet v;
246 
247 
248  for(unsigned int i=0; i < perms.size(); i++){
249  v.add(MakeBox(pat, perms[i], nSigma));
250  }
251 
252  return v;
253 }
virtual DalitzBoxSet MakeBox(const DalitzEventPattern &pat, const Permutation &perm, double nSigma=3)
Definition: Amplitude.cpp:255
void add(const DalitzBox &box)

◆ MakeBWBox()

DalitzBWBox Amplitude::MakeBWBox ( const DalitzEventPattern pat,
const Permutation perm,
TRandom *  rnd = gRandom 
)
virtual

Definition at line 321 of file Amplitude.cpp.

324  {
325  bool dbThis=false;
326  if(dbThis) cout << "making bw-box for " << (*this) << endl;
327 
328  std::vector<counted_ptr<IGenFct> > limits;
329  for(std::vector<ILineshape*>::iterator it = _LineshapeList.begin();
330  it != _LineshapeList.end(); it++){
331  if(dbThis){
332  cout << "adding co-ordinate "
333  << (*it)->getDalitzCoordinate()
334  << " to box." << endl;
335  }
336  DalitzCoordinate coord ((*it)->getDalitzCoordinate().mapMe(perm) );
337  counted_ptr<IGenFct> fct( (*it)->generatingFunction() );
338  fct->setCoordinate(coord);
339  if((int) coord.size() < pat.numDaughters()){
340  // otherwise it's the D itself (coord.size is the number of
341  // indices in s_ij..)
342  // so s12 or s23 have 2, s123 has 3, s1234 has 4.)
343  limits.push_back(fct);
344  }
345  }
346  DalitzBWBox box(pat, limits, 0, rnd);
347  box.setName(this->theBareDecay().oneLiner()
348  + " BW");
349  return box;
350 }
virtual void setCoordinate(const DalitzCoordinate &c)=0
std::vector< ILineshape * > _LineshapeList
Definition: Amplitude.h:58
DecayTree theBareDecay() const
Definition: Amplitude.h:157

◆ MakeBWBoxes()

DalitzBWBoxSet Amplitude::MakeBWBoxes ( const DalitzEventPattern pat,
TRandom *  rnd = gRandom 
)
virtual

Definition at line 300 of file Amplitude.cpp.

302  {
303  bool dbThis=false;
304  Permutator perms(pat);
305  DalitzBWBoxSet v(rnd);
306 
307  for(unsigned int i=0; i < perms.size(); i++){
308  DalitzBWBox box(MakeBWBox(pat, perms[i], rnd));
309  box.height() = boxFactor()/perms.size();
310  if(dbThis){
311  cout << "setting boxHeight to " << box.height()
312  << " = " << boxFactor() << " / " << perms.size()
313  << endl;
314  }
315  v.add(box);
316  }
317 
318  return v;
319 }
virtual double boxFactor()
Definition: Amplitude.h:68
virtual DalitzBWBox MakeBWBox(const DalitzEventPattern &pat, const Permutation &perm, TRandom *rnd=gRandom)
Definition: Amplitude.cpp:321

◆ name()

std::string Amplitude::name ( ) const

Definition at line 446 of file Amplitude.cpp.

446  {
447  return (std::string) "("
448  + _spd
449  + " wave) with opt " + _lopt + "; "
450  + theBareDecay().oneLiner();
451 }
char _spd
Definition: Amplitude.h:51
std::string _lopt
Definition: Amplitude.h:52
void oneLiner(std::stringstream &seam, int generation=0) const
Definition: DDTree.h:375
DecayTree theBareDecay() const
Definition: Amplitude.h:157

◆ prefix() [1/2]

const std::string& Amplitude::prefix ( ) const
inlineprotected

Definition at line 60 of file Amplitude.h.

60 {return _prefix;}
std::string _prefix
Definition: Amplitude.h:49

◆ prefix() [2/2]

std::string& Amplitude::prefix ( )
inlineprotected

Definition at line 61 of file Amplitude.h.

61 {return _prefix;}
std::string _prefix
Definition: Amplitude.h:49

◆ print()

void Amplitude::print ( std::ostream &  out = std::cout) const

Definition at line 453 of file Amplitude.cpp.

453  {
454  out << "(" << _spd << " wave)\n" << theBareDecay();
455 }
char _spd
Definition: Amplitude.h:51
DecayTree theBareDecay() const
Definition: Amplitude.h:157

◆ Prob()

double Amplitude::Prob ( IDalitzEvent evt)
inline

Definition at line 133 of file Amplitude.h.

133  {
134  std::complex<double> res = getVal(evt);
135  return res.real()*res.real() + res.imag()*res.imag();
136  }
virtual std::complex< double > getVal(IDalitzEvent &evt)
Definition: Amplitude.h:122

◆ renew()

bool Amplitude::renew ( )
protected

Definition at line 109 of file Amplitude.cpp.

109  {
112  if(! _init){
113  cout << "ERROR: Amplitude::renew() failed" << endl;
114  }
115  return _init;
116 }
bool deleteDependants()
Definition: Amplitude.cpp:78
bool createDependants()
Definition: Amplitude.cpp:89
bool _init
Definition: Amplitude.h:56

◆ resetTree()

bool Amplitude::resetTree ( const DecayTree dt)

Definition at line 117 of file Amplitude.cpp.

117  {
118  AssociatingDecayTree newTree(dt);
119  _associatingDecayTree = newTree;
120  return renew();
121  //return deleteDependants();
122 }
AssociatingDecayTree _associatingDecayTree
Definition: Amplitude.h:47
bool renew()
Definition: Amplitude.cpp:109

◆ setL()

bool Amplitude::setL ( int  L)

Definition at line 142 of file Amplitude.cpp.

142  {
143  DecayTree dt = theBareDecay();
144  dt.getVal().setL(L);
145  return resetTree(dt);
146 }
const ValueType & getVal() const
Definition: DDTree.h:102
bool resetTree(const DecayTree &dt)
Definition: Amplitude.cpp:117
void setL(int l)
Definition: DecayTreeItem.h:61
DecayTree theBareDecay() const
Definition: Amplitude.h:157

◆ spinFactor()

ISpinFactor* Amplitude::spinFactor ( )
inline

Definition at line 169 of file Amplitude.h.

169  {
170  return _spinFactor;
171  }
ISpinFactor * _spinFactor
Definition: Amplitude.h:48

◆ SpinFactorValue()

std::complex< double > Amplitude::SpinFactorValue ( IDalitzEvent evt)
protected

Definition at line 205 of file Amplitude.cpp.

205  {
206  // bool dbThis=true;
207  /*
208  if(dbThis) {
209  cout << "amplitude " << name()
210  << " calling spin factor: "
211  << spinFactor()->name() << endl;
212  }
213  */
214  if(0 == spinFactor()) initialise(evt.eventPattern());
215  /*
216  if(dbThis){
217  cout << " spin factor value is: "
218  << spinFactor()->getVal(evt) << endl;
219  }
220  */
221  return spinFactor()->ComplexVal(evt);
222 }
ISpinFactor * spinFactor()
Definition: Amplitude.h:169
virtual std::complex< double > ComplexVal(IDalitzEvent &evt)=0
bool initialise(const DalitzEventPattern &pat)
Definition: Amplitude.h:85
virtual const DalitzEventPattern & eventPattern() const =0

◆ theBareDecay()

DecayTree Amplitude::theBareDecay ( ) const
inline

Definition at line 157 of file Amplitude.h.

157  {
159  }
DecayTree getBareTree() const
AssociatingDecayTree _associatingDecayTree
Definition: Amplitude.h:47

◆ theDecay() [1/2]

const AssociatedDecayTree& Amplitude::theDecay ( const DalitzEventPattern pat) const
inline

Definition at line 143 of file Amplitude.h.

143  {
144  return _associatingDecayTree.getTree(pat);
145  }
AssociatingDecayTree _associatingDecayTree
Definition: Amplitude.h:47
const AssociatedDecayTree & getTree(const DalitzEventPattern &pat) const

◆ theDecay() [2/2]

const AssociatedDecayTree& Amplitude::theDecay ( IDalitzEvent evt) const
inline

Definition at line 146 of file Amplitude.h.

146  {
148  }
AssociatingDecayTree _associatingDecayTree
Definition: Amplitude.h:47
const AssociatedDecayTree & getTree(const DalitzEventPattern &pat) const
virtual const DalitzEventPattern & eventPattern() const =0

Friends And Related Function Documentation

◆ FitAmplitude

friend class FitAmplitude
friend

Definition at line 194 of file Amplitude.h.

Member Data Documentation

◆ _associatingDecayTree

AssociatingDecayTree Amplitude::_associatingDecayTree
protected

Definition at line 47 of file Amplitude.h.

◆ _init

bool Amplitude::_init
protected

Definition at line 56 of file Amplitude.h.

◆ _LineshapeList

std::vector<ILineshape*> Amplitude::_LineshapeList
protected

Definition at line 58 of file Amplitude.h.

◆ _lopt

std::string Amplitude::_lopt
protected

Definition at line 52 of file Amplitude.h.

◆ _lsPrefix

std::string Amplitude::_lsPrefix
protected

Definition at line 50 of file Amplitude.h.

◆ _numOpts

std::vector<double> Amplitude::_numOpts
protected

Definition at line 53 of file Amplitude.h.

◆ _pat

DalitzEventPattern Amplitude::_pat
protected

Definition at line 55 of file Amplitude.h.

◆ _prefix

std::string Amplitude::_prefix
protected

Definition at line 49 of file Amplitude.h.

◆ _spd

char Amplitude::_spd
protected

Definition at line 51 of file Amplitude.h.

◆ _spinFactor

ISpinFactor* Amplitude::_spinFactor
protected

Definition at line 48 of file Amplitude.h.


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