Lead nucleus & Pb-Pb collisions

Nucleus of a (lead) isotope:PbPb_collisions-001.pngLead-lead (PbPb) collisions at the LHC with electromagnetic fields (note Lorentz-contraction):PbPb_collisions-002.png

Main idea

At first I tried randomly assigning an angle and radius (sampling sqrt((rand+1)/2) for uniform distribution along the radius):Pb_nucleus-001.pngThis did not fill up so evenly as I wanted, so I tried to generate the nucleons uniformly on ring layers using polar coordinates:Pb_nucleus-002.pngAdding a bit of random offsets to the angle and radius in the polar coordinate:Pb_nucleus-003.pngRandomly shuffling the nucleons along the rings so the overlap of consecutive balls is not regular, and the even/odd coloring looks more random:Pb_nucleus-004.pngThe rings have constant distance between them because each ring's radius is set with a simple linear equation of the form r=R*i/N. To make the nucleus look more like a 3D sphere, we can gradually pull the outers rings closer together by reducing the ring radius quadratically: r'=r-C*r^2 for some tunable parameter C ~ 0.2:Pb_nucleus-005.png
% Author: Izaak Neutelings (March 2024)
% Description: Lead-lead collisions
\documentclass[border=3pt,tikz]{standalone}
\usepackage{amsmath}
\usepackage{listofitems} % to create arrays with \readlist
\usepackage{ifthen} % for \whiledo
%\usetikzlibrary{arrows.meta} % for arrow size

% COLORS
\colorlet{myred}{red!75!black}
\colorlet{myblue}{blue!70!black}

