Line data Source code
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) 1998 Caltech, UCSB
10 : //
11 : // Module: EvtBToKpipiCP.cc
12 : //
13 : // Description: Routine to decay B->K pi pi
14 : // and has CP violation.
15 : // --- This is the routine to be called by the Main generator
16 : // to get the decay of B0 -->-- K+ pi- pi0
17 : // The decay proceeeds through three channels:
18 : // a) B0 -->-- K*+ pi- ; K*+ -->-- K+ pi0
19 : // b) K*0 pi0 ; K*0bar -->-- K+ pi-
20 : // c) K- rho+ ; rho+ -->-- pi+ pi0
21 : // It provides at the same time the CP conjugate decay
22 : // B0bar -->-- K- pi+ pi0
23 : //
24 : // Modification history:
25 : //
26 : // Versille September, 1997 Module created
27 : //
28 : //------------------------------------------------------------------------
29 : //
30 : #include "EvtGenBase/EvtPatches.hh"
31 : #include <stdlib.h>
32 : #include "EvtGenBase/EvtParticle.hh"
33 : #include "EvtGenBase/EvtGenKine.hh"
34 : #include "EvtGenBase/EvtCPUtil.hh"
35 : #include "EvtGenBase/EvtPDL.hh"
36 : #include "EvtGenBase/EvtReport.hh"
37 : #include "EvtGenModels/EvtBToKpipiCP.hh"
38 : #include "EvtGenBase/EvtId.hh"
39 : #include <string>
40 :
41 : #ifdef WIN32
42 : extern "C" {
43 : extern void __stdcall EVTKPIPI(double *, double *, int *,double *,
44 : double *,double *,double *,double *,
45 : double *,double *,double *);
46 : }
47 : #else
48 : extern "C" {
49 : extern void evtkpipi_(double *, double *, int *,double *,
50 : double *,double *,double *,double *,
51 : double *,double *,double *);
52 : }
53 : #endif
54 :
55 0 : EvtBToKpipiCP::~EvtBToKpipiCP() {}
56 :
57 :
58 : std::string EvtBToKpipiCP::getName(){
59 :
60 0 : return "BTOKPIPI_CP";
61 :
62 : }
63 :
64 :
65 : EvtDecayBase* EvtBToKpipiCP::clone(){
66 :
67 0 : return new EvtBToKpipiCP;
68 :
69 0 : }
70 :
71 : void EvtBToKpipiCP::init(){
72 :
73 : // check that there are 3 arguments
74 0 : checkNArg(3);
75 0 : checkNDaug(3);
76 :
77 0 : checkSpinParent(EvtSpinType::SCALAR);
78 :
79 0 : checkSpinDaughter(0,EvtSpinType::SCALAR);
80 0 : checkSpinDaughter(1,EvtSpinType::SCALAR);
81 0 : checkSpinDaughter(2,EvtSpinType::SCALAR);
82 :
83 0 : double alpha=getArg(1);
84 0 : double beta=getArg(2);
85 0 : int iset;
86 0 : iset=10000;
87 :
88 0 : double p4Kplus[4],p4piminus[4],p4gamm1[4],p4gamm2[4];
89 :
90 0 : double realA,imgA,realbarA,imgbarA;
91 :
92 : #ifdef WIN32
93 : EVTKPIPI(&alpha,&beta,&iset,p4Kplus,p4piminus,p4gamm1,p4gamm2,
94 : &realA,&imgA,&realbarA,&imgbarA);
95 : #else
96 0 : evtkpipi_(&alpha,&beta,&iset,p4Kplus,p4piminus,p4gamm1,p4gamm2,
97 : &realA,&imgA,&realbarA,&imgbarA);
98 : #endif
99 0 : }
100 :
101 :
102 : void EvtBToKpipiCP::decay( EvtParticle *p){
103 :
104 : //added by Lange Jan4,2000
105 0 : static EvtId B0=EvtPDL::getId("B0");
106 0 : static EvtId B0B=EvtPDL::getId("anti-B0");
107 :
108 0 : double t;
109 0 : EvtId other_b;
110 :
111 0 : EvtCPUtil::getInstance()->OtherB(p,t,other_b,0.5);
112 :
113 : EvtParticle *Kp,*pim,*pi0;
114 :
115 0 : p->makeDaughters(getNDaug(),getDaugs());
116 0 : Kp=p->getDaug(0);
117 0 : pim=p->getDaug(1);
118 0 : pi0=p->getDaug(2);
119 :
120 0 : EvtVector4R p4[3];
121 :
122 : //double dm=getArg(0);
123 0 : double alpha=getArg(1);
124 0 : double beta=getArg(2);
125 0 : int iset;
126 :
127 0 : iset=0;
128 :
129 0 : double p4Kplus[4],p4piminus[4],p4gamm1[4],p4gamm2[4];
130 :
131 0 : double realA,imgA,realbarA,imgbarA;
132 :
133 : #ifdef WIN32
134 : EVTKPIPI(&alpha,&beta,&iset,p4Kplus,p4piminus,p4gamm1,p4gamm2,
135 : &realA,&imgA,&realbarA,&imgbarA);
136 : #else
137 0 : evtkpipi_(&alpha,&beta,&iset,p4Kplus,p4piminus,p4gamm1,p4gamm2,
138 : &realA,&imgA,&realbarA,&imgbarA);
139 : #endif
140 :
141 0 : p4[0].set(p4Kplus[3],p4Kplus[0],p4Kplus[1],p4Kplus[2]);
142 0 : p4[1].set(p4piminus[3],p4piminus[0],p4piminus[1],p4piminus[2]);
143 0 : p4[2].set(p4gamm1[3]+p4gamm2[3],p4gamm1[0]+p4gamm2[0],
144 0 : p4gamm1[1]+p4gamm2[1],p4gamm1[2]+p4gamm2[2]);
145 :
146 0 : Kp->init( getDaug(0), p4[0] );
147 0 : pim->init( getDaug(1), p4[1] );
148 0 : pi0->init( getDaug(2), p4[2] );
149 :
150 0 : EvtComplex amp;
151 :
152 0 : EvtComplex A(realA,imgA);
153 0 : EvtComplex Abar(realbarA,imgbarA);
154 :
155 0 : if (other_b==B0B){
156 0 : amp=Abar;
157 0 : }
158 0 : if (other_b==B0){
159 0 : amp=A;
160 0 : }
161 :
162 0 : vertex(amp);
163 :
164 : return ;
165 0 : }
166 :
|