TauSpinner: a tool for simulating CP effects in H to tau tau decays at LHC

In this paper, we discuss application of the TauSpinner package as a simulation tool for measuring the CP state of the newly discovered Higgs boson using the transverse spin correlations in the H to tau tau decay channel. We discuss application for its main background Z/gamma* to tau tau as well. The TauSpinner package allows one to add, with the help of weights, transverse spin correlations corresponding to any mixture of scalar/pseudoscalar state, on already existing events using information from the kinematics of outgoing tau leptons and their decay products only. This procedure can be used when polarimetric vectors of the taus decays and density matrix for tau-pair production are not stored with the event sample. We concentrate on the well-defined effects for the Higgs (or Higgs-like scalar) decays, which are physically separated from the production processes. TauSpinner also allows to reintroduce (or remove) spin correlations to events from Drell-Yan Z/gamma* to tau tau process, the main background for the Higgs parity observables, again with the help of weights only. From the literature, we recall well-established observables, developed for measuring the CP of the Higgs, and use them as benchmarks for illustrating applications of the TauSpinner package. We also include a description of the code and prepared testing examples.


Introduction
In the year 2012, ATLAS and CMS Collaborations published the discovery of a new resonance [1,2] in the search of the Standard Model Higgs boson H [3,4], with a mass of about 125 GeV. The next experimental challenge soon became to measure and compare its properties with the Standard Model predictions. In 2013 the ATLAS Collaboration reported [5] that the data are compatible with the Standard Model J P = 0 + quantum numbers for the Higgs boson, whereas all alternative hypotheses studied are excluded at the confidence level above 97.8%.
The Higgs boson decay to τ pairs has been directly confirmed so far only as an evidence, with observed signal significance on the level of 4.2σ (ATLAS, [6]) and 3.2 σ (CMS, [7]). The run II of LHC, which is starting next year, will hopefully bring observation in this channel also above 5σ.
Measurement of the Higgs CP state in the decay channel to τ 's will be an avenue of the physics programme for measuring Higgs properties in its decays to fermions. Tau leptons offer a unique opportunity of being excellent polarimeter probes, as the spin correlations, both longitudinal and transverse, are propagated to their measurable decays products. Availability of the multi-body decays: to single π ± or 3 π ± , and via resonances like ρ → π ± π 0 , allows to study and explore correlations between decay products.
In this paper we first recall sensitive observables for the measurement of the CP Higgs boson state in the decay to τ leptons and present new developments in the TauSpinner package which can be used for studying such observables on Monte Carlo samples or data embedded events with the help of weights with easy to configure options. Both longitudinal and transverse spin correlations are now available in TauSpinner [8,9,10] and can be modeled with this package starting from a sample which does not included such effects. This implementation allows for simulation of transverse spin effects for the mixture of scalar/pseudoscalar Higgs boson state and also for the main background, the Drell-Yan (DY) process Z/γ * → τ τ . All with the help of the weights calculated after Monte Carlo samples are already generated. In particular there is no need for polarimetric vectors for τ ± decays and density matrices for τ -pair production to be stored in the event sample. For some generators such information may be made available, but not in the case of embedded τ 's, see e.g. [6].
Because correlations are introduced by spin weights wt, the kinematical configuration of each event remains intact, statistical fluctuations on the (wt − 1) difference only introduce errors to the results of the comparisons. Weighted and unweighted samples are correlated. Use of weighted samples allows to study different theory models without the need of timeconsuming simulation of the detector responses: for arbitrary choice of Higgs parity state assumed for its decay and/or for its production matrix element. In the present paper we concentrate on Higgs decay. For scalars, decays are independent from the kinematic configuration of production process which can be treated separately.
As we will show, effects from the transverse spin correlations in decays are rather small. Let us note however that the data analysis techniques which have been developed during Run I of LHC have reached unprecedented level of sophistication, both on the statistical treatment and events classification techniques. As a result, it is impossible to judge the feasibility to measure the Higgs boson CP with the τ τ decay channel. We do not address this question in our paper. But having a program available to properly model such effects will certainly be a key to the success of such difficult measurement.
Our paper is organized as follows; in the following Section 2, we briefly recall the definition of the longitudinal and transverse spin correlations. In Section 3, we recall definition of the spin-sensitive observables in the H → τ τ decay. In Section 4, we present new development of their implementation in TauSpinner package. The next Sections 5.1 and 5.2, for signal and background respectively, collect some benchmark numerical results obtained with TauSpinner package and discuss possible improvements in the definition of those observables. Appendix A gives more technical details concerning the usage of TauSpinner. Several tests are also included to facilitate usage of the package and checks on its installation. Summary, Section 6, closes the paper.

