118 extern double dgauss_(
double (*fun)(
double*),
double *,
double *,
double *);
127double EvtConExc::_xs0=0;
128double EvtConExc::_xs1=0;
129double EvtConExc::_er0=0;
130double EvtConExc::_er1=0;
131int EvtConExc::_nevt=0;
163 radflag=0;mydbg=
false;
168 std::cout<<
"The decay daughters are "<<std::endl;
170 std::cout<<std::endl;
172 radflag=0;mydbg=
false;
177 else if(
getNArg()==1){ _mode =
getArg(0);radflag=0;mydbg=
false;}
180 else{std::cout<<
"ConExc:umber of parameter should be 1,2 or 3, but you set "<<
getNArg()<<std::endl;::abort(); }
189 myfile =
new TFile(
"mydbg.root",
"RECREATE");
190 xs=
new TTree (
"xs",
"momentum of rad. gamma and hadrons");
191 xs->Branch(
"imode",&imode,
"imode/I");
192 xs->Branch(
"pgam",pgam,
"pgam[4]/D");
193 xs->Branch(
"phds",phds,
"phds[4]/D");
194 xs->Branch(
"ph1",ph1,
"ph1[4]/D");
195 xs->Branch(
"ph2",ph2,
"ph2[4]/D");
196 xs->Branch(
"mhds",&mhds,
"mhds/D");
197 xs->Branch(
"mass1",&mass1,
"mass1/D");
198 xs->Branch(
"mass2",&mass2,
"mass2/D");
212 if(mx<mth){std::cout<<
"The CMS energy is lower than the threshold of the final states"<<std::endl;abort();}
213 }
else if(_mode == -2){
219 std::cout<<
"The specified mode is "<<_mode<<std::endl;
223 double Egamcut = 0.025;
224 double Esig = 0.0001;
225 double x = 2*Egamcut/
_cms;
227 double mhscut = sqrt(
s*(1-
x));
240 double EgamH = (
s-mhdL*mhdL)/2/sqrt(
s);
244 std::cout<<
"_xs0= "<<_er0<<std::endl;
246 double xs1_err = _er1;
249 double xb= 2*Esig/
_cms;
256 double obsvXS = _xs0 + _xs1;
257 double obsvXS_er= _er0 + xs1_err;
258 double corr = obsvXS/bornXS;
259 double corr_er =corr*sqrt(bornXS_er*bornXS_er/bornXS/bornXS + obsvXS_er*obsvXS_er/obsvXS/obsvXS);
262 if(bornXS==0){std::cout<<
"EvtConExc::init : The Born cross section at this point is zero!"<<std::endl;abort();}
263 if(obsvXS==0){std::cout<<
"EvtConExc::init : The observed cross section at this point is zero!"<<std::endl;abort();}
268 std::cout<<
""<<std::endl;
269 std::cout<<
"========= Generation using cross section (Egamcut=0.025 GeV) =============="<<std::endl;
270 std::cout<<
" sqrt(s)= "<<mx<<
" GeV "<<std::endl;
271 if(_mode>=0 || _mode ==-2 ){
272 std::cout<<
"The generated born cross section (sigma_b): "<<_xs0<<
"+/-"<<_er0<<
" in Unit "<<_unit.c_str()<<std::endl;
273 std::cout<<
"The generated radiative correction cross section (sigma_isr): "<<_xs1<<
"+/-"<<xs1_err<<
" in Unit "<<_unit.c_str()<<std::endl;
274 std::cout<<
"The Born process is sampled according to the ratio sigma_b/(sigma_b+sigma_isr)"<<std::endl;
275 std::cout<<
"The radiative correction factor sigma_obs/sigma_born(s) = (1+delta) = "<<corr<<
"+/-"<< fabs(corr_er)<<
","<<std::endl;
276 std::cout<<
"which is calcualted with these quantities:"<<std::endl;
277 std::cout<<
"the observed cross section is "<<obsvXS<<
"+/-"<< obsvXS_er<<_unit.c_str()<<std::endl;
278 std::cout<<
"and the Born cross section (s) is "<<bornXS<<
"+/-"<<bornXS_er<<_unit.c_str()<<std::endl;
280 std::cout<<
"==========================================================================="<<std::endl;
282 std::cout<<
"The generated born cross section (sigma_b): "<<_xs0<<
" *Br_ee"<<
" in Unit "<<_unit.c_str()<<std::endl;
283 std::cout<<
"The generated radiative correction cross section (sigma_isr): "<<_xs1<<
"*Br_ee in Unit "<<_unit.c_str()<<std::endl;
284 std::cout<<
"The Born process is sampled according to the ratio sigma_b/(sigma_b+sigma_isr)"<<std::endl;
285 std::cout<<
"The radiative correction factor sigma_obs/sigma_born(s) = (1+delta) = "<<corr<<
"+/-"<< fabs(corr_er)<<std::endl;
286 std::cout<<
"==========================================================================="<<std::endl;
288 std::cout<<std::endl;
289 std::cout<<std::endl;
295 if(_xs0 == 0 && _xs1==0){std::cout<<
"EvtConExc::ini() has zero cross section"<<std::endl;abort();}
299 for(
int jj=1;jj<_ndaugs;jj++){
303 for(
int ii=0;ii<6;ii++){
305 if(mx<mR || mR<mthrld)
continue;
306 double narRxs=
Ros_xs(mx,BR_ee[ii],ResId[ii]);
307 std::cout<<
"The corss section for gamma "<<
EvtPDL::name(ResId[ii]).c_str()<<
" is: "<< narRxs<<
"*Br (nb)."<<std::endl;
309 std::cout<<
"==========================================================================="<<std::endl;
310 std::cout<<std::endl;
311 std::cout<<std::endl;
316 double xx[10000],yy[10000],xer[10000],yer[10000];
317 for(
int i=0;i<nd;i++){
324 myth=
new TH1F(
"myth",
"Exp.data",200,xx[0],xx[nd]);
325 for(
int i=0;i<nd;i++){
326 myth->Fill(xx[i],yy[i]);
362 }
else if(mode ==6 ){
381 }
else if(mode ==10 ){
386 }
else if(mode ==11 ){
391 }
else if(mode ==12 ){
397 }
else if(mode ==13 ){
403 }
else if(mode ==14 ){
409 }
else if(mode ==15 ){
415 }
else if(mode ==16 ){
421 }
else if(mode ==17 ){
428 }
else if(mode ==18 ){
435 }
else if(mode ==19 ){
442 }
else if(mode ==20 ){
449 }
else if(mode ==21 ){
457 }
else if(mode ==22 ){
465 }
else if(mode == 23){
469 }
else if(mode == 24){
473 }
else if(mode == 25){
477 }
else if(mode == 26){
481 }
else if(mode == 27){
485 }
else if(mode == 28){
490 }
else if(mode == 29){
495 }
else if(mode == 30){
500 }
else if(mode == 31){
505 }
else if(mode == 32){
510 }
else if(mode == 33){
515 }
else if(mode == 34){
520 }
else if(mode == 35){
525 }
else if(mode == 36){
529 }
else if(mode == 37){
534 }
else if(mode == 38){
539 }
else if(mode == 39){
543 }
else if(mode == 40){
548 }
else if(mode == 41){
553 }
else if(mode == 42){
558 }
else if(mode == 43){
564 }
else if(mode == 44){
568 }
else if(mode == 45){
572 }
else if(mode == 46){
576 }
else if(mode == 50){
581 }
else if(mode == 51){
586 }
else if(mode == 68){
591 }
else if(mode == 69){
596 }
else if(mode == 70){
605 }
else if(mode == 72){
610 }
else if(mode == 73){
615 }
else if(mode == 74){
620 }
else if(mode == 75){
625 }
else if(mode == 76){
630 }
else if(mode == 77){
635 }
else if(mode == 78){
640 }
else if(mode == 79){
644 }
else if(mode == 80){
648 }
else if(mode == 81){
653 }
else if(mode == 82){
658 }
else if(mode == 83){
663 }
else if(mode == 84){
668 }
else if(mode == 90){
673 }
else if(mode == 91){
678 }
else if(mode == 92){
683 }
else if(mode == 93){
687 }
else if(mode == 94){
691 }
else if(mode == 95){
695 }
else if(mode == -1){
697 for(
int i=0;i<nson;i++){ daugs[i]=son[i]; }
698 std::cout<<
"The paraent particle: "<<
EvtPDL::name(pid)<<std::endl;
699 }
else if(mode == -2){
701 for(
int i=0;i<nson;i++){ daugs[i]=son[i]; }
703 std::cout<<
"Bad mode_index number, please refer to the manual."<<std::endl;
722 if((_xs0 + _xs1)==0) {std::cout<<
"EvtConExc::zero total xsection"<<std::endl;::abort();}
724 double xsratio = _xs0/(_xs0 + _xs1);
726 if(pm<xsratio){iflag = 0;}
else{iflag=1;}
728 if(radflag==1){xsratio=1;iflag=1;}
730 daugs[_ndaugs]=gamId;
733 for(
int i=0;i< _ndaugs+iflag;i++){
740 bool gam_ang,byn_ang,msn_ang,xs_ang;
746 for(
int i=1;i<_ndaugs;i++){
749 double xm = vhds.
mass();
759 if(!gam_ang || !xs_ang ){
goto angular_sampling;}
772 if(_mode<=5 || _mode ==44 ||_mode ==72 ||_mode == 73||_mode==94||_mode==95 ||_mode ==79 || _mode>=23 &&_mode<=27 || _mode==36|| _mode ==39 || _mode == 80){
774 if(!byn_ang) {
goto angular_sampling;}
775 }
else if(_mode ==6||_mode==45 || _mode==46 || _mode==70 || _mode==71|| _mode==93){
777 if(!msn_ang){
goto angular_sampling;}
781 std::cout<<
"The decay chain: "<<std::endl;
828 for(
int ii=0;ii<nmc;ii++){
830 int gamdaugs = _ndaugs+1;
833 for(
int i=0;i<_ndaugs;i++){
834 theDaugs[i] = daugs[i];
836 theDaugs[_ndaugs]=gamId;
840 for(
int i=0;i<gamdaugs;i++){
849 double pmag = pgam.
d3mag();
850 double pz = pgam.
get(3);
851 double sintheta = sqrt( pmag*pmag - pz*pz)/pmag;
852 double onedegree = 1./180.*3.1415926;
854 if(pmag <El || pmag >Eh) {
goto loop;}
860 if(thexs>maxXS) {maxXS=thexs;}
861 double s = p_init.
mass2();
862 double x = 2*pgam.
get(0)/sqrt(
s);
883 double xL=2*El/sqrt(
s);
884 double xH=2*Eh/sqrt(
s);
885 for(
int i=0;i<nmc;i++){
887 double x= xL+ (xH-xL)*rdm;
896 double thexs= Rad2Xs*(xH-xL);
904 std::cout<<
" "<<std::endl;
914 if(!Rad2Xs)
return Rad2Xs;
921 std::cout<<
" "<<std::endl;
931 if(!Rad2Xs)
return Rad2Xs;;
948 for(
int ii=0;ii<nmc;ii++){
950 int gamdaugs = _ndaugs+1;
953 for(
int i=0;i<_ndaugs;i++){
954 theDaugs[i] = daugs[i];
956 theDaugs[_ndaugs]=gamId;
960 for(
int i=0;i<gamdaugs;i++){
968 if(thexs>maxXS) {maxXS=thexs;}
976 for(
int i=1;i<_ndaugs;i++){
980 double mhs = p0.
mass();
981 double egam = pgam.
get(0);
982 double sin2theta = pgam.
get(3)/pgam.
d3mag();
983 sin2theta = 1-sin2theta*sin2theta;
986 double alpha = 1./137.;
987 double pi = 3.1415926;
988 double x = 2*egam/cms;
993 double difxs = 2*mhs/cms/cms * wsx *xs;
1002 double xsratio = xs/maxXS;
1003 if(pm<xsratio){
return true;}
else{
return false;}
1009 if(pm <xs/
XS_max) {
return true;}
else {
return false;}
1015 double costheta=
cos(theta);
1021 double ang = 1 + costheta*costheta;
1022 if(pm< ang/2.) {
return true;}
else{
return false;}
1029 double costheta=
cos(theta);
1032 double ang = 1 - costheta*costheta;
1033 if(pm< ang/1.) {
return true;}
else{
return false;}
1039 double alpha = 1./137.;
1040 double pi=3.1415926;
1041 double me = 0.5*0.001;
1042 double sme = sqrt(
s)/
me;
1043 double L = 2*log(sme);
1051 double alpha = 1./137.;
1052 double pi=3.1415926;
1053 double me = 0.5*0.001;
1054 double xi2 = 1.64493407;
1055 double xi3=1.2020569;
1056 double sme = sqrt(
s)/
me;
1057 double L = 2*log(sme);
1058 double beta = 2*
alpha/
pi*(L-1);
1059 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.;
1061 double Delta = 1 + ap *(1.5*L + 1./3.*
pi*
pi-2) + ap*ap *delta2;
1062 double wsx = Delta * beta * pow(
x,beta-1)-0.5*beta*(2-
x);
1063 double wsx2 = (2-
x)*( 3*log(1-
x)-4*log(
x) ) -4*log(1-
x)/
x-6+
x;
1064 wsx = wsx + beta*beta/8. *wsx2;
1074 for(
int i=1;i<_ndaugs;i++){
1081 double mrg = cms - summass;
1083 double mhs = pm*mrg + summass;
1085 double s = cms * cms;
1086 double x = 2*Egam/cms;
1094 double difxs = 2*mhs/cms/cms * wsx *xs;
1103 double mhs = sqrt(
s*(1-
x));
1107 double difxs = wsx *xs;
1116 for(
int i=1;i<_ndaugs;i++){
1121 double mrg = cms - summass;
1123 double mhs = pm*mrg + summass;
1125 double s = cms * cms;
1126 double x = 1 - mhs*mhs/
s;
1133 double difxs = 2*mhs/cms/cms * wsx *xs;
1142 double psipp_ee=9.6E-06;
1143 double psip_ee =7.73E-03;
1144 double jsi_ee =5.94*0.01;
1145 double phi_ee =2.954E-04;
1146 double omega_ee=7.28E-05;
1147 double rho_ee = 4.72E-05;
1157 BR_ee.push_back(rho_ee);
1158 BR_ee.push_back(omega_ee);
1159 BR_ee.push_back(phi_ee);
1160 BR_ee.push_back(jsi_ee);
1161 BR_ee.push_back(psip_ee);
1162 BR_ee.push_back(psipp_ee);
1164 ResId.push_back(rhoId);
1165 ResId.push_back(omegaId);
1166 ResId.push_back(phiId);
1167 ResId.push_back(jsiId);
1168 ResId.push_back(pspId);
1169 ResId.push_back(psppId);
1174 double pi=3.1415926;
1179 double sigma = 12*
pi*
pi*bree*width/
mass/
s;
1180 sigma *=
Rad2(
s, xv);
1188 double s = cms * cms;
1189 double x = 1 - (*mhs)*(*mhs)/
s;
1196 double difxs = 2*dhs/cms/cms * wsx *xs;
1197 std::ofstream
oa;
oa<<
x<<std::endl;
1202 double s = cms * cms;
1203 double x = 1 - (*mhs)*(*mhs)/
s;
1208 double differ2 = 2*(*mhs)/cms/cms * wsx *xs;
1209 std::ofstream
oa;
oa<<
x<<std::endl;
1215 double s = cms * cms;
1216 double x = 1 - (*mhs)*(*mhs)/
s;
1223 double difxs = 2*dhs/cms/cms * wsx *xs;
1230 double s = cms * cms;
1231 double x = 1 - (*mhs)*(*mhs)/
s;
1236 double differ2 = 2*(*mhs)/cms/cms * wsx *xs;
1243 double alpha = 1./137.;
1244 double pi=3.1415926;
1245 double me = 0.5*0.001;
1246 double xi2 = 1.64493407;
1247 double xi3=1.2020569;
1248 double sme = sqrt(
s)/
me;
1249 double L = 2*log(sme);
1250 double beta = 2*
alpha/
pi*(L-1);
1251 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.;
1253 double Delta = 1 + ap *(1.5*L + 1./3.*
pi*
pi-2) + ap*ap *delta2;
1255 double beta2 = beta*beta;
1258 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 -
1259 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) +
1260 16*pow(beta,2)*
Li2(b))/32. ;
1266 double li2= -
x +
x*
x/4. -
x*
x*
x/9;
double Rad2difXs2(double *mhs)
double Rad2difXs(double *m)
double Rad2difXs_er2(double *mhs)
double dgauss_(double(*fun)(double *), double *, double *, double *)
double Rad2difXs_er(double *m)
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
EvtTensor3C eps(const EvtVector3R &v)
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
void findMaxXS(EvtParticle *p)
double gamHXSection_er(double El, double Eh)
double Ros_xs(double mx, double bree, EvtId pid)
double Rad1(double s, double x)
static EvtXsection * myxsection
bool meson_sampling(EvtVector4R pcm, EvtVector4R pi)
bool xs_sampling(double xs)
double gamHXSection(EvtParticle *p, double El, double Eh, int nmc=100000)
double Rad1difXs(EvtParticle *p)
bool baryon_sampling(EvtVector4R pcm, EvtVector4R pi)
double Rad2difXs(EvtParticle *p)
double SoftPhoton_xs(double s, double b)
double difgamXs(EvtParticle *p)
bool gam_sampling(EvtParticle *p)
double Rad2(double s, double x)
void getName(std::string &name)
void decay(EvtParticle *p)
static double getWidth(EvtId i)
static double getMeanMass(EvtId i)
static EvtId evtIdFromStdHep(int stdhep)
static std::string name(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)
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()