LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pma Namespace Reference

Classes

class  bDistCenterLess2D
 
class  bDistCenterLess3D
 
class  bSegmentProjLess
 
struct  bTrack3DLonger
 
struct  bTrajectory3DDistLess
 
struct  bTrajectory3DOrderLess
 
class  Element3D
 
class  Hit3D
 
class  Node3D
 
class  PMAlgCosmicTagger
 
class  PMAlgFitter
 
class  PMAlgStitching
 
class  PMAlgTracker
 
class  PMAlgTrackingBase
 
class  PMAlgVertexing
 
class  ProjectionMatchingAlg
 
class  Segment3D
 
class  SortedBranchBase
 
class  SortedObjectBase
 
class  Track3D
 
class  TrkCandidate
 
class  TrkCandidateColl
 
class  VtxCandidate
 

Typedefs

typedef std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > view_hitmap
 
typedef std::map< unsigned int, view_hitmaptpc_view_hitmap
 
typedef std::map< unsigned int, tpc_view_hitmapcryo_tpc_view_hitmap
 
typedef ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< double > > Vector2D
 
typedef recob::tracking::Vector_t Vector3D
 
typedef std::map< size_t, std::vector< double > > dedx_map
 
typedef std::map< size_t, pma::TrkCandidateColltpc_track_map
 

Functions

double Dist2 (const TVector2 &v1, const TVector2 &v2)
 
double Dist2 (const Vector2D &v1, const Vector2D &v2)
 
template<typename T , typename U >
double Dist2 (const T &v1, const U &v2)
 
size_t GetHitsCount (const std::vector< pma::Hit3D * > &hits, unsigned int view)
 
double GetSummedADC (const std::vector< pma::Hit3D * > &hits, unsigned int view=geo::kUnknown)
 
double GetSummedAmpl (const std::vector< pma::Hit3D * > &hits, unsigned int view=geo::kUnknown)
 
double GetHitsRadius3D (const std::vector< pma::Hit3D * > &hits, bool exact=false)
 
double GetHitsRadius2D (const std::vector< pma::Hit3D * > &hits, bool exact=false)
 
double GetSegmentProjVector (const TVector2 &p, const TVector2 &p0, const TVector2 &p1)
 
double GetSegmentProjVector (const Vector2D &p, const Vector2D &p0, const Vector2D &p1)
 
double GetSegmentProjVector (const TVector3 &p, const TVector3 &p0, const TVector3 &p1)
 
double GetSegmentProjVector (const Vector3D &p, const Vector3D &p0, const Vector3D &p1)
 
TVector2 GetProjectionToSegment (const TVector2 &p, const TVector2 &p0, const TVector2 &p1)
 
TVector3 GetProjectionToSegment (const TVector3 &p, const TVector3 &p0, const TVector3 &p1)
 
double SolveLeastSquares3D (const std::vector< std::pair< TVector3, TVector3 >> &lines, TVector3 &result)
 
TVector2 GetProjectionToPlane (const TVector3 &p, unsigned int plane, unsigned int tpc, unsigned int cryo)
 
TVector2 GetVectorProjectionToPlane (const TVector3 &v, unsigned int plane, unsigned int tpc, unsigned int cryo)
 
TVector2 WireDriftToCm (detinfo::DetectorPropertiesData const &detProp, unsigned int wire, float drift, unsigned int plane, unsigned int tpc, unsigned int cryo)
 
TVector2 CmToWireDrift (detinfo::DetectorPropertiesData const &detProp, float xw, float yd, unsigned int plane, unsigned int tpc, unsigned int cryo)
 
recob::Track convertFrom (const pma::Track3D &src, unsigned int tidx, int pdg=0)
 

Typedef Documentation

typedef std::map<unsigned int, tpc_view_hitmap> pma::cryo_tpc_view_hitmap

Definition at line 28 of file PmaTrkCandidate.h.

typedef std::map<size_t, std::vector<double> > pma::dedx_map

Definition at line 36 of file Utilities.h.

typedef std::map<size_t, pma::TrkCandidateColl> pma::tpc_track_map

Definition at line 54 of file PMAlgTracking.h.

typedef std::map<unsigned int, view_hitmap> pma::tpc_view_hitmap

Definition at line 27 of file PmaTrkCandidate.h.

typedef ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<double> > pma::Vector2D

Definition at line 33 of file Utilities.h.

Definition at line 34 of file Utilities.h.

typedef std::map<unsigned int, std::vector<art::Ptr<recob::Hit> > > pma::view_hitmap

Definition at line 26 of file PmaTrkCandidate.h.

Function Documentation

TVector2 pma::CmToWireDrift ( detinfo::DetectorPropertiesData const &  detProp,
float  xw,
float  yd,
unsigned int  plane,
unsigned int  tpc,
unsigned int  cryo 
)

Definition at line 298 of file Utilities.cxx.

References detinfo::DetectorPropertiesData::ConvertXToTicks(), geo::GeometryCore::Plane(), and geo::PlaneGeo::WirePitch().

Referenced by Dist2(), pma::Track3D::DriftsOfWireIntersection(), and pma::Track3D::WireDriftRange().

304 {
306  geo::PlaneID const id{cryo, tpc, plane};
307  return TVector2(xw / geom->Plane(id).WirePitch(), detProp.ConvertXToTicks(yd, id));
308 }
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:378
recob::Track pma::convertFrom ( const pma::Track3D src,
unsigned int  tidx,
int  pdg = 0 
)

Definition at line 24 of file PMAlgTracking.cxx.

References pma::Track3D::GetDirection3D(), recob::TrajectoryPointFlags::makeMask(), and pma::Track3D::size().

Referenced by trkf::PMAlgTrajFitter::produce(), and trkf::PMAlgTrackMaker::produce().

25 {
26  std::vector<Point_t> positions;
27  positions.reserve(src.size());
28  std::vector<Vector_t> momenta;
29  momenta.reserve(src.size());
30  std::vector<recob::TrajectoryPointFlags> outFlags;
31  outFlags.reserve(src.size());
32 
33  for (size_t i = 0, h = 0; i < src.size(); i++)
34  if (src[i]->IsEnabled()) {
35  auto const& point3d = src[i]->Point3D();
36  positions.emplace_back(point3d.X(), point3d.Y(), point3d.Z());
37  momenta.push_back(src.GetDirection3D(i));
38  outFlags.emplace_back(h++, recob::TrajectoryPointFlags::makeMask());
39  }
40 
41  int ndof = 0;
42  float totChi2 = 0;
43 
44  SMatrixSym55 covStart, covEnd;
45  return recob::Track(
46  recob::TrackTrajectory(std::move(positions), std::move(momenta), std::move(outFlags), false),
47  pdg,
48  totChi2,
49  ndof,
50  covStart,
51  covEnd,
52  tidx);
53 }
static constexpr Mask_t makeMask(Flags...flags)
Returns a bit mask with only the specified bit set.
pma::Vector3D GetDirection3D(size_t index) const
Get trajectory direction at given hit index.
Definition: PmaTrack3D.cxx:380
A trajectory in space reconstructed from hits.
recob::tracking::SMatrixSym55 SMatrixSym55
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:992
size_t size() const
Definition: PmaTrack3D.h:89
double pma::Dist2 ( const TVector2 &  v1,
const TVector2 &  v2 
)

Definition at line 39 of file Utilities.cxx.

Referenced by pma::ProjectionMatchingAlg::alignTracks(), ems::MultiEMShowers::analyze(), pma::PMAlgTracker::areCoLinear(), pma::Track3D::AttachTo(), pma::ProjectionMatchingAlg::buildMultiTPCTrack(), tss::Segmentation2D::buildSegment(), pma::ProjectionMatchingAlg::buildSegment(), tss::Cluster2D::closest(), pma::PMAlgTracker::collectSingleViewEnd(), pma::PMAlgTracker::collectSingleViewFront(), ems::DirOfGamma::ComputeMaxDist(), tss::Cluster2D::dist2(), pma::ProjectionMatchingAlg::FilterOutSmallParts(), ems::DirOfGamma::FindCandidates(), ems::DirOfGamma::FindInitialPart(), ems::EMShower3D::GetCloseHits(), pma::ProjectionMatchingAlg::GetCloseHits_(), pma::Hit3D::GetDist2ToProj(), pma::Node3D::GetDistance2To(), GetHitsRadius2D(), GetHitsRadius3D(), ems::Bin2D::GetIniHits(), ems::MultiEMShowers::getMinDist(), pma::Track3D::HitDxByView(), pma::Element3D::HitsRadius3D(), pma::Track3D::InitFromHits(), pma::VtxCandidate::JoinTracks(), pma::Track3D::Length(), tss::Cluster2D::length2(), pma::Segment3D::Length2(), pma::PMAlgVertexing::makeVertices(), pma::PMAlgTracker::mergeCoLinear(), tss::Segmentation2D::mergeDenseParts(), pma::ProjectionMatchingAlg::mergeTracks(), pma::VtxCandidate::MergeWith(), tss::bDistToPointLess::operator()(), pma::bTrack3DLonger::operator()(), pma::bDistCenterLess2D::operator()(), pma::bDistCenterLess3D::operator()(), tss::Cluster2D::outermost(), ems::EMShower3D::Reoptimize(), tss::Segmentation2D::run(), tss::Segmentation2D::selectRing(), pma::ProjectionMatchingAlg::ShortenSeg_(), tss::Segmentation2D::splitHitsNaive(), pma::Node3D::SumDist2Hits(), tss::Segmentation2D::tagDenseEnds(), pma::ProjectionMatchingAlg::TestTrk_(), ems::EMShower3D::Validate(), pma::ProjectionMatchingAlg::validate(), and pma::ProjectionMatchingAlg::validate_on_adc_test().

40 {
41  double const dx = v1.X() - v2.X(), dy = v1.Y() - v2.Y();
42  return cet::sum_of_squares(dx, dy);
43 }
double pma::Dist2 ( const Vector2D v1,
const Vector2D v2 
)

Definition at line 44 of file Utilities.cxx.

45 {
46  double const dx = v1.X() - v2.X(), dy = v1.Y() - v2.Y();
47  return cet::sum_of_squares(dx, dy);
48 }
template<typename T , typename U >
double pma::Dist2 ( const T &  v1,
const U &  v2 
)

Definition at line 51 of file Utilities.h.

References CmToWireDrift(), GetHitsCount(), GetHitsRadius2D(), GetHitsRadius3D(), GetProjectionToPlane(), GetProjectionToSegment(), GetSegmentProjVector(), GetSummedADC(), GetSummedAmpl(), GetVectorProjectionToPlane(), hits(), geo::kUnknown, SolveLeastSquares3D(), lar::dump::vector(), and WireDriftToCm().

52  {
53  double dx = v1.X() - v2.X(), dy = v1.Y() - v2.Y(), dz = v1.Z() - v2.Z();
54  return dx * dx + dy * dy + dz * dz;
55  }
size_t pma::GetHitsCount ( const std::vector< pma::Hit3D * > &  hits,
unsigned int  view 
)

Definition at line 50 of file Utilities.cxx.

References geo::kUnknown.

Referenced by Dist2().

51 {
52  if (view == geo::kUnknown) { return hits.size(); }
53  return ranges::count_if(hits, [view](auto hit) { return view == hit->View2D(); });
54 }
Unknown view.
Definition: geo_types.h:142
Detector simulation of raw signals on wires.
double pma::GetHitsRadius2D ( const std::vector< pma::Hit3D * > &  hits,
bool  exact = false 
)

Definition at line 94 of file Utilities.cxx.

References Dist2().

Referenced by Dist2(), pma::Element3D::UpdateHitParams(), and pma::Track3D::UpdateHitsRadius().

95 {
96  if (hits.empty()) return 0.0;
97 
98  if (!exact && (hits.size() < 5)) return 0.0;
99 
100  using namespace ranges;
101  auto to_2d_point = [](auto hit) -> decltype(auto) { return hit->Point2D(); };
102  auto const mean_point =
103  accumulate(hits | views::transform(to_2d_point), TVector2{}) * (1. / hits.size());
104 
105  auto to_dist2_from_mean = [&mean_point](auto hit) {
106  return pma::Dist2(hit->Point2D(), mean_point);
107  };
108  auto const max_r2 = max(hits | views::transform(to_dist2_from_mean));
109  return sqrt(max_r2);
110 }
double Dist2(const TVector2 &v1, const TVector2 &v2)
Definition: Utilities.cxx:39
Detector simulation of raw signals on wires.
double pma::GetHitsRadius3D ( const std::vector< pma::Hit3D * > &  hits,
bool  exact = false 
)

Definition at line 76 of file Utilities.cxx.

References Dist2().

Referenced by Dist2().

