\section{Acceptance effects}\label{sec:Accept}

An accurate measurement of the angular distribution of the \BuToKstmm decay in different \qsq regions requires a correction of the acceptance effects. The non-flat angular acceptance is given by the geometry of the \lhcb detector and by the event selection. A dedicated simulation sample is used to ascertain this effect. In this simulation sample, the events are generated with a pure phase-space (PHSP) coupling in the decay chain. Therefore, this set of simulated events is  per construction generated with flat distributions in the 4D space of \angles and \qsq. %I will not mention that we have to correct extra for q2, leave this to the ana note

The PHSP simulation sample is used to validate that the event selection does not strongly bias the \angles distributions. Then, the PHSP simulation is corrected to match the data in the same way as described in \refSec{sel-SimulationCorrection}. Last step is the 4D-parametrization of  \angles and \qsq distributions, resulting in weights applied to the data.


\subsection{Simulation with homogeneous phase-space distribution}\label{sec:Accept-PHSP}

In order to precisely describe the acceptance, a PHSP simulation sample is generated for each data-taking year. The number of events passing the event selection are summarized in \refTab{PHSP_events}. 


The trigger, central and cut-based selections are heavily influenced by the detector geometry. A dedicated cross-check is done to verify the multi-variate selection does not depend on the decay angles. This is validated by establishing the efficiency of the MLP $\varepsilon_{MLP}$ in a same way as described in \refSec{sel-Efficiency}. 

The MLP efficiency $\varepsilon_{MLP}$ in dependence on \qsq, \ctk, \ctl and $\phi$ is shown in \refFig{eff_MLP_angles}. In the top row,  $\varepsilon_{MLP} =  \varepsilon_{MLP}(\qsq)$ is shown. Careful reader will notice a small dip at $\sim3\gevgev$. This is purely caused by the detectors acceptance, similarly to the \emph{roof}-like trend in  $\varepsilon_{MLP} =  \varepsilon_{MLP}(\ctl)$. A large effect is visible in the MLP efficiency in the very-high \ctk region. As \ctk is proportional to the asymmetry between the momentum of \Kstarp meson decay  products $\frac{p_{\Kp}-p_{\piz}}{p_{\Kp}+p_{\piz}}\simeq \ctk$, events with very low \piz momentum are more affected by background contributions and hence the efficiency drops at \ctk$\sim1$. %The MLP efficiency dependent on \ctl and $\phi$ is flat.


\begin{table}[hbt!]
	\centering
	\begin{tabular}{p{2cm}|cccccc}
		year 	& 2011	& 2012	& 2015	& 2016	& 2017	& 2018 \\ \hline
		events	& 6965	& 15836	& 8431	& 28631	& 31589	& 36307\\
	\end{tabular}	
	\captionof{table}[Number of PHSP signal candidates passing the full selection.]{Number of PHSP signal candidates passing the full selection. For the number of generated PHSP events, see \refTab{ANA-MCsamples}. \label{tab:PHSP_events}} %\runI: 23403, \runII: 112584
\end{table}


