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

#include <FitAmpList.h>

Inheritance diagram for FitAmpList:
FitAmpListBase FitAmpIncoherentSum FitAmpIncoherentSumEvtGen FitAmpSum

Public Member Functions

 FitAmpList (const DalitzEventPattern &pat, const char *fname=0, MINT::MinuitParameterSet *pset=0, const std::string &prefix="", const std::string &lineshapePrefix="", const std::string &opt="")
 
 FitAmpList (const DalitzEventPattern &pat, MINT::MinuitParameterSet *pset, const std::string &prefix="", const std::string &lineshapePrefix="", const std::string &opt="")
 
 FitAmpList (const DalitzEventPattern &pat, const std::string &prefix, const std::string &lineshapePrefix="", const std::string &opt="")
 
 FitAmpList (const FitAmpList &other)
 
virtual MINT::MinuitParameterSetgetMPS ()
 
virtual MINT::counted_ptr< FitAmpListBaseGetCPConjugateSameFitParameters () const
 
virtual MINT::counted_ptr< FitAmpListBaseGetCloneSameFitParameters () const
 
virtual bool createAllAmps (const DalitzEventPattern &thePattern, const std::string &prefix="", const std::string &lineshapePrefix="")
 
virtual bool createAmpsFromFile ()
 
virtual ~FitAmpList ()
 
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
 
FitAmpListoperator *= (double r)
 
FitAmpListoperator *= (const std::complex< double > &z)
 
FitAmpListoperator *= (const MINT::counted_ptr< MINT::IReturnComplex > &irc)
 
FitAmpList operator * (double r) const
 
FitAmpList operator * (const std::complex< double > &z) const
 
FitAmpList operator * (const MINT::counted_ptr< MINT::IReturnComplex > &irc) const
 
FitAmpListoperator= (const FitAmpList &other)
 
FitAmpListoperator+= (const FitAmpList &other)
 
FitAmpList operator+ (const FitAmpList &other) const
 
- Public Member Functions inherited from FitAmpListBase
 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 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< 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 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 Attributes

DalitzEventPattern _pat
 
std::string _paraFName
 
MINT::MinuitParameterSet_minuitParaSet
 
std::string _opt
 
- Protected Attributes inherited from FitAmpListBase
std::vector< FitAmplitude * > _fitAmps
 
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists
 
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency
 

Friends

class FitAmplitude
 

Additional Inherited Members

- Protected Member Functions inherited from FitAmpListBase
virtual void deleteAll ()
 

Detailed Description

Definition at line 29 of file FitAmpList.h.

Constructor & Destructor Documentation

◆ FitAmpList() [1/4]

FitAmpList::FitAmpList ( const DalitzEventPattern pat,
const char *  fname = 0,
MINT::MinuitParameterSet pset = 0,
const std::string &  prefix = "",
const std::string &  lineshapePrefix = "",
const std::string &  opt = "" 
)

Definition at line 19 of file FitAmpList.cpp.

26  : FitAmpListBase()
27  , _pat(pat)
28  , _minuitParaSet(pset)
29  , _opt(opt)
30 {
31  if(0 != fname){
32  _paraFName = fname;
33  }else{
34  _paraFName.clear();
35  }
36 
37  createAllAmps(pat, prefix, lineshapePrefix);
38 }
std::string _opt
Definition: FitAmpList.h:37
DalitzEventPattern _pat
Definition: FitAmpList.h:32
std::string _paraFName
Definition: FitAmpList.h:33
virtual bool createAllAmps(const DalitzEventPattern &thePattern, const std::string &prefix="", const std::string &lineshapePrefix="")
Definition: FitAmpList.cpp:125
MINT::MinuitParameterSet * _minuitParaSet
Definition: FitAmpList.h:35

◆ FitAmpList() [2/4]

FitAmpList::FitAmpList ( const DalitzEventPattern pat,
MINT::MinuitParameterSet pset,
const std::string &  prefix = "",
const std::string &  lineshapePrefix = "",
const std::string &  opt = "" 
)

Definition at line 40 of file FitAmpList.cpp.

46  : FitAmpListBase()
47  , _pat(pat)
48  , _minuitParaSet(pset)
49  , _opt(opt)
50 {
51 
52  cout << "pset pointer in FitAmpList::FitAmpList " << getMPS() << endl;
53 
54  _paraFName.clear();
55 
56  createAllAmps(pat, prefix, lineshapePrefix);
57 }
std::string _opt
Definition: FitAmpList.h:37
DalitzEventPattern _pat
Definition: FitAmpList.h:32
virtual MINT::MinuitParameterSet * getMPS()
Definition: FitAmpList.cpp:95
std::string _paraFName
Definition: FitAmpList.h:33
virtual bool createAllAmps(const DalitzEventPattern &thePattern, const std::string &prefix="", const std::string &lineshapePrefix="")
Definition: FitAmpList.cpp:125
MINT::MinuitParameterSet * _minuitParaSet
Definition: FitAmpList.h:35

