Commit 06cf2a8c authored by Stefan Hoeche's avatar Stefan Hoeche

svn merge --ignore-ancestry trunk/SHERPA branches/bsm

parent dbcb0b09
This diff is collapsed.
......@@ -39,20 +39,12 @@ void Amplitude_Base::BuildGlobalString(int* i,int j,Basic_Sfuncs* BS ,ATOOLS::Fl
String_Handler* shand)
{std::cerr<<"Error: Virtual Amplitude_Base::BuildGlobalString() called!"<<std::endl;}
void Amplitude_Base::SetOrderQED(int) {
std::cerr<<"Error: Virtual Amplitude_Base::GetOrderQED() called!"<<std::endl;
}
void Amplitude_Base::SetOrderQCD(int) {
std::cerr<<"Error: Virtual Amplitude_Base::GetOrderQCD() called!"<<std::endl;
}
int Amplitude_Base::GetOrderQED() {
std::cerr<<"Error: Virtual Amplitude_Base::GetOrderQED() called!"<<std::endl;return 0;
void Amplitude_Base::DefineOrder(const std::vector<int> &o)
{
abort();
}
int Amplitude_Base::GetOrderQCD() {
std::cerr<<"Error: Virtual Amplitude_Base::GetOrderQCD() called!"<<std::endl;return 0;
const std::vector<int> &Amplitude_Base::GetOrder()
{
abort();
}
......@@ -45,10 +45,8 @@ namespace AMEGIC {
virtual void BuildGlobalString(int*,int,Basic_Sfuncs*,ATOOLS::Flavour*,String_Handler*);
virtual void SetOrderQED(int);
virtual void SetOrderQCD(int);
virtual int GetOrderQED();
virtual int GetOrderQCD();
virtual void DefineOrder(const std::vector<int> &o);
virtual const std::vector<int> &GetOrder();
};
}
#endif
......
//#include <iomanip>
#include "AMEGIC++/Amplitude/Amplitude_Generator.H"
#include "AMEGIC++/Amplitude/Amplitude_Manipulator.H"
#include "AMEGIC++/Main/Tools.H"
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Message.H"
#include "ATOOLS/Org/Exception.H"
#include "ATOOLS/Math/MathTools.H"
#include "ATOOLS/Math/Permutation.H"
#include "MODEL/Interaction_Models/Interaction_Model_Base.H"
namespace AMEGIC {
class Compare_Pre_Amplitudes {
......@@ -23,11 +24,11 @@ using namespace MODEL;
using namespace std;
Amplitude_Generator::Amplitude_Generator(int _no,Flavour* _fl,int* _b,
Model_Base * _model,Topology * _top,
int _nQCD,int _nEW,int _ntchan_min,
Amegic_Model * _model,Topology * _top,
std::vector<int> _order,int _ntchan_min,
Basic_Sfuncs* _BS,String_Handler* _shand, bool create_4V)
: fl(_fl), b(_b), p_model(_model), top(_top),
N(_no), nEW(_nEW), nQCD(_nQCD), ntchan_min(_ntchan_min),
N(_no), order(_order), ntchan_min(_ntchan_min),
BS(_BS), shand(_shand), m_create_4V(create_4V)
{
single_top = top->Get(N-2);
......@@ -38,8 +39,8 @@ Amplitude_Generator::Amplitude_Generator(int _no,Flavour* _fl,int* _b,
// fill hash table
Vertex * v = p_model->GetVertex();
Vertex * v = p_model->p_vertex;
for (int i=0;i<v->MaxNumber();++i) {
if ((*v)[i]->on) {
v_table[(*v)[i]->in[0]].push_back((*v)[i]);
......@@ -116,7 +117,7 @@ void Amplitude_Generator::Print_P(Point* p)
}
}
int Amplitude_Generator::MatchVertex(Single_Vertex* v,Flavour* flav,vector<Complex>& cpl)
int Amplitude_Generator::MatchVertex(AMEGIC::Single_Vertex* v,Flavour* flav,vector<Complex>& cpl)
{
if (v->dec>0) return false;
if (flav[0] == v->in[0]) {
......@@ -362,12 +363,6 @@ void Amplitude_Generator::CreateSingleAmplitudes(Single_Amplitude * & first) {
Single_Amplitude* gra;
for (size_t i=0;i<prea_table.size();i++) {
int sw1 = 1;
if (MODEL::s_model->GetInteractionModel()->Code()=="pure_QCD") {
for (int j=0;j<dep;j++) {
if (((prea_table[i].p[j].fl).IsBoson()) &&
(prea_table[i].p[j].fl!=Flavour(kf_gluon))) { sw1 = 0; break; }
}
}
// test if 3-Vertex
if (sw1) {
for (int j=0;j<dep;j++) {
......@@ -642,7 +637,7 @@ int Amplitude_Generator::Compare5Vertex(Point* p1,Point* p2)
Point** pts1=new Point*[4];
Point** pts2=new Point*[4];
Point *p41,*p42;
if (p1->left->fl.Is5VDummy()) {
if (p1->left->fl.Kfcode()==kf_shgluon) {
pts1[0]=p1->left->left;
pts1[1]=p1->left->middle;
pts1[2]=p1->left->right;
......@@ -656,7 +651,7 @@ int Amplitude_Generator::Compare5Vertex(Point* p1,Point* p2)
pts1[3]=p1->right->right;
p41=p1->right;
}
if (p2->left->fl.Is5VDummy()) {
if (p2->left->fl.Kfcode()==kf_shgluon) {
pts2[0]=p2->left->left;
pts2[1]=p2->left->middle;
pts2[2]=p2->left->right;
......@@ -725,16 +720,20 @@ void Amplitude_Generator::CountOrders(Single_Amplitude * & first)
Single_Amplitude* f1 = first;
Single_Amplitude* f2;
int count=0;
int QEDmax = 0;
int QCDmax = 0;
std::vector<int> hitmax;
while (f1) {
int hitQED = 0;
int hitQCD = 0;
hitQCD = f1->GetPointlist()->FindQCDOrder(hitQCD);
hitQED = f1->GetPointlist()->FindQEDOrder(hitQED);
if (hitQED>QEDmax&&hitQED<=nEW) QEDmax=hitQED;
if (hitQCD>QCDmax&&hitQCD<=nQCD) QCDmax=hitQCD;
if ((nEW<99 && hitQED!=nEW) || (nQCD<99 && hitQCD!=nQCD) ||
std::vector<int> hit;
f1->GetPointlist()->FindOrder(hit);
bool valid(true);
for (size_t i(0);i<Min(order.size(),hit.size());++i)
if (hit[i]>order[i]) valid=false;
msg_Debugging()<<"Order check: "<<hit<<" vs. "<<order<<" -> "<<valid<<"\n";
if (hit.size()>hitmax.size())
hitmax.resize(hit.size(),0);
for (size_t i(0);i<Min(hit.size(),hitmax.size());++i)
if (order.size()<=i || hit[i]<order[i])
hitmax[i]=Max(hitmax[i],hit[i]);
if (!valid ||
!CheckTChannels(f1->GetPointlist())) {
++count;
if (f1==first) {
......@@ -755,8 +754,6 @@ void Amplitude_Generator::CountOrders(Single_Amplitude * & first)
f1 = f1->Next;
}
}
nEW = QEDmax;
nQCD = QCDmax;
msg_Tracking()<<"Kicked number of diagrams (Amplitude_Generator::CountOrders()) "<<count<<endl;
}
......@@ -775,13 +772,13 @@ bool Amplitude_Generator::CheckTChannels(Point * p) {
bool Amplitude_Generator::CheckOrders(Point * p)
{
int hitQED = 0;
int hitQCD = 0;
hitQCD = p->FindQCDOrder(hitQCD);
hitQED = p->FindQEDOrder(hitQED);
if (nEW<99 && hitQED!=nEW) return 0;
if (nQCD<99 && hitQCD!=nQCD) return 0;
return 1;
std::vector<int> hit;
p->FindOrder(hit);
bool valid(true);
for (size_t i(0);i<Min(order.size(),hit.size());++i)
if (hit[i]>order[i]) valid=false;
msg_Debugging()<<"Order check: "<<hit<<" vs. "<<order<<" -> "<<valid<<"\n";
return valid;
}
void Amplitude_Generator::Compare(Single_Amplitude* &first)
......@@ -884,15 +881,14 @@ int Amplitude_Generator::ShrinkProps(Point*& p,Point*& pnext, Point*& pcopy, Poi
}
//barflags
Vertex* v = p_model->GetVertex();
Vertex* v = p_model->p_vertex;
for (short int i=0;i<v->MaxNumber4();i++) {
if ((*v)(i)->on) {
Single_Vertex test;
test = *((*v))(i);
if (in[0]) test.in[0] = test.in[0].Bar();
if (in[1]) test.in[1] = test.in[1].Bar();
if (in[2]) test.in[3] = test.in[3].Bar();
......@@ -924,40 +920,39 @@ int Amplitude_Generator::ShrinkProps(Point*& p,Point*& pnext, Point*& pcopy, Poi
//setting the contraction flags
pnext->m = 1;
if ((*v)(i)->Color.size()==1) {
*pcopy->Color = (*v)(i)->Color.back();
if (pcopy->Lorentz) delete pcopy->Lorentz;
if (pcopy->Lorentz) delete pcopy->Lorentz;
pcopy->Lorentz = (*v)(i)->Lorentz.front()->GetCopy();
pcopy->t = (*v)(i)->t;
break;
}
else {
break;
}
else {
for (size_t k=0;k<(*v)(i)->Color.size();k++) {
*pcopy->Color = (*v)(i)->Color[k];
if (pcopy->Lorentz) delete pcopy->Lorentz;
if (pcopy->Lorentz) delete pcopy->Lorentz;
pcopy->Lorentz = (*v)(i)->Lorentz[k]->GetCopy();
pcopy->t = (*v)(i)->t;
Color_Function* cfmemo = pcopy->Color;
//set the contraction indices: 4 -> (prop->number)
while (cfmemo) {
cfmemo->Replace(4,pnext->number);
cfmemo = cfmemo->Next();
}
//fill the vector pcollist
int ll = 0;
Point* ptmp = new Point[single_top->depth];
top->Copy(beg_pcopy,ptmp,ll);
pcollist.push_back(ptmp);
Point* ptmp = new Point[single_top->depth];
top->Copy(beg_pcopy,ptmp,ll);
pcollist.push_back(ptmp);
}
break;
}
}
else hit = 0;
}
}
return hit;
}
......@@ -1060,7 +1055,7 @@ int Amplitude_Generator::Is5VertexArtefact(Point* p, int &tcnt)
case 0:
break;
case 1:
if (tcnt!=-1 || !p->fl.Is5VDummy()) return 1;
if (tcnt!=-1 || p->fl.Kfcode()!=kf_shgluon) return 1;
tcnt++;
break;
case -1:
......@@ -1187,8 +1182,8 @@ Single_Amplitude* Amplitude_Generator::Matching()
}
}
if (fl[perm[j]].IsLepton()) {
if (b[perm[j]]==1) lsum+=fl[perm[j]].LeptonNumber();
else lsum-=fl[perm[j]].LeptonNumber();
if (b[perm[j]]==1) lsum+=LeptonNumber(fl[perm[j]]);
else lsum-=LeptonNumber(fl[perm[j]]);
}
if (!fl[0].IsAnti()) {
......
......@@ -3,8 +3,7 @@
#include "ATOOLS/Phys/Flavour.H"
#include "MODEL/Main/Model_Base.H"
#include "MODEL/Interaction_Models/Vertex.H"
#include "AMEGIC++/Amplitude/Vertex.H"
#include "AMEGIC++/Main/Topology.H"
#include "AMEGIC++/Amplitude/Single_Amplitude.H"
#include "AMEGIC++/Amplitude/Zfunctions/Basic_Sfuncs.H"
......@@ -29,9 +28,10 @@ namespace AMEGIC {
static int NMAX;
ATOOLS::Flavour * fl;
int * b;
MODEL::Model_Base * p_model;
Amegic_Model * p_model;
Topology * top;
int N,nEW,nQCD,ntchan_min;
int N,ntchan_min;
std::vector<int> order;
Single_Topology * single_top;
std::vector<Pre_Amplitude> prea;
......@@ -40,14 +40,14 @@ namespace AMEGIC {
bool m_create_4V;
MODEL::Vertex_Table v_table;
Vertex_Table v_table;
//exhibits the points, the topology and the permutation number
Pre_Ampl_List prea_table;
void Set_End(Point*,int* &,int&);
void Next_P(Point*,Point* &);
void Print_P(Point*);
int MatchVertex(MODEL::Single_Vertex*,ATOOLS::Flavour*,std::vector<Complex>&);
int MatchVertex(AMEGIC::Single_Vertex*,ATOOLS::Flavour*,std::vector<Complex>&);
int CheckEnd(Point*,ATOOLS::Flavour);
void SetProps(Point*,int,Single_Amplitude* &,int*, int, int);
int Kill_Off(Single_Amplitude* &);
......@@ -72,11 +72,10 @@ namespace AMEGIC {
int Count4G(Point * p);
int CountRealAmplitudes(Single_Amplitude* first);
public:
Amplitude_Generator(int,ATOOLS::Flavour *,int *,MODEL::Model_Base *,Topology *,
int,int,int,Basic_Sfuncs *,String_Handler *,bool=true);
Amplitude_Generator(int,ATOOLS::Flavour *,int *,Amegic_Model *,Topology *,
std::vector<int>,int,Basic_Sfuncs *,String_Handler *,bool=true);
~Amplitude_Generator();
Single_Amplitude* Matching();
void GetOrders(int& qed,int& qcd) {qed=nEW;qcd=nQCD;}
};
}
#endif
......
......@@ -363,8 +363,7 @@ Complex Amplitude_Group::Zvalue(int ihel,int* signlist) {
return M;
}
int Amplitude_Group::GetOrderQED()
{return graphs.front()->GetOrderQED();}
int Amplitude_Group::GetOrderQCD()
{return graphs.front()->GetOrderQCD();}
const std::vector<int> &Amplitude_Group::GetOrder()
{
return graphs.front()->GetOrder();
}
......@@ -52,8 +52,7 @@ namespace AMEGIC {
Amplitude_Base* GetAmplitude(const int n);
void BuildGlobalString(int*,int,Basic_Sfuncs*,ATOOLS::Flavour*,String_Handler*);
int GetOrderQED();
int GetOrderQCD();
const std::vector<int> &GetOrder();
};
......
This diff is collapsed.
#ifndef AMEGIC_Amplitude_Amplitude_Handler_H
#define AMEGIC_Amplitude_Amplitude_Handler_H
#include "MODEL/Main/Model_Base.H"
#include "AMEGIC++/Main/Tools.H"
#include "ATOOLS/Phys/Flavour.H"
#include "AMEGIC++/Main/Polarisation.H"
#include "AMEGIC++/Amplitude/Vertex.H"
#include "AMEGIC++/Amplitude/Zfunctions/Basic_Sfuncs.H"
#include "AMEGIC++/String/String_Handler.H"
#include "ATOOLS/Math/MyComplex.H"
......@@ -38,6 +39,9 @@ namespace AMEGIC {
std::map<std::string,ATOOLS::Flavour> m_flavourmap;
std::vector<size_t> m_hm;
std::vector<int> m_maxcpl, m_mincpl, m_aon;
std::vector<std::vector<std::vector<int> > > m_cplmatrix;
std::vector<std::vector<int> > m_on;
int PropProject(Amplitude_Base*,int);
int CompareZfunc(Amplitude_Base*,Zfunc*,Amplitude_Base*,Zfunc*);
......@@ -55,7 +59,9 @@ namespace AMEGIC {
public:
Amplitude_Handler(int,ATOOLS::Flavour *,int *,Process_Tags*,
MODEL::Model_Base *,Topology *,int &,int &,int &,MODEL::Coupling_Map *const cpls,
Amegic_Model *,Topology *,
std::vector<int> &,std::vector<int> &,
int &,MODEL::Coupling_Map *const cpls,
Basic_Sfuncs *,String_Handler *,std::string print_graph="", bool create_4V=true,
bool cutvecprop=true);
~Amplitude_Handler();
......@@ -92,6 +98,8 @@ namespace AMEGIC {
int CompareAmplitudes(Amplitude_Handler*,double &, std::map<std::string,Complex> &);
std::map<std::string,ATOOLS::Flavour>& GetFlavourmap() { return m_flavourmap; }
bool CheckEFMap();
std::vector<int> MaxCpl() const;
std::vector<int> MinCpl() const;
};
//! The alternative color matrix, for more details see CFColor.
......
#include "AMEGIC++/Amplitude/Amplitude_Manipulator.H"
#include "AMEGIC++/Main/Tools.H"
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/Message.H"
......@@ -156,14 +157,14 @@ void Amplitude_Manipulator::GetFermionLine(Point* pcurr,Point*& pbegin,Point*& p
return;
}
if (fl[pbegin->number].IsAnti() && fl[pbegin->number].IsChargino() && fl[pend->number].Majorana()) {
if (fl[pbegin->number].IsAnti() && IsChargino(fl[pbegin->number]) && fl[pend->number].Majorana()) {
Point* h = pbegin;
pbegin = pend;
pend = h;
return;
}
if (!fl[pend->number].IsAnti() && fl[pend->number].IsChargino() && fl[pbegin->number].Majorana()) {
if (!fl[pend->number].IsAnti() && IsChargino(fl[pend->number]) && fl[pbegin->number].Majorana()) {
Point* h = pbegin;
pbegin = pend;
pend = h;
......@@ -171,13 +172,13 @@ void Amplitude_Manipulator::GetFermionLine(Point* pcurr,Point*& pbegin,Point*& p
}
if (fl[pend->number].IsAnti() && fl[pbegin->number].Majorana() &&
fl[pend->number].IsChargino()) return;
IsChargino(fl[pend->number])) return;
if (!fl[pbegin->number].IsAnti() && fl[pbegin->number].IsChargino() &&
fl[pend->number].IsAnti() && fl[pend->number].IsChargino()) return;
if (!fl[pbegin->number].IsAnti() && IsChargino(fl[pbegin->number]) &&
fl[pend->number].IsAnti() && IsChargino(fl[pend->number])) return;
if (fl[pbegin->number].IsAnti() && fl[pbegin->number].IsChargino() &&
!fl[pend->number].IsAnti() && fl[pend->number].IsChargino()) {
if (fl[pbegin->number].IsAnti() && IsChargino(fl[pbegin->number]) &&
!fl[pend->number].IsAnti() && IsChargino(fl[pend->number])) {
Point* h = pbegin;
pbegin = pend;
pend = h;
......@@ -189,7 +190,7 @@ void Amplitude_Manipulator::GetFermionLine(Point* pcurr,Point*& pbegin,Point*& p
if (fl[pend->number].IsAnti() && !fl[pend->number].Majorana()) return;
if ( (fl[pbegin->number].IsAnti() && !fl[pbegin->number].Majorana()) ||
(!fl[pend->number].IsAnti() && !fl[pend->number].Majorana() &&
!fl[pend->number].IsChargino()) ) {
!IsChargino(fl[pend->number])) ) {
Point* h = pbegin;
pbegin = pend;
pend = h;
......@@ -463,8 +464,8 @@ int Amplitude_Manipulator::SetFermionNumberFlow(Point* pb,Point* pe)
int majoflag = 0;
int chinum = 0;
if (!pb->fl.Majorana() && !pe->fl.Majorana()) {
if (pb->fl.IsChargino()) chinum++;
if (pe->fl.IsChargino()) chinum++;
if (IsChargino(pb->fl)) chinum++;
if (IsChargino(pe->fl)) chinum++;
if (chinum!=1) {
if (b[pb->number]==-1 && b[pe->number]==-1 &&
((!pb->fl.IsAnti() && !pe->fl.IsAnti()) ||
......
#include "AMEGIC++/Amplitude/FullAmplitude_External.H"
#include "MODEL/Interaction_Models/Interaction_Model_Base.H"
#include "AMEGIC++/Amplitude/Zfunctions/Basic_Sfuncs.H"
#include "AMEGIC++/Main/ColorSC.H"
#include "AMEGIC++/Main/Helicity.H"
......@@ -19,7 +18,7 @@ using namespace ATOOLS;
FullAmplitude_External::FullAmplitude_External
(const Process_Info &info,Model_Base *model,Coupling_Map *const cpls,
Helicity *hel,const size_t &emit,const size_t &spect):
p_model(model->GetInteractionModel()),
p_model(model),
m_emit(emit), m_spect(spect)
{
DEBUG_FUNC("");
......
......@@ -17,7 +17,7 @@ namespace AMEGIC {
PHASIC::Tree_ME2_Base *p_calc;
ATOOLS::Flavour_Vector m_fls;
MODEL::Interaction_Model_Base *p_model;
MODEL::Model_Base *p_model;
size_t m_nin, m_oqcd, m_oew, m_emit, m_spect;
double m_A;
......
......@@ -4,7 +4,6 @@
#include "ATOOLS/Org/Run_Parameter.H"
#include "ATOOLS/Org/MyStrStream.H"
#include "ATOOLS/Math/MathTools.H"
#include "MODEL/Interaction_Models/Interaction_Model_Base.H"
#include <iostream>
using namespace ATOOLS;
......@@ -22,7 +21,7 @@ static map<string,FullAmplitude_MHV_Base*> s_ampmap;
// constructor
FullAmplitude_MHV_Base::FullAmplitude_MHV_Base(Model_Base *model,MODEL::Coupling_Map *const cpls,int np,int *pl):
p_model(model->GetInteractionModel()),m_cpls(cpls),
p_model(model),m_cpls(cpls),
p_permstore(0), p_permutation(0), p_calc(0), m_colorstore(0), m_ampstore(0), m_ampstore2(0), p_norm(1), colorflag(false),
n_part(np), m_plist(0), m_perm(0), m_permgl(0), m_emit(0), m_spect(0), m_dptgluon(false), m_A(1.), m_conv(1.), m_phase2(1.,0.)
{
......@@ -34,7 +33,7 @@ FullAmplitude_MHV_Base::FullAmplitude_MHV_Base(Model_Base *model,MODEL::Coupling
}
m_perm= new int[np];