77 {
78  if (hits.empty()) return 0.0;
79 
80  if (!exact && (hits.size() < 5)) return 0.0;
81 
82  using namespace ranges;
83  auto to_3d_point = [](auto hit) -> decltype(auto) { return hit->Point3D(); };
84  auto const mean_point =
85  accumulate(hits | views::transform(to_3d_point), TVector3{}) * (1. / hits.size());
86 
87  auto to_dist2_from_mean = [&mean_point](auto hit) {
88  return pma::Dist2(hit->Point3D(), mean_point);
89  };
90  auto const max_r2 = max(hits | views::transform(to_dist2_from_mean));
91  return sqrt(max_r2);
92 }
double Dist2(const TVector2 &v1, const TVector2 &v2)
Definition: Utilities.cxx:39
Detector simulation of raw signals on wires.
TVector2 pma::GetProjectionToPlane ( const TVector3 &  p,
unsigned int  plane,
unsigned int  tpc,
unsigned int  cryo 
)

Definition at line 263 of file Utilities.cxx.

References geo::GeometryCore::Plane(), geo::PlaneGeo::PlaneCoordinate(), and geo::vect::toPoint().

Referenced by pma::ProjectionMatchingAlg::buildShowerSeg(), pma::VtxCandidate::ComputeMse2D(), Dist2(), ems::MultiEMShowers::getMinDist(), GetVectorProjectionToPlane(), and ems::EMShower3D::Validate().

267 {
269 
270  return TVector2(
271  geom->Plane(geo::PlaneID(cryo, tpc, plane)).PlaneCoordinate(geo::vect::toPoint(p)), p.X());
272 }
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
double PlaneCoordinate(geo::Point_t const &point) const
Returns the coordinate of the point on the plane.
Definition: PlaneGeo.h:777
TVector2 pma::GetProjectionToSegment ( const TVector2 &  p,
const TVector2 &  p0,
const TVector2 &  p1 
)

Definition at line 144 of file Utilities.cxx.

References GetSegmentProjVector().

Referenced by pma::PMAlgTracker::areCoLinear(), tss::Segmentation2D::buildSegment(), pma::VtxCandidate::Compute(), pma::VtxCandidate::JoinTracks(), and SolveLeastSquares3D().

145 {
146  TVector2 const v1(p1 - p0);
147  double const b = GetSegmentProjVector(p, p0, p1);
148  return p0 + v1 * b;
149 }
double GetSegmentProjVector(const TVector2 &p, const TVector2 &p0, const TVector2 &p1)
Definition: Utilities.cxx:112
TVector3 pma::GetProjectionToSegment ( const TVector3 &  p,
const TVector3 &  p0,
const TVector3 &  p1 
)

Definition at line 151 of file Utilities.cxx.

References GetSegmentProjVector().

Referenced by Dist2().

152 {
153  TVector3 const v1(p1 - p0);
154  double const b = GetSegmentProjVector(p, p0, p1);
155  return p0 + v1 * b;
156 }
double GetSegmentProjVector(const TVector2 &p, const TVector2 &p0, const TVector2 &p1)
Definition: Utilities.cxx:112
double pma::GetSegmentProjVector ( const TVector2 &  p,
const TVector2 &  p0,
const TVector2 &  p1 
)

Definition at line 112 of file Utilities.cxx.

Referenced by GetProjectionToSegment(), pma::VtxCandidate::JoinTracks(), pma::bSegmentProjLess::operator()(), pma::ProjectionMatchingAlg::validate(), pma::ProjectionMatchingAlg::validate_on_adc(), and pma::ProjectionMatchingAlg::validate_on_adc_test().

113 {
114  TVector2 const v0(p - p0);
115  TVector2 const v1(p1 - p0);
116  return v0 * v1 / v1.Mod2();
117 }
double pma::GetSegmentProjVector ( const Vector2D p,
const Vector2D p0,
const Vector2D p1 
)

Definition at line 119 of file Utilities.cxx.

122 {
123  pma::Vector2D const v0(p - p0);
124  pma::Vector2D const v1(p1 - p0);
125  return v0.Dot(v1) / v1.Mag2();
126 }
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< double > > Vector2D
Definition: Utilities.h:33
double pma::GetSegmentProjVector ( const TVector3 &  p,
const TVector3 &  p0,
const TVector3 &  p1 
)

