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: EvtCBTo3piMPP.cc
12 : //
13 : // Description: Routine to decay B+/-->pi+ pi- pi+/-
14 : // and has CP violation.
15 : //
16 : // Modification history:
17 : //
18 : // RYD/Versille May 6, 1997 Module created
19 : //
20 : //------------------------------------------------------------------------
21 : //
22 : #include "EvtGenBase/EvtPatches.hh"
23 : #include <stdlib.h>
24 : #include "EvtGenBase/EvtParticle.hh"
25 : #include "EvtGenBase/EvtGenKine.hh"
26 : #include "EvtGenBase/EvtPDL.hh"
27 : #include "EvtGenBase/EvtReport.hh"
28 : #include "EvtGenBase/EvtId.hh"
29 : #include "EvtGenModels/EvtCBTo3piMPP.hh"
30 : #include <string>
31 :
32 : //Below you will have do modify the declaration to be appropriate
33 : //for your new routine for the calculation of the amplitude
34 :
35 : #ifdef WIN32
36 : extern "C" void __stdcall EVT3PIONSMPP(double *,int *,double *,
37 : double *,double *,double *,
38 : double *,double *,double *);
39 : #else
40 : extern "C" void evt3pionsmpp_(double *,int *,double *,
41 : double *,double *,double *,
42 : double *,double *,double *);
43 : #endif
44 :
45 0 : EvtCBTo3piMPP::~EvtCBTo3piMPP() {}
46 :
47 : std::string EvtCBTo3piMPP::getName(){
48 :
49 0 : return "CB3PI-MPP";
50 :
51 : }
52 :
53 :
54 : EvtDecayBase* EvtCBTo3piMPP::clone(){
55 :
56 0 : return new EvtCBTo3piMPP;
57 :
58 0 : }
59 :
60 : void EvtCBTo3piMPP::init(){
61 :
62 : // check that there are 1 argument
63 0 : checkNArg(1);
64 0 : checkNDaug(3);
65 :
66 0 : checkSpinParent(EvtSpinType::SCALAR);
67 :
68 0 : checkSpinDaughter(0,EvtSpinType::SCALAR);
69 0 : checkSpinDaughter(1,EvtSpinType::SCALAR);
70 0 : checkSpinDaughter(2,EvtSpinType::SCALAR);
71 :
72 0 : }
73 :
74 : void EvtCBTo3piMPP::initProbMax(){
75 :
76 0 : setProbMax(1.5);
77 :
78 0 : }
79 :
80 : void EvtCBTo3piMPP::decay( EvtParticle *p ){
81 :
82 : //added by Lange Jan4,2000
83 0 : static EvtId BM=EvtPDL::getId("B-");
84 0 : static EvtId BP=EvtPDL::getId("B+");
85 :
86 : EvtParticle *pi1,*pi2,*pi3;
87 :
88 0 : p->makeDaughters(getNDaug(),getDaugs());
89 0 : pi1=p->getDaug(0);
90 0 : pi2=p->getDaug(1);
91 0 : pi3=p->getDaug(2);
92 :
93 0 : EvtVector4R p4[3];
94 0 : double alpha = getArg(0);
95 :
96 0 : int iset;
97 :
98 : static int first=1;
99 :
100 0 : if (first==1) {
101 0 : iset=10000;
102 0 : first=0;
103 0 : }
104 : else{
105 0 : iset=0;
106 : }
107 :
108 0 : double p4pi1[4],p4pi2[4],p4pi3[4];
109 :
110 0 : double realA,imgA,realbarA,imgbarA;
111 :
112 : #ifdef WIN32
113 : EVT3PIONSMPP(&alpha,&iset,p4pi1,p4pi2,p4pi3,
114 : &realA,&imgA,&realbarA,&imgbarA);
115 : #else
116 0 : evt3pionsmpp_(&alpha,&iset,p4pi1,p4pi2,p4pi3,
117 : &realA,&imgA,&realbarA,&imgbarA);
118 : #endif
119 :
120 0 : p4[0].set(p4pi1[3],p4pi1[0],p4pi1[1],p4pi1[2]);
121 0 : p4[1].set(p4pi2[3],p4pi2[0],p4pi2[1],p4pi2[2]);
122 0 : p4[2].set(p4pi3[3],p4pi3[0],p4pi3[1],p4pi3[2]);
123 :
124 0 : pi1->init( getDaug(0), p4[0] );
125 0 : pi2->init( getDaug(1), p4[1] );
126 0 : pi3->init( getDaug(2), p4[2] );
127 :
128 0 : EvtComplex A(realA,imgA);
129 0 : EvtComplex Abar(realbarA, imgbarA);
130 :
131 : //amp is filled just to make sure the compiler will
132 : //do its job!! but one has to define amp differently
133 : // if one wants the B+ or the B- to decay to 3pi!
134 : //
135 :
136 :
137 0 : EvtComplex amp;
138 0 : if(p->getId()==BP)
139 : {
140 0 : amp = A;
141 0 : }
142 0 : if(p->getId()==BM)
143 : {
144 0 : amp = Abar;
145 0 : }
146 :
147 0 : vertex(amp);
148 :
149 : return ;
150 0 : }
151 :
152 :
|