124#include "TGraphErrors.h"
126#include "TPostScript.h"
128#include "TMultiGraph.h"
132 extern double dgauss_(
double (*fun)(
double*),
double *,
double *,
double *);
136 extern double divdif_(
float*,
float *,
int *,
float *,
int*);
140 extern void polint_(
float*,
float *,
int *,
float *,
float*);
144 extern void hadr5n12_(
float*,
float *,
float *,
float *,
float *,
float *);
155double EvtConExc::_xs0=0;
156double EvtConExc::_xs1=0;
157double EvtConExc::_er0=0;
158double EvtConExc::_er1=0;
159int EvtConExc::_nevt=0;
164std::vector<std::vector <double> > EvtConExc::VXS;
192 for(
int i=0;i<120;i++){
196 for(
int i=0;i<97;i++){
197 if(47<=i && i<=49)
continue;
198 if(52<=i && i<=67)
continue;
199 if(85<=i && i<=89)
continue;
200 if(_mode==74110) vmode.push_back(i);
203 vmode.push_back(74100);
204 vmode.push_back(74101);
205 vmode.push_back(74102);
206 vmode.push_back(74103);
207 vmode.push_back(74104);
208 vmode.push_back(74105);
209 vmode.push_back(74110);
218 }
else if(
getNDaug()>2){std::cout<<
"Bad daughter specified"<<std::endl;abort();}
224 radflag=0;mydbg=
false;
229 std::cout<<
"The decay daughters are "<<std::endl;
231 std::cout<<std::endl;
233 radflag=0;mydbg=
false;
238 else if(
getNArg()==1){ _mode =
getArg(0);radflag=0;mydbg=
false;}
241 else{std::cout<<
"ConExc:umber of parameter should be 1,2 or 3, but you set "<<
getNArg()<<std::endl;::abort(); }
250 myfile =
new TFile(
"mydbg.root",
"RECREATE");
251 xs=
new TTree (
"xs",
"momentum of rad. gamma and hadrons");
252 xs->Branch(
"imode",&imode,
"imode/I");
253 xs->Branch(
"pgam",pgam,
"pgam[4]/D");
254 xs->Branch(
"phds",phds,
"phds[4]/D");
255 xs->Branch(
"ph1",ph1,
"ph1[4]/D");
256 xs->Branch(
"ph2",ph2,
"ph2[4]/D");
257 xs->Branch(
"mhds",&mhds,
"mhds/D");
258 xs->Branch(
"mass1",&mass1,
"mass1/D");
259 xs->Branch(
"mass2",&mass2,
"mass2/D");
260 xs->Branch(
"costheta",&costheta,
"costheta/D");
261 xs->Branch(
"cosp",&cosp,
"cosp/D");
262 xs->Branch(
"cosk",&cosk,
"cosk/D");
263 xs->Branch(
"sumxs",&sumxs,
"sumxs/D");
264 xs->Branch(
"selectmode",&selectmode,
"selectmode/D");
270 std::cout<<
"parent mass = "<<parentMass<<std::endl;
282 if(mx<mth){std::cout<<
"The CMS energy is lower than the threshold of the final states"<<std::endl;abort();}
283 }
else if(_mode == -2){
289 std::cout<<
"The specified mode is "<<_mode<<std::endl;
294 double Esig = 0.0001;
295 double x = 2*Egamcut/
_cms;
297 double mhscut = sqrt(
s*(1-
x));
300 float fe,fst2,fder,ferrder,fdeg,ferrdeg;
304 if(3.0943<
_cms &&
_cms<3.102) vph=1;
305 std::cout<<
"sum of leptonic, hadronic contributions(u,d,s,c,b) to vacuum polarization: "<<vph<<
" @"<<fe<<
"GeV"<<std::endl;
311 for(
int jj=1;jj<_ndaugs;jj++){
316 ISRXS.clear();ISRM.clear();ISRFLAG.clear();
317 for(
int ii=0;ii<3;ii++){
319 if(mx<mR || _mode !=74110)
continue;
320 double narRxs=
Ros_xs(mx,BR_ee[ii],ResId[ii]);
321 std::cout<<
"The corss section for gamma "<<
EvtPDL::name(ResId[ii]).c_str()<<
" is: "<< narRxs<<
"*Br (nb)."<<std::endl;
322 ISRXS.push_back(narRxs);
324 ISRFLAG.push_back(1.);
325 ISRID.push_back(ResId[ii]);
328 std::cout<<
"==========================================================================="<<std::endl;
333 EgamH = (
s-mhdL*mhdL)/2/sqrt(
s);
337 std::cout<<
"_er0= "<<_er0<<std::endl;
339 double xs1_err = _er1;
343 double xb= 2*Esig/
_cms;
350 double stp=(EgamH - Egamcut)/Nstp;
351 for(
int i=0;i<Nstp;i++){
352 double Eg0=EgamH - i*stp;
353 double Eg1=EgamH - (i+1)*stp;
359 double binwidth = mh2-mhi;
362 if(i>=1) AF[i]=AF[i-1]+xsi;
366 AA[598]=Egamcut; AA[599]=0;
368 AF[599]=AF[598]+ _xs0;
373 for(
int i=0;i<vmode.size();i++){
375 if(_mode==74110)
mk_VXS(Esig,Egamcut,EgamH,i);
393 for(
int i=0;i<600;i++){
399 std::cout<<
"VXS[79][599]: "<<VXS[79][599]<<
" VXS[79][598]= "<<VXS[79][598]<<std::endl;
400 std::cout<<
"EgamH="<<EgamH<<
" "<<_xs0+_xs1<<
" AF[599]="<<AF[599]<<
" AF[598] "<<AF[598]<<std::endl;
407 double obsvXS = _xs0 + _xs1;
408 double obsvXS_er= _er0 + xs1_err;
409 double corr = obsvXS/bornXS;
410 double corr_er =corr*sqrt(bornXS_er*bornXS_er/bornXS/bornXS + obsvXS_er*obsvXS_er/obsvXS/obsvXS);
413 if(bornXS==0){std::cout<<
"EvtConExc::init : The Born cross section at this point is zero!"<<std::endl;abort();}
414 if(obsvXS==0){std::cout<<
"EvtConExc::init : The observed cross section at this point is zero!"<<std::endl;abort();}
419 std::cout<<
""<<std::endl;
420 std::cout<<
"========= Generation using cross section (Egamcut="<<Egamcut<<
" GeV) =============="<<std::endl;
421 std::cout<<
" sqrt(s)= "<<mx<<
" GeV "<<std::endl;
422 if(_mode>=0 || _mode ==-2 ){
423 std::cout<<
"The generated born cross section (sigma_b): "<<_xs0<<
"+/-"<<_er0<<
" in Unit "<<_unit.c_str()<<std::endl;
424 std::cout<<
"The generated radiative correction cross section (sigma_isr): "<<_xs1<<
"+/-"<<xs1_err<<
" in Unit "<<_unit.c_str()<<std::endl;
425 std::cout<<
"The Born process is sampled according to the ratio sigma_b/(sigma_b+sigma_isr)"<<std::endl;
426 std::cout<<
"The radiative correction factor f_ISR*f_vacuum= sigma_obs/sigma_born(s) = "<<corr<<
"+/-"<< fabs(corr_er)<<
","<<std::endl;
427 std::cout<<
"which is calcualted with these quantities:"<<std::endl;
428 std::cout<<
"the observed cross section is "<<obsvXS<<
"+/-"<< obsvXS_er<<_unit.c_str()<<std::endl;
429 std::cout<<
"and the Born cross section (s) is "<<bornXS<<
"+/-"<<bornXS_er<<_unit.c_str()<<std::endl;
430 std::cout<<
"and the vaccum polarziation factor (lep. + hadr.) 1/|1-Pi|^2= "<<vph<<std::endl;
432 std::cout<<
"==========================================================================="<<std::endl;
434 std::cout<<
"The generated born cross section (sigma_b): "<<_xs0<<
" *Br_ee"<<
" in Unit "<<_unit.c_str()<<std::endl;
435 std::cout<<
"The generated radiative correction cross section (sigma_isr): "<<_xs1<<
"*Br_ee in Unit "<<_unit.c_str()<<std::endl;
436 std::cout<<
"The Born process is sampled according to the ratio sigma_b/(sigma_b+sigma_isr)"<<std::endl;
437 std::cout<<
"The radiative correction factor sigma_obs/sigma_born(s) = (1+delta) = "<<corr<<
"+/-"<< fabs(corr_er)<<std::endl;
438 std::cout<<
"==========================================================================="<<std::endl;
440 std::cout<<std::endl;
441 std::cout<<std::endl;
448 if(_xs0 == 0 && _xs1==0){std::cout<<
"EvtConExc::ini() has zero cross section"<<std::endl;abort();}
450 std::cout<<std::endl;
451 std::cout<<std::endl;
454 if(mydbg && _mode!=74110){
456 double xx[10000],yy[10000],xer[10000],yer[10000];
457 for(
int i=0;i<nd;i++){
464 myth=
new TH1F(
"myth",
"Exp.data",200,xx[0],xx[nd]);
465 for(
int i=0;i<nd;i++){
466 myth->Fill(xx[i],yy[i]);
474 if(mydbg && _mode==74110 ){
476 double xx[10000],yy[10000],xer[10000],yer[10000],ysum[10000],yysum[10000];
477 for(
int i=0;i<nd;i++){
487 TGraphErrors *Gdt =
new TGraphErrors(nd,xx,yy,xer,yer);
489 myth=
new TH1F(
"myth",
"Exp.data",600,
xlow,xhigh);
490 Xsum=
new TH1F(
"sumxs",
"sum of exclusive xs",600,
xlow,xhigh);
492 for(
int i=0;i<600;i++){
500 for(
int i=0;i<600;i++){
503 if(ysum[i]==0)
continue;
504 Xsum->Fill(mx,ysum[i]);
508 for(
int i=0;i<nd;i++){
516 TGraphErrors *Gsum =
new TGraphErrors(nd,xx,yysum,xer,yer);
518 double ex[600]={600*0};
519 double ey[600],ta[600];
520 double exz[600]={600*0};
521 double eyz[600]={600*0};
522 for(
int i=0;i<600;i++){
525 TGraphErrors *gr0 =
new TGraphErrors(600,MH,AF,ex,ey);
526 TGraphErrors *gr1 =
new TGraphErrors(600,MH,RadXS,exz,eyz);
527 TPostScript *ps =
new TPostScript(
"xsobs.ps",111);
528 TCanvas *c1 =
new TCanvas(
"c1",
"TGraphs for data",200,10,600,400);
531 gStyle->SetCanvasColor(0);
532 gStyle->SetStatBorderSize(1);
540 gr0->SetMarkerStyle(10);
542 gr0->GetXaxis()->SetTitle(
"M_{hadrons} (GeV)");
543 gr0->GetYaxis()->SetTitle(
"observed cross section (nb)");
551 gr1->SetMarkerStyle(10);
553 gr1->GetXaxis()->SetTitle(
"M_{hadrons} (GeV)");
554 gr1->GetYaxis()->SetTitle(
"Rad*BornXS");
558 TMultiGraph *mg =
new TMultiGraph();
559 mg->SetTitle(
"Exclusion graphs");
560 Gdt->SetMarkerStyle(2);
561 Gdt->SetMarkerSize(1);
562 Gsum->SetLineColor(2);
563 Gsum->SetLineWidth(1);
573 mg->GetXaxis()->SetTitle(
"M_{hadrons} (GeV)");
574 mg->GetYaxis()->SetTitle(
"observed cross section (nb)");
582 Gdt->SetMarkerStyle(2);
584 Gdt->GetXaxis()->SetTitle(
"M_{hadrons} (GeV)");
585 Gdt->GetYaxis()->SetTitle(
"observed cross section (nb)");
592 Gsum->SetMarkerStyle(2);
593 Gsum->SetMarkerSize(1);
595 Gsum->SetLineWidth(0);
596 Gsum->GetXaxis()->SetTitle(
"M_{hadrons} (GeV)");
597 Gsum->GetYaxis()->SetTitle(
"observed cross section (nb)");
605 Gdt->SetMarkerStyle(2);
606 Gdt->SetMarkerSize(1);
607 Gdt->SetMaximum(8000.0);
608 Gsum->SetLineColor(2);
609 Gsum->SetLineWidth(1.5);
612 Gsum->GetXaxis()->SetTitle(
"M_{hadrons} (GeV)");
613 Gsum->GetYaxis()->SetTitle(
"cross section (nb)");
649 }
else if(mode ==6 ){
668 }
else if(mode ==10 ){
673 }
else if(mode ==11 ){
678 }
else if(mode ==12 ){
684 }
else if(mode ==13 ){
690 }
else if(mode ==14 ){
696 }
else if(mode ==15 ){
702 }
else if(mode ==16 ){
708 }
else if(mode ==17 ){
715 }
else if(mode ==18 ){
722 }
else if(mode ==19 ){
729 }
else if(mode ==20 ){
736 }
else if(mode ==21 ){
744 }
else if(mode ==22 ){
752 }
else if(mode == 23){
756 }
else if(mode == 24){
760 }
else if(mode == 25){
764 }
else if(mode == 26){
768 }
else if(mode == 27){
772 }
else if(mode == 28){
777 }
else if(mode == 29){
782 }
else if(mode == 30){
787 }
else if(mode == 31){
792 }
else if(mode == 32){
797 }
else if(mode == 33){
802 }
else if(mode == 34){
807 }
else if(mode == 35){
812 }
else if(mode == 36){
816 }
else if(mode == 37){
821 }
else if(mode == 38){
826 }
else if(mode == 39){
830 }
else if(mode == 40){
835 }
else if(mode == 41){
840 }
else if(mode == 42){
845 }
else if(mode == 43){
851 }
else if(mode == 44){
855 }
else if(mode == 45){
859 }
else if(mode == 46){
863 }
else if(mode == 47){
867 }
else if(mode == 48){
871 }
else if(mode == 49){
876 }
else if(mode == 50){
881 }
else if(mode == 51){
886 }
else if(mode == 65){
891 }
else if(mode == 66){
896 }
else if(mode == 67){
900 }
else if(mode == 68){
905 }
else if(mode == 69){
910 }
else if(mode == 70){
919 }
else if(mode == 72){
924 }
else if(mode == 73){
929 }
else if(mode == 74){
934 }
else if(mode == 75){
939 }
else if(mode == 76){
944 }
else if(mode == 77){
949 }
else if(mode == 78){
954 }
else if(mode == 79){
959 }
else if(mode == 80){
963 }
else if(mode == 81){
968 }
else if(mode == 82){
973 }
else if(mode == 83){
978 }
else if(mode == 84){
983 }
else if(mode == 90){
988 }
else if(mode == 91){
993 }
else if(mode == 92){
998 }
else if(mode == 93){
1002 }
else if(mode == 94){
1006 }
else if(mode == 95){
1010 }
else if(mode == 96){
1014 }
else if(mode == 74100){
1017 }
else if(mode == 74101){
1020 }
else if(mode == 74102){
1023 }
else if(mode == 74103){
1026 }
else if(mode == 74104){
1029 }
else if(mode == 74105){
1032 }
else if(mode == 74106){
1035 }
else if(mode == 74107){
1038 }
else if(mode == 74110){
1044 _modeFlag.push_back(74110);
1045 _modeFlag.push_back(0);
1046 }
else if(mode == -1){
1048 for(
int i=0;i<nson;i++){ daugs[i]=son[i]; }
1049 std::cout<<
"The paraent particle: "<<
EvtPDL::name(pid)<<std::endl;
1050 }
else if(mode == -2){
1052 for(
int i=0;i<nson;i++){ daugs[i]=son[i]; }
1053 }
else if(mode == 10000){
1058 std::cout<<
"Bad mode_index number " <<mode<<
", please refer to the manual."<<std::endl;
1070 for(
int i=0;i<_ndaugs;i++){
1076 if(_mode!=74110 && Mthr<fmth) {std::cout<<
"Low end of cross section: ("<<Mthr<<
" < (mass of final state)"<<fmth<<
") GeV."<< std::endl; abort();}
1087 }
else if(mode ==1 ){
1091 }
else if(mode ==2 ){
1095 }
else if(mode ==3 ){
1099 }
else if(mode ==4 ){
1103 }
else if(mode ==5 ){
1107 }
else if(mode ==6 ){
1111 }
else if(mode ==7 ){
1116 }
else if(mode ==8 ){
1121 }
else if(mode ==9 ){
1126 }
else if(mode ==10 ){
1131 }
else if(mode ==11 ){
1136 }
else if(mode ==12 ){
1142 }
else if(mode ==13 ){
1148 }
else if(mode ==14 ){
1154 }
else if(mode ==15 ){
1160 }
else if(mode ==16 ){
1166 }
else if(mode ==17 ){
1173 }
else if(mode ==18 ){
1180 }
else if(mode ==19 ){
1187 }
else if(mode ==20 ){
1194 }
else if(mode ==21 ){
1202 }
else if(mode ==22 ){
1210 }
else if(mode == 23){
1214 }
else if(mode == 24){
1218 }
else if(mode == 25){
1222 }
else if(mode == 26){
1226 }
else if(mode == 27){
1230 }
else if(mode == 28){
1235 }
else if(mode == 29){
1240 }
else if(mode == 30){
1245 }
else if(mode == 31){
1250 }
else if(mode == 32){
1255 }
else if(mode == 33){
1260 }
else if(mode == 34){
1265 }
else if(mode == 35){
1270 }
else if(mode == 36){
1274 }
else if(mode == 37){
1279 }
else if(mode == 38){
1284 }
else if(mode == 39){
1288 }
else if(mode == 40){
1293 }
else if(mode == 41){
1298 }
else if(mode == 42){
1303 }
else if(mode == 43){
1309 }
else if(mode == 44){
1313 }
else if(mode == 45){
1317 }
else if(mode == 46){
1321 }
else if(mode == 47){
1325 }
else if(mode == 48){
1329 }
else if(mode == 49){
1334 }
else if(mode == 50){
1339 }
else if(mode == 51){
1344 }
else if(mode == 65){
1349 }
else if(mode == 66){
1354 }
else if(mode == 67){
1358 }
else if(mode == 68){
1363 }
else if(mode == 69){
1368 }
else if(mode == 70){
1373}
else if(mode == 71){
1377 }
else if(mode == 72){
1382 }
else if(mode == 73){
1387 }
else if(mode == 74){
1392 }
else if(mode == 75){
1397 }
else if(mode == 76){
1402 }
else if(mode == 77){
1407 }
else if(mode == 78){
1412 }
else if(mode == 79){
1417 }
else if(mode == 80){
1421 }
else if(mode == 81){
1426 }
else if(mode == 82){
1431 }
else if(mode == 83){
1436 }
else if(mode == 84){
1441 }
else if(mode == 90){
1446 }
else if(mode == 91){
1451 }
else if(mode == 92){
1456 }
else if(mode == 93){
1460 }
else if(mode == 94){
1464 }
else if(mode == 95){
1468 }
else if(mode == 96){
1472 }
else if(mode == 74100){
1476 }
else if(mode == 74101){
1480 }
else if(mode == 74102){
1484 }
else if(mode == 74103){
1488 }
else if(mode == 74104){
1492 }
else if(mode == 74105){
1496 }
else if(mode == 74106){
1500 }
else if(mode == 74107){
1504 }
else if(mode == 74110){
1511 _modeFlag.push_back(74110);
1512 _modeFlag.push_back(0);
1513 }
else if(mode == -1){
1515 for(
int i=0;i<nson;i++){ daugs[i]=son[i]; }
1516 std::cout<<
"The paraent particle: "<<
EvtPDL::name(pid)<<std::endl;
1517 }
else if(mode == -2){
1519 for(
int i=0;i<nson;i++){ daugs[i]=son[i]; }
1520 }
else if(mode == 10000){
1525 std::cout<<
"Bad mode_index number " <<mode<<
", please refer to the manual."<<std::endl;
1536 std::vector<EvtId> theDaugs;
1537 for(
int i=0;i<_ndaugs;i++){
1538 theDaugs.push_back(daugs[i]);
1540 if(theDaugs.size()) {
return theDaugs;}
else {std::cout<<
"EvtConExc::get_mode: zero size"<<std::endl;abort();}
1553 if(myvpho != p->
getId()){
1554 std::cout<<
"Parent needs to be vpho, but found "<<
EvtPDL::name(p->
getId())<<std::endl;
1563 std::vector<int> vmod; vmod.clear();
1564 int mn[78]={0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,
1566 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,
1567 90,91,92,93,94,95,96,
1568 74100,74101,74102,74103,74104,74105,74110};
1569 int mn2[79]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,
1571 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,
1572 90,91,92,93,94,95,96,
1573 74100,74101,74102,74103,74104,74105,74110};
1574 int mn3[76]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,
1576 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,
1577 90,91,92,93,94,95,96,
1578 74100,74101,74102,74110};
1582 for(
int i=0;i<78;i++){vmod.push_back(mn[i]);}
1584 for(
int i=0;i<79;i++){vmod.push_back(mn2[i]);}
1595 if(pm <_xs0/(_xs0 + _xs1) ){
1599 _selectedMode = mymode;
1600 std::cout<<
"A selected mode is "<<mymode<<
" with Mhds= "<<mhds<<std::endl;
1610 for(
int i=0;i< _ndaugs;i++){
1616 if(totMass>p->
mass())
goto checkA;
1624 mydaugs[0]=daugs[0];
1631 for(
int i=0;i< 2;i++){
1638 if(totMass>p->
mass())
goto checkB;
1650 if(mhds<
SetMthr)
goto Sampling_mhds;
1651 double xeng=1-mhds*mhds/(
_cms*
_cms);
1654 if(mydbg) mass2=mhds;
1660 if(mymode==-10)
goto Sampling_mhds;
1662 if(mhds<2.3 && mymode==74110) {
goto ModeSelection;}
1663 std::cout<<
"A selected mode is "<<mymode<<
" with Mhds= "<<mhds<<std::endl;
1664 _selectedMode = mymode;
1682 mydaugs[0]=daugs[0];
1689 ISRphotonAng_sampling:
1692 for(
int i=0;i< 2;i++){
1698 if(totMass>p->
mass())
goto ISRphotonAng_sampling;
1701 if(!
checkdecay(p))
goto ISRphotonAng_sampling;
1705 if(maxflag==0) {
findMaxXS(mhds); maxflag=1;}
1708 double gx=vgam.
get(1);
1709 double gy=vgam.
get(2);
1710 double sintheta= sqrt(gx*gx+gy*gy)/vgam.
d3mag();
1718 pgam[0]=vgam.
get(0);
1719 pgam[1]=vgam.
get(1);
1720 pgam[2]=vgam.
get(2);
1721 pgam[3]=vgam.
get(3);
1723 phds[0]=vhds.
get(0);
1724 phds[1]=vhds.
get(1);
1725 phds[2]=vhds.
get(2);
1726 phds[3]=vhds.
get(3);
1727 costheta = vgam.
get(3)/vgam.
d3mag();
1728 selectmode = mymode;
1732 _modeFlag[1]= _selectedMode;
1744 if(pm <_xs0/(_xs0 + _xs1) ){
1753 double xeng=1-mhds*mhds/(
_cms*
_cms);
1756 for(
int i=0;i< 2;i++){
1762 SetP4(p,mhds,xeng,theta);
1771 if((_xs0 + _xs1)==0) {std::cout<<
"EvtConExc::zero total xsection"<<std::endl;::abort();}
1773 double xsratio = _xs0/(_xs0 + _xs1);
1776 if(
getNArg()==3 && radflag==1){iflag=1;xsratio=0;}
1777 else if(
getNArg()==3 && radflag==0) {iflag=0;xsratio=1;}
1786 for(
int i=0;i< _ndaugs;i++){
1793 if(summassx>p->
mass())
goto masscheck;
1801 if(!byn_ang)
goto angular_hadron;
1812 double xeng=1-mhdr*mhdr/(
_cms*
_cms);
1823 costheta =
cos(theta);
1827 for(
int i=0;i< 2;i++){
1833 SetP4(p,mhdr,xeng,theta);
1845 std::cout<<
"The decay chain: "<<std::endl;
1862 if(_mode<=5 || _mode ==44|| _mode ==47|| _mode ==48 ||_mode ==72 ||_mode == 73||_mode==94||_mode==95 ||_mode ==96 || _mode>=23 &&_mode<=27 || _mode==36|| _mode ==39 || _mode == 80 ){
1865 }
else if(_mode ==6||_mode==45 || _mode==46 || _mode==70 || _mode==71|| _mode==93){
1868 }
else if(_mode==23 || _mode==24 || _mode==25 || _mode==26 || _mode==27 || _mode==36||_mode==47||_mode==48||_mode==68||_mode==69||_mode==72||_mode==73||_mode==80||_mode==94||_mode==95){
1885 for(
int ii=0;ii<nmc;ii++){
1887 int gamdaugs = _ndaugs+1;
1890 for(
int i=0;i<_ndaugs;i++){
1891 theDaugs[i] = daugs[i];
1893 theDaugs[_ndaugs]=gamId;
1897 for(
int i=0;i<gamdaugs;i++){
1906 double pmag = pgam.
d3mag();
1907 double pz = pgam.
get(3);
1908 double sintheta = sqrt( pmag*pmag - pz*pz)/pmag;
1909 double onedegree = 1./180.*3.1415926;
1911 if(pmag <El || pmag >Eh) {
goto loop;}
1917 if(thexs>maxXS) {maxXS=thexs;}
1918 double s = p_init.
mass2();
1919 double x = 2*pgam.
get(0)/sqrt(
s);
1946 double xL=2*El/sqrt(
s);
1947 double xH=2*Eh/sqrt(
s);
1948 for(
int i=0;i<nmc;i++){
1950 double x= xL+ (xH-xL)*rdm;
1959 double thexs= Rad2Xs*(xH-xL);
1968 std::cout<<
" "<<std::endl;
1978 if(!Rad2Xs)
return Rad2Xs;
1986 std::cout<<
" "<<std::endl;
1996 if(!Rad2Xs)
return Rad2Xs;
2004 std::cout<<
" "<<std::endl;
2014 if(!Rad2Xs)
return Rad2Xs;;
2031 for(
int ii=0;ii<nmc;ii++){
2033 int gamdaugs = _ndaugs+1;
2036 for(
int i=0;i<_ndaugs;i++){
2037 theDaugs[i] = daugs[i];
2039 theDaugs[_ndaugs]=gamId;
2044 for(
int i=0;i<gamdaugs;i++){
2052 if(totm >= p_init.
get(0) )
goto loop;
2057 double costheta = p4gam.
get(3)/p4gam.
d3mag();
2058 double sintheta = sqrt(1-costheta*costheta);
2059 bool acut=(sintheta>0.04) && (sintheta<0.96);
2060 if(thexs>maxXS && acut ) {maxXS=thexs;}
2069 for(
int i=1;i<_ndaugs;i++){
2073 double mhs = p0.
mass();
2074 double egam = pgam.
get(0);
2075 double sin2theta = pgam.
get(3)/pgam.
d3mag();
2076 sin2theta = 1-sin2theta*sin2theta;
2079 double alpha = 1./137.;
2080 double pi = 3.1415926;
2081 double x = 2*egam/cms;
2086 double difxs = 2*mhs/cms/cms * wsx *xs;
2096 double xsratio = xs/maxXS;
2097 if(pm<xsratio){
return true;}
else{
return false;}
2102 double xs =
difgamXs( mhds,sintheta );
2103 double xsratio = xs/maxXS;
2104 if(pm<xsratio){
return true;}
else{
return false;}
2110 if(pm <xs/
XS_max) {
return true;}
else {
return false;}
2116 if(pm <xs/(xs0*1.1)) {
return true;}
else {
return false;}
2123 double costheta=
cos(theta);
2128 if(_mode ==96){
alpha=-0.34;}
2130 double ang = 1 +
alpha*costheta*costheta;
2133 if(pm< ang/myang) {
return true;}
else{
return false;}
2140 double costheta=
cos(theta);
2143 double ang = 1 - costheta*costheta;
2144 if(pm< ang/1.) {
return true;}
else{
return false;}
2151 double costheta=
cos(theta);
2154 double ang = 1 + costheta*costheta;
2155 if(pm< ang/2.) {
return true;}
else{
return false;}
2161 double alpha = 1./137.;
2162 double pi=3.1415926;
2163 double me = 0.5*0.001;
2164 double sme = sqrt(
s)/
me;
2165 double L = 2*log(sme);
2173 double alpha = 1./137.;
2174 double pi=3.1415926;
2175 double me = 0.5*0.001;
2176 double xi2 = 1.64493407;
2177 double xi3=1.2020569;
2178 double sme = sqrt(
s)/
me;
2179 double L = 2*log(sme);
2180 double beta = 2*
alpha/
pi*(L-1);
2181 double delta2 = (9./8.-2*xi2)*L*L - (45./16.-5.5*xi2-3*xi3)*L-6./5.*xi2*xi2-4.5*xi3-6*xi2*log(2.)+3./8.*xi2+57./12.;
2183 double Delta = 1 + ap *(1.5*L + 1./3.*
pi*
pi-2) + ap*ap *delta2;
2184 double wsx = Delta * beta * pow(
x,beta-1)-0.5*beta*(2-
x);
2185 double wsx2 = (2-
x)*( 3*log(1-
x)-4*log(
x) ) -4*log(1-
x)/
x-6+
x;
2186 wsx = wsx + beta*beta/8. *wsx2;
2187 double mymx = sqrt(
s*(1-
x));
2189 return wsx*
getVP(mymx);
2198 for(
int i=1;i<_ndaugs;i++){
2205 double mrg = cms - summass;
2207 double mhs = pm*mrg + summass;
2209 double s = cms * cms;
2210 double x = 2*Egam/cms;
2218 double difxs = 2*mhs/cms/cms * wsx *xs;
2227 double mhs = sqrt(
s*(1-
x));
2231 double difxs = wsx *xs;
2240 for(
int i=1;i<_ndaugs;i++){
2245 double mrg = cms - summass;
2247 double mhs = pm*mrg + summass;
2249 double s = cms * cms;
2250 double x = 1 - mhs*mhs/
s;
2257 double difxs = 2*mhs/cms/cms * wsx *xs;
2267 double psip_ee =7.73E-03;
2268 double jsi_ee =5.94*0.01;
2269 double phi_ee =2.954E-04;
2283 BR_ee.push_back(phi_ee);
2284 BR_ee.push_back(jsi_ee);
2285 BR_ee.push_back(psip_ee);
2290 ResId.push_back(phiId);
2291 ResId.push_back(jsiId);
2292 ResId.push_back(pspId);
2298 double pi=3.1415926;
2303 double sigma = 12*
pi*
pi*bree*width/
mass/
s;
2304 sigma *=
Rad2(
s, xv);
2305 double nbar = 3.89379304*100000;
2312 double s = cms * cms;
2313 double x = 1 - (*mhs)*(*mhs)/
s;
2320 double difxs = 2*dhs/cms/cms * wsx *xs;
2321 std::ofstream
oa;
oa<<
x<<std::endl;
2326 double s = cms * cms;
2327 double x = 1 - (*mhs)*(*mhs)/
s;
2332 double differ2 = 2*(*mhs)/cms/cms * wsx *xs;
2333 std::ofstream
oa;
oa<<
x<<std::endl;
2339 double s = cms * cms;
2340 double x = 1 - (*mhs)*(*mhs)/
s;
2347 double difxs = 2*dhs/cms/cms * wsx *xs;
2354 double s = cms * cms;
2355 double x = 1 - (*mhs)*(*mhs)/
s;
2360 double differ2 = 2*(*mhs)/cms/cms * wsx *xs;
2367 double alpha = 1./137.;
2368 double pi=3.1415926;
2369 double me = 0.5*0.001;
2370 double xi2 = 1.64493407;
2371 double xi3=1.2020569;
2372 double sme = sqrt(
s)/
me;
2373 double L = 2*log(sme);
2374 double beta = 2*
alpha/
pi*(L-1);
2375 double delta2 = (9./8.-2*xi2)*L*L - (45./16.-5.5*xi2-3*xi3)*L-6./5.*xi2*xi2-4.5*xi3-6*xi2*log(2.)+3./8.*xi2+57./12.;
2377 double Delta = 1 + ap *(1.5*L + 1./3.*
pi*
pi-2) + ap*ap *delta2;
2379 double beta2 = beta*beta;
2382 double xs=(-32*b*beta + 8*pow(b,2)*beta - 10*b*pow(beta,2) + pow(b,2)*pow(beta,2) + 32*pow(b,beta)*Delta -
2383 6*(3 - 4*b + pow(b,2))*pow(beta,2)*log(1 - b) - 32*b*pow(beta,2)*log(b) + 8*pow(b,2)*pow(beta,2)*log(b) +
2384 16*pow(beta,2)*
Li2(b))/32. ;
2385 double mymx = sqrt(
s*(1-b));
2387 return xs*
getVP(mymx);
2392 double li2= -
x +
x*
x/4. -
x*
x*
x/9;
2400 for(
int i=0;i<
n-1;i++){
2401 if(
x[i]>=
t &&
t>
x[i+1]) {n0=i;
break;}
2403 if(n0==-1) {
return 0.0;}
else{
2404 double k=(y[n0]-y[n0+1])/(
x[n0]-
x[n0+1]);
2405 z= y[n0+1]+k*(
t-
x[n0+1]);
2415 for(
int i=0;i<
n-1;i++){
2416 if(
x[i]>=
t &&
t>
x[i+1]) {n0=i;
break;}
2418 double xstotal=y[599];
2419 if(n0==-1) {
return 0;}
else{
2420 double p1=y[n0]/xstotal;
2421 double p2=y[n0+1]/xstotal;
2423 if(p1<pm && pm<=p2) {
return 1;}
else{
return 0;}
2430 if(
t==
x[
n-1] )
return y[
n-1];
2431 for(
int i=0;i<
n-1;i++){
2432 if(
x[i]<=
t &&
t<
x[i+1]) {n0=i;
break;}
2434 if(n0==-1) {
return 0.0;}
else{
2435 double k=(y[n0]-y[n0+1])/(
x[n0]-
x[n0+1]);
2436 z= y[n0+1]+k*(
t-
x[n0+1]);
2451 for(
int i=0;i<
n;i++){
2452 if((y[i]/xst)<pm && pm<=(y[i+1]/xst)){mybin=i+1;
break;}
2455 double mhd=
x[mybin-1]+(
x[mybin]-
x[mybin-1])*pm;
2457 if(mhd>
_cms) {std::cout<<
"selected mhd larger than Ecms "<<mhd<<
" > "<<
x[mybin]<<std::endl;abort();}
2459 std::cout<<
"the sample mhassrons is less than the low end of XS"<<mhd<<
" <"<<_mhdL<<std::endl;
2460 for(
int i=0;i<598;i++){std::cout<<i<<
" "<<
x[i]<<
" "<<y[i]<<std::endl;}
2468 double costheta=
cos(theta);
2470 double cos2=costheta*costheta;
2472 double me=0.51*0.001;
2474 double meE2=
me*
me/eb/eb;
2476 double hq1= meE2/2*costheta/(sin2+meE2*cos2);
2477 double hq2= -0.5*log((1+sqrt(1-meE2)*costheta)/(1-sqrt(1-meE2)*costheta));
2478 double hq3=
x*
x*costheta/2/(
x*
x-2*
x+2)*(1-meE2/(sin2+meE2*cos2));
2479 double hq=(L-1)/2.+hq1+hq2+hq3;
2485 double xx[180],yy[180];
2486 double dgr2rad=1./180.*3.1415926;
2490 for(
int i=6;i<=175;i++){
2495 for(
int j=0;j<=nc;j++){
2500 for(
int j=1;j<=nc;j++){
2501 if(yy[j-1]<pm && pm<=yy[j]){mypt=j;
break;}
2504 double mytheta= xx[mypt-1]+ (xx[mypt]-xx[mypt-1])*pm;
2510 double phi=2*3.1415926*pm;
2511 double gamE =
_cms/2*xeng;
2512 double hdrE = sqrt(mhdr*mhdr+gamE*gamE);
2513 double px = gamE*
sin(theta)*
cos(phi);
2514 double py = gamE*
sin(theta)*
sin(phi);
2515 double pz = gamE*
cos(theta);
2517 p4[0].
set(gamE,px,py,pz);
2518 p4[1].
set(hdrE,-px,-py,-pz);
2519 for(
int i=0;i<2;i++){
2527 double phi=2*3.1415926*pm;
2528 double gamE =
_cms/2*xeng;
2529 double hdrE = sqrt(mhdr*mhdr+gamE*gamE);
2530 double px = gamE*
sin(theta)*
cos(phi);
2531 double py = gamE*
sin(theta)*
sin(phi);
2532 double pz = gamE*
cos(theta);
2534 p4[0].
set(hdrE,px,py,pz);
2535 p4[1].
set(gamE,-px,-py,-pz);
2536 for(
int i=0;i<2;i++){
2545 for(
int i=0;i<90000;i++){
2548 double sin2theta =sqrt(1-
cos*
cos);
2549 double alpha = 1./137.;
2550 double pi = 3.1415926;
2553 double difxs = 2*mhds/
_cms/
_cms * wsx *xs;
2554 if(difxs>maxXS)maxXS=difxs;
2560 double sin2theta = sintheta*sintheta;
2561 double alpha = 1./137.;
2562 double pi = 3.1415926;
2565 double difxs = 2*mhds/
_cms/
_cms * wsx *xs;
2572 std::vector<int>excmod;
2573 excmod.push_back(0);
2574 excmod.push_back(1);
2575 excmod.push_back(2);
2576 excmod.push_back(6);
2577 excmod.push_back(7);
2578 excmod.push_back(12);
2579 excmod.push_back(13);
2580 excmod.push_back(45);
2581 excmod.push_back(46);
2583 std::vector<double> vxs;vxs.clear();
2584 for (
int i=0;i<vmod.size();i++){
2593 if(imod==0) {vxs.push_back(myxs);}
2594 else if(imod==74110){
2595 double xcon = myxs - vxs[i-1];
2596 if(xcon<0) {xcon=vxs[i-1];}
else{xcon=myxs;}
2597 if(mhds<2.0) xcon=vxs[i-1];
2598 vxs.push_back(xcon);
2600 vxs.push_back(myxs+vxs[i-1]);
2606 double totxs = vxs[vxs.size()-1];
2612 if(pm <= vxs[0]/totxs) {
2614 std::vector<EvtId> theDaug=
get_mode(themode);
2616 for(
int i=0;i<theDaug.size();i++){daugs[i]=theDaug[i];}
2618 if(exmode==-1){
return themode;}
else{
goto mycount;}
2621 for(
int j=1;j<vxs.size();j++){
2622 double x0 = vxs[j-1]/totxs;
2623 double x1 = vxs[j]/totxs;
2624 if(x0<pm && pm<=x1){
2626 std::vector<EvtId> theDaug=
get_mode(themode);
2628 for(
int i=0;i<theDaug.size();i++){daugs[i]=theDaug[i];}
2630 if(exmode==-1){
return themode;}
else{
break;}
2636 if(icount<20000)
goto mode_iter;
2639 std::cout<<
"EvtConExc::selectMode can not find a mode with 20000 iteration for Mhadrons="<<mhds<<std::endl;
2718 std::cout<<
"J/psi: "<<mjsi<<
" "<<wjsi<<std::endl;
2719 std::cout<<
"psipr: "<<mpsip<<
" "<<wpsip<<std::endl;
2720 std::cout<<
"psipp: "<<mpsipp<<
" "<<wpsipp<<std::endl;
2721 std::cout<<
"phi : "<<mphi<<
" "<<wphi<<std::endl;
2722 std::cout<<
"omega: "<<momega<<
" "<<womega<<std::endl;
2723 std::cout<<
"rho0 : "<<mrho0<<
" "<<wrho0<<std::endl;
2724 std::cout<<
"rho(3S)0: "<<mrho3s<<
" "<<wrho3s<<std::endl;
2725 std::cout<<
"omega(2S): "<<momega2s<<
" "<<womega2s<<std::endl;
2731 for(
int i=0;i<nson;i++){
2736 std::cout<<
"Zero mass!"<<std::endl;
2743 std::vector<int> vmod; vmod.clear();
2744 int mn[78]={0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,
2746 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,
2747 90,91,92,93,94,95,96,
2748 74100,74101,74102,74103,74104,74105,74110};
2749 int mn2[79]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,
2751 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,
2752 90,91,92,93,94,95,96,
2753 74100,74101,74102,74103,74104,74105,74110};
2756 for(
int i=0;i<78;i++){vmod.push_back(mn[i]);}
2758 for(
int i=0;i<79;i++){vmod.push_back(mn2[i]);}
2765 for(
int i=0;i<vmod.size();i++){
2766 int mymode = vmod[i];
2767 if(mymode ==74110)
continue;
2783 for(
int i=0;i<par->
getNDaug();i++){
2799 double angmax = 1+
alpha;
2800 double costheta =
cos(p4i.
theta());
2801 double ang=1+
alpha*costheta*costheta;
2802 double xratio = ang/angmax;
2806 if(xi>xratio)
return false;
2816 double u = 0.938/mx;
2818 double u2 = (1+u)*(1+u);
2819 double uu = u*(1+6*u);
2820 double alpha = (u2-uu)/(u2+uu);
2829 for(
int i=0;i<par->
getNDaug();i++){
2835 if(pdgcode==111 ||pdgcode==221 || pdgcode==331 ){
2839 double angmax = 1+
alpha;
2840 double costheta =
cos(p4i.
theta());
2841 double ang=1+
alpha*costheta*costheta;
2842 double xratio = ang/angmax;
2846 if(xi>xratio)
return false;
2857 double psippee,psipee,jsiee,
phiee,omegaee,
rhoee;
2858 double kev2Gev=0.000001;
2859 psippee=0.262*kev2Gev;
2860 psipee =2.36*kev2Gev;
2861 jsiee =5.55*kev2Gev;
2862 phiee=4.266*0.001*2.954*0.0001;
2863 omegaee=0.6*kev2Gev;
2869 double xpi=12*3.1415926*3.1415926;
2870 if(mxL<=3.0957 && 3.0957<=mxH || mxL<=3.0983 && 3.0983<=mxH) {
2873 }
else if(mxL<=3.6847 && 3.6847<=mxH || mxL<=3.6873 && 3.6873<=mxH){
2876 }
else if(mxL<=1.01906 && 1.01906<=mxH || mxL<= 1.01986 && 1.01986<=mxH){
2881 if(
_cms<=mv)
return -1.;
2882 double xv = 1-mv*mv/
s;
2883 sigv += xpi*widee/mv/
s*
Rad2(
s,xv);
2884 double unic = 3.89379304*100000;
2891 for(
int i=0;i<ISRXS.size();i++){
2892 if( (ISRM[i]-mhi)<binwidth && ISRFLAG[i]){ISRFLAG[i]=0; myxs = ISRXS[i];}
2899 double pm,mhdL,mhds;
2902 mhds = pm*(
_cms - mhdL)+mhdL;
2903 std::vector<double> sxs;
2904 for(
int i=0;i<ISRID.size();i++){
2905 double ri=ISRXS[i]/AF[598];
2908 for(
int j=0;j<sxs.size();j++){
2909 if(j>0) sxs[j] += sxs[j-1];
2915 for(
int j=1;j<sxs.size();j++){
2916 double x0 = sxs[j-1];
2928 for(
int i=0;i<4001;i++){
2932 if(xx<=mx && mx <x1){xx=x1; r1=y1; i1=y2; mytag=0;
break;}
2933 xx=x1; r1=y1; i1=y2;
2935 if(mytag==1){std::cout<<
"No vacuum polarization value found"<<std::endl;abort();}
2937 double thevp=
abs(1./(1-cvp));
2938 if(3.0933<mx && mx<3.1035)
return 1.;
2939 if(3.6810<mx && mx<3.6913)
return 1.;
2945 vpx.clear();vpr.clear();vpi.clear();
2950 std::string locvp=getenv(
"BESEVTGENROOT");
2951 locvp +=
"/share/vp.dat";
2952 ifstream m_inputFile;
2953 m_inputFile.open(locvp.c_str());
2958 for(
int i=0;i<4001;i++){
2959 m_inputFile>>vpx[i]>>vpr[i]>>vpi[i];
2971 int mode=vmode[midx];
2979 double xb= 2*Esig/
_cms;
2984 double stp=(EgamH - Egamcut)/Nstp;
2985 for(
int i=0;i<Nstp;i++){
2986 double Eg0=EgamH - i*stp;
2987 double Eg1=EgamH - (i+1)*stp;
2989 if(i==0) VXS[midx][0]=xsi;
2990 if(i>=1) VXS[midx][i]=VXS[midx][i-1]+xsi;
2992 VXS[midx][598]=VXS[midx][597];
2993 VXS[midx][599]=VXS[midx][598]+ myxs0;
2999 for(
int j=0;i<vmode.size();j++){
3000 if(mode==vmode[j])
return j;
3002 std::cout<<
" EvtConExc::get_mode_index: no index is found in vmode"<<std::endl;
3007 double hwid=(AA[0]-AA[1])/2.;
3010 double Egam=(
s-mhds*mhds)/2/
_cms;
3011 for(
int i=0;i<600;i++){
3012 if( (AA[i]-hwid)<=Egam && Egam<(AA[i]+hwid) )
return VXS[idx][i];
3015 std:cout<<
"EvtConExc::getObsXsection : no observed xs is found "<<endl;
3021 double mhds = sqrt(
s - 2*Egam*
_cms);
3027 oa.open(
"_pkhr.dec");
3031 double xscon=VXS[im][599];
3033 std::vector<int> Vmode;
3035 Vmode.push_back(13);
3036 Vmode.push_back(12);
3039 Vmode.push_back(45);
3040 Vmode.push_back(46);
3043 std::vector<std::string> vmdl;
3044 vmdl.push_back(
"PHOKHARA_pipi");
3045 vmdl.push_back(
"PHOKHARA_pi0pi0pipi");
3046 vmdl.push_back(
"PHOKHARA_4pi");
3047 vmdl.push_back(
"PHOKHARA_ppbar");
3048 vmdl.push_back(
"PHOKHARA_nnbar");
3049 vmdl.push_back(
"PHOKHARA_KK");
3050 vmdl.push_back(
"PHOKHARA_K0K0");
3051 vmdl.push_back(
"PHOKHARA_pipipi0");
3052 vmdl.push_back(
"PHOKHARA_LLB");
3054 for(
int i=0;i<Vmode.size();i++){
3059 for(
int i=0;i<Vmode.size();i++){
3063 oa<<
"LundaPar PARJ(11)=0.611798"<<std::endl;
3064 oa<<
"LundaPar PARJ(12)=7.92527E-12"<<std::endl;
3065 oa<<
"LundaPar PARJ(14)=0.244495"<<std::endl;
3066 oa<<
"LundaPar PARJ(15)=1.16573E-15"<<std::endl;
3067 oa<<
"LundaPar PARJ(16)=0.436516"<<std::endl;
3068 oa<<
"LundaPar PARJ(17)=0.530517"<<std::endl;
3069 oa<<
"LundaPar PARJ(1)=0.0651577"<<std::endl;
3070 oa<<
"LundaPar PARJ(2)=0.260378"<<std::endl;
3071 oa<<
"LundaPar PARJ(21)=0.0664835"<<std::endl;
3072 oa<<
"LundaPar RALPA(15)=0.576687"<<std::endl;
3073 oa<<
"LundaPar RALPA(16)=0.364796"<<std::endl;
3074 oa<<
"LundaPar RALPA(17)=3.19486E-06"<<std::endl;
3075 oa<<
"noPhotos"<<std::endl;
3076 oa<<
"Particle vpho "<<
_cms<<
" 0"<<std::endl;
3077 oa<<
"Decay vpho"<<std::endl;
3078 oa<<
"0 pi+ pi- PHSP ;"<<std::endl;
3079 oa<<
"0 pi0 pi0 pi- pi+ PHSP ;"<<std::endl;
3080 oa<<
"0 pi+ pi- pi- pi+ PHSP ;"<<std::endl;
3081 oa<<
"0 anti-p- p+ PHSP ;"<<std::endl;
3082 oa<<
"0 anti-n0 n0 PHSP ;"<<std::endl;
3083 oa<<
"0 K+ K- PHSP ;"<<std::endl;
3084 oa<<
"0 K_S0 K_L0 PHSP ;"<<std::endl;
3085 oa<<
"0 pi+ pi- pi0 PHSP ;"<<std::endl;
3086 oa<<
"0 Lambda0 anti-Lambda0 PHSP ;"<<std::endl;
3087 oa<<
"0 gamma phi PHSP;"<<std::endl;
3088 oa<<
"0 gamma rho0 PHSP;"<<std::endl;
3089 oa<<
"0 gamma omega PHSP;"<<std::endl;
3090 oa<<xscon<<
" ConExc 74110;"<<std::endl;
3091 for(
int i=0;i<Vmode.size();i++){
3092 oa<<VXS[
getModeIndex(Vmode[i]) ][599]<<
" "<<vmdl[i]<<
" ;"<<std::endl;
3094 oa<<
"Enddecay"<<std::endl;
3095 oa<<
"End"<<std::endl;
3102 oa.open(
"_evtR.dat");
3105 double xscon=VXS[im][599];
3106 double xscon0=xscon;
3107 oa<<
"Ecms= "<<
_cms<<
" GeV"<<std::endl;
3108 oa<<
"The total observed xs: "<<xscon<<
" nb"<<std::endl;
3109 oa<<
"=== mode =========== ratio ==========="<<std::endl;
3110 for(
int i=0;i<vmode.size();i++){
3113 if(vmode[i]==74110)
continue;
3114 xscon -= VXS[themode ][599];
3116 if(xscon<0) xscon=0;
3118 for(
int i=0;i<vmode.size();i++){
3120 if(vmode[i]==74110)
continue;
3121 oa<<vmode[i]<<
"-th mode: "<<100*VXS[themode][599]/xscon0<<
" % "<<std::endl;
3123 oa<<
"74110-th mode: "<<100*xscon/xscon0<<
" % "<<std::endl;
3129 for (
int i=0;i<vmode.size();i++){
3130 if(m==vmode[i])
return i;
3132 std::cout<<
"EvtConExc::getModeIndex: no index in vmode found "<<std::endl;
double Rad2difXs2(double *mhs)
void hadr5n12_(float *, float *, float *, float *, float *, float *)
double divdif_(float *, float *, int *, float *, int *)
double Rad2difXs(double *m)
double Rad2difXs_er2(double *mhs)
double dgauss_(double(*fun)(double *), double *, double *, double *)
double Rad2difXs_er(double *m)
void polint_(float *, float *, int *, float *, float *)
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
DOUBLE_PRECISION xlow[20]
EvtTensor3C eps(const EvtVector3R &v)
double sin(const BesAngle a)
double cos(const BesAngle a)
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations xmb DOUBLE PRECISION xcb DOUBLE PRECISION xmDcs DOUBLE PRECISION xmBbc DOUBLE PRECISION rh2ee DOUBLE PRECISION omepi DOUBLE PRECISION om3ee DOUBLE PRECISION phiee
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations xmb DOUBLE PRECISION xcb DOUBLE PRECISION xmDcs DOUBLE PRECISION xmBbc DOUBLE PRECISION rhoee
bool checkdecay(EvtParticle *p)
void findMaxXS(EvtParticle *p)
double addNarrowRXS(double mhi, double binwidth)
double narrowRXS(double mxL, double mxH)
bool VP_sampling(EvtVector4R pcm, EvtVector4R pi)
double gamHXSection_er(double El, double Eh)
bool islgr(double *x, double *y, int n, double t)
double lgr(double *x, double *y, int n, double t)
double baryonAng(double mx)
double Ros_xs(double mx, double bree, EvtId pid)
double Rad1(double s, double x)
static EvtXsection * myxsection
void SetP4Rvalue(EvtParticle *part, double mhdr, double xeng, double theta)
bool meson_sampling(EvtVector4R pcm, EvtVector4R pi)
bool photonSampling(EvtParticle *part)
double ISR_ang_integrate(double x, double theta)
bool xs_sampling(double xs)
int selectMode(std::vector< int > vmod, double mhds)
double gamHXSection(EvtParticle *p, double El, double Eh, int nmc=100000)
double Rad1difXs(EvtParticle *p)
bool baryon_sampling(EvtVector4R pcm, EvtVector4R pi)
int get_mode_index(int mode)
double LLr(double *x, double *y, int n, double t)
double Rad2difXs(EvtParticle *p)
double SoftPhoton_xs(double s, double b)
bool angularSampling(EvtParticle *part)
double difgamXs(EvtParticle *p)
double ISR_ang_sampling(double x)
double Mhad_sampling(double *x, double *y)
std::vector< EvtId > get_mode(int mode)
double getObsXsection(double mhds, int mode)
void mk_VXS(double Esig, double Egamcut, double EgamH, int midx)
bool hadron_angle_sampling(EvtVector4R ppi, EvtVector4R pcm)
bool gam_sampling(EvtParticle *p)
double Rad2(double s, double x)
void getName(std::string &name)
void decay(EvtParticle *p)
double Egam2Mhds(double Egam)
void SetP4(EvtParticle *part, double mhdr, double xeng, double theta)
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
static double getWidth(EvtId i)
static int getStdHep(EvtId id)
static double getMeanMass(EvtId i)
static void reSetWidth(EvtId i, double width)
static void reSetMass(EvtId i, double mass)
static EvtId evtIdFromStdHep(int stdhep)
static std::string name(EvtId i)
static double getMinMass(EvtId i)
static double getMass(EvtId i)
static EvtId getId(const std::string &name)
static EvtParticle * particleFactory(EvtSpinType::spintype spinType)
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
void setIntFlag(std::vector< int > vi)
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
void deleteDaughters(bool keepChannel=false)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void set(int i, double d)
std::vector< double > getEr()
double getXsection(double mx)
std::vector< double > getYY()
std::vector< double > getXX()