BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/Trajectory.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: Trajectory.h,v 1.3 2010/03/25 09:54:17 zhangy Exp $
4//
5// Description:
6// Abstract base class to describe 3-dimensional trajectories in space.
7// Defines an interface, and provides one data member -- the pathlength
8// range for which a trejectory object is valid (infinite by default).
9// In all cases, "flightlength" = 3-d pathlength along traj.
10//
11// Software developed for the BaBar Detector at the SLAC B-Factory.
12//
13// Author(s): Dave Brown, Steve Schaffner
14//
15//------------------------------------------------------------------------
16#ifndef TRAJECTORY_H
17#define TRAJECTORY_H
18
19//----------------
20//-- header --
21//----------------
22#include <iosfwd>
23#include "CLHEP/Matrix/Vector.h"
24#include "CLHEP/Vector/ThreeVector.h"
25
26#include "CLHEP/Geometry/Point3D.h"
27#ifndef ENABLE_BACKWARDS_COMPATIBILITY
29#endif
30
31
32using namespace CLHEP;
33
34
35class Trajectory{
36
37 public:
38 //*******************
39 // Constructors, etc.
40 //*******************
41 // By default, the valid flight distance range is really big
42 Trajectory(double lowlim, double hilim);
43 virtual ~Trajectory();
44
45 //**********
46 // Access
47 //**********
48 // As a function of the flight distance
49 virtual HepPoint3D position( double ) const = 0;
50 virtual Hep3Vector direction( double ) const = 0;
51 virtual Hep3Vector delDirect( double ) const = 0; // 2nd deriv. WRT pathlen
52 virtual double curvature( double ) const = 0; // = |delDirect|
53 // For more efficient calling:
54 virtual void getInfo(double fltLen, HepPoint3D& pos, Hep3Vector& direction) const = 0;
55 virtual void getInfo(double fltLen, HepPoint3D& pos, Hep3Vector& direction,
56 Hep3Vector& delDirect) const = 0;
57
58 // How far can you go using given approximation in direction (+/- 1) pathDir
59 // before error > tolerance? Only the sign of pathDir matters; magnitude
60 // must be 1. Returned distance is >= 0.
61 double distTo0thError(double s, double tol, int pathDir) const;
62 virtual double distTo1stError(double s, double tol, int pathDir) const = 0;
63 virtual double distTo2ndError(double s, double tol, int pathDir) const = 0;
64
65 // CopyOf function
66 virtual Trajectory* clone() const = 0;
67
68 // Range of valid flight distances:
69 bool validFlightDistance(double f,double tolerance=0.0) const;
70 virtual void setFlightRange(double newrange[2]);
71 double lowRange() const;
72 double hiRange() const;
73 double range() const;
74 // Print functions
75
76 virtual void print(std::ostream& os) const;
77 virtual void printAll(std::ostream& os) const;
78 //**************
79 // End interface
80 //**************
81 protected:
83 double flightrange[2]; // validity range for the flight distance parameter
84};
85
86// inline functions
87
88inline bool Trajectory::validFlightDistance(double f,double tol) const {
89 return f >= flightrange[0]-tol && f <= flightrange[1]+tol;
90}
91inline double Trajectory::lowRange() const {return flightrange[0];}
92inline double Trajectory::hiRange() const {return flightrange[1];}
93inline double Trajectory::range() const { return hiRange()-lowRange(); }
94#endif
XmlRpcServer s
Definition: HelloServer.cpp:11
virtual Trajectory * clone() const =0
virtual HepPoint3D position(double) const =0
double range() const
virtual ~Trajectory()
virtual double distTo2ndError(double s, double tol, int pathDir) const =0
virtual Hep3Vector delDirect(double) const =0
double distTo0thError(double s, double tol, int pathDir) const
double lowRange() const
virtual void print(std::ostream &os) const
Trajectory(double lowlim, double hilim)
virtual void getInfo(double fltLen, HepPoint3D &pos, Hep3Vector &direction) const =0
virtual double distTo1stError(double s, double tol, int pathDir) const =0
virtual void getInfo(double fltLen, HepPoint3D &pos, Hep3Vector &direction, Hep3Vector &delDirect) const =0
virtual Hep3Vector direction(double) const =0
virtual void printAll(std::ostream &os) const
bool validFlightDistance(double f, double tolerance=0.0) const
Trajectory & operator=(const Trajectory &)
virtual double curvature(double) const =0
virtual void setFlightRange(double newrange[2])
double hiRange() const