In this question I asked how to use the argument of a new sectioning level defined with the titlesec pkg as header. Now repeating the same code I'd like to ask how can I use the argument of \part command as header. It seemed easier, and I looked into titlesec documentation and there was a hint but I couldn't understand how to use it.
\documentclass[b5paper,twoside]{book}
\usepackage{geometry}
\usepackage{titletoc}
\usepackage[rm,small,center,compact,newparttoc,clearempty,pagestyles]{titlesec}
\usepackage{kantlipsum}
\titleclass{\subpart}{page}[\part]
\newcounter{subpart}
\renewcommand{\thesubpart}{\Alph{subpart}}
\newcommand{\subpartname}{Subpart}
\titleformat{\subpart}[display]{\centering\normalfont\Large\bfseries}%
{\subpartname~\thesubpart}{1pc}{\Huge\bfseries}
\titlespacing{\subpart}{0pt}{0pt}{0pt}
\titlecontents{subpart}[0pt]{\addvspace{1pc}\normalfont\bfseries}%
{\thecontentslabel\enspace ---\enspace\large}%
{\normalfont\large\bfseries}{\hspace{2em plus 1fill}\large\contentspage}
\setcounter{secnumdepth}{-2}
\newpagestyle{main}{
\sethead[][\chaptertitle][]
{}{\parttitle}{} % Problem: Here I want to have part title.
\setfoot[][\thepage][]
{}{\thepage}{}}
\pagestyle{main}
\newpagestyle{preface}{
\sethead[][\chaptertitle][]
{}{\parttitle}{}
\setfoot[][\thepage][]
{}{\thepage}{}}
\pagestyle{empty}
\assignpagestyle{\part}{empty}
\assignpagestyle{\subpart}{empty}
\assignpagestyle{\chapter}{empty}
\settitlemarks{part,chapter}
\begin{document}\frontmatter
\pagestyle{empty}
\chapter[Preface]{PREFACE}
\pagestyle{preface}
\kant[1-20]
\part{History}
\subpart{Primitive Historians}
\pagestyle{main}
\chapter{The Formation of the Concept of History}
\kant[1-20]
\end{document}


\partnameand\thepart?{\normalfont\huge\bfseries\filcenter}{\partname\ \ \thepart}{22pt}{\Huge}– nima Jun 06 '16 at 13:26\ \ \thepartjust introduce two space characters before the part number.\stands forspace character– Jun 06 '16 at 14:56