\begin{figure}[hbt!] \vspace{-10pt}
	\centering
	\includegraphics[width=0.43\textwidth]{./Data/Efficiencies/TMVA/PHSP/Run1/KplusPi0Resolved_PHSP_IDTM_rndGamma_weighted_BDT_AloneOnly_Efficiency_Run1_q2_binned.eps}
	\includegraphics[width=0.43\textwidth]{./Data/Efficiencies/TMVA/PHSP/Run2/KplusPi0Resolved_PHSP_IDTM_rndGamma_weighted_BDT_AloneOnly_Efficiency_Run2_q2_binned.eps}
	\includegraphics[width=0.43\textwidth]{./Data/Efficiencies/TMVA/PHSP/Run1/KplusPi0Resolved_PHSP_IDTM_rndGamma_weighted_BDT_AloneOnly_Efficiency_Run1_phi.eps}
	\includegraphics[width=0.43\textwidth]{./Data/Efficiencies/TMVA/PHSP/Run2/KplusPi0Resolved_PHSP_IDTM_rndGamma_weighted_BDT_AloneOnly_Efficiency_Run2_phi.eps}
	\includegraphics[width=0.43\textwidth]{./Data/Efficiencies/TMVA/PHSP/Run1/KplusPi0Resolved_PHSP_IDTM_rndGamma_weighted_BDT_AloneOnly_Efficiency_Run1_thetak_equal.eps}
	\includegraphics[width=0.43\textwidth]{./Data/Efficiencies/TMVA/PHSP/Run2/KplusPi0Resolved_PHSP_IDTM_rndGamma_weighted_BDT_AloneOnly_Efficiency_Run2_thetak_equal.eps}
	\includegraphics[width=0.43\textwidth]{./Data/Efficiencies/TMVA/PHSP/Run1/KplusPi0Resolved_PHSP_IDTM_rndGamma_weighted_BDT_AloneOnly_Efficiency_Run1_thetal_equal.eps}
	\includegraphics[width=0.43\textwidth]{./Data/Efficiencies/TMVA/PHSP/Run2/KplusPi0Resolved_PHSP_IDTM_rndGamma_weighted_BDT_AloneOnly_Efficiency_Run2_thetal_equal.eps}
	\captionof{figure}[MLP efficiency versus \angleDist and \qsq from PHSP simulation.]{MLP efficiency per Run obtained from PHSP simulation sample  as a function of  \angleDist and \qsq. The dip of $\varepsilon_{MLP}$ at $\ctk\sim1$ is caused by events with very low neutral pion momentum $p_\piz$.\label{fig:eff_MLP_angles}}
\end{figure}

\clearpage

\subsection{Parametrization of the angular acceptance}\label{sec:Accept-parametrizaiton}

In order to obtain the correction weights, the PHSP sample, flat in \angles and \qsq, are parametrized using a Legendre polynomial~\cite{FIT-legendre}. As the four observables do not factorize, the polynomial takes the form of 
%
\begin{equation}\label{eq:legendre_eff}
	\epsilon(\ctl, \ctk, \phi, \qsq)  = \sum_{l,m,n,o} c_{lmno} \times P_l(\qsq) \times P_m(\ctl) \times P_n(\ctk) \times P_o(\phi)  \,,
\end{equation}
%
%\begin{align}\label{eq:legendre_eff}
%	\epsilon(\ctl, \ctk, \phi, \qsq) & = \sum_{l,m,n,o} c_{lmno} \times P_l(\qsq) \times P_m(\ctl) \times P_n(\ctk) \times P_o(\phi) \\
%									 & = \sum_{h,i,j,k} c_{hijk} \times \left(\qsq\right)^h \times \left( \ctl \right)^i \times \left( \ctk \right)^j \times \left( \phi \right)^k \,,
%\end{align}
%
where $P_{l,m,n,o}$ are Legendre polynomials of orders $l, m, n$ and $o$. The maximal order of the polynomial is chosen in a way that the polynomial describes the acceptance well while preventing picking-up statistical fluctuations in the PHSP simulation sample. Moreover, the parametrization in $\phi$ is forced to be symmetric. The possible asymmetry in the $\phi$ distribution is smeared out by integrating over \Bu and \Bub meson decays as well as the reversal of polarity of the bending magnet. 


The parametrization is obtained individually for each Run.  The maximal order of the polynomial is optimized using a \chisq-goodness of the parametrization (see \refFig{app_chisq}) and visual inspection of the projections (see \refFig{angProj_Run1}, \refFig{angProj_Run2} and \refApp{AngCorr}). It is clear from \refFig{app_chisq} that there is no clear best maximal order of the polynomial. This should be taken into account as a systematic uncertainty and it is discussed later in \refSec{toy-sig}. The order of the Legendre polynomial describing the PHSP simulation sample well is found to be six in \ctk, three in \ctl, flat in $\phi$ and seven in \qsq. The higher order of the \ctk polynomial is caused by the very low acceptance in the high \ctk region arising from the high background contribution in the low \piz momentum region.  The acceptance at very high \ctk is essentially zero. This leads to huge weights destabilizing the angular fit later on. For this reason, the \ctk range is limited to $[-1.0,0.8]$. The \ctk range is further limited in the case of applying folding 4 defined in \refSec{ANA_folding}: in order to be able to fold in the \ctk dimension, only candidates with \ctk$\in[-0.8,0.8]$ are considered.



