% Author: Izaak Neutelings (June 2017)
\documentclass{article}
\usepackage{amsmath} % for \text
\usepackage{tikz}
\tikzset{>=latex} % for LaTeX arrow head
\usetikzlibrary{patterns} % for hatches area

% colors
\definecolor{mylightred}{RGB}{255,200,200}
\definecolor{mylightblue}{RGB}{172,188,63}
\definecolor{mylightgreen}{RGB}{150,220,150}

% split figures into pages
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{1pt}%

\def\tick#1#2{\draw[thick] (#1) ++ (#2:0.015) --++ (#2-180:0.03)}
%\def\square#1#2{
%  \draw[thick,blue!80,fill=blue!40,line width=1.1]
%    (\ex+#1+\ey) rectangle ++(1-2*\ex,1-2*\ey)
%    node[black,midway,scale=0.8] {#2};
%}
%\def\rectangle#1#2#3{
%  \draw[thick,blue!80,fill=blue!40,line width=1.1]
%    (\ex+#1+\ey) rectangle ++(-2*\ex+#2-2*\ey)
%    node[black,midway,scale=0.8] {#3};
%}

\begin{document}


% ISOLATION REGIONS 1
\begin{tikzpicture}[scale=6]
  
  % define to change easily 
  \def\isolep{0.15}
  \def\isotau{0.30}
  \def\isotauM{0.10} % medium
  \def\isotauM{0.10} % loose
  \def\isoSB{0.50}
  \def\isomax{0.60}
  
  % axes
  \draw[->,thick]
    (0,0) -- (0,\isomax)
    node[at end,left=25pt,rotate=90] {Tight $\tau_h$ isolation $I_{\tau_h}$};
  \draw[->,thick]
    (0,0) -- (\isomax,0)
    node[at end,below=16pt,left] {Lepton $\ell$ isolation $I_\ell$};
  
  % boxes
  \draw[thick,fill=mylightgreen]
    (\isolep,\isotau) rectangle (\isoSB,\isoSB)
    node[anchor=north east] {SB};
  \draw[thick,fill=mylightred]
    (0,\isotau) rectangle (\isolep,\isoSB)
    node[anchor=north east] {SR};
  
  % labels
  \draw
    (0,\isotau/2) node[anchor=east]  {\scriptsize fail}
    (0,{\isotau+(\isoSB-\isotau)/2}) node[anchor=east]  {\scriptsize pass};
  \tick{0,\isotau}{0};
  \tick{\isolep,0}{90} node[below=-1] {\scriptsize$\isolep$};
  \tick{\isoSB,0}{90} node[below=-1] {\scriptsize$\isoSB$};
  
\end{tikzpicture}



% ISOLATION REGIONS 2
\begin{tikzpicture}[scale=6]
  
  % define to change easily 
  \def\isoe{0.15}
  \def\isomu{0.20}
  \def\isoSB{0.50}
  \def\isomax{0.60}
  
  % axes
  \draw[->,thick]
    (0,0) -- (0,\isomax)
    node[at end,left=24pt,rotate=90] {Muon isolation $I_\mu$};
  \draw[->,thick]
    (0,0) -- (\isomax,0)
    node[at end,below=16pt,left] {Electron isolation $I_\text{e}$};
  
  % boxes
  \draw[thick,fill=mylightgreen]
    (0,0) rectangle (\isoSB,\isoSB)
    %(0,\isomu) rectangle (\isoSB,\isoSB)
    node[anchor=north east] {isolation SB};
  \draw[thick,fill=mylightred]
    (0,0) rectangle (\isoe,\isomu)
    node[anchor=north east] {SR};
  
  % labels
  \tick{0,\isomu}{0} node[left=-2] {\scriptsize$\isomu$};
  \tick{0,\isoSB}{0} node[left=-2] {\scriptsize$\isoSB$};
  \tick{\isoe,0}{90} node[below=-1] {\scriptsize$\isoe$};
  \tick{\isoSB,0}{90} node[below=-1] {\scriptsize$\isoSB$};
  
\end{tikzpicture}



% CONTROL REGIONS 3
\begin{tikzpicture}[scale=4]
  
  \def\mx{0.45} %middle
  
  % boxes
  \fill [mylightred] % SR
    (0,0) rectangle (\mx,1);
  \fill [mylightgreen] % SB
    (\mx,0) rectangle (1,1);
  \draw[thick]
    (0,0) rectangle (1,1);
  
  % dashed lines
  \draw[dashed,thick]
    (\mx,-0.1) -- (\mx,1);
  \draw[dashed,thick]
    (-0.1,0.5) -- (1,0.5);
  
  % labels
  \draw
    (0,0.75) node[anchor=east]  {OS}
    (0,0.25) node[anchor=east]  {SS}
    (\mx/2,0) node[anchor=north] {SR}
    (0.5+\mx/2,0) node[anchor=north] {SB}
    (0,0.50) node[rotate=90,above=16pt] {Lepton charges}
    (0.50,0) node[below=10pt] {Lepton isolations};
  \node[align=center,scale=1,inner sep=3] (SB) at (\mx/2,0.25) {QCD\\\small shape};
  \node[align=center,scale=1,inner sep=3] (SR) at (\mx/2,0.75) {QCD};
  
  % arrows
  \draw[->,thick] % SB: SS -> OS
    (SB) -- (SR);
  \draw[->,thick] % SB: SS -> OS
    (1.2*\mx,0.38) --++ (0,0.3)
    node[pos=0.8,right=-1,scale=1.2]{$\left(\frac{\text{OS}}{\text{SS}}\right)^\text{\tiny SB}_\text{\tiny data}$};
  
\end{tikzpicture}



% CONTROL REGIONS 4
\begin{tikzpicture}[scale=4]
  
  \def\mx{0.45} %middle
  
  % boxes
  \fill [mylightred] % SR
    (0,0) rectangle (\mx,1);
  \fill [mylightgreen] % SB
    (\mx,0) rectangle (1,1);
  \draw[thick]
    (0,0) rectangle (1,1);
  
  % dashed lines
  \draw[dashed,thick]
    (\mx,-0.1) -- (\mx,1);
  \draw[dashed,thick]
    (-0.1,0.5) -- (1,0.5);
  
  % labels
  \draw
    (0,0.75) node[anchor=east]  {OS}
    (0,0.25) node[anchor=east]  {SS}
    (\mx/2,0) node[anchor=north] {SR}
    (0.5+\mx/2,0) node[anchor=north] {SB}
    (0,0.50) node[rotate=90,above=16pt] {Lepton charges}
    (0.50,0) node[below=10pt] {Lepton isolations};
  \draw
    (\mx/2,0.78) node {QCD}
    (0.5+\mx/2,0.25) node[align=center] {QCD\\shape} %{$\text{QCD}^\text{SS,SB}_\text{data}$};
    (\mx/2,0.25) node[align=center,scale=0.80] {QCD\\\small normalization};
  
  % arrows
  \draw[->,thick] % SR: SS -> OS
    (\mx+0.1,0.30) -- (\mx-0.1,0.30);
    %node[midway,above=8pt,right=-2pt,scale=0.70]{};
  \draw[->,thick] % SB: SS -> OS
    (0.95,0.35) -- (0.95,0.7)
    node[midway,above=8pt,left=-2pt,scale=0.70]{$\left(\frac{\text{OS}}{\text{SS}}\right)^\text{\tiny SB}_\text{\tiny data}$};
  
  \begin{scope}[shift={(\mx+0.02,0.54)},scale=0.35]
    \draw[->,thick]
      (0.40,-0.5) -- (-0.45,0.5);
      %node[midway,above=5pt,right=0pt,scale=0.8]{ $F^{\tiny \text{e}\mu}_\text{\tiny sim}$};
  \end{scope}
  
\end{tikzpicture}



\end{document}