18#include "TrkExtAlg/Ext_xp_err.h"
24static const double Cinv( 3335.640952 );
26static const double C( 0.002997924582 );
27static const double Small( 0.01 );
28static const double Eps(1.0e-12);
29static const double Infinite( 1.0e10 );
31static const int Ndim_herr( 5 );
35 m_xv(3), m_pv(3), m_xp_jcb(Ndim_err,Ndim_err,0),
36 m_h2xp_jcb(Ndim_err,Ndim_herr,0),
m_q(0), m_mass2(0){}
41 m_xp_jcb(err.m_xp_jcb), m_h2xp_jcb(err.m_h2xp_jcb),
m_q( err.
m_q ),
42 m_mass2( err.m_mass2 ){}
49 const double &
q,
const double &
mass )
76 const Hep3Vector &B,
const int ms_on,
90 double dx( ( xv1 - m_xv ).mag() );
91 double dp( ( pv1 - m_pv ).mag() );
92 double p2( m_pv.mag2() );
93 double p_abs( sqrt( p2 ) );
96 if( p_abs > Small && pv1.mag() > Small ){
103 double ms_coeff( 2.557 * chi_cc );
104 bool with_B( ( B.mag() > Small ) ? 1 : 0 );
105 double p2inv( p_inv * p_inv );
106 double p3inv( p2inv * p_inv );
107 double fdx( dx * p3inv );
108 double cx( 100.*m_q *
C * fdx );
109 double fdp( dp * p_inv );
111 double px( m_pv.x() );
112 double py( m_pv.y() );
113 double pz( m_pv.z() );
114 double px2( px * px );
115 double py2( py * py );
116 double pz2( pz * pz );
117 double pxy( px * py );
118 double pyz( py * pz );
119 double pzx( pz * px );
124 m_xp_jcb( 1, 1 ) = 1.0;
125 m_xp_jcb( 1, 4 ) = fdx * ( py2 + pz2 );
126 m_xp_jcb( 1, 5 ) = - fdx * pxy;
127 m_xp_jcb( 1, 6 ) = - fdx * pzx;
129 m_xp_jcb( 2, 2 ) = 1.0;
130 m_xp_jcb( 2, 4 ) = - fdx * pxy;
131 m_xp_jcb( 2, 5 ) = fdx * ( pz2 + px2 );
132 m_xp_jcb( 2, 6 ) = - fdx * pyz;
134 m_xp_jcb( 3, 3 ) = 1.0;
135 m_xp_jcb( 3, 4 ) = - fdx * pzx;
136 m_xp_jcb( 3, 5 ) = - fdx * pyz;
137 m_xp_jcb( 3, 6 ) = fdx * ( px2 + py2 );
139 m_xp_jcb( 4, 4 ) = 1.0 - fdp;
140 m_xp_jcb( 5, 5 ) = 1.0 - fdp;
141 m_xp_jcb( 6, 6 ) = 1.0 - fdp;
143 if( with_B && m_q!=0. ){
144 m_xp_jcb( 4, 4 ) += - cx * ( pxy * Bz - pzx * By );
145 m_xp_jcb( 4, 5 ) = cx * ( ( pz2 + px2 ) * Bz + pyz * By );
146 m_xp_jcb( 4, 6 ) = - cx * ( ( px2 + py2 ) * By + pyz * Bz );
148 m_xp_jcb( 5, 4 ) = - cx * ( ( py2 + pz2 ) * Bz + pzx * Bx );
149 m_xp_jcb( 5, 5 ) += - cx * ( pyz * Bx - pxy * Bz );
150 m_xp_jcb( 5, 6 ) = cx * ( ( px2 + py2 ) * Bx + pzx * Bz );
152 m_xp_jcb( 6, 4 ) = cx * ( ( py2 + pz2 ) * By + pxy * Bx );
153 m_xp_jcb( 6, 5 ) = - cx * ( ( pz2 + px2 ) * Bx + pxy * By );
154 m_xp_jcb( 6, 6 ) += - cx * ( pzx * By - pyz * Bx );
164 double beta_p_inv( ( m_mass2 + p2 ) / ( p2 * p2 ) );
165 double th2( 100000.0 * ms_coeff * ms_coeff * beta_p_inv * dx );
167 double m11( th2 * dx * dx /3.0);
168 double m12( 0.5 * th2 * dx * p_abs );
169 double m22( th2 * p2 );
172 double c1( px*p_inv );
173 double c2( py*p_inv );
174 double c3( pz*p_inv );
175 double c12( - c1*c2 );
176 double c13( - c1*c3 );
177 double c23( - c2*c3 );
178 double s1s( 1 - c1*c1 );
179 double s2s( 1 - c2*c2 );
180 double s3s( 1 - c3*c3 );
182 m_err.fast( 1, 1 ) += m11*s1s;
184 m_err.fast( 2, 1 ) += m11*c12;
185 m_err.fast( 2, 2 ) += m11*s2s;
187 m_err.fast( 3, 1 ) += m11*c13;
188 m_err.fast( 3, 2 ) += m11*c23;
189 m_err.fast( 3, 3 ) += m11*s3s;
191 m_err.fast( 4, 1 ) += m12*s1s;
192 m_err.fast( 4, 2 ) += m12*c12;
193 m_err.fast( 4, 3 ) += m12*c13;
194 m_err.fast( 4, 4 ) += m22*s1s;
196 m_err.fast( 5, 1 ) += m12*c12;
197 m_err.fast( 5, 2 ) += m12*s2s;
198 m_err.fast( 5, 3 ) += m12*c23;
199 m_err.fast( 5, 4 ) += m22*c12;
200 m_err.fast( 5, 5 ) += m22*s2s;
202 m_err.fast( 6, 1 ) += m12*c13;
203 m_err.fast( 6, 2 ) += m12*c23;
204 m_err.fast( 6, 3 ) += m12*s3s;
205 m_err.fast( 6, 4 ) += m22*c13;
206 m_err.fast( 6, 5 ) += m22*c23;
207 m_err.fast( 6, 6 ) += m22*s3s;
225 m_xp_jcb = err.m_xp_jcb;
226 m_h2xp_jcb = err.m_h2xp_jcb;
228 m_mass2 = err.m_mass2;
240 <<
"m_xv: " << err.m_xv << std::endl <<
" abs(xv)= " << err.m_xv.mag()
242 <<
"m_pv: " << err.m_pv << std::endl <<
" abs(pv)= " << err.m_pv.mag()
244 <<
"m_xp_jcb: " << err.m_xp_jcb
246 <<
"m_h2xp_jcb: " << err.m_h2xp_jcb
248 <<
"m_q: " << err.m_q
250 <<
"m_mass: " << sqrt(err.m_mass2)
std::ostream & operator<<(std::ostream &s, const Ext_xp_err &err)
NTuple::Item< double > m_q
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
void put_err(const double error[])
Ext_xp_err & operator=(const Ext_xp_err &xp_err)
void set_err(const HepSymMatrix &err, const Hep3Vector &xv, const Hep3Vector &pv, const double &q, const double &mass)
bool move(const Hep3Vector &xv1, const Hep3Vector &pv1, const Hep3Vector &B, const int ms_on, const double chi_cc)