1 #ifndef GEO_CHANNELMAPALG_H 2 #define GEO_CHANNELMAPALG_H 75 virtual unsigned int Nchannels()
const = 0;
148 virtual std::set<geo::PlaneID>
const&
PlaneIDs()
const = 0;
180 unsigned int cstat)
const = 0;
206 virtual unsigned int NOpChannels(
unsigned int NOpDets)
const;
222 virtual unsigned int MaxOpChannel(
unsigned int NOpDets)
const;
255 (
unsigned int opChannel,
unsigned int NOpDets)
const;
267 (
unsigned int detNum,
unsigned int hwchannel = 0)
const;
286 (
unsigned int opChannel)
const;
332 unsigned int PlaneNo,
334 unsigned int cstat)
const = 0;
372 unsigned int PlaneNo,
374 unsigned int cstat)
const = 0;
402 unsigned int PlaneNo,
404 unsigned int cstat)
const 422 (
const double* point, std::vector<geo::AuxDetGeo>
const& auxDets,
double tolerance = 0)
const;
432 (
const double* point, std::vector<geo::AuxDetGeo>
const& auxDets,
double tolerance = 0)
const;
445 virtual size_t ChannelToAuxDet(std::vector<geo::AuxDetGeo>
const& auxDets,
447 uint32_t
const& channel
458 std::vector<geo::AuxDetGeo>
const& auxDets,
460 uint32_t
const& channel
519 virtual unsigned int MaxROPs()
const = 0;
547 virtual std::vector<geo::TPCID>
ROPtoTPCs 600 template <
typename T>
604 template <
typename T>
626 template <
typename T>
629 {
return map[
id.Cryostat][
id.TPC]; }
632 template <
typename T>
635 {
return map[
id.Cryostat].size(); }
639 template <
typename T>
642 {
return id.Cryostat < map.size(); }
643 template <
typename T>
647 && (
id.TPC < map[
id.Cryostat].size());
653 template <
typename T>
656 {
return map[
id.Cryostat][
id.TPC][
id.Plane]; }
659 template <
typename T>
662 {
return map[
id.Cryostat][
id.TPC].size(); }
666 template <
typename T>
669 {
return id.Cryostat < map.size(); }
670 template <
typename T>
674 && (
id.TPC < map[
id.Cryostat].size());
676 template <
typename T>
681 && (
id.Plane < AccessSize(map,
id.asTPCID()));
686 template <
typename T>
690 if (
id.Cryostat >= map.size())
return nullptr;
691 auto const& cryo_map = map[
id.Cryostat];
692 if (
id.
TPC >= cryo_map.size())
return nullptr;
693 auto const& TPC_map = cryo_map[
id.TPC];
694 if (
id.
Plane >= TPC_map.size())
return nullptr;
695 auto const& plane_map = TPC_map[
id.Plane];
703 #endif // GEO_CHANNELMAPALG_H Interface for a class providing readout channel mapping to geometry.
virtual std::set< geo::PlaneID > const & PlaneIDs() const =0
Returns a list of the plane IDs in the whole detector.
virtual double WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeID) const
Returns the index of the wire nearest to the specified position.
virtual std::pair< size_t, size_t > ChannelToSensitiveAuxDet(std::vector< geo::AuxDetGeo > const &auxDets, std::string const &detName, uint32_t const &channel) const
Returns the index of the sensitive detector containing the channel.
bool isValidElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Classes identifying readout-related concepts.
virtual unsigned int Nchannels() const =0
Returns the total number of channels present (not necessarily contiguous)
bool isValidElement(PlaneInfoMap_t< T > const &map, geo::TPCID const &id) const
const std::vector< std::vector< std::vector< raw::ChannelID_t > > > FirstChannelInThisPlane() const
Retrieve the private fFirstChannelInThisPlane vector for testing.
geo::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
geo::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.
CryostatID_t Cryostat
Index of cryostat.
virtual geo::SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const =0
Return the signal type of the specified channel.
WireID_t Wire
Index of the wire within its plane.
T const & AccessElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
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.
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 geo::GeoObjectSorter const & Sorter() const =0
Returns the object to sort geometry with.
unsigned int NearestWire(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the index of the wire nearest to the specified position.
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const =0
Returns a list of ID of TPCs the specified ROP spans.
enum geo::_plane_sigtype SigType_t
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
virtual std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const =0
Returns a list of ID of planes belonging to the specified ROP.
virtual raw::ChannelID_t PlaneWireToChannel(geo::WireID const &wireID) const
Returns the channel ID a wire is connected to.
constexpr bool isValidChannelID(raw::ChannelID_t channel)
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const =0
Returns the total number of TPC sets in the specified cryostat.
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const =0
Returns the ID of the first TPC belonging to the specified TPC set.
The data type to uniquely identify a TPC.
PlaneID_t Plane
Index of the plane within its TPC.
Definition of data types for geometry description.
Class identifying a set of planes sharing readout channels.
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const =0
Returns the ID of the ROP planeid belongs to.
std::map< size_t, std::vector< size_t > > fADChannelToSensitiveGeo
unsigned int NearestWire(const TVector3 &worldPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const
Returns the index of the wire nearest to the specified position.
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.
T const * GetElementPtr(PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const
Returns a pointer to the specified element, or nullptr if invalid.
size_t AccessElementSize(TPCInfoMap_t< T > const &map, geo::CryostatID const &id) const
Returns the number of elements in the specified cryostat of the TPC map.
virtual geo::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 unsigned int MaxOpChannel(unsigned int NOpDets) const
Returns the number of optical channels contained in some detectors.
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const =0
Returns the ID of the TPC set tpcid belongs to.
virtual size_t ChannelToAuxDet(std::vector< geo::AuxDetGeo > const &auxDets, std::string const &detName, uint32_t const &channel) const
Returns the index of the detector containing the specified channel.
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first plane belonging to the specified ROP.
virtual std::vector< geo::TPCID > TPCsetToTPCs(readout::TPCsetID const &tpcsetid) const =0
Returns a list of ID of TPCs belonging to the specified TPC set.
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.
bool isValidElement(TPCInfoMap_t< T > const &map, geo::CryostatID const &id) const
Returns whether the ID specifies a valid entry.
virtual unsigned int NOpHardwareChannels(unsigned int opDet) const
Returns the number of channels in the specified optical detectors.
virtual geo::WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the ID of the wire nearest to the specified position.
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const =0
virtual ~ChannelMapAlg()=default
Virtual destructor.
virtual bool IsValidOpChannel(unsigned int opChannel, unsigned int NOpDets) const
Returns whether the ID identifies a valid optical detector channel.
virtual size_t NearestSensitiveAuxDet(const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const
Returns sensitive auxiliary detector closest to specified point.
Data in the geometry description.
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
unsigned int ChannelID_t
Type representing the ID of a readout channel.
TPCID_t TPC
Index of the TPC within its cryostat.
recob::tracking::Plane Plane
LArSoft geometry interface.
const std::vector< std::vector< std::vector< raw::ChannelID_t > > > FirstChannelInNextPlane() const
Retrieve the private fFirstChannelInNextPlane vector for testing.
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const
Returns the auxiliary detector closest to the specified point.
virtual void Initialize(GeometryData_t const &geodata)=0
Geometry initialisation.
The data type to uniquely identify a cryostat.