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
EvtHypNonLepton.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
26#include "EvtGenBase/EvtPDL.hh"
31
33{
34 return new EvtHypNonLepton;
35}
36
37std::string EvtHypNonLepton::getName() const
38{
39 return "HypNonLepton";
40}
41
43{
44 if ( getNArg() < 2 || getNArg() > 3 ) { // alpha phi gamma delta
45 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
46 << " ERROR: EvtHypNonLepton generator expected 2 or 3 arguments but found: "
47 << getNArg() << std::endl;
48 EvtGenReport( EVTGEN_INFO, "EvtGen" )
49 << " 1. Decay asymmetry parameter - alpha" << std::endl;
50 EvtGenReport( EVTGEN_INFO, "EvtGen" )
51 << " 2. Parameter phi - in degrees (not radians)" << std::endl;
52 EvtGenReport( EVTGEN_INFO, "EvtGen" )
53 << " 3. Note on every x-th decay" << std::endl;
54 ::abort();
55 }
56
57 if ( getNDaug() != 2 ) { // Check that there are 2 daughters only
58 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
59 << " ERROR: EvtHypNonLepton generator expected 2 daughters but found: "
60 << getNDaug() << std::endl;
61 ::abort();
62 }
63
64 // Check particles spins
66 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
67 << " ERROR: EvtHypNonLepton generator expected dirac parent particle, but found "
69 << " spin degrees of freedom" << std::endl;
70 ::abort();
71 }
73 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
74 << " ERROR: EvtHypNonLepton generator expected the first child to be dirac particle, but found "
76 << " spin degrees of freedom" << std::endl;
77 ::abort();
78 }
80 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
81 << " ERROR: EvtHypNonLepton generator expected the second child to be scalar particle, but found "
83 << " spin degrees of freedom" << std::endl;
84 ::abort();
85 }
86
87 // Read all parameters
88 m_alpha = getArg( 0 );
89 m_phi = getArg( 1 ) * EvtConst::pi / 180;
90 if ( getNArg() == 3 )
91 m_noTries = static_cast<decltype( m_noTries )>( getArg( 2 ) );
92 else
93 m_noTries = 0;
94
95 // calculate additional parameters
96 double p, M, m1, m2;
97 double p_to_s, beta, delta, gamma;
98
100 m1 = EvtPDL::getMass( getDaug( 0 ) );
101 m2 = EvtPDL::getMass( getDaug( 1 ) );
102
103 if ( m1 + m2 >= M ) {
104 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
105 << " ERROR: EvtHypNonLepton found impossible decay: " << M
106 << " --> " << m1 << " + " << m2 << " GeV\n"
107 << std::endl;
108 ::abort();
109 }
110
111 p = sqrt( M * M - ( m1 + m2 ) * ( m1 + m2 ) ) *
112 sqrt( M * M - ( m1 - m2 ) * ( m1 - m2 ) ) / 2. / M;
113
114 beta = sqrt( 1. - m_alpha * m_alpha ) * sin( m_phi );
115 delta = -atan2( beta, m_alpha );
116 gamma = sqrt( 1. - m_alpha * m_alpha - beta * beta );
117 p_to_s = sqrt( ( 1. - gamma ) / ( 1. + gamma ) );
118
119 m_B_to_A = p_to_s * ( m1 + sqrt( p * p + m1 * m1 ) ) / p *
120 EvtComplex( cos( delta ), sin( delta ) );
121}
122
124{
125 double maxProb, m1, m2, M, p;
126
128 m1 = EvtPDL::getMass( getDaug( 0 ) );
129 m2 = EvtPDL::getMass( getDaug( 1 ) );
130
131 if ( m1 + m2 >= M ) {
132 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
133 << " ERROR: EvtHypNonLepton found impossible decay: " << M
134 << " --> " << m1 << " + " << m2 << " GeV\n"
135 << std::endl;
136 ::abort();
137 }
138
139 p = sqrt( M * M - ( m1 + m2 ) * ( m1 + m2 ) ) *
140 sqrt( M * M - ( m1 - m2 ) * ( m1 - m2 ) ) / 2 / M;
141 maxProb = 16 * M *
142 ( sqrt( p * p + m1 * m1 ) + m1 +
143 abs( m_B_to_A ) * abs( m_B_to_A ) *
144 ( sqrt( p * p + m1 * m1 ) - m1 ) );
145 //maxProb *= G_F*M_pi*M_pi;
146
147 setProbMax( maxProb );
148 EvtGenReport( EVTGEN_INFO, "EvtGen" )
149 << " EvtHypNonLepton set up maximum probability to " << maxProb
150 << std::endl;
151}
152
154{
155 parent->initializePhaseSpace( getNDaug(), getDaugs() );
156 calcAmp( &m_amp2, parent );
157}
158
160{
161 static thread_local decltype( m_noTries ) noTries = 0;
162 int i;
163 EvtComplex Matrix[2][2];
164
165 //G_F = 1.16637e-5;
166 //M_pi = 0.13957;
167
168 for ( i = 0; i < 4; i++ ) {
169 //std::cout << "--------------------------------------------------" << std::endl;
170 Matrix[i / 2][i % 2] = EvtLeptonSCurrent(
171 parent->sp( i / 2 ), parent->getDaug( 0 )->spParent( i % 2 ) );
172 //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
173 Matrix[i / 2][i % 2] -=
174 m_B_to_A *
175 EvtLeptonPCurrent( parent->sp( i / 2 ),
176 parent->getDaug( 0 )->spParent( i % 2 ) );
177 //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
178 //Matrix[i/2][i%2] *= G_F*M_pi*M_pi;
179 //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
180 //std::cout << "--------------------------------------------------" << std::endl;
181 amp->vertex( i / 2, i % 2, Matrix[i / 2][i % 2] );
182 }
183
184 if ( m_noTries > 0 )
185 if ( !( ( ++noTries ) % m_noTries ) )
186 EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
187 << " EvtHypNonLepton already finished " << noTries
188 << " matrix element calculations" << std::endl;
189}
double abs(const EvtComplex &c)
EvtComplex EvtLeptonSCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtComplex EvtLeptonPCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition EvtReport.cpp:32
@ EVTGEN_INFO
Definition EvtReport.hh:52
@ EVTGEN_DEBUG
Definition EvtReport.hh:53
@ EVTGEN_ERROR
Definition EvtReport.hh:49
void vertex(const EvtComplex &amp)
Definition EvtAmp.cpp:453
static const double pi
Definition EvtConst.hh:26
EvtAmp m_amp2
EvtDecayBase()=default
int getNDaug() const
int getNArg() const
double getArg(unsigned int j)
void setProbMax(double prbmx)
EvtId getParentId() const
EvtId getDaug(int i) const
const EvtId * getDaugs() const
std::string getName() const override
void initProbMax() override
void init() override
std::size_t m_noTries
void calcAmp(EvtAmp *amp, EvtParticle *parent)
EvtDecayBase * clone() const override
void decay(EvtParticle *p) override
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.cpp:371
static double getMass(EvtId i)
Definition EvtPDL.cpp:311
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
virtual EvtDiracSpinor spParent(int) const
EvtParticle * getDaug(const int i)
virtual EvtDiracSpinor sp(int) const
static int getSpin2(spintype stype)