13 #include "cetlib_except/exception.h" 61 double sinphi = std::sin(
fPhi);
62 double cosphi = std::cos(
fPhi);
65 uvw[0] = xyz[0] -
fX0;
68 uvw[1] = (xyz[1] -
fY0) * cosphi + (xyz[2] -
fZ0) * sinphi;
71 uvw[2] = -(xyz[1] -
fY0) * sinphi + (xyz[2] -
fZ0) * cosphi;
83 double sinphi = std::sin(
fPhi);
84 double cosphi = std::cos(
fPhi);
87 xyz[0] =
fX0 + uvw[0];
90 xyz[1] =
fY0 + uvw[1] * cosphi - uvw[2] * sinphi;
93 xyz[2] =
fZ0 + uvw[1] * sinphi + uvw[2] * cosphi;
132 double p = 1. / std::max(invp, 1.
e-3);
136 double dudw = vec(2);
137 double dvdw = vec(3);
141 double dwds = 1. / std::sqrt(1. + dudw * dudw + dvdw * dvdw);
146 throw cet::exception(
"SurfYZPlane") <<
"Track direction not specified.\n";
150 double pu = p * dudw * dwds;
151 double pv = p * dvdw * dwds;
152 double pw = p * dwds;
156 double sinphi = std::sin(
fPhi);
157 double cosphi = std::cos(
fPhi);
160 mom[1] = pv * cosphi - pw * sinphi;
161 mom[2] = pv * sinphi + pw * cosphi;
188 double delta_phi = TVector2::Phi_mpi_pi(
fPhi - psurf->
phi());
213 throw cet::exception(
"SurfYZPlane") <<
"Attempt to find distance to non-parallel surface.\n";
218 double otheruvw[3] = {0., 0., 0.};
251 double delta_phi = TVector2::Phi_mpi_pi(
fPhi - psurf->
phi());
252 double dx =
fX0 - psurf->
x0();
253 double dy =
fY0 - psurf->
y0();
254 double dz =
fZ0 - psurf->
z0();
265 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.
constexpr auto abs(T v)
Returns the absolute value of the argument.
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.
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