Public Member Functions | Private Attributes | List of all members
WireCell::WireParams Class Reference

#include <WireParams.h>

Inheritance diagram for WireCell::WireParams:
WireCell::IWireParameters WireCell::IConfigurable WireCell::IComponent< IWireParameters > WireCell::IComponent< IConfigurable > WireCell::Interface WireCell::Interface

Public Member Functions

void set (const Ray &bounds, const Ray &U, const Ray &V, const Ray &W)
 
void set (double dx=10 *units::mm, double dy=1 *units::meter, double dz=1 *units::meter, double pitch=10 *units::mm, double angle=60.0 *units::degree)
 
const Raybounds () const
 
const RaypitchU () const
 
const RaypitchV () const
 
const RaypitchW () const
 
virtual void configure (const WireCell::Configuration &config)
 
virtual WireCell::Configuration default_configuration () const
 Optional, override to return a hard-coded default configuration. More...
 
 WireParams ()
 
virtual ~WireParams ()
 
- Public Member Functions inherited from WireCell::IWireParameters
virtual ~IWireParameters ()
 
virtual const Raypitch (WireCell::WirePlaneLayer_t layer) const
 
- Public Member Functions inherited from WireCell::IComponent< IWireParameters >
virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 
- Public Member Functions inherited from WireCell::IConfigurable
virtual ~IConfigurable ()
 
- Public Member Functions inherited from WireCell::IComponent< IConfigurable >
virtual ~IComponent ()
 

Private Attributes

Ray m_bounds
 
Ray m_pitchU
 
Ray m_pitchV
 
Ray m_pitchW
 

Additional Inherited Members

- Public Types inherited from WireCell::IComponent< IWireParameters >
typedef std::shared_ptr< IWireParameterspointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 
- Public Types inherited from WireCell::IComponent< IConfigurable >
typedef std::shared_ptr< IConfigurablepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 

Detailed Description

Embody parameters describing a triple of wire planes and provide a configurable interface.

Definition at line 12 of file WireParams.h.

Constructor & Destructor Documentation

WireParams::WireParams ( )

Definition at line 17 of file WireParams.cxx.

18 {
19  //++n_wireparams;
20  //cerr << "WireParams(" << n_wireparams << ")" << endl;
21  this->set();
22 }
WireParams::~WireParams ( )
virtual

Definition at line 23 of file WireParams.cxx.

24 {
25  //--n_wireparams;
26  //cerr << "~WireParams(" << n_wireparams << ")" << endl;
27 }

Member Function Documentation

const Ray & WireParams::bounds ( ) const
virtual

Provide access to the rays which were used to define the wires.

Implements WireCell::IWireParameters.

Definition at line 149 of file WireParams.cxx.

149 { return m_bounds; }
void WireParams::configure ( const WireCell::Configuration config)
virtual

Configurable interface.

Implements WireCell::IConfigurable.

Definition at line 44 of file WireParams.cxx.

45 {
46  // The local origin about which all else is measured.
47  double cx = get<double>(cfg, "center_mm.x")*units::mm;
48  double cy = get<double>(cfg,"center_mm.y")*units::mm;
49  double cz = get<double>(cfg, "center_mm.z")*units::mm;
50  const Point center(cx,cy,cz);
51 
52  // The full width sizes
53  double dx = get<double>(cfg, "size_mm.x")*units::mm;
54  double dy = get<double>(cfg, "size_mm.y")*units::mm;
55  double dz = get<double>(cfg, "size_mm.z")*units::mm;
56  const Point deltabb(dx,dy,dz);
57  const Point bbmax = center + 0.5*deltabb;
58  const Point bbmin = center - 0.5*deltabb;
59 
60  // The angles of the wires w.r.t. the positive Y axis
61  double angU = get<double>(cfg, "angle_deg.u")*units::degree;
62  double angV = get<double>(cfg, "angle_deg.v")*units::degree;
63  double angW = get<double>(cfg, "angle_deg.w")*units::degree;
64 
65  const Vector wU(0, std::cos(angU), std::sin(angU));
66  const Vector wV(0, std::cos(angV), std::sin(angV));
67  const Vector wW(0, std::cos(angW), std::sin(angW));
68 
69  // The pitch magnitudes.
70  double pitU = get<double>(cfg, "pitch_mm.u")*units::mm;
71  double pitV = get<double>(cfg, "pitch_mm.v")*units::mm;
72  double pitW = get<double>(cfg, "pitch_mm.w")*units::mm;
73 
74  // Pitch vectors
75  const Vector xaxis(1,0,0);
76  const Vector pU = pitU*xaxis.cross(wU);
77  const Vector pV = pitV*xaxis.cross(wV);
78  const Vector pW = pitW*xaxis.cross(wW);
79 
80  // The offset in the pitch direction from the center to a wire
81  double offU = get<double>(cfg, "offset_mm.u")*units::mm;
82  double offV = get<double>(cfg, "offset_mm.v")*units::mm;
83  double offW = get<double>(cfg, "offset_mm.w")*units::mm;
84 
85  Point oU = center + pU.norm() * offU;
86  Point oV = center + pV.norm() * offV;
87  Point oW = center + pW.norm() * offW;
88 
89  // Force X location of plane along the X axis.
90  oU.x(get<double>(cfg, "plane_mm.u")*units::mm);
91  oV.x(get<double>(cfg, "plane_mm.v")*units::mm);
92  oW.x(get<double>(cfg, "plane_mm.w")*units::mm);
93 
94 
95  const Ray bounds(bbmin, bbmax);
96  const Ray U(oU, oU+pU), V(oV, oV+pV), W(oW, oW+pW);
97  this->set(bounds, U, V, W);
98 }
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
D3Vector< double > Point
A 3D Cartesian point in double precision.
Definition: Point.h:15
const Ray & bounds() const
Definition: WireParams.cxx:149
cfg
Definition: dbjson.py:29
static const double mm
Definition: Units.h:55
std::vector< float > Vector
def center(depos, point)
Definition: depos.py:117
static const double degree
Definition: Units.h:78
Configuration WireParams::default_configuration ( ) const
virtual

