File indexing completed on 2025-04-19 09:09:45
0001 #ifndef AMEGIC_Amplitude_Amplitude_Generator_H
0002 #define AMEGIC_Amplitude_Amplitude_Generator_H
0003
0004 #include "ATOOLS/Phys/Flavour.H"
0005
0006 #include "AMEGIC++/Amplitude/Vertex.H"
0007 #include "AMEGIC++/Main/Topology.H"
0008 #include "AMEGIC++/Amplitude/Single_Amplitude.H"
0009 #include "AMEGIC++/Amplitude/Zfunctions/Basic_Sfuncs.H"
0010 #include "AMEGIC++/String/String_Handler.H"
0011
0012 namespace AMEGIC {
0013 class Pre_Amplitude {
0014 public:
0015 Point* p;
0016 int on;
0017 int top;
0018 int perm;
0019 Pre_Amplitude():p(0),on(1),top(0),perm(0) {}
0020 Pre_Amplitude(Point* _p, int _top, int _perm):p(_p),on(1),top(_top),perm(_perm) {}
0021 };
0022
0023
0024 typedef std::vector<Pre_Amplitude> Pre_Ampl_List;
0025
0026
0027 class Amplitude_Generator {
0028 static int NMAX;
0029 ATOOLS::Flavour * fl;
0030 int * b;
0031 Amegic_Model * p_model;
0032 Topology * top;
0033 int N,ntchan_min,ntchan_max;
0034 std::vector<int> order;
0035
0036 Single_Topology * single_top;
0037 std::vector<Pre_Amplitude> prea;
0038 Basic_Sfuncs * BS;
0039 String_Handler * shand;
0040
0041 bool m_create_4V;
0042
0043 Vertex_Table v_table;
0044
0045 Pre_Ampl_List prea_table;
0046
0047 void Set_End(Point*,const int* &,int&);
0048 void Next_P(Point*,Point* &);
0049 void Print_P(Point*);
0050 inline int MatchVertex(AMEGIC::Single_Vertex* v,
0051 ATOOLS::Flavour* flav,std::vector<Complex>& cpl)
0052 {
0053 if (v->dec>0 || flav[0]!=v->in[0]) return 0;
0054 if (flav[1].Kfcode() && flav[1]!=v->in[1]) return 0;
0055 if (flav[2].Kfcode() && flav[2]!=v->in[2]) return 0;
0056 flav[1]=v->in[1];
0057 flav[2]=v->in[2];
0058 cpl.resize(v->cpl.size());
0059 for (int j=0;j<v->cpl.size();++j) cpl[j]=v->Coupling(j);
0060 return 1;
0061 }
0062 int CheckEnd(Point*,ATOOLS::Flavour);
0063 void SetProps(Point*,int,Single_Amplitude* &, int, int);
0064 int Kill_Off(Single_Amplitude* &);
0065 int SingleCompare(Point*,Point*);
0066 void CountOrders(Single_Amplitude* &);
0067 bool CheckOrders(Point * p);
0068 bool CheckTChannels(Point * p);
0069 void Compare(Single_Amplitude* &);
0070 int CompareColors(Point*,Point*);
0071 int Compare5Vertex(Point*,Point*);
0072
0073 void CreateSingleAmplitudes(Single_Amplitude* &,std::set<std::pair<int,int> > &);
0074 void CheckFor4Vertices(Single_Amplitude* &);
0075 int EvalPointlist(Point*&, Point*&,Point*&,std::vector<Point*>&);
0076 int ShrinkProps(Point*&,Point*&,Point*&,Point*&,std::vector<Point*>&);
0077 Point* FindNext(Point*);
0078
0079 void Kill5VertexArtefacts(Single_Amplitude* first);
0080 int Is5VertexArtefact(Point* p, int &tcnt);
0081
0082 int Count4G(Point * p);
0083 int CountRealAmplitudes(Single_Amplitude* first);
0084 public:
0085 Amplitude_Generator(int,ATOOLS::Flavour *,int *,Amegic_Model *,Topology *,
0086 std::vector<int>,int,int,
0087 Basic_Sfuncs *,String_Handler *,bool=true);
0088 ~Amplitude_Generator();
0089 Single_Amplitude* Matching(std::set<std::pair<int,int> > &valid);
0090
0091 inline const std::vector<int> &Order() const { return order; }
0092 };
0093 }
0094 #endif
0095
0096
0097
0098
0099
0100
0101
0102
0103