13 #include "cetlib_except/exception.h" 70 double sinphi = std::sin(
fPhi);
71 double cosphi = std::cos(
fPhi);
74 uvw[0] = xyz[0] -
fX0;
77 uvw[1] = (xyz[1] -
fY0) * cosphi + (xyz[2] -
fZ0) * sinphi;
80 uvw[2] = -(xyz[1] -
fY0) * sinphi + (xyz[2] -
fZ0) * cosphi;
92 double sinphi = std::sin(
fPhi);
93 double cosphi = std::cos(
fPhi);
96 xyz[0] =
fX0 + uvw[0];
99 xyz[1] =
fY0 + uvw[1] * cosphi - uvw[2] * sinphi;
102 xyz[2] =
fZ0 + uvw[1] * sinphi + uvw[2] * cosphi;
146 double dudw = vec(2);
147 double dvdw = vec(3);
151 double dwds = 1. / std::sqrt(1. + dudw*dudw + dvdw*dvdw);
156 throw cet::exception(
"SurfYZPlane") <<
"Track direction not specified.\n";
160 double pu = p * dudw * dwds;
161 double pv = p * dvdw * dwds;
162 double pw = p * dwds;
166 double sinphi = std::sin(
fPhi);
167 double cosphi = std::cos(
fPhi);
170 mom[1] = pv * cosphi - pw * sinphi;
171 mom[2] = pv * sinphi + pw * cosphi;
198 double delta_phi = TVector2::Phi_mpi_pi(
fPhi - psurf->
phi());
224 throw cet::exception(
"SurfYZPlane") <<
"Attempt to find distance to non-parallel surface.\n";
229 double otheruvw[3] = {0., 0., 0.};
262 double delta_phi = TVector2::Phi_mpi_pi(
fPhi - psurf->
phi());
263 double dx =
fX0 - psurf->
x0();
264 double dy =
fY0 - psurf->
y0();
265 double dz =
fZ0 - psurf->
z0();
278 out <<
"SurfYZPlane{ x0=" <<
fX0 <<
", y0=" <<
fY0 <<
", z0=" <<
fZ0 <<
", phi=" <<
fPhi <<
"}";
static double fSepTolerance
Separation tolerance for equal.
TrackDirection
Track direction enum.
double fPhi
Rotation angle about x-axis.
double z0() const
Z origin.
double x0() const
X origin.
Planar surface parallel to x-axis.
static double fPhiTolerance
Phi tolerance for parallel.
virtual ~SurfYZPlane()
Destructor.
virtual bool isParallel(const Surface &surf) const
Test whether two surfaces are parallel, within tolerance.
virtual double distanceTo(const Surface &surf) const
Find perpendicular forward distance to a parallel surface.
virtual void getMomentum(const TrackVector &vec, double mom[3], TrackDirection dir=UNKNOWN) const
Get momentum vector of track.
double y0() const
Y origin.
virtual bool isTrackValid(const TrackVector &vec) const
Surface-specific tests of validity of track parameters.
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
static int max(int a, int b)
virtual void toLocal(const double xyz[3], double uvw[3]) const
Transform global to local coordinates.
virtual std::ostream & Print(std::ostream &out) const
Printout.
virtual void toGlobal(const double uvw[3], double xyz[3]) const
Transform local to global coordinates.
SurfYZPlane()
Default constructor.
virtual bool isEqual(const Surface &surf) const
Test two surfaces for equality, within tolerance.
double phi() const
Rotation angle about x-axis.
virtual TrackDirection getDirection(const TrackVector &, TrackDirection dir=UNKNOWN) const
Get direction of track (default UNKNOWN).
virtual void getPosition(const TrackVector &vec, double xyz[3]) const
Get position of track.
virtual Surface * clone() const
Clone method.
virtual void toGlobal(const double uvw[3], double xyz[3]) const =0
Transform local to global coordinates.
cet::coded_exception< error, detail::translate > exception