Transverse spin correlations
Spin correlations of τ τ pairs from Higgs boson decays are sensitive to its parity [11]. This sensitivity is reflected in angular correlations of secondary decay products, in particular in the acollinearity distributions of the π + π − from τ + τ − decays. The spin density matrix for the two τ s resulting from the decay of the state which is a mixture of scalar/pseudoscalar is given, using convention of [12], by the formula below where R(2θ) can be understood as an operator for the rotation by an angle 2θ (double the mixing scalar-pseudoscalar angle θ) around the direction, i.e. of τ + τ − momenta in H rest-frame. The s τ − and s τ + are the τ ± polarization vectors, which are defined in their respective rest frames 1 . The R(2θ) spin density matrix, effectively a rotation matrix, reduces to just a diagonal one for the pure parity state: R xx = R yy = 1 for scalar and R xx = R yy = −1 for pseudoscalar.

CP sensitive observables
It is clear from formula (1), that to measure effects due to Higgs parity, it is necessary to understand how effects due to the s τ ± ⊥ component of the polarization translate to measurable quantities.
The τ lepton is an unstable fermion often decaying hadronically. Such process was described for the first time in [14], its differential decay width is given by the formula where h depends on the actual decay mode and its kinematical configuration, the dσ nopolarized dΩ decay denotes differential decay width in case when polarization is absent, and a vector s (conveniently defined in its rest-frame), parametrizes its spin density matrix. In case of τ ± → π ± ν τ the h is defined by the direction of ν τ momentum (in τ rest-frame). Also for other τ decay modes h is correlated with the ν τ momentum. The key to the measurement, used in all approaches, in particular in [12,13,15,16,17], is to have at least partial control over the relative orientation of the planes spanned by the momenta of τ ± and its decay product ν τ (in the Higss boson rest-frame). Unfortunately, all these quantities are at best difficult to measure and depending on the detector conditions one of the choices may be better than other ones. The actual choice of the observable among those proposed in these references will of course depend on details of the detector and background understanding. Further improvements with respect to these references can be expected, similarly as it was the case at a time of LEP measurements, see e.g. [18] for the concept of optimal variables.
Thanks to the prolonged effort, especially in the context of preparing physics programme of the future linear collider, observables sensitive to the CP spin effects were designed for final states involving τ leptons. We would like to recall here two such observables, well established in the literature.
In Ref. [12] it was shown that for the acollinearity angle defined in the rest frame of the Higgs boson, the shape at the end-point of the acollinearlity distributions for the two pions resulting from Higgs decay can be easily interpreted as a consequence of spin parity. Reconstruction of the τ 4-momentum could be avoided, but precise control of the Higgs rest-frame was necessary. It is rather easy to understand that indeed the transverse spin correlations, carrying information on Higgs parity, can be translated into observable such as acollinearity in H → τ + τ − , τ ± → π ± ν decay chain.
In Ref. [15] an alternative observable was proposed for the H → τ + τ − , τ ± → ρ ± ν, ρ ± → π ± π 0 decay chain. It was suggested to abandon reconstruction of the Higgs rest frame and τ four-momenta, instead use the ρ + ρ − rest frame which has the advantage that it is built only from directly visible decay products of the ρ + and ρ − . Reconstruction of the τ + and τ − rest frames or momenta was not necessary.
One-dimensional angular distribution of the acoplanarity angle θ acop between π + π 0 and π − π 0 decay planes in the ρ + ρ − pair rest frame was proposed as CP sensitive observable. To establish this sensitivity, one has to define two categories of events depending on the sign of the energy difference between π ± and π 0 . More specifically the energy differences are defined as follows: y + of π + π 0 from ρ + , and y − of π − π 0 from ρ − and categories depend on sign of the y + ·y − product. The distribution of the acoplanarity angle θ acop in each category separately is sensitive to the CP of the Higgs boson. Energy differences, y ± , measured in the laboratory frame can be used. For better sensitivity of the observable, one can attempt to reconstruct those quantities in the τ 's rest frames. The second option is however more challenging experimentally. Also the τ ± → a ± 1 ν decay chain is potentially very interesting, however in this decay chain it is much more difficult to construct CP-sensitive observable that is easy to interpret and use.
The effects of detector smearing for the measurements of π's directions and energies were studied in [15]. The sensitivity to parity of the Higgs boson was preserved even if relatively large smearing was allowed, as long as the relative orientation of π 0 's direction with respect to π ± could be established. Precision for the measurement of energies was of no concern. Even large smearing was found not to deteriorate the CP sensitivity of the observable.

