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
EvtSSDCP.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
27#include "EvtGenBase/EvtPDL.hh"
33
34#include <stdlib.h>
35#include <string>
36using std::endl;
37
38std::string EvtSSDCP::getName() const
39{
40 return "SSD_CP";
41}
42
44{
45 return new EvtSSDCP;
46}
47
49{
50 // check that there are 8 or 12 or 14 arguments
51
52 checkNArg( 14, 12, 8 );
53 checkNDaug( 2 );
54
57
58 // Check it is a B0 or B0s
59 if ( ( getParentId() != EvtPDL::getId( "B0" ) ) &&
60 ( getParentId() != EvtPDL::getId( "anti-B0" ) ) &&
61 ( getParentId() != EvtPDL::getId( "B_s0" ) ) &&
62 ( getParentId() != EvtPDL::getId( "anti-B_s0" ) ) ) {
63 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
64 << "EvtSSDCP only decays B0 and B0s" << std::endl;
65 ::abort();
66 }
67
68 if ( ( !( d1type == EvtSpinType::SCALAR || d2type == EvtSpinType::SCALAR ) ) ||
69 ( !( ( d2type == EvtSpinType::SCALAR ) ||
70 ( d2type == EvtSpinType::VECTOR ) ||
71 ( d2type == EvtSpinType::TENSOR ) ) ) ||
72 ( !( ( d1type == EvtSpinType::SCALAR ) ||
73 ( d1type == EvtSpinType::VECTOR ) ||
74 ( d1type == EvtSpinType::TENSOR ) ) ) ) {
75 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
76 << "EvtSSDCP generator expected "
77 << "one of the daugters to be a scalar, the other either scalar, vector, or tensor, found:"
78 << EvtPDL::name( getDaug( 0 ) ).c_str() << " and "
79 << EvtPDL::name( getDaug( 1 ) ).c_str() << endl;
80 EvtGenReport( EVTGEN_ERROR, "EvtGen" )
81 << "Will terminate execution!" << endl;
82 ::abort();
83 }
84
85 m_dm = getArg( 0 ) / EvtConst::c; //units of 1/mm
86
87 m_dgog = getArg( 1 );
88
89 m_qoverp = getArg( 2 ) * EvtComplex( cos( getArg( 3 ) ), sin( getArg( 3 ) ) );
90 m_poverq = 1.0 / m_qoverp;
91
92 m_A_f = getArg( 4 ) * EvtComplex( cos( getArg( 5 ) ), sin( getArg( 5 ) ) );
93
94 m_Abar_f = getArg( 6 ) * EvtComplex( cos( getArg( 7 ) ), sin( getArg( 7 ) ) );
95
96 if ( getNArg() >= 12 ) {
97 m_eigenstate = false;
98 m_A_fbar = getArg( 8 ) *
99 EvtComplex( cos( getArg( 9 ) ), sin( getArg( 9 ) ) );
100 m_Abar_fbar = getArg( 10 ) *
101 EvtComplex( cos( getArg( 11 ) ), sin( getArg( 11 ) ) );
102 } else {
103 //I'm somewhat confused about this. For a CP eigenstate set the
104 //amplitudes to the same. For a non CP eigenstate CPT invariance
105 //is enforced. (ryd)
106 if ( ( getDaug( 0 ) == EvtPDL::chargeConj( getDaug( 0 ) ) &&
107 getDaug( 1 ) == EvtPDL::chargeConj( getDaug( 1 ) ) ) ||
108 ( getDaug( 0 ) == EvtPDL::chargeConj( getDaug( 1 ) ) &&
109 getDaug( 1 ) == EvtPDL::chargeConj( getDaug( 0 ) ) ) ) {
110 m_eigenstate = true;
111 } else {
112 m_eigenstate = false;
115 }
116 }
117
118 //FS: new check for z
119 if ( getNArg() == 14 ) { //FS Set m_z parameter if provided else set it 0
120 m_z = EvtComplex( getArg( 12 ), getArg( 13 ) );
121 } else {
122 m_z = EvtComplex( 0.0, 0.0 );
123 }
124
125 // FS substituted next 2 lines...
126
127 //
128 // m_gamma=EvtPDL::getctau(EvtPDL::getId("B0")); //units of 1/mm
129 //m_dgamma=m_gamma*0.5*m_dgog;
130 //
131 // ...with:
132
133 if ( ( getParentId() == EvtPDL::getId( "B0" ) ) ||
134 ( getParentId() == EvtPDL::getId( "anti-B0" ) ) ) {
135 m_gamma = 1. / EvtPDL::getctau( EvtPDL::getId( "B0" ) ); //gamma/c (1/mm)
136 } else {
137 m_gamma = 1. / EvtPDL::getctau( EvtPDL::getId( "B_s0" ) );
138 }
139
140 m_dgamma = m_gamma * m_dgog; //dgamma/c (1/mm)
141
142 if ( verbose() ) {
143 EvtGenReport( EVTGEN_INFO, "EvtGen" )
144 << "SSD_CP will generate CP/CPT violation:" << endl
145 << endl
146 << " " << EvtPDL::name( getParentId() ).c_str() << " --> "
147 << EvtPDL::name( getDaug( 0 ) ).c_str() << " + "
148 << EvtPDL::name( getDaug( 1 ) ).c_str() << endl
149 << endl
150 << "using parameters:" << endl
151 << endl
152 << " delta(m) = " << m_dm << " hbar/ps" << endl
153 << "dGamma = " << m_dgamma << " ps-1" << endl
154 << " q/p = " << m_qoverp << endl
155 << " z = " << m_z << endl
156 << " tau = " << 1. / m_gamma << " ps" << endl;
157 }
158}
159
161{
162 double theProbMax = abs( m_A_f ) * abs( m_A_f ) +
163 abs( m_Abar_f ) * abs( m_Abar_f ) +
164 abs( m_A_fbar ) * abs( m_A_fbar ) +
166
167 if ( m_eigenstate )
168 theProbMax *= 2;
169
172 if ( d1type == EvtSpinType::TENSOR || d2type == EvtSpinType::TENSOR )
173 theProbMax *= 10;
174
175 setProbMax( theProbMax );
176}
177
179{
180 static const EvtId B0 = EvtPDL::getId( "B0" );
181 static const EvtId B0B = EvtPDL::getId( "anti-B0" );
182
183 static const EvtId B0s = EvtPDL::getId( "B_s0" );
184 static const EvtId B0Bs = EvtPDL::getId( "anti-B_s0" );
185
186 double t;
187 EvtId other_b;
188 EvtId daugs[2];
189
190 int flip = 0;
191 if ( !m_eigenstate ) {
192 if ( EvtRandom::Flat( 0.0, 1.0 ) < 0.5 )
193 flip = 1;
194 }
195
196 if ( !flip ) {
197 daugs[0] = getDaug( 0 );
198 daugs[1] = getDaug( 1 );
199 } else {
200 daugs[0] = EvtPDL::chargeConj( getDaug( 0 ) );
201 daugs[1] = EvtPDL::chargeConj( getDaug( 1 ) );
202 }
203
204 EvtParticle* d;
205 p->initializePhaseSpace( 2, daugs );
206
207 EvtComplex amp;
208
209 EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 ); // t is c*Dt (mm)
210 // EvtIncoherentMixing::OtherB( p , t , other_b , 0.5 ) ;
211
212 //if (flip) t=-t;
213
214 //FS We assume DGamma=GammaLow-GammaHeavy and Dm=mHeavy-mLow
215 EvtComplex expH = exp( -EvtComplex( -0.25 * m_dgamma * t, 0.5 * m_dm * t ) );
216 EvtComplex expL = exp( EvtComplex( -0.25 * m_dgamma * t, 0.5 * m_dm * t ) );
217 //FS Definition of gp and gm
218 EvtComplex gp = 0.5 * ( expL + expH );
219 EvtComplex gm = 0.5 * ( expL - expH );
220 //FS Calculation os sqrt(1-z^2)
221 EvtComplex sqz = sqrt( abs( 1 - m_z * m_z ) ) *
222 exp( EvtComplex( 0, arg( 1 - m_z * m_z ) / 2 ) );
223
224 //EvtComplex BB=0.5*(expL+expH); // <B0|B0(t)>
225 //EvtComplex barBB=m_qoverp*0.5*(expL-expH); // <B0bar|B0(t)>
226 //EvtComplex BbarB=m_poverq*0.5*(expL-expH); // <B0|B0bar(t)>
227 //EvtComplex barBbarB=BB; // <B0bar|B0bar(t)>
228 // FS redefinition of these guys... (See BAD #188 eq.35 for ref.)
229 // q/p is taken as in the BaBar Phys. Book (opposite sign wrt ref.)
230 EvtComplex BB = gp + m_z * gm; // <B0|B0(t)>
231 EvtComplex barBB = sqz * m_qoverp * gm; // <B0bar|B0(t)>
232 EvtComplex BbarB = sqz * m_poverq * gm; // <B0|B0bar(t)>
233 EvtComplex barBbarB = gp - m_z * gm; // <B0bar|B0bar(t)>
234
235 if ( !flip ) {
236 if ( other_b == B0B || other_b == B0Bs ) {
237 //at t=0 we have a B0
238 //EvtGenReport(EVTGEN_INFO,"EvtGen") << "B0B"<<endl;
239 amp = BB * m_A_f + barBB * m_Abar_f;
240 //std::cout << "noflip B0B tag:"<<amp<<std::endl;
241 //amp=0.0;
242 }
243 if ( other_b == B0 || other_b == B0s ) {
244 //EvtGenReport(EVTGEN_INFO,"EvtGen") << "B0"<<endl;
245 amp = BbarB * m_A_f + barBbarB * m_Abar_f;
246 }
247 } else {
248 if ( other_b == B0 || other_b == B0s ) {
249 amp = BbarB * m_A_fbar + barBbarB * m_Abar_fbar;
250 //std::cout << "flip B0 tag:"<<amp<<std::endl;
251 //amp=0.0;
252 }
253 if ( other_b == B0B || other_b == B0Bs ) {
254 amp = BB * m_A_fbar + barBB * m_Abar_fbar;
255 }
256 }
257
258 EvtVector4R p4_parent = p->getP4Restframe();
259
261
262 EvtVector4R momv;
263 EvtVector4R moms;
264
265 if ( d2type == EvtSpinType::SCALAR ) {
266 d2type = EvtPDL::getSpinType( getDaug( 0 ) );
267 d = p->getDaug( 0 );
268 momv = d->getP4();
269 moms = p->getDaug( 1 )->getP4();
270 } else {
271 d = p->getDaug( 1 );
272 momv = d->getP4();
273 moms = p->getDaug( 0 )->getP4();
274 }
275
276 if ( d2type == EvtSpinType::SCALAR ) {
277 vertex( amp );
278 }
279
280 if ( d2type == EvtSpinType::VECTOR ) {
281 double norm = momv.mass() / ( momv.d3mag() * p->mass() );
282
283 //std::cout << amp << " " << norm << " " << p4_parent << d->getP4()<< std::endl;
284 // std::cout << EvtPDL::name(d->getId()) << " " << EvtPDL::name(p->getDaug(0)->getId()) <<
285 // " 1and2 " << EvtPDL::name(p->getDaug(1)->getId()) << std::endl;
286 //std::cout << d->eps(0) << std::endl;
287 //std::cout << d->epsParent(0) << std::endl;
288 vertex( 0, amp * norm * p4_parent * ( d->epsParent( 0 ) ) );
289 vertex( 1, amp * norm * p4_parent * ( d->epsParent( 1 ) ) );
290 vertex( 2, amp * norm * p4_parent * ( d->epsParent( 2 ) ) );
291 }
292
293 if ( d2type == EvtSpinType::TENSOR ) {
294 double norm = d->mass() * d->mass() /
295 ( p4_parent.mass() * d->getP4().d3mag() *
296 d->getP4().d3mag() );
297
298 vertex( 0, amp * norm * d->epsTensorParent( 0 ).cont1( p4_parent ) *
299 p4_parent );
300 vertex( 1, amp * norm * d->epsTensorParent( 1 ).cont1( p4_parent ) *
301 p4_parent );
302 vertex( 2, amp * norm * d->epsTensorParent( 2 ).cont1( p4_parent ) *
303 p4_parent );
304 vertex( 3, amp * norm * d->epsTensorParent( 3 ).cont1( p4_parent ) *
305 p4_parent );
306 vertex( 4, amp * norm * d->epsTensorParent( 4 ).cont1( p4_parent ) *
307 p4_parent );
308 }
309
310 return;
311}
312
313std::string EvtSSDCP::getParamName( int i )
314{
315 switch ( i ) {
316 case 0:
317 return "deltaM";
318 case 1:
319 return "deltaGammaOverGamma";
320 case 2:
321 return "qOverP";
322 case 3:
323 return "qOverPPhase";
324 case 4:
325 return "Af";
326 case 5:
327 return "AfPhase";
328 case 6:
329 return "Abarf";
330 case 7:
331 return "AbarfPhase";
332 case 8:
333 return "Afbar";
334 case 9:
335 return "AfbarPhase";
336 case 10:
337 return "Abarfbar";
338 case 11:
339 return "AbarfbarPhase";
340 case 12:
341 return "Z";
342 case 13:
343 return "ZPhase";
344 default:
345 return "";
346 }
347}
348
349std::string EvtSSDCP::getParamDefault( int i )
350{
351 switch ( i ) {
352 case 3:
353 return "0.0";
354 case 4:
355 return "1.0";
356 case 5:
357 return "0.0";
358 case 6:
359 return "1.0";
360 case 7:
361 return "0.0";
362 default:
363 return "";
364 }
365}
EvtComplex conj(const EvtComplex &c)
EvtComplex exp(const EvtComplex &c)
double arg(const EvtComplex &c)
double abs(const EvtComplex &c)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition EvtReport.cpp:32
@ EVTGEN_INFO
Definition EvtReport.hh:52
@ EVTGEN_ERROR
Definition EvtReport.hh:49
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)
EvtDecayBase()=default
int getNArg() const
double getArg(unsigned int j)
void setProbMax(double prbmx)
EvtId getParentId() const
bool verbose() 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 EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.cpp:371
static std::string name(EvtId i)
Definition EvtPDL.cpp:376
static EvtId chargeConj(EvtId id)
Definition EvtPDL.cpp:201
static double getctau(EvtId i)
Definition EvtPDL.cpp:351
static EvtId getId(const std::string &name)
Definition EvtPDL.cpp:283
virtual EvtVector4C epsParent(int i) const
virtual EvtTensor4C epsTensorParent(int i) const
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
EvtVector4R getP4Restframe() const
const EvtVector4R & getP4() const
EvtParticle * getDaug(const int i)
double mass() const
static double Flat()
Definition EvtRandom.cpp:95
EvtDecayBase * clone() const override
Definition EvtSSDCP.cpp:43
std::string getParamDefault(int i) override
Definition EvtSSDCP.cpp:349
void initProbMax() override
Definition EvtSSDCP.cpp:160
double m_dgog
Definition EvtSSDCP.hh:49
EvtComplex m_Abar_fbar
Definition EvtSSDCP.hh:62
EvtComplex m_poverq
Definition EvtSSDCP.hh:52
EvtComplex m_qoverp
Definition EvtSSDCP.hh:51
EvtComplex m_A_f
Definition EvtSSDCP.hh:58
bool m_eigenstate
Definition EvtSSDCP.hh:69
void decay(EvtParticle *p) override
Definition EvtSSDCP.cpp:178
std::string getParamName(int i) override
Definition EvtSSDCP.cpp:313
void init() override
Definition EvtSSDCP.cpp:48
EvtComplex m_A_fbar
Definition EvtSSDCP.hh:61
EvtComplex m_z
Definition EvtSSDCP.hh:53
double m_dgamma
Definition EvtSSDCP.hh:67
EvtComplex m_Abar_f
Definition EvtSSDCP.hh:59
double m_gamma
Definition EvtSSDCP.hh:66
std::string getName() const override
Definition EvtSSDCP.cpp:38
double m_dm
Definition EvtSSDCP.hh:47
EvtVector4C cont1(const EvtVector4C &v4) const
double mass() const
double d3mag() const