BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcGeom/include/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 "CLHEP/Matrix/Vector.h"
23#include "CLHEP/Vector/ThreeVector.h"
24#include <iosfwd>
25
26#include "CLHEP/Geometry/Point3D.h"
27#ifndef ENABLE_BACKWARDS_COMPATIBILITY
28typedef HepGeom::Point3D<double> HepPoint3D;
29#endif
30
31using namespace CLHEP;
32
33class Trajectory {
34
35public:
36 //*******************
37 // Constructors, etc.
38 //*******************
39 // By default, the valid flight distance range is really big
40 Trajectory( double lowlim, double hilim );
41 virtual ~Trajectory();
42
43 //**********
44 // Access
45 //**********
46 // As a function of the flight distance
47 virtual HepPoint3D position( double ) const = 0;
48 virtual Hep3Vector direction( double ) const = 0;
49 virtual Hep3Vector delDirect( double ) const = 0; // 2nd deriv. WRT pathlen
50 virtual double curvature( double ) const = 0; // = |delDirect|
51 // For more efficient calling:
52 virtual void getInfo( double fltLen, HepPoint3D& pos, Hep3Vector& direction ) const = 0;
53 virtual void getInfo( double fltLen, HepPoint3D& pos, Hep3Vector& direction,
54 Hep3Vector& delDirect ) const = 0;
55
56 // How far can you go using given approximation in direction (+/- 1) pathDir
57 // before error > tolerance? Only the sign of pathDir matters; magnitude
58 // must be 1. Returned distance is >= 0.
59 double distTo0thError( double s, double tol, int pathDir ) const;
60 virtual double distTo1stError( double s, double tol, int pathDir ) const = 0;
61 virtual double distTo2ndError( double s, double tol, int pathDir ) const = 0;
62
63 // CopyOf function
64 virtual Trajectory* clone() const = 0;
65
66 // Range of valid flight distances:
67 bool validFlightDistance( double f, double tolerance = 0.0 ) const;
68 virtual void setFlightRange( double newrange[2] );
69 double lowRange() const;
70 double hiRange() const;
71 double range() const;
72 // Print functions
73
74 virtual void print( std::ostream& os ) const;
75 virtual void printAll( std::ostream& os ) const;
76 //**************
77 // End interface
78 //**************
79protected:
81 double flightrange[2]; // validity range for the flight distance parameter
82};
83
84// inline functions
85
86inline bool Trajectory::validFlightDistance( double f, double tol ) const {
87 return f >= flightrange[0] - tol && f <= flightrange[1] + tol;
88}
89inline double Trajectory::lowRange() const { return flightrange[0]; }
90inline double Trajectory::hiRange() const { return flightrange[1]; }
91inline double Trajectory::range() const { return hiRange() - lowRange(); }
92#endif
HepGeom::Point3D< double > HepPoint3D
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
XmlRpcServer s
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