1 #ifndef GEO_CHANNELMAPALG_H 2 #define GEO_CHANNELMAPALG_H 69 virtual unsigned int Nchannels()
const = 0;
139 virtual std::set<PlaneID>
const&
PlaneIDs()
const = 0;
174 virtual unsigned int NOpChannels(
unsigned int NOpDets)
const;
190 virtual unsigned int MaxOpChannel(
unsigned int NOpDets)
const;
222 virtual bool IsValidOpChannel(
unsigned int opChannel,
unsigned int NOpDets)
const;
233 virtual unsigned int OpChannel(
unsigned int detNum,
unsigned int hwchannel = 0)
const;
308 std::vector<AuxDetGeo>
const& auxDets,
309 double tolerance = 0)
const;
319 std::vector<AuxDetGeo>
const& auxDets,
320 double tolerance = 0)
const;
334 std::string
const& detName,
335 uint32_t
const& channel)
const;
345 std::vector<AuxDetGeo>
const& auxDets,
346 std::string
const& detName,
347 uint32_t
const& channel)
const;
401 virtual unsigned int MaxROPs()
const = 0;
479 template <
typename T>
483 template <
typename T>
491 std::map<std::string, size_t>
493 std::map<size_t, std::vector<size_t>>
507 template <
typename T>
510 return map[
id.Cryostat][
id.TPC];
514 template <
typename T>
517 return map[
id.Cryostat].size();
521 template <
typename T>
525 return id.Cryostat < map.size();
527 template <
typename T>
530 return isValidElement(map,
id.asCryostatID()) && (
id.TPC < map[
id.Cryostat].size());
535 template <
typename T>
538 return map[
id.Cryostat][
id.TPC][
id.Plane];
542 template <
typename T>
545 return map[
id.Cryostat][
id.TPC].size();
549 template <
typename T>
553 return id.Cryostat < map.size();
555 template <
typename T>
558 return isValidElement(map,
id.asCryostatID()) && (
id.TPC < map[
id.Cryostat].size());
560 template <
typename T>
563 return isValidElement(map,
id.asTPCID()) && (
id.Plane < AccessSize(map,
id.asTPCID()));
568 template <
typename T>
571 if (
id.Cryostat >= map.size())
return nullptr;
572 auto const& cryo_map = map[
id.Cryostat];
573 if (
id.TPC >= cryo_map.size())
return nullptr;
574 auto const& TPC_map = cryo_map[
id.TPC];
575 if (
id.
Plane >= TPC_map.size())
return nullptr;
576 auto const& plane_map = TPC_map[
id.Plane];
583 #endif // GEO_CHANNELMAPALG_H Interface for a class providing readout channel mapping to geometry.
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.
virtual SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const =0
Return the signal type of the specified channel.
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 double WireCoordinate(double YPos, double ZPos, PlaneID const &planeID) const =0
Returns the index of the wire nearest to the specified position.
virtual std::vector< TPCID > ROPtoTPCs(readout::ROPID const &ropid) const =0
Returns a list of ID of TPCs the specified ROP spans.
Classes identifying readout-related concepts.
virtual unsigned int Nchannels() const =0
Returns the total number of channels present (not necessarily contiguous)
virtual std::set< PlaneID > const & PlaneIDs() const =0
Returns a list of the plane IDs in the whole detector.
virtual readout::TPCsetID TPCtoTPCset(TPCID const &tpcid) const =0
Returns the ID of the TPC set tpcid belongs to.
T const & AccessElement(TPCInfoMap_t< T > const &map, TPCID const &id) const
Returns the specified element of the TPC map.
SigType_t SignalTypeForROPID(readout::ROPID const &ropid) const
Return the signal type on the specified readout plane.
virtual bool HasROP(readout::ROPID const &ropid) const =0
SigType_t SignalTypeForChannel(raw::ChannelID_t const channel) const
Return the signal type of the specified channel.
Simple data structure holding the data of the geometry.
The data type to uniquely identify a Plane.
Class identifying a set of TPC sharing readout channels.
std::vector< std::vector< std::vector< raw::ChannelID_t > > > const & FirstChannelInThisPlane() const
Retrieve the private fFirstChannelInThisPlane vector for testing.
bool isValidElement(TPCInfoMap_t< T > const &map, CryostatID const &id) const
Returns whether the ID specifies a valid entry.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
bool isValidElement(PlaneInfoMap_t< T > const &map, PlaneID const &id) const
Returns whether the ID specifies a valid entry.
virtual unsigned int NOpChannels(unsigned int NOpDets) const
Returns the number of optical channels contained in some detectors.
virtual unsigned int OpDetFromOpChannel(unsigned int opChannel) const
Returns the optical detector the specified optical channel belongs.
virtual void Uninitialize()=0
Deconfiguration: prepare for a following call of Initialize()
std::vector< std::vector< T >> TPCInfoMap_t
Data type for per-TPC information.
TPCInfoMap_t< std::vector< T >> PlaneInfoMap_t
Data type for per-plane information.
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.
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const =0
Returns the total number of ROP in the specified TPC set.
Interface to algorithm class for sorting geo::XXXGeo objects.
virtual unsigned int MaxROPs() const =0
Returns the largest number of ROPs a TPC set in the detector has.
virtual std::vector< PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const =0
Returns a list of ID of planes belonging to the specified ROP.
T const & AccessElement(PlaneInfoMap_t< T > const &map, PlaneID const &id) const
Returns the specified element of the plane map.
virtual GeoObjectSorter const & Sorter() const =0
Returns the object to sort geometry with.
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
std::map< std::string, size_t > fADNameToGeo
map the names of the dets to the AuxDetGeo objects
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const =0
bool isValidElement(PlaneInfoMap_t< T > const &map, CryostatID const &id) const
Returns whether the ID specifies a valid entry.
bool isValidElement(PlaneInfoMap_t< T > const &map, TPCID const &id) const
Returns whether the ID specifies a valid entry.
constexpr bool isValidChannelID(raw::ChannelID_t channel)
std::vector< std::vector< std::vector< raw::ChannelID_t > > > const & FirstChannelInNextPlane() const
Retrieve the private fFirstChannelInNextPlane vector for testing.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const =0
Returns the total number of TPC sets in the specified cryostat.
The data type to uniquely identify a TPC.
Definition of data types for geometry description.
virtual std::pair< size_t, size_t > ChannelToSensitiveAuxDet(std::vector< AuxDetGeo > const &auxDets, std::string const &detName, uint32_t const &channel) const
Returns the index of the sensitive detector containing the channel.
Class identifying a set of planes sharing readout channels.
virtual PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first plane belonging to the specified ROP.
virtual size_t ChannelToAuxDet(std::vector< AuxDetGeo > const &auxDets, std::string const &detName, uint32_t const &channel) const
Returns the index of the detector containing the specified channel.
std::map< size_t, std::vector< size_t > > fADChannelToSensitiveGeo
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const =0
Returns the ID of the ROP the channel belongs to.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first channel in the specified readout plane.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
virtual SigType_t SignalTypeForROPIDImpl(readout::ROPID const &ropid) const
Return the signal type on the specified readout plane.
virtual unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const
Returns the hardware channel number of specified optical channel.
virtual unsigned int MaxTPCsets() const =0
Returns the largest number of TPC sets any cryostat in the detector has.
virtual readout::ROPID WirePlaneToROP(PlaneID const &planeid) const =0
Returns the ID of the ROP planeid belongs to.
virtual unsigned int MaxOpChannel(unsigned int NOpDets) const
Returns the number of optical channels contained in some detectors.
virtual size_t NearestAuxDet(Point_t const &point, std::vector< AuxDetGeo > const &auxDets, double tolerance=0) const
Returns the auxiliary detector closest to the specified point.
virtual bool HasChannel(raw::ChannelID_t channel) const
Returns whether the specified channel is valid This default implementation assumes all channels up to...
virtual unsigned int OpChannel(unsigned int detNum, unsigned int hwchannel=0) const
Returns the channel ID of the specified hardware channel.
virtual raw::ChannelID_t PlaneWireToChannel(WireID const &wireID) const =0
Returns the channel ID a wire is connected to.
virtual unsigned int NOpHardwareChannels(unsigned int opDet) const
Returns the number of channels in the specified optical detectors.
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const =0
virtual ~ChannelMapAlg()=default
virtual bool IsValidOpChannel(unsigned int opChannel, unsigned int NOpDets) const
Returns whether the ID identifies a valid optical detector channel.
Data in the geometry description.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
recob::tracking::Plane Plane
Namespace collecting geometry-related classes utilities.
virtual TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const =0
Returns the ID of the first TPC belonging to the specified TPC set.
T const * GetElementPtr(PlaneInfoMap_t< T > const &map, PlaneID const &id) const
Returns a pointer to the specified element, or nullptr if invalid.
virtual WireID NearestWireID(Point_t const &worldPos, PlaneID const &planeID) const =0
Returns the ID of the wire nearest to the specified position.
bool isValidElement(TPCInfoMap_t< T > const &map, TPCID const &id) const
Returns the specified element of the TPC map.
virtual void Initialize(GeometryData_t const &geodata)=0
Geometry initialisation.
virtual size_t NearestSensitiveAuxDet(Point_t const &point, std::vector< AuxDetGeo > const &auxDets, double tolerance=0) const
Returns sensitive auxiliary detector closest to specified point.
The data type to uniquely identify a cryostat.