New development of the TauSpinner code
The TauSpinner package [8,9,10] represents a tool which can be used to modify τ spin effects in samples where intermediate states decay into final states including τ leptons. As an input, generated samples of events featuring τ leptons produced from intermediate state W , Z, Higgs bosons are used. The information on the polarization and spin correlations is reconstructed from the kinematics of the τ leptons (also ν τ in case of W mediated processes) and τ decay products alone. The hard process parton level scattering flavour/kinematical configurations, in particular x 1 , x 2 for PDFs, are reconstructed from the known centre-off-mass energy, rapidity and virtuality of the τ + τ − pair. The convolution of the parton density functions (PDF) at given x 1 , x 2 and the effective Born level cross sections of the hard process can be used for calculating respective spin weights. Depending on whether longitudinal and transverse spin correlations were included in the original sample, the TauSpinner package calculates the corresponding weight, on the event-by-event basis to model the required spin effects. It allows to model spin correlations of the scalar or pseudoscalar Higgs boson or desired mixture of both states, starting from the same sample of generated events. Longitudinal spin correlations are modeled properly for the vector boson W , Z intermediate state as well. As discussed below, the first implementation for modeling the transverse spin correlations in the Z intermediate state is also prepared.
By calculating spin weights, attributed on the event-by-event basis, TauSpinner enables numerical evaluation of the spin effects on experimentally measured distributions and/or modification of the spin effects.
Because of the modularity of the design, most of the algorithms and solutions used in Tauola universal interface package [19] could have been used in TauSpinner. In Tauola universal interface longitudinal and transverse spin correlations are implemented as part of event generation since a long time. Spin effects originate directly from the properties of the matrix elements used. There are necessary extensions and new conditions, for algorithms of Tauola universal interface (and later Tauola++ universal interface [20] as well) to be useful for inserting or modifying spin effects post-fact on already stored events. The numerical stability of the reweighting procedure (one has to boost back τ decay products from laboratory frame to τ rest frames) has to be assured. Also the lack of information available in the event record 2 , necessary for calculating the weights such as the flavours of incoming quarks which are not known, has to be overcome. To construct the missing information for the kinematics and/or flavour of hard process partons an additional algorithm, at present based on leading-log approximation only, had to be introduced. This is discussed in some more details in [10] and in other papers discussing TauSpinner applications [8,9]. To evaluate technical correctness of those algorithms it was sufficient to compare, for a given analysis selection, results from samples generated using the Tauola++ universal interface and including all effects from the beginning, with the ones where effects were obtained using the TauSpinner package. Further work, based on calculations with approximations beyond leading logarithm, will allow to improve the precision of both the TauSpinner and the Tauola++ universal interface packages. This can not be completed on the basis of programs featuring leading logarithm approximations, one may need to wait until full NLL Monte Carlo programs become available [21]. At present comparisons with fixed order results such as [22] or with NLO simulations in particular [23,24] are planned.

Transverse spin correlations in H → τ τ decay
The effects of transverse spin correlations resulting in sensitivity to Higgs parity in case of decays to τ leptons was already installed in Tauola universal interface [19] some time ago.
We have discussed Higgs boson CP observability already in [15]. The method was later extended to the mixed parity case [13]. The τ decays to two pion final states were used to present numerical results. The transverse spin correlations manifest themselves in the form of a directly observable acoplanarity 3 angle between (oriented)-decay planes of ρ + and ρ − . This observable was one of the basic benchmarks for implementing the transverse spin in Tauola++ universal interface [20], the direct continuation of ideas presented in [19].
The application of the TauSpinner package for simulating effects of the longitudinal spin correlations has been discussed in [10]. Presently, important elements of the algorithms implementing transverse spin correlations have been ported to this package. With the method of events reweighting, the algorithms are able to reintroduce correlations to the kinematics of already generated H → τ τ events without those effects. This is a useful technique because it allows one to work on generated Monte Carlo events and also on the data embedded samples.

