00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "EvtGenBase/EvtPatches.hh"
00031 #include <stdlib.h>
00032 #include "EvtGenBase/EvtParticle.hh"
00033 #include "EvtGenBase/EvtGenKine.hh"
00034 #include "EvtGenBase/EvtCPUtil.hh"
00035 #include "EvtGenBase/EvtPDL.hh"
00036 #include "EvtGenBase/EvtReport.hh"
00037 #include "EvtGenModels/EvtBToKpipiCP.hh"
00038 #include "EvtGenBase/EvtId.hh"
00039 #include <string>
00040
00041 extern "C" {
00042 extern void evtkpipi_(double *, double *, int *,double *,
00043 double *,double *,double *,double *,
00044 double *,double *,double *);
00045 }
00046
00047 EvtBToKpipiCP::~EvtBToKpipiCP() {}
00048
00049
00050 void EvtBToKpipiCP::getName(std::string& model_name){
00051
00052 model_name="BTOKPIPI_CP";
00053
00054 }
00055
00056
00057 EvtDecayBase* EvtBToKpipiCP::clone(){
00058
00059 return new EvtBToKpipiCP;
00060
00061 }
00062
00063 void EvtBToKpipiCP::init(){
00064
00065
00066 checkNArg(3);
00067 checkNDaug(3);
00068
00069 checkSpinParent(EvtSpinType::SCALAR);
00070
00071 checkSpinDaughter(0,EvtSpinType::SCALAR);
00072 checkSpinDaughter(1,EvtSpinType::SCALAR);
00073 checkSpinDaughter(2,EvtSpinType::SCALAR);
00074
00075 }
00076
00077
00078 void EvtBToKpipiCP::decay( EvtParticle *p){
00079
00080
00081 static EvtId B0=EvtPDL::getId("B0");
00082 static EvtId B0B=EvtPDL::getId("anti-B0");
00083
00084 double t;
00085 EvtId other_b;
00086
00087 EvtCPUtil::OtherB(p,t,other_b);
00088
00089 EvtParticle *Kp,*pim,*pi0;
00090
00091 p->makeDaughters(getNDaug(),getDaugs());
00092 Kp=p->getDaug(0);
00093 pim=p->getDaug(1);
00094 pi0=p->getDaug(2);
00095
00096 EvtVector4R p4[3];
00097
00098
00099 double alpha=getArg(1);
00100 double beta=getArg(2);
00101 int iset;
00102
00103 static int first=1;
00104
00105 if (first==1) {
00106 iset=10000;
00107 first=0;
00108 }
00109 else{
00110 iset=0;
00111 }
00112
00113 double p4Kplus[4],p4piminus[4],p4gamm1[4],p4gamm2[4];
00114
00115 double realA,imgA,realbarA,imgbarA;
00116
00117 evtkpipi_(&alpha,&beta,&iset,p4Kplus,p4piminus,p4gamm1,p4gamm2,
00118 &realA,&imgA,&realbarA,&imgbarA);
00119
00120 p4[0].set(p4Kplus[3],p4Kplus[0],p4Kplus[1],p4Kplus[2]);
00121 p4[1].set(p4piminus[3],p4piminus[0],p4piminus[1],p4piminus[2]);
00122 p4[2].set(p4gamm1[3]+p4gamm2[3],p4gamm1[0]+p4gamm2[0],
00123 p4gamm1[1]+p4gamm2[1],p4gamm1[2]+p4gamm2[2]);
00124
00125 Kp->init( getDaug(0), p4[0] );
00126 pim->init( getDaug(1), p4[1] );
00127 pi0->init( getDaug(2), p4[2] );
00128
00129 EvtComplex amp;
00130
00131 EvtComplex A(realA,imgA);
00132 EvtComplex Abar(realbarA,imgbarA);
00133
00134 if (other_b==B0B){
00135 amp=Abar;
00136 }
00137 if (other_b==B0){
00138 amp=A;
00139 }
00140
00141 vertex(amp);
00142
00143 return ;
00144 }
00145