14 return (0 == _mps ? MinuitParameterSet::getDefaultSet() : _mps);
17 return (0 == _mps ? MinuitParameterSet::getDefaultSet() : _mps);
21 return _faint.save(fname);
26 if( ! _faint.initialised()){
28 cout <<
"DalitzPdfBaseFastInteg::getNorm: don't know event pattern!" 34 cout <<
"DalitzPdfBaseFastInteg::getNorm: don't have amps!" 47 _faint.initialise(_commaSepList_of_SavedIntegrators
57 #ifdef CHECK_INTEGRATOR 58 cout <<
"WARNING in DalitzPdfBaseFastInteg::getNorm!!!" 59 <<
" using old, inefficient integrator." 60 <<
" Won't work for efficiencies!!" 62 _mcint.initialise(evtPtr->eventPattern()
71 _norm = _faint.getVal();
74 #ifdef CHECK_INTEGRATOR 75 double fastVal = _norm;
76 double oldVal = _mcint.getVal();
77 cout <<
"DalitzPdfBaseFastInteg::getNorm:" 78 <<
" compare mcint integral with fast: " 79 <<
"\n\t old: " << oldVal <<
" , fast: " << fastVal
80 <<
", ratio " << oldVal/fastVal
90 if(_pat.empty())
return 0;
91 if(0 == getAmps())
return 0;
93 ptr(getAmps()->makeEventGenerator(_pat));
94 _defaultGenerator = ptr;
95 return _defaultGenerator.
get();
99 if(0 == _generator) makeDefaultGenerator();
104 cout <<
"WARNING in DalitzPdfBaseFastInteg::getEventGenerator() const" 105 <<
" returning 0 pointer." << endl;
112 #ifdef CHECK_INTEGRATOR 113 _mcint.setPrecision(_precision);
115 _faint.setPrecision(_precision);
140 , _generator(generator)
142 , _defaultGenerator(0)
143 , _commaSepList_of_SavedIntegrators(
"")
146 , _redoGradNorm(true)
169 , _generator(generator)
171 , _defaultGenerator(0)
172 , _commaSepList_of_SavedIntegrators(
"")
175 , _redoGradNorm(true)
191 , _precision(other._precision)
193 , _countedAmps(other._countedAmps)
195 , _generator(other._generator)
196 , _integrating(other._integrating)
197 , _defaultGenerator(other._defaultGenerator)
198 , _commaSepList_of_SavedIntegrators(other._commaSepList_of_SavedIntegrators)
201 , _redoGradNorm(true)
210 if(dbThis)cout <<
"DalitzPdfBaseFastInteg::~DalitzPdfBaseFastInteg() called" << endl;
212 if(dbThis)cout <<
"DalitzPdfBaseFastInteg::~DalitzPdfBaseFastInteg() done" << endl;
219 cout <<
"DalitzPdfBaseFastInteg::makeAmps() with MPS pointer " <<
getMPS()
220 <<
" and _amps pointer " <<
_amps << endl;
222 cout <<
"DalitzPdfBaseFastInteg::getAmps() making _amps with pointer " <<
getMPS()
245 static double maxVal=0;
256 double val=num/
_norm;
257 if(fabs(val) > maxVal){
260 cout <<
"biggest un_normalised / norm, yet: " 261 << num <<
" / " <<
_norm 262 <<
" = " << num/
_norm 265 cout <<
"for event: "; evt.
print(); cout << endl;
278 if(dbThis) cout <<
"DalitzPdfBaseFastInteg::getVal_noPs: returning " 300 unsigned int N= mps->
size();
302 std::vector<double> gradAmpSum(N);
303 for(
unsigned int j=0; j < gradAmpSum.size(); j++) gradAmpSum[j]= 0.;
313 if(
_gradNorm.size() != grad.size() || gradAmpSum.size() !=grad.size()
314 || gradAmpSum.size() !=
_gradNorm.size()){
315 cout <<
"array size mismatch in DalitzPdfBaseFastInteg::Gradient" << endl;
319 for (
unsigned int i=0; i<N; i++) {
std::vector< DalitzHistoSet > GetEachAmpsHistograms()
std::vector< DalitzHistoSet > GetInterferenceHistograms()
virtual double getVal(IDalitzEvent &evt)
void saveEachAmpsHistograms(const std::string &prefix) const
virtual double getVal_noPs(IDalitzEvent &evt)
MINT::IEventGenerator< IDalitzEvent > * makeDefaultGenerator()
virtual double phaseSpace() const =0
std::vector< DalitzHistoSet > GetInterferenceHistograms()
void setIntegratorFileName(const std::string &commaSeparatedList)
virtual int iFixInit() const =0
MINT::IEventGenerator< IDalitzEvent > * getEventGenerator()
void saveInterferenceHistograms(const std::string &prefix) const
IMinuitParameter * getParPtr(unsigned int i)
unsigned int size() const
virtual double getVal_withPs(IDalitzEvent &evt)
void doFinalStats(MINT::Minimiser *mini=0)
virtual void print(std::ostream &os=std::cout) const =0
bool saveIntegrator(const std::string &fname) const
void setIntegrationPrecision(double prec)
virtual void Gradient(IDalitzEvent &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
MINT::counted_ptr< IFastAmplitudeIntegrable > _countedAmps
virtual DalitzHistoSet interferenceHistoSet() const
void GradientForLasso(MINT::MinuitParameterSet *mps, std::vector< double > &grad)
DalitzPdfBaseFastInteg(const DalitzEventPattern &pat, MINT::IEventGenerator< IDalitzEvent > *generator, IFastAmplitudeIntegrable *amps, double precision=1.e-3, MINT::MinuitParameterSet *mps=0)
virtual DalitzHistoSet histoSet() const
virtual bool integrating()
DalitzHistoSet histoSet() const
virtual double un_normalised_noPs(IDalitzEvent &evt)=0
std::string _commaSepList_of_SavedIntegrators
bool makePlots(const std::string &filename) const
virtual void doFinalStats(MINT::Minimiser *mini=0)
virtual bool hidden() const =0
IFastAmplitudeIntegrable * _amps
virtual const DalitzEventPattern & eventPattern() const =0
virtual void GradientForLasso(std::vector< double > &grad)
std::vector< double > _gradNorm
MINT::MinuitParameterSet * getMPS()
std::vector< DalitzHistoSet > GetEachAmpsHistograms()
void saveEachAmpsHistograms(const std::string &prefix) const
virtual void Gradient(IDalitzEvent &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
FastAmplitudeIntegrator _faint
virtual double phaseSpace(IDalitzEvent &evt)
bool save(const std::string &filename="DalitzHistos.root") const
virtual ~DalitzPdfBaseFastInteg()
DalitzHistoSet interferenceHistoSet() const
void Gradient(MINT::MinuitParameterSet *mps, std::vector< double > &grad)
void saveInterferenceHistograms(const std::string &prefix) const