Transverse spin correlations in Z → τ τ decay
From now on, transverse spin correlations are available with TauSpinner, for the DY process, Z/γ * → τ τ . The spin correlation matrix R ij is calculated for Tauola++ universal interface by the electroweak library [25], at one loop precision level. We have checked that, the non diagonal part of the spin density matrix remains close to zero in high energy limit, as expected from analytic form of [26] applicable for low virtualities of τ τ pairs. The R xx , and R yy components of τ + τ − pair spin density matrix (already precalculated and stored for Tauola++ universal interface in text files) are made available for the use of TauSpinner. As the actual calculation of spin weight was identical, and only parton level kinematical configuration was obtained differently, it was technically rather simple.
Let us elaborate a bit more on the actual implementations of the spin correlations. One can represent the complete differential cross section for τ pair production and decay as the combination of several segments. The separation into τ decays and production components is exact, thanks to the narrow width of the τ . Both phase space and matrix elements can be factorized into the part corresponding to production and the one corresponding to the decays. That is the property which is used in Tauola since the beginning [27]. For the cross section calculation, separation into production process and the decay is not complete, it requires introducing the spin weight wt. Only this weight depends simultaneously on kinematical variables of the production and of the τ decays. This dependence is regular and consists of contraction of 4×4 density matrix R ij for τ pair production and polarimetric vectors h + i , h − j for each τ ± decay. The following properties hold by construction: 0 < wt < 4 and < wt >= 1. This is used in [28,29] and does not require any approximation. It is used by the Tauola universal interface and TauSpinner as well. The problem maybe be simplified however; depending on the approximations some of the components of R ij may be ignored and set to zero. Also, if only collinear helicity-like degrees are taken into account, detailed definition of frames used for τ 's quantization is not necessary 4 .
The τ pair production process at LHC, pp → τ + τ − X, can be complicated. The spectator system X can be of a very distinct type depending on the intermediate state decaying to the τ τ pair. For the case of Higgs production and decay, the picture simplifies since the Higgs is a narrow resonance and of a zero spin. The dominant production mode is gg → H fusion, but independently of the production process it is enough to use Higgs decay products kinematics for calculation of the decay matrix element. For the calculation of spin weights in Tauola++ universal interface or TauSpinner, the information on four momentum of the Higgs, four momenta of τ s and their decay products are sufficient. No approximations are involved, independently of whether the transverse spin effects are taken into account or not. The production part factorizes out. Moreover the TauSpinner algorithm is designed such that modification of the production mechanism, with the help of respective weights is possible. For the case of 2 → 2 processes of τ pair production, this functionality is already available, see Ref. [9] for details.
In case of the DY process, the situation is different. Even at the lowest order information on the flavours of the incoming quarks to the hard process is needed to introduce spin correlations. This defines another segment of the calculations. In Tauola++ universal interface flavours of incoming quarks are deciphered from the history in entries of the event record. For TauSpinner, where we assume that the history in the event record is not available, four-momenta of incoming quarks are calculated from the virtuality and rapidity of the τ pair [8]. Then, the particular quark flavour configuration is chosen randomly on the basis of PDFs (e.g. [31,32]) and quark level Born cross section. The scattering angle of the hard process is also calculated, as described in [8], following [33], and is used for calculating spin weights.
The discussion above does not exhaust all details necessary for calculation of the TauSpinner weights for spin effects discussed in this paper, but the main ingredients are explained. For more details concerning the algorithms which replace the production matrix elements with the help of weights, references [8,9,10] should be consulted. When adapting these algorithms for TauSpinner, we could also profit from the available corresponding segments of the Tauola++ universal interface and study their functionalities 5 .

QED bremsstrahlung in decays
So far our discussion is neglecting the effects of bremsstrahlung in Higgs decay and final state radiation (FSR) in DY process. The solution implemented in TauSpinner was discussed already in Ref. [8]. We have checked that test distributions used in the present paper are defined in a way which avoids potential difficulties. All figures were reproduced for the samples where final state effects were included in H or Z/γ * decays, no differences beyond statistical fluctuations have been observed. Also for the general case, it is known that effects are small and can be factorised into a separate simulation block. This required discussions of the matrix element properties and we do not plan to repeat these studies here. From the user point of view, as discussed in [8], to control the effect from final state bremsstrahlung, the intermediate state (H, Z/γ * , etc.) decay vertex has to be passed to the TauSpinner as follows. FSR photons have to be summed into the four-momentum of the intermediate state Z/γ * , but not into four momenta of τ ± and their decay products. The four momentum non-conservation of such (on-fly created) vertex will be assumed to be due to FSR photons. Detailed discussion of theoretical results behind this solution can be found in the documentation of PHOTOS [34] and references therein. 5 One can use available building blocks to evaluate the properties of the background without complete simulations as well. The spin correlation matrix R ij is calculated for Tauola++ universal interface by the electroweak, one loop level, segment of the code. We have started to collect the necessary preliminary results in the directory CP-tests/Z-pi. First, we have checked that, as in analytic form of [26], only diagonal parts of R ij and polarization (R tz , R zt ) remain non zero in the high energy limit (see the content of CP-tests/Z-pi/RijS-INTcosthe.root file). Plots for different component of R ij are given as a function of invariant mass and incoming quark flavour. The module of R ij is taken and integration over the hard scattering angle is performed.
Encouraged by this confirmation we have looked into the comparison of R xx and R yy for different values of s and incoming quark flavours but as function of the cosine of the hard scattering angle (see the content of CP-tests/Z-pi/Rijcostheta-S=2-6.root and CP-tests/Z-pi/delta12.root files).
For higher values of s the R xx and R yy were coinciding. Thus, the resulting background will feature, see Fig. 4, transverse spin effects (necessary for CP Higgs measurement) as if the sample was not polarized, provided that the observable will symmetrize the overall orientation angle common for the two τ decay systems, with respect to the hard scattering plane.

Numerical results
Below we present benchmark numerical results for the CP sensitive observables discussed above. We show, that the effects of transverse spin correlations, already published in [20] using Tauola++ universal interface and obtained also by other authors with independent approaches, can be reproduced using TauSpinner.

Case of the 125 GeV Higgs
The acollinearity angle in the H → τ τ with both τ ± → π ± ν, which requires precise reconstruction of the Higgs rest frame, can be realized in the muon collider but was considered difficult in LC or LHC experiments, due to missing neutrino momenta from τ decays. Nonetheless, we show this observable in Fig. 1 and included it into our benchmarks discussed in Appendix A.4 because of its straightforward theoretical interpretation. Because of the simple kinematical constraints, in the rest frame of the Higgs boson, τ 's are back-toback and acoplanarity angle between decay products π + π − is above 2.8. When zooming into this region (right plot of Fig. 1), a clear difference between spectra for scalar and pseudoscalar Higgs boson is observed. However, to measure it experimentally, very precise reconstruction of the Higgs boson rest frame would be mandatory.  Figure 1: The acollinearity distributions of the π + π − in H → τ + τ − , τ ± → π ± ν decays. Red line corresponds to the scalar and blue dashed line to the pseudoscalar case. Black line shows the ratio of the distributions. On the right side, the acoplanarity range is zoomed to show its endpoint region.
We consider the H → τ + τ − , τ ± → ρ ± ν, ρ ± → π ± π 0 decay chain and one-dimensional angular distribution of the acoplanarity angle θ acop between the π + π 0 and the π − π 0 decay planes in the ρ + ρ − pair rest-frame (Ref. [15]). In view of the Standard Model Higgs boson of a mass of 125 GeV, it is a good candidate for a CP sensitive observable at LHC. This distribution is CP sensitive if events are separated 6 into two categories, accordingly to the sign of the product y + · y − .
We recall this distribution 7 in Fig. 2. We split events into two separate categories and compare the case of the scalar (red) and the mixed scalar-pseudoscalar state (blue dashed) with assumed mixing angle θ = 0.2. The θ acop distribution relies on measurement of the four-momenta (in the laboratory frame) of the π + π 0 and π − π 0 only. No reconstruction of the rest frames of Higgs and/or τ ± is required. Obviously, the nature of the observable is at least three dimensional and the multi-dimensional fit in the space (θ acop , y − , y + ) offers additional increase in sensitivity of this measurement. Fig. 3 shows the same distribution but when y ± energy differences are calculated in τ ± rest frames instead of the laboratory frame. Reconstruction of τ ± rest frames can be in part achieved with the help of τ decay vertex measurement. Comparison of Fig. 3 and Fig. 2 allows to estimate available potential improvement which may be accessible also at LHC.
This optimization can be realized in part, if the τ decay vertex is measured to a limited precision, as used in [16]. This helps resolving twofold ambiguity in reconstructing the τ momentum. Other examples where the reconstruction of the decay vertex is used as an essential part of the observable, are given in [17] and also 8 in Ref. [35]. Naturally, extension to other decay modes of τ 's, especially to 3 π channels will be beneficial as well. These channels offer substantial increase of the sample statistics, and also, if ignored would contribute to the background. Many options, with optimal choices depending on details of detector response, the hard scattering and τ decay distributions, can be envisaged.

Case of Drell-Yan background
Studies of the transverse spin effects and of CP sensitive observables can not be completed for the Higgs boson unless properties of the main background, that is DY Z/γ → τ + τ − , are studied as well. At LHC, this dominant background is difficult to separate from the Higgs boson signature [6]. Both Atlas and CMS use embedded τ samples for the estimation of the background [6, 7]. Control of the transverse spin effects can be realized in this case with the help of weights of the new version of TauSpinner presented in this paper.
Numerical results for the DY sample with m τ τ > 60 GeV are shown in Fig. 4, for the acoplanarity of the π + π − directions, i.e. the same variable as in Fig. 1 for the Higgs boson. Note that because of the line-shape of the Z/γ * , i.e. large spread of the τ + τ − virtualities, the end-point of the π − π + acollinearity distribution is not as sharp as for the Higgs boson.
6 This separation, thanks to the properties of τ decay matrix elements, correlates the ρ decay plane with the one spanned on τ and ν τ momenta.
7 Details on the program used in preparation of this plot are given in Appendix A.4. 8 Note that the angles 0 < φ * < π and 0 < Ψ * CP < π of Ref. [35] are related to our angle 0 < θ acop < 2π. The φ * = arccos(cos(θ acop )) and Ψ * CP = arcsin(sin(θ acop )). Different, but correlated, physics input is used for the definition of planes. In Ref. [13] planes spanned on momenta π ± and π 0 from ρ ± decays are used. In [35] the plane spanned by τ direction and its charged decay product is used instead; exactly as the angle φ * of Ref. [12]. The actual choice will depend on how well measured are π 0 directions and precision of reconstruction of the τ decay vertex. If all these quantities are to be shown to be measurable, one should consider simultaneous fit to multidimensional distribution over all of the variables.  Figure 2: The acoplanarity distribution for the H → τ + τ − , τ ± → π ± π 0 ν decays (see text for more details). Left plot for events with y − · y + > 0, right plot for y − · y + < 0. Compared are scalar (red) and mixed scalar-pseudoscalar (blue dashed), with mixing angle θ = 0.2, cases. The y ± variables are calculated in the laboratory frame.  Figure 3: The same as Fig. 2 but with y ± variables calculated in τ ± rest frames.
For DY events, no transverse spin effects can be seen (right plot). To nevertheless enhance effects from the spin correlations, an additional cut on | cos θ planes | > 0.5 is introduced (left plot), leading to a difference of 20% in the shape of the falling edge. The θ planes is an angle between planes defined by: τ ± momentum -beam momentum (first plane) and τ ± momentum and its decay product π ± momentum (second plane). with tr. spin corr. 3 3  Figure 4: The acollinearity of π + π − directions in the rest frame of intermediate Z/γ * state, invariant mass of the τ + τ − pair is requested to be larger than 60 GeV. An additional cut has been applied (left plot), as defined in the text, to enhance effect from transverse spin correlations. Without this cut (right plot) effect is substantially smaller than statistical fluctuations.
The DY background is also characterized by a simply flat distribution of the acoplanarity angle, in case of Z → τ + τ − , τ ± → ρ ± ν decay chain; where θ acop is defined between π + π 0 and π − π 0 decay planes in the ρ + ρ − pair rest frame. The distribution, shown in Fig. 3 for the Higgs case, becomes a sensitive observable only if dependent on the sign of y − · y + . This is not the case of the Z boson (independent of the sign of y − · y + ) and this feature may be used to control the background, unless (unlikely) destroyed accidentally by some selection cuts.
We have cross-checked these results with samples generated including transverse-spin correlations directly (i.e. using Tauola++ universal interface). In this case, the transverse spin effects for the DY production are activated simultaneously with the electroweak loop corrections, see [20].

Summary
In this paper, we have presented a new extension of the TauSpinner package, namely the implementation of the transverse spin correlations in the decay of scalar/pseudoscalar state into a pair of τ leptons as well as for DY Z/γ * processes. The post-fact modeling of the correlations is achieved by calculating weights on the event-by-event basis using only information on the kinematics of the outgoing τ decay products. This provides a convenient tool, where multiple models can be studied on the correlated events without the need for CPU-intensive simulations. The question of weights to model/replace matrix elements used for generating scalar/pseudoscalar state production is postponed to a forthcoming paper.
The new functionality has been achieved by porting and adapting code developed for the Tauola++ universal interface package, so it can be used on already generated events where such correlations were included or not.
We have recalled two observables sensitive to the transverse spin correlations in case of H → τ τ decays, which have been proposed already some time ago: acolinearity in case of τ → π ± decay, and acoplanarity in case of τ → π ± π 0 ν decays. They have been used to provide numerical benchmark of this implementation, for the Higgs mass of 125 GeV, as recently discovered by the LHC experiments.
We have also discussed transverse spin correlations for the DY Z/γ * background process, which can now be modeled with the TauSpinner package. We have shown that the effect for background is marginal (as expected). Nevertheless, given the fact that experimental selection may enhance such effects it is considered as important to have it also available.
We have not addressed here the question of the feasibility to observe transverse spin correlations in the analyses of H → τ τ channel at LHC. Given nowdays very refined analysis techniques, even rather small effects can be turned into successful measurements. Our aim was to prepare, describe and validate a tool which may be useful for such a goal.
We have concentrated on the Higgs decays. One expects that for the distinct parity of the Higgs-like object, its production hard scattering matrix element should differ as well. Respective modifications to the production matrix elements of the user choice (and not only to the spin correlation weight discussed in the present paper) has been implemented for the 2 → 2 hard processes since some time now [9]. Our intention is to extend this functionality also to the vector boson fusion production processes [36], that is kinematical configurations of final states consisting of τ + τ − pair and two jets. Implementation of the transverse spin effects, for such user provided non-standard physics processes, may be considered in the future.

A TauSpinner technical details A.1 Initialization
In case of transverse spin effects, the following changes have to be introduced for TauSpinner initialization. The rest of its execution is performed as explained in the previous publications [8,9]. In particular, all weights will still be calculated by calling the function calculateWeightFromParticlesH 9 .
Let us give a few details concerning different options: Case of Higgs bosons • For mixed parity state, use: double theta = 0.2; setHiggsParametersTR(-cos(2*theta),cos(2*theta), -sin(2*theta),-sin(2*theta)); Case of DY process 10 • At initialization stage: setZgamMultipliersTR(1.0,1.0, 1.0, 1.0); the R xx , R yy , R xy , and R yx components of the density matrix will be multiplied by these coefficients. The two files named table1-1.txt, table2-2.txt have to be present in the directory of the executable main program, exactly as in the case of Tauola++ universal interface [20]. If the tables are absent, or if their name is distinct, the transverse components of R ij will be equal to zero.
• At execution stage: The method getZgamParametersTR(RXX, RYY, RXY, RYX); can be used to port the numerical values of R xx , R yy , R xy , R yx to the user program to monitor the values or to modify them by repeating the following: setZgamMultipliersTR(...); WT1 = calculateWeightFromParticlesH(...); for each individual event. Motivated by the results of our tests, we have chosen R xy and R yx to be zero in all DY cases.
Further details are given in the following sections and in README files of the distribution tar-ball. All the plots of the present paper can be reproduced with the help of new demonstration programs which are included in the Tauola++ v1.1.5 (or later) distribution tar-ball. We are using the ROOT-based MC-TESTER package [37] to facilitate histograming and plotting.

A.2 Electroweak corrections
In Tauola++ universal interface transverse spin effects are activated together with electroweak corrections of the SANC library, see Ref. [25]. Now, this is the case in TauSpinner as well. The R xx and R yy components of τ + τ − pair spin density matrix have been ported to the TauSpinner code. Other, non-diagonal components, have been demonstrated to be suppressed to, or below the few percent level and are not taken into account. See the plots of the file CP-tests/Z-pi/RijS-INTcosthe.root discussed in the main body of the paper.

A.3 Installation
As auxiliary material to this paper, the directory TAUOLA/TauSpinner/examples/CP-tests has been prepared. The main program CP-test.cxx is based on the default example program tau-reweight-test.cxx located in the TAUOLA/TauSpinner/examples directory. In order to compile it one has to: • Configure Tauola++ for compilation with TauSpinner, HepMC [38] and MC-TESTER [37]. See [20] and [8] for instructions on how to define the appropriate paths.
• If using Tauola++ distribution tarball for LCG 11 , available on the project website [40], no additional configuration is required. In case of complete distribution 12 , execute ./configure with appropriate paths in the TauSpinner/examples directory.
• Execute make in CP-tests.
The example located in this directory is prepared to work without modifications. Please see comments in the code for possible options.

A.4 Executing tests
The directory CP-tests contains four tests located in subdirectories H-rho, H-pi, Z-rho and Z-pi. Each test can be executed by the command ../CP-test.exe in one of those subdirectories. Each subdirectory contains a small HepMC file events.dat with a sample of 100 events to test the installation. See Appendix A.6 for instructions on how to set up generation of larger data samples using Tauola++ and Pythia8. Executing the program with no parameters will process the predefined events.dat sample. Any sample can be processed with:

../CP-test.exe <data sample> [<optional events limit>]
For each subdirectory, an appropriate MC-TESTER user analysis script is provided. Appropriate parameters are set with the help of setHiggsParametersTR and setZgamMultipliersTR in the main program CP-test.cxx file. Note that subdirectories Z-rho and Z-pi contain previously generated tables of electroweak one loop level results for the quark level differential cross section and R ij 13 , which are needed for these tests (see Appendix A.2). For tests (and for our figures), MC-TESTER data files have been used with the results of processing samples of 1M events for pp@8TeV (or @14TeV) collisions generated with Pythia8 [41] hard process option HiggsSM:ffbar2H ( WeakSingleBoson:ffbar2gmZ) turned on. We have checked that variation of the Higgs mass in range 120-125 GeV does not affect results beyond the statistical fluctuations. This applies to the case when ISR, FSR is activated in Pythia as well 14 . We have used LHAPDF dataset cteq6ll.LHpdf [32]. MC-TESTER user analysis scripts are adapted to the appropriate Higgs (Z/γ * ) states.

A.5 Analyzing results
The result of the test described in previous section is stored in mc-tester.root file. It contains all plots defined in user analysis script file 15 . To compare two MC-TESTER rootfiles use compare.sh located in the CP-tests directory: ./compare.sh <file1.root> <file2.root> The benchmark distributions will be stored in the section USER HISTOGRAMS of the booklet tester.pdf produced during comparison. Each directory provides one or more benchmark files that can be used if no changes have been introduced to user analysis script files.
Executing the program in the directory CP-tests/H-rho generates Figure 2 if root files scalar.root, thet-0.2.root are used as inputs. With scalar-tauframe.root, thet-0.2-tauframe.root used as inputs, the plots for Fig. 3 are generated instead. These plots, to a large degree, coincide with Figure 2 of Ref. [13]. Note the different choice of quantization frames used in these papers. If the directory CP-tests/H-pi is used, Fig. 1 is generated, reproducing Fig. 3 from [12] (files scalar.root, pseudoscalar.root 13 See Z-pi/table1-1.txt, Z-pi/table2-2.txt. Subdirectory Z-rho contains symbolic links to these two files. See [20] for instructions on how to generate these tables with modified parametrization. 14 In this case, a large number of final states can be recognized by MC-TESTER -result of FSR activity in Z or H decays. On some platforms, for bigger samples, this may cause buffer overflow problems. Our examples are not expected to work for all possible options of constructing and storing the event records. They are supposed to work for the properly prepared data files only. 15 User analysis ROOT scripts are the .C files located in the directory where the test is run. The name of those files ends with *UserTreeAnalysis.C). Plot definitions located in these files can be modified as needed, however new plot definitions mean that benchmark files provided with the distribution cannot be used for comparison. Keep in mind that in order for MC-TESTER to work correctly $(MCTESTERLOCATION) environmental variable must be set. are used). Not only the acollinearity of π ± directions in the rest frame of the Higgs is histogrammed, but also the acoplanarity angle for the π − τ − and π + τ + planes of the same frame (it is not included in our paper).
Numerical results for the DY sample of 1M events are collected in the files: start60.root and transverse60.root in the CP-tests/Z-pi subdirectory, and were used for the plot shown in Fig. 4 for the case with the selection | cos θ planes | > 0.5, and files start60-noc.root and transverse60-noc.root without this selection.

A.6 Generating data files
In this section we describe how data files can be generated for the tests. For this purpose, a subdirectory CP-tests/generate-datafiles has been provided with a program specifically configured for generating data files for these tests. Note that using this subdirectory requires a path to Pythia8 to be provided during the configuration of Tauola++ in addition to other paths 16 . To compile this program, execute ''make generate'' in the CP-tests directory. To run it, execute: ./generate.exe <output file> <pythia8 config> <decay channel> <events count> Two Pythia8 config files have been prepared: pythia.Z.conf, pythia.H.conf, and they can be used in combination with Tauola++ decay channel 3 or 4 to provide samples for π or ρ respectively 17 .
The program is set up to strip event of all particles other than H or Z boson, τ and τ decay products. This information is enough for TauSpinner to work and output files are relatively small (around 4GB per 1M events). 16 Contrary to TAUOLA/examples subdirectory, this program is set up only for pythia version 8.180 or later. When using older versions, changes to the use of pythia8 HepMC interface may have to be introduced. 17 Tests described in this paper have been configured for proton-proton collisions at √ s = 14T eV , therefore Pythia8 configuration files use the same setup.