All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfWireLine.cxx
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////
2 ///
3 /// \file SurfWireLine.cxx
4 ///
5 /// \brief Linear surface defined by wire id and x coordinate.
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  /// x - X coordinate.
25  ///
26  SurfWireLine::SurfWireLine(const geo::WireID& wireid, double x)
27  {
28  // Get geometry service.
29 
30  art::ServiceHandle<geo::Geometry const> geom;
31 
32  // Get wire geometry.
33 
34  geo::WireGeo const& wgeom = geom->WireIDToWireGeo(wireid);
35 
36  // Get wire center and angle from the wire geometry.
37  // Put local origin at center of wire.
38 
39  double xyz[3] = {0.};
40  wgeom.GetCenter(xyz);
41  double phi = TMath::PiOver2() - wgeom.ThetaZ();
42 
43  // Update base class.
44 
45  *static_cast<SurfYZLine*>(this) = SurfYZLine(x, xyz[1], xyz[2], phi);
46  }
47 
48  /// Destructor.
50  {}
51 
52 } // end namespace trkf
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:65
process_name opflash particleana ie x
SurfWireLine(const geo::WireID &wireid, double x)
Constructor.
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Definition: WireGeo.h:250
virtual ~SurfWireLine()
Destructor.
Linear surface defined by wire id and x coordinate.
Encapsulate the geometry of a wire.
double phi() const
Rotation angle about x-axis.
Definition: SurfYZLine.h:95
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:73
art framework interface to geometry description
SurfYZLine()
Default constructor.
Definition: SurfYZLine.cxx:25