◆ FitAmpList() [3/4]

FitAmpList::FitAmpList ( const DalitzEventPattern pat,
const std::string &  prefix,
const std::string &  lineshapePrefix = "",
const std::string &  opt = "" 
)

Definition at line 58 of file FitAmpList.cpp.

63  : FitAmpListBase()
64  , _pat(pat)
65  , _minuitParaSet(0)
66  , _opt(opt)
67 {
68 
69  _paraFName.clear();
70 
71  createAllAmps(pat, prefix, lineshapePrefix);
72 }
std::string _opt
Definition: FitAmpList.h:37
DalitzEventPattern _pat
Definition: FitAmpList.h:32
std::string _paraFName
Definition: FitAmpList.h:33
virtual bool createAllAmps(const DalitzEventPattern &thePattern, const std::string &prefix="", const std::string &lineshapePrefix="")
Definition: FitAmpList.cpp:125
MINT::MinuitParameterSet * _minuitParaSet
Definition: FitAmpList.h:35

◆ FitAmpList() [4/4]

FitAmpList::FitAmpList ( const FitAmpList other)

Definition at line 74 of file FitAmpList.cpp.

75  : FitAmpListBase(other)
76  , _pat(other._pat)
77  , _paraFName(other._paraFName)
79  , _opt(other._opt)
80 {
81 }
std::string _opt
Definition: FitAmpList.h:37
DalitzEventPattern _pat
Definition: FitAmpList.h:32
std::string _paraFName
Definition: FitAmpList.h:33
MINT::MinuitParameterSet * _minuitParaSet
Definition: FitAmpList.h:35

◆ ~FitAmpList()

FitAmpList::~FitAmpList ( )
virtual

Definition at line 253 of file FitAmpList.cpp.

253  {
254  bool dbThis=false;
255  if(dbThis) cout << "FitAmpList::~FitAmpList()" << endl;
256  deleteAll();
257  if(dbThis) cout << "FitAmpList::~FitAmpList() done" << endl;
258 }
virtual void deleteAll()

Member Function Documentation

◆ createAllAmps()

bool FitAmpList::createAllAmps ( const DalitzEventPattern thePattern,
const std::string &  prefix = "",
const std::string &  lineshapePrefix = "" 
)
virtual

Definition at line 125 of file FitAmpList.cpp.

128  {
129  bool dbThis=false;
130 
131  // cout << "pset pointer in FitAmpList::createAllAmps " << getMPS() << endl;
132 
134 
135  if(! ndl){
136  cout << "ERROR in FitAmpList::createAllAmps!"
137  << "\n > Can't get NamedDecayTreeList."
138  << endl;
139  return false;
140  }
141 
142  if(ndl->size() == 0){
143  cout << "ERROR in FitAmpList::createAllAmps!"
144  << "\n > NamedDecayTreeList is empty."
145  << endl;
146  return false;
147  }
148 
149  bool success=true;
150  const char* fnamePtr = 0;
151  if( ! _paraFName.empty()){
152  fnamePtr = _paraFName.c_str();
153  }
154  for(AmpInitMap::const_iterator it= ndl->trees(_opt).begin();
155  it != ndl->trees(_opt).end();
156  it++){
157 
158  const DecayTree& theTree = it->second.tree();
159  if(! thePattern.compatibleWith(theTree)) continue;
160  if(dbThis) cout << "making amplitude " << prefix + it->first << endl;
161 
162  if(A_is_in_B("TopHats", it->second.lopt())){
163  cout << "making TopHats" << endl;
164  NamedParameter<double> TopHatsLimits("TopHatsLimits");
165  if(TopHatsLimits.size() < 2){
166  cout << "error when setting TopHatsLimits: need at least 2 limits, have "
167  << TopHatsLimits.size() << endl;
168  continue;
169  }
170  MultiTopHat mth;
171  for( int i=1; i < TopHatsLimits.size(); i++){
172  double lo = TopHatsLimits.getVal(i-1);
173  double hi = TopHatsLimits.getVal(i);
174 
175  cout << "TopHatLimits: " << lo << ", " << hi << endl;
176  AmpInitialiser ai(it->second, prefix, lineshapePrefix);
177  ai.setNumOpts(lo, hi);
178  ai.setIndex(i);
179 
180  cout << "ai set " << endl;
181  //success &= addAmplitude(new FitAmplitude(prefix + it->first + "_" + anythingToString(i)
182 
183  FitAmplitude* famp(new FitAmplitude(ai
184  , fnamePtr
185  , getMPS()
186  )
187  );
188  if(! famp->canBeIgnored()){
189  if(dbThis) cout << "adding this: " << *famp << endl;
190  success &= mth.addAmplitude(famp);
191  }else{
192  if(dbThis) cout << "ignoring this: " << *famp << endl;
193  delete famp;
194  }
195  }
196  addAsList(mth);
197  }else{
198  if(dbThis)cout << "making a normal amplitude " << it->first << endl;
199  if(dbThis)cout << "with prefix: " << prefix << endl;
200  if(dbThis)cout << "lopt: " << it->second.lopt() << endl;
201  AmpInitialiser ai(it->second, prefix, lineshapePrefix);
202  if(dbThis)cout << "lopt2 " << ai.lopt() <<endl;
203  if(dbThis)cout << "at FitAmpList: lineshapePrefix " << lineshapePrefix << endl;
204  FitAmplitude* famp(new FitAmplitude( ai
205  , fnamePtr
206  , getMPS()
207  )
208  );
209  if(! famp->canBeIgnored()){
210  if(dbThis)cout << "adding this: " << *famp << endl;
211  success &= this->addAmplitude(famp);
212  }else{
213  if(dbThis) cout << "ignoring this: " << *famp << endl;
214  delete famp;
215  }
216  }
217  if(! success){
218  cout << "ERROR in FitAmpList::createAllAmps!"
219  << "\n > failed to create FitAmplitude"
220  << "\n > for decay name " << it->first
221  << "\n > \"new\" returned zero."
222  << "\n > I'll keep going and try to"
223  << "\n > create the other amplitudes."
224  << endl;
225  }
226 
227  }
228  return success;
229 }
friend class FitAmplitude
Definition: FitAmpList.h:102
virtual bool addAmplitude(FitAmplitude *fa)
bool compatibleWith(const DecayTree &tree) const
std::string _opt
Definition: FitAmpList.h:37
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
virtual MINT::MinuitParameterSet * getMPS()
Definition: FitAmpList.cpp:95
static NamedDecayTreeList * getMe(const std::string &printopt="printNever")
const AmpInitMap & trees(const std::string &opt="ALL") const
std::complex< double > getVal(IDalitzEvent &evt)
Definition: MultiTopHat.cpp:78
unsigned int size(const std::string &opt="ALL") const
std::string _paraFName
Definition: FitAmpList.h:33