The final form of the Legendre polynomial takes the form of 
\begin{equation}\label{eq:legendre_eff_final}
	\epsilon(\ctk, \ctl, \phi, \qsq)  = \sum_{l=1}^6\sum_{m=1}^3\sum_{o=1}^7 c_{lmno} \times P_l(\ctk) \times P_m(\ctl) \times P_1(\phi) \times P_o(\qsq) \,.
\end{equation}

Finally, in order to correct the data for the angular acceptance, each event is weighted with the weight $w$
\begin{equation}\label{eq:angularAcc_weight}	
w(\ctl, \ctk, \phi, \qsq) = \frac{1}{\epsilon(\ctl, \ctk, \phi, \qsq)}\,.
\end{equation}


\begin{figure}[hbt!]
	\centering
	\includegraphics[width=0.48\textwidth]{./Angular/scan/ScanChi2MaxOrderPolynomRun1.eps}
	\includegraphics[width=0.48\textwidth]{./Angular/scan/ScanChi2MaxOrderPolynomRun2.eps}
	\captionof{figure}[Angular acceptance parametrization \chisq-goodness scan.]{Angular acceptance parametrization \chisq-goodness scan for \runI (left) and \runII (right). The numbers on the axis correspond to the applied order of the Legendre polynomial for the given variables. Note that the \chisq values for each of the parametrization are very close to each other: there is no preference of the order of the polynomial in the orders considered here. \label{fig:app_chisq}}
\end{figure}

\begin{figure}[hbt!]
	\centering
	\includegraphics[width=0.45\textwidth]{./Angular/projections/ctkeff_KplusPi0Resolved_Run1.eps}
	\includegraphics[width=0.45\textwidth]{./Angular/projections/ctleff_KplusPi0Resolved_Run1.eps}\\
	\includegraphics[width=0.45\textwidth]{./Angular/projections/phieff_KplusPi0Resolved_Run1.eps}
	\includegraphics[width=0.45\textwidth]{./Angular/projections/q2eff_KplusPi0Resolved_Run1.eps}
	\captionof{figure}[Angular acceptance parametrization projections for \runI.]{One-dimensional projections of the angular acceptance. The data points are \runI PHSP simulation, the solid curve is the four dimensional Legendre-polynomial parametrization described by \refEq{legendre_eff_final}. \label{fig:angProj_Run1}}
\end{figure}


\begin{figure}[hbt!]
	\centering
	\includegraphics[width=0.45\textwidth]{./Angular/projections/ctkeff_KplusPi0Resolved_Run2.eps}
	\includegraphics[width=0.45\textwidth]{./Angular/projections/ctleff_KplusPi0Resolved_Run2.eps}\\
	\includegraphics[width=0.45\textwidth]{./Angular/projections/phieff_KplusPi0Resolved_Run2.eps}
	\includegraphics[width=0.45\textwidth]{./Angular/projections/q2eff_KplusPi0Resolved_Run2.eps}
	\captionof{figure}[Angular acceptance parametrization projections for \runII.]{One-dimensional projections of the angular acceptance. The data points are \runII PHSP simulation, the solid curve is the four dimensional Legendre-polynomial parametrization described by \refEq{legendre_eff_final}. \label{fig:angProj_Run2}}
\end{figure}

%\subsubsection{Angular resolution}\label{sec:Accept-resolution}
%\begin{figure}[hbt!]
%	\centering
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctk_2011.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctk_2012.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctk_2016.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctk_2017.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctk_2018.eps}\\
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctl_2011.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctl_2012.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctl_2016.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctl_2017.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_ctl_2018.eps}\\
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_phi_2011.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_phi_2012.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_phi_2016.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_phi_2017.eps}
%	\includegraphics[width=0.19\textwidth]{./Angular/resolution/Reso_phi_2018.eps}\\
%	\captionof{figure}[Angular resolution per year.]{Angular resolution in \angles for each year. \label{fig:angProj_Run2}}
%\end{figure}



\clearpage    