BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcSagTraj Class Reference

#include <MdcSagTraj.h>

+ Inheritance diagram for MdcSagTraj:

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
 
- Public Member Functions inherited from TrkGeomTraj
 TrkGeomTraj (double lowlim, double hilim)
 
virtual ~TrkGeomTraj ()
 
- 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
 
virtual void print (std::ostream &os) const
 
virtual void printAll (std::ostream &os) const
 

Additional Inherited Members

- Protected Member Functions inherited from Trajectory
Trajectoryoperator= (const Trajectory &)
 
- Protected Attributes inherited from Trajectory
double flightrange [2]
 

Detailed Description

Definition at line 65 of file MdcSagTraj.h.

Constructor & Destructor Documentation

◆ MdcSagTraj() [1/2]

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

Definition at line 57 of file MdcSagTraj.cxx.

59 : TrkGeomTraj(0.0,start.distance(stop)), _sag(sag), _start(start), _stop(stop)
60{
61 //_direction = stop - start;
62 _direction = ((CLHEP::Hep3Vector) stop) - ((CLHEP::Hep3Vector) start);
63 _length = _direction.mag();
64 assert( _length != 0 );
65
66 _direction.setMag(1.0);
67 _a = _sag*4./(_length*_length);
68 _b = -_a*_length;
69
70}
double sag(void) const
Definition MdcSagTraj.h:80
TrkGeomTraj(double lowlim, double hilim)

Referenced by clone().

◆ MdcSagTraj() [2/2]

MdcSagTraj::MdcSagTraj ( const MdcSagTraj & traj)

Definition at line 72 of file MdcSagTraj.cxx.

73 : TrkGeomTraj(0.0,other._start.distance(other._stop)),
74 _sag(other._sag), _a(other._a), _b(other._b), _length(other._length),
75 _start(other._start), _stop(other._stop),
76 _direction(other._direction)
77{}
Index other(Index i, Index j)

◆ ~MdcSagTraj()

MdcSagTraj::~MdcSagTraj ( )
virtual

Definition at line 79 of file MdcSagTraj.cxx.

79{;}

Member Function Documentation

◆ accept()

void MdcSagTraj::accept ( TrkGeomTrajVisitor & visitor) const
virtual

Reimplemented from TrkGeomTraj.

Definition at line 212 of file MdcSagTraj.cxx.

213{
214 std::cout<<"ErrMsg(error)"<<"accept visitor NOT implemented yet"<<std::endl;
215}

◆ clone()

MdcSagTraj * MdcSagTraj::clone ( ) const
virtual

Implements TrkGeomTraj.

Definition at line 84 of file MdcSagTraj.cxx.

85{
86 return new MdcSagTraj(*this);
87}
MdcSagTraj(const double sag, const HepPoint3D &point1, const HepPoint3D &point2)

◆ curvature()

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

Implements Trajectory.

Definition at line 190 of file MdcSagTraj.cxx.

191{
192 return _sag;
193}

Referenced by MdcSWire::print().

◆ delDirect()

Hep3Vector MdcSagTraj::delDirect ( double ) const
virtual

Implements Trajectory.

Definition at line 146 of file MdcSagTraj.cxx.

147{
148 return Hep3Vector(0., 2.*_a, 0.);
149}

◆ deltaY()

double MdcSagTraj::deltaY ( double fltLen) const
inline

Definition at line 94 of file MdcSagTraj.h.

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

Referenced by getInfo().

◆ direction()

Hep3Vector MdcSagTraj::direction ( double flightlen) const
virtual

Implements Trajectory.

Definition at line 132 of file MdcSagTraj.cxx.

132 {
133 if ( flightlen <= 0. ) return _direction;
134// Hep3Vector dir = _direction*flightlen + delDirect(flightlen);
135 static Hep3Vector tmpdir;
136 tmpdir = _direction*flightlen;
137// register double newy = tmpdir.y() + 2.*_a*flightlen+_b;
138// tmpdir.setY(newy);
139 tmpdir.setY(tmpdir.y() + 2.*_a*flightlen+_b);
140// tmpdir += delDirect(flightlen);
141 tmpdir.setMag(1.0);
142 return tmpdir;
143}