Definition at line 128 of file Utilities.cxx.

129 {
130  TVector3 const v0(p - p0);
131  TVector3 const v1(p1 - p0);
132  return v0.Dot(v1) / v1.Mag2();
133 }
double pma::GetSegmentProjVector ( const Vector3D p,
const Vector3D p0,
const Vector3D p1 
)

Definition at line 135 of file Utilities.cxx.

Referenced by Dist2().

138 {
139  pma::Vector3D const v0(p - p0);
140  pma::Vector3D const v1(p1 - p0);
141  return v0.Dot(v1) / v1.Mag2();
142 }
recob::tracking::Vector_t Vector3D
Definition: Utilities.h:34
double pma::GetSummedADC ( const std::vector< pma::Hit3D * > &  hits,
unsigned int  view = geo::kUnknown 
)

Definition at line 56 of file Utilities.cxx.

References geo::kUnknown.

Referenced by Dist2().

57 {
58  using namespace ranges;
59  auto to_summed_adc = [](auto hit) { return hit->SummedADC(); };
60  if (view == geo::kUnknown) { return accumulate(hits | views::transform(to_summed_adc), 0.); }
61  return accumulate(hits | views::filter([view](auto hit) { return view == hit->View2D(); }) |
62  views::transform(to_summed_adc),
63  0.);
64 }
Unknown view.
Definition: geo_types.h:142
Detector simulation of raw signals on wires.
double pma::GetSummedAmpl ( const std::vector< pma::Hit3D * > &  hits,
unsigned int  view = geo::kUnknown 
)

Definition at line 66 of file Utilities.cxx.

References geo::kUnknown.

Referenced by Dist2().

67 {
68  using namespace ranges;
69  auto to_amplitude = [](auto hit) { return hit->GetAmplitude(); };
70  if (view == geo::kUnknown) { return accumulate(hits | views::transform(to_amplitude), 0.); }
71  return accumulate(hits | views::filter([view](auto hit) { return view == hit->View2D(); }) |
72  views::transform(to_amplitude),
73  0.);
74 }
Unknown view.
Definition: geo_types.h:142
Detector simulation of raw signals on wires.
TVector2 pma::GetVectorProjectionToPlane ( const TVector3 &  v,
unsigned int  plane,
unsigned int  tpc,
unsigned int  cryo 
)

Definition at line 274 of file Utilities.cxx.

References GetProjectionToPlane().

Referenced by Dist2().

278 {
279  TVector3 v0_3d(0., 0., 0.);
280  TVector2 v0_2d = GetProjectionToPlane(v0_3d, plane, tpc, cryo);
281  TVector2 v1_2d = GetProjectionToPlane(v, plane, tpc, cryo);
282 
283  return v1_2d - v0_2d;
284 }
TVector2 GetProjectionToPlane(const TVector3 &p, unsigned int plane, unsigned int tpc, unsigned int cryo)
Definition: Utilities.cxx:263
double pma::SolveLeastSquares3D ( const std::vector< std::pair< TVector3, TVector3 >> &  lines,
TVector3 &  result 
)

Definition at line 158 of file Utilities.cxx.

References dir, GetProjectionToSegment(), r, w, x, and y.

Referenced by ems::MultiEMShowers::analyze(), pma::VtxCandidate::Compute(), and Dist2().

