1 //--------------------------------------------------------------------------
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.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtBTo3piCP.cc
13 // Description: Routine to decay B->pi+ pi- pi0
14 // and has CP violation.
16 // Modification history:
18 // RYD/VERSILLE March 2, 1997 Module created
20 //------------------------------------------------------------------------
22 #include "EvtGenBase/EvtPatches.hh"
24 #include "EvtGenBase/EvtParticle.hh"
25 #include "EvtGenBase/EvtCPUtil.hh"
26 #include "EvtGenBase/EvtPDL.hh"
27 #include "EvtGenBase/EvtReport.hh"
28 #include "EvtGenModels/EvtBTo3piCP.hh"
29 #include "EvtGenBase/EvtId.hh"
31 #include "EvtGenBase/EvtConst.hh"
35 extern void __stdcall EVT3PIONS(double *,int *,double *,
36 double *,double *,double *,double *,
37 double *,double *,double *);
41 extern void evt3pions_(double *,int *,double *,
42 double *,double *,double *,double *,
43 double *,double *,double *);
47 EvtBTo3piCP::~EvtBTo3piCP() {}
50 std::string EvtBTo3piCP::getName(){
57 EvtDecayBase* EvtBTo3piCP::clone(){
59 return new EvtBTo3piCP;
63 void EvtBTo3piCP::init(){
65 // check that there are 2 arguments
69 checkSpinParent(EvtSpinType::SCALAR);
71 checkSpinDaughter(0,EvtSpinType::SCALAR);
72 checkSpinDaughter(1,EvtSpinType::SCALAR);
73 checkSpinDaughter(2,EvtSpinType::SCALAR);
78 void EvtBTo3piCP::initProbMax(){
80 // perform common blocks initialization before
82 double alpha=getArg(1);
87 double p4piplus[4],p4piminus[4],p4gamm1[4],p4gamm2[4];
89 double realA,imgA,realbarA,imgbarA;
92 EVT3PIONS(&alpha,&iset,p4piplus,p4piminus,p4gamm1,p4gamm2,
93 &realA,&imgA,&realbarA,&imgbarA);
95 evt3pions_(&alpha,&iset,p4piplus,p4piminus,p4gamm1,p4gamm2,
96 &realA,&imgA,&realbarA,&imgbarA);
103 void EvtBTo3piCP::decay( EvtParticle *p){
105 //added by Lange Jan4,2000
106 static EvtId B0=EvtPDL::getId("B0");
107 static EvtId B0B=EvtPDL::getId("anti-B0");
112 EvtCPUtil::getInstance()->OtherB(p,t,other_b,0.5);
114 EvtParticle *pip,*pim,*pi0;
116 p->makeDaughters(getNDaug(),getDaugs());
118 // p->init_daug(SCALAR,&pip,SCALAR,&pim,SCALAR,&pi0);
126 double alpha=getArg(1);
131 double p4piplus[4],p4piminus[4],p4gamm1[4],p4gamm2[4];
133 double realA,imgA,realbarA,imgbarA;
136 EVT3PIONS(&alpha,&iset,p4piplus,p4piminus,p4gamm1,p4gamm2,
137 &realA,&imgA,&realbarA,&imgbarA);
139 evt3pions_(&alpha,&iset,p4piplus,p4piminus,p4gamm1,p4gamm2,
140 &realA,&imgA,&realbarA,&imgbarA);
143 p4[0].set(p4piplus[3],p4piplus[0],p4piplus[1],p4piplus[2]);
144 p4[1].set(p4piminus[3],p4piminus[0],p4piminus[1],p4piminus[2]);
145 p4[2].set(p4gamm1[3]+p4gamm2[3],p4gamm1[0]+p4gamm2[0],
146 p4gamm1[1]+p4gamm2[1],p4gamm1[2]+p4gamm2[2]);
148 if (pip->getId()==EvtPDL::getId("pi+")) {
149 pip->init( getDaug(0), p4[0] );
150 pim->init( getDaug(1), p4[1] );
153 pip->init( getDaug(0), p4[1] );
154 pim->init( getDaug(1), p4[0] );
157 pi0->init( getDaug(2), p4[2] );
161 EvtComplex A(realA,imgA);
162 EvtComplex Abar(realbarA,imgbarA);
165 amp=A*cos(dm*t/(2*EvtConst::c))+
166 EvtComplex(0.,1.)*Abar*sin(dm*t/(2*EvtConst::c));
169 amp=Abar*cos(dm*t/(2*EvtConst::c))+
170 EvtComplex(0.,1.)*A*sin(dm*t/(2*EvtConst::c));