Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:10:07

0001 #ifndef MODEL__Main__Color_Function_H
0002 #define MODEL__Main__Color_Function_H
0003 
0004 #include <string>
0005 
0006 namespace MODEL {
0007 
0008   class cf {
0009   public:
0010     enum code {
0011       T=0, 
0012       F=1, 
0013       D=2, 
0014       None=3, 
0015       G=4,  
0016       UFO=5,
0017       Unknown=99}; 
0018   };
0019 
0020   std::ostream &operator<<(std::ostream &str,const cf::code &c);
0021 
0022   class Color_Function {
0023   public:
0024     cf::code  m_type; // Number of args, multi gluons etc.
0025     int  m_partarg[3];
0026     char m_strarg[3];
0027     std::string m_string;
0028     Color_Function* p_next;
0029   public:
0030     Color_Function()  {
0031       m_type = cf::Unknown;
0032       p_next = 0;
0033       for (short int i=0;i<3;++i) m_partarg[i] = -1;
0034       for (short int i=0;i<3;++i) m_strarg[i] = '?';
0035     }
0036     
0037     Color_Function(cf::code _type, 
0038            int _partarg0 = -1, int _partarg1 = -1, int _partarg2 = -1, 
0039            Color_Function* n=NULL) 
0040       : m_type(_type), p_next(n) 
0041     {       
0042       m_partarg[0] = _partarg0;
0043       m_partarg[1] = _partarg1;
0044       m_partarg[2] = _partarg2;
0045       m_strarg[0]  = _partarg0>0?_partarg0+47:52;
0046       m_strarg[1]  = _partarg1>0?_partarg1+47:52;
0047       m_strarg[2]  = _partarg2>0?_partarg2+47:52;
0048     }
0049 
0050     Color_Function(const Color_Function & c) : p_next(NULL)
0051     {
0052       *this=c;
0053     }
0054 
0055     Color_Function & operator=(const Color_Function & c);
0056     ~Color_Function();
0057 
0058     bool operator==(const Color_Function &c) const;
0059     
0060     void SetParticleArg(int a, int b,int c=-1) {
0061       m_partarg[0] = a;m_partarg[1] = b;
0062       if (m_type!=cf::D && m_type!=cf::G) m_partarg[2] = c;
0063     }
0064 
0065     void SetStringArg(char a, char b, char c='?') {
0066       m_strarg[0] = a;m_strarg[1] = b;
0067       if (m_type!=cf::D && m_type!=cf::G) m_strarg[2] = c;
0068     }
0069 
0070     int ParticleArg(int i) const
0071     { 
0072       return m_partarg[i];
0073     }
0074     char StringArg(int i) const
0075     { 
0076       return m_strarg[i];
0077     }
0078     cf::code Type() const
0079     {
0080       return m_type;
0081     }
0082     Color_Function * Next() { 
0083       return p_next; 
0084     }
0085     void Conjugate() 
0086     {
0087       if (Type()!=cf::T) return;
0088 
0089       int help   = m_partarg[1];
0090       m_partarg[1] = m_partarg[2];
0091       m_partarg[2] = help;
0092 
0093       char help2 = m_strarg[1];
0094       m_strarg[1] = m_strarg[2];
0095       m_strarg[2] = help2;  
0096     }
0097     
0098     void Replace(int hit,int prop) {
0099       for (short int i=0;i<3;i++) {
0100     if ((Type()==cf::D || Type()==cf::G) && i==2) break;    
0101     if (ParticleArg(i)==hit) m_partarg[i] = prop;
0102       }
0103     }
0104     void Replace(int hit,char repl) {
0105       for (short int j=0;j<3;j++) {
0106     if ((Type()==cf::D || Type()==cf::G) && j==2) break;
0107     if (ParticleArg(j)==hit) m_strarg[j] = repl;
0108       }
0109     }
0110     void Append(Color_Function * last) 
0111     {
0112       Color_Function* help = this;
0113       while (help->p_next) help = help->p_next;
0114       help->p_next = last;  
0115     }
0116     Color_Function * Erase(Color_Function * granny) 
0117     {
0118       Color_Function * mo = p_next;
0119       if (granny)  granny->p_next=mo;
0120       p_next=0;
0121       delete this;
0122       return mo;
0123     }
0124 
0125     std::string String() const;
0126     std::string PID() const;   
0127     std::string FullString() const;
0128   };  
0129 
0130   std::ostream &operator<<(std::ostream &str,const Color_Function &cf);
0131 
0132   /*!
0133     \file
0134     \brief this file contains the classes MODEL::Color_Function
0135            and MODEL::cf   
0136   */
0137 
0138   /*! 
0139     \class cf 
0140     \brief Helper class that collects the existing types of possible Color_Functions
0141 
0142   */
0143 
0144   /*! 
0145     \class Color_Function 
0146     \brief In this class the basic ingredients of \f$ SU(3)_C \f$ algebra are defined 
0147 
0148     In order to attach the underlying color information to a Vertex object 
0149     Color_Function objects are defined. A Color_Function possesses a type, 
0150     defined in the class MODEL::cf, and a number of arguments which come 
0151     in two types, either as an int or a char variable. Per default the integer 
0152     arguments of a Color_Function, called partarg, are set to '-1' and the char 
0153     arguments, called strarg, are set to '?'. In addition attached to a 
0154     Color_Function is a string expression that contains the information of the 
0155     Color_Function type and charakter arguments. Tab. ?? list the Color_Function 
0156     types defined in MODEL++ and there associated number of arguments the 
0157     \f$ SU(3)_C\f$ analoga and the corresponding string expression.
0158         
0159     <table width=300 align=center>
0160     <tr>
0161     <td>Color_Funtion</td>
0162     <td>args</td>
0163     <td>\f$ SU(3)_C \f$</td>
0164     <td>String()</td>
0165     </tr>
0166     <tr>
0167     <td>None</td>
0168     <td>0</td>
0169     <td>\f$ 1 \f$</td>
0170     <td>1</td>
0171     </tr>
0172     <tr>
0173     <td>T</td>
0174     <td>3</td>
0175     <td>\f$ T^A_{ij} \f$</td>
0176     <td>T[A,i,j]</td>
0177     </tr>
0178     <tr>
0179     <td>F</td>
0180     <td>3</td>
0181     <td>\f$ f^{ABC} \f$</td>
0182     <td>F[A,B,C]</td>
0183     </tr>
0184     <tr>
0185     <td>D</td>
0186     <td>2</td>
0187     <td>\f$ \delta_{i,j} \f$</td>
0188     <td>D[i,j]</td>
0189     </tr>
0190     <tr>
0191     <td>G</td>
0192     <td>2</td>
0193     <td>\f$ \delta_{A,B} \f$</td>
0194     <td>G[A,B]</td>
0195     </tr>
0196     </table>
0197         
0198     The indizes \f$ i,j \f$ denote quark color degrees of freedom and  
0199     \f$ A,B,C \f$ label the \f$ SU(3)_C \f$ gluon octet. Apart from its type, 
0200     arguments and string each Color_Function owns a pointer to a further
0201     Color_Function called Next, a priori this pointer is initialized as nil.
0202 
0203   */
0204 
0205    /*!
0206      \fn Color_Function::Color_Function() 
0207     \brief Constructs a Color_Function object of type cf::Unknown and all partarg 
0208     initialized as '-1' and all strarg as '?'. The pointer Next (also a Color_Function) 
0209     is initialized as nil.
0210 
0211   */
0212 
0213   /*!
0214      \fn Color_Function::Color_Function(cf::code _type, 
0215            int _partarg0 = -1, int _partarg1 = -1, int _partarg2 = -1, 
0216            Color_Function *n=NULL) 
0217     \brief Can be used to contruct a Color_Function with a definite type and definite arguments.
0218     Again the pointer Next is initialized as nil.
0219 
0220   */
0221 
0222   /*!
0223     \fn void Color_Function::SetParticleArg(int a, int b,int c=-1)   
0224     \brief The setting of the integer arguments of a Color_Function object is 
0225     performed. Since the third argument is per default '-1' it is sufficient to 
0226     set only two arguments for a Color_Function possessing only two physical
0227     meaningful arguments.
0228   */
0229   
0230 /*!
0231     \fn void Color_Function::SetStringArg(char a, char b, char c='?')   
0232     \brief The setting of the charakter arguments of a Color_Function object is 
0233     performed. Since the third argument is per default set to '?' it is sufficient 
0234     to initialize only two arguments for a Color_Function possessing only two physical
0235     meaningful arguments.
0236   */
0237     
0238   /*!
0239     \fn std::string Color_Function::String()
0240     \brief Returns the string expression of the associated Color_Function in terms 
0241     of the Color_Function type and its charakter arguments.
0242   */
0243     }
0244 #endif