CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackTools.cc
Go to the documentation of this file.
1 /* From SimpleFits Package
2  * Designed an written by
3  * author: Ian M. Nugent
4  * Humboldt Foundations
5  */
8 #include "math.h"
9 #include <iostream>
10 
11 using namespace tauImpactParameter;
12 
15  double lam=p.parameter(TrackParticle::lambda);
17  double dxy=p.parameter(TrackParticle::dxy);
18  double dz=p.parameter(TrackParticle::dz);
19  double r=kappa/2.0;
20  double s=(asin((x+(r+dxy)*sin(phi))/r)-phi)/(2*kappa);
21  double y=-r*cos(2.0*s*kappa+phi)+(r+dxy)*cos(phi);
22  double z=dz+s*tan(lam);
23  return TVector3(x,y,z);
24 }
25 
28  double lam=p.parameter(TrackParticle::lambda);
30  double dxy=p.parameter(TrackParticle::dxy);
31  double dz=p.parameter(TrackParticle::dz);
32  double r=kappa/2.0;
33  double s=(acos(((r+dxy)*cos(phi)-y)/r)-phi)/(2*kappa);
34  double x=r*sin(2.0*s*kappa+phi)-(r+dxy)*sin(phi);
35  double z=dz+s*tan(lam);
36  return TVector3(x,y,z);
37 }
38 
41  double lam=p.parameter(TrackParticle::lambda);
43  double dxy=p.parameter(TrackParticle::dxy);
44  double dz=p.parameter(TrackParticle::dz);
45  double s=(z-dz)/tan(lam);
46  double r=kappa/2.0;
47  double x=r*sin(2.0*s*kappa+phi)-(r+dxy)*sin(phi);
48  double y=-r*cos(2.0*s*kappa+phi)+(r+dxy)*cos(phi);
49  return TVector3(x,y,z);
50 }
51 
52 
54 {
57  FreePar(TrackHelixVertexFitter::x0)=v.X();
58  FreePar(TrackHelixVertexFitter::y0)=v.Y();
59  FreePar(TrackHelixVertexFitter::z0)=v.Z();
65  TVectorT<double> LVPar=TrackHelixVertexFitter::computeLorentzVectorPar(FreePar);
67  return LorentzVectorParticle(LVPar,LVCov,p.pdgId(),p.charge(),p.bField());
68 }
69 
70 
static LorentzVectorParticle lorentzParticleAtPosition(const TrackParticle &p, const TVector3 &v)
Definition: TrackTools.cc:53
virtual int pdgId() const
Definition: Particle.h:28
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
static TVector3 propagateToYPosition(const TrackParticle &p, double y)
Definition: TrackTools.cc:26
float float float z
virtual double charge() const
Definition: Particle.h:29
static TVectorT< double > computeLorentzVectorPar(const TVectorT< double > &inpar)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static TVector3 propagateToXPosition(const TrackParticle &p, double x)
Definition: TrackTools.cc:13
static TVector3 propagateToZPosition(const TrackParticle &p, double z)
Definition: TrackTools.cc:39
virtual double parameter(int i) const
Definition: Particle.h:24
virtual double mass() const
Definition: TrackParticle.h:24
virtual double bField() const
Definition: Particle.h:26
static const G4double kappa
Definition: DDAxes.h:10
static TMatrixTSym< double > propagateError(std::function< TVectorT< double >(const TVectorT< double > &)> f, const TVectorT< double > &inPar, TMatrixTSym< double > &inCov, double epsilon=0.001, double errorEpsilonRatio=1000)
Definition: DDAxes.h:10