All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfWireX.cxx
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////
2 ///
3 /// \file SurfWireX.cxx
4 ///
5 /// \brief Planar surface defined by wire id and x-axis.
6 ///
7 /// \author H. Greenlee
8 ///
9 ////////////////////////////////////////////////////////////////////////
10 
11 #include "art/Framework/Services/Registry/ServiceHandle.h"
15 #include "TMath.h"
16 
17 namespace trkf {
18 
19  /// Constructor.
20  ///
21  /// Arguments:
22  ///
23  /// wireid - Wire id.
24  ///
26  {
27  // Get geometry service.
28 
29  art::ServiceHandle<geo::Geometry const> geom;
30 
31  // Get wire geometry.
32 
33  geo::WireGeo const& wgeom = geom->WireIDToWireGeo(wireid);
34 
35  // Get wire center and angle from the wire geometry.
36  // Put local origin at center of wire.
37 
38  double xyz[3] = {0.};
39  wgeom.GetCenter(xyz);
40  double phi = TMath::PiOver2() - wgeom.ThetaZ();
41 
42  // Update base class.
43 
44  *static_cast<SurfYZPlane*>(this) = SurfYZPlane(0., xyz[1], xyz[2], phi);
45  }
46 
47  /// Destructor.
49  {}
50 
51 } // end namespace trkf
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:65
virtual ~SurfWireX()
Destructor.
Definition: SurfWireX.cxx:48
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Definition: WireGeo.h:250
Encapsulate the geometry of a wire.
SurfYZPlane()
Default constructor.
Definition: SurfYZPlane.cxx:24
double phi() const
Rotation angle about x-axis.
Definition: SurfYZPlane.h:63
SurfWireX(const geo::WireID &wireid)
Constructor.
Definition: SurfWireX.cxx:25
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:73
Planar surface defined by wire id and x-axis.
art framework interface to geometry description