%                            GLUONSETUP(31).TEX
% CALLED BY FEYNMAN(34).
% USED FOR GENERATING GLUON LINES IN FEYNMAN DIAGRAMS IN LATEX.
\global\newcount\gluonlength
\global\newcount\gluonlengthx
\global\newcount\gluonlengthy
\global\newcount\gluonfrontx  %}(x,y) co-ord of left of gluon
\global\newcount\gluonfronty  %}
\global\newcount\gluonbackx
\global\newcount\gluonbacky
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\setunitbox(#1)[#2][#3](#4)[#5]{
\gdef\upperunitbox{\oval(#1,#1)[#2]}
\gdef\lowerunitbox{\oval(401,401)[#3]}
\gdef\thirdunitbox{\oval(#4,#4)[#5]}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\selectgluon{  % ORIGINALLY DEFINED IN FEYNMAN(29+).  RECURSIVELY RE-DEFINE
\global\advance\gluoncount by 1  % Counts number of gluons drawn. 
\global\gluonfrontx=\particlefrontx   % READ IN FROM FEYNMAN \selectgluon
\global\gluonfronty=\particlefronty   % READ IN FROM FEYNMAN \selectgluon
\global\particleadjustx=0     \global\particleadjusty=0
% Error messages for overly-long lines.  See FEYNMAN for negative-lengths.
\ifnum\unitboxnumber > 40
\message{   *** WARNING *** Gluon with 
\the\unitboxnumber\space loops requested ***   }
\ifnum\unitboxnumber > 85
\message{   *** Reducing gluon length to 6 loops (max 85) ***   }
\ifnum\unitboxnumber > 1000
\message{   *** Probable Cause:  Gluon selected instead of Fermion ***   }
\fi \global\unitboxnumber=6 \fi \fi  % end of length error
\global\unitboxnumberpo=\unitboxnumber  % DEFINED IN \drawsavedline (FEYNMAN).
\global\advance\unitboxnumberpo by 1 %\unitboxnumber if \unitboxnumber is odd.
% DEFAULTS:
\global\numlineparts = 3
\global\numupperunits=\unitboxnumber
\global\numlowerunits=\unitboxnumber
\global\numthirdunits=\unitboxnumber
% select gluon alignment:
\ifcase\LINEDIRECTION
\Ngluon    %\LINEDIRECTION=0 (NORTH) CASE
\or  \NEgluon  % 1 case
\or  \Egluon   % 2 case...horizontal gluon.
\or  \SEgluon
\or  \Sgluon
\or  \SWgluon 
\or  \Wgluon
\or  \NWgluon
\else\DIRECTERROR \fi
\setparticle  
\global\gluonlengthx=\particlelengthx  \global\gluonlengthy=\particlelengthy
\global\gluonbackx=\particlebackx      \global\gluonbacky=\particlebacky      
} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\Ngluon{   % VERTICAL gluons
\ifcase\LINECONFIGURATION   % \REG GLUON CONFIGURATION
\setcoords(600,540,600)(20,620,1220)[0,1050] 
\setunitbox(1600)[tl][r](1600)[bl]
\particleadjusty=195
\or % \FLIPPED
\setcoords(-990,-930,-990)(12,615,1215)[0,1050]
\setunitbox(1600)[tr][l](1600)[br]
\particleadjusty=195
\or % \CURLYGLUON
\setcoords(440,390,440)(-10,415,840)[0,850]  
\setunitbox(1250)[tl][r](1250)[bl]
\particleadjustx=0
\particleadjusty=-10
\or % \FLIPPED case
\setcoords(-820,-770,-820)(-25,400,825)[0,850]  % Matches change in \S\CURLY
\particleadjusty=-10  % goes with \CURLY \particleadjusty=-10
\setunitbox(1250)[tr][l](1250)[br]
\or \UNIMPERROR  % \LCONFIG=4 is \FLAT case
\or \UNIMPERROR  % \LCONFIG=5 is \FLIPPEDFLAT case
\or % \LCONFIG=6 is \CENTRALGLUON case
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumberpo
\setcoords(-200,-200,-200)(616,1041,616)[0,850]
\setunitbox(1250)[tl][r](1250)[bl]
\particleadjusty=1238
\particleadjusty=1233
\or % \FLIPPEDCENTRAL
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumberpo
\setcoords(-200,-200,-200)(620,1045,620)[0,850]
\setunitbox(1250)[tr][l](1250)[br]
\particleadjusty=1245
\else \UNIMPERROR % etc.
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\NEgluon{
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumber
\ifcase\LINECONFIGURATION
\setcoords(900,900,900)(0,900,900)[900,900]
\setunitbox(2200)[tl][tr](401)[b]
\particleadjustx=1100     \particleadjusty=1100
\or % \FLIPPED case
\setcoords(-180,720,720)(1090,1091,1091)[900,900]
\setunitbox(2200)[br][tr](401)[l]
\particleadjustx=1110     \particleadjusty=1050                      
\else \UNIMPERROR % etc.
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\Egluon{     % EASTWARD HORIZONTAL gluons
\ifcase\LINECONFIGURATION
\setcoords(-210,390,990)(-800,-745,-800)[1050,0]  % draws from outer line edge
\setunitbox(1600)[tr][b](1600)[tl]  
\particleadjustx=130  % draws from outer line edge
\or % \FLIPPED
\setcoords(-210,390,990)(800,745,800)[1050,0]  % draws from outer line edge
\setunitbox(1600)[br][t](1600)[bl]
\particleadjustx=130
\or % \CURLYGLUON
\setcoords(-200,225,650)(-625,-575,-625)[850,0]
\setunitbox(1250)[tr][b](1250)[tl]  
\or % \FLIPPED case
\setcoords(-200,225,650)(625,575,625)[850,0]
\setunitbox(1250)[br][t](1250)[bl]
\or % \LCONFIG=4 is \FLAT case
\setcoords(-200,430,1060)(-830,-780,-830)[1260,0]
\setunitbox(1660)[tr][b](1660)[tl]
\or % \LCONFIG=5 is \FLIPPEDFLAT case
\setcoords(-200,430,1060)(830,780,830)[1260,0]
\setunitbox(1660)[br][t](1660)[bl]
\or % \LCONFIG=6 is \CENTRALGLUON case
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumberpo
\setcoords(440,865,440)(0,50,0)[850,0]
\setunitbox(1250)[tr][b](1250)[tl]
\particleadjustx=1260
\or % \FLIPPEDCENTRALGLUON case 
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumberpo
\setcoords(430,855,430)(0,-50,0)[850,0]
\setunitbox(1250)[br][t](1250)[bl]
\particleadjustx=1250
\or % \LCONFIG=8 is \SQUASHEDGLUON case
\setcoords(-160,440,1040)(-600,-550,-600)[1200,0]
\gdef\upperunitbox{\oval(1600,1200)[tr]}
\gdef\thirdunitbox{\oval(1600,1200)[tl]}
\gdef\lowerunitbox{\oval(401,401)[b]}
\else \UNIMPERROR 
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\SEgluon{  
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumber
\ifcase\LINECONFIGURATION
\setcoords(-200,700,700)(-1100,-1100,-1100)[900,-900]
\setunitbox(2200)[tr][br](401)[l]
\particleadjustx=1100     \particleadjusty=-1100  
\or % \FLIPPED case
\setcoords(890,890,890)(0,-900,-900)[900,-900]
\setunitbox(2200)[bl][br](401)[t]
\particleadjustx=1050     \particleadjusty=-1100 
\else \UNIMPERROR % etc.
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\Sgluon{   % VERTICAL gluons
\ifcase\LINECONFIGURATION  % \REG STYLE GLUON
\setcoords(-1000,-940,-1000)(0,-595,-1195)[0,-1050]
\setunitbox(1600)[br][l](1600)[tr]
\particleadjusty=-150
\or % \FLIPPED
\setcoords(605,545,605)(-20,-615,-1215)[0,-1050]
\setunitbox(1600)[bl][r](1600)[tl]  
\particleadjusty=-150
\or % \CURLYGLUON
\setcoords(-820,-770,-820)(0,-425,-850)[0,-850]
\setunitbox(1250)[br][l](1250)[tr]  
\or % \FLIPPED case
\setcoords(440,390,440)(0,-425,-850)[0,-850]
\setunitbox(1250)[bl][r](1250)[tl]  
\or \UNIMPERROR % \LCONFIG=4 is \FLATGLUON case
\or \UNIMPERROR
\or % \LCONFIG=6 is \CENTRALGLUON case
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumberpo
\setcoords(-180,-180,-180)(-635,-1060,-635)[0,-850]
\setunitbox(1250)[br][l](1250)[tr]  
\particleadjusty=-1290
\or % \FLIPPEDCENTRAL case
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumberpo
\setcoords(-180,-180,-180)(-635,-1060,-635)[0,-850]
\setunitbox(1250)[bl][r](1250)[tl]
\particleadjusty=-1290
\else \UNIMPERROR % etc.
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\SWgluon{
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumber
\ifcase\LINECONFIGURATION
\setcoords(-1300,-1300,-1300)(0,-900,-900)[-900,-900]
\setunitbox(2200)[br][bl](401)[t]
\particleadjustx=-1100     \particleadjusty=-1100
\or % \FLIPPED case
\setcoords(-215,-1115,-1115)(-1107,-1107,-1107)[-900,-900]
\setunitbox(2200)[tl][bl](401)[r]
\particleadjustx=-1120     \particleadjusty=-1120
\else \UNIMPERROR % FLIPPED FLATGLUON etc.
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\Wgluon{   % HORIZONTAL gluons
\ifcase\LINECONFIGURATION
\setcoords(-190,-790,-1390)(800,745,800)[-1050,0]
\setunitbox(1600)[bl][t](1600)[br]  
\particleadjustx=-150  %302
\or % \UNIMPERROR % \FLIPPED
\setcoords(-190,-790,-1390)(-800,-745,-800)[-1050,0]
\setunitbox(1600)[tl][b](1600)[tr]  
\particleadjustx=-150  %302
\or % \CURLYGLUON
\setcoords(-200,-625,-1050)(625,575,625)[-850,0]
\setunitbox(1250)[bl][t](1250)[br]  
\or % \FLIPPED case
\setcoords(-200,-625,-1050)(-625,-575,-625)[-850,0] 
\setunitbox(1250)[tl][b](1250)[tr]  
\or % \LCONFIG=4 is \FLATGLUON case
\setcoords(-230,-860,-1490)(830,780,830)[-1260,0]
\setunitbox(1660)[bl][t](1660)[br]  
\or % \UNIMPERROR
\setcoords(-230,-860,-1490)(-830,-780,-830)[-1260,0]
\setunitbox(1660)[tl][b](1660)[tr]
\or % \LCONFIG=6 is \CENTRALGLUON case
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumberpo
\setcoords(-825,-1250,-825)(0,-50,0)[-850,0]
\setunitbox(1250)[bl][t](1250)[br]  
\particleadjustx=-1250
\or  % \FLIPPEDCENTRALGLUON
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumberpo
\setcoords(-825,-1250,-825)(0,50,0)[-850,0] 
\setunitbox(1250)[tl][b](1250)[tr]  
\particleadjustx=-1250
\else \UNIMPERROR % FLIPPED FLATGLUON etc.
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\gdef\NWgluon{
\numupperunits=\unitboxnumberpo
\numlowerunits=\unitboxnumber
\numthirdunits=\unitboxnumber
\ifcase\LINECONFIGURATION
\setcoords(-200,-1100,-1100)(1100,1100,1100)[-900,900]
\setunitbox(2200)[bl][tl](401)[r]
\particleadjustx=-1110   \particleadjusty=1100
\or  % \FLIPPED
\setcoords(-1309,-1309,-1309)(-15,885,885)[-900,900]
\setunitbox(2200)[tr][tl](401)[b]
\particleadjustx=-1120   \particleadjusty=1065
\else \UNIMPERROR % FLIPPED FLATGLUON etc.
\fi
}
%
%                         *** GLUON LINKS AND CAPS ***
%
% 
\gdef\gluonlink{    %  A `RECURSIVE' DEFINITION.
\input gluonlinks   % \gluonlink is redefined here.
\gluonlink}  %  THIS RE-DEFINES \gluonlink FOR ALL FUTURE USES.
%
% 
\gdef\gluoncap{    %  A `RECURSIVE' DEFINITION.
\input gluonlinks   % \gluoncap is redefined here.
\gluoncap}  %  THIS RE-DEFINES \gluoncap FOR ALL FUTURE USES.
