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
EvtFlatSqDalitz.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
25#include "EvtGenBase/EvtPDL.hh"
29
30#include <cmath>
31#include <string>
32
33std::string EvtFlatSqDalitz::getName() const
34{
35 return "FLATSQDALITZ";
36}
37
39{
40 return new EvtFlatSqDalitz;
41}
42
47
49{
50 //check there are 3 daughters
51 checkNDaug( 3 );
52
53 // check that there are 0 arguments
54 checkNArg( 0, 2, 4 );
55
56 if ( getNArg() > 0 ) {
57 m_mPrimeMin = getArg( 0 );
58 m_mPrimeMax = getArg( 1 );
59 }
60 if ( getNArg() > 2 ) {
63 }
64}
65
67{
70 const double mParent = p->mass();
71 EvtParticle* daug1 = p->getDaug( 0 );
72 EvtParticle* daug2 = p->getDaug( 1 );
73 EvtParticle* daug3 = p->getDaug( 2 );
74 const double mDaug1 = daug1->mass();
75 const double mDaug2 = daug2->mass();
76 const double mDaug3 = daug3->mass();
77 const double mParentSq = mParent * mParent;
78 const double mDaug1Sq = mDaug1 * mDaug1;
79 const double mDaug2Sq = mDaug2 * mDaug2;
80 const double mDaug3Sq = mDaug3 * mDaug3;
81
82 // Generate m' and theta'
83 const double mPrime = EvtRandom::Flat( m_mPrimeMin, m_mPrimeMax );
84 const double thetaPrime = EvtRandom::Flat( m_thetaPrimeMin, m_thetaPrimeMax );
85
86 // calculate m12 and m23
87 const double m12 = 0.5 * ( std::cos( mPrime * EvtConst::pi ) + 1 ) *
88 ( mParent - ( mDaug1 + mDaug2 + mDaug3 ) ) +
89 mDaug1 + mDaug2;
90 const double m12Sq = m12 * m12;
91
92 const double en1 = ( m12Sq - mDaug2Sq + mDaug1Sq ) / ( 2. * m12 );
93 const double en3 = ( mParentSq - m12Sq - mDaug3Sq ) / ( 2. * m12 );
94
95 const double p1 = std::sqrt( en1 * en1 - mDaug1Sq );
96 const double p3 = std::sqrt( en3 * en3 - mDaug3Sq );
97 const double m13Sq =
98 mDaug1Sq + mDaug3Sq +
99 2.0 * ( en1 * en3 - p1 * p3 * std::cos( EvtConst::pi * thetaPrime ) );
100 const double m23Sq = mParentSq - m12Sq - m13Sq + mDaug1Sq + mDaug2Sq +
101 mDaug3Sq;
102
103 // Turn m12 and m23 into momenta
104 EvtGenKine::ThreeBodyKine( m12Sq, m23Sq, p );
105
106 return;
107}
static const double pi
Definition EvtConst.hh:26
EvtDecayBase()=default
int getNDaug() const
int getNArg() const
double getArg(unsigned int j)
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
const EvtId * getDaugs() const
std::string getName() const override
void decay(EvtParticle *p) override
void init() override
void initProbMax() override
EvtDecayBase * clone() const override
static void ThreeBodyKine(const double m12Sq, const double m23Sq, EvtParticle *p)
EvtParticle * getDaug(const int i)
double mass() const
bool generateMassTree()
void makeDaughters(size_t ndaug, const EvtId *id)
static double Flat()
Definition EvtRandom.cpp:95