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
EvtPto3P.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
23#include "EvtGenBase/EvtPDL.hh"
25using namespace EvtCyclic3;
26
28{
29 // There must be 3 daughters. All particles must be pseudoscalars.
30 // Charge must be conserved. Number of arguments must be non-zero.
31
32 EvtId parent = getParentId();
33 assert( getNDaug() == 3 );
34 EvtId dau0 = getDaug( 0 );
35 EvtId dau1 = getDaug( 1 );
36 EvtId dau2 = getDaug( 2 );
37
38 assert( EvtPDL::getSpinType( parent ) == EvtSpinType::SCALAR );
39 assert( EvtPDL::getSpinType( dau0 ) == EvtSpinType::SCALAR );
40 assert( EvtPDL::getSpinType( dau1 ) == EvtSpinType::SCALAR );
41 assert( EvtPDL::getSpinType( dau2 ) == EvtSpinType::SCALAR );
42 assert( EvtPDL::chg3( parent ) ==
43 EvtPDL::chg3( dau0 ) + EvtPDL::chg3( dau1 ) + EvtPDL::chg3( dau2 ) );
44 assert( getNArg() > 0 );
45
46 return EvtDalitzPlot( EvtPDL::getMass( dau0 ), EvtPDL::getMass( dau1 ),
47 EvtPDL::getMass( dau2 ), EvtPDL::getMass( parent ) );
48}
49
51 const EvtMultiChannelParser& parser )
52{
53 // Compute the interval size
54
55 EvtDalitzPlot plot = dp();
57 fact->build( parser, 10000 );
58 return fact;
59}
60
61std::vector<EvtVector4R> EvtPto3P::initDaughters( const EvtDalitzPoint& x ) const
62{
63 std::vector<EvtVector4R> v;
64 assert( x.isValid() );
65
66 // Calculate in the r.f. of AB
67
68 double eA = x.e( A, AB );
69 double eB = x.e( B, AB );
70 double eC = x.e( C, AB );
71 double pA = x.p( A, AB );
72 double pC = x.p( C, AB );
73 double cos = x.cosTh( CA, AB );
74 double sin = sqrt( 1.0 - cos * cos );
75
76 EvtVector4R vA( eA, 0, 0, pA );
77 EvtVector4R vB( eB, 0, 0, -pA );
78 EvtVector4R vC( eC, 0, pC * sin, pC * cos );
79
80 // Boost from rest frame of AB to rest-frame of decaying particle
81 // vboost is the 4-momentum of frame being boosted from in the frame
82 // being boosted into.
83
84 EvtVector4R vboost = vA + vB + vC;
85 vboost.set( 1, -vboost.get( 1 ) );
86 vboost.set( 2, -vboost.get( 2 ) );
87 vboost.set( 3, -vboost.get( 3 ) );
88 vA.applyBoostTo( vboost );
89 vB.applyBoostTo( vboost );
90 vC.applyBoostTo( vboost );
91
92 // Rotate
93
94 double alpha = EvtRandom::Flat( EvtConst::twoPi );
95 double beta = acos( EvtRandom::Flat( -1.0, 1.0 ) );
96 double gamma = EvtRandom::Flat( EvtConst::twoPi );
97
98 vA.applyRotateEuler( alpha, beta, gamma );
99 vB.applyRotateEuler( alpha, beta, gamma );
100 vC.applyRotateEuler( alpha, beta, gamma );
101
102 // Fill vector
103
104 assert( v.size() == 0 );
105 v.push_back( vA );
106 v.push_back( vB );
107 v.push_back( vC );
108
109 return v;
110}
virtual void build(const EvtMultiChannelParser &parser, int nItg)
static const double twoPi
Definition EvtConst.hh:27
int getNDaug() const
int getNArg() const
EvtId getParentId() const
EvtId getDaug(int i) const
Definition EvtId.hh:27
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.cpp:371
static int chg3(EvtId i)
Definition EvtPDL.cpp:366
static double getMass(EvtId i)
Definition EvtPDL.cpp:311
EvtDalitzPlot dp()
Definition EvtPto3P.cpp:27
std::vector< EvtVector4R > initDaughters(const EvtDalitzPoint &p) const override
Definition EvtPto3P.cpp:61
EvtAmpFactory< EvtDalitzPoint > * createFactory(const EvtMultiChannelParser &parser) override
Definition EvtPto3P.cpp:50
static double Flat()
Definition EvtRandom.cpp:95
void applyRotateEuler(double alpha, double beta, double gamma)
double get(int i) const
void set(int i, double d)
void applyBoostTo(const EvtVector4R &p4, bool inverse=false)