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