% STYLES
\tikzset{
  >=latex, % for LaTeX arrow head
  ball/.style={ultra thin,draw=black,fill=\getcol{#1},
               circle,inner sep=1pt,minimum size=15pt,scale=0.8},
  ball/.default=1,
}
\def\getcol#1{\ifodd#1 blue!20 \else red!20 \fi}
\def\drawgrid#1{
  \pgfmathsetmacro\xmax{ceil(#1)+0.6}
  \pgfmathsetmacro\xmin{0.3-\xmax}
  \draw[black!20] (\xmin,\xmin) grid (\xmax,\xmax);
  \draw[thick,->] (\xmin,0) -- (\xmax,0);
  \draw[thick,->] (0,\xmin) -- (0,\xmax);
  \draw[black!20] (0,0) circle(#1);
}

\begin{document}


% NUCLEUS - random radius & angle
\def\R{2.0}
\def\Nlay{5} % number of rings/layers
\def\N{100}
\begin{tikzpicture}
  \drawgrid{\R}
  
  % NUCLEUS
  \foreach \i [evaluate={
    \r=\R*sqrt((rand+1)/2); % ball radius
    \a=180*rand % ball angle
  }] in {1,...,\N}{
    \node[ball=\i] at (\a:\r) {\i};
  }
  
\end{tikzpicture}


% NUCLEUS - uniform rings
\begin{tikzpicture}
  \message{^^JNucleus with uniform rings}
  \drawgrid{\R}
  
  % NUCLEUS
  \foreach \lay [evaluate={
    \r=\R*\lay/\Nlay; % ring radius
    \Nring=int(round(2*\lay*\N/(\Nlay*(\Nlay+1)))) % number of balls per ring
  }] in {\Nlay,...,1}{
    \message{^^J N=\N, Nlay=\Nlay, Nring=\Nring, r=\r}
    \foreach \i [evaluate={
      \a=360*(\i/\Nring); % ball angle
    }] in {1,...,\Nring}{
      \node[ball=\i] at (\a:\r) {\i};
    }
  }
  
\end{tikzpicture}


% NUCLEUS - uniform rings + random offset
\begin{tikzpicture}
  \message{^^JNucleus with uniform rings + random offset}
  %\def\R{1.8}
  \drawgrid{\R}
  
  % NUCLEUS
  \foreach \lay [evaluate={
    \r=\R*(\lay-0.1)/\Nlay; % ring radius
    \aR=3*rand; % angular offset
    \Nring=int(round(2*\lay*\N/(\Nlay*(\Nlay+1)))) % number of balls per ring
  }] in {\Nlay,...,1}{
    \message{^^J N=\N, Nlay=\Nlay, Nring=\Nring, r=\r}
    \foreach \i [evaluate={
      \aB=\aR+360*(\i/\Nring)+2*rand/\Nring; % ball angle plus random offset
      \rB=\r+0.04*rand % ball radius plus random radial offset
    }] in {1,...,\Nring}{
      \node[ball=\i] at (\aB:\rB) {\i};
      %\fill[red] ({\aR+360*(\i/\Nring)}:\r) circle(0.5pt);
    }
  }
  
\end{tikzpicture}


% NUCLEUS - shuffle balls
\def\shufflelist#1{
  %\message{^^JShuffle list}
  \pgfmathsetmacro\tmplist{random(1,#1)} % first random item
  \readlist*\shuffledlist\tmplist % convert to array
  \newboolean{unique}
  \whiledo{\shuffledlistlen<#1}{ % try until list is of length \N=#1
    \pgfmathsetmacro\rx{random(1,#1)} % generate new random item
    \setboolean{unique}{true}
    \foreachitem \x \in \shuffledlist{ % loop over previous elements
      \ifnum \x=\rx % look if new number in list
        \setboolean{unique}{false} % already in list
        \breakforeach
      \fi
    }
    \ifthenelse{\boolean{unique}}{ % found unique item !
      \xdef\tmplist{\tmplist,\rx} % add new unique item
      \readlist*\shuffledlist\tmplist % convert to array
    }{}
  }
}
\begin{tikzpicture}[xscale=1]
  \message{^^JNucleus with shuffling balls}
  %\def\R{1.8}
  \drawgrid{\R}
  \pgfmathsetseed{1234567890}
  
  % NUCLEUS
  \foreach \lay [evaluate={
    \r=\R*(\lay-0.1)/\Nlay; % ring radius
    \aR=3*rand; % angular offset
    \Nring=int(round(2*\lay*\N/(\Nlay*(\Nlay+1)))) % number of balls per ring
  }] in {\Nlay,...,1}{
    \message{^^J N=\N, Nlay=\Nlay, Nring=\Nring, r=\r}
    \shufflelist{\Nring} % get shuffled list of sequence 1,...,\Nring
    \foreach \i [evaluate={
      \is=int(\shuffledlist[\i]); % shuffled index
      \aB=\aR+360*(\is/\Nring)+2*rand/\Nring; % ball angle plus random offset
      \rB=\r+0.04*rand % ball radius plus random radial offset
    }] in {1,...,\Nring}{
      \message{^^J is=\is, i=\i, a=\aB}
      \node[ball=\i] at (\aB:\rB) {\i};
      %\fill[red] ({\aR+360*(\i/\Nring)}:\r) circle(0.5pt);
    }
  }
  \node[ball=\i] at (0,0) {0}; % cover hole
  
\end{tikzpicture}


% NUCLEUS - 3D effect
\begin{tikzpicture}[xscale=1]
  \message{^^JNucleus with 3D effect}
  %\def\R{1.8}
  \drawgrid{\R}
  \pgfmathsetseed{1234567890}
  
  % NUCLEUS
  \pgfmathsetmacro\C{min(1/(4*\R),0.11)} % put balls at edges closer in to create 3D ball effect
  \pgfmathsetmacro\D{1-4*\C*\R} % discriminant
  \message{^^J R=\R, C=\C, D=1-4cR=\D (must be >0)}
  \pgfmathsetmacro\Rs{2*\R/(1+sqrt(\D)} % scaled total radius
  \foreach \lay [evaluate={
    \r=\Rs*(\lay-0.1)/\Nlay; % ring radius
    \rC=\r-\C*\r*\r; % reduce outer radii to create 3D effect
    \aR=3*rand; % angular offset
    \Nring=int(round(2*\rC*\N/(\Rs*(\Nlay+1)*(1-\C*\Rs*(2*\Nlay+1)/(3*\Nlay))))) % number of balls on this ring
  }] in {\Nlay,...,1}{
    \message{^^J N=\N, Nlay=\Nlay, Nring=\Nring, r=\r}
    \shufflelist{\Nring} % get shuffled list of sequence 1,...,\Nring
    \foreach \i [evaluate={
      \is=int(\shuffledlist[\i]); % shuffled index
      \aB=\aR+360*(\is/\Nring)+2*rand/\Nring; % ball angle plus random offset
      \rB=\rC+0.05*rand % ball radius plus random radial offset
    }] in {1,...,\Nring}{
      \message{^^J is=\is, i=\i, a=\aB}
      \node[ball=\i] at (\aB:\rB) {\i};
      %\fill[red] ({\aR+360*(\i/\Nring)}:\r) circle(0.5pt);
    }
  }
  \node[ball=\i] at (0,0) {0}; % cover hole
  
\end{tikzpicture}


\end{document}

Full code

Edit and compile if you like:

% Author: Izaak Neutelings (March 2024)
% Description: Lead-lead collisions
% Inspiration: https://arxiv.org/abs/2010.07855
\documentclass[border=3pt,tikz]{standalone}
\usepackage{listofitems} % to create arrays with \readlist
\usepackage{ifthen} % for \whiledo
\usetikzlibrary{decorations.pathmorphing} % for snake, coil, zigzag

% COLORS
\colorlet{protoncol}{red!68!black!80}
\colorlet{neutroncol}{green!68!black!80}
\colorlet{photoncol}{yellow!85!orange!95!black}

% STYLES
\tikzset{
  >=latex, % for LaTeX arrow head
  vector/.style={->,thick,green!60!black},
  photon/.style={->,line width=0.7,line cap=round,photoncol,decorate,decoration={
    snake,amplitude=.4mm,segment length=2.2mm,post length=1.5mm}
  },
  ball/.style={
    circle,draw=none,ball color=#1,postaction={
    fill=#1,fill opacity=0.6,draw=#1!40!black,line width=0.04}
  },
  ball/.default=protroncol,
  pics/nucleus/.style={%
    code={%
      \fill[protoncol] (0,0) circle(0.88*\R); % background to fill any holes
      \pgfmathsetmacro\Rball{0.2*\R} % ball radius
      \pgfmathsetmacro\C{min(1/(4*\R),0.24)} % put balls at edges closer in to create 3D ball effect
      \pgfmathsetmacro\D{1-4*\C*\R} % discriminant
      \pgfmathsetmacro\Rs{2*\R/(1+sqrt(\D)} % scaled total radius
      \message{^^J R=\R, Rs=\Rs, C=\C, D=1-4cR=\D (must be >0)}
      \foreach \lay [evaluate={
        \r=\Rs*(\lay-0.05)/\Nlay; % ring radius
        \rC=\r-\C*\r*\r; % reduce outer radii to create 3D effect
        \aR=3*rand; % random angular offset
        \Nring=int(round(2*\rC*\N/(\Rs*(\Nlay+1)*(1-\C*\Rs*(2*\Nlay+1)/(3*\Nlay))))) % number of balls on this ring
      }] in {\Nlay,...,1}{
        \message{^^J N=\N, Nlay=\Nlay, Nring=\Nring, r=\r}
        \shufflelist{\Nring} % get shuffled list of sequence 1,...,\Nring
        \foreach \i [evaluate={
          \p=(rand+1)/2<0.39?1:0; % 0: neutron, 1: proton
          \is=int(\shuffledlist[\i]); % shuffled index
          \aB=\aR+360*(\is/\Nring)+2*rand/\Nring; % ball angle plus random offset
          \rB=\rC+0.04*rand % ball radius plus random radial offset
        }] in {1,...,\Nring}{
          %\message{^^J is=\is, i=\i, a=\aB, p=\p}
          \fill[ball=\ifodd\p protoncol\else neutroncol\fi]
            (\aB:\rB) circle(\Rball);
        }
      }
      \fill[ball=protoncol] (0,0) circle(\Rball);
      \foreach \ang in {0,60,90,120,180,-60,-90,-120}{
        \coordinate (-\ang) at (\ang:\R+1.3*\Rball);
      }
      %\coordinate (-west) at (\R+\Rball,0); % define coordinate
      %\coordinate (-east) at (-\R-\Rball,0);
    }
  }
}
\def\shufflelist#1{ % get shuffled list of sequence 1,...,#1
  %\message{^^JShuffle list}
  \pgfmathsetmacro\tmplist{random(1,#1)} % first random item
  \readlist*\shuffledlist\tmplist % convert to array
  \newboolean{unique}
  \whiledo{\shuffledlistlen<#1}{ % try until list is of length = #1
    \pgfmathsetmacro\rx{random(1,#1)} % generate new random item
    \setboolean{unique}{true}
    \foreachitem \x \in \shuffledlist{ % loop over previous elements
      \ifnum \x=\rx % look if new number in list
        \setboolean{unique}{false} % already in list
        \breakforeach % stop looking and try again in next iteration
      \fi
    }
    \ifthenelse{\boolean{unique}}{ % found unique item !
      \xdef\tmplist{\tmplist,\rx} % add new unique item
      \readlist*\shuffledlist\tmplist % convert to array
    }{}
  }
}

\begin{document}


% Pb nuclus
\def\N{85} % number of nucleons
\def\R{1.0} % nucleus radius
\def\Nlay{5} % number of rings/layers
\begin{tikzpicture}
  
  % NUCLEUS
  \pic {nucleus};
  
\end{tikzpicture}


% Pb-Pb collision
\begin{tikzpicture}
  \def\N{80} % number of nucleons
  \def\R{1.0} % nucleus radius
  \def\Nlay{4} % number of rings/layers
  \def\xs{0.3} % horizontally scale
  \def\Rp{0.92} % length photon
  \def\D{3.7} % horizontal distance between nuclei
  \pgfmathsetmacro\L{2.10*\R} % vertical distance between nuclei
  \pgfmathsetmacro\v{0.25*\D} % length vector
  
  % NUCLEUS
  \pic[xscale=\xs] (L) at (0,\L/2) {nucleus};
  \pic[xscale=\xs] (R) at (3.8,-\L/2) {nucleus};
  
  % VELOCITY VECTORS
  \draw[vector] (L-0)++(0.1,0) --++ (\v,0) node[above] {$v\approx c$};
  \draw[vector] (R-180)++(-0.1,0) --++ (-\v,0) node[above] {$v\approx c$};
  
  % PHOTONS
  \foreach \ang in {60,90,120,-60,-90,-120}{
    \draw[photon] (L-\ang) --++ (\ang:\Rp);
    \draw[photon] (R-\ang) --++ (\ang:\Rp);
  }
  
\end{tikzpicture}


\end{document}

Click to download: PbPb_collisions.texPbPb_collisions.pdf
Open in Overleaf: PbPb_collisions.tex

Leave a Reply

Your email address will not be published.