BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDalitzFlatPdf.cc
Go to the documentation of this file.
2/*******************************************************************************
3 * Project: BaBar detector at the SLAC PEP-II B-factory
4 * Package: EvtGenBase
5 * File: $Id: EvtDalitzFlatPdf.cc,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
6 * Author: Alexei Dvoretskii, [email protected], 2001-2002
7 *
8 * Copyright (C) 2002 Caltech
9 *******************************************************************************/
10
13
15 : EvtPdf<EvtDalitzPoint>(), _dp(dp)
16{}
17
19 : EvtPdf<EvtDalitzPoint>(other), _dp(other._dp)
20{}
21
23{}
24
26{
27 return new EvtDalitzFlatPdf(*this);
28}
29
31{
32 return 1.;
33}
34
36{
37 return EvtValError(_dp.getArea(N),0.);
38}
39
41{
42 // To obtain a uniform distribution generate
43 // in terms of q's. Generate in a box that circumscribes the
44 // Dalitz plot. Accept points inside. If there are two
45 // many unsuccessful attempts it's a hint that the Dalitz plot
46 // area is tiny compared to the box. It's a pathological
47 // case. Abort.
48
51
52 int n = 0;
53 int maxTries = 1000;
54 while(n++ < maxTries) {
55
56 double q1 = EvtRandom::Flat(_dp.qAbsMin(pair1),_dp.qAbsMax(pair2));
57 double q2 = EvtRandom::Flat(_dp.qAbsMin(pair2),_dp.qAbsMax(pair2));
58
59 EvtDalitzCoord point(pair1,q1,pair2,q2);
60 EvtDalitzPoint x(_dp,point);
61
62 if(x.isValid()) return x;
63 }
64
65 printf("No point generated for dalitz plot after %d tries\n",maxTries);
66 assert(0);
67}
const Int_t n
Double_t x[10]
EvtDalitzFlatPdf(const EvtDalitzPlot &dp)
EvtDalitzPlot _dp
virtual double pdf(const EvtDalitzPoint &) const
virtual EvtDalitzPoint randomPoint()
virtual ~EvtDalitzFlatPdf()
virtual EvtPdf< EvtDalitzPoint > * clone() const
double getArea(int N=1000, EvtCyclic3::Pair i=EvtCyclic3::AB, EvtCyclic3::Pair j=EvtCyclic3::BC) const
double qAbsMin(EvtCyclic3::Pair i) const
double qAbsMax(EvtCyclic3::Pair i) const
Definition: EvtPdf.hh:57
virtual EvtValError compute_integral() const
Definition: EvtPdf.hh:92
static double Flat()
Definition: EvtRandom.cc:74