EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
EvtDalitzFlatPdf.cpp
Go to the documentation of this file.
1
2/***********************************************************************
3* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4* *
5* This file is part of EvtGen. *
6* *
7* EvtGen is free software: you can redistribute it and/or modify *
8* it under the terms of the GNU General Public License as published by *
9* the Free Software Foundation, either version 3 of the License, or *
10* (at your option) any later version. *
11* *
12* EvtGen is distributed in the hope that it will be useful, *
13* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15* GNU General Public License for more details. *
16* *
17* You should have received a copy of the GNU General Public License *
18* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19***********************************************************************/
20
22
27
29 EvtPdf<EvtDalitzPoint>( other ), m_dp( other.m_dp )
30{
31}
32
34{
35 return new EvtDalitzFlatPdf( *this );
36}
37
39{
40 return 1.;
41}
42
44{
45 return EvtValError( m_dp.getArea( N ), 0. );
46}
47
49{
50 // To obtain a uniform distribution generate
51 // in terms of q's. Generate in a box that circumscribes the
52 // Dalitz plot. Accept points inside. If there are two
53 // many unsuccessful attempts it's a hint that the Dalitz plot
54 // area is tiny compared to the box. It's a pathological
55 // case. Abort.
56
59
60 int n = 0;
61 int maxTries = 1000;
62 while ( n++ < maxTries ) {
63 double q1 = EvtRandom::Flat( m_dp.qAbsMin( pair1 ),
64 m_dp.qAbsMax( pair2 ) );
65 double q2 = EvtRandom::Flat( m_dp.qAbsMin( pair2 ),
66 m_dp.qAbsMax( pair2 ) );
67
68 EvtDalitzCoord point( pair1, q1, pair2, q2 );
69 EvtDalitzPoint x( m_dp, point );
70
71 if ( x.isValid() )
72 return x;
73 }
74
75 printf( "No point generated for dalitz plot after %d tries\n", maxTries );
76 return EvtDalitzPoint();
77}
EvtDalitzFlatPdf(const EvtDalitzPlot &dp)
EvtPdf< EvtDalitzPoint > * clone() const override
double pdf(const EvtDalitzPoint &) const override
EvtDalitzPoint randomPoint() override
bool isValid() const
virtual EvtValError compute_integral() const
Definition EvtPdf.hh:113
static double Flat()
Definition EvtRandom.cpp:95