22#include "EvtGenModels/EvtPsi3Sdecay.hh"
23#include "EvtGenBase/EvtRandom.hh"
24#include "EvtGenBase/EvtParticleFactory.hh"
25#include "EvtGenBase/EvtGenKine.hh"
26#include "EvtGenBase/EvtHelSys.hh"
30int EvtPsi3Sdecay::psi3Scount=0;
33 if(Ecms < x[0] ){theLocation =0;}
else
34 if(Ecms >=x[nsize-1]) {theLocation = nsize-1;}
else{
35 for (
int i=0;i<nsize-1;i++){
36 if( x[i] <= Ecms && x[i+1] > Ecms) {theLocation=i;}
46 if(theLocation==nsize-1){xs = vy[nsize-1];}
else{
47 xs = (vy[theLocation +1 ]- vy[theLocation]) / (x[theLocation+1]-x[theLocation])*(Ecms - x[theLocation])+vy[theLocation];
56 int Nchannels=myxs.size();
60 std::vector <double> thexs;
63 for(
int j=0;j<Nchannels;j++){
65 thexs.push_back(sumxs);
69 if(sumxs == 0) {std::cout<<
"EvtPsi3Sdecay::theProb, denominator is 0"<<std::endl;::abort();}
70 return thexs[ich] / sumxs ;
77 std::string son0,son1,son2;
80 for(
int i=0;i<Ndaugs;i++){
82 if(nson!=
"gammaFSR" && nson!=
"gamma"){ Vson.push_back(nson);Vid.push_back(theParent->
getDaug(i)->
getId());}
91 son0 = Vson[0];son1 = Vson[1];
92 if(son0 ==
"D0" && son1 ==
"anti-D0" || son1 ==
"D0" && son0 ==
"anti-D0") {
return 0;}
else
93 if(son0 ==
"D+" && son1 ==
"D-" || son1 ==
"D+" && son0 ==
"D-" ) {
return 1;}
else
94 if(son0 ==
"D0" && son1 ==
"anti-D*0" || son1 ==
"D0" && son0 ==
"anti-D*0") {
return 2;}
else
95 if(son0 ==
"anti-D0" && son1 ==
"D*0" || son1 ==
"anti-D0" && son0 ==
"D*0") {
return 3;}
else
96 if(son0 ==
"D*0" && son1 ==
"anti-D*0" || son1 ==
"D*0" && son0 ==
"anti-D*0") {
return 4;}
else
97 if(son0 ==
"D*+" && son1 ==
"D-" || son1 ==
"D*+" && son0 ==
"D-") {
return 5;}
else
98 if(son0 ==
"D*-" && son1 ==
"D+" || son1 ==
"D*-" && son0 ==
"D+") {
return 6;}
else
99 if(son0 ==
"D*+" && son1 ==
"D*-" || son1 ==
"D*+" && son0 ==
"D*-") {
return 7;}
else
100 if(son0 ==
"D_s+" && son1 ==
"D_s-" || son1 ==
"D_s+" && son0 ==
"D_s-") {
return 8;}
else
101 if(son0 ==
"D_s*+" && son1 ==
"D_s-" || son1 ==
"D_s*+" && son0 ==
"D_s-") {
return 9;}
else
102 if(son0 ==
"D_s*-" && son1 ==
"D_s+" || son1 ==
"D_s*-" && son0 ==
"D_s+") {
return 10;}
else
103 if(son0 ==
"D_s*+" && son1 ==
"D_s*-" || son1 ==
"D_s*+" && son0 ==
"D_s*-") {
return 11;}
else {
goto ErrInfo;}
106 son0 = Vson[0];son1 = Vson[1];son2 = Vson[2];
107 if(son0 ==
"D*+" && son1 ==
"D-" && son2 ==
"pi0" ) {
return 12;}
else
108 if(son0 ==
"D*-" && son1 ==
"D+" && son2 ==
"pi0" ) {
return 13;}
else
109 if(son0 ==
"D*+" && son1 ==
"anti-D0" && son2 ==
"pi-" ) {
return 14;}
else
110 if(son0 ==
"D*-" && son1 ==
"D0" && son2 ==
"pi+" ) {
return 15;}
else
111 if(son0 ==
"D+" && son1 ==
"anti-D*0" && son2 ==
"pi-" ) {
return 16;}
else
112 if(son0 ==
"D-" && son1 ==
"D*0" && son2 ==
"pi+" ) {
return 17;}
else
113 if(son0 ==
"D*+" && son1 ==
"D*-" && son2 ==
"pi0" ) {
return 18;}
else
114 if(son0 ==
"anti-D*0" &&son1 ==
"D*+" && son2 ==
"pi-" ) {
return 19;}
else
115 if(son0 ==
"D*0" && son1 ==
"D*-" && son2 ==
"pi+" ) {
return 20;}
else
116 if(son0 ==
"D*0" && son1 ==
"anti-D*0" && son2 ==
"pi0" ) {
return 21;}
else
117 if(son0 ==
"D0" && son1 ==
"anti-D*0" && son2 ==
"pi0" ) {
return 22;}
else
118 if(son0 ==
"anti-D0" && son1 ==
"D*0" && son2 ==
"pi0" ) {
return 23;}
else {
goto ErrInfo;}
121 std::cout<<
"Not open charm decay"<<std::endl;
122 std::cout<<
"final states \"";
123 for(
int j=0;j<nh;j++){
124 std::cout<<Vson[j]<<
" ";
126 std::cout<<
" \" is not in the Psi3Decay list, see $BESEVTGENROOT/src/EvtGen/EvtGenModels/EvtPsi3Sdecay.hh"<<std::endl;
136 double d0d0bar_xs=
polint(d0d0bar);
137 double dpdm_xs =
polint(dpdm);
138 double d0dst0bar_xs =
polint(d0dst0bar);
139 double d0bardst0_xs =
polint(d0bardst0);
141 double dst0dst0bar_xs =
polint(dst0dst0bar);
142 double dstpdm_xs =
polint(dstpdm);
144 double dstmdp_xs =
polint(dstmdp);
145 double dstpdstm_xs =
polint(dstpdstm);
147 double dspdsm_xs =
polint(dspdsm);
149 double dsspdsm_xs =
polint(dsspdsm);
150 double dssmdsp_xs =
polint(dssmdsp);
152 double dsspdssm_xs =
polint(dsspdssm);
154 double _xs12 =
polint(xs12);
155 double _xs13 =
polint(xs13);
156 double _xs14 =
polint(xs14);
157 double _xs15 =
polint(xs15);
158 double _xs16 =
polint(xs16);
159 double _xs17 =
polint(xs17);
160 double _xs18 =
polint(xs18);
161 double _xs19 =
polint(xs19);
162 double _xs20 =
polint(xs20);
163 double _xs21 =
polint(xs21);
164 double _xs22 =
polint(xs22);
165 double _xs23 =
polint(xs23);
172 for(
int i=0;i<Vid.size();i++){
175 double mparent= theParent->
getP4().
mass();
177 if (mparent<xmtotal){
return false;}
180 std::vector<double> myxs; myxs.clear();
181 myxs.push_back(d0d0bar_xs);
182 myxs.push_back(dpdm_xs);
183 myxs.push_back(d0dst0bar_xs);
184 myxs.push_back(d0bardst0_xs);
185 myxs.push_back(dst0dst0bar_xs);
186 myxs.push_back(dstpdm_xs);
187 myxs.push_back(dstmdp_xs);
188 myxs.push_back(dstpdstm_xs);
189 myxs.push_back(dspdsm_xs);
190 myxs.push_back(dsspdsm_xs);
191 myxs.push_back(dssmdsp_xs);
192 myxs.push_back(dsspdssm_xs);
194 myxs.push_back(_xs12);
195 myxs.push_back(_xs13);
196 myxs.push_back(_xs14);
197 myxs.push_back(_xs15);
198 myxs.push_back(_xs16);
199 myxs.push_back(_xs17);
200 myxs.push_back(_xs18);
201 myxs.push_back(_xs19);
202 myxs.push_back(_xs20);
203 myxs.push_back(_xs21);
204 myxs.push_back(_xs22);
205 myxs.push_back(_xs23);
208 if(ich==0){ Prop0=0;}
else
216 if( Prop0 < pm && pm<= Prop1 )
flag =
true;
233 double xm = par->
mass();
235 std::vector< EvtId > theid =
getVId(themode);
236 int ndaugjs = theid.size();
238 for(
int i=0;i<ndaugjs;i++){myId[i]=theid[i];}
255 v_p4.clear();Vid.clear();
256 double xm = par->
mass();
261 std::vector< EvtId > theid =
getVId(themode);
262 int ndaugjs = theid.size();
264 for(
int i=0;i<ndaugjs;i++){myId[i]=theid[i];}
267 for(
int i=0;i<mypar->
getNDaug();i++){
276 bool pp = (themode == 0||themode == 1 ||themode ==6);
277 bool vp = (themode >=2 && themode <=5 || themode >=7 && themode <=9 );
284 if(
alpha != 0 && !flag1 )
goto loop;
287 for(
int i=0;i<mypar->
getNDaug();i++){
289 v_p4.push_back( di->
getP4() );
290 Vid.push_back(myId[i]);
315 if(ecms<3.97 || ecms >4.66){std::cout<<
"EvtPsi3Sdecay::getDecay: You need to set the CMS energy between 3.97~4.66 GeV, but you have ecms= "<<
ecms<<
" GeV.The lower end can be set at KKMC"<<std::endl; }
316 if(_excflag ==1)
return _themode;
319 double d0d0bar_xs=
polint(d0d0bar);
320 double dpdm_xs =
polint(dpdm);
321 double d0dst0bar_xs =
polint(d0dst0bar);
322 double d0bardst0_xs =
polint(d0bardst0);
324 double dst0dst0bar_xs =
polint(dst0dst0bar);
325 double dstpdm_xs =
polint(dstpdm);
327 double dstmdp_xs =
polint(dstmdp);
328 double dstpdstm_xs =
polint(dstpdstm);
330 double dspdsm_xs =
polint(dspdsm);
332 double dsspdsm_xs =
polint(dsspdsm);
333 double dssmdsp_xs =
polint(dssmdsp);
335 double dsspdssm_xs =
polint(dsspdssm);
337 double _xs12 =
polint(xs12);
338 double _xs13 =
polint(xs13);
339 double _xs14 =
polint(xs14);
340 double _xs15 =
polint(xs15);
341 double _xs16 =
polint(xs16);
342 double _xs17 =
polint(xs17);
343 double _xs18 =
polint(xs18);
344 double _xs19 =
polint(xs19);
345 double _xs20 =
polint(xs20);
346 double _xs21 =
polint(xs21);
347 double _xs22 =
polint(xs22);
348 double _xs23 =
polint(xs23);
351 std::vector<double> myxs; myxs.clear();
352 myxs.push_back(d0d0bar_xs);
353 myxs.push_back(dpdm_xs);
354 myxs.push_back(d0dst0bar_xs);
355 myxs.push_back(d0bardst0_xs);
356 myxs.push_back(dst0dst0bar_xs);
357 myxs.push_back(dstpdm_xs);
358 myxs.push_back(dstmdp_xs);
359 myxs.push_back(dstpdstm_xs);
360 myxs.push_back(dspdsm_xs);
361 myxs.push_back(dsspdsm_xs);
362 myxs.push_back(dssmdsp_xs);
363 myxs.push_back(dsspdssm_xs);
364 myxs.push_back(_xs12);
365 myxs.push_back(_xs13);
366 myxs.push_back(_xs14);
367 myxs.push_back(_xs15);
368 myxs.push_back(_xs16);
369 myxs.push_back(_xs17);
370 myxs.push_back(_xs18);
371 myxs.push_back(_xs19);
372 myxs.push_back(_xs20);
373 myxs.push_back(_xs21);
374 myxs.push_back(_xs22);
375 myxs.push_back(_xs23);
378 for(
int i=0;i<myxs.size();i++){mytotxs += myxs[i];}
379 if(psi3Scount==0) {std::cout<<
"The total xs at "<<
ecms<<
" is: "<<mytotxs<<
" pb"<<std::endl;psi3Scount++;}
385 if(niter>1000) {std::cout<<
"EvtPsi3Sdecay:getDecay() do loops over 1000 times at Ecm= "<<
ecms<<std::endl;abort();}
388 std::vector<EvtId> theVid;
391 for(
int i=0;i<theVid.size();i++){
395 if(Ecms < xmtotal ) {
goto loop;}
398 if(ich==0){ Prop0=0;}
else
406 if( Prop0 < pm && pm<= Prop1 ) {
return ich;}
413 std::vector<EvtId> theVid;
415 for(
int i=0;i<VmodeSon[mode].size();i++){
417 theVid.push_back(theId);
425 double theta=angles.getHelAng(1);
434 if(rand <=ags) {
return true;}
double cos(const BesAngle a)
static std::string name(EvtId i)
static double getMinMass(EvtId i)
static EvtId getId(const std::string &name)
static EvtParticle * particleFactory(EvtSpinType::spintype spinType)
void makeDaughters(int ndaug, EvtId *id)
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
int getDecay(double ecms)
double theProb(std::vector< double > myxs, int ich)
void PHSPDecay(EvtParticle *par)
bool AngSam(EvtVector4R parent_p4cm, EvtVector4R son_p4cm, double alpha)
std::vector< EvtId > getVId(int mode)
double polint(std::vector< double > points)