#include <EvtAmpAmpPdf.hh>
Inheritance diagram for EvtAmpAmpPdf< T >:
Public Member Functions | |
EvtPredGen< EvtPdfGen< T >, EvtPdfPred< T > > | accRejGen (const EvtPdf< T > &pc, int nMax, double factor=1.) |
virtual EvtAmpAmpPdf< T > * | clone () const |
virtual EvtValError | compute_integral (int N) const |
virtual EvtValError | compute_integral () const |
EvtValError | compute_mc_integral (const EvtPdf< T > &pc, int N) |
double | evaluate (const T &p) const |
EvtAmpAmpPdf (const EvtAmpAmpPdf< T > &other) | |
EvtAmpAmpPdf (int type, const EvtAmplitude< T > &1, const EvtAmplitude< T > &2) | |
EvtAmpAmpPdf () | |
EvtValError | findGenEff (const EvtPdf< T > &pc, int N, int nFindMax) |
EvtPdfMax< T > | findMax (const EvtPdf< T > &pc, int N) |
EvtValError | getItg (int N) const |
EvtValError | getItg () const |
virtual double | pdf (const T &p) const |
virtual T | randomPoint () |
void | setItg (EvtValError itg) |
virtual | ~EvtAmpAmpPdf () |
Protected Attributes | |
EvtValError | _itg |
Private Attributes | |
EvtAmplitude< T > * | _amp1 |
EvtAmplitude< T > * | _amp2 |
int | _type |
|
00027 {}
|
|
|
|
|
|
00035 { 00036 delete _amp1; 00037 delete _amp2; 00038 }
|
|
00302 { 00303 EvtPdfGen<T> gen(pc); 00304 EvtPdfDiv<T> pdfdiv(*this,pc); 00305 EvtPdfPred<T> pred(pdfdiv); 00306 pred.compute_max(iter(gen,nMax),iter(gen),factor); 00307 return EvtPredGen<EvtPdfGen<T>,EvtPdfPred<T> >(gen,pred); 00308 }
|
|
Implements EvtPdf< T >. 00040 { return new EvtAmpAmpPdf(*this); }
|
|
Reimplemented in EvtDalitzFlatPdf, EvtDalitzResPdf, EvtPdfSum< T >, and EvtPdfSum< EvtDalitzPoint >. 00095 { return compute_integral(); }
|
|
Reimplemented in EvtIntegPdf1D, EvtIntervalFlatPdf, EvtPdfSum< T >, and EvtPdfSum< EvtDalitzPoint >. 00094 { printf("Analytic integration of PDF is not defined\n"); assert(0); return compute_integral();}
|
|
00254 { 00255 assert(N > 0); 00256 00257 EvtValError otherItg = pc.getItg(); 00258 EvtPdfDiv<T> pdfdiv(*this,pc); 00259 EvtPdfUnary<T> unary(pdfdiv); 00260 00261 EvtPdfGen<T> gen(pc); 00262 EvtStreamInputIterator<T> begin = iter(gen,N); 00263 EvtStreamInputIterator<T> end; 00264 00265 double sum = 0.; 00266 double sum2 = 0.; 00267 while(!(begin == end)) { 00268 00269 double value = pdfdiv.evaluate(*begin++); 00270 sum += value; 00271 sum2 += value*value; 00272 } 00273 00274 EvtValError x; 00275 if(N > 0) { 00276 double av = sum/((double) N); 00277 if(N > 1) { 00278 double dev2 = (sum2 - av*av*N)/((double) (N - 1)); 00279 // Due to numerical precision dev2 may sometimes be negative 00280 if(dev2 < 0.) dev2 = 0.; 00281 double error = sqrt(dev2/((double) N)); 00282 x = EvtValError(av,error); 00283 } 00284 else x = EvtValError(av); 00285 } 00286 _itg = x * pc.getItg(); 00287 return _itg; 00288 }
|
|
00065 { 00066 if(p.isValid()) return pdf(p); 00067 else return 0.; 00068 }
|
|
00242 { 00243 assert(N > 0 || nFindMax > 0); 00244 EvtPredGen<EvtPdfGen<T>,EvtPdfPred<T> > gen = accRejGen(pc,nFindMax); 00245 int i; 00246 for(i=0;i<N;i++) gen(); 00247 double eff = double(gen.getPassed())/double(gen.getTried()); 00248 double err = sqrt(double(gen.getPassed()))/double(gen.getTried()); 00249 return EvtValError(eff,err); 00250 }
|
|
00231 { 00232 EvtPdfPred<T> pred(*this); 00233 EvtPdfGen<T> gen(pc); 00234 pred.compute_max(iter(gen,N),iter(gen)); 00235 EvtPdfMax<T> p = pred.getMax(); 00236 return p; 00237 }
|
|
00087 { 00088 if(!_itg.valueKnown()) _itg = compute_integral(N); 00089 return _itg; 00090 }
|
|
00083 { 00084 if(!_itg.valueKnown()) _itg = compute_integral(); 00085 return _itg; 00086 }
|
|
Implements EvtPdf< T >. 00043 { 00044 EvtComplex amp1 = _amp1->evaluate(p); 00045 EvtComplex amp2 = _amp2->evaluate(p); 00046 EvtComplex pr = amp1 * conj(amp2); 00047 00048 if(_type == POSRE) return real(pr) > 0 ? real(pr) : 0.; 00049 if(_type == NEGRE) return real(pr) < 0 ? -real(pr) : 0.; 00050 if(_type == POSIM) return imag(pr) > 0 ? imag(pr) : 0.; 00051 if(_type == NEGIM) return imag(pr) < 0 ? -imag(pr) : 0.; 00052 00053 assert(0); 00054 }
|
|
Reimplemented in EvtDalitzFlatPdf, EvtDalitzResPdf, EvtIntegPdf1D, EvtIntervalFlatPdf, EvtPdfSum< T >, and EvtPdfSum< EvtDalitzPoint >. 00292 { 00293 printf("Function defined for analytic PDFs only\n"); 00294 assert(0); 00295 T temp; 00296 return temp; 00297 }
|
|
00081 {_itg = itg; }
|
|
|
|
|
|
Reimplemented in EvtPdfSum< T >, and EvtPdfSum< EvtDalitzPoint >. |
|
|