\documentclass[tikz]{standalone}
\usepackage{amsmath}
\usetikzlibrary{calc}
\usetikzlibrary{backgrounds}

\input{.common.tex}

\begin{document}


\begin{tikzpicture}[x=0.4cm,y=0.4cm]
    \node (M0) at (0,0) {};
    \node[below=of M0] (W0) {};
    \node[below=of W0] (m0) {};
    \foreach \i in {0,...,2} {
        \pgfmathsetmacro{\j}{int(\i+1)}
        \node[right=of M\i] (M\j) {}; % $M^{[\the\numexpr\i+1]}$
        \node[right=of W\i] (W\j) {}; % $W^{[\the\numexpr\i+1]}$
        \node[right=of m\i] (m\j) {}; % $m^{[\the\numexpr\i+1]}$
        % horizontal
    }
    % \pgfmathsetmacro{\dx}{0.3*\nodeDistance}
    % \pgfmathsetmacro{\dy}{0.3*\nodeDistance}
    \def\dx{0.4}
    \def\dy{0.4}

    % \node[draw, dashed, rounded corners=5pt, fit=(M0) (M2) (m0) (m2)] (group) {};
    \begin{scope}[on background layer]
      \draw[fill=\colorHeff,rounded corners=2] 
        ($(M0)+(-\dx, \dy)$) --
        ($(M2)+( \dx, \dy)$) --
        ($(m2)+( \dx,-\dy)$) --
        ($(m0)+(-\dx,-\dy)$) --
        cycle;

      \draw[fill=\colorTheta,rounded corners=2pt] 
        ($(M3)+(-\dx, \dy)$) -- 
        ($(M3)+( \dx, \dy)$) -- 
        ($(m3)+( \dx,-\dy)$) -- 
        ($(m3)+(-\dx,-\dy)$) -- 
        cycle;

      % \draw[fill=\colorTheta,rounded corners=2pt] 
      %   ($(M3)+(-\dx, \dy)$) -- 
      %   ($(M3)+( \dx, \dy)$) -- 
      %   ($(m3)+( \dx,-\dy)$) -- 
      %   ($(m3)+(-\dx,-\dy)$) -- 
      %   cycle;
    \end{scope}
    % \draw node[above left=of M0] {} -- node[above right=of M2] {} -- node[above right=of W2] {};

    \node[above=0.1 of M1] (Heff) {$H_\text{eff}$};
    \node[above=0.1 of M3] (Theta) {$\Theta$};
\end{tikzpicture}

\end{document}
