Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MdcSagTraj Class Reference

#include <MdcSagTraj.h>

Inheritance diagram for MdcSagTraj:

TrkGeomTraj TrkGeomTraj Trajectory Trajectory Trajectory Trajectory List of all members.

Public Member Functions

void accept (TrkGeomTrajVisitor &visitor) const
void accept (TrkGeomTrajVisitor &visitor) const
MdcSagTrajclone () const
MdcSagTrajclone () const
double curvature (double f=0.) const
double curvature (double f=0.) const
Hep3Vector delDirect (double) const
Hep3Vector delDirect (double) const
double deltaY (double fltLen) const
double deltaY (double fltLen) const
Hep3Vector direction (double) const
Hep3Vector direction (double) const
double distTo0thError (double s, double tol, int pathDir) const
double distTo0thError (double s, double tol, int pathDir) const
virtual double distTo1stError (double s, double tol, int pathDir) const
virtual double distTo1stError (double s, double tol, int pathDir) const
virtual double distTo2ndError (double s, double tol, int pathDir) const
virtual double distTo2ndError (double s, double tol, int pathDir) const
void getInfo (double fltLen, HepPoint3D &, Hep3Vector &direction, Hep3Vector &delDirect) const
void getInfo (double fltLen, HepPoint3D &, Hep3Vector &direction) const
void getInfo (double fltLen, HepPoint3D &, Hep3Vector &direction, Hep3Vector &delDirect) const
void getInfo (double fltLen, HepPoint3D &, Hep3Vector &direction) const
double hiRange () const
double hiRange () const
double lowRange () const
double lowRange () const
 MdcSagTraj (const MdcSagTraj &traj)
 MdcSagTraj (const double sag, const HepPoint3D &point1, const HepPoint3D &point2)
 MdcSagTraj (const MdcSagTraj &traj)
 MdcSagTraj (const double sag, const HepPoint3D &point1, const HepPoint3D &point2)
MdcSagTrajoperator= (const MdcSagTraj &)
MdcSagTrajoperator= (const MdcSagTraj &)
HepPoint3D position (double) const
HepPoint3D position (double) const
virtual void print (std::ostream &os) const
virtual void print (std::ostream &os) const
virtual void printAll (std::ostream &os) const
virtual void printAll (std::ostream &os) const
double range () const
double range () const
const Hep3Vector & rawDirection (void) const
const Hep3Vector & rawDirection (void) const
double sag (void) const
double sag (void) const
virtual void setFlightRange (double newrange[2])
virtual void setFlightRange (double newrange[2])
bool validFlightDistance (double f, double tolerance=0.0) const
bool validFlightDistance (double f, double tolerance=0.0) const
virtual ~MdcSagTraj ()
virtual ~MdcSagTraj ()

Protected Attributes

double flightrange [2]

Private Member Functions

Hep3Vector deviation (double) const
Hep3Vector deviation (double) const

Private Attributes

double _a
double _b
Hep3Vector _direction
double _length
double _sag
HepPoint3D _start
HepPoint3D _stop

Constructor & Destructor Documentation

MdcSagTraj::MdcSagTraj const double  sag,
const HepPoint3D point1,
const HepPoint3D point2
 

00059   : TrkGeomTraj(0.0,start.distance(stop)), _sag(sag), _start(start), _stop(stop)
00060 {
00061   //_direction = stop - start;
00062   _direction = ((CLHEP::Hep3Vector) stop) - ((CLHEP::Hep3Vector) start);
00063   _length = _direction.mag();
00064   assert( _length != 0 );
00065 
00066   _direction.setMag(1.0);
00067   _a = _sag*4./(_length*_length);
00068   _b = -_a*_length;
00069 
00070 }

MdcSagTraj::MdcSagTraj const MdcSagTraj traj  ) 
 

MdcSagTraj::~MdcSagTraj  )  [virtual]
 

00079 {;}

MdcSagTraj::MdcSagTraj const double  sag,
const HepPoint3D point1,
const HepPoint3D point2
 

MdcSagTraj::MdcSagTraj const MdcSagTraj traj  ) 
 

virtual MdcSagTraj::~MdcSagTraj  )  [virtual]
 


Member Function Documentation

void MdcSagTraj::accept TrkGeomTrajVisitor visitor  )  const [virtual]
 

Reimplemented from TrkGeomTraj.

void MdcSagTraj::accept TrkGeomTrajVisitor visitor  )  const [virtual]
 

Reimplemented from TrkGeomTraj.

00213 {
00214   std::cout<<"ErrMsg(error)"<<"accept visitor NOT implemented yet"<<std::endl;
00215 }

MdcSagTraj* MdcSagTraj::clone  )  const [virtual]
 

Implements TrkGeomTraj.

MdcSagTraj * MdcSagTraj::clone  )  const [virtual]
 

Implements TrkGeomTraj.

00085 {
00086   return new MdcSagTraj(*this);
00087 }

double MdcSagTraj::curvature double  f = 0.  )  const [virtual]
 

Implements Trajectory.

double MdcSagTraj::curvature double  f = 0.  )  const [virtual]
 

