1 #ifndef GEO_CHANNELMAPALG_H 2 #define GEO_CHANNELMAPALG_H 20 #include "cetlib_except/exception.h" 35 struct GeometryData_t;
82 virtual unsigned int Nchannels()
const = 0;
155 virtual std::set<geo::PlaneID>
const&
PlaneIDs()
const = 0;
187 unsigned int cstat)
const = 0;
213 virtual unsigned int NOpChannels(
unsigned int NOpDets)
const;
229 virtual unsigned int MaxOpChannel(
unsigned int NOpDets)
const;
262 (
unsigned int opChannel,
unsigned int NOpDets)
const;
274 (
unsigned int detNum,
unsigned int hwchannel = 0)
const;
293 (
unsigned int opChannel)
const;
339 unsigned int PlaneNo,
341 unsigned int cstat)
const = 0;
379 unsigned int PlaneNo,
381 unsigned int cstat)
const = 0;
409 unsigned int PlaneNo,
411 unsigned int cstat)
const 428 (
const double* point, std::vector<geo::AuxDetGeo*>
const& auxDets)
const;
437 (
const double* point, std::vector<geo::AuxDetGeo*>
const& auxDets)
const;
450 virtual size_t ChannelToAuxDet(std::vector<geo::AuxDetGeo*>
const& auxDets,
451 std::string
const& detName,
452 uint32_t
const& channel
463 std::vector<geo::AuxDetGeo*>
const& auxDets,
464 std::string
const& detName,
465 uint32_t
const& channel
524 virtual unsigned int MaxROPs()
const = 0;
552 virtual std::vector<geo::TPCID>
ROPtoTPCs 605 template <
typename T>
609 template <
typename T>
631 template <
typename T>
634 {
return map[
id.Cryostat][
id.TPC]; }
637 template <
typename T>
640 {
return map[
id.Cryostat].size(); }
643 template <
typename T>
647 {
return id.Cryostat < map.size(); }
648 template <
typename T>
652 && (
id.TPC < map[
id.Cryostat].size());
658 template <
typename T>
661 {
return map[
id.Cryostat][
id.TPC][
id.Plane]; }
664 template <
typename T>
667 {
return map[
id.Cryostat][
id.TPC].size(); }
670 template <
typename T>
674 {
return id.Cryostat < map.size(); }
675 template <
typename T>
679 && (
id.TPC < map[
id.Cryostat].size());
681 template <
typename T>
686 && (
id.Plane < AccessSize(map,
id.asTPCID()));
691 template <
typename T>
695 if (
id.Cryostat >= map.size())
return nullptr;
696 auto const& cryo_map = map[
id.Cryostat];
697 if (
id.TPC >= cryo_map.size())
return nullptr;
698 auto const& TPC_map = cryo_map[
id.TPC];
699 if (
id.
Plane >= TPC_map.size())
return nullptr;
700 auto const& plane_map = TPC_map[
id.Plane];
708 #endif // GEO_CHANNELMAPALG_H 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.
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.
bool isValidElement(TPCInfoMap_t< T > const &map, geo::TPCID const &id) const
Returns the specified element of the TPC map.
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
Returns whether the ID specifies a valid entry.
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.
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.
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
Returns the auxiliary detector closest to the specified point.
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.
Collection of exceptions for Geometry system.
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.
virtual size_t NearestSensitiveAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
Returns sensitive auxiliary detector closest to specified point.
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
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 geo::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< geo::AuxDetGeo * > const &auxDets, std::string const &detName, uint32_t const &channel) const
Returns the index of the detector containing the specified channel.
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.
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
Namespace collecting geometry-related classes utilities.
const std::vector< std::vector< std::vector< raw::ChannelID_t > > > FirstChannelInNextPlane() const
Retrieve the private fFirstChannelInNextPlane vector for testing.
virtual void Initialize(GeometryData_t const &geodata)=0
Geometry initialisation.
The data type to uniquely identify a cryostat.