Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:09:45

0001 #ifndef AMEGIC_Amplitude_CFColor_H
0002 #define AMEGIC_Amplitude_CFColor_H
0003 
0004 #include "ATOOLS/Math/Matrix.H"
0005 #include "AMEGIC++/String/String_Tree.H"
0006 #include "AMEGIC++/Amplitude/Single_Amplitude.H"
0007 #include <map>
0008 
0009 namespace AMEGIC {
0010 
0011   //!the container for the T and F products
0012   typedef std::map<std::string, Complex>  TFprod_Table;
0013   typedef TFprod_Table::iterator          TF_Iterator;
0014   //!the map of indices
0015   typedef std::map<char, char>            Char_Map;
0016   typedef std::map<char, int>             CharNum_Map;
0017   
0018   class CFColor {
0019     static std::string noname;
0020     
0021     String_Tree    st;
0022     ATOOLS::CMatrix * CFC;
0023 
0024     int *     id;        // points to graph with same Color structure (mod. sign)
0025     int *     map;       // points to entry of color matrix for each graph
0026     int mcount, ncount;  // number of graphs, number of graphs with generic Color!
0027 
0028     void ReplaceT(sknot*);
0029     void ReplaceD(sknot*,sknot*);
0030     void ReplaceG(sknot* m,sknot* m0=0);
0031     void ReplaceF(sknot*,CharNum_Map&,char&);
0032 
0033 
0034     int  SingleReplaceD(sknot *,sknot *,char, char);
0035     void SingleReplaceF(sknot*,int&,CharNum_Map&,char&);
0036     void SingleReplaceFT(sknot*,int&,CharNum_Map&,char&);
0037 
0038     int  Compare(MODEL::Color_Function*,MODEL::Color_Function*);
0039     int  CompareArg(int,int,int,MODEL::Color_Function*,MODEL::Color_Function*);
0040     
0041     void ExtractIndices(sknot*,CharNum_Map&);
0042     char DeliverIndex(CharNum_Map&,char&);
0043     std::string BuildTChain(std::vector<std::string>);
0044     std::string MapFChain(std::vector<std::string>);
0045     TFprod_Table t_table;
0046     TFprod_Table f_table;
0047   public:
0048     /*!
0049       The constructor of the colour class that basically organizes the
0050       full evaluation of the colour matrix :
0051       - After initializing colour functions for every amplitude it is checked
0052       whether there are colour factors at all. If not, the colour matrix has
0053       only unity elements. 
0054       - Then the colour structures are analyzed in order to find identical ones
0055       to further alleviate the calculation.
0056       - Finally, pairs of surviving colour functions are evaluated.
0057       In doing so first structure constants f^abc are replaced by the usual
0058       relations :  
0059       Then, products of structure constants T^a_ij T^a_kl are replaced via :
0060       Furthermore, delta functions are eliminated.
0061 
0062     */
0063     CFColor(int,Single_Amplitude*,ATOOLS::Flavour *,
0064             char,char,std::string pID=noname,bool=false);
0065     ~CFColor();
0066     //! Outputs the colour matrix.
0067     void Output(std::string &);
0068     /*!
0069       Simple access to individual elements of the colour matrix.
0070     */
0071     inline const Complex& Mij(const int i,const int j) const
0072     {return (*CFC)[i][j];}
0073     inline const ATOOLS::CMatrix* GetCMatrix() const {return CFC;}
0074     inline int CFMap(int i) const {return map[i]; }
0075     inline int CFSign(int i) const {return (id[i]>=0) ? 1 : -1; }
0076     inline int MatrixSize() const {return ncount;}
0077   };
0078   
0079 }
0080 #endif