BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
HelixTraj Class Reference

#include <HelixTraj.h>

+ Inheritance diagram for HelixTraj:

Public Types

enum  ParIndex {
  d0Index =0 , phi0Index , omegaIndex , z0Index ,
  tanDipIndex
}
 
enum  { NHLXPRM = 5 }
 

Public Member Functions

 HelixTraj (const HepVector &, const HepSymMatrix &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const TrkExchangePar &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const TrkParams &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 
 HelixTraj (const HelixTraj &)
 
HelixTrajclone () const
 
virtual ~HelixTraj ()
 
HelixTrajoperator= (const HelixTraj &)
 
virtual HepPoint3D position (double fltLen) const
 
virtual Hep3Vector direction (double fltLen) const
 
virtual Hep3Vector delDirect (double) const
 
virtual void getInfo (double fltLen, HepPoint3D &pos, Hep3Vector &dir) const
 
virtual void getInfo (double fltLen, HepPoint3D &, Hep3Vector &dir, Hep3Vector &delDir) const
 
virtual void getDFInfo (double fltLen, DifPoint &, DifVector &dir, DifVector &delDir) const
 
virtual void getDFInfo2 (double fltLen, DifPoint &pos, DifVector &dir) const
 
virtual double distTo1stError (double s, double tol, int pathDir) const
 
virtual double distTo2ndError (double s, double tol, int pathDir) const
 
double curvature (double fltLen) const
 
HepMatrix derivDeflect (double fltlen, deflectDirection) const
 
HepMatrix derivDisplace (double fltlen, deflectDirection idir) const
 
HepMatrix derivPFract (double fltlen) const
 
TranslateParams paramFunction () const
 
void invertParams (TrkParams *params, std::vector< bool > &flags) const
 
int nPar () const
 
double d0 () const
 
double phi0 () const
 
double omega () const
 
double z0 () const
 
double tanDip () const
 
virtual void visitAccept (TrkVisitor *vis) const
 
virtual void print (std::ostream &os) const
 
virtual void printAll (std::ostream &os) const
 
- Public Member Functions inherited from TrkSimpTraj
 TrkSimpTraj (const HepVector &params, const HepSymMatrix &cov, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)
 
 TrkSimpTraj (const TrkParams &params, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)
 
virtual ~TrkSimpTraj ()
 
TrkParamsparameters ()
 
const TrkParamsparameters () const
 
virtual const TrkSimpTrajlocalTrajectory (double fltLen, double &localFlt) const
 
const HepPoint3DreferencePoint () const
 
void changePoint (const HepPoint3D &newpoint, double &fltlen)
 
void setPoint (const HepPoint3D &newpoint)
 
TrkSimpTrajinvert ()
 
bool operator== (const TrkSimpTraj &) const
 
- Public Member Functions inherited from TrkDifTraj
 TrkDifTraj (const double lowlim=-99999., const double hilim=99999.)
 
virtual ~TrkDifTraj ()
 
- Public Member Functions inherited from Trajectory
 Trajectory (double lowlim, double hilim)
 
virtual ~Trajectory ()
 
double distTo0thError (double s, double tol, int pathDir) const
 
bool validFlightDistance (double f, double tolerance=0.0) const
 
virtual void setFlightRange (double newrange[2])
 
double lowRange () const
 
double hiRange () const
 
double range () const
 
- Public Member Functions inherited from TrkKalDeriv

Additional Inherited Members

- Static Public Attributes inherited from TrkSimpTraj
static HepPoint3D _theOrigin
 
- Protected Member Functions inherited from Trajectory
Trajectoryoperator= (const Trajectory &)
 
- Protected Attributes inherited from TrkSimpTraj
TrkParams _dtparams
 
HepPoint3D _refpoint
 
- Protected Attributes inherited from Trajectory
double flightrange [2]
 

Detailed Description

Definition at line 27 of file HelixTraj.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NHLXPRM 

Definition at line 31 of file HelixTraj.h.

31{NHLXPRM = 5};

◆ ParIndex

Enumerator
d0Index 
phi0Index 
omegaIndex 
z0Index 
tanDipIndex 

Definition at line 30 of file HelixTraj.h.

Constructor & Destructor Documentation

◆ HelixTraj() [1/4]

HelixTraj::HelixTraj ( const HepVector & pvec,
const HepSymMatrix & pcov,
double lowlim = -99999.,
double hilim = 99999.,
const HepPoint3D & refpoint = _theOrigin )

Definition at line 28 of file HelixTraj.cxx.

29 :
30 TrkSimpTraj(pvec, pcov, lowlim,hilim,refpoint)
31{
32 // Make sure the dimensions of the input matrix and vector are correct
33
34 if( pvec.num_row() != NHLXPRM || pcov.num_row() != NHLXPRM ){
35 std::cout<<"ErrMsg(fatal) "
36 << "HelixTraj: incorrect constructor vector/matrix dimension" << std::endl;
37 ::abort();
38 }
39
40 if (omega() == 0.0) parameters()->parameter()[omegaIndex] = 1.e-9;
41}
HepVector & parameter()
Definition DifIndepPar.h:51
double omega() const
Definition HelixTraj.h:81
TrkSimpTraj(const HepVector &params, const HepSymMatrix &cov, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)
TrkParams * parameters()
Definition TrkSimpTraj.h:80

Referenced by clone().

◆ HelixTraj() [2/4]

HelixTraj::HelixTraj ( const TrkExchangePar & inpar,
double lowlim = -99999.,
double hilim = 99999.,
const HepPoint3D & refpoint = _theOrigin )

Definition at line 44 of file HelixTraj.cxx.

45 :
46 TrkSimpTraj(inpar.params(), inpar.covariance(), lowlim,hilim,refpoint)
47{
48 if (omega() == 0.0) parameters()->parameter()[omegaIndex] = 1.e-9;
49}
const HepVector & params() const
const HepSymMatrix & covariance() const

◆ HelixTraj() [3/4]

HelixTraj::HelixTraj ( const TrkParams & inpar,
double lowlim = -99999.,
double hilim = 99999.,
const HepPoint3D & refpoint = _theOrigin )

Definition at line 51 of file HelixTraj.cxx.

52 :
53 TrkSimpTraj(inpar, lowlim,hilim,refpoint)
54{
55 assert(inpar.parameter().num_row()==NHLXPRM);
56 if (omega() == 0.0) parameters()->parameter()[omegaIndex] = 1.e-9;
57}

◆ HelixTraj() [4/4]

HelixTraj::HelixTraj ( const HelixTraj & h)

Definition at line 59 of file HelixTraj.cxx.

62{
63}
double lowRange() const
Definition Trajectory.h:91
double hiRange() const
Definition Trajectory.h:92
HepSymMatrix & covariance()
Definition TrkParams.h:54
const HepPoint3D & referencePoint() const
Definition TrkSimpTraj.h:84

◆ ~HelixTraj()

HelixTraj::~HelixTraj ( )
virtual

Definition at line 82 of file HelixTraj.cxx.

83{
84}

Member Function Documentation

◆ clone()

HelixTraj * HelixTraj::clone ( ) const
virtual

Implements TrkSimpTraj.

Definition at line 66 of file HelixTraj.cxx.

67{
68 return new HelixTraj(*this);
69}
HelixTraj(const HepVector &, const HepSymMatrix &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
Definition HelixTraj.cxx:28

◆ curvature()

double HelixTraj::curvature ( double fltLen) const
virtual

Implements Trajectory.

Definition at line 499 of file HelixTraj.cxx.

500{
501// Compute the curvature as the magnitude of the 2nd derivative
502// of the position function with respect to the 3-d flight distance
503//
504 double cosd = cosDip();
505// return sqr(cosd)*fabs(omega());
506 return (cosd*cosd)*fabs(omega());
507}

◆ d0()

double HelixTraj::d0 ( ) const
inline

◆ delDirect()

Hep3Vector HelixTraj::delDirect ( double fltLen) const
virtual

Implements Trajectory.

Definition at line 123 of file HelixTraj.cxx.

124{
125 double ang = angle(fltLen);
126 double cDip = cosDip();
127 double delX = -omega() * cDip * cDip * sin(ang);
128 double delY = omega() * cDip * cDip * cos(ang);
129 return Hep3Vector(delX, delY, 0.0);
130}
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213

◆ derivDeflect()

HepMatrix HelixTraj::derivDeflect ( double fltlen,
deflectDirection idirect ) const
virtual

Implements TrkKalDeriv.

Definition at line 365 of file HelixTraj.cxx.

366{
367//
368// This function computes the column matrix of derrivatives for the change
369// in parameters for a change in the direction of a track at a point along
370// its flight, holding the momentum and position constant. The effects for
371// changes in 2 perpendicular directions (theta1 = dip and
372// theta2 = phi*cos(dip)) can sometimes be added, as scattering in these
373// are uncorrelated.
374//
375 HepMatrix ddflct(NHLXPRM,1);
376//
377// Compute some common things
378//
379 double omeg = omega();
380 double tand = tanDip();
381 double arcl = arc(fltlen);
382 double dx = cos(arcl);
383 double dy = sin(arcl);
384 double cosd = cosDip();
385 double darc = omeg*d0();
386//
387// Go through the parameters
388//
389 switch (idirect) {
390 case theta1:
391 ddflct(omegaIndex+1,1) = omeg*tand;
392// ddflct(tanDipIndex+1,1) = 1.0/sqr(cosd);
393 ddflct(tanDipIndex+1,1) = 1.0/(cosd*cosd);
394 ddflct(d0Index+1,1) = (1-dx)*tand/omeg;
395 ddflct(phi0Index+1,1) = -dy*tand/(1+darc);
396// ddflct(z0Index+1,1) = - translen(fltlen) - sqr(tand)*dy/(omeg*(1+darc));
397 ddflct(z0Index+1,1) = - translen(fltlen) - (tand*tand)*dy/(omeg*(1+darc));
398 break;
399 case theta2:
400 ddflct(omegaIndex+1,1) = 0;
401 ddflct(tanDipIndex+1,1) = 0;
402 ddflct(d0Index+1,1) = -dy/(cosd*omeg);
403 ddflct(phi0Index+1,1) = dx/(cosd*(1+darc));
404 ddflct(z0Index+1,1) = -tand*(1- dx/(1+darc))/(cosd*omeg);
405 break;
406 }
407
408 return ddflct;
409}
@ theta2
Definition TrkKalDeriv.h:24
@ theta1
Definition TrkKalDeriv.h:24
double d0() const
Definition HelixTraj.h:79
double tanDip() const
Definition HelixTraj.h:83

◆ derivDisplace()

HepMatrix HelixTraj::derivDisplace ( double fltlen,
deflectDirection idir ) const
virtual

Implements TrkKalDeriv.

Definition at line 413 of file HelixTraj.cxx.

414{
415//
416// This function computes the column matrix of derrivatives for the change
417// in parameters for a change in the position of a track at a point along
418// its flight, holding the momentum and direction constant. The effects for
419// changes in 2 perpendicular directions 'theta1' = (-sin(l)cos(p),-sin(l)sin(p),cos(l)) and
420// 'theta2' = (-sin(p),cos(p),0). These are by definition orthogonal and uncorrelated.
421// these displacements are correlated with the angular change above
422//
423 HepMatrix ddflct(NHLXPRM,1);
424//
425// Compute some common things
426//
427 double omeg = omega();
428 double tand = tanDip();
429 double arcl = arc(fltlen);
430 double dx = cos(arcl);
431 double dy = sin(arcl);
432 double cosd = cosDip();
433 double sind = sinDip();
434 double darc_1 = 1.0+omeg*d0();
435//
436// Go through the parameters
437//
438 switch (idirect) {
439 case theta1:
440 ddflct(omegaIndex+1,1) = 0.0;
441 ddflct(tanDipIndex+1,1) = 0.0;
442 ddflct(d0Index+1,1) = -sind*dy;
443 ddflct(phi0Index+1,1) = sind*dx*omeg/darc_1;
444 ddflct(z0Index+1,1) = sind*tand*dx/darc_1 + cosd;
445 break;
446 case theta2:
447 ddflct(omegaIndex+1,1) = 0;
448 ddflct(tanDipIndex+1,1) = 0;
449 ddflct(d0Index+1,1) = dx;
450 ddflct(phi0Index+1,1) = dy*omeg/darc_1;
451 ddflct(z0Index+1,1) = tand*dy/darc_1;
452 break;
453 }
454
455 return ddflct;
456}

◆ derivPFract()

HepMatrix HelixTraj::derivPFract ( double fltlen) const
virtual

Implements TrkKalDeriv.

Definition at line 460 of file HelixTraj.cxx.

461{
462//
463// This function computes the column matrix of derrivatives for the change
464// in parameters from a (fractional) change in the track momentum,
465// holding the direction and position constant. The momentum change can
466// come from energy loss or bfield inhomogeneities.
467//
468// For a helix, dp/P = -domega/omega,
469// dParam/d(domega/omega) = -omega*dParam/ddomega
470//
471 HepMatrix dmomfrac(NHLXPRM,1);
472//
473// Compute some common things
474
475 double omeg = omega();
476 double tand = tanDip();
477 double tranl = translen(fltlen);
478 double arcl = tranl*omeg;
479 double dx = cos(arcl);
480 double dy = sin(arcl);
481 double darc = omeg*d0();
482
483// Go through the parameters
484// omega
485 dmomfrac(omegaIndex+1,1) = -omeg;
486// tanDip
487 dmomfrac(tanDipIndex+1,1) = 0.0;
488// d0
489 dmomfrac(d0Index+1,1) = -(1-dx)/omeg;
490// phi0
491 dmomfrac(phi0Index+1,1) = dy/(1+darc);
492// z0
493 dmomfrac(z0Index+1,1) = -tand*(tranl-dy/((1+darc)*omeg));
494//
495 return dmomfrac;
496}

◆ direction()

Hep3Vector HelixTraj::direction ( double fltLen) const
virtual

Implements Trajectory.

Definition at line 110 of file HelixTraj.cxx.

111{
112 // Angle formed by tangent vector after
113 // being rotated 'arclength' around orbit.
114 double alpha = angle( f );
115 // Construct 3-D tangent vector of unit magnitude.
116 double cDip = cosDip();
117 return Hep3Vector ( cos(alpha)*cDip,
118 sin(alpha)*cDip,
119 cDip*tanDip() );
120}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
const double alpha

◆ distTo1stError()

double HelixTraj::distTo1stError ( double s,
double tol,
int pathDir ) const
virtual

Implements Trajectory.

Definition at line 133 of file HelixTraj.cxx.

134{
135// return sqrt(2.*tol/fabs(omega())*(1.+sqr(tanDip())));
136 return sqrt(2.*tol/fabs(omega())*(1.+tanDip()*tanDip()));
137}

◆ distTo2ndError()

double HelixTraj::distTo2ndError ( double s,
double tol,
int pathDir ) const
virtual

Implements Trajectory.

Definition at line 140 of file HelixTraj.cxx.

141{
142// return sqrt(1.+sqr(tanDip()))*cbrt(6.*tol/sqr(omega()));
143 return sqrt(1.+tanDip()*tanDip())*cbrt(6.*tol/omega()*omega());
144}

◆ getDFInfo()

void HelixTraj::getDFInfo ( double fltLen,
DifPoint & pos,
DifVector & dir,
DifVector & delDir ) const
virtual

Implements TrkDifTraj.

Definition at line 280 of file HelixTraj.cxx.

282{
283 //Provides difNum version of information for calculation of derivatives.
284 // All arithmetic operations have been replaced by +=, etc. versions
285 // for speed.
286
287 // Create difNumber versions of parameters
288 DifNumber phi0Df(phi0(), phi0Index+1, NHLXPRM);
289 DifNumber d0Df(d0(), d0Index+1, NHLXPRM);
290 DifNumber z0Df(z0(), z0Index+1, NHLXPRM);
291 DifNumber tanDipDf(tanDip(), tanDipIndex+1, NHLXPRM);
292 DifNumber omegaDf(omega(), omegaIndex+1, NHLXPRM);
293 phi0Df.setIndepPar( parameters() );
294 d0Df.setIndepPar( parameters() );
295 z0Df.setIndepPar( parameters() );
296 tanDipDf.setIndepPar( parameters() );
297 omegaDf.setIndepPar( parameters() );
298 DifNumber dipDf = atan(tanDipDf);
299
300 static DifNumber cDip;
301 dipDf.cosAndSin(cDip, dir.z);
302 static DifNumber sinPhi0, cosPhi0;
303 phi0Df.cosAndSin(cosPhi0, sinPhi0);
304
305 bool lref = (referencePoint().x() != 0. || referencePoint().y() != 0. ||
306 referencePoint().z() != 0.);
307
308 DifNumber alphaDf = cDip;
309 alphaDf *= omegaDf;
310 alphaDf *= flt;
311 alphaDf += phi0Df;
312
313 // This is not the prettiest line imaginable for this operation:
315 // DifNumber sinAlpha, cosAlpha;
316 alphaDf.cosAndSin(dir.x, dir.y);
317
318 // DifNumber x = (sinAlpha - sinPhi0) / omegaDf - d0Df * sinPhi0 + px;
319 // DifNumber y = -(cosAlpha - cosPhi0) / omegaDf + d0Df * cosPhi0 + py;
320
321 pos.x = dir.y;
322 pos.x -= sinPhi0;
323 pos.x /= omegaDf;
324 DifNumber temp = d0Df;
325 temp *= sinPhi0;
326 pos.x -= temp;
327
328 pos.y = cosPhi0;
329 pos.y -= dir.x;
330 pos.y /= omegaDf;
331 temp = d0Df;
332 temp *= cosPhi0;
333 pos.y += temp;
334
335 pos.z = flt;
336 pos.z *= dir.z;
337 pos.z += z0Df;
338
339 if (lref) {
340 DifNumber px(referencePoint().x());
341 DifNumber py(referencePoint().y());
342 DifNumber pz(referencePoint().z());
343 pos.x += px;
344 pos.y += py;
345 pos.z += pz;
346 }
347
348 delDir.x = -omegaDf;
349 delDir.x *= cDip;
350 delDir.x *= cDip;
351 delDir.x *= dir.y;
352
353 delDir.y = omegaDf;
354 delDir.y *= cDip;
355 delDir.y *= cDip;
356 delDir.y *= dir.x;
357
358 delDir.z = 0.;
359
360 dir.x *= cDip;
361 dir.y *= cDip;
362}
Double_t x[10]
static const double pi
Definition Constants.h:38
DifNumber & mod(double lo, double hi)
void cosAndSin(DifNumber &c, DifNumber &s) const
DifNumber y
Definition DifVector.h:149
DifNumber x
Definition DifVector.h:148
DifNumber z
Definition DifVector.h:150
double phi0() const
double z0() const
Definition HelixTraj.h:82
double y[1000]

◆ getDFInfo2()

void HelixTraj::getDFInfo2 ( double fltLen,
DifPoint & pos,
DifVector & dir ) const
virtual

Reimplemented from TrkDifTraj.

Definition at line 207 of file HelixTraj.cxx.

208{
209 //Provides difNum version of information for calculation of derivatives.
210 // All arithmetic operations have been replaced by +=, etc. versions
211 // for speed.
212
213 // Create difNumber versions of parameters
214 DifNumber phi0Df(phi0(), phi0Index+1, NHLXPRM);
215 phi0Df.setIndepPar( parameters() );
216 DifNumber d0Df(d0(), d0Index+1, NHLXPRM);
217 d0Df.setIndepPar( parameters() );
218 DifNumber z0Df(z0(), z0Index+1, NHLXPRM);
219 z0Df.setIndepPar( parameters() );
220 DifNumber tanDipDf(tanDip(), tanDipIndex+1, NHLXPRM);
221 tanDipDf.setIndepPar( parameters() );
222 DifNumber omegaDf(omega(), omegaIndex+1, NHLXPRM);
223 omegaDf.setIndepPar( parameters() );
224
225 DifNumber dipDf = atan(tanDipDf);
226
227 static DifNumber cDip;
228 dipDf.cosAndSin(cDip, dir.z);
229 static DifNumber sinPhi0, cosPhi0;
230 phi0Df.cosAndSin(cosPhi0, sinPhi0);
231
232 bool lref = (referencePoint().x() != 0. || referencePoint().y() != 0. ||
233 referencePoint().z() != 0.);
234
235 DifNumber alphaDf = cDip;
236 alphaDf *= omegaDf;
237 alphaDf *= flt;
238 alphaDf += phi0Df;
239
240 // This is not the prettiest line imaginable for this operation:
242 // DifNumber sinAlpha, cosAlpha;
243 alphaDf.cosAndSin(dir.x, dir.y);
244
245 // DifNumber x = (sinAlpha - sinPhi0) / omegaDf - d0Df * sinPhi0 + px;
246 // DifNumber y = -(cosAlpha - cosPhi0) / omegaDf + d0Df * cosPhi0 + py;
247
248 pos.x = dir.y;
249 pos.x -= sinPhi0;
250 pos.x /= omegaDf;
251 DifNumber temp = d0Df;
252 temp *= sinPhi0;
253 pos.x -= temp;
254
255 pos.y = cosPhi0;
256 pos.y -= dir.x;
257 pos.y /= omegaDf;
258 temp = d0Df;
259 temp *= cosPhi0;
260 pos.y += temp;
261
262 pos.z = flt;
263 pos.z *= dir.z;
264 pos.z += z0Df;
265
266 if (lref) {
267 DifNumber px(referencePoint().x());
268 DifNumber py(referencePoint().y());
269 DifNumber pz(referencePoint().z());
270 pos.x += px;
271 pos.y += py;
272 pos.z += pz;
273 }
274
275 dir.x *= cDip;
276 dir.y *= cDip;
277}

◆ getInfo() [1/2]

void HelixTraj::getInfo ( double fltLen,
HepPoint3D & pos,
Hep3Vector & dir,
Hep3Vector & delDir ) const
virtual

Implements Trajectory.

Definition at line 147 of file HelixTraj.cxx.

149{
150 // double ang = angle(fltLen);
151 double cDip = cosDip();
152 double sDip = tanDip() * cDip;
153 double phi00 = parameters()->parameter()[phi0Index]; // Don't normalize
154 double ang = phi00 + cDip*fltLen*omega();
155 double cang = cos(ang);
156 double sang = sin(ang);
157 double sphi0 = sin(phi00);
158 double cphi0 = cos(phi00);
159
160 double xt = (sang - sphi0)/omega() - d0()*sphi0 +
161 referencePoint().x();
162 double yt = -(cang - cphi0)/omega() + d0()*cphi0 +
163 referencePoint().y();
164 double zt = z0() + fltLen*sDip + referencePoint().z();
165 pos.setX(xt);
166 pos.setY(yt);
167 pos.setZ(zt);
168
169 dir.setX(cang * cDip);
170 dir.setY(sang * cDip);
171 dir.setZ(sDip);
172
173 double delX = -omega() * cDip * cDip * sang;
174 double delY = omega() * cDip * cDip * cang;
175 delDir.setX(delX);
176 delDir.setY(delY);
177 delDir.setZ(0.0);
178}

◆ getInfo() [2/2]

void HelixTraj::getInfo ( double fltLen,
HepPoint3D & pos,
Hep3Vector & dir ) const
virtual

Implements Trajectory.

Definition at line 181 of file HelixTraj.cxx.

182{
183 // double ang = angle(fltLen);
184 double cDip = cosDip();
185 double sDip = tanDip() * cDip;
186 double phi00 = parameters()->parameter()[phi0Index]; // Don't normalize
187 double ang = phi00 + cDip*fltLen*omega();
188 double cang = cos(ang);
189 double sang = sin(ang);
190 double sphi0 = sin(phi00);
191 double cphi0 = cos(phi00);
192
193 double xt = (sang - sphi0)/omega() - d0()*sphi0 +
194 referencePoint().x();
195 double yt = -(cang - cphi0)/omega() + d0()*cphi0 +
196 referencePoint().y();
197 double zt = z0() + fltLen*sDip + referencePoint().z();
198 pos.setX(xt);
199 pos.setY(yt);
200 pos.setZ(zt);
201
202 dir.setX(cang * cDip);
203 dir.setY(sang * cDip);
204 dir.setZ(sDip);
205}

◆ invertParams()

void HelixTraj::invertParams ( TrkParams * params,
std::vector< bool > & flags ) const
virtual

Implements TrkSimpTraj.

Definition at line 598 of file HelixTraj.cxx.

599{
600 // Inverts parameters and returns true if the parameter inversion
601 // requires a change in sign of elements in the covariance matrix
602
603 for (unsigned iparam = 0; iparam < NHLXPRM; iparam++) {
604 switch ( iparam ) {
605 case d0Index: // changes sign
606 case omegaIndex: // changes sign
607 case tanDipIndex: // changes sign
608 params->parameter()[iparam] *= -1.0;
609 flags[iparam] = true;
610 break;
611 case phi0Index: // changes by pi, but covariance matrix shouldn't change
612 params->parameter()[iparam] =
613 BesAngle(params->parameter()[iparam] + Constants::pi);
614 flags[iparam] = false;
615 break;
616 case z0Index: // nochange
617 flags[iparam] = false;
618 }
619 }
620 return;
621}

◆ nPar()

int HelixTraj::nPar ( ) const
inlinevirtual

Reimplemented from TrkSimpTraj.

Definition at line 75 of file HelixTraj.h.

75{ return NHLXPRM;}

◆ omega()

◆ operator=()

HelixTraj & HelixTraj::operator= ( const HelixTraj & h)

Definition at line 72 of file HelixTraj.cxx.

73{
74 if( &h != this ){
76 _dtparams = *(h.parameters());
78 }
79 return *this;
80}
Trajectory & operator=(const Trajectory &)
TrkParams _dtparams
HepPoint3D _refpoint

◆ paramFunction()

TranslateParams HelixTraj::paramFunction ( ) const
inlinevirtual

Implements TrkSimpTraj.

Definition at line 69 of file HelixTraj.h.

69{ return HelixTraj::paramFunc; }

◆ phi0()

double HelixTraj::phi0 ( ) const

Definition at line 510 of file HelixTraj.cxx.

511{
512 return BesAngle(parameters()->parameter()[phi0Index]).rad();
513}
double rad() const
Definition BesAngle.h:118
double precision pisqo6 parameter(pi=3.14159265358979d0, pisq=pi *pi, pisqo6=pisq/6d0) double precision zip

Referenced by getDFInfo(), getDFInfo2(), TrkCompTrk::print(), TrkHelixRep::print(), and printAll().

◆ position()

HepPoint3D HelixTraj::position ( double fltLen) const
virtual

Implements Trajectory.

Definition at line 93 of file HelixTraj.cxx.

94{
95 double cDip = cosDip();
96 double sDip = tanDip() * cDip;
97 double phi00 = parameters()->parameter()[phi0Index]; // Don't normalize
98 double ang = phi00 + cDip*f*omega();
99 double cang = cos(ang);
100 double sang = sin(ang);
101 double sphi0 = sin(phi00);
102 double cphi0 = cos(phi00);
103
104 return HepPoint3D((sang - sphi0)/omega() - d0()*sphi0+referencePoint().x(),
105 -(cang - cphi0)/omega() + d0()*cphi0+referencePoint().y(),
106 z0() + f*sDip +referencePoint().z());
107}
HepGeom::Point3D< double > HepPoint3D
Definition HelixTraj.h:14

◆ print()

void HelixTraj::print ( std::ostream & os) const
virtual

Reimplemented from TrkSimpTraj.

Definition at line 649 of file HelixTraj.cxx.

650{
651 Trajectory::print(os << "HelixTraj" );
652}
virtual void print(std::ostream &os) const

◆ printAll()

void HelixTraj::printAll ( std::ostream & os) const
virtual

Reimplemented from TrkSimpTraj.

Definition at line 637 of file HelixTraj.cxx.

638{
639 os << "HelixTraj with range "
640 << lowRange() <<" to " << hiRange() << " and parameters " << endl
641 << "d0= " << d0() << " phi0= "
642 << phi0() << " omega= "
643 << omega() << " z0 = "
644 << z0() << " tanDip= "
645 << tanDip() << endl;
646}

◆ tanDip()

◆ visitAccept()

void HelixTraj::visitAccept ( TrkVisitor * vis) const
virtual

Implements TrkSimpTraj.

Definition at line 591 of file HelixTraj.cxx.

592{
593// Visitor access--just use the Visitor class member function
594 vis->trkVisitHelixTraj(this);
595}
virtual void trkVisitHelixTraj(const HelixTraj *)=0

◆ z0()

double HelixTraj::z0 ( ) const
inline

The documentation for this class was generated from the following files: