double Soft_Cluster_Handler:: TransformKin(const double MC,const Flavour & flav,const bool & enforce) { double mass2(sqr(flav.HadMass())); double width2(sqr(Max(flav.Width(),1.e-6))); if (!enforce && sqr(MC*MC-mass2)>10.*mass2*width2) return 0.; return pow(sqr(mass2)/(sqr(MC*MC-mass2) + mass2*width2),m_kappa) * pow(mass2*width2/(sqr(MC*MC-mass2) + mass2*width2),m_lambda); }
T3Channel::T3Channel(int _nin,int _nout,Flavour * fl,Flavour res) { nin = _nin; nout = _nout; ms = new double[nin+nout]; for (int i=0;i<nin+nout;i++) ms[i] = ATOOLS::sqr(fl[i].Mass()); rannum = 3*nout-4; rans = new double[rannum]; s = smax = pt2max = sqr(ATOOLS::rpa->gen.Ecms()); pt2min = 0.0; E = 0.5 * sqrt(s); name = "T3-Channel"; if (nout>2) name = ToString(nin)+"->"+ToString(nout)+"_"+name; mass = width = 0.; type = 0; if (res!=Flavour(kf_none)) { mass = res.Mass(); width = res.Width(); type = 1; } p_vegas = new Vegas(rannum,100,name,0); }
Decay2Channel::Decay2Channel(int _nin,int _nout,const Flavour * fl,Flavour res) { if (_nout != 2 || _nin!=1) { msg_Error()<<"Tried to initialize Decay2Channel with nout = "<<_nin<<" -> "<<_nout<<endl; abort(); } nin = _nin; nout = _nout; ms = new double[nin+nout]; for (short int i=0;i<nin+nout;i++) ms[i] = ATOOLS::sqr(fl[i].Mass()); rannum = 2; rans = new double[rannum]; s = smax = pt2max = sqr(ATOOLS::rpa->gen.Ecms()); pt2min = 0.; E = 0.5 * sqrt(s); name = "Decay2-Channel"; mass = width = 0.; type = 0; if (res!=Flavour(kf_none)) { mass = res.Mass(); width = res.Width(); type = 1; } }
T1Channel::T1Channel(int _nin,int _nout,Flavour * fl,Flavour res) { if (_nout != 2 || _nin!=2) { msg_Error()<<"Tried to initialize T1Channel with nout = "<<_nin<<" -> "<<_nout<<endl; abort(); } nin = _nin; nout = _nout; ms = new double[nin+nout]; for (int i=0;i<nin+nout;i++) ms[i] = ATOOLS::sqr(fl[i].Mass()); rannum = 3*nout-4; rans = new double[rannum]; s = smax = pt2max = sqr(ATOOLS::rpa->gen.Ecms()); pt2min = 0.0; E = 0.5 * sqrt(s); name = "T-Channel"; mass = width = 0.; type = 0; if (res!=Flavour(kf_none)) { mass = res.Mass(); width = res.Width(); type = 1; } p_vegas = new Vegas(rannum,100,name,0); }
void Channel_Generator_Decays::GenerateMasses(int flag,Point** _plist,int pcount, int& rannum,ofstream& sf) { string * lm = new string[pcount]; string * momp = new string[pcount]; int * sflag = new int[pcount]; string mummy; string sum_s_i; string help; for (short int i=0;i<pcount;i++) { lm[i] = LinkedMasses(_plist[i]); mummy += lm[i]; if (_plist[i]->left==0) { if (flag==0 || flag==10) AddToVariables(flag,lm[i],string("ms[")+GetMassIndex(lm[i])+string("]"),0,sf); //sf<<" double s"<<lm[i]<<" = ms["<<lm[i]<<"];"<<endl; momp[i] = string("p[") + GetMassIndex(lm[i]) + string("]"); sflag[i] = 1; //sum_s_i += string("-sqrt(s")+lm[i]+string(")"); help += lm[i]; } else { CalcSmin(flag,"min",lm[i],sf,_plist[i]); momp[i] = string("p") + Order(lm[i]); sflag[i] = 0; } } if (help.length()>0) { //CalcSmin(flag,"restmin",help,sf,0); //sum_s_i = string("-sqrt(s")+Order(help)+string("_restmin)"); CalcSmin(flag,"min",help,sf,0); sum_s_i = string("-sqrt(s")+Order(help)+string("_min)"); } int hit; double maxpole; double res; Flavour flav; string smax; for (;;) { hit = -1; maxpole = -1.; for (short int j=0;j<pcount;j++) { if (sflag[j]==0) { flav = _plist[j]->fl; res = ATOOLS::sqr(flav.Width()*flav.Mass()); if (!ATOOLS::IsZero(res) && Massive(flav)) { if (1./res>maxpole) { maxpole = 1./res; hit = j; } } else { if (hit==-1) hit = j; } } } if (hit==-1) break; smax = string("sqr(sqrt(s")+Order(mummy)+string(")")+sum_s_i; for (short int j=0;j<pcount;j++) { if (sflag[j]==0 && j!=hit) { smax += string("-sqrt(s")+Order(lm[j])+string("_min)"); } } smax += string(")"); AddToVariables(flag,lm[hit] +string("_max"),smax,0,sf); //sf<<" double s"<<Order(lm[hit])<<"_max = "<<smax<<endl; int hi = 0; if (maxpole>0.) { hi = (_plist[hit]->fl).Kfcode(); if (flag>=0) sf<<" Flavour fl"<<lm[hit]<<" = "<<"Flavour((kf_code)("<<hi<<"));"<<endl; } switch (flag) { case -11: case -1: if (maxpole>0.) { m_idc.push_back(string("MP")+ToString(hi)+string("_")+Order(lm[hit])); } else m_idc.push_back(string("MlP_")+Order(lm[hit])); break; case 0: case 10: sf<<" Vec4D "<<momp[hit]<<";"<<endl <<" double s"<<Order(lm[hit])<<";"<<endl; if (maxpole>0.) { sf<<" s"<<Order(lm[hit]) <<" = CE.MassivePropMomenta(fl"<<lm[hit]<<".Mass(),"<<"fl"<<lm[hit]<<".Width(),1," <<"s"<<Order(lm[hit])<<"_min,s"<<Order(lm[hit])<<"_max,ran["<<rannum<<"]);"<<endl; } else { sf<<" s"<<Order(lm[hit])<<" = CE.MasslessPropMomenta(1.,s"<<Order(lm[hit])<<"_min," <<"s"<<Order(lm[hit])<<"_max,ran["<<rannum<<"]);"<<endl; } rannum++; break; default: string s(""); for (int i=0;i<(int)lm[hit].length()-1;i++) s += string("p[")+GetMassIndex(lm[hit][i])+string("]+"); s += string("p[")+GetMassIndex(lm[hit][lm[hit].length()-1])+string("]"); AddToVariables(flag,lm[hit],s,1,sf); AddToVariables(flag,lm[hit],string("dabs(")+momp[hit]+string(".Abs2())"),0,sf); if (maxpole>0.) { sf<<" wt *= CE.MassivePropWeight(fl"<<lm[hit]<<".Mass(),"<<"fl"<<lm[hit]<<".Width(),1," <<"s"<<Order(lm[hit])<<"_min,s"<<Order(lm[hit])<<"_max,"<<"s"<<Order(lm[hit])<<",rans["<<rannum<<"]);"<<endl; } else { sf<<" wt *= CE.MasslessPropWeight(1.,s"<<Order(lm[hit])<<"_min," <<"s"<<Order(lm[hit])<<"_max,s"<<Order(lm[hit])<<",rans["<<rannum<<"]);"<<endl; } rannum++; } sum_s_i += string("-sqrt(s")+Order(lm[hit])+string(")"); sflag[hit] = 1; } delete[] lm; delete[] momp; delete[] sflag; }