2

I want to draw a Feynman Diagram, for this I have written this code.

\documentclass[a4paper,12pt, border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations, decorations.markings, decorations.pathmorphing, arrows, graphs, graphdrawing, shapes.geometric, snakes}
\usegdlibrary{trees,force, layered}

\pgfdeclaredecoration{complete sines}{initial}
{
    \state{initial}[
        width=+0pt,
        next state=sine,
        persistent precomputation={\pgfmathsetmacro\matchinglength{
            \pgfdecoratedinputsegmentlength / int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)}
            \setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
        }] {}
    \state{sine}[width=\pgfdecorationsegmentlength]{
        \pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
        \pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
        \pgfpathsine{\pgfpoint{0.25\pgfdecorationsegmentlength}{-0.5\pgfdecorationsegmentamplitude}}
        \pgfpathcosine{\pgfpoint{0.25\pgfdecorationsegmentlength}{0.5\pgfdecorationsegmentamplitude}}
}
    \state{final}{}
}

\tikzset{
    photon/.style={
        decoration={complete sines, amplitude=0.15cm, segment length=0.2cm},
        decorate    
    },
    fermion/.style={
        decoration={
            markings,
            mark=at position 0.5 with {\node[transform shape, xshift=-0.5mm, fill=black, inner sep=1pt, draw, isosceles triangle]{};}
        },
        postaction=decorate
    },
    gluon/.style={
        decoration={coil, aspect=0.75, mirror, segment length=1.5mm},
        decorate
    }, 
    left/.style={
        bend left=90,
        looseness=1.75
    }
}

\begin{document}%
\begin{tikzpicture}
\graph [spring layout, anchor at={(0,-4)}, nodes=coordinate, vertical= a to d, vertical= e to f]
{
a -- [fermion, edge label={\tiny{$\nu_{\mu/\tau}$}}] b,
c -- [fermion, edge label={{\tiny{$\nu_{\mu/\tau}$}}}] a,
a -- [photon, edge label={\tiny{$Z'$}}] d -- [left, fermion, edge label={\tiny{$\mu^-/\tau^-$}}] e -- [left, fermion, edge label={\tiny{$\mu^-/\tau^-$}}] d,
e -- [photon, edge label={\tiny{$\gamma$}}] f,
g-- [fermion, edge label={\tiny{$p$}}] f,
f -- [fermion, edge label={\tiny{$p$}}] h;
};

\end{tikzpicture}
\end{document}

Output is:

enter image description here

But the labeling is looking not so good, especially the $\nu_{\mu/\tau}$ (It would be better if the labeling of $\nu_{\mu/\tau}$ fermion line is looking like the labeling of $p$ line). Also the text size of the labeling is very big.

Can anyone please help me to resolve these problems?

2

1 Answer 1

1

Here's a simplified version for the scatter-event, which started with the simplified spring layout:

\feynmandiagram [vertical = c to f] {
    {a,b} -- c -- d -- e -- f -- {g,h};
}

In the left screenshot I marked the points in your drawing. The right one is produced by the code below.

For now it just drops the arrows for simplicity. You could work them in by splitting up the structure, e.g. like I did with the missing half arc. Looks like one shouldn't take the terms (fermion, boson etc.) too literally and use them more to obtain the desired drawing. That's why I used "fermions" for the lepton-circle.

CODED

\documentclass[10pt, border=10pt]{standalone}

\usepackage{tikz-feynman}

\begin{document}

\feynmandiagram [vertical = c to f] {
%   {a,b} -- c -- d -- e -- f -- {g,h}; % basic structure

    {   a [particle=\(\nu_\mu / \tau\)] ,% R
        b [particle=\(\nu_\mu / \tau\)] % L
    }
    -- c 
    -- [boson, edge label=\(Z^{'}\)] d 
    -- [fermion, half left, edge label=\(\mu^{-}/\tau^{-}\)] e 
    -- [photon, edge label=\(\gamma\)] f 
    -- {g [particle=\(p\)],h [particle=\(p\)]};
    
    % adding the missing half-loop
    e -- [fermion, half left, edge label=\(\mu^{-}/\tau^{-}\)] d;
};


\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .