LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
WireReadoutGeom.h
Go to the documentation of this file.
1 #ifndef LARCOREALG_GEOMETRY_WIREREADOUTGEOM_H
2 #define LARCOREALG_GEOMETRY_WIREREADOUTGEOM_H
3 // vim: sw=2 expandtab :
4 
10 
11 // LArSoft libraries
21 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
25 
26 // C/C++ standard libraries
27 #include <cstddef>
28 #include <map>
29 #include <optional>
30 #include <set>
31 #include <string>
32 #include <utility>
33 #include <vector>
34 
35 namespace geo {
36 
53  : Iterable<details::ReadoutIterationPolicy, details::ToReadoutGeometryElement> {
55 
56  public:
57  explicit WireReadoutGeom(GeometryCore const* geom,
58  std::unique_ptr<WireReadoutGeometryBuilder> builder,
59  std::unique_ptr<WireReadoutSorter> sorter);
60  virtual ~WireReadoutGeom();
61 
62  using Segment = std::pair<Point_t, Point_t>;
63  static auto const& start(Segment const& s) { return s.first; }
64  static auto const& finish(Segment const& s) { return s.second; }
65 
66  //--------------------------------------------------------------------------
67  // Iteration facilities
68  using Iteration::begin;
69  using Iteration::end;
70  using Iteration::Iterate;
71 
73 
78  bool HasPlane(PlaneID const& planeid) const;
79  bool HasElement(PlaneID const& planeid) const { return HasPlane(planeid); }
81 
83 
84  //
85  // group features
86  //
87 
89  unsigned int MaxPlanes() const;
90 
92 
102  unsigned int Nplanes(TPCID const& tpcid = details::tpc_zero) const;
103  unsigned int NElements(TPCID const& tpcid) const { return Nplanes(tpcid); }
104  unsigned int NSiblingElements(PlaneID const& planeid) const { return Nplanes(planeid); }
106 
117  unsigned int Nviews() const;
118 
123  std::set<View_t> const& Views() const { return allViews; }
124 
125  std::set<View_t> Views(TPCID const& tpcid) const;
126 
128 
134  PlaneGeo const& FirstPlane(TPCID const& tpcid) const;
136 
138 
150  PlaneGeo const& Plane(TPCID const& tpcid, View_t view) const;
151  PlaneGeo const& Plane(PlaneID const& planeid) const;
152  PlaneGeo const& GetElement(PlaneID const& planeid) const { return Plane(planeid); }
154 
156 
163  PlaneGeo const* PlanePtr(PlaneID const& planeid) const;
164  PlaneGeo const* GetElementPtr(PlaneID const& planeid) const { return PlanePtr(planeid); }
166 
167  //--------------------------------------------------------------------------
170 
171  unsigned int MaxWires() const;
172 
174 
184  unsigned int Nwires(PlaneID const& planeid) const;
185  unsigned int NElements(PlaneID const& planeid) const;
186  unsigned int NSiblingElements(WireID const& wireid) const { return Nwires(wireid); }
187 
189 
190  //
191  // access
192  //
193 
195 
200  bool HasWire(WireID const& wireid) const;
201  bool HasElement(WireID const& wireid) const { return HasWire(wireid); }
203 
205 
212  WireGeo const* WirePtr(WireID const& wireid) const;
213  WireGeo const* GetElementPtr(WireID const& wireid) const { return WirePtr(wireid); }
215 
217 
225  WireGeo const& Wire(WireID const& wireid) const;
226  WireGeo const& GetElement(WireID const& wireid) const { return Wire(wireid); }
228 
229  //
230  // simple geometry queries
231  //
232 
245  void WireEndPoints(WireID const& wireid, double* xyzStart, double* xyzEnd) const;
246 
248 
260  Segment WireEndPoints(WireID const& wireid) const
261  {
262  WireGeo const& wire = Wire(wireid);
263  return {wire.GetStart(), wire.GetEnd()};
264  }
266 
269 
270  //
271  // single object features
272  //
273 
275 
289  double WireAngleToVertical(View_t view, TPCID const& tpcid) const;
291 
293 
294  //
295  // wire intersections
296  //
297 
299 
330  bool WireIDsIntersect(WireID const& wid1, WireID const& wid2, Point_t& intersection) const;
332 
334 
353  std::optional<WireIDIntersection> WireIDsIntersect(WireID const& wid1,
354  WireID const& wid2) const;
356 
358 
361 
362  //
363  // access
364  //
365 
376 
389  PlaneID ThirdPlane(PlaneID const& pid1, PlaneID const& pid2) const;
390 
408  double ThirdPlaneSlope(PlaneID const& pid1,
409  double slope1,
410  PlaneID const& pid2,
411  double slope2,
412  PlaneID const& output_plane) const;
413 
430  double ThirdPlaneSlope(PlaneID const& pid1,
431  double slope1,
432  PlaneID const& pid2,
433  double slope2) const;
434 
436 
452  double slope1,
453  PlaneID::PlaneID_t plane2,
454  double slope2,
455  TPCID const& tpcid) const
456  {
457  return ThirdPlaneSlope(PlaneID(tpcid, plane1), slope1, PlaneID(tpcid, plane2), slope2);
458  }
460 
476  double ThirdPlane_dTdW(PlaneID const& pid1,
477  double slope1,
478  PlaneID const& pid2,
479  double slope2,
480  PlaneID const& output_plane) const;
481 
498  double ThirdPlane_dTdW(PlaneID const& pid1,
499  double slope1,
500  PlaneID const& pid2,
501  double slope2) const;
502 
514  static double ComputeThirdPlaneSlope(double angle1,
515  double slope1,
516  double angle2,
517  double slope2,
518  double angle_target);
519 
536  static double ComputeThirdPlane_dTdW(double angle1,
537  double pitch1,
538  double dTdW1,
539  double angle2,
540  double pitch2,
541  double dTdW2,
542  double angle_target,
543  double pitch_target);
544 
546 
547  //......................................................................
548  double Plane0Pitch(TPCID const& tpcid, unsigned int p1) const;
549  double PlanePitch(TPCID const& tpcid, unsigned int p1 = 0, unsigned int p2 = 1) const;
550 
551  //--------------------------------------------------------------------------
554 
556  virtual unsigned int Nchannels() const = 0;
557 
560  virtual unsigned int Nchannels(readout::ROPID const& ropid) const = 0;
561 
563  std::vector<raw::ChannelID_t> ChannelsInTPCs() const;
564 
567  virtual bool HasChannel(raw::ChannelID_t channel) const
568  {
569  return raw::isValidChannelID(channel) ? channel < Nchannels() : false;
570  }
571 
574  virtual std::vector<WireID> ChannelToWire(raw::ChannelID_t channel) const = 0;
575 
584  View_t View(raw::ChannelID_t const channel) const;
585 
596  View_t View(readout::ROPID const& ropid) const;
597 
607  SigType_t SignalType(PlaneID const& pid) const;
608 
617  SigType_t SignalType(raw::ChannelID_t const channel) const;
618 
631  SigType_t SignalType(readout::ROPID const& ropid) const;
632 
641  raw::ChannelID_t NearestChannel(Point_t const& worldLoc, PlaneID const& planeid) const;
642 
654  std::optional<WireIDIntersection> ChannelsIntersect(raw::ChannelID_t c1,
655  raw::ChannelID_t c2) const;
656 
658  virtual std::set<PlaneID> const& PlaneIDs() const = 0;
659 
668  virtual raw::ChannelID_t PlaneWireToChannel(WireID const& wireID) const = 0;
669 
671 
672  //--------------------------------------------------------------------------
675 
692  virtual unsigned int NOpChannels(unsigned int NOpDets) const;
693 
695  unsigned int NOpChannels() const;
696 
698  unsigned int MaxOpChannel() const;
699 
701  bool IsValidOpChannel(int opChannel) const;
702 
715  virtual unsigned int MaxOpChannel(unsigned int NOpDets) const;
716 
735  virtual unsigned int NOpHardwareChannels(unsigned int opDet) const;
736 
746  virtual bool IsValidOpChannel(unsigned int opChannel, unsigned int NOpDets) const;
747 
756  virtual unsigned int OpChannel(unsigned int detNum, unsigned int hwchannel = 0) const;
757 
765  virtual unsigned int OpDetFromOpChannel(unsigned int opChannel) const;
766 
774  OpDetGeo const& OpDetGeoFromOpChannel(unsigned int opChannel) const;
775 
783  virtual unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const;
784 
786 
787  //--------------------------------------------------------------------------
790 
806  virtual double WireCoordinate(double YPos, double ZPos, PlaneID const& planeID) const = 0;
807 
823  virtual WireID NearestWireID(Point_t const& worldPos, PlaneID const& planeID) const = 0;
824 
826 
827  //--------------------------------------------------------------------------
830 
835  virtual unsigned int NTPCsets(readout::CryostatID const& cryoid) const = 0;
836 
838  virtual unsigned int MaxTPCsets() const = 0;
839 
842  virtual bool HasTPCset(readout::TPCsetID const& tpcsetid) const = 0;
843 
844  readout::TPCsetID FindTPCsetAtPosition(Point_t const& worldLoc) const;
845 
847  virtual readout::TPCsetID TPCtoTPCset(TPCID const& tpcid) const = 0;
848 
859  virtual std::vector<TPCID> TPCsetToTPCs(readout::TPCsetID const& tpcsetid) const = 0;
860 
862  virtual TPCID FirstTPCinTPCset(readout::TPCsetID const& tpcsetid) const = 0;
863 
865 
866  //--------------------------------------------------------------------------
869 
876  virtual unsigned int NROPs(readout::TPCsetID const& tpcsetid) const = 0;
877 
879  virtual unsigned int MaxROPs() const = 0;
880 
883  virtual bool HasROP(readout::ROPID const& ropid) const = 0;
884 
886  virtual readout::ROPID WirePlaneToROP(PlaneID const& planeid) const = 0;
887 
889  virtual std::vector<PlaneID> ROPtoWirePlanes(readout::ROPID const& ropid) const = 0;
890 
892  virtual PlaneID FirstWirePlaneInROP(readout::ROPID const& ropid) const = 0;
893 
904  virtual std::vector<TPCID> ROPtoTPCs(readout::ROPID const& ropid) const = 0;
905 
915  virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const = 0;
916 
927  virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const& ropid) const = 0;
928 
930 
931  //--------------------------------------------------------------------------
934 
936  std::vector<std::vector<std::vector<raw::ChannelID_t>>> const& FirstChannelInNextPlane() const
937  {
939  }
940 
942  std::vector<std::vector<std::vector<raw::ChannelID_t>>> const& FirstChannelInThisPlane() const
943  {
945  }
946 
948 
949  //--------------------------------------------------------------------------
950 
951  protected:
960  virtual SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const = 0;
961 
974  virtual SigType_t SignalTypeForROPIDImpl(readout::ROPID const& ropid) const;
975 
977  template <typename T>
978  using TPCInfoMap_t = std::vector<std::vector<T>>;
979 
981  template <typename T>
983 
990 
993  template <typename T>
994  T const& AccessElement(TPCInfoMap_t<T> const& map, TPCID const& id) const
995  {
996  return map[id.Cryostat][id.TPC];
997  }
998 
1000  template <typename T>
1001  size_t AccessElementSize(TPCInfoMap_t<T> const& map, CryostatID const& id) const
1002  {
1003  return map[id.Cryostat].size();
1004  }
1005 
1007  template <typename T>
1009  bool isValidElement(TPCInfoMap_t<T> const& map, CryostatID const& id) const
1010  {
1011  return id.Cryostat < map.size();
1012  }
1013  template <typename T>
1014  bool isValidElement(TPCInfoMap_t<T> const& map, TPCID const& id) const
1015  {
1016  return isValidElement(map, id.asCryostatID()) && (id.TPC < map[id.Cryostat].size());
1017  }
1019 
1021  template <typename T>
1022  T const& AccessElement(PlaneInfoMap_t<T> const& map, PlaneID const& id) const
1023  {
1024  return map[id.Cryostat][id.TPC][id.Plane];
1025  }
1026 
1028  template <typename T>
1029  size_t AccessElementSize(PlaneInfoMap_t<T> const& map, TPCID const& id) const
1030  {
1031  return map[id.Cryostat][id.TPC].size();
1032  }
1033 
1035  template <typename T>
1037  bool isValidElement(PlaneInfoMap_t<T> const& map, CryostatID const& id) const
1038  {
1039  return id.Cryostat < map.size();
1040  }
1041  template <typename T>
1042  bool isValidElement(PlaneInfoMap_t<T> const& map, TPCID const& id) const
1043  {
1044  return isValidElement(map, id.asCryostatID()) && (id.TPC < map[id.Cryostat].size());
1045  }
1046  template <typename T>
1047  bool isValidElement(PlaneInfoMap_t<T> const& map, PlaneID const& id) const
1048  {
1049  return isValidElement(map, id.asTPCID()) && (id.Plane < AccessSize(map, id.asTPCID()));
1050  }
1052 
1054  template <typename T>
1055  T const* GetElementPtr(PlaneInfoMap_t<T> const& map, PlaneID const& id) const
1056  {
1057  if (id.Cryostat >= map.size()) return nullptr;
1058  auto const& cryo_map = map[id.Cryostat];
1059  if (id.TPC >= cryo_map.size()) return nullptr;
1060  auto const& TPC_map = cryo_map[id.TPC];
1061  if (id.Plane >= TPC_map.size()) return nullptr;
1062  auto const& plane_map = TPC_map[id.Plane];
1063  return &plane_map;
1064  } // GetElementPtr()
1065 
1067 
1068  // These 3D vectors are used in initializing the Channel map. Only a 1D vector is
1069  // really needed so far, but these are more general.
1072 
1073  private:
1075  bool WireIDIntersectionCheck(WireID const& wid1, WireID const& wid2) const;
1076 
1078  void ResetDriftDirection(TPCID const& tpcid);
1079 
1080  void UpdateAfterSorting(TPCGeo const& tpc, std::vector<PlaneGeo>& planes);
1081 
1083  void SortPlanes(TPCID const& tpcid, std::vector<PlaneGeo>& planes) const;
1084  void SortSubVolumes(std::vector<PlaneGeo>& planes, Compare<WireGeo> compareWires) const;
1085 
1086  std::map<TPCID, std::vector<PlaneGeo>> fPlanes;
1087  std::map<TPCID, std::vector<double>> fPlane0Pitch;
1088 
1089  // cached values
1090  std::set<View_t> allViews;
1091 
1093  };
1094 
1095 }
1096 #endif // LARCOREALG_GEOMETRY_WIREREADOUTGEOM_H
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:112
bool HasElement(WireID const &wireid) const
Returns whether we have the specified wire.
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const =0
Returns the ID of the ROP the channel belongs to.
virtual double WireCoordinate(double YPos, double ZPos, PlaneID const &planeID) const =0
Returns the index of the wire nearest to the specified position.
size_t AccessElementSize(TPCInfoMap_t< T > const &map, CryostatID const &id) const
Returns the number of elements in the specified cryostat of the TPC map.
PlaneID ThirdPlane(PlaneID const &pid1, PlaneID const &pid2) const
Returns the plane that is not in the specified arguments.
static auto const & start(Segment const &s)
unsigned int Nwires(PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
WireGeo const & GetElement(WireID const &wireid) const
Returns the specified wire.
virtual unsigned int MaxROPs() const =0
Returns the largest number of ROPs a TPC set in the detector has.
unsigned int NElements(TPCID const &tpcid) const
Returns the total number of planes in the specified TPC.
double Plane0Pitch(TPCID const &tpcid, unsigned int p1) const
bool isValidElement(TPCInfoMap_t< T > const &map, CryostatID const &id) const
Returns whether the ID specifies a valid entry.
Classes identifying readout-related concepts.
PlaneGeo const & GetElement(PlaneID const &planeid) const
Returns the specified wire.
PlaneGeo const * PlanePtr(PlaneID const &planeid) const
Returns the specified plane.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const =0
Returns the total number of TPC sets in the specified cryostat.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
bool IsValidOpChannel(int opChannel) const
Is this a valid OpChannel number?
static double ComputeThirdPlane_dTdW(double angle1, double pitch1, double dTdW1, double angle2, double pitch2, double dTdW2, double angle_target, double pitch_target)
Returns the slope on the third plane, given it in the other two.
bool HasWire(WireID const &wireid) const
Returns whether we have the specified wire.
virtual unsigned int Nchannels() const =0
Returns the total number of channels present (not necessarily contiguous)
void SortPlanes(TPCID const &tpcid, std::vector< PlaneGeo > &planes) const
Sorts (in place) the specified PlaneGeo objects by drift distance.
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:365
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
Geometry information for a single TPC.
Definition: TPCGeo.h:33
Class identifying a set of TPC sharing readout channels.
Definition: readout_types.h:54
virtual unsigned int OpDetFromOpChannel(unsigned int opChannel) const
Returns the optical detector the specified optical channel belongs.
virtual unsigned int NOpHardwareChannels(unsigned int opDet) const
Returns the number of channels in the specified optical detectors.
double WireAngleToVertical(View_t view, TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
double PlanePitch(TPCID const &tpcid, unsigned int p1=0, unsigned int p2=1) const
WireGeo const * WirePtr(WireID const &wireid) const
Returns the specified wire.
SigType_t SignalType(PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
std::optional< WireIDIntersection > ChannelsIntersect(raw::ChannelID_t c1, raw::ChannelID_t c2) const
Returns an intersection point of two channels.
Point_t GetStart() const
Returns the world coordinate of one end of the wire [cm].
Definition: WireGeo.h:224
Point_t GetEnd() const
Returns the world coordinate of one end of the wire [cm].
Definition: WireGeo.h:229
std::map< TPCID, std::vector< PlaneGeo > > fPlanes
bool HasPlane(PlaneID const &planeid) const
Returns whether we have the specified plane.
virtual bool HasROP(readout::ROPID const &ropid) const =0
virtual bool HasChannel(raw::ChannelID_t channel) const
Returns whether the specified channel is valid This default implementation assumes all channels up to...
std::map< TPCID, std::vector< double > > fPlane0Pitch
Pitch between planes.
virtual TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const =0
Returns the ID of the first TPC belonging to the specified TPC set.
unsigned int NSiblingElements(WireID const &wireid) const
Returns the total number of wires in the specified plane.
WireReadoutGeom(GeometryCore const *geom, std::unique_ptr< WireReadoutGeometryBuilder > builder, std::unique_ptr< WireReadoutSorter > sorter)
WireGeo const & Wire(WireID const &wireid) const
Returns the specified wire.
virtual WireID NearestWireID(Point_t const &worldPos, PlaneID const &planeID) const =0
Returns the ID of the wire nearest to the specified position.
PlaneGeo const * GetElementPtr(PlaneID const &planeid) const
Returns the specified plane.
virtual PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first plane belonging to the specified ROP.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
std::vector< raw::ChannelID_t > ChannelsInTPCs() const
Returns an std::vector<ChannelID_t> in all TPCs in a TPCSet.
static double ComputeThirdPlaneSlope(double angle1, double slope1, double angle2, double slope2, double angle_target)
Returns the slope on the third plane, given it in the other two.
OpDetGeo const & OpDetGeoFromOpChannel(unsigned int opChannel) const
Returns the optical detector the specified optical channel belongs.
readout::TPCsetID FindTPCsetAtPosition(Point_t const &worldLoc) const
Returns the total number of TPC sets in the specified cryostat.
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
std::set< View_t > const & Views() const
Returns a list of possible views in the detector.
TCanvas * c1
Definition: plotHisto.C:7
TCanvas * c2
Definition: plot_hist.C:75
std::function< bool(T const &, T const &)> Compare
Definition: fwd.h:22
void UpdateAfterSorting(TPCGeo const &tpc, std::vector< PlaneGeo > &planes)
bool isValidElement(TPCInfoMap_t< T > const &map, TPCID const &id) const
Returns the specified element of the TPC map.
virtual readout::ROPID WirePlaneToROP(PlaneID const &planeid) const =0
Returns the ID of the ROP planeid belongs to.
Definitions of geometry vector data types.
static auto const & finish(Segment const &s)
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
Interface for a class providing readout channel mapping to geometry.
std::pair< Point_t, Point_t > Segment
unsigned int MaxWires() const
Returns the total number of wires in the specified plane.
std::vector< std::vector< std::vector< raw::ChannelID_t > > > const & FirstChannelInNextPlane() const
Retrieve the private fFirstChannelInNextPlane vector for testing.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:67
unsigned int Nviews() const
Returns the number of views (different wire orientations)
virtual SigType_t SignalTypeForROPIDImpl(readout::ROPID const &ropid) const
Return the signal type on the specified readout plane.
std::vector< std::vector< std::vector< raw::ChannelID_t > > > const & FirstChannelInThisPlane() const
Retrieve the private fFirstChannelInThisPlane vector for testing.
constexpr bool isValidChannelID(raw::ChannelID_t channel)
Definition: RawTypes.h:35
virtual raw::ChannelID_t PlaneWireToChannel(WireID const &wireID) const =0
Returns the channel ID a wire is connected to.
void SortSubVolumes(std::vector< PlaneGeo > &planes, Compare< WireGeo > compareWires) const
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const =0
bool isValidElement(PlaneInfoMap_t< T > const &map, PlaneID const &id) const
Returns whether the ID specifies a valid entry.
std::vector< std::vector< T >> TPCInfoMap_t
Data type for per-TPC information.
double ThirdPlane_dTdW(PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2, PlaneID const &output_plane) const
Returns dT/dW on the third plane, given it in the other two.
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
Description of the physical geometry of one entire detector.
Definition: GeometryCore.h:91
bool isValidElement(PlaneInfoMap_t< T > const &map, TPCID const &id) const
Returns whether the ID specifies a valid entry.
Definition of data types for geometry description.
Class identifying a set of planes sharing readout channels.
raw::ChannelID_t NearestChannel(Point_t const &worldLoc, PlaneID const &planeid) const
Returns the ID of the channel nearest to the specified position.
void ResetDriftDirection(TPCID const &tpcid)
Recomputes the drift direction; needs planes to have been initialised.
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, Point_t &intersection) const
Computes the intersection between two wires.
unsigned int Nplanes(TPCID const &tpcid=details::tpc_zero) const
Returns the total number of planes in the specified TPC.
size_t AccessElementSize(PlaneInfoMap_t< T > const &map, TPCID const &id) const
Returns the number of elements in the specified TPC of the plane map.
Encapsulate the geometry of a wire .
virtual ~WireReadoutGeom()
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
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const =0
Returns the total number of ROP in the specified TPC set.
TPCInfoMap_t< std::vector< T >> PlaneInfoMap_t
Data type for per-plane information.
virtual unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const
Returns the hardware channel number of specified optical channel.
Segment WireEndPoints(WireID const &wireid) const
Returns a segment whose ends are the wire end points.
PlaneGeo const & FirstPlane(TPCID const &tpcid) const
Returns the first plane of the specified TPC.
T const * GetElementPtr(PlaneInfoMap_t< T > const &map, PlaneID const &id) const
Returns a pointer to the specified element, or nullptr if invalid.
virtual std::set< PlaneID > const & PlaneIDs() const =0
Returns a list of the plane IDs in the whole detector.
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const =0
Encapsulate the construction of a single detector plane .
View_t View(raw::ChannelID_t const channel) const
Returns the view (wire orientation) on the specified TPC channel.
unsigned int MaxOpChannel() const
Largest optical channel number.
unsigned int NSiblingElements(PlaneID const &planeid) const
Returns the total number of planes in the specified TPC.
virtual std::vector< TPCID > TPCsetToTPCs(readout::TPCsetID const &tpcsetid) const =0
Returns a list of ID of TPCs belonging to the specified TPC set.
virtual unsigned int MaxTPCsets() const =0
Returns the largest number of TPC sets any cryostat in the detector has.
constexpr TPCID tpc_zero
Definition: ZeroIDs.h:8
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
bool isValidElement(PlaneInfoMap_t< T > const &map, CryostatID const &id) const
Returns whether the ID specifies a valid entry.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first channel in the specified readout plane.
unsigned int NOpChannels() const
Number of electronics channels for all the optical detectors.
bool WireIDIntersectionCheck(WireID const &wid1, WireID const &wid2) const
Wire ID check for WireIDsIntersect methods.
GeometryCore const * fGeom
T const & AccessElement(TPCInfoMap_t< T > const &map, TPCID const &id) const
Returns the specified element of the TPC map.
WireGeo const * GetElementPtr(WireID const &wireid) const
Returns the specified wire.
PlaneGeo const & Plane(TPCID const &tpcid, View_t view) const
Returns the specified wire.
T const & AccessElement(PlaneInfoMap_t< T > const &map, PlaneID const &id) const
Returns the specified element of the plane map.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
virtual std::vector< TPCID > ROPtoTPCs(readout::ROPID const &ropid) const =0
Returns a list of ID of TPCs the specified ROP spans.
ROOT libraries.
virtual unsigned int OpChannel(unsigned int detNum, unsigned int hwchannel=0) const
Returns the channel ID of the specified hardware channel.
virtual SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const =0
Return the signal type of the specified channel.
void WireEndPoints(WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
bool HasElement(PlaneID const &planeid) const
Returns whether we have the specified plane.
std::set< View_t > allViews
All views in the detector.
double ThirdPlaneSlope(PlaneID const &pid1, double slope1, PlaneID const &pid2, double slope2, PlaneID const &output_plane) const
Returns the slope on the third plane, given it in the other two.
virtual std::vector< PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const =0
Returns a list of ID of planes belonging to the specified ROP.
The data type to uniquely identify a cryostat.
Definition: geo_types.h:187
double ThirdPlaneSlope(PlaneID::PlaneID_t plane1, double slope1, PlaneID::PlaneID_t plane2, double slope2, TPCID const &tpcid) const
Returns the slope on the third plane, given it in the other two.
virtual readout::TPCsetID TPCtoTPCset(TPCID const &tpcid) const =0
Returns the ID of the TPC set tpcid belongs to.