// Channel_Generator3V #include "PHASIC++/Channels/Single_Channel.H" #include "ATOOLS/Org/Run_Parameter.H" #include "ATOOLS/Org/MyStrStream.H" #include "ATOOLS/Org/Scoped_Settings.H" #include "PHASIC++/Channels/Channel_Elements.H" #include "PHASIC++/Channels/Vegas.H" using namespace PHASIC; using namespace ATOOLS; namespace PHASIC { class C3_2 : public Single_Channel { double m_thexp; Info_Key m_kI_2_34,m_kI_3_4,m_kZR23_136; Vegas* p_vegas; public: C3_2(int,int,Flavour*,Integration_Info * const); ~C3_2(); void GenerateWeight(Vec4D *,Cut_Data *); void GeneratePoint(Vec4D *,Cut_Data *,double *); void AddPoint(double); void MPISync() { p_vegas->MPISync(); } void Optimize() { p_vegas->Optimize(); } void EndOptimize() { p_vegas->EndOptimize(); } void WriteOut(std::string pId) { p_vegas->WriteOut(pId); } void ReadIn(std::string pId) { p_vegas->ReadIn(pId); } void ISRInfo(int &,double &,double &); std::string ChID(); }; } extern "C" Single_Channel * Getter_C3_2(int nin,int nout,Flavour* fl,Integration_Info * const info) { return new C3_2(nin,nout,fl,info); } void C3_2::GeneratePoint(Vec4D * p,Cut_Data * cuts,double * _ran) { double *ran = p_vegas->GeneratePoint(_ran); for(int i=0;iGetscutAmegic(std::string("34")); Flavour fl34 = Flavour((kf_code)(23)); Vec4D p34; double s34 = CE.MassivePropMomenta(fl34.Mass(),fl34.Width(),s34_min,s34_max,ran[0]); double s2 = p_ms[2]; CE.Isotropic2Momenta(p234,s2,s34,p[2],p34,ran[1],ran[2]); CE.Isotropic2Momenta(p34,s3,s4,p[3],p[4],ran[3],ran[4]); } void C3_2::GenerateWeight(Vec4D* p,Cut_Data * cuts) { double wt = 1.; Vec4D p234=p[0]+p[1]; double s234_max = p234.Abs2(); double s34_max = sqr(sqrt(s234_max)-sqrt(p_ms[2])); double s3 = p_ms[3]; double s4 = p_ms[4]; double s34_min = cuts->GetscutAmegic(std::string("34")); Flavour fl34 = Flavour((kf_code)(23)); Vec4D p34 = p[3]+p[4]; double s34 = dabs(p34.Abs2()); wt *= CE.MassivePropWeight(fl34.Mass(),fl34.Width(),s34_min,s34_max,s34,p_rans[0]); double s2 = p_ms[2]; if (m_kI_2_34.Weight()==ATOOLS::UNDEFINED_WEIGHT) m_kI_2_34<GenerateWeight(p_rans); if (wt!=0.) wt = vw/wt/pow(2.*M_PI,3*3.-4.); m_weight = wt; } C3_2::C3_2(int nin,int nout,Flavour* fl,Integration_Info * const info) : Single_Channel(nin,nout,fl) { Settings& s = Settings::GetMainSettings(); m_name = std::string("C3_2"); m_rannum = 5; p_rans = new double[m_rannum]; m_thexp = s["THRESHOLD_EXPONENT"].Get(); m_kI_2_34.Assign(std::string("I_2_34"),2,0,info); m_kI_3_4.Assign(std::string("I_3_4"),2,0,info); m_kZR23_136.Assign(std::string("ZR23_136"),2,0,info); p_vegas = new Vegas(m_rannum,100,m_name); } C3_2::~C3_2() { delete p_vegas; } void C3_2::ISRInfo(int & type,double & mass,double & width) { type = 1; mass = Flavour((kf_code)(23)).Mass(); width = Flavour((kf_code)(23)).Width(); } void C3_2::AddPoint(double Value) { Single_Channel::AddPoint(Value); p_vegas->AddPoint(Value,p_rans); } std::string C3_2::ChID() { return std::string("CG2$I_2_34$I_3_4$MP23_34$ZR23_136$"); }