MINT2
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Static Private Attributes | List of all members
FlexiFastAmplitudeIntegrator Class Reference

#include <FlexiFastAmplitudeIntegrator.h>

Inheritance diagram for FlexiFastAmplitudeIntegrator:
IDalitzIntegrator MINT::IReturnReal

Public Member Functions

 FlexiFastAmplitudeIntegrator (const std::string &fastFlexiEventFileName="fastFlexiEventFileName.root")
 
 FlexiFastAmplitudeIntegrator (const DalitzEventPattern &pattern, IFastAmplitudeIntegrable *amps=0, MINT::IEventGenerator< IDalitzEvent > *eventGenerator=0, TRandom *rnd=0, double precision=1.e-2, const std::string &fastFlexiEventFileName="fastFlexiEventFileName.root")
 
bool initialise (const DalitzEventPattern &pattern, IFastAmplitudeIntegrable *amps=0, MINT::IEventGenerator< IDalitzEvent > *eventGenerator=0, TRandom *rnd=0, double precision=1.e-2)
 
virtual bool add (const FlexiFastAmplitudeIntegrator &other)
 
bool setValues (const DalitzEventPattern &pattern, IFastAmplitudeIntegrable *amps=0, MINT::IEventGenerator< IDalitzEvent > *eventGenerator=0, TRandom *rnd=0, double precision=1.e-2)
 
void setPrecision (double prec)
 
bool initialised () const
 
double getVal ()
 
double RealVal ()
 
double integralForMatchingPatterns (bool match, int pattern_sign)
 
std::complex< double > ComplexIntegralForTags (int tag1, int tag2)
 
std::complex< double > ComplexSumForMatchingPatterns (bool match)
 
double sumOfSqrtFitFractions ()
 
double sumOfFitFractions ()
 
double absSumOfSqrtInterferenceFractions ()
 
double absSumOfInterferenceFractions ()
 
int numberOfFitFractionsLargerThanThreshold (double threshold)
 
FitFractionList getFractions () const
 
FitFractionList getInterferenceTerms () const
 
bool doFractions ()
 
double variance () const
 
DalitzHistoSet histoSet () const
 
void saveEachAmpsHistograms (const std::string &prefix) const
 
std::vector< DalitzHistoSetGetEachAmpsHistograms ()
 
DalitzHistoSet interferenceHistoSet () const
 
void saveInterferenceHistograms (const std::string &prefix) const
 
std::vector< DalitzHistoSetGetInterferenceHistograms ()
 
virtual void doFinalStats (MINT::Minimiser *mini=0)
 
void doFinalStatsAndSave (MINT::Minimiser *min=0, const std::string &fname="FitAmpResults.txt", const std::string &fnameROOT="fitFractions.root")
 
double getFractionChi2 () const
 
bool ensureFreshEvents ()
 
- Public Member Functions inherited from MINT::IReturnReal
virtual ~IReturnReal ()
 

Protected Member Functions

void forcedReIntegrate ()
 
void reIntegrate ()
 
double weight (IDalitzEvent *evtPtr)
 
int updateEventSet (long int Nevents)
 
double evaluateSum ()
 
int determineNumEvents ()
 
int generateEnoughEvents ()
 
void addEvent (IDalitzEvent &evt)
 
void reAddEvent (DalitzEvent &evt)
 
int addEvents (long int Nevents)
 
TRandom * makeNewRnd (int seed=-9999)
 
- Protected Member Functions inherited from MINT::IReturnReal
 IReturnReal ()
 

Protected Attributes

DalitzEventList _fastFlexiEventList
 
DalitzEventPattern _pat
 
IFastAmplitudeIntegrable_amps
 
MINT::counted_ptr< FitAmpPairList_integCalc
 
MINT::counted_ptr< FitAmpPairList_integCalc_copyForDebug
 
TRandom * _rnd
 
MINT::counted_ptr< TRandom > _localRnd
 
double _precision
 
MINT::IEventGenerator< IDalitzEvent > * _generator
 

Private Attributes

double _mean
 
int _numEvents
 
int _Ncalls
 
int _NReEvaluations
 
double _sumT
 
double _sumTRe
 
double _sumTfast
 
bool _initialised
 
bool _db
 

Static Private Attributes

static const long int _minEvents =100
 

Detailed Description

Definition at line 32 of file FlexiFastAmplitudeIntegrator.h.

Constructor & Destructor Documentation

◆ FlexiFastAmplitudeIntegrator() [1/2]