Implements Trajectory.

00191 {
00192   return _sag;
00193 }

Hep3Vector MdcSagTraj::delDirect double   )  const [virtual]
 

Implements Trajectory.

Hep3Vector MdcSagTraj::delDirect double   )  const [virtual]
 

Implements Trajectory.

00147 {
00148   return Hep3Vector(0., 2.*_a, 0.);
00149 }

double MdcSagTraj::deltaY double  fltLen  )  const [inline]
 

00094 { return (_a*fltLen+_b)*fltLen; }

double MdcSagTraj::deltaY double  fltLen  )  const [inline]
 

00094 { return (_a*fltLen+_b)*fltLen; }

Hep3Vector MdcSagTraj::deviation double   )  const [private]
 

Hep3Vector MdcSagTraj::deviation double   )  const [private]
 

00112 {
00113   // only correction in y
00114 //   Hep3Vector deviation(0., (_a*flightlen+_b)*flightlen, 0.);
00115 //   Hep3Vector deviaH(0.,cosh((flightlen-_length/2.)/_a_H)+_b_H,0.);
00116 //   return deviation;
00117   return Hep3Vector(0., (_a*flightlen+_b)*flightlen, 0.);
00118 }

Hep3Vector MdcSagTraj::direction double   )  const [virtual]
 

Implements Trajectory.

Hep3Vector MdcSagTraj::direction double   )  const [virtual]
 

Implements Trajectory.

00132                                               {
00133   if ( flightlen <= 0. ) return _direction;
00134 //    Hep3Vector dir =  _direction*flightlen + delDirect(flightlen);
00135   static Hep3Vector tmpdir;
00136   tmpdir =  _direction*flightlen;
00137 //   register double newy = tmpdir.y() + 2.*_a*flightlen+_b;
00138 //   tmpdir.setY(newy);
00139   tmpdir.setY(tmpdir.y() + 2.*_a*flightlen+_b);
00140 //   tmpdir += delDirect(flightlen);
00141   tmpdir.setMag(1.0);
00142   return tmpdir;
00143 }

double Trajectory::distTo0thError double  s,
double  tol,
int  pathDir
const [inherited]
 

double Trajectory::distTo0thError double  s,
double  tol,
int  pathDir
const [inherited]
 

00052 {
00053   return fabs(tolerance);
00054 }

virtual double MdcSagTraj::distTo1stError double  s,
double  tol,
int  pathDir
const [virtual]
 

Implements Trajectory.

double MdcSagTraj::distTo1stError double  s,
double  tol,
int  pathDir
const [virtual]
 

Implements Trajectory.

00197 {
00198   double dtmp = pathDir*2.*_a*flightlen+_b;
00199 
00200   return dtmp==0. ? 9999.e4 : fabs(tol/dtmp);
00201 }

virtual double MdcSagTraj::distTo2ndError double  s,
double  tol,
int  pathDir
const [virtual]
 

Implements Trajectory.

double MdcSagTraj::distTo2ndError double  s,
double  tol,
int  pathDir
const [virtual]
 

Implements Trajectory.

00205 { 
00206   return 999.e4 ;
00207   //return _a==0. ? 999.e4 : tol/(2.*_a); 
00208 }

void MdcSagTraj::getInfo double  fltLen,
HepPoint3D ,
Hep3Vector &  direction,
Hep3Vector &  delDirect
const [virtual]
 

Implements Trajectory.

void MdcSagTraj::getInfo double  fltLen,
HepPoint3D ,
Hep3Vector &  direction
const [virtual]
 

Implements Trajectory.

void MdcSagTraj::getInfo double  fltLen,
HepPoint3D ,
Hep3Vector &  direction,
Hep3Vector &  delDirect
const [virtual]
 

Implements Trajectory.

00171 {
00172 //       std::cout<<"Dyz*"<<"MdcSagTraj011 "<<std::endl;//yzhang DEBUG
00173          
00174   pos = _start;
00175 //CHANGE   pos += _direction*flightlen ;
00176   pos += (HepPoint3D) _direction*flightlen ;
00177   
00178   pos.setY( pos.y() + (_a*flightlen+_b)*flightlen) ;
00179 
00180   dir = _direction;
00181   dir.setY( dir.y() + 2*_a*flightlen+_b) ;
00182   // Note: `dir' is on purpose not normalized (WDH, Jan 2003)
00183 
00184   delDir.setX(0.);
00185   delDir.setY(2.*_a);
00186   delDir.setZ(0.);
00187 }

void MdcSagTraj::getInfo double  fltLen,
HepPoint3D ,
Hep3Vector &  direction
const [virtual]
 

Implements Trajectory.

00153 {
00154 // std::cout<<"Dyz*"<<"MdcSagTraj01 "<<std::endl;//yzhang DEBUG
00155   // Written using +=, etc to avoid temporaries
00156   pos = _start;
00157 //CHANGE   pos += _direction*flightlen;
00158   pos += (HepPoint3D) _direction*flightlen;
00159   
00160   dir = _direction;
00161   if ( flightlen > 0. ) {
00162     pos.setY(pos.y() + deltaY(flightlen));
00163     dir.setY(dir.y() + 2.*_a*flightlen+_b);
00164     dir.setMag(1.0);
00165   }
00166 }

