#include <FlexiFastAmplitudeIntegrator.h>
|
| 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< DalitzHistoSet > | GetEachAmpsHistograms () |
|
DalitzHistoSet | interferenceHistoSet () const |
|
void | saveInterferenceHistograms (const std::string &prefix) const |
|
std::vector< DalitzHistoSet > | GetInterferenceHistograms () |
|
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 () |
|
virtual | ~IReturnReal () |
|
◆ FlexiFastAmplitudeIntegrator() [1/2]
FlexiFastAmplitudeIntegrator::FlexiFastAmplitudeIntegrator |
( |
const std::string & |
fastFlexiEventFileName = "fastFlexiEventFileName.root" | ) |
|
◆ FlexiFastAmplitudeIntegrator() [2/2]
Definition at line 22 of file FlexiFastAmplitudeIntegrator.cpp.
32 initialise(pattern, amps, generator, rnd, precision);
33 (void)fastFlexiEventFileName;
bool initialise(const DalitzEventPattern &pattern, IFastAmplitudeIntegrable *amps=0, MINT::IEventGenerator< IDalitzEvent > *eventGenerator=0, TRandom *rnd=0, double precision=1.e-2)
◆ absSumOfInterferenceFractions()
double FlexiFastAmplitudeIntegrator::absSumOfInterferenceFractions |
( |
| ) |
|
|
inline |
◆ absSumOfSqrtInterferenceFractions()
double FlexiFastAmplitudeIntegrator::absSumOfSqrtInterferenceFractions |
( |
| ) |
|
|
inline |
◆ add()
Definition at line 58 of file FlexiFastAmplitudeIntegrator.cpp.
virtual bool Add(const EVENT_TYPE &evt)
MINT::counted_ptr< FitAmpPairList > _integCalc
DalitzEventList _fastFlexiEventList
virtual bool add(const FitAmpPairList &otherList)
IFastAmplitudeIntegrable * _amps
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.
virtual bool Add(const EVENT_TYPE &evt)
MINT::counted_ptr< FitAmpPairList > _integCalc
DalitzEventList _fastFlexiEventList
virtual unsigned int size() const
double weight(IDalitzEvent *evtPtr)
virtual void addEvent(IDalitzEvent *evtPtr, double weight=1)
◆ addEvents()
int FlexiFastAmplitudeIntegrator::addEvents |
( |
long int |
Nevents | ) |
|
|
protected |
Definition at line 220 of file FlexiFastAmplitudeIntegrator.cpp.
222 if(dbThis) cout <<
"FlexiFastAmplitudeIntegrator::addEvents " 223 <<
" got called " << endl;
227 cout <<
"FlexiFastAmplitudeIntegrator::addEvents " 228 <<
" adding flat events. " << endl;
229 for(
int i=0; i < Nevents; i++){
235 unsigned long int maxTries = (
unsigned long int) Nevents * 1000;
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;
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;
247 cout <<
"ERROR in FlexiFastAmplitudeIntegrator::addEvents" 248 <<
"\n\t Generator exhausted, cannot generate more events." 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);
262 cout <<
" FlexiFastAmplitudeIntegrator::addEvents: added " << N_success
266 double sigma = -9999;
267 if(v > 0) sigma = sqrt(v);
268 cout <<
"\t integ= " <<
_mean <<
" +/- " << sigma;
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 " 284 cout <<
" added " << Nevents <<
" _integCalc->numEvents "
MINT::counted_ptr< FitAmpPairList > _integCalc
void addEvent(IDalitzEvent &evt)
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)
◆ ComplexIntegralForTags()
std::complex<double> FlexiFastAmplitudeIntegrator::ComplexIntegralForTags |
( |
int |
tag1, |
|
|
int |
tag2 |
|
) |
| |
|
inline |
Definition at line 141 of file FlexiFastAmplitudeIntegrator.h.
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.
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.
339 double safetyFactor = 1.15;
342 (v*safetyFactor/maxVariance);
346 cout <<
" FlexiFastAmplitudeIntegrator::determineNumEvents():" 347 <<
"\n\t> mean: " <<
_mean <<
", rms " << sqrt(v)
348 <<
"\n\t> currently, our relative precision is " 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;
MINT::counted_ptr< FitAmpPairList > _integCalc
int updateEventSet(long int Nevents)
static const long int _minEvents
virtual int numEvents() const
◆ doFinalStats()
void FlexiFastAmplitudeIntegrator::doFinalStats |
( |
MINT::Minimiser * |
mini = 0 | ) |
|
|
virtual |
Implements IDalitzIntegrator.
Definition at line 429 of file FlexiFastAmplitudeIntegrator.cpp.
431 if(dbThis) cout <<
"FlexiFastAmplitudeIntegrator::doFinalStats() called" << endl;
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.
439 if(dbThis) cout <<
"FlexiFastAmplitudeIntegrator::doFinalStats() called" << endl;
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 |
◆ ensureFreshEvents()
bool FlexiFastAmplitudeIntegrator::ensureFreshEvents |
( |
| ) |
|
Definition at line 100 of file FlexiFastAmplitudeIntegrator.cpp.
TRandom * makeNewRnd(int seed=-9999)
virtual bool ensureFreshEvents()=0
MINT::IEventGenerator< IDalitzEvent > * _generator
◆ evaluateSum()
double FlexiFastAmplitudeIntegrator::evaluateSum |
( |
| ) |
|
|
protected |
Definition at line 294 of file FlexiFastAmplitudeIntegrator.cpp.
295 time_t tstart = time(0);
300 double sigma = -9999;
301 if(v >= 0) sigma = sqrt(v);
302 double actualPrecision = -9999;
303 if(
_mean != 0 && sigma > 0) actualPrecision = sigma/
_mean;
305 double delT = difftime(time(0), tstart);
307 int printEvery = 100;
308 if(
_Ncalls > 1000) printEvery = 1000;
309 if(
_Ncalls > 10000) printEvery = 10000;
310 if(
_Ncalls > 100000) printEvery = 100000;
314 cout <<
" FlexiFastAmplitudeIntegrator::evaluateSum() for " 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." 323 cout <<
"checking save and read-back:" << endl;
326 cout <<
" copy values:"
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.
MINT::counted_ptr< FitAmpPairList > _integCalc
void startForcedReIntegration()
DalitzEventList _fastFlexiEventList
void reAddEvent(DalitzEvent &evt)
virtual unsigned int size() const
◆ generateEnoughEvents()
int FlexiFastAmplitudeIntegrator::generateEnoughEvents |
( |
| ) |
|
|
protected |
Definition at line 358 of file FlexiFastAmplitudeIntegrator.cpp.
362 counter < 10 && _numEvents > 0){
MINT::counted_ptr< FitAmpPairList > _integCalc
int updateEventSet(long int Nevents)
static const long int _minEvents
virtual int numEvents() const
◆ GetEachAmpsHistograms()
std::vector< DalitzHistoSet > FlexiFastAmplitudeIntegrator::GetEachAmpsHistograms |
( |
| ) |
|
◆ getFractionChi2()
double FlexiFastAmplitudeIntegrator::getFractionChi2 |
( |
| ) |
const |
◆ getFractions()
◆ GetInterferenceHistograms()
std::vector< DalitzHistoSet > FlexiFastAmplitudeIntegrator::GetInterferenceHistograms |
( |
| ) |
|
◆ getInterferenceTerms()
FitFractionList FlexiFastAmplitudeIntegrator::getInterferenceTerms |
( |
| ) |
const |
|
inline |
◆ getVal()
double FlexiFastAmplitudeIntegrator::getVal |
( |
| ) |
|
Definition at line 369 of file FlexiFastAmplitudeIntegrator.cpp.
371 time_t tstart = time(0);
372 double delT_slow, delT_fast, delT_total;
376 delT_slow = difftime(time(0), tstart);
379 time_t tstart_2 = time(0);
381 delT_total = difftime(time(0), tstart);
382 delT_fast = difftime(time(0), tstart_2);
386 if(
_Ncalls > 100) printEvery = 100;
387 if(
_Ncalls > 1000) printEvery = 1000;
388 if(
_Ncalls > 10000) printEvery = 10000;
389 if(
_Ncalls > 100000) printEvery = 100000;
393 cout <<
"FlexiFastAmplitudeIntegrator::getVal, " <<
_Ncalls <<
"th call: Returning " <<
_mean 395 <<
"\n\t this call took " << delT_total <<
" s," 400 cout <<
", average call w/o re-integration " <<
_sumTfast / delN;
402 cout <<
" ." << endl;
MINT::counted_ptr< FitAmpPairList > _integCalc
bool needToReIntegrate() const
◆ histoSet()
◆ initialise()
Definition at line 45 of file FlexiFastAmplitudeIntegrator.cpp.
52 sc &=
setValues(pattern, amps, generator, rnd, precision);
bool setValues(const DalitzEventPattern &pattern, IFastAmplitudeIntegrable *amps=0, MINT::IEventGenerator< IDalitzEvent > *eventGenerator=0, TRandom *rnd=0, double precision=1.e-2)
int generateEnoughEvents()
◆ initialised()
bool FlexiFastAmplitudeIntegrator::initialised |
( |
| ) |
const |
|
inline |
◆ integralForMatchingPatterns()
double FlexiFastAmplitudeIntegrator::integralForMatchingPatterns |
( |
bool |
match, |
|
|
int |
pattern_sign |
|
) |
| |
|
inline |
Definition at line 137 of file FlexiFastAmplitudeIntegrator.h.
MINT::counted_ptr< FitAmpPairList > _integCalc
double integralForMatchingPatterns(bool match, int pattern_sign) const
◆ interferenceHistoSet()
DalitzHistoSet FlexiFastAmplitudeIntegrator::interferenceHistoSet |
( |
| ) |
const |
◆ makeNewRnd()
TRandom * FlexiFastAmplitudeIntegrator::makeNewRnd |
( |
int |
seed = -9999 | ) |
|
|
protected |
Definition at line 108 of file FlexiFastAmplitudeIntegrator.cpp.
109 if(seed < -9998) seed = time(0);
110 cout <<
"FlexiFastAmplitudeIntegrator::makeNewRnd with seed " << seed << endl;
MINT::counted_ptr< TRandom > _localRnd
◆ numberOfFitFractionsLargerThanThreshold()
int FlexiFastAmplitudeIntegrator::numberOfFitFractionsLargerThanThreshold |
( |
double |
threshold | ) |
|
|
inline |
Definition at line 165 of file FlexiFastAmplitudeIntegrator.h.
MINT::counted_ptr< FitAmpPairList > _integCalc
int numberOfFitFractionsLargerThanThreshold(double threshold)
◆ reAddEvent()
void FlexiFastAmplitudeIntegrator::reAddEvent |
( |
DalitzEvent & |
evt | ) |
|
|
protected |
Definition at line 216 of file FlexiFastAmplitudeIntegrator.cpp.
MINT::counted_ptr< FitAmpPairList > _integCalc
virtual void reAddEvent(IDalitzEvent &evt, double weight=1)
double weight(IDalitzEvent *evtPtr)
◆ RealVal()
double FlexiFastAmplitudeIntegrator::RealVal |
( |
| ) |
|
|
inlinevirtual |
◆ reIntegrate()
void FlexiFastAmplitudeIntegrator::reIntegrate |
( |
| ) |
|
|
protected |
Definition at line 190 of file FlexiFastAmplitudeIntegrator.cpp.
MINT::counted_ptr< FitAmpPairList > _integCalc
void startReIntegration()
DalitzEventList _fastFlexiEventList
void reAddEvent(DalitzEvent &evt)
virtual unsigned int size() const
◆ saveEachAmpsHistograms()
void FlexiFastAmplitudeIntegrator::saveEachAmpsHistograms |
( |
const std::string & |
prefix | ) |
const |
◆ saveInterferenceHistograms()
void FlexiFastAmplitudeIntegrator::saveInterferenceHistograms |
( |
const std::string & |
prefix | ) |
const |
Definition at line 422 of file FlexiFastAmplitudeIntegrator.cpp.
MINT::counted_ptr< FitAmpPairList > _integCalc
void saveInterferenceHistograms(const std::string &prefix) const
◆ setPrecision()
void FlexiFastAmplitudeIntegrator::setPrecision |
( |
double |
prec | ) |
|
|
inline |
◆ setValues()
Definition at line 117 of file FlexiFastAmplitudeIntegrator.cpp.
143 cout <<
"ERROR in FlexiFastAmplitudeIntegrator::initialise" 144 <<
" amps->makeIntegCalculator()" 145 <<
" return NULL pointer!" << endl;
146 cout <<
"\t This will go wrong." << endl;
MINT::counted_ptr< FitAmpPairList > _integCalc
TRandom * makeNewRnd(int seed=-9999)
virtual MINT::counted_ptr< FitAmpPairList > makeFitAmpPairList()=0
MINT::IEventGenerator< IDalitzEvent > * _generator
IFastAmplitudeIntegrable * _amps
MINT::counted_ptr< FitAmpPairList > _integCalc_copyForDebug
◆ sumOfFitFractions()
double FlexiFastAmplitudeIntegrator::sumOfFitFractions |
( |
| ) |
|
|
inline |
◆ sumOfSqrtFitFractions()
double FlexiFastAmplitudeIntegrator::sumOfSqrtFitFractions |
( |
| ) |
|
|
inline |
◆ updateEventSet()
int FlexiFastAmplitudeIntegrator::updateEventSet |
( |
long int |
Nevents | ) |
|
|
protected |
Definition at line 158 of file FlexiFastAmplitudeIntegrator.cpp.
160 cout <<
" FlexiFastAmplitudeIntegrator::updateEventSet " 161 <<
" need to know pattern first." << endl;
168 if(missingEvents > 0){
169 cout <<
"missing events: " << missingEvents
175 cout <<
"want " << Nevents
177 <<
", so no more events missing." << endl;
MINT::counted_ptr< FitAmpPairList > _integCalc
int addEvents(long int Nevents)
virtual int numEvents() const
◆ variance()
double FlexiFastAmplitudeIntegrator::variance |
( |
| ) |
const |
◆ weight()
double FlexiFastAmplitudeIntegrator::weight |
( |
IDalitzEvent * |
evtPtr | ) |
|
|
protected |
◆ _amps
◆ _db
bool FlexiFastAmplitudeIntegrator::_db |
|
private |
◆ _fastFlexiEventList
◆ _generator
◆ _initialised
bool FlexiFastAmplitudeIntegrator::_initialised |
|
private |
◆ _integCalc
◆ _integCalc_copyForDebug
◆ _localRnd
◆ _mean
double FlexiFastAmplitudeIntegrator::_mean |
|
mutableprivate |
◆ _minEvents
const long int FlexiFastAmplitudeIntegrator::_minEvents =100 |
|
staticprivate |
◆ _Ncalls
int FlexiFastAmplitudeIntegrator::_Ncalls |
|
private |
◆ _NReEvaluations
int FlexiFastAmplitudeIntegrator::_NReEvaluations |
|
private |
◆ _numEvents
int FlexiFastAmplitudeIntegrator::_numEvents |
|
private |
◆ _pat
◆ _precision
double FlexiFastAmplitudeIntegrator::_precision |
|
protected |
◆ _rnd
TRandom* FlexiFastAmplitudeIntegrator::_rnd |
|
protected |
◆ _sumT
double FlexiFastAmplitudeIntegrator::_sumT |
|
private |
◆ _sumTfast
double FlexiFastAmplitudeIntegrator::_sumTfast |
|
private |
◆ _sumTRe
double FlexiFastAmplitudeIntegrator::_sumTRe |
|
private |
The documentation for this class was generated from the following files: