1 #include "Math/VectorUtil.h"
5 namespace HWWFunctions {
19 const double d0vtx = hww.
trks_d0().at(itrk) - bx *
sin(phi) + by *
cos(phi);
20 const double d0err = hww.
trks_d0Err().at(itrk);
26 const double d0err2vtx = d0err * d0err
27 - 2 * (bx *
cos(phi) + by *
sin(phi)) * d0phicov
28 + (bx *
cos(phi) + by *
sin(phi)) * (bx *
cos(phi) + by *
sin(phi)) * phierr * phierr
30 - 2 *
sin(phi) *
cos(phi) * vxy;
32 return std::pair<double, double>(d0vtx,
sqrt(d0err2vtx));
34 edm::LogError(
"NegativeValue") <<
"Oh no! sigma^2(d0corr) < 0!";
35 return std::pair<double, double>(d0vtx, -
sqrt(-d0err2vtx));
50 const double d0vtx = hww.
gsftrks_d0().at(itrk) - bx *
sin(phi) + by *
cos(phi);
57 const double d0err2vtx = d0err * d0err
58 - 2 * (bx *
cos(phi) + by *
sin(phi)) * d0phicov
59 + (bx *
cos(phi) + by *
sin(phi)) * (bx *
cos(phi) + by *
sin(phi)) * phierr * phierr
61 - 2 *
sin(phi) *
cos(phi) * vxy;
63 return std::pair<double, double>(d0vtx,
sqrt(d0err2vtx));
65 edm::LogError(
"NegativeValue") <<
"Oh no! sigma^2(d0corr) < 0!";
66 return std::pair<double, double>(d0vtx, -
sqrt(-d0err2vtx));
80 double ddzdpvx =
cos(phi)*1./
tan(theta);
81 double ddzdpvy =
sin(phi)*1./
tan(theta);
82 double ddzdphi = -1*pv.x()*
sin(phi)*1./
tan(theta) + pv.y()*
cos(phi)*1./
tan(theta);
83 double ddzdtheta = -1*1/
sin(theta)*1/
sin(theta) * (pv.x()*
cos(phi) + pv.y()*
sin(phi));
88 ddzdtheta *= ddzdtheta;
104 double error =
sqrt(z0Err + pvzErr + ddzdpvx*pvxErr + ddzdpvy*pvyErr + ddzdphi*phiErr + ddzdtheta*thetaErr);
106 return std::pair<double, double>(
value,
error);
122 double ddzdpvx =
cos(phi)*1./
tan(theta);
123 double ddzdpvy =
sin(phi)*1./
tan(theta);
124 double ddzdphi = -1*pv.x()*
sin(phi)*1./
tan(theta) + pv.y()*
cos(phi)*1./
tan(theta);
125 double ddzdtheta = -1*1/
sin(theta)*1/
sin(theta) * (pv.x()*
cos(phi) + pv.y()*
sin(phi));
130 ddzdtheta *= ddzdtheta;
138 thetaErr *= thetaErr;
146 double error =
sqrt(z0Err + pvzErr + ddzdpvx*pvxErr + ddzdpvy*pvyErr + ddzdphi*phiErr + ddzdtheta*thetaErr);
148 return std::pair<double, double>(
value,
error);
std::vector< float > & trks_phiErr()
std::vector< float > & gsftrks_phiErr()
std::vector< float > & gsftrks_d0Err()
Sin< T >::type sin(const T &t)
std::vector< LorentzVector > & trks_trk_p4()
std::vector< float > & gsftrks_z0Err()
Geom::Theta< T > theta() const
std::vector< std::vector< float > > & vtxs_covMatrix()
std::vector< float > & trks_d0()
std::vector< float > & vtxs_zError()
std::vector< float > & gsftrks_etaErr()
std::vector< float > & trks_z0Err()
std::pair< double, double > gsftrks_dz_pv(HWW &, int itrk, int ipv)
std::vector< float > & trks_z0()
std::pair< double, double > trks_d0_pv(HWW &, int itrk, int ipv)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
std::vector< LorentzVector > & vtxs_position()
std::vector< float > & gsftrks_d0phiCov()
std::vector< float > & trks_d0phiCov()
std::vector< float > & trks_etaErr()
std::vector< float > & gsftrks_d0()
std::vector< float > & vtxs_xError()
std::pair< double, double > trks_dz_pv(HWW &, int itrk, int ipv)
Geom::Phi< T > phi() const
std::vector< LorentzVector > & gsftrks_p4()
std::pair< double, double > gsftrks_d0_pv(HWW &, int itrk, int ipv)
std::vector< float > & trks_d0Err()
std::vector< float > & vtxs_yError()
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
std::vector< float > & gsftrks_z0()