20 #include "HelixTrackModel.h"
21 #include <FieldManager.h>
28 HelixTrackModel::HelixTrackModel(
const TVector3& pos,
const TVector3& mom,
double charge) {
44 R_ = 100.*mom.Perp()/(0.0299792458*Bz) / fabs(charge);
46 if (charge<0) sgn_=-1.;
47 center_ = pos + sgn_ * R_ * dir2D.Orthogonal();
48 alpha0_ = (pos-center_).Phi();
58 TVector3 HelixTrackModel::getPos(
double tracklength)
const {
62 double angle = alpha0_ - sgn_ * tracklength / R_ * sin(theta_);
64 TVector3 radius(R_,0,0);
66 pos = center_ + radius;
67 pos.SetZ(center_.Z() - sgn_ * ((alpha0_-angle)*R_ *
tan(theta_-M_PI/2.)) );
72 void HelixTrackModel::getPosMom(
double tracklength, TVector3& pos, TVector3& mom)
const {
74 double angle = alpha0_ - sgn_ * tracklength / R_ * sin(theta_);
76 TVector3 radius(R_,0,0);
78 pos = center_ + radius;
79 pos.SetZ(center_.Z() - sgn_ * ((alpha0_-angle)*R_ *
tan(theta_-M_PI/2.)) );
83 mom.SetPhi(angle - sgn_*M_PI/2.);
TVector3 getFieldVal(const TVector3 &position)
This does NOT use the cache!
static FieldManager * getInstance()
Get singleton instance.
double tan(double a)
tan for double
Defines for I/O streams used for error and debug printing.