LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PlaneGeo.h
Go to the documentation of this file.
1 #ifndef LARCOREALG_GEOMETRY_PLANEGEO_H
9 #define LARCOREALG_GEOMETRY_PLANEGEO_H
10 
11 // LArSoft libraries
19 #include "larcorealg/Geometry/geo_vectors_utils.h" // geo::vect
21 
22 // ROOT libraries
23 #include "Math/GenVector/Cartesian2D.h"
24 #include "Math/GenVector/DisplacementVector2D.h"
25 #include "Math/GenVector/PositionVector2D.h"
26 
27 // ROOT libraries
28 #include "TGeoMatrix.h" // TGeoHMatrix
29 
30 // C/C++ standard libraries
31 #include <cmath> // std::atan2()
32 #include <string>
33 #include <vector>
34 
35 class TGeoNode;
36 
37 namespace geo {
38 
39  namespace details {
40  struct ActiveAreaCalculator;
41  } // namespace details
42 
43  //......................................................................
44  class WireGeo;
45  using WirePtr = WireGeo const*; // this will become an object in the future
46 
75  // Note: SignalType() and SetSignalType() have been removed.
76  // Use `geo::GeometryCore::SignalType` instead.
77  // (see LArSoft issue #14365 at https://cdcvs.fnal.gov/redmine/issues/14365 )
78  class PlaneGeo {
79  public:
80  using ID_t = PlaneID;
81  using WireCollection_t = std::vector<geo::WireGeo>;
82  using GeoNodePath_t = std::vector<TGeoNode const*>;
83 
86 
88 
102  struct PlaneGeoCoordinatesTag {};
104 
107 
110 
112 
115 
118 
120  using WireCoordProjection_t =
121  ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<double>, WireCoordinateReferenceTag>;
122 
125 
128 
130 
133 
136 
139  using WidthDepthProjection_t =
140  ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<double>, WidthDepthReferenceTag>;
141 
144  ROOT::Math::DisplacementVector2D<ROOT::Math::Cartesian2D<double>, WidthDepthReferenceTag>;
145 
147  using WidthDepthDecomposer_t =
149 
153 
155 
158 
160  PlaneGeo(TGeoNode const& node, geo::TransformationMatrix&& trans, WireCollection_t&& wires);
161 
164 
166  View_t View() const { return fView; }
167 
169  Orient_t Orientation() const { return fOrientation; }
170 
172  double ThetaZ() const;
173 
175  double PhiZ() const { return std::atan2(fSinPhiZ, fCosPhiZ); }
176 
178  double SinPhiZ() const { return fSinPhiZ; }
179 
181  double CosPhiZ() const { return fCosPhiZ; }
182 
184  geo::PlaneID const& ID() const { return fID; }
185 
187 
190 
192 
200  Vector_t const& WidthDir() const { return fDecompFrame.MainDir(); }
202 
204 
212  Vector_t const& DepthDir() const { return fDecompFrame.SecondaryDir(); }
214 
221  double Width() const { return fFrameSize.Width(); }
222 
229  double Depth() const { return fFrameSize.Depth(); }
230 
234 
236 
239 
241  unsigned int Nwires() const { return fWire.size(); }
243  unsigned int NElements() const { return Nwires(); }
245 
247 
252  bool HasWire(unsigned int iwire) const { return iwire < Nwires(); }
253  bool HasElement(unsigned int iwire) const { return HasWire(iwire); }
255 
257 
265  bool HasWire(geo::WireID const& wireid) const { return HasWire(wireid.Wire); }
266  bool HasElement(geo::WireID const& wireid) const { return HasWire(wireid); }
268 
272  WireGeo const& Wire(unsigned int iwire) const;
273 
275 
284  WireGeo const& Wire(WireID const& wireid) const { return Wire(wireid.Wire); }
285  WireGeo const& GetElement(WireID const& wireid) const { return Wire(wireid); }
287 
293  geo::WirePtr WirePtr(unsigned int iwire) const
294  {
295  return HasWire(iwire) ? &(fWire[iwire]) : nullptr;
296  }
297 
299 
307  geo::WirePtr WirePtr(WireID const& wireid) const { return WirePtr(wireid.Wire); }
308  geo::WirePtr GetElementPtr(WireID const& wireid) const { return WirePtr(wireid); }
310 
312  const WireGeo& FirstWire() const { return Wire(0); }
313 
315  const WireGeo& MiddleWire() const { return Wire(Nwires() / 2); }
316 
318  const WireGeo& LastWire() const { return Wire(Nwires() - 1); }
319 
320  // @{
368  ElementIteratorBox IterateElements() const { return fWire; }
369  ElementIteratorBox IterateWires() const { return IterateElements(); }
370  // @}
371 
373 
376 
378  double WirePitch() const { return fWirePitch; }
379 
389  bool WireIDincreasesWithZ() const;
390 
392 
407  Vector_t const& GetNormalDirection() const { return fNormal; }
409 
411 
418  Vector_t const& GetIncreasingWireDirection() const { return fDecompWire.SecondaryDir(); }
420 
422 
435  Point_t const& GetCenter() const { return fCenter; }
437 
439 
449  Point_t GetBoxCenter() const { return toWorldCoords(LocalPoint_t{0.0, 0.0, 0.0}); }
451 
453 
459  Vector_t const& GetWireDirection() const { return fDecompWire.MainDir(); }
461 
463 
487  geo::WireID NearestWireID(geo::Point_t const& pos) const;
489 
511  geo::WireGeo const& NearestWire(geo::Point_t const& pos) const;
512 
528  geo::WireID ClosestWireID(geo::WireID::WireID_t wireNo) const; // inline
529 
540  geo::WireID ClosestWireID(geo::WireID const& wireid) const; // inline
541 
543 
558  double DistanceFromPlane(geo::Point_t const& point) const
559  {
560  return fDecompWire.PointNormalComponent(point);
561  }
563 
565 
579  void DriftPoint(geo::Point_t& position, double distance) const
580  {
581  position -= distance * GetNormalDirection();
582  }
584 
586 
595  void DriftPoint(geo::Point_t& position) const
596  {
597  DriftPoint(position, DistanceFromPlane(position));
598  }
600 
602 
622  double InterWireProjectedDistance(WireCoordProjection_t const& projDir) const;
624 
626 
646  double InterWireDistance(geo::Vector_t const& dir) const;
648 
650 
668  double InterWireProjectedDistance(Vector_t const& dir) const
669  {
670  return InterWireProjectedDistance(Projection(dir));
671  }
673 
685  Rect const& ActiveArea() const { return fActiveArea; }
686 
688  // lar::util::simple_geo::Volume<Point_t> Coverage() const;
689 
712  template <typename Stream>
713  void PrintPlaneInfo(Stream&& out, std::string indent = "", unsigned int verbosity = 1) const;
714 
722  std::string PlaneInfo(std::string indent = "", unsigned int verbosity = 1) const;
723 
725  static constexpr unsigned int MaxVerbosity = 6;
726 
728 
736 
738 
755  double PlaneCoordinateFrom(geo::Point_t const& point, geo::WireGeo const& refWire) const
756  {
757  return fDecompWire.VectorSecondaryComponent(point - refWire.GetCenter());
758  }
760 
762 
777  double PlaneCoordinate(geo::Point_t const& point) const
778  {
779  return fDecompWire.PointSecondaryComponent(point);
780  }
782 
797  double WireCoordinate(geo::Point_t const& point) const
798  {
799  return PlaneCoordinate(point) / WirePitch();
800  }
801 
803 
818  {
819  return fDecompWire.DecomposePoint(point);
820  }
822 
824 
830  Point_t ProjectionReferencePoint() const { return fDecompWire.ReferencePoint(); }
832 
834 
851  {
852  return fDecompWire.ProjectPointOnPlane(point);
853  }
855  {
856  return Projection(point);
857  }
859 
861 
874  {
875  return fDecompWire.ProjectVectorOnPlane(v);
876  }
878 
880 
891  {
892  return fDecompWire.ComposeVector(decomp);
893  } //@}
894 
896 
909  Vector_t ComposeVector(double distance, WireCoordProjection_t const& proj) const
910  {
911  return fDecompWire.ComposeVector(distance, proj);
912  }
914 
916 
925  {
926  return fDecompWire.ComposePoint(decomp);
927  }
929 
931 
950  Point_t ComposePoint(double distance, WireCoordProjection_t const& proj) const
951  {
952  return fDecompWire.ComposePoint(distance, proj);
953  }
955 
957 
966 
968 
983  {
984  return fDecompFrame.DecomposePoint(point);
985  }
987 
989 
1001  {
1002  return fDecompFrame.ProjectPointOnPlane(point);
1003  }
1005 
1007 
1019  {
1020  return fDecompFrame.ProjectVectorOnPlane(v);
1021  }
1023 
1025 
1036  bool isProjectionOnPlane(geo::Point_t const& point) const;
1038 
1064  WidthDepthProjection_t DeltaFromPlane(WidthDepthProjection_t const& proj,
1065  double wMargin,
1066  double dMargin) const;
1067 
1082  double margin = 0.0) const
1083  {
1084  return DeltaFromPlane(proj, margin, margin);
1085  }
1086 
1114  WidthDepthProjection_t DeltaFromActivePlane(WidthDepthProjection_t const& proj,
1115  double wMargin,
1116  double dMargin) const;
1117 
1132  double margin = 0.0) const
1133  {
1134  return DeltaFromActivePlane(proj, margin, margin);
1135  }
1136 
1153  WidthDepthProjection_t MoveProjectionToPlane(WidthDepthProjection_t const& proj) const;
1154 
1156 
1167  geo::Point_t MovePointOverPlane(geo::Point_t const& point) const;
1169 
1171 
1183  {
1184  return fDecompFrame.ComposePoint(decomp);
1185  }
1187 
1189 
1207  Point_t ComposePoint(double distance, WidthDepthProjection_t const& proj) const
1208  {
1209  return fDecompFrame.ComposePoint(distance, proj);
1210  }
1212 
1214 
1216 
1224  geo::Point_t toWorldCoords(LocalPoint_t const& local) const
1226  {
1227  return fTrans.toWorldCoords(local);
1228  }
1229 
1232  {
1233  return fTrans.toWorldCoords(local);
1234  }
1235 
1238  {
1239  return fTrans.toLocalCoords(world);
1240  }
1241 
1244  {
1245  return fTrans.toLocalCoords(world);
1246  }
1247 
1249 
1252 
1254  void SetView(geo::View_t view) { fView = view; }
1255 
1257 
1259  void SortWires(geo::GeoObjectSorter const& sorter);
1260 
1262  void UpdateAfterSorting(geo::PlaneID planeid, geo::BoxBoundedGeo const& TPCbox);
1263 
1265  static std::string ViewName(geo::View_t view);
1266 
1268  static std::string OrientationName(geo::Orient_t orientation);
1269 
1270  private:
1272  void DetectGeometryDirections();
1273 
1275  geo::Vector_t GetNormalAxis() const;
1276 
1278  void UpdatePlaneNormal(geo::BoxBoundedGeo const& TPCbox);
1279 
1281  void UpdateWidthDepthDir();
1282 
1284  void UpdateIncreasingWireDir();
1285 
1287  void UpdateWireDir();
1288 
1290  void UpdateOrientation();
1291 
1293  void UpdateWirePitch();
1294 
1296  void UpdateWirePlaneCenter();
1297 
1299  void UpdatePhiZ();
1300 
1302  void UpdateView();
1303 
1305  void UpdateWirePitchSlow();
1306 
1308  void UpdateDecompWireOrigin();
1309 
1311  void UpdateActiveArea();
1312 
1314  bool shouldFlipWire(geo::WireGeo const& wire) const;
1315 
1316  private:
1317  using LocalTransformation_t =
1319 
1320  struct RectSpecs {
1321  double halfWidth;
1322  double halfDepth;
1323 
1324  double HalfWidth() const { return halfWidth; }
1325  double HalfDepth() const { return halfDepth; }
1326  double Width() const { return 2.0 * HalfWidth(); }
1327  double Depth() const { return 2.0 * HalfDepth(); }
1328  }; // RectSpecs
1329 
1331  TGeoVolume const* fVolume;
1335  double fWirePitch;
1336  double fSinPhiZ;
1337  double fCosPhiZ;
1338 
1340  WireDecomposer_t fDecompWire;
1349  Rect fActiveArea;
1353 
1355 
1357 
1358  }; // class PlaneGeo
1359 
1360 } // namespace geo
1361 
1362 //------------------------------------------------------------------------------
1363 //--- inline implementation
1364 //---
1366 {
1367  return {ID(), std::min(wireNo, Nwires())};
1368 }
1369 
1371 {
1372  if (wireid.asPlaneID() != ID()) {
1373  geo::WireID invalid{wireid};
1374  invalid.markInvalid();
1375  return invalid;
1376  }
1377  return ClosestWireID(wireid.Wire);
1378 } // geo::PlaneGeo::ClosestWireID()
1379 
1380 //------------------------------------------------------------------------------
1381 //--- template implementation
1382 //---
1383 template <typename Stream>
1385  std::string indent /* = "" */,
1386  unsigned int verbosity /* = 1 */
1387 ) const
1388 {
1389 
1390  //----------------------------------------------------------------------------
1391  out << "plane " << std::string(ID());
1392 
1393  if (verbosity-- <= 0) return; // 0
1394 
1395  //----------------------------------------------------------------------------
1396  out << " at " << GetCenter() << " cm"
1397  << ", theta: " << ThetaZ() << " rad";
1398 
1399  if (verbosity-- <= 0) return; // 1
1400 
1401  //----------------------------------------------------------------------------
1402  unsigned int const nWires = Nwires();
1403 
1404  out << "\n"
1405  << indent << "normal to wire: " << PhiZ() << " rad"
1406  << ", with orientation " << OrientationName(Orientation()) << ", has " << nWires
1407  << " wires measuring " << ViewName(View()) << " with a wire pitch of " << WirePitch()
1408  << " cm";
1409 
1410  if (verbosity-- <= 0) return; // 2
1411 
1412  //----------------------------------------------------------------------------
1413  auto const& normal = GetNormalDirection();
1414  auto const& incrZdir = GetIncreasingWireDirection();
1415  auto const& wireNormalDir = fDecompWire.NormalDir();
1416  out << "\n"
1417  << indent << "normal to plane: " << normal
1418  << ", direction of increasing wire number: " << incrZdir
1419  << " [wire frame normal: " << wireNormalDir << "]"
1420  << " (" << (WireIDincreasesWithZ() ? "increases" : "decreases") << " with z)";
1421 
1422  if (verbosity-- <= 0) return; // 3
1423 
1424  //----------------------------------------------------------------------------
1425 
1426  auto const& wireDir = GetWireDirection();
1427  auto const& widthDir = WidthDir();
1428  auto const& depthDir = DepthDir();
1429  auto const& frameNormalDir = fDecompFrame.NormalDir();
1430 
1431  out << "\n"
1432  << indent << "wire direction: " << wireDir << "; width " << Width()
1433  << " cm in direction: " << widthDir << ", depth " << Depth()
1434  << " cm in direction: " << depthDir << " [normal: " << frameNormalDir << "]";
1435 
1436  if (verbosity-- <= 0) return; // 4
1437 
1438  //----------------------------------------------------------------------------
1439  // get the area spanned by the wires
1440  out << "\n"
1441  << indent << "wires cover width " << ActiveArea().width.lower << " to "
1442  << ActiveArea().width.upper << ", depth " << ActiveArea().depth.lower << " to "
1443  << ActiveArea().depth.upper << " cm";
1444  if (verbosity-- <= 0) return; // 5
1445 
1446  //----------------------------------------------------------------------------
1447  // print also the containing box
1448  auto const box = BoundingBox();
1449  out << "\n" << indent << "bounding box: " << box.Min() << " -- " << box.Max();
1450 
1451  // if (verbosity-- <= 0) return; // 6
1452 
1453  //----------------------------------------------------------------------------
1454 } // geo::PlaneGeo::PrintPlaneInfo()
1455 
1456 //------------------------------------------------------------------------------
1457 
1458 #endif // LARCOREALG_GEOMETRY_PLANEGEO_H
1459 
WireGeo const * WirePtr
Definition: PlaneGeo.h:45
geo::WirePtr WirePtr(unsigned int iwire) const
Returns the wire number iwire from this plane.
Definition: PlaneGeo.h:293
unsigned int NElements() const
Number of wires in this plane.
Definition: PlaneGeo.h:243
WireGeo const & Wire(WireID const &wireid) const
Returns the wire in wireid from this plane.
Definition: PlaneGeo.h:284
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:114
double HalfWidth() const
Definition: PlaneGeo.h:1324
geo::Vector_t toWorldCoords(LocalVector_t const &local) const
Transform direction vector from local to world.
Definition: PlaneGeo.h:1231
void SetView(geo::View_t view)
Set the signal view (for TPCGeo).
Definition: PlaneGeo.h:1254
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< double >, WidthDepthReferenceTag > WidthDepthDisplacement_t
Type for vector projections in the plane frame base representation.
Definition: PlaneGeo.h:144
WidthDepthProjection_t DeltaFromPlane(WidthDepthProjection_t const &proj, double margin=0.0) const
Returns a projection vector that, added to the argument, gives a projection inside (or at the border ...
Definition: PlaneGeo.h:1081
Point_t const & GetCenter() const
Returns the world coordinate of the center of the wire [cm].
Definition: WireGeo.h:221
Point_t ComposePoint(WireDecomposedVector_t const &decomp) const
Returns the 3D point from composition of projection and distance.
Definition: PlaneGeo.h:924
WireCollection_t const & ElementIteratorBox
Type returned by IterateElements().
Definition: PlaneGeo.h:85
WidthDepthProjection_t VectorWidthDepthProjection(geo::Vector_t const &v) const
Returns the projection of the specified vector on the plane.
Definition: PlaneGeo.h:1018
geo::Point_t fCenter
Center of the plane, lying on the wire plane.
Definition: PlaneGeo.h:1352
double fWirePitch
Pitch of wires in this plane.
Definition: PlaneGeo.h:1335
std::vector< geo::WireGeo > WireCollection_t
Definition: PlaneGeo.h:81
Vector_t const & DepthDir() const
Return the direction of plane depth.
Definition: PlaneGeo.h:212
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:160
Point_t const & GetCenter() const
Returns the centre of the wire plane in world coordinates [cm].
Definition: PlaneGeo.h:435
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
enum geo::_plane_orient Orient_t
Enumerate the possible plane projections.
geo::PlaneID fID
ID of this plane.
Definition: PlaneGeo.h:1354
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
WidthDepthProjection_t PointWidthDepthProjection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: PlaneGeo.h:1000
ElementIteratorBox IterateWires() const
Allows range-for iteration on all wires in this plane.
Definition: PlaneGeo.h:369
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:563
double WireCoordinate(geo::Point_t const &point) const
Returns the coordinate of the point on the plane, in wire units.
Definition: PlaneGeo.h:797
Rect const & ActiveArea() const
Returns an area covered by the wires in the plane.
Definition: PlaneGeo.h:685
bool HasElement(geo::WireID const &wireid) const
Returns whether the wire in wireid is present in this plane.
Definition: PlaneGeo.h:266
Vector_t ComposeVector(WireDecomposedVector_t const &decomp) const
Returns the 3D vector from composition of projection and distance.
Definition: PlaneGeo.h:890
double Depth() const
Definition: PlaneGeo.h:1327
WireCoordProjection_t Projection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: PlaneGeo.h:850
LocalPoint_t toLocalCoords(geo::Point_t const &world) const
Transform point from world frame to local plane frame.
Definition: PlaneGeo.h:1237
View_t fView
Does this plane measure U, V, or W?
Definition: PlaneGeo.h:1332
void DriftPoint(geo::Point_t &position, double distance) const
Shifts the position of an electron drifted by a distance.
Definition: PlaneGeo.h:579
geo::Vector_t fNormal
Definition: PlaneGeo.h:1339
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
double PlaneCoordinateFrom(geo::Point_t const &point, geo::WireGeo const &refWire) const
Returns the coordinate of point on the plane respect to a wire.
Definition: PlaneGeo.h:755
ElementIteratorBox IterateElements() const
Allows range-for iteration on all wires in this plane.
Definition: PlaneGeo.h:368
Interface to algorithm class for sorting geo::XXXGeo objects.
TGeoVolume const * fVolume
Plane volume description.
Definition: PlaneGeo.h:1331
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:166
Point_t GetBoxCenter() const
Returns the centre of the box representing the plane.
Definition: PlaneGeo.h:449
WireDecomposedVector_t DecomposePoint(geo::Point_t const &point) const
Decomposes a 3D point in two components.
Definition: PlaneGeo.h:817
Classes to project and compose a vector on a plane.
WidthDepthDecomposer_t::DecomposedVector_t WDDecomposedVector_t
Definition: PlaneGeo.h:152
WidthDepthDecomposer_t fDecompFrame
Definition: PlaneGeo.h:1347
Local-to-world transformations with LArSoft geometry vectors.
geo::WirePtr GetElementPtr(WireID const &wireid) const
Returns the wire in wireid from this plane.
Definition: PlaneGeo.h:308
double PhiZ() const
Angle from positive z axis of the wire coordinate axis, in radians.
Definition: PlaneGeo.h:175
const WireGeo & MiddleWire() const
Return the middle wire in the plane.
Definition: PlaneGeo.h:315
RTree::BoundingBox BoundingBox
Definition: DBScanAlg.h:33
Tag for vectors in the "local" GDML coordinate frame of the plane.
Definition: PlaneGeo.h:103
Vector_t const & GetWireDirection() const
Returns the direction of the wires.
Definition: PlaneGeo.h:459
WireCollection_t fWire
List of wires in this plane.
Definition: PlaneGeo.h:1334
WireGeo const & GetElement(WireID const &wireid) const
Returns the wire in wireid from this plane.
Definition: PlaneGeo.h:285
WireCoordProjection_t Projection(geo::Vector_t const &v) const
Returns the projection of the specified vector on the plane.
Definition: PlaneGeo.h:873
double Depth() const
Return the depth of the plane.
Definition: PlaneGeo.h:229
std::string indent(std::size_t const i)
double fSinPhiZ
Sine of .
Definition: PlaneGeo.h:1336
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
double Width() const
Return the width of the plane.
Definition: PlaneGeo.h:221
Utilities to extend the interface of geometry vectors.
void DriftPoint(geo::Point_t &position) const
Shifts the position along drift direction to fall on the plane.
Definition: PlaneGeo.h:595
WireCoordProjection_t PointProjection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Definition: PlaneGeo.h:854
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< double >, WireCoordinateReferenceTag > WireCoordProjection_t
Type for projections in the wire base representation.
Definition: PlaneGeo.h:121
geo::WirePtr WirePtr(WireID const &wireid) const
Returns the wire in wireid from this plane.
Definition: PlaneGeo.h:307
Vector_t ComposeVector(double distance, WireCoordProjection_t const &proj) const
Returns the 3D vector from composition of projection and distance.
Definition: PlaneGeo.h:909
constexpr PlaneID const & asPlaneID() const
Conversion to PlaneID (for convenience of notation).
Definition: geo_types.h:520
double CosPhiZ() const
Cosine of PhiZ()
Definition: PlaneGeo.h:181
const WireGeo & FirstWire() const
Return the first wire in the plane.
Definition: PlaneGeo.h:312
bool HasElement(unsigned int iwire) const
Returns whether a wire with index iwire is present in this plane.
Definition: PlaneGeo.h:253
RectSpecs fFrameSize
Definition: PlaneGeo.h:1348
double SinPhiZ() const
Sine of PhiZ()
Definition: PlaneGeo.h:178
std::vector< TGeoNode const * > GeoNodePath_t
Definition: PlaneGeo.h:82
void markInvalid()
Sets the ID as invalid.
Definition: geo_types.h:238
LocalTransformation_t fTrans
Plane to world transform.
Definition: PlaneGeo.h:1330
Definition of data types for geometry description.
Provides a base class aware of world box coordinates.
typename PlaneDecomposer_t::DecomposedVector_t DecomposedVector_t
Type representing a decomposition on the plane.
Definition: Decomposer.h:411
double HalfDepth() const
Definition: PlaneGeo.h:1325
Orient_t Orientation() const
What is the orientation of the plane.
Definition: PlaneGeo.h:169
Encapsulate the geometry of a wire.
ROOT::Math::DisplacementVector2D< ROOT::Math::Cartesian2D< double >, WidthDepthReferenceTag > WidthDepthProjection_t
Definition: PlaneGeo.h:140
Point_t ComposePoint(double distance, WireCoordProjection_t const &proj) const
Returns the 3D point from composition of projection and distance.
Definition: PlaneGeo.h:950
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
Tag for plane frame base vectors.
Definition: PlaneGeo.h:135
Selection of the type of transformation matrix used in geometry.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
double InterWireProjectedDistance(Vector_t const &dir) const
Returns the distance between wires along the specified direction.
Definition: PlaneGeo.h:668
bool HasWire(unsigned int iwire) const
Returns whether a wire with index iwire is present in this plane.
Definition: PlaneGeo.h:252
void PrintPlaneInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Returns a volume including all the wires in the plane.
Definition: PlaneGeo.h:1384
double DistanceFromPlane(geo::Point_t const &point) const
Returns the distance of the specified point from the wire plane.
Definition: PlaneGeo.h:558
TDirectory * dir
Definition: macro.C:5
geo::PlaneID const & ID() const
Returns the identifier of this plane.
Definition: PlaneGeo.h:184
Point_t ComposePoint(WDDecomposedVector_t const &decomp) const
Returns the 3D vector from composition of projection and distance.
Definition: PlaneGeo.h:1182
Vector_t const & WidthDir() const
Return the direction of plane width.
Definition: PlaneGeo.h:200
Float_t proj
Definition: plot.C:35
geo::WireID ClosestWireID(geo::WireID::WireID_t wireNo) const
Returns the closest valid wire ID to the specified wire.
Definition: PlaneGeo.h:1365
Some simple functions to represent geometry entities.
WireDecomposer_t::DecomposedVector_t WireDecomposedVector_t
Type describing a 3D point or vector decomposed on a plane on wire base.
Definition: PlaneGeo.h:127
double fCosPhiZ
Cosine of .
Definition: PlaneGeo.h:1337
Vector_t const & GetIncreasingWireDirection() const
Returns the direction of increasing wires.
Definition: PlaneGeo.h:418
Vector_t const & GetNormalDirection() const
Returns the direction normal to the plane.
Definition: PlaneGeo.h:407
WDDecomposedVector_t DecomposePointWidthDepth(geo::Point_t const &point) const
Decomposes a 3D point in two components.
Definition: PlaneGeo.h:982
GenPoint3DBase_t< double, C > Point3DBase_t
Type of 3D point with representation in double precision.
Definition: geo_vectors.h:88
unsigned int WireID_t
Type for the ID number.
Definition: geo_types.h:546
GenVector3DBase_t< double, C > Vector3DBase_t
Definition: geo_vectors.h:83
double Width() const
Definition: PlaneGeo.h:1326
Class computing the active area of the plane.
Definition: PlaneGeo.cxx:78
Point_t ProjectionReferencePoint() const
Returns the reference point used by PointProjection().
Definition: PlaneGeo.h:830
bool HasWire(geo::WireID const &wireid) const
Returns whether the wire in wireid is present in this plane.
Definition: PlaneGeo.h:265
geo::Vector3DBase_t< PlaneGeoCoordinatesTag > LocalVector_t
Type of displacement vectors in the local GDML wire plane frame.
Definition: PlaneGeo.h:109
const WireGeo & LastWire() const
Return the last wire in the plane.
Definition: PlaneGeo.h:318
Namespace collecting geometry-related classes utilities.
Orient_t fOrientation
Is the plane vertical or horizontal?
Definition: PlaneGeo.h:1333
double PlaneCoordinate(geo::Point_t const &point) const
Returns the coordinate of the point on the plane.
Definition: PlaneGeo.h:777
Point_t ComposePoint(double distance, WidthDepthProjection_t const &proj) const
Returns the 3D point from composition of projection and distance.
Definition: PlaneGeo.h:1207
geo::Point3DBase_t< PlaneGeoCoordinatesTag > LocalPoint_t
Type of points in the local GDML wire plane frame.
Definition: PlaneGeo.h:106
ROOT::Math::Transform3D TransformationMatrix
Type of transformation matrix used in geometry.
LocalVector_t toLocalCoords(geo::Vector_t const &world) const
Transform direction vector from world to local.
Definition: PlaneGeo.h:1243
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:378
WidthDepthProjection_t DeltaFromActivePlane(WidthDepthProjection_t const &proj, double margin=0.0) const
Returns a projection vector that, added to the argument, gives a projection inside (or at the border ...
Definition: PlaneGeo.h:1131
Tag for wire base vectors.
Definition: PlaneGeo.h:117