Fix bug in building local list of valid files.
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenModels / EvtCBTo3piP00.cpp
CommitLineData
da0e9ce3 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: EvtCBTo3piP00.cc
12//
13// Description: Routine to decay B+/-->pi0 pi0 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 "EvtGenModels/EvtCBTo3piP00.hh"
29#include <string>
30
31//Below you will have do modify the declaration to be appropriate
32//for your new routine for the calculation of the amplitude
33
34#ifdef WIN32
35extern "C" {
36 extern void EVT3PIONSP00(double *,int *,
37 double *,
38 double *,double *,
39 double *,double *,
40 double *,double *,double *,double *);
41}
42#else
43extern "C" {
44 extern void evt3pionsp00_(double *,int *,
45 double *,
46 double *,double *,
47 double *,double *,
48 double *,double *,double *,double *);
49}
50#endif
51
52EvtCBTo3piP00::~EvtCBTo3piP00() {}
53
54std::string EvtCBTo3piP00::getName(){
55
56 return "CB3PI-P00";
57
58}
59
60
61EvtDecayBase* EvtCBTo3piP00::clone(){
62
63 return new EvtCBTo3piP00;
64
65}
66
67void EvtCBTo3piP00::init(){
68
69 // check that there are 1 argument
70 checkNArg(1);
71 checkNDaug(3);
72
73 checkSpinParent(EvtSpinType::SCALAR);
74
75 checkSpinDaughter(0,EvtSpinType::SCALAR);
76 checkSpinDaughter(1,EvtSpinType::SCALAR);
77 checkSpinDaughter(2,EvtSpinType::SCALAR);
78
79}
80
81
82
83void EvtCBTo3piP00::initProbMax(){
84
85
86 setProbMax(1.5);
87
88}
89
90
91void EvtCBTo3piP00::decay( EvtParticle *p ){
92
93 //added by Lange Jan4,2000
94 static EvtId BM=EvtPDL::getId("B-");
95 static EvtId BP=EvtPDL::getId("B+");
96
97 EvtParticle *pi1,*pi2,*pi3;
98
99 p->makeDaughters(getNDaug(),getDaugs());
100 pi1=p->getDaug(0);
101 pi2=p->getDaug(1);
102 pi3=p->getDaug(2);
103
104 EvtVector4R p4[3];
105 double alpha = getArg(0);
106 int iset;
107 static int first=1;
108
109 if (first==1) {
110 iset=10000;
111 first=0;
112 }
113 else{
114 iset=0;
115 }
116
117 double p4pi1[4],p4Gamma11[4],p4Gamma12[4];
118 double p4Gamma21[4],p4Gamma22[4];
119
120 double realA,imgA,realbarA,imgbarA;
121
122 evt3pionsp00_(&alpha,&iset,
123 p4pi1,
124 p4Gamma11,p4Gamma12,
125 p4Gamma21,p4Gamma22,
126 &realA,&imgA,&realbarA,&imgbarA);
127
128 p4[0].set(p4pi1[3],p4pi1[0],p4pi1[1],p4pi1[2]);
129 p4[1].set(p4Gamma11[3]+p4Gamma12[3],
130 p4Gamma11[0]+p4Gamma12[0],
131 p4Gamma11[1]+p4Gamma12[1],
132 p4Gamma11[2]+p4Gamma12[2]);
133 p4[2].set(p4Gamma21[3]+p4Gamma22[3],
134 p4Gamma21[0]+p4Gamma22[0],
135 p4Gamma21[1]+p4Gamma22[1],
136 p4Gamma21[2]+p4Gamma22[2]);
137
138 pi1->init( getDaug(0), p4[0] );
139 pi2->init( getDaug(1), p4[1] );
140 pi3->init( getDaug(2), p4[2] );
141
142 EvtComplex A(realA,imgA);
143 EvtComplex Abar(realbarA, imgbarA);
144
145 EvtComplex amp;
146 if(p->getId()==BP)
147 {
148 amp = A;
149 }
150 if(p->getId()==BM)
151 {
152 amp = Abar;
153 }
154
155 vertex(amp);
156
157 return ;
158}
159