◆ createAmpsFromFile()

virtual bool FitAmpList::createAmpsFromFile ( )
inlinevirtual

Definition at line 87 of file FitAmpList.h.

87 {return false;}// to be implemented later

◆ GetCloneSameFitParameters()

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

Reimplemented from FitAmpListBase.

Reimplemented in FitAmpSum, FitAmpIncoherentSum, and FitAmpIncoherentSumEvtGen.

Definition at line 100 of file FitAmpList.cpp.

100  {
101  bool dbThis=false;
102  if(dbThis) cout << "FitAmpList::GetCloneSameFitParameters()" << endl;
103  /*
104  There'll be 'physical' copies of all Amplitudes, but the
105  FitParameters remain the same (pointers to the same
106  FitParameter Object). This is useful for the CP-con coding
107  as it is now, but perhaps a bit counter-intuitive. needs to
108  be reviewed at some point. This behaviour is defined in the
109  copy constructor of the FitAmplitude class.
110  */
111 
112  counted_ptr<FitAmpList> newList(new FitAmpList(*this));
113  return newList;
114 }
FitAmpList(const DalitzEventPattern &pat, const char *fname=0, MINT::MinuitParameterSet *pset=0, const std::string &prefix="", const std::string &lineshapePrefix="", const std::string &opt="")
Definition: FitAmpList.cpp:19

◆ GetCPConjugateSameFitParameters()

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

Reimplemented from FitAmpListBase.

Definition at line 116 of file FitAmpList.cpp.

116  {
117  bool dbThis=false;
118  if(dbThis) cout << "FitAmpList::GetCPConjugateSameFitParameters()" << endl;
119 
121  newList->CPConjugateSameFitParameters();
122  return newList;
123 }
virtual bool CPConjugateSameFitParameters()
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const
Definition: FitAmpList.cpp:100

◆ getMPS()

MINT::MinuitParameterSet * FitAmpList::getMPS ( )
virtual

Definition at line 95 of file FitAmpList.cpp.

95  {
96  if(0 == _minuitParaSet) _minuitParaSet = MinuitParameterSet::getDefaultSet();
97  return _minuitParaSet;
98 }
MINT::MinuitParameterSet * _minuitParaSet
Definition: FitAmpList.h:35

◆ operator *() [1/3]

FitAmpList FitAmpList::operator * ( double  r) const

Definition at line 284 of file FitAmpList.cpp.

284  {
285  FitAmpList fas(*this);
286  fas.multiply(r);
287  return fas;
288 }

◆ operator *() [2/3]

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

◆ operator *() [3/3]

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

Definition at line 294 of file FitAmpList.cpp.