FlexiFastAmplitudeIntegrator::FlexiFastAmplitudeIntegrator ( const std::string &  fastFlexiEventFileName = "fastFlexiEventFileName.root")

Definition at line 36 of file FlexiFastAmplitudeIntegrator.cpp.

37  : _sumT(0.0), _sumTRe(0.0), _sumTfast(0.0), _initialised(0), _db(false)//, _fastFlexiEventList(fastFlexiEventFileName, "RECREATE")
38 
39 {
40  (void)fastFlexiEventFileName;
41 }

◆ FlexiFastAmplitudeIntegrator() [2/2]

FlexiFastAmplitudeIntegrator::FlexiFastAmplitudeIntegrator ( const DalitzEventPattern pattern,
IFastAmplitudeIntegrable amps = 0,
MINT::IEventGenerator< IDalitzEvent > *  eventGenerator = 0,
TRandom *  rnd = 0,
double  precision = 1.e-2,
const std::string &  fastFlexiEventFileName = "fastFlexiEventFileName.root" 
)

Definition at line 22 of file FlexiFastAmplitudeIntegrator.cpp.

29  : _Ncalls(0), _NReEvaluations(0), _sumT(0.0), _sumTRe(0.0), _sumTfast(0.0), _db(false)
30  // , _fastFlexiEventList(fastFlexiEventFileName, "RECREATE")
31 {
32  initialise(pattern, amps, generator, rnd, precision);
33  (void)fastFlexiEventFileName;
34 }
bool initialise(const DalitzEventPattern &pattern, IFastAmplitudeIntegrable *amps=0, MINT::IEventGenerator< IDalitzEvent > *eventGenerator=0, TRandom *rnd=0, double precision=1.e-2)

Member Function Documentation

◆ absSumOfInterferenceFractions()

double FlexiFastAmplitudeIntegrator::absSumOfInterferenceFractions ( )
inline

Definition at line 161 of file FlexiFastAmplitudeIntegrator.h.

161  {
163  }
MINT::counted_ptr< FitAmpPairList > _integCalc
double absSumOfInterferenceFractions()

◆ absSumOfSqrtInterferenceFractions()

double FlexiFastAmplitudeIntegrator::absSumOfSqrtInterferenceFractions ( )
inline

Definition at line 157 of file FlexiFastAmplitudeIntegrator.h.

157  {
159  }
MINT::counted_ptr< FitAmpPairList > _integCalc
double absSumOfSqrtInterferenceFractions()

◆ add()

bool FlexiFastAmplitudeIntegrator::add ( const FlexiFastAmplitudeIntegrator other)
virtual

Definition at line 58 of file FlexiFastAmplitudeIntegrator.cpp.

58  {
59  int totalEvents = _numEvents + other._numEvents;
61 
62  if(totalEvents > 0){
63  _mean = (_numEvents * _mean + other._numEvents * other._mean)/totalEvents;
64  }
65  _numEvents = totalEvents;
66  _Ncalls += other._Ncalls;
68  _sumT += other._sumT;
69  _sumTRe += other._sumTRe;
70  _sumTfast += other._sumTfast;
71  if(0 != this->_integCalc){
72  _integCalc->add(other._integCalc);
73  }else{
74  if(0 != other._integCalc){
76  _integCalc = nL;
77  }
78  }
79  if(0 != this->_integCalc_copyForDebug){
81  }else{
82  if(0 != other._integCalc_copyForDebug){
84  nLc(new IntegCalculator(*(other._integCalc_copyForDebug)));
86  }
87  }
88  _initialised |= other._initialised;
89  _db |= other._db;
90 
91  // other quantities we take over if they aren't defined, here:
92  if(0 == _amps) _amps = other._amps;
93  if(0 == _rnd) _rnd = other._rnd;
94  if(0 == _localRnd) _localRnd = other._localRnd;
95  if(_precision <= 0.0) _precision = other._precision;
96 
97  return true;
98 }
virtual bool Add(const EVENT_TYPE &evt)
Definition: EventList.h:63
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual bool add(const FitAmpPairList &otherList)
MINT::counted_ptr< TRandom > _localRnd
MINT::counted_ptr< FitAmpPairList > _integCalc_copyForDebug

◆ addEvent()

void FlexiFastAmplitudeIntegrator::addEvent ( IDalitzEvent evt)
protected

Definition at line 211 of file FlexiFastAmplitudeIntegrator.cpp.

211  {
214  _integCalc->addEvent(listEvent, weight(&listEvent));
215 }
virtual bool Add(const EVENT_TYPE &evt)
Definition: EventList.h:63
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual unsigned int size() const
Definition: EventList.h:59
virtual void addEvent(IDalitzEvent *evtPtr, double weight=1)

