Pitch-Impact-Position. More...
#include <Pimpos.h>
Public Member Functions | |
Pimpos (int nwires, double minwirepitch, double maxwirepitch, const Vector &wire=Vector(0, 1, 0), const Vector &pitch=Vector(0, 0, 1), const Point &origin=Point(0, 0, 0), int nimpact_bins_per_wire_region=10) | |
int | nimpbins_per_wire () const |
Trivial accessor. More... | |
const Point & | origin () const |
Return given 3-point origin for plane pitch. More... | |
const Vector & | axis (int i) const |
Vector | relative (const Point &pt) const |
Return the vector from the origin to the given point. More... | |
double | distance (const Point &pt, int axis=2) const |
Point | transform (const Point &pt) const |
const Binning & | region_binning () const |
const Binning & | impact_binning () const |
std::pair< int, int > | closest (double pitch) const |
int | wire_impact (int wireind) const |
Return the impact position index coincident with the wire index. More... | |
std::pair< int, int > | wire_impacts (int wireind) const |
int | reflect (int wireind, int impind) const |
Private Attributes | |
int | m_nimpbins_per_wire |
Point | m_origin |
Vector | m_axis [3] |
Binning | m_regionbins |
Binning | m_impactbins |
Pitch-Impact-Position.
A Pimpos object encapsulates information and methods related to geometry and binning of a plane of parallel and equidistant wires and a further uniform sub division along their pitch directions.
A wire region or wire bin is the locus centered on a wire and which extends +/- 1/2 pitch from the wire position.
An impact region or impact bin is the smaller locus of pitch formed by uniformly splitting a wire region. It is bound by two (not centered on one) impact positions.
Impact positions are "in phase" with wires" such that there is one impact position coincident with a wire position.
For 3D "lab" to "plane" coordinate transformations there is a plane coordinate system which has these three orthogonal axes:
axis0) anti nominal drift direction (normal to the wire plane) and axis1) along the wire direction such that, axis2) the pitch direction is the cross product of axis0 X axis1.
Pimpos::Pimpos | ( | int | nwires, |
double | minwirepitch, | ||
double | maxwirepitch, | ||
const Vector & | wire = Vector(0,1,0) , |
||
const Vector & | pitch = Vector(0,0,1) , |
||
const Point & | origin = Point(0,0,0) , |
||
int | nimpact_bins_per_wire_region = 10 |
||
) |
Create a Pimpos object for a particular plane.
nwires | is the number of wires in the plane. |
minwirepitch | is the location in the pitch coordinate of the first (zero index) wire. |
maxwirepitch | is the location in the pitch coordinate of the last wire (ie, index=nwires-1). |
wire | is a Vector which sets the direction of the wires in the plane. If the underlying wires are not exactly parallel, this should be some representative average wire direction. |
pitch | is a Vector which sets the direction and of the pitch of the wires in the plane. The pitch should be such that the cross product, wire (x) pitch, points in the anti-drift direction for the region this plane services. If the underlying wires are not exactly parallel, this pitcvector should be some representative average pitch direction. |
origin | is a Point which sets an origin for all transforms. In particular, the projection of this origin point along the drift direction to the plane of wires sets the origin for the pitch coordinate. |
nbins | gives the number of of impact bins covering one wire region. |
The pitch extents and the origin vector must be expressed in the WCT system of (length) units.
Definition at line 5 of file Pimpos.cxx.
|
inline |
std::pair< int, int > Pimpos::closest | ( | double | pitch | ) | const |
Return a pair of indices. The first is the index of the wire closest to the given pitch. The second is the relative index of the impact closest impact position (index=0 means the impact position coincident with the wire).
Definition at line 34 of file Pimpos.cxx.
double Pimpos::distance | ( | const Point & | pt, |
int | axis = 2 |
||
) | const |
Return the distance from origin to point along the given axis. Default is pitch distance.
Definition at line 71 of file Pimpos.cxx.
|
inline |
|
inline |
|
inline |
int Pimpos::reflect | ( | int | wireind, |
int | impind | ||
) | const |
Return the impact position index which is the reflection of the given impact position index through the given wire index.
Definition at line 56 of file Pimpos.cxx.
|
inline |
Return the vector from the origin to the given point.
Definition at line 66 of file Pimpos.cxx.
Transform the given point into the Pimpos coordinate system.
Definition at line 76 of file Pimpos.cxx.
int Pimpos::wire_impact | ( | int | wireind | ) | const |
Return the impact position index coincident with the wire index.
Definition at line 43 of file Pimpos.cxx.
std::pair< int, int > Pimpos::wire_impacts | ( | int | wireind | ) | const |
Return the impact position indices (bin edges) at either extreme of the wire region. The smaller index for this wire is the larger index of wireind-1's values and vice versa.
Definition at line 48 of file Pimpos.cxx.