Optional, override to return a hard-coded default configuration.

Reimplemented from WireCell::IConfigurable.

Definition at line 29 of file WireParams.cxx.

30 {
31  std::string json = R"(
32 {
33 "center_mm":{"x":0.0, "y":0.0, "z":0.0},
34 "size_mm":{"x":10.0, "y":1000.0, "z":1000.0},
35 "pitch_mm":{"u":3.0, "v":3.0, "w":3.0},
36 "angle_deg":{"u":60.0, "v":-60.0, "w":0.0},
37 "offset_mm":{"u":0.0, "v":0.0, "w":0.0},
38 "plane_mm":{"u":3.0, "v":2.0, "w":1.0}
39 }
40 )";
41  return Persist::loads(json);
42 }
std::string string
Definition: nybbler.cc:12
Json::Value loads(const std::string &text, const externalvars_t &extvar=externalvars_t(), const externalvars_t &extcode=externalvars_t())
Definition: Persist.cxx:152
const Ray & WireParams::pitchU ( ) const
virtual

A ray going from the center of the first U wire to the second and perpendicular to both.

Implements WireCell::IWireParameters.

Definition at line 150 of file WireParams.cxx.

150 { return m_pitchU; }
const Ray & WireParams::pitchV ( ) const
virtual

A ray going from the center of the first V wire to the second and perpendicular to both.

Implements WireCell::IWireParameters.

Definition at line 151 of file WireParams.cxx.

151 { return m_pitchV; }
const Ray & WireParams::pitchW ( ) const
virtual

A ray going from the center of the first W wire to the second and perpendicular to both.

Implements WireCell::IWireParameters.

Definition at line 152 of file WireParams.cxx.

152 { return m_pitchW; }
void WireParams::set ( const Ray bounds,
const Ray U,
const Ray V,
const Ray W 
)

Directly set the fundamental parameters. See WireCell::IWireParameters.

Definition at line 100 of file WireParams.cxx.

102 {
103  // save for posterity
104  m_bounds = bounds;
105  m_pitchU = U;
106  m_pitchV = V;
107  m_pitchW = W;
108 }
const Ray & bounds() const
Definition: WireParams.cxx:149
void WireCell::WireParams::set ( double  dx = 10 *units::mm,
double  dy = 1 *units::meter,
double  dz = 1 *units::meter,
double  pitch = 10 *units::mm,
double  angle = 60.0 *units::degree 
)

Set the wire parameters simply.

This method gives a simpler, more restricted interface to setting the wire parameter. It follows the same conventions as the one above but assumes:

  • The bounding box is centered on the origin.
  • One wire of each plane intersects the X-axis.
  • The magnitudes of the U and V angles are equal.
  • The pitches of all three planes are the same.
  • The X values W, V and U planes evening distributed on the positive half of the X covered by the bounding box.
Parameters
dx,dy,dzare the full widths of the bounding box in the associated direction.
pitchis the perpendicular distance between two adjacent wires in a plane.
angleis the absolute angular distance from the U and V wires and the Y-axis.

Member Data Documentation

Ray WireCell::WireParams::m_bounds
private

Definition at line 71 of file WireParams.h.

Ray WireCell::WireParams::m_pitchU
private

Definition at line 71 of file WireParams.h.

Ray WireCell::WireParams::m_pitchV
private

Definition at line 71 of file WireParams.h.

Ray WireCell::WireParams::m_pitchW
private

Definition at line 71 of file WireParams.h.


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