MdcSagTraj Class Reference

#include <MdcSagTraj.h>

Inheritance diagram for MdcSagTraj:

TrkGeomTraj Trajectory List of all members.

Public Member Functions

 MdcSagTraj (const double sag, const HepPoint3D &point1, const HepPoint3D &point2)
 MdcSagTraj (const MdcSagTraj &traj)
MdcSagTrajclone () const
virtual ~MdcSagTraj ()
MdcSagTrajoperator= (const MdcSagTraj &)
double sag (void) const
HepPoint3D position (double) const
Hep3Vector direction (double) const
double curvature (double f=0.) const
Hep3Vector delDirect (double) const
const Hep3Vector & rawDirection (void) const
void getInfo (double fltLen, HepPoint3D &, Hep3Vector &direction) const
void getInfo (double fltLen, HepPoint3D &, Hep3Vector &direction, Hep3Vector &delDirect) const
virtual double distTo1stError (double s, double tol, int pathDir) const
virtual double distTo2ndError (double s, double tol, int pathDir) const
double deltaY (double fltLen) const
void accept (TrkGeomTrajVisitor &visitor) const
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
virtual void print (std::ostream &os) const
virtual void printAll (std::ostream &os) const

Protected Attributes

double flightrange [2]

Private Member Functions

Hep3Vector deviation (double) const

Private Attributes

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

Detailed Description

Definition at line 65 of file MdcSagTraj.h.


Constructor & Destructor Documentation

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

Definition at line 57 of file MdcSagTraj.cxx.

References _a, _b, _direction, _length, and _sag.

Referenced by clone().

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  ) 

Definition at line 72 of file MdcSagTraj.cxx.

00073   : TrkGeomTraj(0.0,other._start.distance(other._stop)), 
00074     _sag(other._sag), _a(other._a), _b(other._b), _length(other._length),
00075     _start(other._start), _stop(other._stop), 
00076     _direction(other._direction)
00077 {}

MdcSagTraj::~MdcSagTraj (  )  [virtual]

Definition at line 79 of file MdcSagTraj.cxx.

00079 {;}


Member Function Documentation

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

Reimplemented from TrkGeomTraj.

Definition at line 212 of file MdcSagTraj.cxx.

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

MdcSagTraj * MdcSagTraj::clone (  )  const [virtual]

Implements TrkGeomTraj.

Definition at line 84 of file MdcSagTraj.cxx.

References MdcSagTraj().

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

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

Implements Trajectory.

Definition at line 190 of file MdcSagTraj.cxx.

References _sag.

Referenced by MdcSWire::print().

00191 {
00192   return _sag;
00193 }

Hep3Vector MdcSagTraj::delDirect ( double   )  const [virtual]

Implements Trajectory.

Definition at line 146 of file MdcSagTraj.cxx.

References _a.

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

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

Definition at line 94 of file MdcSagTraj.h.

References _a, and _b.

Referenced by getInfo().

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

Hep3Vector MdcSagTraj::deviation ( double   )  const [private]

Definition at line 111 of file MdcSagTraj.cxx.

References _a, and _b.

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.

Definition at line 132 of file MdcSagTraj.cxx.

References _a, _b, and _direction.

Referenced by MdcSWire::print().

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]

Definition at line 51 of file Trajectory.cxx.

00052 {
00053   return fabs(tolerance);
00054 }

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

Implements Trajectory.

Definition at line 196 of file MdcSagTraj.cxx.

References _a, and _b.

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

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

Implements Trajectory.

Definition at line 204 of file MdcSagTraj.cxx.

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.

Definition at line 169 of file MdcSagTraj.cxx.

References _a, _b, _direction, and _start.

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.

Definition at line 152 of file MdcSagTraj.cxx.

References _a, _b, _direction, _start, and deltaY().

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 [inline, inherited]

Definition at line 92 of file Trajectory.h.

References Trajectory::flightrange.

Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::changePoint(), MdcUtilitySvc::docaPatPar(), TrkRep::endValidRange(), TrkCompTrk::endValidRange(), TrkSimpTraj::invert(), TrkDifPieceTraj::invert(), TrkDifPieceTraj::locallyValid(), MdcHitOnTrack::MdcHitOnTrack(), TrkSimpTraj::operator==(), TrkDifPieceTraj::prepend(), and Trajectory::range().

00092 {return flightrange[1];}

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

Definition at line 91 of file Trajectory.h.

