24 : _efficiency(other._efficiency)
28 if(dbThis)cout <<
"copy-ctor FitAmpListBase, done deleteAll()" << endl;
42 : _efficiency(other._efficiency)
46 if(dbThis)cout <<
"copy-ctor FitAmpListBaseSubset, done deleteAll()" << endl;
60 if(&other ==
this)
return *
this;
74 if(1.0 != factor) newList->multiply(factor);
82 for(
unsigned int i=0; i < other.
_fitAmps.size(); i++){
85 if(1.0 != factor) newFa->
multiply(factor);
89 for(
unsigned int i=0; i < other.
_fitAmpLists.size(); i++){
96 for(
unsigned int i=0; i < other.
_fitAmps.size(); i++){
100 if(1.0 != factor) newFa->
multiply(factor);
103 for(
unsigned int i=0; i < other.
_fitAmpLists.size(); i++){
127 cout <<
" FitAmpListBase::getAmp index out of range" 141 cout <<
" FitAmpListBase::getAmp index out of range" 148 if(dbThis) cout <<
"FitAmpListBase::CPConjugateSameFitParameters()" << endl;
151 for(
unsigned int i=0; i< this->
size(); i++){
159 if(dbThis) cout <<
"FitAmpListBase::CConjugateFinalStateSameFitParameters()" << endl;
162 for(
unsigned int i=0; i< this->
size(); i++){
170 if(dbThis) cout <<
"FitAmpListBase::CConjugateFinalStateSameFitParameters()" << endl;
173 for(
unsigned int i=0; i< this->
size(); i++){
181 if(dbThis) cout <<
"FitAmpListBase::setLSameFitParameters()" << endl;
184 for(
unsigned int i=0; i< this->
size(); i++){
192 if(dbThis) cout <<
"FitAmpListBase::GetCloneSameFitParameters()" << endl;
208 if(dbThis) cout <<
"FitAmpListBase::GetCloneSameFitParameters()" << endl;
224 if(dbThis) cout <<
"FitAmpListBase::GetCPConjugateSameFitParameters()" << endl;
233 if(dbThis) cout <<
"FitAmpListBase::GetCConjugateFinalStateSameFitParameters()" << endl;
242 if(dbThis) cout <<
"FitAmpListBase::GetCConjugateFinalStateSameFitParameters()" << endl;
251 if(dbThis) cout <<
"FitAmpListBase::GetDifferentLSameFitParameters()" << endl;
260 if(0 == fa)
return false;
261 if(dbThis) cout <<
"check init values: " << *fa << endl;
268 os <<
"FitAmpListBase::printLargestAmp: list is empty" << endl;
272 double largestValue = -9999;
273 std::string largestName =
"none";
275 for(
unsigned int i=0; i< this->
size(); i++){
277 cout <<
"FitAmpListBase::printLargestAmp()" 282 double val = norm(
getAmpPtr(i)->getVal(evt));
283 if(val > largestValue){
288 os <<
"largest amp for event " << evt
289 <<
"\n is " << largestName
290 <<
" with value " << largestValue
298 os <<
"FitAmpListBase::printAllAmps: list is empty" << endl;
302 std::string largestName =
"none";
303 if(dbThis) cout <<
"Debug mode for FitAmpListBase::printAllAmps" << endl;
305 os <<
"FitAmpListBase::printAllAmps()\n====================";
307 for(
unsigned int i=0; i< this->
size(); i++){
316 os <<
"FitAmpListBase::printAllAmps: list is empty" << endl;
320 std::string largestName =
"none";
321 if(dbThis) cout <<
"Debug mode for FitAmpListBase::printAllAmps" << endl;
323 os <<
"FitAmpListBase::printAllAmps()\n====================";
325 for(
unsigned int i=0; i< this->
size(); i++){
334 os <<
"FitAmpListBase::printNonZeroWithValue: list is empty" << endl;
338 std::string largestName =
"none";
339 if(dbThis) cout <<
"Debug mode for FitAmpListBase::printAllAmps" << endl;
341 os <<
"FitAmpListBase::printNonZeroWithValue\n====================\n";
343 for(
unsigned int i=0; i < this->
size(); i++){
351 os <<
"FitAmpListBase::print\n====================";
353 for(
unsigned int i=0; i< this->
size(); i++){
359 os <<
"FitAmpListBase::printNonZero\n====================";
361 for(
unsigned int i=0; i< this->
size(); i++){
369 for(
unsigned int i=0; i< this->
size(); i++){
379 boxes.
add(phaseSpaceBox);
381 for(
unsigned int i=0; i< this->
size(); i++){
396 for(
unsigned int i=0; i< this->
size(); i++){
398 boxes.
add(oneAmpsBox);
405 for(
unsigned int i=0; i< this->
size(); i++){
412 for(
unsigned int i=0; i< this->
size(); i++){
419 for(
unsigned int i=0; i< this->
size(); i++){
426 for(
unsigned int i=0; i< this->
size(); i++){
435 if(dbThis) cout <<
"Hello from FitAmpListBase::deleteAll()" << endl;
436 for(
unsigned int i=0; i<
_fitAmps.size(); i++){
450 if(dbThis) cout <<
"all fine in FitAmpListBase::deleteAll()" << endl;
459 if(eff < 0)
return 0;
465 for(
unsigned int i=0; i< this->
size(); i++){
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]));
474 if(weight_sum==0)weight_sum = evtList.
size();
482 for(
unsigned int i=0; i< this->
size(); i++){
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]));
491 if(weight_sum==0)weight_sum = evtList.
size();
492 if(integral>0)tmp.push_back(sqrt(weight_sum/integral));
498 TRandom3* r =
new TRandom3(seed);
500 for(
unsigned int i=0; i< this->
size(); i++){
502 double mag = r->Uniform(0.,1.);
504 r->Circle(re,im,mag);
505 complex<double> c(re,im);
513 TRandom3* r =
new TRandom3(seed);
515 for(
unsigned int i=0; i< this->
size(); i++){
517 double phase = r->Uniform(-
pi,
pi);
523 for(
unsigned int i=0; i< this->
size(); i++){
virtual MINT::counted_ptr< FitAmpListBase > GetCloneOfSubsetSameFitParameters(std::string name) const
void setPDF(MINT::IReturnRealForEvent< IDalitzEvent > *amps)
virtual int add(const FitAmpListBase &other, double factor=1)
virtual bool addAmplitude(FitAmplitude *fa)
virtual FitAmplitude * getAmpPtr(unsigned int i)
virtual MINT::counted_ptr< FitAmpListBase > GetCConjugateInitialStateSameFitParameters() const
virtual int addCopyWithSameFitParameters(const FitAmpListBase &other, double factor=1)
DalitzBWBoxSet makeBWBoxes(const DalitzEventPattern &pat, MINT::IReturnRealForEvent< IDalitzEvent > *pdf, TRandom *rnd=gRandom)
virtual bool CPConjugateSameFitParameters()
virtual void printNonZero(std::ostream &os=std::cout) const
DalitzBoxSet makeBoxes(const DalitzEventPattern &pat, MINT::IReturnRealForEvent< IDalitzEvent > *pdf, double nSigma=2)
virtual std::complex< double > getVal(IDalitzEvent &evt)
bool CPConjugateSameFitParameters()
void setEfficiency(const MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > &eff)
virtual double RealVal(EVENT_TYPE &evt)=0
std::ostream & operator<<(std::ostream &os, const FitAmpListBase &fal)
FitAmpListBase operator *(double r) const
FitAmpListBase operator+(const FitAmpListBase &other) const
bool CConjugateInitialStateSameFitParameters()
DecayTree theBareDecay() const
virtual void printLargestAmp(IDalitzEvent &evt, std::ostream &os=std::cout)
FitAmpListBase operator *(double r, const FitAmpListBase &rhs)
virtual int addAsList(const FitAmpListBase &other, double factor=1)
virtual MINT::counted_ptr< FitAmpListBase > GetCPConjugateSameFitParameters() const
std::vector< double > normFactors(DalitzEventList &evtList)
virtual int addCopyOfSubsetWithSameFitParameters(const FitAmpListBase &other, std::string name, double factor=1)
MINT::counted_ptr< MINT::IReturnRealForEvent< IDalitzEvent > > _efficiency
FitAmpListBase & operator *=(double r)
MINT::FitComplex & FitAmpPhase()
bool CConjugateFinalStateSameFitParameters()
bool A_is_in_B(const std::string &a, const std::string &b)
virtual void printNonZeroWithValue(IDalitzEvent &evt, std::ostream &os=std::cout)
std::vector< FitAmplitude * > _fitAmps
void add(const DalitzBox &box)
bool setLSameFitParameters(int L)
virtual MINT::counted_ptr< FitAmpListBase > GetCloneSameFitParameters() const
double efficiency(IDalitzEvent &evt)
void randomizeStartVals(int seed=0)
void normalizeAmps(DalitzEventList &evtList)
std::vector< MINT::counted_ptr< FitAmpListBase > > _fitAmpLists
virtual MINT::counted_ptr< FitAmpListBase > GetDifferentLSameFitParameters(int L) const
virtual void set(std::complex< double > z)=0
virtual bool setLSameFitParameters(int L)
virtual unsigned int size() const
virtual MINT::counted_ptr< FitAmpListBase > GetCConjugateFinalStateSameFitParameters() const
virtual bool CConjugateInitialStateSameFitParameters()
void setAllAmpsTo(const std::complex< double > z)
friend class FitAmplitude
void oneLiner(std::stringstream &seam, int generation=0) const
void randomizePhaseStartVals(int seed=0)
virtual ~FitAmpListBase()
FitAmpListBase & operator=(const FitAmpListBase &other)
virtual bool CConjugateFinalStateSameFitParameters()
virtual unsigned int size() const
virtual void print(std::ostream &os=std::cout) const
virtual void printAllAmps(std::ostream &os=std::cout) const
void add(DalitzBWBox &box)
virtual void multiply(double r)
FitAmpListBase & operator+=(const FitAmpListBase &other)