Skip to content

Instantly share code, notes, and snippets.

@heitorPB
Last active December 13, 2018 16:33
Show Gist options
  • Save heitorPB/623c663cf44a6df180f84502e1874973 to your computer and use it in GitHub Desktop.
Save heitorPB/623c663cf44a6df180f84502e1874973 to your computer and use it in GitHub Desktop.
Diagram of steps in CMS analysis. opendata.cern.ch/docs/cms-mc-production-overview
\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{fit}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[nodes={draw, % General options for all nodes
line width=1pt,
anchor=center,
text centered,
rounded corners,
minimum width=1.5cm, minimum height=8mm},
]
% box styles
\tikzset{txt/.style={text width=1.5cm, anchor=center}};
\tikzset{txt2/.style={text width=1.8cm, anchor=center}};
\tikzset{txt3/.style={text width=2cm, anchor=center}};
\tikzset{txt4/.style={text width=2.2cm, anchor=center}};
\tikzset{TXT/.style={anchor=center}};
\tikzset{blue dotted/.style={draw=blue!50!white, line width=1pt, dash pattern=on 1pt off 4pt on 6pt off 4pt, inner sep=4mm, rectangle, rounded corners}};
\tikzset{dashes/.style={draw=black!37!white, line width=1pt, dash pattern=on 1pt off 4pt on 1pt off 4pt, inner sep=4mm, rectangle, rounded corners}};
\tikzset{empty/.style={draw=none}};
% gen step
\node[txt3] (pythia) {General purpose generator};
\node[TXT] (hadronization) [right=2 of pythia] {Hadronization};
\node[txt] (guns) [below=of pythia] {Particle guns};
\node[txt] (meGen) [right=0.8 of guns] {Matrix Element generator};
\node[txt] (lhe) [right=0.8 of meGen] {LHE};
\node[blue dotted, fit = (guns) (lhe) (hadronization)] (gen) {};
\node[empty] at (gen.north) [above, inner sep=3mm] {\textbf{GEN}};
\draw[->, ultra thick] (pythia) to (hadronization);
\draw[->, ultra thick] (guns) to [out=50, in=210] (hadronization);
\draw[->, ultra thick] (meGen) to (lhe);
\draw[->, ultra thick] (lhe) to [out=90, in=270] (hadronization);
% sim step
\node[txt2] (geant) [right=1.5 of hadronization] {Detector simulation};
\node[txt2] (digi) [right=of geant] {Digitization};
\node[txt2] (L1sim) [right=of digi] {L1 trigger simulation};
\node[txt] (digi2raw) [below=of L1sim] {Digi2raw};
\node[txt2] (HLTsim) [left=of digi2raw] {HLT simulation};
\node[txt2] (pileUp) [below=of geant] {Pile-up simulation};
\node[blue dotted, fit = (geant) (L1sim) (digi2raw)] (sim) {};
\node[empty] at (sim.north) [above, inner sep=3mm] {\textbf{SIM}};
\draw[->, ultra thick] (hadronization) -- (geant);
\draw[->, ultra thick] (geant) -- (digi);
\draw[->, ultra thick] (digi) -- (L1sim);
\draw[->, ultra thick] (L1sim) -- (digi2raw);
\draw[->, ultra thick] (digi2raw) -- (HLTsim);
\draw[->, ultra thick] (pileUp) to [out=60, in=270] (digi);
% data aquisition step
\node[txt] (protons) [below=1.5 of guns] {Beam Colisions};
\node[txt] (detector) [right=of protons] {Detectors};
\node[txt] (L1) [right=of detector] {L1 Trigger};
\node[txt] (HLT) [right=of L1] {High Level Trigger};
\node[blue dotted, fit = (protons) (detector) (HLT)] (data) {};
\node[empty] at (data.south) [below, inner sep=3mm] {\textbf{CMS Experiment}};
\draw[->, ultra thick] (protons) -- (detector);
\draw[->, ultra thick] (detector) -- (L1);
\draw[->, ultra thick] (L1) -- (HLT);
% reco step
\node[txt4] (reco1) [right=of HLT] {Event reconstruction};
\node[blue dotted, fit = (reco1)] (reco) {};
\node[empty] at (reco.south) [below, inner sep=3mm] {\textbf{RECO}};
\draw[->, ultra thick] (HLTsim) to [out=180, in=170] (reco1);
\draw[->, ultra thick] (HLT) to [out=0, in=180] (reco1);
% analysis step
\node[txt] (analysis) [right=of reco1] {Custom software};
\node[blue dotted, fit = (analysis)] (Analysis) {};
\node[empty] at (Analysis.south) [below, inner sep=3mm] {\textbf{Data Analysis}};
\draw[->, ultra thick] (reco1) -- (analysis);
% spaces to make diagram more pleasent for the eyes
\node[empty, minimum width=0.1cm] (void) [left=0.35 of pythia] {}; % left
%\node[empty, minimum width=0.1cm] (void) [right=0.3 of HLTsim] {}; % right
\end{tikzpicture}
\end{document}
# make tex into pdf
pdflatex cms-mc-production-overview-diagram.tex
# convert pdf to png
convert -verbose -density 300 -trim cms-mc-production-overview-diagram.pdf -quality 100 -flatten -sharpen 0x1.0 -transparent white diagram.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment