Documentation of TauSpinner algorithms: program for simulating spin effects in \(\uptau \)lepton production at LHC
 35 Downloads
Abstract
\(\uptau \)leptons produced in pp collisions allow to measure Standard Model parameters and offer probes for New Physics. The TauSpinner program can be used to modify spin (or production matrix elements) effects in any \(\uptau \) sample. It relies on the kinematics of outgoing particles: \(\uptau \) lepton(s) (also \(\upnu _\uptau \) in case of Wmediated processes, optionally also fourmoments of accompanying hard jets) and \(\uptau \) decay products. No other information is required from the event record. With calculated spin (or production/decay matrix element) weights, attributed on the eventbyevent basis, modifications to the spin/decay/production features, is possible without the need for regenerating events. With TauSpinner algorithms, the experimental techniques developed over years since LEP 1 times are already used and extended for LHC applications. The purpose of the present publication is to systematically document physics basis of the program, and to overview its application domain and systematic errors.
1 Introduction
At LHC experiments, interest in \(\uptau \) leptons lies in the use of decays for the measurements of the properties of hard production processes, of the properties of resonances like W, Z or Higgs boson or in the searches for New Physics.
That is why, it was of interest to prepare a package called TauSpinner which can be used for changing with weights generated event samples including \(\uptau \) lepton decays. In many cases one can argue that such reweighting of the sample with different physics assumptions may be of little use. Why not simply generate another series of events with different assumptions and compare distributions obtained from them? Indeed one can think reweighting may bring little benefits and considerable risks, e.g. if the original sample has some sectors of the phase space biased by a particular technical cutoffs, or if it features zero matrix element on some hypersurface within the phase space manifold. Arbitrary large weights may then appear. However, in several cases such disadvantages are balanced by the benefits. The weighted events sample is statistically correlated with the original one, thus the statistical errors affect the estimate of the differences only. Even larger CPU gain is expected, if the sample is processed with simulation of the detector effects. A full simulation of the detector response usually requires few orders of magnitude more CPU time than generation of physics events, or the calculation of events weight. Even the inclusion of Next to Leading Order (NLO) QCD effects in the generation can be CPU costly. Reweighting to a different production process with the same final state (set of final states) can be also of interest. That is why the reweighting algorithms of TauSpinner were prepared; simultaneously for \(\uptau \) lepton pair production and \(\uptau \) lepton decays. The weight could depend on ten or even more four momenta taken from kinematical configurations of stored events. The proposed implementation was widely used in experimental analyses at LHC; in the domains of Standard Model precision measurements [1, 2, 3], Higgs boson discovery and particle properties measurements [4, 5, 6, 7, 8] and searches for New Physics [9, 10].
At the beginning the TauSpinner project was focused on the longitudinal spin effects only [11]. It was used to calculate appropriate weights, to include spin effects into (or removed from) the generated events sample. With time, other options were added. In Ref. [12], an additional weight was introduced to manipulate the production process by adding or replacing the generated production process with an alternative one, including for example exchange of new intermediate particles. Reference [13] brought the possibility of introducing complete spin effects (longitudinal and transverse) in decays of intermediate Higgs bosons, and in Ref. [14] in the Drell–Yan process as well. The production process was modeled with lowest order \(2 \rightarrow 2\) matrix elements. In [15] the implementation of hard processes featuring the parton level matrix elements for production of \(\uptau \) lepton pairs and two jets was introduced. This was motivated by the experimental analyses becoming sensitive to Electroweak Higgs and the Z boson production in the fusion of WW or ZZ pairs. The question of systematic uncertainties due to the approximation where \(2 \rightarrow 2\) or \(2 \rightarrow 4\) matrix elements were used for the calculation of spin effects could be addressed since then. With time also more sophisticated options for treatment of spin effects were prepared. In Ref. [13] possibility to assign helicity to \(\uptau \) leptons was added. An approximation was used taking only the longitudinal components of density matrix for \(\uptau \) lepton pair production into account. In [14] one loop electroweak (EW) corrections in the Drell–Yan process became available for the weight calculation. Finally let us mention that available options allow to configure the TauSpinner algorithm to work on samples where only partial spin effects were taken into account and to correct them to full spin effects.
All these different options were introduced into TauSpinner because of user’s interest and under the pressure of time during converging very fast analyses of LHC Run I data by ATLAS and CMS experiments. That is why there is a need and the opportunity now to document them systematically and archive the code which will be used during the final LHC Run II analyses.
New applications of the TauSpinner are currently developed. The most recent example, where reweighting techniques of TauSpinner were used for the precision measurement at LHC is the \(\sin ^2{\uptheta }_{eff}^{lep}\) measurement by the ATLAS Collaboration [16]. The TauSpinner algorithms served as a tool for introducing genuine EW and other loop corrections to the samples generated with EW leading order (LO) matrix elements.
Contrary to the previous papers we will emphasize here less phenomenological applications, but rather focus on common theoretical/phenomenological basis and relations between different options. Whenever possible we will address the point of the theoretical uncertainties of the proposed algorithms with references to our previous publications on TauSpinner.
The focus of the present paper is the documentation of the program. We do not repeat the physics reasons why options or particular approximations were then prepared. The principles of algorithms for the exact treatment of all spin effects for the \(\uptau \) leptons production and decay are known since a long time. Also, all approximations used by us and applied in other currently used programs of today were investigated already not later than a decade ago, see e.g. Ref. [17] of the final publication on the LEP precision measurements.
The general purpose Monte Carlo programs for LHC such as Pythia [18], Herwig [19] or Sherpa [20] feature \(\uptau \) lepton decays and corresponding spin effects, often without any approximations. This depend on the particular process of \(\uptau \) leptons in the final state. Reweighting algorithms are available in these programs as well, see e.g. [21, 22, 23], even though they not necessarily rely on event record formats, presently used for storing events of LHC experiments, or are prepared for \(\uptau \) lepton physics. Such reweighting options are usually not used in the LHC experiments analyses, for events which have been already generated and stored. The TauSpinner therefore offers as we will explain later with very little compromising on the physics precision, solution for reweighting.
Discussion, comparisons of different programs and their results for the modelling of spin effects in a multitude of high energy processes is of vital interest but remains out of the scope of the present publication. Fortunately we can refer to conference contributions and workshops, see e.g. [21, 24], with the caviat however that so far details on the \(\uptau \) lepton physics at LHC are largely shadowed by the interest and complexity of higher order QCD corrections. The extensive work like the one in Ref. [17] for LEP is to our knowledge at present not available. It should not be a surprise, Ref. [17] was published many years after LEP experiments stopped taking data. Likely it will be the case for LHC too and the comprehensive review will have to wait for the time of finalising precision measurements of the full Run II data.
Our paper is organized as follows. In Sect. 2 a theoretical basis for describing \(\uptau \) leptons in production and decay matrix elements is introduced. We define weights calculated by the program. Details of kinematics; definition of frames and transformations connecting them, used for calculation of hard partonlevel amplitudes or cross section and for calculation of spin effects are given in Sects. 3 and 4. In the subsections we explain simplifications and resulting formulae for the differential cross section and spin correlations. Section 5 is devoted to the case when at parton level \(2 \rightarrow 2\) processes are used. Section 6 covers the calculation of density matrices for \(\uptau \) lepton decays; the polarimetric vectors. In Sect. 7 the case of \(2 \rightarrow 4\) processes is discussed and extensions to the algorithms which were needed for the case when the final state consists not only of a \(\uptau \) lepton pair, but also two additional jets are present are explained. Section 8 is devoted to general discussion how systematic uncertainties related to applications of TauSpinner weights can be estimated. The \(\uptau \) lepton decay library Tauola [25] providing some methods for TauSpinner is discussed as well. Section 9, closes the paper. The appendices recall all examples and applications which are included in the most recent release. So far, the documentation for these applications was scattered over several publication appendices and was thus not available in a systematic manner.
2 Theoretical basis
We start the discussion from presenting the exact formula on the cross section for \(pp \rightarrow \uptau \uptau \; X\) or \(pp \rightarrow \uptau \; \upnu _\uptau \; X\) processes, which requires knowledge of the whole process matrix elements, including decays of \(\uptau \) leptons. Considering about 20 \(\uptau \) lepton decay channels we endup with 400 possible configurations for each \(\uptau \) lepton pair production process. The exact formula can therefore not be used in practice. Nonetheless, it can serve as a starting point for more practical ones, also those involving approximations. The formulae presented below for the \( H (Z/\upgamma ^*) \rightarrow \uptau \uptau \) can be applied also to the \(H^\pm (W^\pm ) \rightarrow \uptau \; \upnu _\uptau \) case. Then the second \(\uptau \) lepton of the formulae should be replaced by \(\upnu _\uptau \) and the part of formula which describes its decay dropped out.
2.1 Exact formula
Formula (4) is universal, it does not depend on the production process, and there are no approximations introduced. It features useful properties: \(0<wt_{spin}<4\) and weight average \(<wt_{spin}>=1\). The use of expressions (5) and (6) moves our description from the language of spin amplitudes toward the language of crosssections and probability distributions; since amplitudes squared contribute only.
All complexities are in the calculation of \(R_{i,j}\) spin correlation matrix for production and \(h^i_{\uptau ^+} h^j_{\uptau ^}\) polarimetric vectors for the decay of \(\uptau \) leptons. The \(R_{i,j}\) matrix describes the full spin correlation between the two \(\uptau \) leptons as well as the individual spin states of the \(\uptau \) leptons. The \(R_{i,j}\) depend on kinematics of the production process only, and \(h^i_{\uptau ^+} h^j_{\uptau ^}\) respectively on the kinematics of \(\uptau ^+\) and \(\uptau ^\) leptons. The explicit definition of the matrix \(R_{i,j}\) and vectors \(h^i_{\uptau ^+}\), \(h^j_{\uptau ^}\) is rather lengthy and also well known, see Refs. [28, 29] for detailed definitions. It is decay channel dependent.
So far we discussed the case of a \(\uptau \) lepton pair in the final state, being the case of \(H \rightarrow \uptau \uptau \) or \(Z/\upgamma ^* \rightarrow \uptau \uptau \) processes. The case of only one \(\uptau \) lepton in the final state, that is the case of \(W^\pm \rightarrow \uptau \; \upnu _\uptau \) or \(H^\pm \rightarrow \uptau \; \upnu _\uptau \) is much simpler. The \(R_{i,j}\) matrix is replaced by the vector of components \(R_t,R_x,R_y,R_z= 1,0,0,\mp 1\) respectively for W and charged Higgs decays. The sum over two indices is thus reduced to the sum over one index only, the axis z is the direction of \(\uptau _\upnu \) from \(W^\pm /H^\pm \) decay as seen from the \(\uptau \) lepton restframe, and the spin weight read thus \(wt_{spin}= 1\pm h_{\uptau }^z\). The frames choices (presented in the next Section) for that case could have been simpler than for Z / H decays, no details of transverse directions are then needed.
2.2 Formula using parton level amplitudes
To introduce the changes due to different spin effects in modified production process or the decay models, one can define in the generated sample (i.e. without regeneration of events) the weight WT, representing the ratio of the new to old crosssections at each point in the phase space.
3 WT calculations in TauSpinner
The formulae listed above are used in TauSpinner for the calculation of distinct components of WT, see Eq. (10). Let us start with the main weight of the spin effects, \(wt_{spin}\) defined by Eq. (4). With this weight, for the samples where spin effects of \(\uptau \) lepton production are absent, they can be inserted into decay distributions. Alternatively, its inverse can be used to remove spin effects from a sample where they are taken into account. As a building block of this weight introducing the dependence on the production process, the matrix \(R_{i,j}\), is given by the formula (8). The other weights, \(w_{prod}\) and \(w_{decay}^{\uptau ^\pm }\) are defined by formulae (11, 12).
It is useful to introduce the notation \(P^z_{\uptau }=R_{t,z}=R_{z,t}\), which represents the longitudinal polarization of the single \(\uptau \) lepton (if one integrates out possible configurations of the other \(\uptau \) lepton ). In usually sufficient approximation of helicity states, that is when transverse momenta of \(\uptau \) decay products are neglected, as is the case of ultrarelativistic \(\uptau \) leptons, the \(P^z_{\uptau }\) is the only nontrivial (dynamic dependent) element of matrix R. All others are equal to ±1, or can be set to 0. We will return to the details later.
In the calculation of \(wt_{spin}\) and \(w_{prod}\) the physics uncertainty depends on the accurateness of the factorization assumptions for separation of patron level matrix elements and PDFs and also on the choice of a particular PDFs parametrization. Nothing in principle would change if instead of \(2\rightarrow 2\) body production matrix element one would use the the ones for \(2\rightarrow 2+n\), where n denotes additional partons/jets or other particles (of summed spinstates). In addition to the choice of PDFs (eventually also model of underlying event interactions) for parton level matrix elements one has to make a careful choice of how hard scattering kinematics is reconstructed from information available in the event.
Calculation of \(wt_{decay}^{\uptau ^{\pm }}\) involves modeling of \(\uptau \) lepton decays only. This weight is useful in studies of the resulting systematic uncertainties. This part of the code is using function of the Tauola library.
We will return to these points later, but one can keep it in mind already now, while reading the following.
3.1 Kinematical frames
The components necessary for the WT weight are calculated in different frames. This is a correct approach as long as details of boosts and rotations connecting frames are meticulously followed. Also spin states of the \(\uptau \) leptons may be defined in different frames than four momenta of the hard process. Bremsstrahlung photons and properties of the matrix element in their presence, require a dedicated treatment.
Frames used for the calculation of components used in weights calculation, Eq. (10). Specified are also frames to which these components need to be transformed
Object  Frame of object calculation  Frame of object use  Comment 

\( R_{i,j} \) for \(wt_{spin}\)  A (or B)  \(C^\pm \)  B if transverse spin included 
\(h^i_{\uptau ^+}, h^j_{\uptau ^} \) for \(wt_{spin}\)  \(D^\pm \)  \(C^\pm \)  
\(wt_{prod} \)  A (\(A'\))  \(A'\) is used if bremsstrahlung photons are present  
\(wt_{decay}\)  \(D^\pm \)  \(D^\pm \) 
 A :

The basic frame (starting point) for kinematic transformations and all other frame definitions.
The rest frame of the \(\uptau \) lepton pair is used (and not of \(\uptau \) lepton pair with the final state bremsstrahlung photons combined). Such choice is possible thanks to the properties of bremsstrahlung amplitudes. Emitted photons do not carry out the spin. This nontrivial observation is exploited also in Photos Monte Carlo phase space parametrization, see Refs. [30, 31]. The definition of the rest frame of the \(\uptau \) lepton pairs is completed with incoming partons set along the zaxis.
 \(A':\)

The rest frame of the \(\uptau \) lepton pairs and the final state bremsstrahlung photons combined. Incoming partons are again set along the zaxis. This frame is used for calculating the production weight \(wt_{prod}\) and the spin correlation matrix \(R_{i,j}\); if no bremsstrahlung photons are present it is equivalent^{3} to frame A. In every case we reconstruct \(x_1, x_2\), the arguments of the PDF function, from the virtuality M and the longitudinal to the beam direction component (\(p_L\)) of the intermediate state (sum of momenta of \(\uptau ^+\; \uptau ^\; n\upgamma \)) momentum in lab frame. The center of mass energy of pp scattering is used to calculate \(x_1 x_2 \) through relations \(x_1 x_2 CMS_{ENE}^2 = M^2(\uptau ^+\; \uptau ^\; n\upgamma )\), \((x_1x_2)\) \(CMS_{ENE} = 2 p_L(\uptau ^+\; \uptau ^\; n\upgamma )\). The \(n\upgamma \) is assumed to correspond to the final state bremsstrahlung associated with the \(\uptau \) lepton pair production and its momentum has to be taken into account, but only in the calculation of the virtuality for the intermediate \(Z/\upgamma ^*\) state in case of \(2\rightarrow 2\) amplitudes.^{4} Note that \(A'\) is used for \(x_1, x_2 \) calculation only. The \(2\rightarrow 2\) hard process scattering angle is calculated in frame A.
 B :

The rest frame of the \(\uptau \) lepton pairs, with \(\uptau \) leptons along the zaxis. It is used for common orientation of production and decay coordinate systems. In this frame the polarimetric vectors \(h_{\pm }\) are defined. Transformation \(A \rightarrow B \) requires rotation.
 \(C_{\uptau ^{\pm }}:\)

The rest frames of individual \(\uptau \) leptons with the direction of the boost to \(\uptau \) lepton pair restframe along the zaxis. Transformation \(B \rightarrow C_{\uptau ^+}\) or \(C_{\uptau ^}\) requires boost only.
 \(D_{\uptau ^{\pm }}:\)

The rest frames of individual \(\uptau \) leptons, with \(\upnu _{\uptau }\) along the zaxis. It is used for the calculating decay weights. In fact in the frames \(D_{\uptau ^{\pm }}\) also the polarimetric vectors \(h_{\uptau ^{\pm }}\) are calculated and then rotated back to frame \(C_{\uptau ^{\pm }}\).
In Table 1, we summarize which frames are used for calculations of different variables and then to which frames they are boosted (rotated) before being used in formula (7). Let us stress that it is not only important to define all the frames of type \(AD\) but also the Lorentz transformations between them.
The frame of type A is used for calculation of the hard process amplitudes. If only longitudinal components of spin density matrix are taken into account, we do not need to define in detail the transverse directions (quantization frame versors) with respect of \(\uptau \) lepton momenta, and control on the corresponding details of boost methods to the rest frames of \(\uptau \) leptons is not needed. However, the code of TauSpinner controls such details of the boosts, because it is prepared to handle also cases when the complete spin density matrix is used.
The frames of type B and of type C have common direction of the zaxis, also x and y axes coincide. Frame B is used for \(R_{i,j}\) calculation if transverse degrees of freedom are taken into account. Calculation of the spin weight, that is contraction of indices in \(wt_{spin} = \sum _{ij} R_{i,j}\) \( h^i_{\uptau ^+} h^j_{\uptau ^}\), is performed in frames \(C_{\uptau ^+}\), \(C_{\uptau ^}\). It enables control on transverse spin effects. Frames of type D are used for calculation of decay matrix elements and \(h^{i}_{\uptau ^+},h^{i}_{\uptau ^} \) polarimetric vectors with methods from the Tauola library, see Ref. [29] for details.
Let us note that we have used such frames in many applications already at the time of LEP analyzes. They were useful for comparisons and tests. These choices once established can be easily modified whenever necessary, e.g. to fulfill the constraints of particular conventions of spin amplitude calculations, see e.g. in Ref. [27].
Let us comment on the possible future improvement of the definition of the frame A, to allow useful freedom of choice. At present in the TauSpinner the simplest possible ansatz is used in definition of lepton pair restframe A. For the frame A beam direction (necessary to define Bornlevel scattering angle), it is assumed that no jets of substantial \(p_T\) are present and \(p_T\) can be ignored. This can be improved without redoing the design of the above tree of frame definitions. The studies for matrix elements featuring one or two high \(p_T\) jets are already documented in Refs. [32, 33]. The corresponding modifications of the code were not yet introduced into TauSpinner, as there are no clear indications of their numerical importance, but it is a path for the possible forthcoming improvement.
3.2 Production weight \(wt_{prod}\) and spin correlation matrix \(R_{i,j}\)
The \(R_{i,j}\) matrix is not Lorentz invariant. In fact, its indices run over coordinates in two frames, \(C_{\uptau ^{+}}\) and \(C_{\uptau ^{}}\). As input for matrix element calculation the four momenta of A frame are used. For details of relations between frames and elements used in weight calculations, see also Table 1.
For calculation of the production weight \(wt_{prod}\) and the spin correlation matrix \(R_{i,j}\), the centreofmass frame of the \(\uptau \) lepton pair with incoming partons being along the zaxis (frame of type A) is not the optimal one. It is nonetheless used if there is no interest in the transverse spin degrees of freedom. Frame of type B, with \(\uptau \) leptons along the zaxis, is more convenient and with the x and the y axes parallel to the ones of frames \(C_{\uptau ^{\pm }}\), represents the most convenient setup. In fact all these three frames B and \(C_{\uptau ^{\pm }}\) are used simultaneously for calculation of the spin weight of Eq. (4).

Boost both \(\uptau \) leptons and their decay products from the laboratory frame to the restframe of \(\uptau \) lepton pair.

Rotate all to the frame, where the direction of incoming partons is along the zaxis (frame A).

Rotate so that \(\uptau \) leptons are set along the zaxis and incoming partons remain in the \(zy\) plane (frames \(C_{\uptau ^\pm }\) have to be correlated with B by a boost along the z axis). These frames are used for \(R_{i,j}\) spin states definition too.

Presence of the final state bremsstrahlung from \(\uptau \) lepton pair brings complication, because the rest frame of the \(\uptau \) lepton pair is not the rest frame of the resonance which decayed into \(\uptau \) lepton pair. For the sake of kinematical transformations, frames A and B defined as above are used. However, for the calculation of matrix elements we use frame \(A'\), where effectively bremsstrahlung photons are absorbed into \(\uptau \) lepton momenta. For calculation of \(x_1, x_2\) we use the invariant mass, which can be easily calculated in frame \(A'\).
3.3 Decay weight \(wt_{decay}^{\uptau ^{\pm }}\) and polarimetric vectors \(h_{\uptau ^{\pm }}\)

Boost all decay products along the zaxis to the rest frame of the \(\uptau ^{\pm }\) lepton (frames \(C_{\uptau ^{\pm }}\)).

Rotate again \(\uptau \) lepton daughters so that \(\uptau \) neutrino is along the zaxis (frames \(D_{\uptau ^{\pm }}\)).

Calculate in frames \(D_{\uptau ^{\pm }}\) polarimetric vectors \(h^i_{\uptau ^\pm }\), rotate them back from \(D_{\uptau ^{\pm }}\) to \(C_{\uptau ^{\pm }}\). Only then they can be contracted with \(R_{i,j}\) for \(wt_{spin}\) calculation.
4 Exact and approximate spin weight \(wt_{spin}\)
Basic formula (3) of Sect. 2.1 is exact. Because of approximated calculations (introduction of parton level amplitudes) or as explained later in the section, to obtain a physical picture easier to interpret (valid in ultrarelativistic case only) we can introduce simplifications. No such simplification was introduced yet. Let us recall first that according to \(R_{i,j}\) and \(h_{\uptau ^{\pm }}^i\) definitions, \(R_{t,t}=1\) and \(h_{{\pm }}^t=1\) (we can use shorter notation \(h_{{\pm }}^i=h_{\uptau ^{\pm }}^i\)).
4.1 Neglecting \(m_\uptau ^2\) terms
4.2 Neglecting transverse spin correlations and spin state probabilities
A further approximation (not always used) to include longitudinal spin effects only, means that terms \(R_{i,j}\) are set to zero for \(i,j=x,y\). In general those terms can be large, but as they result in dependencies of transverse with respect to \(\uptau \) lepton direction components of \(\uptau \) lepton decay products momenta, they often do not lead to measurable effects and can be dropped.
4.3 Longitudinal versus transverse spin correlations
In the formalism discussed above, there is a seemingly rather minor difference between the situations when the complete spin effects or only longitudinal ones are taken into account. The case of longitudinal spin effects only means that all \(R_{i,j}\) components are set to zero except \(R_{t,z}\), \(R_{z,t}\) and \(R_{t,t}=1\), \(R_{z,z} = \pm 1\); the sign depends on whether the decaying object is a scalar or a vector and \(R_{t,z}\) is equal to longitudinal \(\uptau \) lepton polarization \(P_{\uptau }^z\). No difference in the reweighting algorithm is needed with this definition of \(R_{i,j}\). The transverse spin correlations are introduced with nonzero \(R_{x,x}\), \(R_{y,y}\) and offdiagonal \(R_{x,y}\), \(R_{y,x}\), without any modifications of the t and z components.
5 The \(2 \rightarrow 2\) parton level processes
The implemented methods calculate internally a complete set of weights but as a default one, the spin correlation/polarization weight, as most often used in the applications is returned.^{5} Other weights are returned by supplementary methods.^{6}
5.1 Production weight
The production weight \(wt_{prod}\) which is a sum over all configurations of \(\uptau \) leptons spin and flavours of incoming partons of matrix element squared multiplied by PDFs is calculated in frame \(A'\). The parton level angular kinematic configuration is usually taken in the A frame. The \(R_{i,j}\) are calculated in A or \(A'\) frame, except the case when transverse spin effects are taken into account and frame B has to be used.
5.2 Decay weights
Calculation of the decay weights \(wt_{decay}^{\uptau ^+}\) and \(wt_{decay}^{\uptau ^}\) is a byproduct of polarimetric vectors of \(h^i_{\uptau ^+}\) and \(h^j_{\uptau ^}\) calculation. This calculation is performed in frames \(D_{\uptau ^\pm }\). The methods of Tauola used for \(h^j_{\uptau ^}\) calculation, provide at the same time decay matrix elements squared summed over the \(\uptau \) lepton spin which are used in \(wt_{decay}^{\uptau ^\pm }\).
5.3 Spin correlation matrix \(R_{i,j}\)
In most cases the spin correlation matrix \(R_{i,j}\) is calculated in frame A or \(A'\). Frame B is used if transverse spin effects are taken into account.
Note, that the weight \(wt_{prod}\) is obtained as a byproduct of \(R_{i,j}\) calculation, in fact of its \(R_{t,z}\), \(R_{z,t}\) components.^{7} In case of using directly the formula for Born crosssection with vector/axial couplings and \(Z/\upgamma ^*\) propagators (implemented in TauSpinner) this connection is less transparent.
5.3.1 Case of a spin zero resonance
If the \(\uptau \) lepton mass is small in comparison to the \(\uptau \) lepton pair virtuality then \(R_{z,z} = 1\). For the scalar Higgs boson holds \(R_{x,x} = R_{y,y} = 1\) and \(R_{x,x} = R_{y,y} = 1\) for the pseudoscalar, while the mixed scalarpseudoscalar configuration the formula includes scalarpseudoscalar mixing angle and nonzero offdiagonal \(R_{x,y}, R_{y,x}\) terms. This extension is important for the simulation of Higgs CP parity signatures.
5.3.2 Case of a spin one resonance (Drell–Yan)
5.3.3 Case of a spin two resonance X (non SM Higgs)
5.4 Calculating the \(wt_{spin}\) weight
For the \(wt_{spin}\) calculation formulae (15, 16) are available. However, unless required differently by the user, the default version is to omit transverse spin correlations, i.e. \( R_{x,x} = R_{y,y} = R_{x,y} = R_{y,x} = 0\), corresponding to formula (17). In the following we will exploit components of \(R_{i,j}\) for the individual cases prepared in the previous subsection.
5.4.1 Case a of spin zero resonance (scalar Higgs)
5.4.2 Case a of spin two resonance X (non SM Higgs)
5.4.3 Case a of spin one resonance (Drell–Yan)
The \( R_{x,x}, R_{y,y}, R_{x,y}, R_{y,x} \) are used directly as transverse components for \(R_{i,j}\) in case of nonstandard model calculation. If one is not interested in the actual size of transverse effects, as predicted by \({\mathscr {O}}(\upalpha )\) EW corrections, one can also modify hard coded pre initialized to zero values, or use non SM Higgs options discussed previously.
 If in the generated sample spin correlations between two \(\uptau \) leptons are included but no other effects, the weight takes the form:Such choice for the sample introduces dominant spin effect (the correlation), which at the same time is free of systematic errors. It is a consequence of the spin 1 state decaying to \(\uptau \) lepton pair.$$\begin{aligned} wt_{spin}^{no\ pol} = \frac{wt_{spin}}{ 1.0 + sign \cdot h^{z}_{+} h^{z}_{} }. \end{aligned}$$(29)
 If in the generated sample spin correlations and partial (no angular dependence and no incoming quark flavour dependence) polarization effects are included, the weight should take the form:where the denominator again represents spin correlations present in the sample. One can expect the \(P^{z, part}_{\uptau }=P^{z}_{\uptau }(s,\cos (\uptheta =0))\) calculated for incoming electrons being the easiest way to obtain an average correction. This approach reproduces correctly the average individual \(\uptau \) lepton polarization for the events of \(\uptau \) lepton pair virtuality close to the Z boson peak. Such choice for the generated sample could be motivated as follows. It features all spin effects except those which depend on the incoming partons PDFs, thus it is free of related systematic uncertainties, making it convenient for studying systematic uncertainty from PDFs. The corrections introduced with \(wt_{spin}^{no\ angular}\) are even smaller than those of \(wt_{spin}^{no\ pol}\).$$\begin{aligned}&wt_{spin}^{no\ angular} \nonumber \\&\quad = \frac{wt_{spin}}{ 1 + sign \cdot h^{z}_{+} h^{z}_{} + P^{z, part}_{\uptau } h^{z}_{+} + P^{z, part}_{\uptau } h^{z}_{}} \end{aligned}$$(30)
5.5 Use of spin correlation/polarization weight in special cases
If the generated sample feature spin effects then the \(wt_{spin}\) of formula (3) can be used as weight \( WT = 1/wt_{spin}\) to remove spin effects.
The cases when only a part of spin effects is taken into account, like in Ref. [36], more specifically the spin correlation but no effects due to vector and axial couplings to the intermediate \(Z/\upgamma ^{*}\) state, can be corrected with the help of the appropriate weights as in examples for Eqs. (29, 30). On the other hand, such partial spin effects can be also removed completely, e.g. for consistency checks. The case, when spin correlations and average \(\uptau \) lepton polarization are present, but angular dependence is absent, can be treated as usual with Eq. (10).
5.6 Born crosssection
Until now, we were expressing formulae in the language of spin amplitudes and spin weights (spin correlation matrix \(R_{i,j}\)). However, often crosssections calculated at the parton level are available for the explicit helicity states of the outgoing \(\uptau \) leptons. Several such lowest order formulae for calculating crosssections of an analytical form are implemented in the code of the TauSpinner itself, or of its examples. Some of them represent the legacy code, ported from different projects, others were coded for the TauSpinner application as benchmarks on the EW parameters setting and are used in the published tests. For completeness of the documentation we describe them in Appendix B.9.
6 Polarimetric vectors, polarization and helicity states
Calculation of the polarimetric vectors \(h_{\uptau }\) is performed using the code from the Tauola library. The conventions is that \(h_{\uptau } = (h_{\uptau }^x, h_{\uptau }^y, h_{\uptau }^z, h_{\uptau }^t)\) (i.e. the last component is timelike) following the convention used in FORTRAN. The same FORTRAN code calculates decay matrix element squared, which are returned as well, as auxiliary information.
Depending on which decay channel is present the calculation is performed using the respective functions from the Tauola library. Not for all \(\uptau \) lepton decay channels, see Table 2, \(h_\uptau \) is nonetheless calculated. About 97.5% of the decay width is covered, i.e. the polarimetric vector h is calculated, otherwise its spatial components are set^{9} to 0.
Summary of \(\uptau \) lepton decay modes implemented for calculation of polarimetric vectors. Branching fractions for each decay mode according to [37] illustrate the completeness of the algorithm. The “Other” decay modes are treated as unpolarized ones
\(\uptau \) lepton decay mode  Branching fractions % 

\(e^ {\bar{\upnu }}_e \upnu _{\uptau }\)  17.85 
\(\mu ^ {\bar{\upnu }}_{\mu } \upnu _{\uptau }\)  17.36 
\(\uppi ^ \upnu \)  10.91 
\(\uppi ^ \uppi ^{0} \upnu \)  25.51 
\(\uppi ^ \uppi ^{0} \uppi ^{0} \upnu , \uppi ^ \uppi ^+ \uppi ^ \upnu \)  9.29, 9.03 (incl. \(\upomega \)) 
\( K^ \upnu \)  0.70 
\( K^ \uppi ^{0} \upnu , K^0 \uppi ^ \upnu \)  0.43, 0.84 
\(\uppi ^ \uppi ^+ \uppi ^ \uppi ^0 \upnu \)  4.48 (incl. \(\upomega \)) 
\(\uppi ^ \uppi ^0 \uppi ^0 \uppi ^0 \upnu \)  1.04 
Other  2.5 
As a byproduct of the \(h_\uptau \) calculations, the \(wt_{decay}^{\uptau ^\pm }\) of Eq. (12) is obtained.
6.1 Longitudinal polarization
The calculation of components of the \(R_{i,j}\) spin density matrix in the ultrarelativistic limit is then equivalent to the calculation of modules for matrix elements of \(\uptau \) lepton pair production in given helicity configurations. Depending on the approach, either \(p^z_{\uptau }\) or \(P^z_{\uptau }\) is calculated from the other one, using respectively formula (21) or (20). The case when EW effects are included, technically differs only slightly,^{10} despite the fact that then the transverse spin effects can be taken into account. In all cases the relation \(R_{t,z}= P^z_{\uptau }\) holds, no pretabulated EW results are used for this component of \(R_{i,j}\). This can be easily activated though, e.g. if results for large s are needed. Around the Z peak presently implemented EW library may be less suitable. Formula (19) is used for attribution of helicity states.
6.1.1 Case of a spin = 0 resonance (scalar (Higgs))
In \(H \rightarrow \uptau \uptau \) lepton decays the probability of the helicity state denoted \(p^z_{\uptau }\) is equal to 0.5 for \( P^z_{\uptau } = 1\) and for \( P^z_{\uptau } = 1\) as well, see Table 3.
6.1.2 Case of spin = 1 resonance (Drell–Yan)
In \(Z/\upgamma ^* \rightarrow \uptau \uptau \) lepton decays the probability of the helicity state denoted \(p^z_{\uptau }\) is a function of the \(\uptau \) lepton scattering angle, \(\uptheta \), and the center of mass energy squared of the hard process, s. It is true at Born level, and in the ultrarelativistic limit [36].
Note that the rest frame of the production process and the rest frame of the \(\uptau \) lepton pair might not be the same due to photon bremsstrahlung in the \(\uptau \) lepton pair production vertex. We have discussed this already in Sect. 3.1, but let us complete some more technical details now.
Probability for the helicities of the of \(\uptau \) leptons from different origins [36]
Origin  Hel. \({\uptau _1}\)  Hel. \({\uptau _2}\)  Prob. 

Neutral Higgs boson: H  +  −  0.5 
−  +  0.5  
Neutral vector boson: \(Z/\upgamma ^*\)  +  +  \(p_{\uptau }^{z}\) 
−  −  \(1  p_{\uptau }^{z}\)  
Charged Higgs boson: \(H^{\pm }\)  +  −  1.0 
Charged vector boson: \(W^{\pm }\)  −  −  1.0 
For calculating the spin weight, the polarization \(P^z_{\uptau }\) of the single \(\uptau \) lepton in a mixed quantum state is calculated neglecting transverse spin degrees of freedom (ultrarelativistic limit). The \(P^z_{\uptau }\) is then a linear function of the probability for the helicity state,^{11} Eq. (21).
6.1.3 Case of a spin two resonance X (not a Higgs)
In this case a user provided function required to replace \(\frac{d \upsigma }{d \cos \uptheta }\), the nonStandard physics effective Born parametrizations, is not included in the TauSpinner library, and a dummy function is provided only. It can be replaced with a user one, see Ref. [12] for details and in particular the TAUOLA/TauSpinner/examples/taureweighttest.cxx directory. This \(2\rightarrow 2\) parton level process function nonSM_adoptH (or nonSM_adopt) has the following arguments (int ID, double S, double cost,int H1,int H2, int key). It can be activated in the user code at the execution time, see Appendix B.2.
6.2 Attributing \(\uptau \) (or \(\uptau \) pair) helicity states
For the individual event, the \(\uptau \) helicity (\(+/\)) is attributed stochastically. The probability for given configurations of the longitudinal polarization of \(\uptau \) leptons of different origins [36] is shown in Table 3. These probabilities can be used, when decay kinematical configurations of the decays are not yet constructed.
 Case of a spin zero resonance (scalar Higgs)where \(sign = 1\).$$\begin{aligned} p() = \frac{ 1 + sign \cdot h^{z}_{+} \cdot h^{z}_{} + h^{z}_{+} + h^{z}_{} }{ 2 + 2 \cdot sign \cdot h^{z}_{+} \cdot h^{z}_{} } \end{aligned}$$(36)
 Case of a spin two resonance X (not a Higgs)where \(sign = +1\).$$\begin{aligned} p() = (1 + P^z_{\uptau }) \frac{ 1 + sign \cdot h^{z}_{+} \cdot h^{z}_{} + h^{z}_{+} + h^{z}_{} }{ 2 + 2 \cdot sign \cdot h^{z}_{+} \cdot h^{z}_{} + 2.0 \cdot P^z_{\uptau } \cdot (h^{z}_{+} + h^{z}_{}) }\nonumber \\ \end{aligned}$$(37)
 Case of a spin one resonance (Drell–Yan)where \(sign = +1\).$$\begin{aligned} p() = (1 + P^z_{\uptau }) \frac{ 1 + sign \cdot h^{z}_{+} \cdot h^{z}_{} + h^{z}_{+} + h^{z}_{} }{ 2 + 2 \cdot sign \cdot h^{z}_{+} \cdot h^{z}_{} + 2.0 \cdot P^z_{\uptau } \cdot (h^{z}_{+} + h^{z}_{}) }\nonumber \\ \end{aligned}$$(38)
7 The \(2 \rightarrow 4\) process
At this point we have completed the discussion for the case when the TauSpinner is used assuming a parton level processes of \(2\rightarrow 2\) type. Let us turn now to the case when \(2\rightarrow 4\) parton level processes are used. This extension has been introduced recently, see Ref. [15] for a detailed description.

Kinematics
For calculation of factorization scale, instead of virtuality of \(\uptau \) lepton pair, virtuality of lepton pair combined with jets is used. In fact a few options to define the \(Q^2\) factorization scale have been implemented. The definitions of frames type A, B, \(C_{\uptau ^\pm }\) and \(D_{\uptau ^\pm }\) as explained for case of \(2 \rightarrow 2\) processes are used. In principle the additional rotation by the angle \(\uppi \) around the axis x would be again needed for the \(\uptau ^\) in transformations from B, \(C_{\uptau ^}\) frames. This is due to convention used for spin amplitudes.^{12} The definition of the previously discussed frame \(A'\) needs to be modified. Not only bremsstrahlung photons need to be added to \(\uptau \) leptons to obtain kinematic configurations for matrix element calculation, but outgoing partons (jets) fourmomenta have to be taken into account as well.

Matrix Element Calculation
Matrix element squared are calculated for given helicity states of \(\uptau \) leptons and flavours of incoming/outgoing partons in frame A’. In particular formula (23) is used for calculation of \(R_{z,t}\) and \(R_{t,z}\), which are then used as of frame B, without any modifications. The EW scheme used and \(\upalpha _s(Q^2)\) can be configured using several options defined in Ref. [15].

Extension due to flavours of accompanying partons/jets
All sums \(\sum _{flavour}\) as used in Sect. 2.2 should read now as sums over flavours of incoming and outgoing partons. Of course PDFs convolution with distributions is used for incoming partons only. This modification is extending reweighting algorithm dependence on the final state components consisting of partons (hadronic jets). This technically simple change may be thus of a concern because of additional types of the systematic uncertainties involved.
8 On the systematic errors
In the following the limitations of the program and its systematic uncertainties will be discussed.
One of the questions is whether TauSpinner can be used to modify spin/production/decay features of events; when \(\uptau \) lepton decay library other than Tauola was used, when its physics initialization was different, or when events were generated with QCD matrix elements of higher order than implemented in TauSpinner? If yes, what is the systematic uncertainty or bias which should be attributed to the predictions obtained using a Monte Carlo sample with weights calculated by TauSpinner?
The evaluation of them is not universal, it needs to be repeated for every new observable. We therefore cannot focus the discussion on the tool itself, but rather present general observations concerning reweighting techniques for the \(\uptau \) lepton physics. The topic obviously can not be allembracingly covered in the present paper.
Nowadays Monte Carlo programs such as Herwig [39], Sherpa [20], Pythia [40] have their own \(\uptau \) lepton decay algorithms and physics initializations. One can argue, if in some aspects, they are not better than the ones used in publicly available version of the Tauola library. One can also argue that the reweighting with algorithms like TauSpinner is nowadays an obsolete technique, and that it is better to generate new event samples with modified required physics input, or to use generator own reweighting methods.
In some cases this might be true but it is not always easy to apply in practice. For example, experiments store events in a format which must be universal for all generators. Inevitably some intermediate information is lost. Also, regeneration of such experimentspecific samples with modified assumptions is timeconsuming, because of the detector response simulation and often also because of the CPU needed for each event of the desired phase space region. Event generation became CPU expensive in modern Monte Carlo generators, because of the complexity of the phase space and multiplicity of the outgoing legs in the matrixelements.
 A.

Physics driven uncetainty, related to approximations used for particular matrix element calculations of the production and the \(\uptau \) lepton decays, finally of the parton distribution functions.
 B.

Approximations related to the program design.
 C.

Technical uncertainties related to the mismatch in the way how information is being passed to the program or of approximations used in the generation of samples to be reweighted.
A.
Technically, any \(\uptau \) lepton decay generator, to a great degree, can be understood as consisting of three elements: (i) a phase space generator, (ii) a calculator of matrix elements and finally (iii) a model for hadronic current for semileptonic decays. The last one (iii) is prone to large systematic uncertainties. TauSpinner shares the code for (ii) and (iii) with Tauola. That is also why part of the systematic uncertainties is common. The precision of models used in construction of hadronic currents is optimistically at 5 % precision level and realistically one can expect a precision rather at the level of 10 or 20 % only. Smaller ambiguities are expected for inclusive distributions like branching ratios or onedimensional spectra, larger ones for multidimensional distributions. It is crucial, that the work on related comparisons with the data, fits and evaluation of systematic uncertainties is performed within the experiments. Let us focus on the systematic uncertainty evaluation and practical consequences for TauSpinner when applied to events where \(\uptau \) lepton decays are simulated with a different library than Tauola. The particular choice of hadronic currents used in samples generated with Herwig, Sherpa or Pythia needs to be known and the same choice has to be used for TauSpinner too. The techniques how to check if proper choice was taken are documented in Ref. [13] (Section 4.5 “Consistency checks”). Consequences of mismatches are of numerical importance.
If the matrix elements used in the \(\uptau \) lepton decay sample generation do not match those assumed to be used for the calculation of TauSpinner weights, results can be largely inaccurate. Particularly numerical instabilities may occur if the matrix element used for the weight denominators would approach zero in nondepleted regions of the phase space. The problem may appear for multiscalar final states, but for \(\uptau ^\pm \rightarrow l^\pm \upnu {\bar{\upnu }}\), \(\uptau ^\pm \rightarrow \uppi ^\pm \upnu \) or even \(\uptau ^\pm \rightarrow \uppi ^\pm \uppi ^0 \upnu \) decays, which amount for 2/3 of all \(\uptau \) lepton decays, this problem is generally absent. Let us concentrate on the case of \(\uptau ^\pm \rightarrow (3\uppi )^\pm \ \upnu \) because it contributes more than 20 % to the \(\uptau \) lepton decay rate. We have observed that in some regions of the phase space the modeling of \(\uptau \) lepton decays can lead to distributions which differ by a factor of 2, or even more, depending on the data used as an input. At the same time, for more inclusive results like onedimensional distributions differences can be of the order of 10 % or less. For numerical evaluation see Ref. [41] (Section 10). Eight variants of hadronic currents were presented and used for the discussion in Section 2 of Ref. [41], most of them as available in Tauola, but one of them was taken from Pythia 8, in the version of the year 2015. Tests how to check if indeed sufficient level of precision was achieved are discussed in the summary of that paper. It is stressed that at least 3dimensional distributions are necessary to appropriately identify differences. Tests of modelling for \(\uptau \) lepton decays are particularly important for applications based on Machine Learning techniques. Such tests were performed in Ref. [42], for Higgs CP parity sensitive observables in \(H\rightarrow \uptau ^+\uptau ^\) with \(\uptau \) lepton decays to three scalars.
B.
Let us note that not only the matrix elements, used for \(\uptau \) lepton decays in the reweighted sample, have to match the one used in the weight calculation. Also the level of approximation used for calculation of production matrix element and in particular spin effects have to match the one used in spin weight denominators. See Ref. [13], Section 4, for details on the consistency checks.^{13}
The matrix element for \(pp \rightarrow \uptau ^+\uptau ^ X\) production are generally not available. They are obtained from the factorization theorems separating parton distribution (parton showers) from the hard matrix elements. For the case of pp collisions, references [32, 33] can be used to provide necessary input from the theoretical side for the algorithmic solutions. The tests of consistency are presented^{14} in Section 5.4 of Ref. [13]. Following the results of references [32, 33] tests consisting of comparing spin effects implemented in different \(\uptau \) lepton pair rest frames can be very useful on top of the ones for the dependence of results on EW schemes studied in these papers.^{15}
The comparisons of results obtained from TauSpinner working in \(2 \rightarrow 2\) and \(2 \rightarrow 4\) matrix element modes offer the way to check if factorization used in TauSpinner algorithm is sufficiently precise for the configurations featuring high \(p_T\) jets.
C.
One should bear in mind, that information on intermediate and also final state particles stored by many of todays generators use distinct variants of encoding conventions, even if the same format like HepMC is used in every case. That can be a problem for many applications used by experiments, e.g. in the estimation if reconstruction algorithms work properly, and if the initial input of the generation can be deconvoluted from the event response of the detector. Inescapably this may cause problems for TauSpinner, too. Implicitly, the event record design relies on the assumption that the event is represented by a treelike structure. This generally can not be assured, in particular because of quantum interference and quantum entanglement. Some approximations need to be used, or information of intermediate states, such as EW bosons abandoned.^{16}
Several options of TauSpinner initialization are prepared. They can help to understand if the samples were e.g. generated particular, partial spin implementation only. Then they can be used to reweight to the required physics assumptions, see Ref. [13].
9 Summary
In this paper we have presented the theoretical basis and description of algorithms used in the TauSpinner program for simulating spin effects in the production and the decay of \(\uptau \) leptons in protonproton collisions at the LHC. The primary source of \(\uptau \) leptons are Drell–Yan processes of single W and Z boson production, often accompanied by additional jets. Since the Higgs boson discovery by ATLAS and CMS Collaboration in 2012, the \(H \rightarrow \uptau \uptau \) lepton decay became the most promising channel for studying CP properties of its couplings to fermions. With more data available from Run II of the LHC also \(\uptau \) lepton decays in case of multiboson production will become part of interesting signatures.
The algorithms discussed here allow for the separation of the \(\uptau \) lepton production and decay in phenomenological studies. We have discussed options used for simplifying descriptions and approximations used.
Although the framework of TauSpinner is prepared for implementation of the non Standard Model couplings, we have not given too much attention to this possible development path. We have recalled in the Appendices most of examples and applications. They are available with the distributed code. References, covering details wherever possible are given. The technical information is brief, details are delegated to the README files. Techniques of how to estimate systematic uncertainties for the results obtained with TauSpinner were briefly reviewed.
Footnotes
 1.
The double sum runs in principle over all possible flavours for the two incoming partons: \(g, u, {\bar{u}}, d, {\bar{d}}, c, {\bar{c}}, s, {\bar{s}}, b, {\bar{b}}\).
 2.
It can seem natural to choose the initial flavours, on the basis of probabilities obtained from production density \(1/N_{normalization}\; f(x_1, \ldots )f(x_2, \ldots )\bigl (\sum _{\uplambda _1, \uplambda _2 }{{\mathscr {M}}}^{prod}_{parton\; level}^2 \bigr )\) and then calculate weights for such flavour configuration. It would not be correct. The dependence on the decay configuration, already fixed and stored for the event, would be then ignored. In case of the Tauola interface incoming flavours are obtained from the event record and decays are generated accordingly.
 3.
In case when photons are present and for \(2 \rightarrow 4\) matrix elements modifications are needed to assure that onmass shell kinematic configuration is passed to the routines calculating spin amplitudes.
 4.
In case when configurations with twojets are evaluated (\(2\rightarrow 4\) processes), not only more attention for the bremsstrahlung photons will be needed, but also the momenta of the jets have to be taken into account in evaluation of \(p_L\) and \(M^2\). We will return to this point in the future.
 5.
Calculation is invoked with the call to calculateWeightFromParticlesH method. The code organization is a consequence of the history of implemented functionalities and benchmarks. Not all features were expected to be included at the beginning:
At first, only longitudinal spin effects were expected to be taken into account and for \( 2 \rightarrow 2\) at parton level processes only. That is why, methods from KORALZ [34] could have been used. Later processes \( 2 \rightarrow 4\) with two jets in final state made original methods focused around calculation of \(\uptau \) lepton polarization i.e. \(R_{t,z}\) less intuitive/convenient. Introduction of options featuring complete spin effects made such organization even less suitable. Still we preserve backward compatibility, of the functioning code and stability of results for tests and examples, accumulated over years.
 6.
 7.
Relation between \(R_{t,z}\), \(R_{z,t}\) and modules of amplitudes is transparent in case of calculation as of Sect. 7.
 8.
Nothing in principle prevents us to perform similar arrangements for \(R_{t,z}\), that is for \(P^z_{\uptau }\) which can be taken from pretabulated EW results as well. Discussion of the systematic uncertainty is then nonetheless needed.
 9.
This is not the case for the Tauola library if used for generating \(\uptau \) lepton decays. Then only for channels featuring more than 5 pions polarimetric vector is calculated with approximation. Still then, it is not set to zero.
 10.
The same formulae using \(R_{i,j}\) matrix are still used, individual parton flavour contributions to \(R_{i,j}\) are obtained numerically from the pretabulated values for some invariant masses and scattering angles. These pretabulated values are read from the stored files. Then results are interpolated to obtain results for required arguments. The x and y components of \(R_{i,j}\) are pretabulated and available for use.
 11.
Note that in paper [11] formula \( P_{\uptau }^z=(2 p^z_\uptau 1)\) is used instead of Eq. (21). There, different (rotated by \(\uppi \) angle with respect to axis perpendicular to reaction) frame is used. Similar convention matching may be necessary for other programs as well, see e.g. nonSM_adopt(); nonSM_adoptH() methods of the taureweighttest.cxx.
 12.
In practice, as no transverse spin effects are taken into account, the convention change is performed while calculating double W[2][2] (amplitudes squared for the helicity states) in wbfdistr.cxx.
 13.
One of such test is to verify whether with the help of TauSpinner weight, spin polarization and spin correlations can be completely removed from the event sample. It is relatively easy to observe if it is indeed the case. The decay product spectra should then not depend on anything else but properties of decay matrix elements and \(\uptau \) lepton momenta.
 14.
They are also distributed together with Tauola and TauSpinner source code.
 15.
Once completed, they open the way for interchanging the EW schemes with the help of the weights. With the improving precision, this may turn out to be important for \(\uptau \) leptons final states including decays as for light leptons production studied in Ref. [16].
 16.
That is not convenient, if properties of such intermediate states are to be measured. For example, reconstruction algorithms are more difficult to debug. From that perspective TauSpinner can be understood as supplementary debugging tool. If its results are far from the expected ones, this often mean, that the content of the (HepMC) event records used in experimental environment was not up to the expectations. Results obtained from TauSpinner can point to the source of difficulties. See Ref. [13], Section 5.4 for examples of such applications.
 17.
 18.
Also bremsstrahlung photons from \(\uptau \) pair production process. In case of multitude entries for the single particle, identification of the one matching the kinematical constraints is necessary. It often requires navigation back and forth through the event record, finding links to mothers, etc.
 19.
In most cases event record format of HepMC is used as an input.
 20.
Lists named tau1_daughters, tau2_daughters are needed.
 21.
The S,cost denote invariant mass squared of the \(\uptau \) lepton pair as well as \(\cos {\uptheta }\) (of the \(2\rightarrow 2\) scattering angle) and ID the identifier for the incoming parton flavour, all for the parton level kinematic configuration prepared by TauSpinner. To get the actual values interpolations between entries of tables is used.
Notes
Acknowledgements
We would like to acknowledge and thank several colleagues who either contributed directly or by stimulating discussions to the development of the TauSpinner package and its applications: M. Bahmani, S. Banerjee, Z. Czyczula, W. Davey, A. Kaczmarska, J. Kalinowski and W. Kotlarski.
Supplementary material
References
 1.G. Aad et al. [ATLAS Collaboration], Eur. Phys. J. C 72, 2062 (2012). https://doi.org/10.1140/epjc/s1005201220626. arXiv:1204.6720 [hepex]
 2.M. Aaboud et al. [ATLAS Collaboration], Eur. Phys. J. C 78(2), 163 (2018). https://doi.org/10.1140/epjc/s1005201856191. arXiv:1709.03490 [hepex]
 3.A. M. Sirunyan et al. [CMS Collaboration], Eur. Phys. J. C 78(9), 708 (2018). https://doi.org/10.1140/epjc/s1005201861469. arXiv:1801.03535 [hepex]
 4.G. Aad et al. [ATLAS Collaboration], JHEP 1411, 056 (2014). https://doi.org/10.1007/JHEP11(2014)056. arXiv:1409.6064 [hepex]
 5.G. Aad et al. [ATLAS Collaboration], JHEP 1504, 117 (2015). https://doi.org/10.1007/JHEP04(2015)117. arXiv:1501.04943 [hepex]
 6.G. Aad et al. [ATLAS Collaboration], JINST 10(09), P09018 (2015). https://doi.org/10.1088/17480221/10/09/P09018. https://doi.org/10.1088/17480221/2015/9/P09018. arXiv:1506.05623 [hepex]
 7.M. Aaboud et al. [ATLAS Collaboration], Eur. Phys. J. C 76(11), 585 (2016). https://doi.org/10.1140/epjc/s1005201644006. arXiv:1608.00890 [hepex]
 8.The ATLAS collaboration [ATLAS Collaboration], ATLASCONF2017050Google Scholar
 9.G. Aad et al. [ATLAS Collaboration], JHEP 1507, 157 (2015). https://doi.org/10.1007/JHEP07(2015)157. arXiv:1502.07177 [hepex]
 10.M. Aaboud et al. [ATLAS Collaboration], Eur. Phys. J. C 76(12), 683 (2016). https://doi.org/10.1140/epjc/s1005201644812. arXiv:1607.05979 [hepex]
 11.Z. Czyczula, T. Przedzinski, Z. Was, Eur. Phys. J. C 72, 1988 (2012). arXiv:1201.0117 ADSCrossRefGoogle Scholar
 12.S. Banerjee, J. Kalinowski, W. Kotlarski, T. Przedzinski, Z. Was, Eur. Phys. J. C 73, 2313 (2013). arXiv:1212.2873 ADSCrossRefGoogle Scholar
 13.A. Kaczmarska, J. Piatlicki, T. Przedzinski, E. RichterWas, Z. Was, Acta Phys. Polon. B 45(10), 1921–1946 (2014). arXiv:1402.2068 ADSMathSciNetCrossRefGoogle Scholar
 14.T. Przedzinski, E. RichterWas, Z. Was, Eur. Phys. J. C 74, 3177 (2014). arXiv:1406.1647 ADSCrossRefGoogle Scholar
 15.J. Kalinowski, W. Kotlarski, E. RichterWas, Z. Was, Eur. Phys. J. C 76(10), 540 (2016). arXiv:1604.00964 ADSCrossRefGoogle Scholar
 16.The ATLAS collaboration [ATLAS Collaboration], “Measurement of the effective leptonic weak mixing angle using electron and muon pairs from \(Z\)boson decay in the ATLAS experiment at \(\sqrt{s} = 8\) TeV,” ATLASCONF2018037 (2018)Google Scholar
 17.S. Schael et al. [ALEPH and DELPHI and L3 and OPAL and SLD Collaborations and LEP Electroweak Working Group and SLD Electroweak Group and SLD Heavy Flavour Group], “Precision electroweak measurements on the \(Z\) resonance”. Phys. Rep. 427, 257 (2006)Google Scholar
 18.P. Ilten, Nucl. Phys. Proc. Suppl. 253–255, 77 (2014)ADSCrossRefGoogle Scholar
 19.D. Grellscheid, P. Richardson, Simulation of Tau Decays in the Herwig++ Event Generator. arXiv:0710.1951 [hepph]
 20.T. Gleisberg, S. Hoeche, F. Krauss, M. Schonherr, S. Schumann, F. Siegert, J. Winter, JHEP 0902, 007 (2009). https://doi.org/10.1088/11266708/2009/02/007. arXiv:0811.4622 [hepph]ADSCrossRefGoogle Scholar
 21.P. Ilten, Nucl. Part. Phys. Proc. 260, 56 (2015)CrossRefGoogle Scholar
 22.J. Bellm, S. Plätzer, P. Richardson, A. Siódmok, S. Webster, Phys. Rev. D 94(3), 034028 (2016). https://doi.org/10.1103/PhysRevD.94.034028. arXiv:1605.08256 [hepph]ADSCrossRefGoogle Scholar
 23.
 24.A. Buckley, Phys. Rep. 504, 145 (2011). https://doi.org/10.1016/j.physrep.2011.03.005. arXiv:1101.2599 [hepph]ADSCrossRefGoogle Scholar
 25.N. Davidson, G. Nanava, T. Przedzinski, E. RichterWas, Z. Was, Comput. Phys. Commun. 183, 821–843 (2012). arXiv:1002.0543 ADSCrossRefGoogle Scholar
 26.S. Jadach, B. Ward, Z. Was, Comput. Phys. Commun. 130, 260–325 (2000). arXiv:hepph/9912214 ADSCrossRefGoogle Scholar
 27.S. Jadach, B.F.L. Ward, Z. Was, Eur. Phys. J. C 22, 423–430 (2001). arXiv:hepph/9905452 ADSCrossRefGoogle Scholar
 28.S. Jadach, Z. Wa̧s, Acta Phys. Polon. B 15, 1151 (1984). Erratum: B16 (1985) 483Google Scholar
 29.S. Jadach, Z. Wa̧s, R. Decker, J .H. Kühn, Comput. Phys. Commun. 76, 361 (1993)ADSCrossRefGoogle Scholar
 30.N. Davidson, T. Przedzinski, Z. Was, Comput. Phys. Commun. 199, 86–101 (2016). arXiv:1011.0937 ADSMathSciNetCrossRefGoogle Scholar
 31.G. Nanava, Q. Xu, Z. Was, Eur. Phys. J. C 70, 673–688 (2010). arXiv:0906.4052 ADSCrossRefGoogle Scholar
 32.E. RichterWas, Z. Was, Eur. Phys. J. C 76(8), 473 (2016). arXiv:1605.05450 ADSCrossRefGoogle Scholar
 33.E. RichterWas, Z. Was, Eur. Phys. J. C 77(2), 111 (2017). arXiv:1609.02536 ADSCrossRefGoogle Scholar
 34.S. Jadach, B.F.L. Ward, Z. Wa̧s, Comput. Phys. Commun. 79, 503 (1994)ADSCrossRefGoogle Scholar
 35.A. Andonov et al., Comput. Phys. Commun. 181, 305–312 (2010). arXiv:0812.4207 ADSCrossRefGoogle Scholar
 36.T. Pierzchala, E. RichterWas, Z. Was, M. Worek, Acta Phys. Polon. B 32, 1277–1296 (2001). arXiv:hepph/0101311 ADSGoogle Scholar
 37.Particle Data Group Collaboration, K. Nakamura et al., J. Phys. G 37, 075021 (2010)Google Scholar
 38.Z. Was, S. Jadach, Phys. Rev. D 41, 1425 (1990)ADSCrossRefGoogle Scholar
 39.J. Bellm et al., Eur. Phys. J. C 76(4), 196 (2016). https://doi.org/10.1140/epjc/s1005201640188. arXiv:1512.01178 [hepph]. N = ATLASCONF2018037
 40.T. Sjötrand et al., Comput. Phys. Commun. 191, 159 (2015). https://doi.org/10.1016/j.cpc.2015.01.024. arXiv:1410.3012 [hepph]ADSCrossRefGoogle Scholar
 41.Z. Was, J. Zaremba, Eur. Phys. J. C 75(11), 566 (2015) Erratum: [Eur. Phys. J. C 76, no. 8, 465 (2016)] https://doi.org/10.1140/epjc/s1005201642952, https://doi.org/10.1140/epjc/s1005201537803. arXiv:1508.06424 [hepph]
 42.E. Barberio, B. Le, E. RichterWas, Z. Was, D. Zanzi, J. Zaremba, Phys. Rev. D 96(7), 073002 (2017). arXiv:1706.07983 ADSCrossRefGoogle Scholar
 43.J. Alwall et al., Comput. Phys. Commun. 176, 300–304 (2007). arXiv:hepph/0609017 ADSCrossRefGoogle Scholar
 44.M. Dobbs, J.B. Hansen, Comput. Phys. Commun. 134, 41–46 (2001). https://savannah.cern.ch/projects/hepmc/
 45.P. Golonka, T. Pierzchala, Z. Was, Comput. Phys. Commun. 157, 39–62 (2004). arXiv:hepph/0210252 ADSCrossRefGoogle Scholar
 46.N. Davidson, P. Golonka, T. Przedzinski, Z. Was, Comput. Phys. Commun. 182, 779–789 (2011). arXiv:0812.3215 ADSCrossRefGoogle Scholar
 47.R. Jozefowicz, E. RichterWas, Z. Was, Phys. Rev. D 94(9), 093001 (2016). arXiv:1608.02609 ADSCrossRefGoogle Scholar
 48.M. Bahmani, J. Kalinowski, W. Kotlarski, E. RichterWas, Z. Was, Eur. Phys. J. C 78(1), 10 (2018). arXiv:1708.03671 ADSCrossRefGoogle Scholar
 49.A. Andonov et al., Comput. Phys. Commun. 174, 481–517 (2006). arXiv:hepph/0411186 ADSCrossRefGoogle Scholar
Copyright information
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
Funded by SCOAP^{3}