#include "AMEGIC++/DipoleSubtraction/Single_OSTerm.H" #include "AMEGIC++/DipoleSubtraction/Single_LOProcess.H" #include "AMEGIC++/DipoleSubtraction/Single_LOProcess_MHV.H" #include "AMEGIC++/Main/Single_Process.H" #include "AMEGIC++/Main/Single_Process_MHV.H" #include "AMEGIC++/Main/Single_Process_External.H" #include "PHASIC++/Main/Process_Integrator.H" #include "PHASIC++/Scales/Scale_Setter_Base.H" #include "PHASIC++/Selectors/Combined_Selector.H" #include "PDF/Main/ISR_Handler.H" #include "ATOOLS/Org/Run_Parameter.H" #include "ATOOLS/Org/Shell_Tools.H" #include "ATOOLS/Org/MyStrStream.H" #include "ATOOLS/Org/Exception.H" #include "AMEGIC++/DipoleSubtraction/FF_DipoleSplitting.H" #include "AMEGIC++/DipoleSubtraction/FI_DipoleSplitting.H" #include "AMEGIC++/DipoleSubtraction/IF_DipoleSplitting.H" #include "AMEGIC++/DipoleSubtraction/II_DipoleSplitting.H" using namespace AMEGIC; using namespace PHASIC; using namespace MODEL; using namespace PDF; using namespace BEAM; using namespace ATOOLS; using namespace std; /*------------------------------------------------------------------------------- Constructors ------------------------------------------------------------------------------- */ Single_OSTerm::Single_OSTerm(const Process_Info &pinfo, size_t pi,size_t pj,size_t swit, Process_Integrator* pint) : p_partner(this), p_OS_mom(0), p_os_process(0), m_wwindow{ 5.0 }, p_realint(pint) { DEBUG_FUNC(""); PHASIC::Process_Base::Init(pinfo, pint->Beam(), pint->ISR()); AMEGIC::Process_Base::Init(); m_pi = pi; m_pj = pj; m_switch = swit; m_pk=2; if (m_pi==m_pk || m_pj==m_pk) m_pk ++; if (m_pi==m_pk || m_pj==m_pk) m_pk ++; m_name+= "_OS"+ToString(m_pi)+"_"+ToString(m_pj)+"_"+ToString(swit); bool val=DetermineType(); if (!val) return; //Construct OS Process Process_Info lopi(m_pinfo); lopi.m_fi.m_nlotype=nlo_type::lo; lopi.m_fi.m_ps.erase(FindInInfo(lopi.m_fi, m_pi-m_nin)); if (m_pj>m_pi) lopi.m_fi.m_ps.erase(FindInInfo(lopi.m_fi, m_pj-m_nin-1)); else lopi.m_fi.m_ps.erase(FindInInfo(lopi.m_fi, m_pj-m_nin)); vector::iterator part=FindInInfo(m_pinfo.m_fi, m_pi-m_nin); lopi.m_fi.m_ps.push_back(Subprocess_Info(m_flij,part->m_id, part->m_pol)); lopi.m_fi.m_ps.back().m_id="osdecay"; Subprocess_Info ACFS; ACFS.m_ps.push_back(lopi.m_fi.m_ps.back()); DEBUG_VAR(ACFS); BuildDecay(ACFS); DEBUG_VAR(ACFS); for (size_t afsi(0);afsi(); } Single_OSTerm::~Single_OSTerm() { p_scale=NULL; if (p_os_process) {delete p_os_process; p_os_process=0;} if (p_OS_mom) {delete[] p_OS_mom; p_OS_mom=0;} } /*------------------------------------------------------------------------------ Generic stuff for initialization of Single_OSTerms ------------------------------------------------------------------------------*/ void Single_OSTerm::BuildDecay (Subprocess_Info &ACFS) { int osf=1; Subprocess_Info ACDIS, ACDFS; std::string decid("osdecay"); ACDIS.m_ps.resize(1); ACDIS.m_ps.front().m_ps.clear(); for (size_t i(0);i::iterator Single_OSTerm::FindInInfo(Subprocess_Info& fi, int idx) const { // Find particle #idx in the given final state tree // and make sure it is not part of a decay for the time being int cnt=0; for (size_t i=0; iInfo()); int ip(-1), jp(-1), kp(-1),decayfound(0); for (size_t i=0; iPrintLOmom();return;} for (size_t i=0;i & links, vector & errs) { p_OS_mom = new Vec4D[m_nin+m_nout]; p_OS_labmom.resize(m_nin+m_nout); if (m_osinfo.m_amegicmhv>0) { if (CF.MHVCalculable(m_osinfo)) p_os_process = new Single_Process_MHV(); if (m_osinfo.m_amegicmhv==2) { m_valid=0; return 0; } } if (!p_os_process) p_os_process = new AMEGIC::Single_Process(); int status; p_os_process->PHASIC::Process_Base::Init(m_osinfo,p_realint->Beam(),p_realint->ISR()); Poincare cms; SetLOMomenta(p_testmoms,cms); p_os_process->SetTestMoms(p_OS_mom); status=p_os_process->InitAmplitude(model,top,links,errs); if (status<=0) { m_valid=0; return status; } m_subevt.m_n = m_nin+m_nout; m_subevt.p_fl = &(p_os_process->Flavours().front()); m_subevt.p_dec = &m_decins; m_subevt.p_mom = &p_OS_labmom.front(); m_subevt.m_i = m_pi; m_subevt.m_j = m_pj; m_subevt.m_k = m_pk; m_subevt.p_proc = p_os_process->Integrator(); m_sids.resize(m_nin+m_nout); for (size_t i(0);iInfo().m_ii,p_os_process->Info().m_fi); SetMaxOrders(p_os_process->MaxOrders()); SetMinOrders(p_os_process->MinOrders()); SetMaxOrder(0,p_os_process->MaxOrder(0)+1); SetMinOrder(0,p_os_process->MinOrder(0)+1); return 1; } /*------------------------------------------------------------------------------ Phase space initialization ------------------------------------------------------------------------------*/ bool Single_OSTerm::SetUpIntegrator() { bool res=p_os_process->SetUpIntegrator(); if (res) return res; return true; } /*------------------------------------------------------------------------------ Process management ------------------------------------------------------------------------------*/ void Single_OSTerm::SetLookUp(const bool lookup) { m_lookup=lookup; if (p_os_process) p_os_process->SetLookUp(lookup); } void Single_OSTerm::Minimize() { if (p_partner==this) return; if (p_os_process) {delete p_os_process; p_os_process=0;} if (p_OS_mom) {delete[] p_OS_mom; p_OS_mom=0;} m_subevt.p_mom = p_partner->GetSubevt()->p_mom; } double Single_OSTerm::Partonic(const Vec4D_Vector &_moms, int mode) { return 0.; } double Single_OSTerm::operator()(const ATOOLS::Vec4D * mom,const ATOOLS::Poincare &cms,const int mode) { ATOOLS::Vec4D dec(mom[m_pi]+mom[m_pj]); double invm2 = dec*dec; if (abs(sqr(m_flij.Mass()) - invm2) > m_wwindow*m_flij.Mass()*m_flij.Width() ) return 0.; if (sqrt((dec+mom[m_pk]).Abs2())<(m_flij.Mass()+m_flk.Mass())) return 0.; ResetLastXS(); p_os_process->ResetLastXS(); SetLOMomenta(mom,cms); bool trg(false); trg= p_os_process->Trigger(p_OS_labmom) || !p_os_process->Selector()->On(); p_int->SetMomenta(p_OS_labmom); p_os_process->Integrator()->SetMomenta(p_OS_labmom); m_subevt.m_me = m_subevt.m_mewgt = m_subevt.m_result = 0.; if (!trg) return m_lastxs=m_subevt.m_me=m_subevt.m_mewgt=0.; ATOOLS::Vec4D_Vector lomoms; for (size_t i=0;iScaleSetter()->CalculateScale(lomoms); double norm = p_os_process->Norm(); double M2 =p_os_process->operator()(&lomoms.front())*norm; double mij2 = sqr(m_flij.Mass()); double wij2 = sqr(m_flij.Width()); if (wij2==0.) THROW (fatal_error,"width is zero for on shell decay"); double factor= mij2*wij2/(sqr(invm2-mij2) + mij2*wij2); m_lastxs = factor*M2; m_subevt.m_me = m_subevt.m_mewgt = -m_lastxs; m_subevt.m_mu2[stp::fac1] = p_scale->Scale(stp::fac1); m_subevt.m_mu2[stp::fac2] = p_scale->Scale(stp::fac2); m_subevt.m_mu2[stp::ren] = p_scale->Scale(stp::ren); return m_lastxs; } void Single_OSTerm::SetSelector(const PHASIC::Selector_Key &key) { p_os_process->SetSelector(key); } int Single_OSTerm::NumberOfDiagrams() { if (p_partner==this) return p_os_process->NumberOfDiagrams(); return p_partner->NumberOfDiagrams(); } Point * Single_OSTerm::Diagram(int i) { if (p_partner==this) return p_os_process->Diagram(i); return p_partner->Diagram(i); } void Single_OSTerm::AddChannels(std::list*psln) { p_os_process->AddChannels(psln); } void Single_OSTerm::PrintProcessSummary(int it) { for(int i=0;iName()<<")"; if (p_partner!=this) { cout<<"; partner (*"<PrintProcessSummary(0); return; } cout<IsMapped()) p_os_process->SetScale(args); p_scale=p_os_process->Partner()->ScaleSetter(); }