Referenced by MdcSWire::print().

◆ distTo1stError()

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

Implements Trajectory.

Definition at line 196 of file MdcSagTraj.cxx.

197{
198 double dtmp = pathDir*2.*_a*flightlen+_b;
199
200 return dtmp==0. ? 9999.e4 : fabs(tol/dtmp);
201}

◆ distTo2ndError()

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

Implements Trajectory.

Definition at line 204 of file MdcSagTraj.cxx.

205{
206 return 999.e4 ;
207 //return _a==0. ? 999.e4 : tol/(2.*_a);
208}

◆ getInfo() [1/2]

void MdcSagTraj::getInfo ( double fltLen,
HepPoint3D & pos,
Hep3Vector & direction ) const
virtual

Implements Trajectory.

Definition at line 152 of file MdcSagTraj.cxx.

153{
154// std::cout<<"Dyz*"<<"MdcSagTraj01 "<<std::endl;//yzhang DEBUG
155 // Written using +=, etc to avoid temporaries
156 pos = _start;
157//CHANGE pos += _direction*flightlen;
158 pos += (HepPoint3D) _direction*flightlen;
159
160 dir = _direction;
161 if ( flightlen > 0. ) {
162 pos.setY(pos.y() + deltaY(flightlen));
163 dir.setY(dir.y() + 2.*_a*flightlen+_b);
164 dir.setMag(1.0);
165 }
166}
HepGeom::Point3D< double > HepPoint3D
Definition MdcSagTraj.h:51
double deltaY(double fltLen) const
Definition MdcSagTraj.h:94

◆ getInfo() [2/2]

void MdcSagTraj::getInfo ( double fltLen,
HepPoint3D & pos,
Hep3Vector & direction,
Hep3Vector & delDirect ) const
virtual

Implements Trajectory.

Definition at line 169 of file MdcSagTraj.cxx.

171{
172// std::cout<<"Dyz*"<<"MdcSagTraj011 "<<std::endl;//yzhang DEBUG
173
174 pos = _start;
175//CHANGE pos += _direction*flightlen ;
176 pos += (HepPoint3D) _direction*flightlen ;
177
178 pos.setY( pos.y() + (_a*flightlen+_b)*flightlen) ;
179
180 dir = _direction;
181 dir.setY( dir.y() + 2*_a*flightlen+_b) ;
182 // Note: `dir' is on purpose not normalized (WDH, Jan 2003)
183
184 delDir.setX(0.);
185 delDir.setY(2.*_a);
186 delDir.setZ(0.);
187}

◆ operator=()

MdcSagTraj & MdcSagTraj::operator= ( const MdcSagTraj & other)

Definition at line 94 of file MdcSagTraj.cxx.

95{
96 if(&other != this){
97 for(int iend=0;iend<2;iend++)
98 flightrange[iend] = other.flightrange[iend];
99 _start = other._start;
100 _stop = other._stop;
101 _sag = other._sag;
102 _a = other._a;
103 _b = other._b;
104 _length = other._length;
105 _direction = other._direction;
106 }
107 return *this;
108}
double flightrange[2]
Definition Trajectory.h:83

◆ position()

HepPoint3D MdcSagTraj::position ( double flightlen) const
virtual

Implements Trajectory.

Definition at line 121 of file MdcSagTraj.cxx.

122{
123 static HepPoint3D tmppos;
124 tmppos = _start;
125//CHANGE tmppos += _direction*flightlen;
126 tmppos += (HepPoint3D) _direction*flightlen;//yzhang TEMP
127 tmppos.setY(tmppos.y()+(_a*flightlen+_b)*flightlen);
128 return tmppos;
129}

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

◆ rawDirection()

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

Definition at line 87 of file MdcSagTraj.h.

87{ return _direction; }

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

◆ sag()

double MdcSagTraj::sag ( void ) const
inline

Definition at line 80 of file MdcSagTraj.h.

80{ return _sag; }

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


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