46 #ifndef LARCOREALG_GEOMETRY_GEOMETRYCORE_H 47 #define LARCOREALG_GEOMETRY_GEOMETRYCORE_H 82 #include <type_traits> 98 class AuxDetSensitiveGeo;
159 template <
typename GEOID>
171 "template type GEOID is not a LocalID_t");
200 template <
typename OTHERID>
202 {
return localID() == as.
localID(); }
205 template <
typename OTHERID>
207 {
return localID() != as.
localID(); }
213 LocalID_t const* operator-> ()
const {
return &(localID()); }
222 operator bool()
const;
233 { set_local_limits(); }
236 GeoID_t const& ID()
const {
return id; }
245 bool at_end()
const {
return local_index() == limit; }
249 ID_t limit = LocalID_t::InvalidID;
252 void set_local_limits();
263 {
return static_cast<LocalID_t const&
>(ID()); }
268 ID_t const& local_index()
const {
return localID().
Cryostat; }
293 template <
typename GEOID>
295 virtual public std::forward_iterator_tag,
306 "template type GEOID is not a LocalID_t");
331 { set_local_limits(); }
336 { set_local_limits(); }
345 template <
typename OTHERID>
347 {
return localID() == as.
localID(); }
350 template <
typename OTHERID>
352 {
return localID() != as.
localID(); }
358 LocalID_t const* operator-> ()
const {
return &(localID()); }
367 operator bool()
const;
381 using upper_iterator::ID;
385 {
return static_cast<LocalID_t const&
>(upper_iterator::ID()); }
387 using upper_iterator::at_end;
398 ID_t limit = LocalID_t::InvalidID;
401 void set_local_limits();
429 template <
typename GEOID>
431 virtual public std::forward_iterator_tag,
442 "template type GEOID is not a LocalID_t");
468 { set_local_limits(); }
473 { set_local_limits(); }
482 template <
typename OTHERID>
484 {
return localID() == as.
localID(); }
487 template <
typename OTHERID>
489 {
return localID() != as.
localID(); }
495 LocalID_t const* operator-> ()
const {
return &(localID()); }
504 operator bool()
const;
518 using upper_iterator::ID;
522 {
return static_cast<LocalID_t const&
>(upper_iterator::ID()); }
524 using upper_iterator::at_end;
535 ID_t limit = LocalID_t::InvalidID;
538 void set_local_limits();
566 template <
typename GEOID>
568 virtual public std::forward_iterator_tag,
579 "template type GEOID is not a LocalID_t");
605 { set_local_limits(); }
610 { set_local_limits(); }
619 template <
typename OTHERID>
621 {
return localID() == as.
localID(); }
624 template <
typename OTHERID>
626 {
return localID() != as.
localID(); }
632 LocalID_t const* operator-> ()
const {
return &(localID()); }
641 operator bool()
const;
655 using upper_iterator::ID;
659 {
return static_cast<LocalID_t const&
>(upper_iterator::ID()); }
661 using upper_iterator::at_end;
672 ID_t limit = LocalID_t::InvalidID;
675 void set_local_limits();
687 template <
typename GEOIDITER>
691 template <
typename GEOIDITER>
694 GEOIDITER
const& id_iter
697 template <
typename GEOIDITER>
699 GEOIDITER
const& id_iter,
702 {
return iter == id_iter; }
705 template <
typename GEOIDITER>
708 GEOIDITER
const& id_iter
711 template <
typename GEOIDITER>
713 GEOIDITER
const& id_iter,
716 {
return iter != id_iter; }
734 template <
typename GEOIDITER>
743 "template class for geometry_element_iterator" 744 " must be a geometry iterator" 752 using GeoID_t =
typename id_iterator_t::GeoID_t;
767 using Element_t =
typename std::remove_pointer<ElementPtr_t>::type;
785 id_iter(geom, start_from)
817 if (ptr)
return *ptr;
819 <<
"iterator attempted to obtain geometry element " 820 << std::string(ID());
827 iterator& operator++ () { ++id_iterator();
return *
this; }
831 {
iterator old(*
this); ++id_iterator();
return old; }
834 operator bool()
const 835 {
return bool(id_iterator()) && (id_iterator().get() !=
nullptr); }
882 template <
typename GEOID>
884 virtual public std::forward_iterator_tag,
894 "template type GEOID is not a LocalID_t");
921 { set_local_limits(); }
926 { set_local_limits(); }
935 template <
typename OTHERID>
937 {
return localID() == as.
localID(); }
940 template <
typename OTHERID>
942 {
return localID() != as.
localID(); }
948 LocalID_t const* operator-> ()
const {
return &(localID()); }
957 operator bool()
const;
969 using upper_iterator::ID;
973 {
return static_cast<LocalID_t const&
>(upper_iterator::ID()); }
975 using upper_iterator::at_end;
986 ID_t limit = LocalID_t::InvalidID;
989 void set_local_limits();
1022 template <
typename GEOID>
1024 virtual public std::forward_iterator_tag,
1034 "template type GEOID is not a LocalID_t");
1060 { set_local_limits(); }
1065 { set_local_limits(); }
1074 template <
typename OTHERID>
1076 {
return localID() == as.
localID(); }
1079 template <
typename OTHERID>
1081 {
return localID() != as.
localID(); }
1087 LocalID_t const* operator-> ()
const {
return &(localID()); }
1096 operator bool()
const;
1107 using upper_iterator::ID;
1111 {
return static_cast<LocalID_t const&
>(upper_iterator::ID()); }
1113 using upper_iterator::at_end;
1128 void set_local_limits();
1312 template <
typename Iter>
1365 namespace iterators {
1455 using Point3D_t [[deprecated(
"Convert the code to use geo::Point_t")]]
1460 template <
typename Po
int>
1464 using std::pair<Point, Point>::pair;
1484 static constexpr std::size_t MaxWireDepthInGDML = 20U;
1743 TGeoVolume
const* WorldVolume()
const;
1764 void WorldBox(
double* xlo,
double* xhi,
1765 double* ylo,
double* yhi,
1766 double* zlo,
double* zhi)
const;
1794 TGeoManager* ROOTGeoManager()
const;
1797 const std::string GetWorldVolumeName()
const;
1808 std::string VolumeName(
geo::Point_t const& point)
const;
1823 std::vector<TGeoNode const*> FindAllVolumes
1824 (std::set<std::string>
const& vol_names)
const;
1839 std::vector<std::vector<TGeoNode const*>> FindAllVolumePaths
1840 (std::set<std::string>
const& vol_names)
const;
1844 TGeoMaterial
const* Material(
geo::Point_t const& point)
const;
1852 std::string MaterialName(
geo::Point_t const& point)
const;
1857 double TotalMass()
const {
return TotalMass(GetWorldVolumeName()); }
1859 double TotalMass(std::string vol)
const;
1876 double MassBetweenPoints
1878 double MassBetweenPoints(
double *p1,
double *p2)
const;
1883 template <
typename Stream>
1884 void Print(Stream&& out, std::string
indent =
" ")
const;
1895 template <
typename GeoID>
1904 template <
typename GeoID>
1906 {
auto nextID(
id); IncrementID(nextID);
return nextID; }
1914 template <
typename GeoID>
1925 template <
typename GeoID,
typename ContextID>
1926 GeoID GetBeginID(ContextID
const&
id)
const;
1937 template <
typename GeoID,
typename ContextID>
1938 GeoID GetEndID(ContextID
const&
id)
const;
1960 {
return Ncryostats(); }
1975 {
return cryoid.
Cryostat < Ncryostats(); }
1977 {
return HasCryostat(cryoid); }
1997 {
return Cryostat(cryoid); }
2010 {
return HasCryostat(cryoid)? &(Cryostats()[cryoid.
Cryostat]):
nullptr; }
2012 {
return CryostatPtr(cryoid); }
2026 (
double const worldLoc[3])
const;
2090 (
double const worldLoc[3],
unsigned int &cstat)
const;
2204 void CryostatBoundaries
2222 void CryostatBoundaries
2223 (
double* boundaries,
unsigned int cstat = 0)
const 2266 unsigned int NTPC(
unsigned int cstat = 0)
const 2270 unsigned int MaxTPCs()
const;
2273 unsigned int TotalNTPC()
const;
2304 template <
typename T>
2306 {
return { Ncryostats(), MaxTPCs() }; }
2327 template <
typename T>
2329 {
return { Ncryostats(), MaxTPCs(), defValue }; }
2350 {
return NTPC(cryoid); }
2352 {
return NTPC(tpcid); }
2363 return pCryo? pCryo->
HasTPC(tpcid):
false;
2386 (
unsigned int const tpc = 0,
unsigned int const cstat = 0)
const 2389 {
return Cryostat(tpcid).
TPC(tpcid); }
2391 {
return TPC(tpcid); }
2406 return pCryo? pCryo->
TPCPtr(tpcid):
nullptr;
2409 {
return TPCPtr(tpcid); }
2460 TPCGeo const& PositionToTPC
2461 (
double const worldLoc[3],
unsigned int &tpc,
unsigned int &cstat)
const;
2471 TPCGeo const& PositionToTPC
2472 (
double const worldLoc[3],
TPCID& tpcid)
const;
2488 { GetBeginID(
id.asCryostatID());
id.TPC = 0; }
2492 { GetEndID(
id.asCryostatID());
id.TPC = 0; }
2500 {
return { id, 0 }; }
2590 void IterateTPCIDs(
geo::PlaneID const& pid)
const =
delete;
2593 void IterateTPCIDs(
geo::WireID const& pid)
const =
delete;
2641 IterateTPCs(geo::CryostatID
const& cid)
const {
return {
this, cid }; }
2644 void IterateTPCs(
geo::TPCID const& pid)
const =
delete;
2647 void IterateTPCs(
geo::PlaneID const& pid)
const =
delete;
2650 void IterateTPCs(
geo::WireID const& pid)
const =
delete;
2679 (
unsigned int tpc = 0,
unsigned int cstat = 0)
const 2680 {
return DetHalfWidth(
geo::TPCID(cstat, tpc)); }
2701 (
unsigned int tpc = 0,
unsigned int cstat = 0)
const 2702 {
return DetHalfHeight(
geo::TPCID(cstat, tpc)); }
2723 {
return DetLength(
geo::TPCID(cstat, tpc)); }
2739 template <
typename Po
int = DefaultPo
int_t>
2741 {
return TPC(tpcid).GetFrontFaceCenter<
Point>(); }
2742 template <
typename Po
int = DefaultPo
int_t>
2743 Point GetTPCFrontFaceCenter
2744 (
unsigned int tpc = 0,
unsigned int cstat = 0)
const 2745 {
return GetTPCFrontFaceCenter<Point>(
geo::TPCID(cstat, tpc)); }
2766 std::string GetLArTPCVolumeName(
geo::TPCID const& tpcid)
const;
2767 std::string GetLArTPCVolumeName
2768 (
unsigned int const tpc = 0,
unsigned int const cstat = 0)
const 2769 {
return GetLArTPCVolumeName(
geo::TPCID(cstat, tpc)); }
2792 unsigned int Nplanes(
unsigned int tpc = 0,
unsigned int cstat = 0)
const 2796 unsigned int MaxPlanes()
const;
2825 template <
typename T>
2827 {
return { Ncryostats(), MaxTPCs(), MaxPlanes() }; }
2847 template <
typename T>
2849 {
return { Ncryostats(), MaxTPCs(), MaxPlanes(), defValue }; }
2865 TPCGeo const* pTPC = GetElementPtr(tpcid);
2869 {
return Nplanes(tpcid); }
2871 {
return Nplanes(planeid); }
2886 unsigned int Nviews()
const;
2895 [[deprecated(
"Iterate through geo::GeometryCore::IteratePlaneIDs() instead")]]
2896 std::set<PlaneID>
const& PlaneIDs()
const;
2914 return pTPC? pTPC->
HasPlane(planeid):
false;
2917 {
return HasPlane(planeid); }
2938 (
unsigned int const p,
unsigned int const tpc = 0,
unsigned int const cstat = 0)
2942 {
return TPC(planeid).Plane(planeid); }
2944 {
return Plane(planeid); }
2959 return pTPC? pTPC->
PlanePtr(planeid):
nullptr;
2962 {
return PlanePtr(planeid); }
2971 { GetBeginID(
id.asTPCID());
id.Plane = 0; }
2975 { GetEndID(
id.asTPCID());
id.Plane = 0; }
2983 {
return { GetBeginTPCID(
id), 0 }; }
2988 {
return { GetEndTPCID(
id), 0 }; }
2992 {
return { id, 0 }; }
2997 {
return { GetNextID(
id), 0 }; }
3124 void IteratePlaneIDs(
geo::PlaneID const& pid)
const =
delete;
3127 void IteratePlaneIDs(
geo::WireID const& pid)
const =
delete;
3202 void IteratePlanes(
geo::PlaneID const& pid)
const =
delete;
3205 void IteratePlanes(
geo::WireID const& pid)
const =
delete;
3235 geo::TPCID
const& tpcid,
3241 unsigned int p2 = 1,
3242 unsigned int tpc = 0,
3243 unsigned int cstat = 0)
const;
3286 (
unsigned int p,
unsigned int tpc = 0,
unsigned int cstat = 0)
const 3302 PlaneGeo const* pPlane = GetElementPtr(planeid);
3306 {
return Nwires(planeid); }
3308 {
return Nwires(wireid); }
3311 unsigned int MaxWires()
const;
3330 return pPlane? pPlane->
HasWire(wireid):
false;
3347 return pPlane? pPlane->
WirePtr(wireid):
nullptr;
3350 {
return WirePtr(wireid); }
3364 {
return Plane(wireid).Wire(wireid); }
3366 {
return Wire(wireid); }
3368 {
return Wire(wireid); }
3377 { GetBeginID(
id.asPlaneID());
id.Wire = 0; }
3381 { GetEndID(
id.asPlaneID());
id.Wire = 0; }
3389 {
return { GetBeginPlaneID(
id), 0 }; }
3394 {
return { GetEndPlaneID(
id), 0 }; }
3407 {
return { id, 0 }; }
3412 {
return { GetNextID(
id), 0 }; }
3576 void IterateWireIDs(
geo::WireID const& pid)
const =
delete;
3677 void IterateWires(
geo::WireID const& pid)
const =
delete;
3708 unsigned int tpc = 0,
3709 unsigned int cstat = 0)
const 3710 {
return WirePitch(geo::PlaneID(cstat, tpc, plane)); }
3745 double WireAngleToVertical(
geo::View_t view, geo::TPCID
const& tpcid)
const;
3747 {
return WireAngleToVertical(view, geo::TPCID(Cryo, TPC)); }
3783 (
geo::WireID const& wireid,
double *xyzStart,
double *xyzEnd)
const;
3801 unsigned int cstat,
unsigned int tpc,
unsigned int plane,
unsigned int wire,
3802 double *xyzStart,
double *xyzEnd
3804 { WireEndPoints(
geo::WireID(cstat, tpc, plane, wire), xyzStart, xyzEnd); }
3818 template <
typename Po
int = DefaultPo
int_t>
3864 (
geo::Point_t const& point, geo::PlaneID
const& planeid)
const;
3883 (
const double point[3], geo::PlaneID
const& planeid)
const;
3885 (std::vector<double>
const& point, geo::PlaneID
const& planeid)
const;
3887 (
const TVector3& point, geo::PlaneID
const& planeid)
const 3890 unsigned int const PlaneNo,
3891 unsigned int const TPCNo = 0,
3892 unsigned int const cstat = 0)
const 3893 {
return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
3895 unsigned int const PlaneNo,
3896 unsigned int const TPCNo = 0,
3897 unsigned int const cstat = 0)
const 3898 {
return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
3900 unsigned int const PlaneNo,
3901 unsigned int const TPCNo = 0,
3902 unsigned int const cstat = 0)
const 3903 {
return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
3905 unsigned int const PlaneNo,
3906 unsigned int const TPCNo = 0,
3907 unsigned int const cstat = 0)
const 3908 {
return NearestWireID(point, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
3921 (
geo::Point_t const& point, geo::PlaneID
const& planeid)
const;
3939 unsigned int NearestWire
3940 (
const double worldLoc[3], geo::PlaneID
const& planeid)
const;
3941 unsigned int NearestWire
3942 (std::vector<double>
const& worldLoc, geo::PlaneID
const& planeid)
const;
3943 unsigned int NearestWire
3944 (
const TVector3& worldLoc, geo::PlaneID
const& planeid)
const 3947 unsigned int const PlaneNo,
3948 unsigned int const TPCNo = 0,
3949 unsigned int const cstat = 0)
const 3950 {
return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
3952 unsigned int const PlaneNo,
3953 unsigned int const TPCNo = 0,
3954 unsigned int const cstat = 0)
const 3955 {
return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
3957 unsigned int const PlaneNo,
3958 unsigned int const TPCNo = 0,
3959 unsigned int const cstat = 0)
const 3960 {
return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
3962 unsigned int const PlaneNo,
3963 unsigned int const TPCNo = 0,
3964 unsigned int const cstat = 0)
const 3965 {
return NearestWire(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
3986 (
double YPos,
double ZPos, geo::PlaneID
const& planeid)
const;
4001 unsigned int PlaneNo,
4003 unsigned int cstat)
const 4004 {
return WireCoordinate(YPos, ZPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
4019 (
geo::Point_t const& pos, geo::PlaneID
const& planeid)
const;
4021 (TVector3
const& pos, geo::PlaneID
const& planeid)
const 4053 bool IntersectLines(
4054 double A_start_x,
double A_start_y,
double A_end_x,
double A_end_y,
4055 double B_start_x,
double B_start_y,
double B_end_x,
double B_end_y,
4056 double&
x,
double&
y 4080 bool IntersectSegments(
4081 double A_start_x,
double A_start_y,
double A_end_x,
double A_end_y,
4082 double B_start_x,
double B_start_y,
double B_end_x,
double B_end_y,
4083 double& x,
double& y
4107 bool WireIDsIntersect(
4111 bool WireIDsIntersect
4112 (
WireID const& wid1,
WireID const& wid2, TVector3& intersection)
const;
4137 bool WireIDsIntersect
4183 unsigned int plane1,
4184 unsigned int plane2,
4190 return IntersectionPoint(
4209 geo::PlaneID ThirdPlane
4210 (geo::PlaneID
const& pid1, geo::PlaneID
const& pid2)
const;
4231 double ThirdPlaneSlope(geo::PlaneID
const& pid1,
double slope1,
4232 geo::PlaneID
const& pid2,
double slope2,
4233 geo::PlaneID
const& output_plane)
const;
4252 double ThirdPlaneSlope(geo::PlaneID
const& pid1,
double slope1,
4253 geo::PlaneID
const& pid2,
double slope2)
const;
4273 geo::TPCID
const& tpcid)
const 4275 return ThirdPlaneSlope(
4276 geo::PlaneID(tpcid, plane1), slope1,
4277 geo::PlaneID(tpcid, plane2), slope2
4281 unsigned int plane2,
double slope2,
4282 unsigned int tpc,
unsigned int cstat)
const 4284 return ThirdPlaneSlope
4285 (plane1, slope1, plane2, slope2, geo::TPCID(cstat, tpc));
4306 double ThirdPlane_dTdW(geo::PlaneID
const& pid1,
double slope1,
4307 geo::PlaneID
const& pid2,
double slope2,
4308 geo::PlaneID
const& output_plane)
const;
4327 double ThirdPlane_dTdW(geo::PlaneID
const& pid1,
double slope1,
4328 geo::PlaneID
const& pid2,
double slope2)
const;
4342 static double ComputeThirdPlaneSlope(
4343 double angle1,
double slope1,
4344 double angle2,
double slope2,
4364 static double ComputeThirdPlane_dTdW(
4365 double angle1,
double pitch1,
double dTdW1,
4366 double angle2,
double pitch2,
double dTdW2,
4367 double angle_target,
double pitch_target
4382 unsigned int NOpDets()
const;
4389 OpDetGeo const& OpDetGeoFromOpChannel(
unsigned int OpChannel)
const;
4391 OpDetGeo const& OpDetGeoFromOpDet(
unsigned int OpDet)
const;
4407 unsigned int GetClosestOpDet(
geo::Point_t const& point)
const;
4408 unsigned int GetClosestOpDet(
double const* point)
const;
4424 std::string OpDetGeoName(
unsigned int c = 0)
const;
4447 unsigned int NAuxDets()
const {
return AuxDets().size(); }
4455 unsigned int NAuxDetSensitive(
size_t const& aid)
const;
4469 AuxDetGeo const& AuxDet(
unsigned int const ad = 0)
const;
4480 unsigned int FindAuxDetAtPosition(
double const worldLoc[3])
const;
4490 unsigned int FindAuxDetAtPosition(
geo::Point_t const& point)
const;
4498 void FindAuxDetSensitiveAtPosition(
geo::Point_t const& point,
4500 std::size_t & sv)
const;
4509 void FindAuxDetSensitiveAtPosition(
double const worldLoc[3],
4534 (
double const worldLoc[3],
unsigned int& ad)
const;
4546 (
geo::Point_t const& point,
size_t& ad,
size_t& sv)
const;
4562 const AuxDetGeo& ChannelToAuxDet(std::string
const& auxDetName,
4563 uint32_t
const& channel)
const;
4567 uint32_t
const& channel)
const;
4581 unsigned int Nchannels()
const;
4591 std::set<geo::View_t>
const&
Views()
const {
return allViews; }
4623 unsigned int const wire,
4624 unsigned int const tpc = 0,
4625 unsigned int const cstat = 0)
const 4626 {
return PlaneWireToChannel(
geo::WireID(cstat, tpc, plane, wire)); }
4660 std::vector<geo::WireID> ChannelToWire
4682 (
geo::Point_t const& worldLoc, geo::PlaneID
const& planeid)
const;
4699 (
const double worldLoc[3], geo::PlaneID
const& planeid)
const;
4701 (std::vector<double>
const& worldLoc, geo::PlaneID
const& planeid)
const;
4703 (
const TVector3& worldLoc, geo::PlaneID
const& planeid)
const 4706 unsigned int const PlaneNo,
4707 unsigned int const TPCNo = 0,
4708 unsigned int const cstat = 0)
const 4709 {
return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
4711 unsigned int const PlaneNo,
4712 unsigned int const TPCNo = 0,
4713 unsigned int const cstat = 0)
const 4714 {
return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
4716 unsigned int const PlaneNo,
4717 unsigned int const TPCNo = 0,
4718 unsigned int const cstat = 0)
const 4719 {
return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
4721 unsigned int const PlaneNo,
4722 unsigned int const TPCNo = 0,
4723 unsigned int const cstat = 0)
const 4724 {
return NearestChannel(worldLoc, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
4740 bool ChannelsIntersect
4765 {
return NTPCsets(tpcsetid); }
4769 unsigned int MaxTPCsets()
const;
4781 {
return HasTPCset(tpcsetid); }
4807 std::vector<geo::TPCID> TPCsetToTPCs
4817 { GetBeginID(
id.asCryostatID());
id.TPCset = 0; }
4821 { GetEndID(
id.asCryostatID());
id.TPCset = 0; }
4829 {
return { id, 0 }; }
4968 {
return NROPs(ropid); }
4972 unsigned int MaxROPs()
const;
5000 readout::ROPID WirePlaneToROP(geo::PlaneID
const& planeid)
const;
5012 std::vector<geo::PlaneID> ROPtoWirePlanes
5025 std::vector<geo::TPCID> ROPtoTPCs(
readout::ROPID const& ropid)
const;
5046 { GetBeginID(
id.asTPCsetID());
id.ROP = 0; }
5050 { GetEndID(
id.asTPCsetID());
id.ROP = 0; }
5058 {
return { GetBeginTPCsetID(
id), 0 }; }
5063 {
return { GetEndTPCsetID(
id), 0 }; }
5067 {
return { id, 0 }; }
5072 {
return { GetNextID(
id), 0 }; }
5213 unsigned int NOpChannels()
const;
5216 unsigned int MaxOpChannel()
const;
5219 unsigned int NOpHardwareChannels(
int opDet)
const;
5227 bool IsValidOpChannel(
int opChannel)
const;
5230 unsigned int OpChannel(
int detNum,
int hardwareChannel)
const;
5233 unsigned int OpDetFromOpChannel(
int opChannel)
const;
5236 unsigned int HardwareChannelFromOpChannel(
int opChannel)
const;
5239 unsigned int OpDetFromCryo(
unsigned int o,
unsigned int c)
const;
5261 bool ValueInRange(
double value,
double min,
double max)
const;
5290 void LoadGeometryFile
5291 (std::string gdmlfile, std::string rootfile,
bool bForceReload =
false);
5311 void ApplyChannelMap(std::shared_ptr<geo::ChannelMapAlg> pChannelMap);
5321 {
return fChannelMapAlg.get(); }
5337 void FindCryostat(std::vector<const TGeoNode*>& path,
unsigned int depth);
5339 void MakeCryostat(std::vector<const TGeoNode*>& path,
int depth);
5341 void FindAuxDet(std::vector<const TGeoNode*>& path,
unsigned int depth);
5343 void MakeAuxDet(std::vector<const TGeoNode*>& path,
int depth);
5346 bool WireIDIntersectionCheck
5350 static bool PointWithinSegments(
5351 double A_start_x,
double A_start_y,
double A_end_x,
double A_end_y,
5352 double B_start_x,
double B_start_y,
double B_end_x,
double B_end_y,
5360 void UpdateAfterSorting();
5363 void ClearGeometry();
5367 static void CheckIndependentPlanesOnSameTPC
5368 (geo::PlaneID
const& pid1, geo::PlaneID
const& pid2,
const char* caller);
5377 double fPositionWiggle;
5415 { init(start_node); }
5419 {
return current_path.empty()?
nullptr: current_path.back().self; }
5425 std::vector<TGeoNode const*> get_path()
const;
5432 : self(new_self), sibling(new_sibling) {}
5438 void reach_deepest_descendant();
5440 void init(TGeoNode
const* start_node);
5456 if (
id)
id.isValid = HasCryostat(
id);
5461 unsigned int const nTPCsInCryo = NTPC(
id);
5462 if (++
id.TPC < nTPCsInCryo)
return bool(
id);
5465 return IncrementID(
id.asCryostatID());
5471 unsigned int const nPlanesInTPC = Nplanes(
id);
5472 if (++
id.
Plane < nPlanesInTPC)
return bool(
id);
5475 return IncrementID(
id.asTPCID());
5481 unsigned int const nWiresInPlane = Nwires(
id);
5482 if (++
id.Wire < nWiresInPlane)
return bool(
id);
5485 return IncrementID(
id.asPlaneID());
5489 unsigned int const nTPCsetsInCryo = NTPCsets(
id);
5490 if (++
id.TPCset < nTPCsetsInCryo)
5494 return IncrementID(
id.asCryostatID());
5500 unsigned int const nROPinTPC = NROPs(
id);
5501 if (++
id.ROP < nROPinTPC)
return bool(
id);
5504 return IncrementID(
id.asTPCsetID());
5513 template <
typename Po
int>
5523 template <
typename Stream>
5528 out <<
"Detector " << DetectorName() <<
" has " 5529 << Ncryostats() <<
" cryostats and " 5530 << NAuxDets() <<
" auxiliary detectors:";
5534 cryostat.PrintCryostatInfo
5535 (std::forward<Stream>(out), indent +
" ", cryostat.MaxVerbosity);
5537 const unsigned int nTPCs = cryostat.NTPC();
5538 for(
unsigned int t = 0; t < nTPCs; ++t) {
5541 out <<
"\n" << indent <<
" ";
5543 (std::forward<Stream>(out), indent +
" ", tpc.
MaxVerbosity);
5545 const unsigned int nPlanes = tpc.
Nplanes();
5546 for(
unsigned int p = 0; p < nPlanes; ++p) {
5548 const unsigned int nWires = plane.
Nwires();
5550 out <<
"\n" << indent <<
" ";
5552 (std::forward<Stream>(out), indent +
" ", plane.
MaxVerbosity);
5554 for(
unsigned int w = 0;
w < nWires; ++
w) {
5560 out <<
"\n" << indent <<
" " << wireID <<
" ";
5562 (std::forward<Stream>(out), indent +
" ", wire.
MaxVerbosity);
5567 unsigned int nOpDets = cryostat.NOpDet();
5568 for (
unsigned int iOpDet = 0; iOpDet < nOpDets; ++iOpDet) {
5570 out <<
"\n" << indent <<
" [OpDet #" << iOpDet <<
"] ";
5572 (std::forward<Stream>(out), indent +
" ", opDet.
MaxVerbosity);
5576 unsigned int const nAuxDets = NAuxDets();
5577 for (
unsigned int iDet = 0; iDet < nAuxDets; ++iDet) {
5580 out <<
"\n" << indent <<
"[#" << iDet <<
"] ";
5582 (std::forward<Stream>(out), indent +
" ", auxDet.
MaxVerbosity);
5585 switch (nSensitive) {
5589 out <<
"\n" << indent <<
" ";
5591 (std::forward<Stream>(out), indent +
" ", auxDetS.
MaxVerbosity);
5595 for (
unsigned int iSens = 0; iSens < nSensitive; ++iSens) {
5596 out <<
"\n" << indent <<
"[#" << iSens <<
"] ";
5600 (std::forward<Stream>(out), indent +
" ", auxDetS.
MaxVerbosity);
5617 inline geo::TPCID GeometryCore::GetBeginID<geo::TPCID, geo::CryostatID>
5618 (geo::CryostatID
const& id)
const 5619 {
return GetBeginTPCID(
id); }
5622 inline geo::TPCID GeometryCore::GetEndID<geo::TPCID, geo::CryostatID>
5623 (geo::CryostatID
const& id)
const 5624 {
return GetEndTPCID(
id); }
5627 inline geo::PlaneID GeometryCore::GetBeginID<geo::PlaneID, geo::CryostatID>
5628 (geo::CryostatID
const& id)
const 5629 {
return GetBeginPlaneID(
id); }
5632 inline geo::PlaneID GeometryCore::GetEndID<geo::PlaneID, geo::CryostatID>
5633 (geo::CryostatID
const& id)
const 5634 {
return GetEndPlaneID(
id); }
5642 template <
typename GEOID>
5644 {
return geometry() && geometry()->HasElement(localID()); }
5646 template <
typename GEOID>
5649 {
return geometry()->GetElementPtr(localID()); }
5651 template <
typename GEOID>
5653 { limit = geometry()->NSiblingElements(localID()); }
5655 template <
typename GEOID>
5657 { geometry()->GetBeginID(ID()); }
5659 template <
typename GEOID>
5661 { geometry()->GetEndID(ID()); }
5663 template <
typename GEOID>
5665 if (at_end())
return;
5666 if (++local_index() < limit)
return;
5667 localID().isValid =
false;
5674 template <
typename GEOID>
5676 return upper_iterator::geometry()
5677 && upper_iterator::geometry()->HasElement(localID());
5681 template <
typename GEOID>
5684 {
return upper_iterator::geometry()->GetElementPtr(localID()); }
5686 template <
typename GEOID>
5689 limit = upper_iterator::geometry()->NSiblingElements(localID());
5692 template <
typename GEOID>
5695 if (upper_iterator::at_end())
return;
5698 if (++local_index() < limit)
return;
5702 upper_iterator::next();
5714 template <
typename GEOID>
5716 return upper_iterator::geometry()
5717 && upper_iterator::geometry()->HasElement(localID());
5721 template <
typename GEOID>
5724 {
return upper_iterator::geometry()->GetElementPtr(localID()); }
5726 template <
typename GEOID>
5729 limit = upper_iterator::geometry()->NSiblingElements(localID());
5732 template <
typename GEOID>
5735 if (upper_iterator::at_end())
return;
5738 if (++local_index() < limit)
return;
5742 upper_iterator::next();
5754 template <
typename GEOID>
5756 return upper_iterator::geometry()
5757 && upper_iterator::geometry()->HasElement(localID());
5760 template <
typename GEOID>
5763 {
return upper_iterator::geometry()->GetElementPtr(localID()); }
5765 template <
typename GEOID>
5768 limit = upper_iterator::geometry()->NSiblingElements(localID());
5771 template <
typename GEOID>
5774 if (upper_iterator::at_end())
return;
5777 if (++local_index() < limit)
return;
5781 upper_iterator::next();
5793 template <
typename GEOIDITER>
5794 bool geo::details::operator==
5800 template <
typename GEOIDITER>
5801 bool geo::details::operator!=
5811 template <
typename GEOID>
5813 return upper_iterator::geometry()
5814 && upper_iterator::geometry()->HasElement(localID());
5818 template <
typename GEOID>
5821 limit = upper_iterator::geometry()->NSiblingElements(localID());
5824 template <
typename GEOID>
5827 if (upper_iterator::at_end())
return;
5830 if (++local_index() < limit)
return;
5834 upper_iterator::next();
5846 template <
typename GEOID>
5848 return upper_iterator::geometry()
5849 && upper_iterator::geometry()->HasElement(localID());
5853 template <
typename GEOID>
5856 limit = upper_iterator::geometry()->NSiblingElements(localID());
5859 template <
typename GEOID>
5862 if (upper_iterator::at_end())
return;
5865 if (++local_index() < limit)
return;
5869 upper_iterator::next();
5881 #endif // LARCOREALG_GEOMETRY_GEOMETRYCORE_H
unsigned int NearestWire(geo::Point_t const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Returns the index of wire closest to position in the specified TPC.
wire_iterator end_wire(geo::PlaneID const &id) const
Returns an iterator pointing after the last wire in specified plane.
wire_iterator begin_wire() const
Returns an iterator pointing to the first wire in the detector.
unsigned int NElements() const
Number of wires in this plane.
void GetStart(double *xyz) const
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
bool HasElement(readout::TPCsetID const &tpcsetid) const
Returns whether we have the specified TPC set.
geo::TPCID GetEndTPCID(geo::CryostatID const &id) const
GeoID GetEndID() const
Returns the (possibly invalid) ID after the last subelement of the detector.
bool HasPlane(unsigned int iplane) const
Returns whether a plane with index iplane is present in this TPC.
geo::PlaneDataContainer< T > makePlaneData() const
Returns a container with one entry per wire plane.
ROP_id_iterator begin_ROP_id() const
Returns an iterator pointing to the first ROP ID in the detector.
id_iterator_t const & id_iterator() const
Access to the base ID iterator.
typename id_iterator_t::LocalID_t LocalID_t
LocalIteratorBox< wire_iterator, geo::CryostatID,&GeometryCore::begin_wire,&GeometryCore::end_wire > IterateWires(geo::CryostatID const &cid) const
Enables ranged-for loops on all wires of specified cryostat.
Interface for a class providing readout channel mapping to geometry.
ID_t & local_index()
Returns the index (part if the ID) this iterator runs on (non-const)
void PrintWireInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this wire.
cryostat_id_iterator_base(geo::GeometryCore const *geom, UndefinedPos_t)
Constructor: does not set the current ID.
raw::ChannelID_t NearestChannel(geo::Point_t const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Returns the ID of the channel nearest to the specified position.
std::string GetCryostatVolumeName(unsigned int const cstat=0) const
Return the name of LAr TPC volume.
cryostat_id_iterator_base(geo::GeometryCore const *geom)
Constructor: points to begin.
readout::ROPID GetEndROPID(geo::CryostatID const &id) const
constexpr auto undefined_pos
wire_iterator end_wire() const
Returns an iterator pointing after the last wire in the detector.
void PrintTPCInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this TPC.
CryostatGeo const * GetElementPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
geo::GeometryCore const * geometry() const
Returns a pointer to the geometry.
IteratorBoxBase(iterator const &b, iterator const &e)
Constructor: initializes the begin and end iterators.
void set_begin()
Sets the iterator to the begin position.
CryostatGeo const & GetElement(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
static constexpr UndefinedPos_t undefined_pos
raw::ChannelID_t NearestChannel(const double worldLoc[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Returns the ID of the channel nearest to the specified position.
void GetBeginID(geo::WireID &id) const
Initializes the specified ID with the ID of the first wire.
TPC_id_iterator begin_TPC_id() const
Returns an iterator pointing to the first TPC ID in the detector.
GeometryData_t fGeoData
The detector description data.
unsigned int NSiblingElements(geo::CryostatID const &) const
Returns the number of cryostats in the detector.
wire_iterator begin_wire(geo::CryostatID const &id) const
Returns an iterator pointing to the first wire in specified cryostat.
std::vector< NodeInfo_t > current_path
which node, which sibling?
IteratorBox< wire_iterator,&GeometryCore::begin_wire,&GeometryCore::end_wire > IterateWires() const
Enables ranged-for loops on all wires of the detector.
Encapsulate the construction of a single cyostat.
bool HasElement(geo::PlaneID const &planeid) const
Returns whether we have the specified plane.
geo::WireID GetEndWireID(geo::TPCID const &id) const
double Length_t
Type used for coordinates and distances. They are measured in centimeters.
geo::Length_t WirePitch(unsigned int plane=0, unsigned int tpc=0, unsigned int cstat=0) const
Returns the distance between two consecutive wires.
IteratorBox< plane_iterator,&GeometryCore::begin_plane,&GeometryCore::end_plane > IteratePlanes() const
Enables ranged-for loops on all planes of the detector.
Encapsulate the geometry of the sensitive portion of an auxiliary detector.
GeoID GetBeginID() const
Returns the ID of the first element of the detector.
cryostat_id_iterator_base(geo::GeometryCore const *geom, EndPos_t)
Constructor: points to end.
Classes identifying readout-related concepts.
geo::WireID NearestWireID(const TVector3 &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Fills two arrays with the coordinates of the wire end points.
LocalIteratorBox< wire_iterator, geo::PlaneID,&GeometryCore::begin_wire,&GeometryCore::end_wire > IterateWires(geo::PlaneID const &tid) const
Enables ranged-for loops on all wires of specified wire plane.
LocalID_t & localID()
Returns the type of ID we act on (non-const version)
TPCset_id_iterator_base(geo::GeometryCore const *geom, EndPos_t)
Constructor: points to end.
void Print(Stream &&out, std::string indent=" ") const
Prints geometry information with maximum verbosity.
unsigned int ROPID_t
type for the ID number
static constexpr BeginPos_t begin_pos
WireGeo const & Wire(unsigned int iwire) const
wire_iterator end_wire(geo::CryostatID const &id) const
Returns an iterator pointing after the last wire in specified cryostat.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Base forward iterator browsing all wire IDs in the detector.
Base forward iterator browsing all TPC IDs in the detector.
Base forward iterator browsing all readout plane IDs in the detector.
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
void WireEndPoints(unsigned int cstat, unsigned int tpc, unsigned int plane, unsigned int wire, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
unsigned int Nplanes() const
Number of planes in this tpc.
LocalID_t & localID()
Returns the type of ID we act on (non-const version).
LocalIteratorBox< wire_id_iterator, geo::CryostatID,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id > IterateWireIDs(geo::CryostatID const &cid) const
Enables ranged-for loops on all wire IDs of specified cryostat.
LocalID_t const & localID() const
Returns the type of ID we act on.
unsigned int CryostatID_t
Type for the ID number.
raw::ChannelID_t NearestChannel(const TVector3 &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Returns the ID of the channel nearest to the specified position.
unsigned int NSiblingElements(geo::PlaneID const &planeid) const
Returns the total number of wire planes in the specified TPC.
std::set< geo::View_t > const & Views() const
Returns a list of possible views in the detector.
details::cryostat_id_iterator_base< geo::CryostatID > cryostat_id_iterator
Forward iterator browsing all cryostats in the detector.
LocalIteratorBox(GeometryCore const *geom, GeoID const &ID)
wire_id_iterator begin_wire_id(geo::TPCID const &id) const
Returns an iterator pointing to the first wire ID in specified TPC.
AuxDetList_t auxDets
The auxiliary detectors.
cryostat_iterator end_cryostat() const
Returns an iterator pointing after the last cryostat.
wire_id_iterator begin_wire_id(geo::PlaneID const &id) const
Returns an iterator pointing to the first wire ID in specified plane.
plane_iterator end_plane() const
Returns an iterator pointing after the last plane in the detector.
The data type to uniquely identify a Plane.
Geometry information for a single TPC.
wire_id_iterator begin_wire_id(geo::CryostatID const &id) const
Returns an iterator pointing to the first wire ID in specified cryostat.
details::ROP_id_iterator_base< readout::ROPID > ROP_id_iterator
Forward iterator browsing all readout planes in the detector.
TPC_iterator end_TPC(geo::CryostatID const &cid) const
Returns an iterator pointing after the last TPC in the detector.
TPCGeo const & GetElement(geo::TPCID const &tpcid) const
Returns the specified TPC.
void next()
Skips to the next wire.
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
Class identifying a set of TPC sharing readout channels.
geo::PlaneID GetBeginPlaneID(geo::CryostatID const &id) const
Returns the ID of the first plane of the specified cryostat.
Point const & start() const
NodeInfo_t(Node_t new_self, int new_sibling)
static constexpr EndPos_t end_pos
LocalID_t & localID()
Returns the type of ID we act on (non-const version).
TPCset_id_iterator_base(geo::GeometryCore const *geom)
Constructor: points to begin.
std::vector< geo::CryostatGeo > CryostatList_t
Type of list of cryostats.
geo::WireID GetBeginWireID(geo::TPCID const &id) const
Returns the ID of the first wire of the specified TPC.
double fSurfaceY
The point where air meets earth for this detector.
GeoID_t & ID()
Returns the actual type of ID we store.
plane_iterator end_plane(geo::TPCID const &ID) const
Returns an iterator pointing after the last plane in the specified TPC.
ID_t const & local_index() const
Returns the index (part if the ID) this iterator runs on.
wire_iterator end_wire(geo::TPCID const &id) const
Returns an iterator pointing after the last wire in specified TPC.
CryostatID_t Cryostat
Index of cryostat.
TPC_iterator begin_TPC(geo::CryostatID const &cid) const
Returns an iterator pointing to the first TPC in the detector.
ROP_id_iterator end_ROP_id() const
Returns an iterator pointing after the last ROP ID in the detector.
geo::WireID NearestWireID(std::vector< double > const &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Fills two arrays with the coordinates of the wire end points.
void next()
Skips to the next TPC.
enum geo::coordinates Coord_t
Enumerate the possible plane projections.
TPCset_id_iterator end_TPCset_id() const
Returns an iterator pointing after the last TPC set ID in the detector.
geo::TPCDataContainer< T > makeTPCData(T const &defValue) const
Returns a container with one entry per TPC.
geo::TPCDataContainer< T > makeTPCData() const
Returns a container with one entry per TPC.
Point const & end() const
geo::WireID GetEndWireID(geo::CryostatID const &id) const
CryostatList_t cryostats
The detector cryostats.
geo::WireID GetEndWireID(geo::PlaneID const &id) const
geo::Length_t CryostatLength(unsigned int cstat=0) const
Returns the length of the cryostat (z direction)
LocalID_t & localID()
Returns the type of ID we act on (non-const version)
TPCset_id_iterator begin_TPCset_id(geo::CryostatID const &cid) const
Container with one element per geometry wire plane.
void GetEndID(geo::WireID &id) const
Initializes the specified ID with the invalid ID after the last wire.
Geometry information for a single cryostat.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
TPCGeo const & TPC(geo::TPCID const &tpcid) const
Returns the specified TPC.
void set_local_limits()
Sets limit to the past-the-end TPC set number of current croystat.
typename id_iterator_t::EndPos_t EndPos_t
double WireAngleToVertical(geo::View_t view, int TPC=0, int Cryo=0) const
Returns the angle of the wires in the specified view from vertical.
ElementPtr_t get() const
Returns a pointer to the geometry element, or nullptr if invalid.
TPC_id_iterator_base()
Default constructor; effect not defined: assign to it before using!
typename LocalID_t::CryostatID_t ID_t
void GetBeginID(geo::TPCID &id) const
Initializes the specified ID with the ID of the first TPC.
TPC_id_iterator begin_TPC_id(geo::CryostatID const &cid) const
geometry_iterator_base(geo::GeometryCore const *geom)
Constructor: associates with the specified geometry.
wire_id_iterator_base(geo::GeometryCore const *geom, EndPos_t)
Constructor: points to end.
std::vector< AuxDetGeo * > AuxDetList_t
Type of list of auxiliary detectors.
unsigned int NearestWire(const TVector3 &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Returns the index of wire closest to position in the specified TPC.
wire_id_iterator end_wire_id(geo::TPCID const &id) const
Returns an iterator pointing after the last wire ID in specified TPC.
void GetBeginID(readout::TPCsetID &id) const
Initializes the specified ID with the ID of the first TPC set.
PlaneGeo const * GetElementPtr(geo::PlaneID const &planeid) const
Returns the specified plane.
ID_t & local_index()
Returns the index (part if the ID) this iterator runs on (non-const).
TVector3 DefaultVector_t
Default template argument.
Class for approximate comparisons.
IteratorBox< TPC_id_iterator,&GeometryCore::begin_TPC_id,&GeometryCore::end_TPC_id > IterateTPCIDs() const
Enables ranged-for loops on all TPC IDs of the detector.
details::geometry_iterator_types::EndPos_t EndPos_t
void next()
Skips to the next TPC set.
unsigned int NSiblingElements(readout::TPCsetID const &tpcsetid) const
Returns the total number of TPC sets in the specified cryostat.
bool IntersectionPoint(unsigned int wire1, unsigned int wire2, unsigned int plane1, unsigned int plane2, unsigned int cstat, unsigned int tpc, double &y, double &z) const
Returns the intersection point of two wires.
WireGeo const * GetElementPtr(geo::WireID const &wireid) const
Returns the specified wire.
unsigned int NElements() const
Returns the number of cryostats in the detector.
void GetEndID(geo::TPCID &id) const
Initializes the specified ID with the invalid ID after the last TPC.
wire_id_iterator_base(geo::GeometryCore const *geom, BeginPos_t const)
Constructor: points to begin.
std::string ROOTFile() const
Returns the full directory path to the geometry file source.
wire_id_iterator_base(geo::GeometryCore const *geom, UndefinedPos_t)
Constructor: position undefined (meaning undefined local limits too)
bool IncrementID(geo::CryostatID &id) const
details::plane_id_iterator_base< geo::PlaneID > plane_id_iterator
Forward iterator browsing all planes in the detector.
PlaneGeo const & Plane(geo::PlaneID const &planeid) const
Returns the specified wire.
TPCGeo const & PositionToTPC(double const point[3]) const
Returns the TPC at specified location.
LocalIteratorBox< wire_id_iterator, geo::TPCID,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id > IterateWireIDs(geo::TPCID const &tid) const
Enables ranged-for loops on all wire IDs of specified TPC.
readout::TPCsetID GetEndTPCsetID(geo::CryostatID const &id) const
details::geometry_iterator_types::BeginPos_t BeginPos_t
unsigned int NSiblingElements(geo::TPCID const &tpcid) const
Returns the total number of TPCs in the specified cryostat.
raw::ChannelID_t NearestChannel(std::vector< double > const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Returns the ID of the channel nearest to the specified position.
TPC_iterator begin_TPC() const
Returns an iterator pointing to the first TPC in the detector.
LocalIteratorBox< ROP_id_iterator, readout::TPCsetID,&GeometryCore::begin_ROP_id,&GeometryCore::end_ROP_id > IterateROPIDs(readout::TPCsetID const &sid) const
Enables ranged-for loops on all readout plane IDs of the specified TPC set.
void GetBeginID(readout::ROPID &id) const
Initializes the specified ID with the ID of the first readout plane.
static lar::util::RealComparisons< geo::Length_t > coordIs
Value of tolerance for equality comparisons.
geo::CryostatID CryostatID
IteratorBox< plane_id_iterator,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id > IteratePlaneIDs() const
Enables ranged-for loops on all plane IDs of the detector.
geo::PlaneID GetBeginPlaneID(geo::TPCID const &id) const
Returns the ID of the first plane of the specified TPC.
TPC_id_iterator end_TPC_id(geo::CryostatID const &cid) const
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
CryostatList_t const & Cryostats() const
Return the internal cryostat list.
geo::CryostatGeo const * ElementPtr_t
Interface to algorithm class for sorting geo::XXXGeo objects.
details::geometry_element_iterator< wire_id_iterator > wire_iterator
Forward iterator browsing all wires in the detector.
ROP_id_iterator begin_ROP_id(readout::TPCsetID const &ID) const
std::string GDMLFile() const
Returns the full directory path to the GDML file source.
details::geometry_element_iterator< plane_id_iterator > plane_iterator
Forward iterator browsing all planes in the detector.
plane_id_iterator_base(geo::GeometryCore const *geom, UndefinedPos_t)
Constructor: position undefined (meaning undefined local limits too)
bool HasElement(readout::ROPID const &ropid) const
cryostat_id_iterator_base()
Default constructor; effect not defined: assign to it before using!
TVector3 DefaultPoint_t
Default template argument.
AuxDetList_t const & AuxDets() const
Return the interfal auxiliary detectors list.
Containers to hold one datum per TPC or plane.
unsigned int PlaneID_t
Type for the ID number.
TPC_id_iterator_base(geo::GeometryCore const *geom, UndefinedPos_t)
Constructor: position undefined (meaning undefined local limits too)
geo::WireID GetBeginWireID(geo::PlaneID const &id) const
Returns the ID of the first wire of the specified wire plane.
IteratorBox< wire_id_iterator,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id > IterateWireIDs() const
Enables ranged-for loops on all wire IDs of the detector.
LocalIteratorBox< plane_id_iterator, geo::CryostatID,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id > IteratePlaneIDs(geo::CryostatID const &cid) const
Enables ranged-for loops on all plane IDs of the specified cryostat.
void set_end()
Sets the iterator to the end position.
Container with one element per geometry TPC.
Base class for geometry iterators, containing some type definitions.
PlaneGeo const * PlanePtr(geo::PlaneID const &planeid) const
Returns the specified plane.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
LocalIteratorBox< TPCset_id_iterator, geo::CryostatID,&GeometryCore::begin_TPCset_id,&GeometryCore::end_TPCset_id > IterateTPCsetIDs(geo::CryostatID const &cid) const
Enables ranged-for loops on all TPC set IDs of the specified cryostat.
plane_id_iterator end_plane_id(geo::TPCID const &ID) const
Iterator to navigate through all the nodes.
bool HasElement(geo::CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
void GetEndID(readout::TPCsetID &id) const
Initializes the specified ID with the invalid ID after the last TPC set.
std::set< geo::View_t > allViews
All views in the detector.
readout::ROPID GetBeginROPID(readout::TPCsetID const &id) const
Returns the ID of the first readout plane of the specified TPC set.
readout::TPCsetID GetBeginTPCsetID(geo::CryostatID const &id) const
Returns the ID of the first TPC set in the specified cryostat.
GeometryData_t::CryostatList_t CryostatList_t
Type of list of cryostats.
LocalID_t & localID()
Returns the type of ID we act on.
geometry_iterator_base()
Default constructor; do not use a default-constructed iterator as-is!
details::TPCset_id_iterator_base< readout::TPCsetID > TPCset_id_iterator
Forward iterator browsing all TPC sets in the detector.
void GetBeginID(geo::CryostatID &id) const
Initializes the specified ID with the ID of the first cryostat.
void GetBeginID(geo::PlaneID &id) const
Initializes the specified ID with the ID of the first plane.
LocalID_t const & localID() const
Returns the type of ID we act on.
LocalIteratorBox< wire_id_iterator, geo::PlaneID,&GeometryCore::begin_wire_id,&GeometryCore::end_wire_id > IterateWireIDs(geo::PlaneID const &pid) const
Enables ranged-for loops on all wire IDs of specified wire plane.
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
ROOTGeoNodeForwardIterator(TGeoNode const *start_node)
Constructor: start from this node.
Definitions of geometry vector data types.
ElementPtr_t get() const
Returns a pointer to plane, or nullptr if invalid.
plane_iterator begin_plane(geo::CryostatID const &ID) const
geo::Length_t DetLength(unsigned int tpc=0, unsigned int cstat=0) const
Returns the length of the active volume of the specified TPC.
typename std::remove_pointer< ElementPtr_t >::type Element_t
Geometry class pointed by the iterator.
unsigned int TPCID_t
Type for the ID number.
typename id_iterator_t::GeoID_t GeoID_t
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
IteratorBox< TPC_iterator,&GeometryCore::begin_TPC,&GeometryCore::end_TPC > IterateTPCs() const
Enables ranged-for loops on all TPCs of the detector.
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
LocalID_t const & localID() const
Returns the type of ID we act on.
Base forward iterator browsing all cryostat IDs in the detector.
ROP_id_iterator_base(geo::GeometryCore const *geom, BeginPos_t const)
Constructor: points to begin.
plane_id_iterator_base(geo::GeometryCore const *geom, BeginPos_t const)
Constructor: points to begin.
wire_iterator begin_wire(geo::PlaneID const &id) const
Returns an iterator pointing to the first wire in specified plane.
details::geometry_element_iterator< TPC_id_iterator > TPC_iterator
Forward iterator browsing all TPCs in the detector.
void set_local_limits()
Sets the limit member to the past-the-end cryostat number.
std::string indent(std::size_t const i)
geo::PlaneID GetEndPlaneID(geo::TPCID const &id) const
std::shared_ptr< const geo::ChannelMapAlg > fChannelMapAlg
Object containing the channel to wire mapping.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
unsigned int NElements() const
Alias for NTPC().
void PrintOpDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this optical detector.
TPCset_id_iterator begin_TPCset_id() const
Returns an iterator pointing to the first TPC set ID in the detector.
Utilities to extend the interface of geometry vectors.
wire_id_iterator_base()
Default constructor; effect not defined: assign to it before using!
geometry_element_iterator(id_iterator_t &&iter)
Constructor: points to the same element as the specified ID iterator.
TPCGeo const * TPCPtr(unsigned int itpc) const
Returns the TPC number itpc from this cryostat.
TPC_id_iterator_base(geo::GeometryCore const *geom, EndPos_t)
Constructor: points to end.
iterator e
Begin and end iterators.
Point GetTPCFrontFaceCenter(geo::TPCID const &tpcid) const
Returns the center of side of the detector facing the beam.
details::wire_id_iterator_base< geo::WireID > wire_id_iterator
Forward iterator browsing all wires in the detector.
bool HasElement(geo::TPCID const &tpcid) const
Returns whether we have the specified TPC.
ID_t const & local_index() const
Returns the index (part if the ID) this iterator runs on.
TPCGeo const * TPCPtr(geo::TPCID const &tpcid) const
Returns the specified TPC.
LocalIteratorBox< plane_id_iterator, geo::TPCID,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id > IteratePlaneIDs(geo::TPCID const &tid) const
Enables ranged-for loops on all plane IDs of the specified TPC.
size_t NSensitiveVolume() const
geo::Length_t SurfaceY() const
The position of the detector respect to earth surface.
TPC_id_iterator_base(geo::GeometryCore const *geom)
Constructor: points to begin.
ROP_id_iterator_base(geo::GeometryCore const *geom, EndPos_t)
Constructor: points to end.
wire_id_iterator end_wire_id() const
Returns an iterator pointing after the last wire ID in the detector.
geo::WireID NearestWireID(geo::Point_t const &point, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Fills two arrays with the coordinates of the wire end points.
The data type to uniquely identify a TPC.
Description of geometry of one entire detector.
void Print(G4Element &ele)
plane_iterator end_plane(geo::CryostatID const &ID) const
void next()
Skips to the next cryostat.
Definition of data types for geometry description.
LocalIteratorBox< plane_iterator, geo::CryostatID,&GeometryCore::begin_plane,&GeometryCore::end_plane > IteratePlanes(geo::CryostatID const &cid) const
Enables ranged-for loops on all planes of the specified cryostat.
ROP_id_iterator_base(geo::GeometryCore const *geom)
Constructor: points to begin.
TPC_id_iterator_base(geo::GeometryCore const *geom, BeginPos_t const)
Constructor: points to begin.
LocalIteratorBox< TPC_id_iterator, geo::CryostatID,&GeometryCore::begin_TPC_id,&GeometryCore::end_TPC_id > IterateTPCIDs(geo::CryostatID const &cid) const
Enables ranged-for loops on all TPC IDs of the specified cryostat.
double DefaultWiggle() const
Returns the tolerance used in looking for positions.
wire_iterator begin_wire(geo::TPCID const &id) const
Returns an iterator pointing to the first wire in specified TPC.
TPC_id_iterator end_TPC_id() const
Returns an iterator pointing after the last TPC ID in the detector.
IteratorBox(GeometryCore const *geom)
Class identifying a set of planes sharing readout channels.
LocalIteratorBox< wire_iterator, geo::TPCID,&GeometryCore::begin_wire,&GeometryCore::end_wire > IterateWires(geo::TPCID const &tid) const
Enables ranged-for loops on all wires of specified TPC.
void PrintAuxDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=0) const
Prints information about this auxiliary sensitive detector.
Provides a base class aware of world box coordinates.
typename id_iterator_t::BeginPos_t BeginPos_t
ElementPtr_t get() const
Returns a pointer to TPC, or nullptr if invalid.
wire_id_iterator end_wire_id(geo::CryostatID const &id) const
plane_id_iterator_base(geo::GeometryCore const *geom, EndPos_t)
Constructor: points to end.
unsigned int NElements(geo::CryostatID const &cryoid) const
Returns the total number of TPCs in the specified cryostat.
double ThirdPlaneSlope(geo::PlaneID::PlaneID_t plane1, double slope1, geo::PlaneID::PlaneID_t plane2, double slope2, geo::TPCID const &tpcid) const
Returns the slope on the third plane, given it in the other two.
Encapsulate the geometry of an auxiliary detector.
LocalID_t const & localID() const
Returns the type of ID we act on.
Encapsulate the geometry of a wire.
GeometryData_t::AuxDetList_t AuxDetList_t
Type of list of auxiliary detectors.
plane_iterator begin_plane(geo::TPCID const &ID) const
Returns an iterator pointing to the first plane in the specified TPC.
ID_t const & local_index() const
Returns the index (part if the ID) this iterator runs on.
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
CryostatGeo const & PositionToCryostat(double const point[3]) const
Returns the cryostat at specified location.
void GetEndID(geo::PlaneID &id) const
Initializes the specified ID with the invalid ID after the last plane.
LocalID_t const & localID() const
Returns the type of ID we act on.
LocalIteratorBox< plane_iterator, geo::TPCID,&GeometryCore::begin_plane,&GeometryCore::end_plane > IteratePlanes(geo::TPCID const &tid) const
Enables ranged-for loops on all planes of the specified TPC.
Encapsulate the geometry of an optical detector.
IteratorBox< cryostat_iterator,&GeometryCore::begin_cryostat,&GeometryCore::end_cryostat > IterateCryostats() const
Enables ranged-for loops on all cryostats of the detector.
std::string fGDMLfile
path to geometry file used for Geant4 simulation
void next()
Skips to the next plane.
bool HasTPC(geo::TPCID const &tpcid) const
Returns whether we have the specified TPC.
cryostat_iterator begin_cryostat() const
Returns an iterator pointing to the first cryostat.
unsigned int WireID_t
Type for the ID number.
ROP_id_iterator begin_ROP_id(geo::CryostatID const &ID) const
unsigned int Nwires(geo::PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
details::geometry_iterator_types::UndefinedPos_t UndefinedPos_t
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
WireGeo const & GetElement(geo::WireID const &wireid) const
Returns the specified wire.
unsigned int NSiblingElements(geo::WireID const &wireid) const
Returns the total number of wires in the specified plane.
void set_local_limits()
Sets limit to the past-the-end TPC number of current croystat.
plane_id_iterator_base()
Default constructor; effect not defined: assign to it before using!
LocalIteratorBox< ROP_id_iterator, geo::CryostatID,&GeometryCore::begin_ROP_id,&GeometryCore::end_ROP_id > IterateROPIDs(geo::CryostatID const &cid) const
Enables ranged-for loops on all readout plane IDs of the specified cryostat.
bool operator!=(geometry_element_iterator< GEOIDITER > const &iter, GEOIDITER const &id_iter)
Comparison operator: geometry ID and element point to different IDs.
plane_id_iterator begin_plane_id(geo::TPCID const &ID) const
geo::WireID GetBeginWireID(geo::CryostatID const &id) const
Returns the ID of the first wire in the specified cryostat.
std::string VolumeName(TVector3 const &point) const
Returns a string with the name of the detector, as configured.
std::string value(boost::any const &)
Base forward iterator browsing all plane IDs in the detector.
double ThirdPlaneSlope(unsigned int plane1, double slope1, unsigned int plane2, double slope2, unsigned int tpc, unsigned int cstat) const
Returns the slope on the third plane, given it in the other two.
ID_t & local_index()
Returns the index (part if the ID) this iterator runs on (non-const).
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintAuxDetInfo().
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
unsigned int NearestWire(std::vector< double > const &worldLoc, unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Returns the index of wire closest to position in the specified TPC.
ID_t const & local_index() const
Returns the index (part if the ID) this iterator runs on.
Encapsulate the construction of a single detector plane.
IteratorBox< ROP_id_iterator,&GeometryCore::begin_ROP_id,&GeometryCore::end_ROP_id > IterateROPIDs() const
Enables ranged-for loops on all readout plane IDs of the detector.
readout::ROPID GetEndROPID(readout::TPCsetID const &id) const
ROP_id_iterator end_ROP_id(readout::TPCsetID const &ID) const
bool HasWire(unsigned int iwire) const
Returns whether a wire with index iwire is present in this plane.
void PrintPlaneInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this plane.
PlaneGeo const * PlanePtr(unsigned int iplane) const
Returns the plane number iplane from this TPC.
geometry_element_iterator(id_iterator_t const &iter)
Constructor: points to the same element as the specified ID iterator.
ElementPtr_t get() const
Returns a pointer to cryostat, or nullptr if invalid.
LocalID_t const & ID() const
Returns the ID of the pointed geometry element.
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
void GetEnd(double *xyz) const
plane_id_iterator end_plane_id() const
Returns an iterator pointing after the last plane ID in the detector.
geo::TPCID FindTPCAtPosition(TVector3 const &point) const
Returns the ID of the TPC at specified location.
ElementPtr_t get() const
Returns a pointer to wire, or nullptr if invalid.
void GetEndID(readout::ROPID &id) const
Initializes the specified ID with the invalid ID after the last ROP.
IteratorBox< TPCset_id_iterator,&GeometryCore::begin_TPCset_id,&GeometryCore::end_TPCset_id > IterateTPCsetIDs() const
Enables ranged-for loops on all TPC set IDs of the detector.
geo::ChannelMapAlg const * ChannelMap() const
Returns the object handling the channel map.
void next()
Skips to the next readout plane.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintOpDetInfo().
geo::PlaneID const & ID() const
Returns the identifier of this plane.
unsigned int NElements(geo::TPCID const &tpcid) const
Returns the total number of wire planes in the specified TPC.
cryostat_id_iterator begin_cryostat_id() const
Returns an iterator pointing to the first cryostat ID.
IteratorBox< cryostat_id_iterator,&GeometryCore::begin_cryostat_id,&GeometryCore::end_cryostat_id > IterateCryostatIDs() const
Enables ranged-for loops on all cryostat IDs of the detector.
WireGeo const * WirePtr(unsigned int iwire) const
Returns the wire number iwire from this plane.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintAuxDetInfo().
geo::TPCID GetBeginTPCID(geo::CryostatID const &id) const
Returns the ID of the first TPC in the specified cryostat.
unsigned int Nwires() const
Number of wires in this plane.
unsigned int NElements(geo::PlaneID const &planeid) const
Returns the total number of wires in the specified plane.
ID_t & local_index()
Returns the index (part if the ID) this iterator runs on (non-const)
unsigned int NElements() const
Number of planes in this tpc.
ID_t & local_index()
Returns the index (part if the ID) this iterator runs on (non-const)
Base class for geometry iterators (note: this is not an iterator)
Simple class with two points (a pair with aliases).
void set_local_limits()
Sets limit to the past-the-end wire number of current plane.
ID_t & local_index()
Returns the index (part if the ID) this iterator runs on.
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
std::string fDetectorName
Name of the detector.
details::TPC_id_iterator_base< geo::TPCID > TPC_id_iterator
Forward iterator browsing all TPCs in the detector.
TPCset_id_iterator_base(geo::GeometryCore const *geom, UndefinedPos_t)
Constructor: position undefined (meaning undefined local limits too).
CryostatGeo const & Cryostat(unsigned int const cstat=0) const
Returns the specified cryostat.
typename id_iterator_t::UndefinedPos_t UndefinedPos_t
id_iterator_t id_iter
iterator performing the job
TPCset_id_iterator_base()
Default constructor; effect not defined: assign to it before using!
raw::ChannelID_t PlaneWireToChannel(unsigned int const plane, unsigned int const wire, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the number of TPC readout channels in the detector.
bool HasPlane(geo::PlaneID const &planeid) const
Returns whether we have the specified plane.
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintWireInfo().
TPCGeo const * GetElementPtr(geo::TPCID const &tpcid) const
Returns the specified TPC.
plane_id_iterator begin_plane_id() const
Returns an iterator pointing to the first plane ID in the detector.
LocalID_t const & localID() const
Returns the type of ID we act on.
Structures to distinguish the constructors.
bool HasElement(geo::WireID const &wireid) const
Returns whether we have the specified wire.
LocalIteratorBox< TPC_iterator, geo::CryostatID,&GeometryCore::begin_TPC,&GeometryCore::end_TPC > IterateTPCs(geo::CryostatID const &cid) const
Enables ranged-for loops on all TPCs of the specified cryostat.
wire_id_iterator begin_wire_id() const
Returns an iterator pointing to the first wire ID in the detector.
unsigned int Nplanes(geo::TPCID const &tpcid) const
Returns the total number of planes in the specified TPC.
void set_local_limits()
Sets limit to the past-the-end plane number of current TPC.
id_iterator_t & id_iterator()
Access to the base ID iterator.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
TPCset_id_iterator_base(geo::GeometryCore const *geom, BeginPos_t const)
Constructor: points to begin.
bool HasTPC(unsigned int itpc) const
Returns whether a TPC with index itpc is present in this cryostat.
std::string MaterialName(TVector3 const &point) const
Name of the deepest material containing the point xyz.
Interface to algorithm class for a specific detector channel mapping.
Data in the geometry description.
wire_id_iterator_base(geo::GeometryCore const *geom)
Constructor: points to begin.
details::geometry_element_iterator< cryostat_id_iterator > cryostat_iterator
Forward iterator browsing all cryostats in the detector.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
TPCset_id_iterator end_TPCset_id(geo::CryostatID const &cid) const
GeoID GetNextID(GeoID const &id) const
Returns the ID next to the specified one.
Forward iterator browsing all geometry elements in the detector.
recob::tracking::Plane Plane
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
static constexpr unsigned int MaxVerbosity
Maximum value for print verbosity.
QuadExpr operator*(double v, const QuadExpr &e)
unsigned int NSiblingElements(readout::ROPID const &ropid) const
Returns the total number of ROP in the specified TPC set.
GENVECTOR_CONSTEXPR::geo::Point_t makePointFromCoords(Coords &&coords)
Creates a geo::Point_t from its coordinates (see makeFromCoords()).
plane_id_iterator end_plane_id(geo::CryostatID const &ID) const
static constexpr unsigned int MaxVerbosity
Maximum verbosity supported by PrintTPCInfo().
wire_id_iterator end_wire_id(geo::PlaneID const &id) const
Returns an iterator pointing after the last wire ID in specified plane.
Namespace collecting geometry-related classes utilities.
geometry_element_iterator(geo::GeometryCore const *geom)
Constructor: points to begin.
Base forward iterator browsing all TPC set IDs in the detector.
geo::Length_t CryostatHalfWidth(unsigned int cstat=0) const
Returns the half width of the cryostat (x direction)
plane_iterator begin_plane() const
Returns an iterator pointing to the first plane in the detector.
ROP_id_iterator end_ROP_id(geo::CryostatID const &ID) const
std::string fROOTfile
path to geometry file for geometry in GeometryCore
unsigned int NearestWire(const double worldLoc[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Returns the index of wire closest to position in the specified TPC.
geo::WireID NearestWireID(const double point[3], unsigned int const PlaneNo, unsigned int const TPCNo=0, unsigned int const cstat=0) const
Fills two arrays with the coordinates of the wire end points.
unsigned int NTPC(geo::CryostatID const &cryoid) const
Returns the total number of TPCs in the specified cryostat.
plane_id_iterator begin_plane_id(geo::CryostatID const &ID) const
readout::ROPID GetBeginROPID(geo::CryostatID const &id) const
Returns the ID of the first readout plane of the specified cryostat.
bool operator==(geometry_element_iterator< GEOIDITER > const &iter, GEOIDITER const &id_iter)
Comparison operator: geometry ID and element point to the same ID.
void SetDetectorName(std::string new_name)
Sets the detector name.
typename id_iterator_t::ElementPtr_t ElementPtr_t
void PrintAuxDetInfo(Stream &&out, std::string indent="", unsigned int verbosity=1) const
Prints information about this auxiliary detector.
CryostatGeo const * CryostatPtr(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
bool HasCryostat(geo::CryostatID const &cryoid) const
Returns whether we have the specified cryostat.
geo::Length_t WireCoordinate(double YPos, double ZPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const
Returns the index of the nearest wire to the specified position.
plane_id_iterator_base(geo::GeometryCore const *geom)
Constructor: points to begin.
LocalID_t & localID()
Returns the type of ID we act on (non-const version)
cet::coded_exception< error, detail::translate > exception
GeoID_t id
ID of the current cryostat.
GEOID GeoID_t
type of the actual ID stored in the iterator
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
geo::Length_t CryostatHalfHeight(unsigned int cstat=0) const
Returns the height of the cryostat (y direction)
TPC_iterator end_TPC() const
Returns an iterator pointing after the last TPC in the detector.
ROP_id_iterator_base(geo::GeometryCore const *geom, UndefinedPos_t)
Constructor: position undefined (meaning undefined local limits too).
Encapsulate the construction of a single detector plane.
The data type to uniquely identify a cryostat.
geo::PlaneID GetEndPlaneID(geo::CryostatID const &id) const
unsigned short TPCsetID_t
type for the ID number
bool HasWire(geo::WireID const &wireid) const
Returns whether we have the specified wire.
void GetEndID(geo::CryostatID &id) const
Initializes the specified ID with the invalid ID after the last cryostat.
geo::PlaneDataContainer< T > makePlaneData(T const &defValue) const
Returns a container with one entry per wire plane.
bool at_end() const
Returns whether this iterator has reached the end.
WireGeo const & WireIDToWireGeo(geo::WireID const &wireid) const
Returns the specified wire.
ID_t const & local_index() const
Returns the index (part if the ID) this iterator runs on.
WireGeo const * WirePtr(geo::WireID const &wireid) const
Returns the specified wire.
PlaneGeo const & GetElement(geo::PlaneID const &planeid) const
Returns the specified wire.
cryostat_id_iterator end_cryostat_id() const
Returns an iterator pointing after the last cryostat ID.