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;
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,
446 std::string
const& detName,
447 uint32_t
const& channel
458 std::vector<geo::AuxDetGeo>
const& auxDets,
459 std::string
const& detName,
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.
BEGIN_PROLOG true icarus_rawdigitfilter FilterTools FilterPlane1 Plane
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 geo::GeoObjectSorter const & Sorter() const =0
Returns the object to sort geometry with.
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.
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.
virtual readout::TPCsetID TPCtoTPCset(geo::TPCID const &tpcid) const =0
Returns the ID of the TPC set tpcid belongs to.
CryostatID_t Cryostat
Index of cryostat.
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.
virtual unsigned int MaxTPCsets() const =0
Returns the largest number of TPC sets any cryostat in the detector has.
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 bool HasROP(readout::ROPID const &ropid) const =0
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.
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const =0
TPCInfoMap_t< std::vector< T >> PlaneInfoMap_t
Data type for per-plane information.
Interface to algorithm class for sorting geo::XXXGeo objects.
unsigned int NearestWire(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the index of the wire nearest to the specified position.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const =0
Returns the total number of TPC sets in the specified cryostat.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first channel in the specified readout plane.
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.
enum geo::_plane_sigtype SigType_t
std::map< std::string, size_t > fADNameToGeo
map the names of the dets to the AuxDetGeo objects
virtual unsigned int MaxROPs() const =0
Returns the largest number of ROPs a TPC set in the detector has.
virtual unsigned int Nchannels() const =0
Returns the total number of channels present (not necessarily contiguous)
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)
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.
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.
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 SignalTypeForChannelImpl(raw::ChannelID_t const channel) const =0
Return the signal type of the specified channel.
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 MaxOpChannel(unsigned int NOpDets) const
Returns the number of optical channels contained in some detectors.
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first plane belonging to the specified ROP.
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const =0
Returns the ID of the ROP planeid 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.
size_t NOpDets(int cryostat)
virtual bool HasChannel(raw::ChannelID_t channel) const
Returns whether the specified channel is valid This default implementation assumes all channels up to...
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 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 std::set< geo::PlaneID > const & PlaneIDs() const =0
Returns a list of the plane IDs in the whole detector.
virtual geo::WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the ID of the wire nearest to the specified position.
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 geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const =0
Returns the ID of the first TPC belonging to the specified TPC set.
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.
virtual std::vector< WireID > ChannelToWire(raw::ChannelID_t channel) const =0
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const =0
Returns the total number of ROP in the specified TPC set.
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.
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const =0
Returns the ID of the ROP the channel belongs to.
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const =0
Returns a list of ID of TPCs the specified ROP spans.