BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtSSDCP.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 2001 Caltech
10//
11// Module: EvtSSDCP.cc
12//
13// Description: See EvtSSDCP.hh
14//
15// Modification history:
16//
17// RYD August 12, 2001 Module created
18// F. Sandrelli, Fernando M-V March 1, 2002 Debugged and added z parameter (CPT
19// violation)
20//------------------------------------------------------------------------
21//
22#include "EvtSSDCP.hh"
33#include <stdlib.h>
34#include <string>
35using std::endl;
36
38
39void EvtSSDCP::getName( std::string& model_name ) { model_name = "SSD_CP"; }
40
42
44
45 // check that there are 8 or 12 or 14 arguments
46
47 checkNArg( 14, 12, 8 );
48 checkNDaug( 2 );
49
52
53 // FS commented this check to include alias of B0
54 // if ( !((getParentId() == EvtPDL::getId("B0"))||(getParentId() == EvtPDL::getId("B0B"))) )
55 // {
56 // report(ERROR, "EvtGen") << "EvtSSDCP cannot decay "
57 // << EvtPDL::name(getParentId())
58 // << ". Must be specified to decay"
59 // << " only B0 or a B0B ." << endl;
60 // report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
61 // ::abort();
62 //}
63
64 if ( ( !( d1type == EvtSpinType::SCALAR || d2type == EvtSpinType::SCALAR ) ) ||
65 ( !( ( d2type == EvtSpinType::SCALAR ) || ( d2type == EvtSpinType::VECTOR ) ||
66 ( d2type == EvtSpinType::TENSOR ) ) ) ||
67 ( !( ( d1type == EvtSpinType::SCALAR ) || ( d1type == EvtSpinType::VECTOR ) ||
68 ( d1type == EvtSpinType::TENSOR ) ) ) )
69 {
70 report( ERROR, "EvtGen" ) << "EvtSSDCP generator expected "
71 << "one of the daugters to be a scalar, the other either "
72 "scalar, vector, or tensor, found:"
73 << EvtPDL::name( getDaug( 0 ) ).c_str() << " and "
74 << EvtPDL::name( getDaug( 1 ) ).c_str() << endl;
75 report( ERROR, "EvtGen" ) << "Will terminate execution!" << endl;
76 ::abort();
77 }
78
79 _dm = getArg( 0 ) / EvtConst::c; // units of 1/mm
80
81 _dgog = getArg( 1 );
82
83 _qoverp = getArg( 2 ) * EvtComplex( cos( getArg( 3 ) ), sin( getArg( 3 ) ) );
84 _poverq = 1.0 / _qoverp;
85
86 _A_f = getArg( 4 ) * EvtComplex( cos( getArg( 5 ) ), sin( getArg( 5 ) ) );
87
88 _Abar_f = getArg( 6 ) * EvtComplex( cos( getArg( 7 ) ), sin( getArg( 7 ) ) );
89
90 if ( getNArg() >= 12 )
91 {
92 _eigenstate = false;
93 _A_fbar = getArg( 8 ) * EvtComplex( cos( getArg( 9 ) ), sin( getArg( 9 ) ) );
94 _Abar_fbar = getArg( 10 ) * EvtComplex( cos( getArg( 11 ) ), sin( getArg( 11 ) ) );
95 }
96 else
97 {
98 // I'm somewhat confused about this. For a CP eigenstate set the
99 // amplitudes to the same. For a non CP eigenstate CPT invariance
100 // is enforced. (ryd)
101 if ( ( getDaug( 0 ) == EvtPDL::chargeConj( getDaug( 0 ) ) &&
102 getDaug( 1 ) == EvtPDL::chargeConj( getDaug( 1 ) ) ) ||
103 ( getDaug( 0 ) == EvtPDL::chargeConj( getDaug( 1 ) ) &&
104 getDaug( 1 ) == EvtPDL::chargeConj( getDaug( 0 ) ) ) )
105 { _eigenstate = true; }
106 else
107 {
108 _eigenstate = false;
109 _A_fbar = conj( _Abar_f );
110 _Abar_fbar = conj( _A_f );
111 }
112 }
113
114 // FS: new check for z
115 if ( getNArg() == 14 )
116 { // FS Set _z parameter if provided else set it 0
117 _z = EvtComplex( getArg( 12 ), getArg( 13 ) );
118 }
119 else { _z = EvtComplex( 0.0, 0.0 ); }
120
121 // FS substituted next 2 lines...
122
123 //
124 // _gamma=EvtPDL::getctau(EvtPDL::getId("B0")); //units of 1/mm
125 //_dgamma=_gamma*0.5*_dgog;
126 //
127 // ...with:
128
129 _gamma = 1 / EvtPDL::getctau( EvtPDL::getId( "B0" ) ); // gamma/c (1/mm)
130 _dgamma = _gamma * _dgog; // dgamma/c (1/mm)
131
132 if ( verbose() )
133 {
134 report( INFO, "EvtGen" ) << "SSD_CP will generate CP/CPT violation:" << endl
135 << endl
136 << " " << EvtPDL::name( getParentId() ).c_str() << " --> "
137 << EvtPDL::name( getDaug( 0 ) ).c_str() << " + "
138 << EvtPDL::name( getDaug( 1 ) ).c_str() << endl
139 << endl
140 << "using parameters:" << endl
141 << endl
142 << " delta(m) = " << _dm << " hbar/ps" << endl
143 << "dGamma = " << _dgamma << " ps-1" << endl
144 << " q/p = " << _qoverp << endl
145 << " z = " << _z << endl
146 << " tau = " << 1. / _gamma << " ps" << endl;
147 }
148}
149
151 double theProbMax = abs( _A_f ) * abs( _A_f ) + abs( _Abar_f ) * abs( _Abar_f ) +
152 abs( _A_fbar ) * abs( _A_fbar ) + abs( _Abar_fbar ) * abs( _Abar_fbar );
153
154 if ( _eigenstate ) theProbMax *= 2;
155
158 if ( d1type == EvtSpinType::TENSOR || d2type == EvtSpinType::TENSOR ) theProbMax *= 10;
159
160 setProbMax( theProbMax );
161}
162
164
165 static EvtId B0 = EvtPDL::getId( "B0" );
166 static EvtId B0B = EvtPDL::getId( "anti-B0" );
167
168 double t;
169 EvtId other_b;
170 EvtId daugs[2];
171
172 int flip = 0;
173 if ( !_eigenstate )
174 {
175 if ( EvtRandom::Flat( 0.0, 1.0 ) < 0.5 ) flip = 1;
176 }
177
178 if ( !flip )
179 {
180 daugs[0] = getDaug( 0 );
181 daugs[1] = getDaug( 1 );
182 }
183 else
184 {
185 daugs[0] = EvtPDL::chargeConj( getDaug( 0 ) );
186 daugs[1] = EvtPDL::chargeConj( getDaug( 1 ) );
187 }
188
189 EvtParticle* d;
190 p->initializePhaseSpace( 2, daugs );
191
192 EvtComplex amp;
193
194 EvtCPUtil::OtherB( p, t, other_b, 0.5 ); // t is c*Dt (mm)
195
196 // if (flip) t=-t;
197
198 // FS We assume DGamma=GammaLow-GammaHeavy and Dm=mHeavy-mLow
199 EvtComplex expL = exp( -EvtComplex( -0.25 * _dgamma * t, 0.5 * _dm * t ) );
200 EvtComplex expH = exp( EvtComplex( -0.25 * _dgamma * t, 0.5 * _dm * t ) );
201 // FS Definition of gp and gm
202 EvtComplex gp = 0.5 * ( expL + expH );
203 EvtComplex gm = 0.5 * ( expL - expH );
204 // FS Calculation os sqrt(1-z^2)
205 EvtComplex sqz = sqrt( abs( 1 - _z * _z ) ) * exp( EvtComplex( 0, arg( 1 - _z * _z ) / 2 ) );
206
207 // EvtComplex BB=0.5*(expL+expH); // <B0|B0(t)>
208 // EvtComplex barBB=_qoverp*0.5*(expL-expH); // <B0bar|B0(t)>
209 // EvtComplex BbarB=_poverq*0.5*(expL-expH); // <B0|B0bar(t)>
210 // EvtComplex barBbarB=BB; // <B0bar|B0bar(t)>
211 // FS redefinition of these guys... (See BAD #188 eq.35 for ref.)
212 // q/p is taken as in the BaBar Phys. Book (opposite sign wrt ref.)
213 EvtComplex BB = gp + _z * gm; // <B0|B0(t)>
214 EvtComplex barBB = sqz * _qoverp * gm; // <B0bar|B0(t)>
215 EvtComplex BbarB = sqz * _poverq * gm; // <B0|B0bar(t)>
216 EvtComplex barBbarB = gp - _z * gm; // <B0bar|B0bar(t)>
217
218 if ( !flip )
219 {
220 if ( other_b == B0B )
221 {
222 // at t=0 we have a B0
223 // report(INFO,"EvtGen") << "B0B"<<endl;
224 amp = BB * _A_f + BbarB * _Abar_f;
225 // std::cout << "noflip B0B tag:"<<amp<<std::endl;
226 // amp=0.0;
227 }
228 if ( other_b == B0 )
229 {
230 // report(INFO,"EvtGen") << "B0"<<endl;
231 amp = barBB * _A_f + barBbarB * _Abar_f;
232 }
233 }
234 else
235 {
236 if ( other_b == B0 )
237 {
238 amp = barBB * _A_fbar + barBbarB * _Abar_fbar;
239 // std::cout << "flip B0 tag:"<<amp<<std::endl;
240 // amp=0.0;
241 }
242 if ( other_b == B0B ) { amp = BB * _A_fbar + BbarB * _Abar_fbar; }
243 }
244
245 EvtVector4R p4_parent = p->getP4Restframe();
246 double m_parent = p4_parent.mass();
247
249
250 EvtVector4R momv;
251 EvtVector4R moms;
252
253 if ( d2type == EvtSpinType::SCALAR )
254 {
255 d2type = EvtPDL::getSpinType( getDaug( 0 ) );
256 d = p->getDaug( 0 );
257 momv = d->getP4();
258 moms = p->getDaug( 1 )->getP4();
259 }
260 else
261 {
262 d = p->getDaug( 1 );
263 momv = d->getP4();
264 moms = p->getDaug( 0 )->getP4();
265 }
266
267 if ( d2type == EvtSpinType::SCALAR ) { vertex( amp ); }
268
269 if ( d2type == EvtSpinType::VECTOR )
270 {
271
272 double norm = momv.mass() / ( momv.d3mag() * p->mass() );
273
274 vertex( 0, amp * norm * p4_parent * ( d->epsParent( 0 ) ) );
275 vertex( 1, amp * norm * p4_parent * ( d->epsParent( 1 ) ) );
276 vertex( 2, amp * norm * p4_parent * ( d->epsParent( 2 ) ) );
277 }
278
279 if ( d2type == EvtSpinType::TENSOR )
280 {
281
282 double norm =
283 d->mass() * d->mass() / ( m_parent * d->getP4().d3mag() * d->getP4().d3mag() );
284
285 vertex( 0, amp * norm * d->epsTensorParent( 0 ).cont1( p4_parent ) * p4_parent );
286 vertex( 1, amp * norm * d->epsTensorParent( 1 ).cont1( p4_parent ) * p4_parent );
287 vertex( 2, amp * norm * d->epsTensorParent( 2 ).cont1( p4_parent ) * p4_parent );
288 vertex( 3, amp * norm * d->epsTensorParent( 3 ).cont1( p4_parent ) * p4_parent );
289 vertex( 4, amp * norm * d->epsTensorParent( 4 ).cont1( p4_parent ) * p4_parent );
290 }
291
292 return;
293}
Evt3Rank3C conj(const Evt3Rank3C &t2)
EvtComplex exp(const EvtComplex &c)
double arg(const EvtComplex &c)
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
@ INFO
Definition EvtReport.hh:52
static void OtherB(EvtParticle *p, double &t, EvtId &otherb)
Definition EvtCPUtil.cc:225
static const double c
Definition EvtConst.hh:31
void vertex(const EvtComplex &amp)
double getArg(int j)
void setProbMax(double prbmx)
EvtId getParentId()
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
EvtId getDaug(int i)
Definition EvtId.hh:27
static std::string name(EvtId i)
Definition EvtPDL.hh:70
static EvtId chargeConj(EvtId id)
Definition EvtPDL.cc:193
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272
static double getctau(EvtId i)
Definition EvtPDL.hh:60
virtual EvtVector4C epsParent(int i) const
virtual EvtTensor4C epsTensorParent(int i) const
EvtVector4R getP4Restframe()
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
double mass() const
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat(double min, double max)
Definition EvtRandom.cc:55
EvtDecayBase * clone()
Definition EvtSSDCP.cc:41
void init()
Definition EvtSSDCP.cc:43
virtual ~EvtSSDCP()
Definition EvtSSDCP.cc:37
void getName(std::string &name)
Definition EvtSSDCP.cc:39
void initProbMax()
Definition EvtSSDCP.cc:150
void decay(EvtParticle *p)
Definition EvtSSDCP.cc:163
EvtVector4C cont1(const EvtVector4C &v4) const
double mass() const
double d3mag() const
int t()
Definition t.c:1