160 {
161  // RS: please, ask me if you need examples/explanation of formulas as they
162  // are not easy to derive from the code solely; I have Mathcad sources that
163  // were used to test the solving method, weighting, etc.
164 
165  result.SetXYZ(0., 0., 0.);
166  if (lines.size() < 2) {
167  mf::LogError("pma::SolveLeastSquares3D") << "Need min. two lines.";
168  return -1.0;
169  }
170 
171  double m;
172  std::vector<TVectorT<double>> U, P;
173  for (size_t v = 0; v < lines.size(); v++) {
174  TVector3 point = lines[v].first;
175  TVector3 dir = lines[v].second;
176  dir -= point;
177  m = dir.Mag();
178  if (m > 0.0) {
179  dir *= 1.0 / m;
180 
181  P.push_back(TVectorT<double>(3));
182  P.back()[0] = point.X();
183  P.back()[1] = point.Y();
184  P.back()[2] = point.Z();
185 
186  U.push_back(TVectorT<double>(3));
187  U.back()[0] = dir.X();
188  U.back()[1] = dir.Y();
189  U.back()[2] = dir.Z();
190  }
191  else
192  mf::LogWarning("pma::SolveLeastSquares3D") << "Line undefined.";
193  }
194  if (P.size() < 2) {
195  mf::LogError("pma::SolveLeastSquares3D") << "Need min. two lines.";
196  return -1.0;
197  }
198 
199  TVectorT<double> x(3), y(3), w(3);
200  TMatrixT<double> A(3, 3);
201  double ur, uc, pc;
202  double s_uc2[3], s_ur_uc[3];
203  double s_p_uc2[3], s_p_ur_uc[3];
204 
205  w[0] = 1.0;
206  w[1] = 1.0;
207  w[2] = 1.0;
208  for (size_t r = 0; r < 3; r++) {
209  y[r] = 0.0;
210  for (size_t c = 0; c < 3; c++) {
211  s_uc2[c] = 0.0;
212  s_ur_uc[c] = 0.0;
213  s_p_uc2[c] = 0.0;
214  s_p_ur_uc[c] = 0.0;
215 
216  for (size_t v = 0; v < P.size(); v++) {
217  //w[1] = fWeights[v]; // to remember that individual coordinates can be supressed...
218  //w[2] = fWeights[v];
219 
220  ur = U[v][r];
221  uc = U[v][c];
222  pc = P[v][c];
223 
224  s_uc2[c] += w[r] * w[c] * (1 - uc * uc);
225  s_p_uc2[c] += w[r] * w[r] * pc * (1 - uc * uc);
226 
227  s_ur_uc[c] += w[r] * w[c] * ur * uc;
228  s_p_ur_uc[c] += w[r] * w[r] * pc * ur * uc;
229  }
230 
231  if (r == c) {
232  y[r] += s_p_uc2[c];
233  A(r, c) = s_uc2[c];
234  }
235  else {
236  y[r] -= s_p_ur_uc[c];
237  A(r, c) = -s_ur_uc[c];
238  }
239  }
240  }
241  try {
242  x = A.InvertFast() * y;
243  }
244  catch (...) {
245  result.SetXYZ(0., 0., 0.);
246  return 1.0e12;
247  }
248 
249  result.SetXYZ(x[0], x[1], x[2]);
250 
251  double mse = 0.0;
252  for (size_t v = 0; v < lines.size(); v++) {
253  TVector3 const pproj = pma::GetProjectionToSegment(result, lines[v].first, lines[v].second);
254 
255  double const dx = result.X() - pproj.X(); // dx, dy, dz and the result point can be weighted
256  double const dy = result.Y() - pproj.Y(); // here (linearly) by each line uncertainty
257  double const dz = result.Z() - pproj.Z();
258  mse += cet::sum_of_squares(dx, dy, dz);
259  }
260  return mse / lines.size();
261 }
Float_t x
Definition: compare.C:6
TRandom r
Definition: spectrum.C:23
Float_t y
Definition: compare.C:6
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
TVector2 GetProjectionToSegment(const TVector2 &p, const TVector2 &p0, const TVector2 &p1)
Definition: Utilities.cxx:144
TDirectory * dir
Definition: macro.C:5
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:82
Float_t w
Definition: plot.C:20
TVector2 pma::WireDriftToCm ( detinfo::DetectorPropertiesData const &  detProp,
unsigned int  wire,
float  drift,
unsigned int  plane,
unsigned int  tpc,
unsigned int  cryo 
)

Definition at line 286 of file Utilities.cxx.

References detinfo::DetectorPropertiesData::ConvertTicksToX(), geo::GeometryCore::Plane(), and geo::PlaneGeo::WirePitch().

Referenced by Dist2(), pma::ProjectionMatchingAlg::FilterOutSmallParts(), ems::EMShower3D::GetCloseHits(), ems::MultiEMShowers::getMinDist(), pma::Track3D::GetUnconstrainedProj3D(), tss::Hit2D::Hit2D(), pma::Hit3D::Hit3D(), pma::Track3D::TestHitsMse(), and pma::ProjectionMatchingAlg::validate().

292 {
294  geo::PlaneID const id{cryo, tpc, plane};
295  return TVector2(geom->Plane(id).WirePitch() * wire, detProp.ConvertTicksToX(drift, id));
296 }
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:378