References Trajectory::flightrange.

Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::changePoint(), MdcUtilitySvc::docaPatPar(), TrkSimpTraj::invert(), TrkDifPieceTraj::invert(), TrkDifPieceTraj::locallyValid(), MdcHitOnTrack::MdcHitOnTrack(), TrkSimpTraj::operator==(), TrkDifPieceTraj::prepend(), Trajectory::range(), TrkRep::startValidRange(), TrkCompTrk::startValidRange(), TrkDifPieceTraj::trajIndex(), and TrkDifPieceTraj::TrkDifPieceTraj().

00091 {return flightrange[0];}

MdcSagTraj & MdcSagTraj::operator= ( const MdcSagTraj  ) 

Definition at line 94 of file MdcSagTraj.cxx.

References _a, _b, _direction, _length, _sag, _start, _stop, Trajectory::flightrange, and EvtCyclic3::other().

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.

Definition at line 121 of file MdcSagTraj.cxx.

References _a, _b, _direction, and _start.

Referenced by main(), and MdcSWire::print().

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, and TrkSimpTraj.

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

Reimplemented in HelixTraj, TrkDifPieceTraj, and TrkSimpTraj.

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

Definition at line 93 of file Trajectory.h.

References Trajectory::hiRange(), and Trajectory::lowRange().

Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::invert(), TrkDifPieceTraj::invert(), and TrkDifPieceTraj::prepend().

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

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

Definition at line 87 of file MdcSagTraj.h.

References _direction.

Referenced by main(), MdcSWire::print(), and MdcSWire::zAxis().

00087 { return _direction; }

double MdcSagTraj::sag ( void   )  const [inline]

Definition at line 80 of file MdcSagTraj.h.

References _sag.

Referenced by MdcUtilitySvc::docaPatPar(), main(), and MdcSWire::print().

00080 { return _sag; }

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

Reimplemented in TrkDifPieceTraj.

Definition at line 57 of file Trajectory.cxx.

References Trajectory::flightrange.

Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::changePoint(), TrkSimpTraj::invert(), TrkDifPieceTraj::invert(), TrkDifPieceTraj::prepend(), and TrkDifPieceTraj::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 [inline, inherited]

Definition at line 88 of file Trajectory.h.

References Trajectory::flightrange.

Referenced by TrkDifPieceTraj::trajIndex().

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


Member Data Documentation

double MdcSagTraj::_a [private]

Definition at line 105 of file MdcSagTraj.h.

Referenced by delDirect(), deltaY(), deviation(), direction(), distTo1stError(), getInfo(), MdcSagTraj(), operator=(), and position().

double MdcSagTraj::_b [private]

Definition at line 106 of file MdcSagTraj.h.

Referenced by deltaY(), deviation(), direction(), distTo1stError(), getInfo(), MdcSagTraj(), operator=(), and position().

Hep3Vector MdcSagTraj::_direction [private]

Definition at line 112 of file MdcSagTraj.h.

Referenced by direction(), getInfo(), MdcSagTraj(), operator=(), position(), and rawDirection().

double MdcSagTraj::_length [private]

Definition at line 107 of file MdcSagTraj.h.

Referenced by MdcSagTraj(), and operator=().

double MdcSagTraj::_sag [private]

Definition at line 104 of file MdcSagTraj.h.

Referenced by curvature(), MdcSagTraj(), operator=(), and sag().

HepPoint3D MdcSagTraj::_start [private]

Definition at line 110 of file MdcSagTraj.h.

Referenced by getInfo(), operator=(), and position().

HepPoint3D MdcSagTraj::_stop [private]

Definition at line 111 of file MdcSagTraj.h.

Referenced by operator=().

double Trajectory::flightrange[2] [protected, inherited]

Definition at line 83 of file Trajectory.h.

Referenced by TrkDifPieceTraj::append(), Trajectory::hiRange(), Trajectory::lowRange(), TrkDifPieceTraj::operator=(), NeutTraj::operator=(), Trajectory::operator=(), operator=(), TrkDifPieceTraj::prepend(), TrkDifPieceTraj::resize(), TrkDifPieceTraj::setFlightRange(), Trajectory::setFlightRange(), Trajectory::Trajectory(), TrkDifPieceTraj::TrkDifPieceTraj(), and Trajectory::validFlightDistance().


Generated on Tue Nov 29 23:20:16 2016 for BOSS_7.0.2 by  doxygen 1.4.7