294  {
295  FitAmpList fas(*this);
296  fas.multiply(irc);
297  return fas;
298 }

◆ operator *=() [1/3]

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

Definition at line 271 of file FitAmpList.cpp.

271  {
272  multiply(r);
273  return *this;
274 }
virtual void multiply(double r)

◆ operator *=() [2/3]

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

◆ operator *=() [3/3]

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

Definition at line 279 of file FitAmpList.cpp.

279  {
280  multiply(irc);
281  return *this;
282 }
virtual void multiply(double r)

◆ operator+()

FitAmpList FitAmpList::operator+ ( const FitAmpList other) const

Definition at line 264 of file FitAmpList.cpp.

264  {
265  FitAmpList fas(*this);
266  fas.add(rhs);
267  return fas;
268 }

◆ operator+=()

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

Definition at line 260 of file FitAmpList.cpp.

260  {
261  add(other);
262  return *this;
263 }
virtual int add(const FitAmpListBase &other, double factor=1)

◆ operator=()

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

Definition at line 83 of file FitAmpList.cpp.

83  {
84  if(&other == this) return *this;
85 
86  (FitAmpListBase)(*this) = (FitAmpListBase) (other);
87  _pat = other._pat;
88  _paraFName = other._paraFName;
90  _opt = other._opt;
91  return *this;
92 }
std::string _opt
Definition: FitAmpList.h:37
DalitzEventPattern _pat
Definition: FitAmpList.h:32
std::string _paraFName
Definition: FitAmpList.h:33
MINT::MinuitParameterSet * _minuitParaSet
Definition: FitAmpList.h:35

◆ printAllAmps() [1/2]

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

Reimplemented from FitAmpListBase.

Definition at line 93 of file FitAmpList.h.

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

◆ printAllAmps() [2/2]

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

Reimplemented from FitAmpListBase.

Definition at line 239 of file FitAmpList.cpp.

239  {
240  bool dbThis=false;
241  if(_fitAmps.empty()) createAllAmps(evt.eventPattern());
243  (void)dbThis;
244 }
std::vector< FitAmplitude * > _fitAmps
virtual const DalitzEventPattern & eventPattern() const =0
virtual bool createAllAmps(const DalitzEventPattern &thePattern, const std::string &prefix="", const std::string &lineshapePrefix="")
Definition: FitAmpList.cpp:125
virtual void printAllAmps(std::ostream &os=std::cout) const

◆ printLargestAmp()

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

Reimplemented from FitAmpListBase.

Reimplemented in FitAmpIncoherentSum, and FitAmpIncoherentSumEvtGen.

Definition at line 231 of file FitAmpList.cpp.

231  {
232  bool dbthis=false;
233  if(_fitAmps.empty()) createAllAmps(evt.eventPattern());
235  (void)dbthis;
236 }
virtual void printLargestAmp(IDalitzEvent &evt, std::ostream &os=std::cout)
std::vector< FitAmplitude * > _fitAmps
virtual const DalitzEventPattern & eventPattern() const =0
virtual bool createAllAmps(const DalitzEventPattern &thePattern, const std::string &prefix="", const std::string &lineshapePrefix="")
Definition: FitAmpList.cpp:125

◆ printNonZero()

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

Reimplemented from FitAmpListBase.

Reimplemented in FitAmpSum, FitAmpIncoherentSum, and FitAmpIncoherentSumEvtGen.

Definition at line 98 of file FitAmpList.h.

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

◆ printNonZeroWithValue()

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

Reimplemented from FitAmpListBase.

Definition at line 246 of file FitAmpList.cpp.

246  {
247  bool dbThis=false;
248  if(_fitAmps.empty()) createAllAmps(evt.eventPattern());
250  (void)dbThis;
251 }
virtual void printNonZeroWithValue(IDalitzEvent &evt, std::ostream &os=std::cout)
std::vector< FitAmplitude * > _fitAmps
virtual const DalitzEventPattern & eventPattern() const =0
virtual bool createAllAmps(const DalitzEventPattern &thePattern, const std::string &prefix="", const std::string &lineshapePrefix="")
Definition: FitAmpList.cpp:125

Friends And Related Function Documentation

◆ FitAmplitude

friend class FitAmplitude
friend

Definition at line 102 of file FitAmpList.h.

Member Data Documentation

◆ _minuitParaSet

MINT::MinuitParameterSet* FitAmpList::_minuitParaSet
protected

Definition at line 35 of file FitAmpList.h.

◆ _opt

std::string FitAmpList::_opt
protected

Definition at line 37 of file FitAmpList.h.

◆ _paraFName

std::string FitAmpList::_paraFName
protected

Definition at line 33 of file FitAmpList.h.

◆ _pat

DalitzEventPattern FitAmpList::_pat
protected

Definition at line 32 of file FitAmpList.h.


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