◆ addEvents()

int FlexiFastAmplitudeIntegrator::addEvents ( long int  Nevents)
protected

Definition at line 220 of file FlexiFastAmplitudeIntegrator.cpp.

220  {
221  bool dbThis=false;
222  if(dbThis) cout << "FlexiFastAmplitudeIntegrator::addEvents "
223  << " got called " << endl;
224  if(Nevents <= 0) return _integCalc->numEvents();
225 
226  if(0 == _generator){
227  cout << "FlexiFastAmplitudeIntegrator::addEvents "
228  << " adding flat events. " << endl;
229  for(int i=0; i < Nevents; i++){
230  DalitzEvent evt(_pat, _rnd);
231  addEvent(evt);
232  }
233  }else{
234  int N_success = 0;
235  unsigned long int maxTries = (unsigned long int) Nevents * 1000;
236  // dealing with possible overflow:
237  if(maxTries < (unsigned long int) Nevents) maxTries = Nevents * 100;
238  if(maxTries < (unsigned long int) Nevents) maxTries = Nevents * 10;
239  if(maxTries < (unsigned long int) Nevents) maxTries = Nevents;
240 
241  time_t startTime = time(0);
242  for(unsigned long int i=0; i < maxTries && N_success < Nevents; i++){
244  if(dbThis) cout << "got event with ptr: " << ptr << endl;
245  if(0 == ptr){
246  if(_generator->exhausted()){
247  cout << "ERROR in FlexiFastAmplitudeIntegrator::addEvents"
248  << "\n\t Generator exhausted, cannot generate more events."
249  << endl;
250  break;
251  }
252  }else{
253  addEvent(*ptr);
254  N_success++;
255  int printEvery = 1000;
256  if(N_success > 1000) printEvery = 50000;
257  if(N_success > 100000) printEvery = 100000;
258  bool printout = (N_success%printEvery == 0);
259  if(dbThis) printout |= (N_success < 20);
260 
261  if(printout){
262  cout << " FlexiFastAmplitudeIntegrator::addEvents: added " << N_success
263  << " th event";
264  evaluateSum();
265  double v= variance();
266  double sigma = -9999;
267  if(v > 0) sigma = sqrt(v);
268  cout << "\t integ= " << _mean << " +/- " << sigma;
269  cout << "\t("
270  << MINT::stringtime(difftime(time(0), startTime))
271  << ")";
272  cout << endl;
273  }
274  }
275  }
276  }
277  if(_integCalc->numEvents() < Nevents){
278  cout << "ERROR in FlexiFastAmplitudeIntegrator::addEvents"
279  << "\n\t> I was supposed to add " << Nevents << " events,"
280  << "\n\t> but now the total list size is only "
281  << _integCalc->numEvents()
282  << endl;
283  }else{
284  cout << " added " << Nevents << " _integCalc->numEvents "
285  << _integCalc->numEvents() << endl;
286 
287  }
288  return _integCalc->numEvents();
289 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual bool exhausted() const =0
virtual counted_ptr< RETURN_TYPE > newEvent()=0
MINT::IEventGenerator< IDalitzEvent > * _generator
virtual int numEvents() const
std::string stringtime(double dt)
Definition: Utils.cpp:14

◆ ComplexIntegralForTags()

std::complex<double> FlexiFastAmplitudeIntegrator::ComplexIntegralForTags ( int  tag1,
int  tag2 
)
inline

Definition at line 141 of file FlexiFastAmplitudeIntegrator.h.

141  {
142  return _integCalc->ComplexIntegralForTags(tag1,tag2);
143  }
MINT::counted_ptr< FitAmpPairList > _integCalc
std::complex< double > ComplexIntegralForTags(int tag1, int tag2) const

◆ ComplexSumForMatchingPatterns()

std::complex<double> FlexiFastAmplitudeIntegrator::ComplexSumForMatchingPatterns ( bool  match)
inline

Definition at line 145 of file FlexiFastAmplitudeIntegrator.h.

145  {
147  }
MINT::counted_ptr< FitAmpPairList > _integCalc
std::complex< double > ComplexSumForMatchingPatterns(bool match) const

◆ determineNumEvents()

int FlexiFastAmplitudeIntegrator::determineNumEvents ( )
protected

Definition at line 335 of file FlexiFastAmplitudeIntegrator.cpp.

335  {
337  evaluateSum();
338  double v = variance();
339  double safetyFactor = 1.15;
340  double maxVariance = _precision*_precision * _mean*_mean;
342  (v*safetyFactor/maxVariance);
343  // round to the nearest 100:
344  _numEvents = (_numEvents/100 + 1)*100;
345 
346  cout << " FlexiFastAmplitudeIntegrator::determineNumEvents():"
347  << "\n\t> mean: " << _mean << ", rms " << sqrt(v)
348  << "\n\t> currently, our relative precision is "
349  << sqrt(v)/_mean
350  << "\n\t> to achieve the requested pecision of " << _precision << ","
351  << "\n\t> (with a safety factor) I think we'll need "
352  << (v*safetyFactor/maxVariance)
353  << " times that, i.e. " << _numEvents << " events" << endl;
354 
355  return _numEvents;
356 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual int numEvents() const

◆ doFinalStats()

void FlexiFastAmplitudeIntegrator::doFinalStats ( MINT::Minimiser mini = 0)
virtual

Implements IDalitzIntegrator.

Definition at line 429 of file FlexiFastAmplitudeIntegrator.cpp.

429  {
430  bool dbThis=true;
431  if(dbThis) cout << "FlexiFastAmplitudeIntegrator::doFinalStats() called" << endl;
432  _integCalc->setSlow(); // means it makes histograms
434  _integCalc->doFinalStats(mini);
435 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual void doFinalStats(MINT::Minimiser *min=0)

◆ doFinalStatsAndSave()

void FlexiFastAmplitudeIntegrator::doFinalStatsAndSave ( MINT::Minimiser min = 0,
const std::string &  fname = "FitAmpResults.txt",
const std::string &  fnameROOT = "fitFractions.root" 
)

Definition at line 437 of file FlexiFastAmplitudeIntegrator.cpp.

437  {
438  bool dbThis=true;
439  if(dbThis) cout << "FlexiFastAmplitudeIntegrator::doFinalStats() called" << endl;
440  _integCalc->setSlow(); // means it makes histograms
442  _integCalc->doFinalStatsAndSave(mini,fname,fnameROOT);
443 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual void doFinalStatsAndSave(MINT::Minimiser *min=0, const std::string &fname="FitAmpResults.txt", const std::string &fnameROOT="fitFractions.root")

◆ doFractions()

bool FlexiFastAmplitudeIntegrator::doFractions ( )
inline

Definition at line 171 of file FlexiFastAmplitudeIntegrator.h.

171 {return _integCalc->doFractions();}
MINT::counted_ptr< FitAmpPairList > _integCalc

◆ ensureFreshEvents()

bool FlexiFastAmplitudeIntegrator::ensureFreshEvents ( )

Definition at line 100 of file FlexiFastAmplitudeIntegrator.cpp.

100  {
101  _rnd = makeNewRnd(time(0));
102  if(0 != _generator){
104  }
105  return true;
106 }
virtual bool ensureFreshEvents()=0
MINT::IEventGenerator< IDalitzEvent > * _generator

◆ evaluateSum()

double FlexiFastAmplitudeIntegrator::evaluateSum ( )
protected

Definition at line 294 of file FlexiFastAmplitudeIntegrator.cpp.

294  {
295  time_t tstart = time(0);
296  // _Ncalls++;
297 
299  double v = variance();
300  double sigma = -9999;
301  if(v >= 0) sigma = sqrt(v);
302  double actualPrecision = -9999;
303  if(_mean != 0 && sigma > 0) actualPrecision = sigma/_mean;
304 
305  double delT = difftime(time(0), tstart);
306 
307  int printEvery = 100;
308  if(_Ncalls > 1000) printEvery = 1000;
309  if(_Ncalls > 10000) printEvery = 10000;
310  if(_Ncalls > 100000) printEvery = 100000;
311  bool printout = _Ncalls < 3 || (0 == _Ncalls%printEvery);
312 
313  if(printout || _db){
314  cout << " FlexiFastAmplitudeIntegrator::evaluateSum() for "
315  << _integCalc->numEvents() << " events, "
316  << _Ncalls << " th call:";
317  cout << "\n\t> getting: " << _mean << " +/- " << sigma
318  << "\n\t> precision: requested: " << _precision*100
319  << "%, actual: " << actualPrecision*100 << "%"
320  << "\n\t> This took " << delT << " s."
321  << endl;
322  if(_db){
323  cout << "checking save and read-back:" << endl;
324  _integCalc->save("checkSaveAndReadBack");
325  _integCalc_copyForDebug->retrieve("checkSaveAndReadBack");
326  cout << " copy values:"
327  << "\n\t mean: " << _integCalc_copyForDebug->integral()
328  << "\n\t variance: " << _integCalc_copyForDebug->variance()
329  << endl;
330  }
331  }
332  return _mean;
333 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual double variance() const
virtual double integral() const
virtual bool save(const std::string &asSubdirOf=".") const
MINT::counted_ptr< FitAmpPairList > _integCalc_copyForDebug
virtual int numEvents() const
virtual bool retrieve(const std::string &asSubdirOf=".")

◆ forcedReIntegrate()

void FlexiFastAmplitudeIntegrator::forcedReIntegrate ( )
protected

Definition at line 183 of file FlexiFastAmplitudeIntegrator.cpp.

183  {
185  for(unsigned int i=0; i < _fastFlexiEventList.size(); i++){
187  }
189 }
MINT::counted_ptr< FitAmpPairList > _integCalc
void startForcedReIntegration()
virtual unsigned int size() const
Definition: EventList.h:59

◆ generateEnoughEvents()

int FlexiFastAmplitudeIntegrator::generateEnoughEvents ( )
protected

Definition at line 358 of file FlexiFastAmplitudeIntegrator.cpp.

358  {
360  int counter(0);
361  while(determineNumEvents() > _integCalc->numEvents() &&
362  counter < 10 && _numEvents > 0){
364  counter++;
365  }
366  return _integCalc->numEvents();
367 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual int numEvents() const

◆ GetEachAmpsHistograms()

std::vector< DalitzHistoSet > FlexiFastAmplitudeIntegrator::GetEachAmpsHistograms ( )

Definition at line 415 of file FlexiFastAmplitudeIntegrator.cpp.

415  {
417 }
MINT::counted_ptr< FitAmpPairList > _integCalc
std::vector< DalitzHistoSet > GetEachAmpsHistograms()

◆ getFractionChi2()

double FlexiFastAmplitudeIntegrator::getFractionChi2 ( ) const

Definition at line 445 of file FlexiFastAmplitudeIntegrator.cpp.

445  {
446  return _integCalc->getFractionChi2();
447 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual double getFractionChi2() const

◆ getFractions()

FitFractionList FlexiFastAmplitudeIntegrator::getFractions ( ) const
inline

Definition at line 169 of file FlexiFastAmplitudeIntegrator.h.

169 {return _integCalc->getFractions();}
MINT::counted_ptr< FitAmpPairList > _integCalc
FitFractionList getFractions() const

◆ GetInterferenceHistograms()

std::vector< DalitzHistoSet > FlexiFastAmplitudeIntegrator::GetInterferenceHistograms ( )

Definition at line 425 of file FlexiFastAmplitudeIntegrator.cpp.

425  {
427 }
MINT::counted_ptr< FitAmpPairList > _integCalc
std::vector< DalitzHistoSet > GetInterferenceHistograms()

◆ getInterferenceTerms()

FitFractionList FlexiFastAmplitudeIntegrator::getInterferenceTerms ( ) const
inline

Definition at line 170 of file FlexiFastAmplitudeIntegrator.h.

170 {return _integCalc->getInterferenceTerms();}
MINT::counted_ptr< FitAmpPairList > _integCalc
FitFractionList getInterferenceTerms() const

◆ getVal()

double FlexiFastAmplitudeIntegrator::getVal ( )

Definition at line 369 of file FlexiFastAmplitudeIntegrator.cpp.

369  {
370  _Ncalls++;
371  time_t tstart = time(0);
372  double delT_slow, delT_fast, delT_total;
373  if( _integCalc->needToReIntegrate() ){
374  _NReEvaluations++;
375  reIntegrate();
376  delT_slow = difftime(time(0), tstart);
377  _sumTRe += delT_slow;
378  }
379  time_t tstart_2 = time(0);
380  evaluateSum();
381  delT_total = difftime(time(0), tstart);
382  delT_fast = difftime(time(0), tstart_2);
383  _sumTfast += delT_fast;
384 
385  int printEvery = 10;
386  if(_Ncalls > 100) printEvery = 100;
387  if(_Ncalls > 1000) printEvery = 1000;
388  if(_Ncalls > 10000) printEvery = 10000;
389  if(_Ncalls > 100000) printEvery = 100000;
390  bool printout = _Ncalls < 10 || (0 == _Ncalls%printEvery);
391 
392  if(_Ncalls > 0 && printout){
393  cout << "FlexiFastAmplitudeIntegrator::getVal, " << _Ncalls << "th call: Returning " << _mean
394  << ", re-evaluation fraction = " << ((double) _NReEvaluations)/((double) _Ncalls)
395  << "\n\t this call took " << delT_total << " s,"
396  << "\n\t average call " << _sumT / _Ncalls;
397  if(_NReEvaluations > 0) cout << ", average re-integration " << _sumTRe / _NReEvaluations;
398  int delN = _Ncalls - _NReEvaluations;
399  if(delN > 0){
400  cout << ", average call w/o re-integration " << _sumTfast / delN;
401  }
402  cout << " ." << endl;
403  }
404 
405  return _mean;
406 }
MINT::counted_ptr< FitAmpPairList > _integCalc
bool needToReIntegrate() const

◆ histoSet()

DalitzHistoSet FlexiFastAmplitudeIntegrator::histoSet ( ) const

Definition at line 408 of file FlexiFastAmplitudeIntegrator.cpp.

408  {
409 
410  return _integCalc->histoSet();
411 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual DalitzHistoSet histoSet() const

◆ initialise()

bool FlexiFastAmplitudeIntegrator::initialise ( const DalitzEventPattern pattern,
IFastAmplitudeIntegrable amps = 0,
MINT::IEventGenerator< IDalitzEvent > *  eventGenerator = 0,
TRandom *  rnd = 0,
double  precision = 1.e-2 
)

Definition at line 45 of file FlexiFastAmplitudeIntegrator.cpp.

50  {
51  bool sc=true;
52  sc &= setValues(pattern, amps, generator, rnd, precision);
53  sc &= generateEnoughEvents();
54  return sc;
55 }
bool setValues(const DalitzEventPattern &pattern, IFastAmplitudeIntegrable *amps=0, MINT::IEventGenerator< IDalitzEvent > *eventGenerator=0, TRandom *rnd=0, double precision=1.e-2)

◆ initialised()

bool FlexiFastAmplitudeIntegrator::initialised ( ) const
inline

Definition at line 127 of file FlexiFastAmplitudeIntegrator.h.

127  {
128  return _initialised;
129  }

◆ integralForMatchingPatterns()

double FlexiFastAmplitudeIntegrator::integralForMatchingPatterns ( bool  match,
int  pattern_sign 
)
inline

Definition at line 137 of file FlexiFastAmplitudeIntegrator.h.

137  {
138  return _integCalc->integralForMatchingPatterns(match, pattern_sign);
139  }
MINT::counted_ptr< FitAmpPairList > _integCalc
double integralForMatchingPatterns(bool match, int pattern_sign) const

◆ interferenceHistoSet()

DalitzHistoSet FlexiFastAmplitudeIntegrator::interferenceHistoSet ( ) const

Definition at line 419 of file FlexiFastAmplitudeIntegrator.cpp.

419  {
421 }
MINT::counted_ptr< FitAmpPairList > _integCalc
DalitzHistoSet interferenceHistoSet() const

◆ makeNewRnd()

TRandom * FlexiFastAmplitudeIntegrator::makeNewRnd ( int  seed = -9999)
protected

Definition at line 108 of file FlexiFastAmplitudeIntegrator.cpp.

108  {
109  if(seed < -9998) seed = time(0);
110  cout << "FlexiFastAmplitudeIntegrator::makeNewRnd with seed " << seed << endl;
111  counted_ptr<TRandom> lr(new TRandom3(seed));
112  _localRnd = lr;
113  _rnd = lr.get();
114  return _rnd;
115 }
MINT::counted_ptr< TRandom > _localRnd

◆ numberOfFitFractionsLargerThanThreshold()

int FlexiFastAmplitudeIntegrator::numberOfFitFractionsLargerThanThreshold ( double  threshold)
inline

Definition at line 165 of file FlexiFastAmplitudeIntegrator.h.

165  {
167  }
MINT::counted_ptr< FitAmpPairList > _integCalc
int numberOfFitFractionsLargerThanThreshold(double threshold)

◆ reAddEvent()

void FlexiFastAmplitudeIntegrator::reAddEvent ( DalitzEvent evt)
protected

Definition at line 216 of file FlexiFastAmplitudeIntegrator.cpp.

216  {
217  _integCalc->reAddEvent(evt, weight(&evt));
218 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual void reAddEvent(IDalitzEvent &evt, double weight=1)

◆ RealVal()

double FlexiFastAmplitudeIntegrator::RealVal ( )
inlinevirtual

Implements MINT::IReturnReal.

Definition at line 133 of file FlexiFastAmplitudeIntegrator.h.

133  {
134  return getVal();
135  }

◆ reIntegrate()

void FlexiFastAmplitudeIntegrator::reIntegrate ( )
protected

Definition at line 190 of file FlexiFastAmplitudeIntegrator.cpp.

190  {
192  for(unsigned int i=0; i < _fastFlexiEventList.size(); i++){
194  }
196 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual unsigned int size() const
Definition: EventList.h:59

◆ saveEachAmpsHistograms()

void FlexiFastAmplitudeIntegrator::saveEachAmpsHistograms ( const std::string &  prefix) const

Definition at line 412 of file FlexiFastAmplitudeIntegrator.cpp.

412  {
413  return _integCalc->saveEachAmpsHistograms(prefix);
414 }
MINT::counted_ptr< FitAmpPairList > _integCalc
void saveEachAmpsHistograms(const std::string &prefix) const

◆ saveInterferenceHistograms()

void FlexiFastAmplitudeIntegrator::saveInterferenceHistograms ( const std::string &  prefix) const

Definition at line 422 of file FlexiFastAmplitudeIntegrator.cpp.

422  {
423  return _integCalc->saveInterferenceHistograms(prefix);
424 }
MINT::counted_ptr< FitAmpPairList > _integCalc
void saveInterferenceHistograms(const std::string &prefix) const

◆ setPrecision()

void FlexiFastAmplitudeIntegrator::setPrecision ( double  prec)
inline

◆ setValues()

bool FlexiFastAmplitudeIntegrator::setValues ( const DalitzEventPattern pattern,
IFastAmplitudeIntegrable amps = 0,
MINT::IEventGenerator< IDalitzEvent > *  eventGenerator = 0,
TRandom *  rnd = 0,
double  precision = 1.e-2 
)

Definition at line 117 of file FlexiFastAmplitudeIntegrator.cpp.

123  {
124  _pat = pattern;
125  _amps = amps;
126  //_weight = weight;
127  if(0 != rnd){
128  _rnd = rnd;
129  }else{
130  _rnd = makeNewRnd(time(0));
131  }
132  _precision = precision;
133 
134  _generator = generator;
135 
136  // _integCalc = amps->makeIntegCalculator();
137  _integCalc = amps->makeFitAmpPairList();
138  _integCalc->setFast();
139 
141 
142  if(0 == _integCalc){
143  cout << "ERROR in FlexiFastAmplitudeIntegrator::initialise"
144  << " amps->makeIntegCalculator()"
145  << " return NULL pointer!" << endl;
146  cout << "\t This will go wrong." << endl;
147  }
148  _Ncalls=0;
149  _NReEvaluations=0;
150  _sumT = 0.0;
151  _sumTRe = 0.0;
152  _sumTfast = 0.0;
153 
154  _initialised = true;
155  return _initialised;
156 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual MINT::counted_ptr< FitAmpPairList > makeFitAmpPairList()=0
MINT::IEventGenerator< IDalitzEvent > * _generator
MINT::counted_ptr< FitAmpPairList > _integCalc_copyForDebug

◆ sumOfFitFractions()

double FlexiFastAmplitudeIntegrator::sumOfFitFractions ( )
inline

Definition at line 153 of file FlexiFastAmplitudeIntegrator.h.

153  {
154  return _integCalc->sumOfFitFractions();
155  }
MINT::counted_ptr< FitAmpPairList > _integCalc
double sumOfFitFractions()

◆ sumOfSqrtFitFractions()

double FlexiFastAmplitudeIntegrator::sumOfSqrtFitFractions ( )
inline

Definition at line 149 of file FlexiFastAmplitudeIntegrator.h.

149  {
151  }
MINT::counted_ptr< FitAmpPairList > _integCalc
double sumOfSqrtFitFractions()

◆ updateEventSet()

int FlexiFastAmplitudeIntegrator::updateEventSet ( long int  Nevents)
protected

Definition at line 158 of file FlexiFastAmplitudeIntegrator.cpp.

158  {
159  if(! _initialised){
160  cout << " FlexiFastAmplitudeIntegrator::updateEventSet "
161  << " need to know pattern first." << endl;
162  return 0;
163  }
164 
166  int missingEvents = Nevents - _integCalc->numEvents();
167 
168  if(missingEvents > 0){
169  cout << "missing events: " << missingEvents
170  << " = " << Nevents
171  << " - " << _integCalc->numEvents()
172  << endl;
173  addEvents(missingEvents);
174  }else{
175  cout << "want " << Nevents
176  << ", have " << _integCalc->numEvents()
177  << ", so no more events missing." << endl;
178  }
180  return _integCalc->numEvents();
181 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual int numEvents() const

◆ variance()

double FlexiFastAmplitudeIntegrator::variance ( ) const

Definition at line 291 of file FlexiFastAmplitudeIntegrator.cpp.

291  {
292  return _integCalc->variance();
293 }
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual double variance() const

◆ weight()

double FlexiFastAmplitudeIntegrator::weight ( IDalitzEvent evtPtr)
protected

Definition at line 198 of file FlexiFastAmplitudeIntegrator.cpp.

198  {
199  return 1;
200  // (not in use, but left as a hook should the need arise)
201  /*
202  if(0 == _weight) return 1;
203 
204  _weight->setEvent(evtPtr);
205  double wght = _weight->RealVal();
206  _weight->resetEventRecord();
207  return wght;
208  */
209 }

Member Data Documentation

◆ _amps

IFastAmplitudeIntegrable* FlexiFastAmplitudeIntegrator::_amps
protected

Definition at line 49 of file FlexiFastAmplitudeIntegrator.h.

◆ _db

bool FlexiFastAmplitudeIntegrator::_db
private

Definition at line 42 of file FlexiFastAmplitudeIntegrator.h.

◆ _fastFlexiEventList

DalitzEventList FlexiFastAmplitudeIntegrator::_fastFlexiEventList
protected

Definition at line 46 of file FlexiFastAmplitudeIntegrator.h.

◆ _generator

MINT::IEventGenerator<IDalitzEvent>* FlexiFastAmplitudeIntegrator::_generator
protected

Definition at line 80 of file FlexiFastAmplitudeIntegrator.h.

◆ _initialised

bool FlexiFastAmplitudeIntegrator::_initialised
private

Definition at line 40 of file FlexiFastAmplitudeIntegrator.h.

◆ _integCalc

MINT::counted_ptr<FitAmpPairList> FlexiFastAmplitudeIntegrator::_integCalc
protected

Definition at line 55 of file FlexiFastAmplitudeIntegrator.h.

◆ _integCalc_copyForDebug

MINT::counted_ptr<FitAmpPairList> FlexiFastAmplitudeIntegrator::_integCalc_copyForDebug
protected

Definition at line 57 of file FlexiFastAmplitudeIntegrator.h.

◆ _localRnd

MINT::counted_ptr<TRandom> FlexiFastAmplitudeIntegrator::_localRnd
protected

Definition at line 60 of file FlexiFastAmplitudeIntegrator.h.

◆ _mean

double FlexiFastAmplitudeIntegrator::_mean
mutableprivate

Definition at line 33 of file FlexiFastAmplitudeIntegrator.h.

◆ _minEvents

const long int FlexiFastAmplitudeIntegrator::_minEvents =100
staticprivate

Definition at line 34 of file FlexiFastAmplitudeIntegrator.h.

◆ _Ncalls

int FlexiFastAmplitudeIntegrator::_Ncalls
private

Definition at line 36 of file FlexiFastAmplitudeIntegrator.h.

◆ _NReEvaluations

int FlexiFastAmplitudeIntegrator::_NReEvaluations
private

Definition at line 37 of file FlexiFastAmplitudeIntegrator.h.

◆ _numEvents

int FlexiFastAmplitudeIntegrator::_numEvents
private

Definition at line 35 of file FlexiFastAmplitudeIntegrator.h.

◆ _pat

DalitzEventPattern FlexiFastAmplitudeIntegrator::_pat
protected

Definition at line 48 of file FlexiFastAmplitudeIntegrator.h.

◆ _precision

double FlexiFastAmplitudeIntegrator::_precision
protected

Definition at line 61 of file FlexiFastAmplitudeIntegrator.h.

◆ _rnd

TRandom* FlexiFastAmplitudeIntegrator::_rnd
protected

Definition at line 59 of file FlexiFastAmplitudeIntegrator.h.

◆ _sumT

double FlexiFastAmplitudeIntegrator::_sumT
private

Definition at line 39 of file FlexiFastAmplitudeIntegrator.h.

◆ _sumTfast

double FlexiFastAmplitudeIntegrator::_sumTfast
private

Definition at line 39 of file FlexiFastAmplitudeIntegrator.h.

◆ _sumTRe

double FlexiFastAmplitudeIntegrator::_sumTRe
private

Definition at line 39 of file FlexiFastAmplitudeIntegrator.h.


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