double Trajectory::hiRange  )  const [inherited]
 

double Trajectory::hiRange  )  const [inline, inherited]
 

00092 {return flightrange[1];}

double Trajectory::lowRange  )  const [inherited]
 

double Trajectory::lowRange  )  const [inline, inherited]
 

00091 {return flightrange[0];}

MdcSagTraj& MdcSagTraj::operator= const MdcSagTraj  ) 
 

MdcSagTraj & MdcSagTraj::operator= const MdcSagTraj  ) 
 

00095 {
00096   if(&other != this){
00097     for(int iend=0;iend<2;iend++)
00098       flightrange[iend] = other.flightrange[iend];
00099     _start = other._start;
00100     _stop = other._stop;
00101     _sag = other._sag;
00102     _a = other._a;
00103     _b = other._b;
00104     _length = other._length;
00105     _direction = other._direction;
00106   }
00107   return *this;
00108 }

HepPoint3D MdcSagTraj::position double   )  const [virtual]
 

Implements Trajectory.

HepPoint3D MdcSagTraj::position double   )  const [virtual]
 

Implements Trajectory.

00122 {
00123   static HepPoint3D tmppos;
00124   tmppos = _start;
00125 //CHANGE   tmppos += _direction*flightlen;
00126   tmppos += (HepPoint3D) _direction*flightlen;//yzhang TEMP 
00127   tmppos.setY(tmppos.y()+(_a*flightlen+_b)*flightlen);
00128   return tmppos;
00129 }

virtual void Trajectory::print std::ostream os  )  const [virtual, inherited]
 

Reimplemented in HelixTraj, TrkDifPieceTraj, TrkSimpTraj, HelixTraj, TrkDifPieceTraj, and TrkSimpTraj.

void Trajectory::print std::ostream os  )  const [virtual, inherited]
 

Reimplemented in HelixTraj, TrkDifPieceTraj, TrkSimpTraj, HelixTraj, TrkDifPieceTraj, and TrkSimpTraj.

00071 {
00072   os << "Trajectory range from " 
00073      << flightrange[0] << " to "
00074      << flightrange[1] << endl;
00075 }

virtual void Trajectory::printAll std::ostream os  )  const [virtual, inherited]
 

Reimplemented in HelixTraj, TrkDifPieceTraj, TrkSimpTraj, HelixTraj, TrkDifPieceTraj, and TrkSimpTraj.

void Trajectory::printAll std::ostream os  )  const [virtual, inherited]
 

Reimplemented in HelixTraj, TrkDifPieceTraj, TrkSimpTraj, HelixTraj, TrkDifPieceTraj, and TrkSimpTraj.

00079 {
00080   os << "Trajectory range from "
00081      << flightrange[0] << " to "
00082      << flightrange[1] << endl;
00083 }

double Trajectory::range  )  const [inherited]
 

double Trajectory::range  )  const [inline, inherited]
 

00093 { return hiRange()-lowRange(); }

const Hep3Vector& MdcSagTraj::rawDirection void   )  const [inline]
 

00087 { return _direction; }

const Hep3Vector& MdcSagTraj::rawDirection void   )  const [inline]
 

00087 { return _direction; }

double MdcSagTraj::sag void   )  const [inline]
 

00080 { return _sag; }

double MdcSagTraj::sag void   )  const [inline]
 

00080 { return _sag; }

virtual void Trajectory::setFlightRange double  newrange[2]  )  [virtual, inherited]
 

Reimplemented in TrkDifPieceTraj, and TrkDifPieceTraj.

void Trajectory::setFlightRange double  newrange[2]  )  [virtual, inherited]
 

Reimplemented in TrkDifPieceTraj, and TrkDifPieceTraj.

00058 {
00059   if (newrange[1] >= newrange[0]) {
00060     flightrange[0] = newrange[0];
00061     flightrange[1] = newrange[1];
00062   } else {
00063     std::cout<<"ErrMsg(error) "<< "Invalid Trajectory range requested." << std::endl;
00064     flightrange[0] = newrange[1];
00065     flightrange[1] = newrange[0];
00066   }
00067 }

bool Trajectory::validFlightDistance double  f,
double  tolerance = 0.0
const [inherited]
 

bool Trajectory::validFlightDistance double  f,
double  tolerance = 0.0
const [inline, inherited]
 

00088                                                                      {
00089   return f >= flightrange[0]-tol && f <= flightrange[1]+tol; 
00090 }


Member Data Documentation

double MdcSagTraj::_a [private]
 

double MdcSagTraj::_b [private]
 

Hep3Vector MdcSagTraj::_direction [private]
 

double MdcSagTraj::_length [private]
 

double MdcSagTraj::_sag [private]
 

HepPoint3D MdcSagTraj::_start [private]
 

HepPoint3D MdcSagTraj::_stop [private]
 

double Trajectory::flightrange [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:28:11 2011 for BOSS6.5.5 by  doxygen 1.3.9.1