#include "AMEGIC++/DipoleSubtraction/Single_LOProcess_External.H" #include "AMEGIC++/Amplitude/FullAmplitude_External.H" #include "ATOOLS/Org/Run_Parameter.H" #include "MODEL/Main/Running_AlphaS.H" #include "PHASIC++/Main/Process_Integrator.H" #include "PHASIC++/Main/Phase_Space_Handler.H" #include "AMEGIC++/Phasespace/Phase_Space_Generator.H" #include "BEAM/Main/Beam_Spectra_Handler.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 using namespace AMEGIC; using namespace PHASIC; using namespace MODEL; using namespace PDF; using namespace BEAM; using namespace ATOOLS; using namespace std; /*------------------------------------------------------------------------------- Constructors ------------------------------------------------------------------------------- */ Single_LOProcess_External::Single_LOProcess_External(const Process_Info &pi, BEAM::Beam_Spectra_Handler *const beam, PDF::ISR_Handler *const isr, const ATOOLS::sbt::subtype& st) : Single_LOProcess(pi, beam, isr, st) { m_emitgluon = false; } Single_LOProcess_External::~Single_LOProcess_External() { if (p_extamp) delete p_extamp; } /*------------------------------------------------------------------------------ Initializing libraries, amplitudes, etc. ------------------------------------------------------------------------------*/ int Single_LOProcess_External::InitAmplitude(Amegic_Model * model,Topology* top, vector & links, vector & errs,int checkloopmap) { DEBUG_FUNC(""); m_type = 21; if (!model->p_model->CheckFlavours(m_nin,m_nout,&m_flavs.front())) return 0; model->p_model->GetCouplings(m_cpls); m_partonlistqcd.clear(); m_partonlistqed.clear(); if (m_stype&sbt::qcd) { for (size_t i=0;ip_model,&m_cpls,p_hel,0,0); if (p_extamp->Status()==0) { msg_Tracking()<<"Single_LOProcess_External::InitAmplitude : No process for "<OrderEW()*2; m_maxcpl[0]=m_mincpl[0]=p_extamp->OrderQCD()*2; p_extamp->Calc()->FillCombinations(m_ccombs,m_cflavs); ////////////////////////////////////////////// switch (Tests()) { case 1 : for (size_t j=0;jType()) { if (m_allowmap && ATOOLS::IsEqual(links[j]->Result(),Result())) { if (CheckMapping(links[j])) { msg_Tracking()<<"Single_LOProcess_External::InitAmplitude : "<Name()<PSLibName(); break; } } } if (p_partner==this) links.push_back(this); return 1; case -3: return 0; default : msg_Error()<<"ERROR in Single_Fin_Process_External::InitAmplitude : "< & links, vector & errs, std::vector* epol,std::vector * pfactors) { m_type = 11; if (!model->p_model->CheckFlavours(m_nin,m_nout,&m_flavs.front())) return 0; model->p_model->GetCouplings(m_cpls); int cnt=0; for (size_t i(0);ip_model,&m_cpls,p_hel,m_emit,m_spect); if (p_extamp->Status()==0) { msg_Tracking()<<"Single_LOProcess_External::InitAmplitude : No process for "<OrderEW()*2; m_maxcpl[0]=m_mincpl[0]=p_extamp->OrderQCD()*2; p_extamp->Calc()->FillCombinations(m_ccombs,m_cflavs); ////////////////////////////////////////////// int tr=Tests(pfactors); // PRINT_INFO("Tests Result: "<Type()) { if (m_allowmap && ATOOLS::IsEqual(links[j]->Result(),Result())) { if (CompareTestMoms(links[j]->GetTestMoms())) { msg_Tracking()<<"Single_LOProcess_External::InitAmplitude : "<Name()<PSLibName(); break; } } } if (p_partner==this) links.push_back(this); Minimize(); return 1; case -3: return 0; default : msg_Error()<<"ERROR in Single_LOProcess_External::InitAmplitude : "< * pfactors) { int number = 1; int gauge_test = 1; int string_test = 1; /* --------------------------------------------------- The reference result for momenta moms --------------------------------------------------- */ string testname = string(""); if (FoundMappingFile(testname,m_pslibname)) { if (testname != string("")) { gauge_test = string_test = 0; } } double M2 = 0.; double helvalue; if (gauge_test) { msg_Tracking()<<"Single_LOProcess_External::Tests for "<SetSqMatrix((*pfactors)[1],p_testmoms[GetEmit()],(*p_epol)[0]); M2=p_extamp->Calc(p_testmoms); if (p_extamp->Calc()->NAmps()) for (size_t i=0;iMaxHel();i++) { if (p_hel->On(i) && p_hel->GetEPol(i)==90) { helvalue = p_extamp->MSquare(i)*p_hel->PolarizationFactor(i); M2 += helvalue; } } m_iresult = M2; } /* --------------------------------------------------- First test : gauge test --------------------------------------------------- */ number++; double M2g = 0.; double * M_doub = new double[p_hel->MaxHel()]; for (size_t i=0; iMaxHel(); ++i) M_doub[i]=0.; if (m_emitgluon) p_extamp->SetSqMatrix((*pfactors)[1],p_testmoms[GetEmit()],(*p_epol)[0]); M2g=p_extamp->Calc(p_testmoms); if (p_extamp->Calc()->NAmps()) for (size_t i=0; iMaxHel(); ++i) { if (p_hel->On(i) && p_hel->GetEPol(i)==90) { M_doub[i] = p_extamp->MSquare(i)*p_hel->PolarizationFactor(i); M2g += M_doub[i]; } } m_iresult = M2g; if (gauge_test) { if (!ATOOLS::IsEqual(M2,M2g)) { msg_Out()<<"WARNING: Gauge test not satisfied: " <MaxHel();i++) { if (p_hel->On(i)) { for (size_t j=i+1;jMaxHel();j++) { if (p_hel->On(j)) { if (ATOOLS::IsEqual(M_doub[i],M_doub[j])) { p_hel->SwitchOff(j); p_hel->SetPartner(i,j); p_hel->IncMultiplicity(i); } } } } } delete[] M_doub; return 1; } double Single_LOProcess_External::operator()(const ATOOLS::Vec4D_Vector &labmom,const ATOOLS::Vec4D *mom, std::vector * pfactors,std::vector* epol,const int mode) { DEBUG_FUNC(m_name); if (p_partner!=this) { if (m_lookup) { m_lastxs = p_partner->LastXS()*m_sfactor; if (m_lastxs!=0.) return m_lastxs; } return m_lastxs = p_partner->operator()(labmom,mom,pfactors,epol,mode)*m_sfactor; } p_int->SetMomenta(labmom); p_scale->CalculateScale(labmom,mode); double M2(0.); if (m_emitgluon) p_extamp->SetSqMatrix((*pfactors)[1],mom[GetEmit()],(*p_epol)[0]); if (p_extamp->Calc()->NAmps()==0) M2=p_extamp->Calc(mom); else { p_extamp->Calc(mom); for (size_t i=0;iMaxHel();i++) { if (p_hel->On(i) && p_hel->GetEPol(i)==90) { double mh=p_extamp->MSquare(i); mh *= p_hel->Multiplicity(i) * p_hel->PolarizationFactor(i); M2 += mh; } } } m_lastxs = M2; return m_lastxs; } void Single_LOProcess_External::Calc_AllXS (const ATOOLS::Vec4D_Vector &labmom, const ATOOLS::Vec4D *mom, std::vector > &dsijqcd, std::vector > &dsijew, const int mode) { p_int->SetMomenta(labmom); p_scale->CalculateScale(labmom,mode); dsijqcd[0][0]=dsijew[0][0]=0.; for (size_t i=0;iCalc()->NAmps()==0) dsijqcd[0][0]=dsijew[0][0]=p_extamp->Calc(mom); else { p_extamp->Calc(mom); for (size_t h=0;hMaxHel();h++) { if (p_hel->On(h)) { double fac = p_hel->Multiplicity(h) * p_hel->PolarizationFactor(h); dsijqcd[0][0] = dsijew[0][0] += p_extamp->MSquare(h,0,0)*fac; for (size_t i=0;iMSquare(h,m_partonlistqcd[i],m_partonlistqcd[k])*fac; } } for (size_t i=0;i