evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtSVSNONCPEIGEN.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 
23 #include "EvtGenBase/EvtCPUtil.hh"
24 #include "EvtGenBase/EvtConst.hh"
25 #include "EvtGenBase/EvtGenKine.hh"
26 #include "EvtGenBase/EvtPDL.hh"
28 #include "EvtGenBase/EvtPatches.hh"
29 #include "EvtGenBase/EvtRandom.hh"
30 #include "EvtGenBase/EvtReport.hh"
32 
33 #include <stdlib.h>
34 #include <string>
35 
37 {
38  return "SVS_NONCPEIGEN";
39 }
40 
42 {
43  return new EvtSVSNONCPEIGEN;
44 }
45 
47 {
48  // check that there are 11 arguments
49  checkNArg( 11, 7 );
50  checkNDaug( 2 );
51 
54 
55  _dm = getArg( 1 );
56  _phickm = 2 * getArg( 0 ) + getArg( 2 );
57 
58  _A_f = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
59  getArg( 3 ) * sin( getArg( 4 ) ) );
60  _Abar_f = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
61  getArg( 5 ) * sin( getArg( 6 ) ) );
62 
63  _A_fbar = _Abar_f;
64  _Abar_fbar = _A_f;
65 
66  if ( getNArg() == 11 ) {
67  _A_fbar = EvtComplex( getArg( 7 ) * cos( getArg( 8 ) ),
68  getArg( 7 ) * sin( getArg( 8 ) ) );
69  _Abar_fbar = EvtComplex( getArg( 9 ) * cos( getArg( 10 ) ),
70  getArg( 9 ) * sin( getArg( 10 ) ) );
71  }
72 }
73 
75 {
76  double theProbMax = abs( _A_f ) * abs( _A_f ) +
77  abs( _Abar_f ) * abs( _Abar_f ) +
78  abs( _A_fbar ) * abs( _A_fbar ) +
79  abs( _Abar_fbar ) * abs( _Abar_fbar );
80 
81  setProbMax( theProbMax );
82 }
83 
85 {
86  //added by Lange Jan4,2000
87  static EvtId B0 = EvtPDL::getId( "B0" );
88  static EvtId B0B = EvtPDL::getId( "anti-B0" );
89 
90  double t;
91  EvtId other_b;
92  EvtId daugs[2];
93 
94  // MB: flip selects the final of the decay
95  int flip = ( ( p->getId() == B0 ) ? 0 : 1 );
96  daugs[0] = getDaug( 0 );
97  daugs[1] = getDaug( 1 );
98  p->initializePhaseSpace( 2, daugs );
99 
100  EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
101 
102  EvtComplex amp;
103  double dmt2 = ( _dm * t ) / ( 2 * EvtConst::c );
104  EvtComplex ePlusIPhi( cos( _phickm ), sin( _phickm ) );
105  EvtComplex eMinusIPhi( cos( -_phickm ), -sin( _phickm ) );
106 
107  // flip == 0 : D-rho+
108  // flip == 1 : D+rho-
109 
110  if ( !flip ) {
111  if ( other_b == B0B ) {
112  // At t=0 we have a B0
113  amp = cos( dmt2 ) * _A_f +
114  eMinusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) * _Abar_f;
115  }
116  if ( other_b == B0 ) {
117  // At t=0 we have a B0bar
118  amp = ePlusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) * _A_f +
119  cos( dmt2 ) * _Abar_f;
120  }
121  } else {
122  if ( other_b == B0B ) {
123  // At t=0 we have a B0
124  amp = cos( dmt2 ) * _A_fbar +
125  eMinusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) * _Abar_fbar;
126  }
127  if ( other_b == B0 ) {
128  // At t=0 we have a B0bar
129  amp = ePlusIPhi * EvtComplex( 0.0, sin( dmt2 ) ) * _A_fbar +
130  cos( dmt2 ) * _Abar_fbar;
131  }
132  }
133 
134  EvtParticle* v;
135  v = p->getDaug( 0 );
136 
137  EvtVector4R momv = p->getDaug( 0 )->getP4();
138  EvtVector4R moms = p->getDaug( 1 )->getP4();
139  EvtVector4R p4_parent = momv + moms;
140 
141  double norm = momv.mass() / ( momv.d3mag() * p->mass() );
142 
143  vertex( 0, amp * norm * p4_parent * ( v->epsParent( 0 ) ) );
144  vertex( 1, amp * norm * p4_parent * ( v->epsParent( 1 ) ) );
145  vertex( 2, amp * norm * p4_parent * ( v->epsParent( 2 ) ) );
146 
147  return;
148 }
void initProbMax() override
std::string getName() override
double getArg(unsigned int j)
double mass() const
Definition: EvtVector4R.cpp:49
EvtId getId() const
void OtherB(EvtParticle *p, double &t, EvtId &otherb)
Definition: EvtCPUtil.cpp:372
void setProbMax(double prbmx)
Definition: EvtId.hh:27
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
virtual EvtVector4C epsParent(int i) const
EvtDecayBase * clone() override
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static const double c
Definition: EvtConst.hh:30
double abs(const EvtComplex &c)
Definition: EvtComplex.hh:201
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
const EvtVector4R & getP4() const
void decay(EvtParticle *p) override
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
double mass() const
double d3mag() const
static EvtCPUtil * getInstance()
Definition: EvtCPUtil.cpp:43
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
int getNArg() const
Definition: EvtDecayBase.hh:68
void init() override
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67