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
EvtSVSCPiso.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/EvtId.hh"
27#include "EvtGenBase/EvtPDL.hh"
32
33#include <stdlib.h>
34#include <string>
35
36std::string EvtSVSCPiso::getName() const
37{
38 return "SVS_CP_ISO";
39}
40
42{
43 return new EvtSVSCPiso;
44}
45
47{
48 // check that there are 27 arguments
49 checkNArg( 27 );
50 checkNDaug( 2 );
51
53
56
57 // Set amplitude coefficients
59 // Calculate amplitude terms
61}
62
64{
65 m_Tp0 = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
66 getArg( 3 ) * sin( getArg( 4 ) ) );
67 m_Tp0_bar = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
68 getArg( 5 ) * sin( getArg( 6 ) ) );
69 m_T0p = EvtComplex( getArg( 7 ) * cos( getArg( 8 ) ),
70 getArg( 7 ) * sin( getArg( 8 ) ) );
71 m_T0p_bar = EvtComplex( getArg( 9 ) * cos( getArg( 10 ) ),
72 getArg( 9 ) * sin( getArg( 10 ) ) );
73 m_Tpm = EvtComplex( getArg( 11 ) * cos( getArg( 12 ) ),
74 getArg( 11 ) * sin( getArg( 12 ) ) );
75 m_Tpm_bar = EvtComplex( getArg( 13 ) * cos( getArg( 14 ) ),
76 getArg( 13 ) * sin( getArg( 14 ) ) );
77 m_Tmp = EvtComplex( getArg( 15 ) * cos( getArg( 16 ) ),
78 getArg( 15 ) * sin( getArg( 16 ) ) );
79 m_Tmp_bar = EvtComplex( getArg( 17 ) * cos( getArg( 18 ) ),
80 getArg( 17 ) * sin( getArg( 18 ) ) );
81 m_P0 = EvtComplex( getArg( 19 ) * cos( getArg( 20 ) ),
82 getArg( 19 ) * sin( getArg( 20 ) ) );
83 m_P0_bar = EvtComplex( getArg( 21 ) * cos( getArg( 22 ) ),
84 getArg( 21 ) * sin( getArg( 22 ) ) );
85 m_P1 = EvtComplex( getArg( 23 ) * cos( getArg( 24 ) ),
86 getArg( 23 ) * sin( getArg( 24 ) ) );
87 m_P1_bar = EvtComplex( getArg( 25 ) * cos( getArg( 26 ) ),
88 getArg( 25 ) * sin( getArg( 26 ) ) );
89}
90
92{
93 const double max1 = abs2( m_A_f ) + abs2( m_Abar_f );
94 const double max2 = abs2( m_A_fbar ) + abs2( m_Abar_fbar );
95 // Amplitude has momentum normalisation that roughly scales with (parent mass)/2
96 // so probability will scale with 0.25 * parenMassSq. Use 0.3 * parMassSq
97 // in case we get larger normalisation values
98 const double parMass = EvtPDL::getMeanMass( getParentId() );
99 const double max = 0.3 * parMass * parMass * ( max1 + max2 );
100 setProbMax( max );
101}
102
104{
105 //added by Lange Jan4,2000
106 static const EvtId B0 = EvtPDL::getId( "B0" );
107 static const EvtId B0B = EvtPDL::getId( "anti-B0" );
108
109 double t;
110 EvtId other_b;
111
112 int first_time = 0;
113 int flip = 0;
114 EvtId ds[2];
115
116 // Randomly generate the tag (B0 or B0B)
117 const double tag = EvtRandom::Flat( 0.0, 1.0 );
118 if ( tag < 0.5 ) {
119 EvtCPUtil::getInstance()->OtherB( p, t, other_b, 1.0 );
120 other_b = B0;
121 } else {
122 EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.0 );
123 other_b = B0B;
124 }
125
126 if ( p->getNDaug() == 0 )
127 first_time = 1;
128
129 if ( first_time ) {
130 if ( EvtRandom::Flat( 0.0, 1.0 ) < getArg( 2 ) )
131 flip = 1;
132 } else {
133 if ( getDaug( 0 ) != p->getDaug( 0 )->getId() )
134 flip = 1;
135 }
136
137 if ( !flip ) {
138 ds[0] = getDaug( 0 );
139 ds[1] = getDaug( 1 );
140 } else {
141 ds[0] = EvtPDL::chargeConj( getDaug( 0 ) );
142 ds[1] = EvtPDL::chargeConj( getDaug( 1 ) );
143 }
144
145 p->initializePhaseSpace( getNDaug(), ds );
146
147 EvtParticle *v, *s;
148 v = p->getDaug( 0 );
149 s = p->getDaug( 1 );
150
151 EvtComplex amp;
152
153 if ( m_charged == 0 ) {
154 if ( !flip ) {
155 if ( other_b == B0B ) {
156 amp = m_A_f * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
157 EvtComplex( cos( -2.0 * getArg( 0 ) ),
158 sin( -2.0 * getArg( 0 ) ) ) *
159 EvtComplex( 0.0, 1.0 ) * m_Abar_f *
160 sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
161 }
162 if ( other_b == B0 ) {
163 amp = m_A_f *
164 EvtComplex( cos( 2.0 * getArg( 0 ) ),
165 sin( 2.0 * getArg( 0 ) ) ) *
166 EvtComplex( 0.0, 1.0 ) *
167 sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
168 m_Abar_f * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
169 }
170 } else {
171 if ( other_b == B0B ) {
172 amp = m_A_fbar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
173 EvtComplex( cos( -2.0 * getArg( 0 ) ),
174 sin( -2.0 * getArg( 0 ) ) ) *
175 EvtComplex( 0.0, 1.0 ) * m_Abar_fbar *
176 sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
177 }
178 if ( other_b == B0 ) {
179 amp = m_A_fbar *
180 EvtComplex( cos( 2.0 * getArg( 0 ) ),
181 sin( 2.0 * getArg( 0 ) ) ) *
182 EvtComplex( 0.0, 1.0 ) *
183 sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
184 m_Abar_fbar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
185 }
186 }
187
188 } else {
189 amp = m_A_f;
190 }
191
192 const EvtVector4R p4_parent = v->getP4() + s->getP4();
193 const double norm = 1.0 / v->getP4().d3mag();
194
195 vertex( 0, amp * norm * p4_parent * ( v->epsParent( 0 ) ) );
196 vertex( 1, amp * norm * p4_parent * ( v->epsParent( 1 ) ) );
197 vertex( 2, amp * norm * p4_parent * ( v->epsParent( 2 ) ) );
198
199 return;
200}
201
203{
204 const int Q1 = EvtPDL::chg3( getDaug( 0 ) );
205 const int Q2 = EvtPDL::chg3( getDaug( 1 ) );
206
207 //***********************charged modes****************************
208
209 if ( Q1 > 0 && Q2 == 0 ) {
210 //V+ S0, so T+0 + 2 P1
211
212 m_charged = 1;
213 m_A_f = m_Tp0 + 2.0 * m_P1;
214 }
215
216 if ( Q1 < 0 && Q2 == 0 ) {
217 //V- S0, so T+0_bar + 2P1_bar
218
219 m_charged = 1;
220 m_A_f = m_Tp0_bar + 2.0 * m_P1_bar;
221 }
222
223 if ( Q1 == 0 && Q2 > 0 ) {
224 //V0 S+, so T0+ - 2 P1
225
226 m_charged = 1;
227 m_A_f = m_T0p - 2.0 * m_P1;
228 }
229
230 if ( Q1 == 0 && Q2 < 0 ) {
231 //V0 S-, so T0+_bar - 2 P1_bar
232
233 m_charged = 1;
234 m_A_f = m_T0p_bar - 2.0 * m_P1_bar;
235 }
236
237 //***********************neutral modes***************************
238
239 //V+ S-, so Af = T+- + P1 + P0
240 m_Apm = m_Tpm + m_P1 + m_P0;
242
243 //V- S+, so Af = T-+ - P1 + P0
244 m_Amp = m_Tmp - m_P1 + m_P0;
246
247 if ( Q1 > 0 && Q2 < 0 ) {
248 //V+ S-
249 m_charged = 0;
250 m_A_f = m_Apm;
252 m_A_fbar = m_Amp;
254 }
255
256 if ( Q1 < 0 && Q2 > 0 ) {
257 //V- S+
258 m_charged = 0;
259 m_A_f = m_Amp;
261 m_A_fbar = m_Apm;
263 }
264
265 if ( Q1 == 0 && Q2 == 0 ) {
266 //V0 S0
267 m_charged = 0;
268 m_A_f = m_T0p + m_Tp0 - m_Tpm - m_Tmp - 2.0 * m_P0;
270 m_A_fbar = m_A_f;
272 }
273}
double abs2(const EvtComplex &c)
static EvtCPUtil * getInstance()
Definition EvtCPUtil.cpp:42
void OtherB(EvtParticle *p, double &t, EvtId &otherb)
static const double c
Definition EvtConst.hh:30
void vertex(const EvtComplex &amp)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
EvtDecayBase()=default
int getNDaug() const
void checkSpinParent(EvtSpinType::spintype sp)
double getArg(unsigned int j)
void setProbMax(double prbmx)
EvtId getParentId() const
EvtId getDaug(int i) const
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
Definition EvtId.hh:27
static int chg3(EvtId i)
Definition EvtPDL.cpp:366
static double getMeanMass(EvtId i)
Definition EvtPDL.cpp:306
static EvtId chargeConj(EvtId id)
Definition EvtPDL.cpp:201
static EvtId getId(const std::string &name)
Definition EvtPDL.cpp:283
virtual EvtVector4C epsParent(int i) const
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
EvtId getId() const
const EvtVector4R & getP4() const
EvtParticle * getDaug(const int i)
size_t getNDaug() const
static double Flat()
Definition EvtRandom.cpp:95
EvtComplex m_Amp
EvtComplex m_T0p
EvtComplex m_A_f
EvtComplex m_T0p_bar
std::string getName() const override
EvtComplex m_P0_bar
EvtComplex m_Tmp_bar
EvtComplex m_Amp_bar
void setAmpCoeffs()
EvtComplex m_Abar_fbar
EvtComplex m_Tmp
EvtComplex m_Tp0_bar
EvtComplex m_Tpm
EvtComplex m_P0
EvtDecayBase * clone() const override
EvtComplex m_Abar_f
void init() override
EvtComplex m_A_fbar
EvtComplex m_Apm_bar
void decay(EvtParticle *p) override
EvtComplex m_Tp0
EvtComplex m_Tpm_bar
void initProbMax() override
EvtComplex m_P1
void calcAmpTerms()
EvtComplex m_Apm
EvtComplex m_P1_bar
double d3mag() const