47 if ( theCPUtil == 0 ) {
58 double beta,
double& fract )
66 double ratio = 1 / ( 1 + 0.65 * 0.65 );
70 rf =
EvtComplex( cos( 2.0 * beta ), sin( 2.0 * beta ) ) * Abarf / Af;
74 double Abar2 =
real( Abarf ) *
real( Abarf ) +
imag( Abarf ) *
imag( Abarf );
77 double rbarf2 =
real( rbarf ) *
real( rbarf ) +
imag( rbarf ) *
imag( rbarf );
79 fract = ( Abar2 * ( 1 + rbarf2 + ( 1 - rbarf2 ) * ratio ) ) /
80 ( Abar2 * ( 1 + rbarf2 + ( 1 - rbarf2 ) * ratio ) +
81 A2 * ( 1 + rf2 + ( 1 - rf2 ) * ratio ) );
86 EvtComplex Abarfbar,
double deltam,
double beta,
87 int flip,
double& fract )
100 double gamma_B = deltam / xd;
101 double IAf, IAfbar, IAbarf, IAbarfbar;
103 double rf2, rfbar2, rbarf2, rbarfbar2;
104 double Af2, Afbar2, Abarf2, Abarfbar2;
106 rf =
EvtComplex( cos( 2.0 * beta ), sin( 2.0 * beta ) ) * Abarf / Af;
107 rfbar =
EvtComplex( cos( 2.0 * beta ), sin( 2.0 * beta ) ) * Abarfbar / Afbar;
108 rbarf =
EvtComplex( cos( -2.0 * beta ), sin( -2.0 * beta ) ) * Af / Abarf;
109 rbarfbar =
EvtComplex( cos( -2.0 * beta ), sin( -2.0 * beta ) ) * Afbar /
115 rbarfbar2 =
real( rbarfbar ) *
real( rbarfbar ) +
116 imag( rbarfbar ) *
imag( rbarfbar );
121 Abarfbar2 =
real( Abarfbar ) *
real( Abarfbar ) +
122 imag( Abarfbar ) *
imag( Abarfbar );
128 IAf = ( Af2 / ( 2 * gamma_B ) ) * ( 1 + rf2 + ( 1 - rf2 ) / ( 1 + xd * xd ) );
129 IAfbar = ( Afbar2 / ( 2 * gamma_B ) ) *
130 ( 1 + rfbar2 + ( 1 - rfbar2 ) / ( 1 + xd * xd ) );
131 IAbarf = ( Abarf2 / ( 2 * gamma_B ) ) *
132 ( 1 + rbarf2 + ( 1 - rbarf2 ) / ( 1 + xd * xd ) );
133 IAbarfbar = ( Abarfbar2 / ( 2 * gamma_B ) ) *
134 ( 1 + rbarfbar2 + ( 1 - rbarfbar2 ) / ( 1 + xd * xd ) );
138 fract = IAbarf / ( IAbarf + IAf ) + flip * IAbarfbar / ( IAfbar + IAbarfbar );
157 static int entryCount = 0;
180 bool incoherentmix =
false;
182 if ( ( parent != 0 ) && ( parent->
getId() == B0 || parent->
getId() == B0B ||
183 parent->
getId() == BS || parent->
getId() == BSB ) ) {
184 incoherentmix =
true;
190 if ( parent == 0 || parent->
getId() != UPS4S ) {
200 assert( parent == 0 );
203 bool needToChargeConj =
false;
204 if ( p->
getId() == B0B && isB0 )
205 needToChargeConj =
true;
206 if ( p->
getId() == B0 && !isB0 )
207 needToChargeConj =
true;
208 if ( p->
getId() == BSB && isB0 )
209 needToChargeConj =
true;
210 if ( p->
getId() == BS && !isB0 )
211 needToChargeConj =
true;
213 if ( needToChargeConj ) {
215 if ( incoherentmix ) {
225 if ( parent->
getDaug( 0 ) != p ) {
241 if (
other->getId().isAlias() ) {
247 if ( entryCount == 1 ) {
250 bool decayed =
other->isDecayed();
258 scalar_part->
init( B0, p_init );
260 scalar_part->
init( B0B, p_init );
264 other->setDiagonalSpinDensity();
274 otherb =
other->getId();
276 other->setLifetime();
279 otherb =
other->getId();
283 <<
"We have an error here!!!!" << endl;
284 otherb =
EvtId( -1, -1 );
300 if ( ( p->
getId() != BS0 ) && ( p->
getId() != BSB ) )
318 if ( ( p->
getId() != B0 ) && ( p->
getId() != B0B ) )
382 if ( p->
getId() == BS0 || p->
getId() == BSB ) {
385 static double ctau = ctauL < ctauH ? ctauH : ctauL;
388 if ( parent != 0 && ( parent->
getId() == BS0 || parent->
getId() == BSB ) ) {
389 if ( parent->
getId() == BS0 )
391 if ( parent->
getId() == BSB )
396 if ( p->
getId() == BS0 )
398 if ( p->
getId() == BSB )
404 if ( p->
getId() == D0 || p->
getId() == D0B ) {
407 static double ctau = ctauL < ctauH ? ctauH : ctauL;
410 if ( parent != 0 && ( parent->
getId() == D0 || parent->
getId() == D0B ) ) {
411 if ( parent->
getId() == D0 )
413 if ( parent->
getId() == D0B )
418 if ( p->
getId() == D0 )
420 if ( p->
getId() == D0B )
432 if ( parent == 0 || parent->
getId() != UPS4 ) {
436 if ( p->
getId() == B0 )
438 if ( p->
getId() == B0B )
440 if ( p->
getId() == BS0 )
442 if ( p->
getId() == BSB )
446 if ( parent->
getDaug( 0 ) != p ) {
464 stdHepNum =
abs( stdHepNum );
469 std::string hname = partName + std::string(
"H" );
470 std::string lname = partName + std::string(
"L" );
479 double ctau = 2.0 * ( ctauL * ctauH ) / ( ctauL + ctauH );
484 double y = ( ctauH - ctauL ) / ( ctauH + ctauL );
488 std::string qoverpParmName = std::string(
"qoverp_incohMix_" ) + partName;
489 std::string mdParmName = std::string(
"dm_incohMix_" ) + partName;
496 if (
id == partId ) {
497 fac = 1.0 / ( qoverp * qoverp );
499 fac = qoverp * qoverp;
502 double mixprob = ( x * x + y * y ) /
503 ( x * x + y * y + fac * ( 2.0 + x * x - y * y ) );
512 double ctaulong = ctauL <= ctauH ? ctauH : ctauL;
517 prob = 1.0 +
exp( -2.0 * fabs( y ) * t / ctau ) +
518 mixsign * 2.0 *
exp( -fabs( y ) * t / ctau ) * cos( x * t / ctau );
532 stdHepNum =
abs( stdHepNum );
536 std::string hname = partName + std::string(
"H" );
537 std::string lname = partName + std::string(
"L" );
545 double dGamma = ( 1 / ctauL - 1 / ctauH ) *
EvtConst::c;
552 stdHepNum =
abs( stdHepNum );
556 std::string parmName = std::string(
"dm_incohMix_" ) + partName;
bool isB0Mixed(EvtParticle *)
const char * c_str(Index i)
static std::string name(EvtId i)
void OtherCoherentB(EvtParticle *p, double &t, EvtId &otherb, double probB0)
EvtParticle * getParent() const
void fractB0nonCP(EvtComplex Af, EvtComplex Abarf, EvtComplex Afbar, EvtComplex Abarfbar, double deltam, double beta, int flip, double &fract)
bool isBsMixed(EvtParticle *)
void OtherIncoherentB(EvtParticle *p, double &t, EvtId &otherb, double probB0)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
double getDeltaGamma(const EvtId id)
void insertDaugPtr(int idaug, EvtParticle *partptr)
static double getctau(EvtId i)
void OtherB(EvtParticle *p, double &t, EvtId &otherb)
static std::string get(const std::string &name, int &ierr)
void setLifetime(double tau)
void fractB0CP(EvtComplex Af, EvtComplex Abarf, double deltam, double beta, double &fract)
void incoherentMix(const EvtId id, double &t, int &mix)
double abs(const EvtComplex &c)
static EvtId evtIdFromStdHep(int stdhep)
static EvtId getId(const std::string &name)
double imag(const EvtComplex &c)
void init(EvtId part_n, double e, double px, double py, double pz)
EvtComplex exp(const EvtComplex &c)
static EvtCPUtil * getInstance()
EvtParticle * getDaug(int i)
EvtCPUtil(int mixingType)
double getDeltaM(const EvtId id)
static EvtId chargeConj(EvtId id)
double real(const EvtComplex &c)
static int getStdHep(EvtId id)
Index other(Index i, Index j)