9 #ifndef ICARUSCODE_GEOMETRY_ICARUSCHANNELMAPALG_H
10 #define ICARUSCODE_GEOMETRY_ICARUSCHANNELMAPALG_H
27 #include "fhiclcpp/types/OptionalDelegatedParameter.h"
28 #include "fhiclcpp/types/Atom.h"
29 #include "fhiclcpp/types/Table.h"
30 #include "fhiclcpp/ParameterSet.h"
41 class ICARUSChannelMapAlg;
182 Name(
"FirstInductionPreChannels"),
184 (
"number of wireless channels before the first regular channel in first induction plane"),
189 Name(
"FirstInductionPostChannels"),
191 (
"number of wireless channels after the last regular channel in first induction plane"),
196 Name(
"SecondInductionEvenPreChannels"),
198 (
"number of wireless/ghost/virtual channels before the first regular channel in second induction planes in even TPC sets"),
203 Name(
"SecondInductionEvenPostChannels"),
205 (
"number of wireless/ghost/virtual channels after the last regular channel in second induction plane in even TPC sets"),
210 Name(
"SecondInductionOddPreChannels"),
212 (
"number of wireless/ghost/virtual channels before the first regular channel in second induction plane in odd TPC sets"),
217 Name(
"SecondInductionOddPostChannels"),
219 (
"number of wireless/ghost/virtual channels after the last regular channel in second induction plane in odd TPC sets"),
224 Name(
"CollectionEvenPreChannels"),
226 (
"number of wireless/ghost/virtual channels before the first regular channel in collection plane in even TPC sets"),
231 Name(
"CollectionEvenPostChannels"),
233 (
"number of wireless/ghost/virtual channels after the last regular channel in collection plane in even TPC sets"),
238 Name(
"CollectionOddPreChannels"),
240 (
"number of wireless/ghost/virtual channels before the first regular channel in collection plane in odd TPC sets"),
245 Name(
"CollectionOddPostChannels"),
247 (
"number of wireless/ghost/virtual channels after the last regular channel in collection plane in odd TPC sets"),
254 fhicl::OptionalDelegatedParameter
Sorter {
256 Comment(
"configuration of the geometry object sorter")
260 Name(
"WirelessChannels"),
261 Comment(
"configuration of channels with no connected wire")
303 virtual unsigned int Nchannels()
const override;
315 unsigned int cstat)
const override
332 (
double YPos,
double ZPos,
geo::PlaneID const& planeID)
const override;
334 unsigned int PlaneNo,
336 unsigned int cstat)
const override
342 (
const TVector3& worldPos,
geo::PlaneID const& planeID)
const override;
344 unsigned int PlaneNo,
346 unsigned int cstat)
const override
350 virtual std::set<geo::PlaneID>
const&
PlaneIDs()
const override;
369 virtual unsigned int MaxTPCsets()
const override;
419 virtual unsigned int NROPs
423 virtual unsigned int MaxROPs()
const override;
470 virtual std::vector<geo::TPCID>
ROPtoTPCs
514 = std::array<std::array<std::pair<unsigned int, unsigned int>, 3U>, 2U>;
668 = std::numeric_limits<PlaneType_t>::max();
713 readout::TPCsetID const& TPCtoTPCset(geo::TPCID const& tid) const
714 { return TPCtoTPCset()[tid]; }
787 (Config::WirelessChannelStruct
const& params);
798 #endif // ICARUSCODE_GEOMETRY_ICARUSCHANNELMAPALG_H
virtual std::set< geo::PlaneID > const & PlaneIDs() const override
Returns a list of the plane IDs in the whole detector.
PlaneType_t findPlaneType(readout::ROPID const &ropid) const
Returns the "type" of readout plane.
virtual std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const override
Returns a list of ID of TPCs the specified ROP spans.
Interface for a class providing readout channel mapping to geometry.
fhicl::Atom< unsigned int > CollectionEvenPostChannels
Geometry object sorter with PMT following TPC wire order.
ICARUSChannelMapAlg(Config const &config)
Constructor: taked a configuration object.
virtual geo::SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const override
Returns the type of signal on the specified channel.
constexpr raw::ChannelID_t end() const
Returns the ID of the channel after the last one in the range.
virtual void Initialize(geo::GeometryData_t const &geodata) override
Prepares the algorithm extracting information from the geometry.
fhicl::Atom< unsigned int > SecondInductionOddPreChannels
fhicl::Atom< unsigned int > FirstInductionPreChannels
virtual std::vector< geo::TPCID > TPCsetToTPCs(readout::TPCsetID const &tpcsetid) const override
Returns a list of ID of TPCs belonging to the specified TPC set.
ChannelRange_t fChannelRange
Range of channels covered by the plane.
Classes identifying readout-related concepts.
constexpr readout::ROPID ROP() const
Returns the ID of the readout plane this wire plane belongs to.
void buildReadoutPlanes(geo::GeometryData_t::CryostatList_t const &Cryostats)
Fills information about the TPC set and readout plane structure.
virtual double WireCoordinate(double YPos, double ZPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the index of the wire nearest to the specified position.
geo::TPCDataContainer< readout::TPCsetID > const & TPCtoTPCset() const
The TPC set including each TPC.
std::size_t PlaneType_t
Type for plane type identifier.
virtual geo::PlaneID FirstWirePlaneInROP(readout::ROPID const &ropid) const override
Returns the ID of the first plane belonging to the specified ROP.
std::array< std::array< std::pair< unsigned int, unsigned int >, 3U >, 2U > WirelessChannelCounts_t
geo::PlaneDataContainer< PlaneInfo_t > fPlaneInfo
Range of channels covered by each of the wire planes.
virtual double WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeID) const override
Returns the index of the wire nearest to the specified position.
virtual readout::ROPID WirePlaneToROP(geo::PlaneID const &planeid) const override
Returns the ID of the ROP planeid belongs to, or invalid if none.
Simple data structure holding the data of the geometry.
The data type to uniquely identify a Plane.
Channel-to-wire mapping data structure.
fhicl::OptionalDelegatedParameter Sorter
virtual std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t channel) const override
Returns a collection of ID of wires connected to the channel.
Class identifying a set of TPC sharing readout channels.
virtual raw::ChannelID_t PlaneWireToChannel(unsigned int plane, unsigned int wire, unsigned int tpc, unsigned int cstat) const override
Returns the channel ID a wire is connected to.
std::vector< geo::CryostatGeo > CryostatList_t
Type of list of cryostats.
readout::TPCsetDataContainer< TPCColl_t > fTPCsetTPCs
All geo::TPCGeo objects in each TPC set, sorted by increasing z.
virtual unsigned int NTPCsets(readout::CryostatID const &cryoid) const override
Returns the total number of TPC sets in the specified cryostat.
CryostatID_t Cryostat
Index of cryostat.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const override
Returns the ID of the first channel in the specified readout plane.
static constexpr PlaneType_t kFirstInductionType
Identifier for first induction plane type.
constexpr raw::ChannelID_t begin() const
Returns the ID of the first channel in the range.
readout::TPCsetDataContainer< unsigned int > fROPcount
Number of readout planes in each TPC set.
virtual bool HasTPCset(readout::TPCsetID const &tpcsetid) const override
PlaneColl_t const & ROPplanes(readout::ROPID const &rid) const
All geo::PlaneGeo objects in the specified readout plane rid.
icarus::GeoObjectSorterPMTasTPC fSorter
Algorithms to sort geometry elements.
virtual unsigned int MaxTPCsets() const override
Returns the largest number of TPC sets any cryostat in the detector has.
virtual bool HasROP(readout::ROPID const &ropid) const override
virtual geo::WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const override
Returns the ID of the wire nearest to the specified position.
unsigned int TPCsetCount(readout::CryostatID const &cid) const
Returns the number of TPC sets in the specified cryostat cid.
static WirelessChannelCounts_t extractWirelessChannelParams(Config::WirelessChannelStruct const ¶ms)
A few simple data type definitions.
static constexpr PlaneType_t kSecondInductionType
Identifier for second induction plane type.
unsigned int NCryostats() const
fhicl::Atom< unsigned int > CollectionOddPreChannels
Containers to hold one datum per TPC or plane.
fhicl::Atom< unsigned int > CollectionEvenPreChannels
virtual unsigned int MaxROPs() const override
Returns the largest number of ROPs a TPC set in the detector has.
Mapping of ROP channels into wires.
unsigned int MaxTPCsets() const
fhicl::Atom< unsigned int > CollectionOddPostChannels
geo::TPCDataContainer< readout::TPCsetID > fTPCtoTPCset
The TPC set each TPC belongs to.
static constexpr PlaneType_t kCollectionType
Identifier for collection plane type.
geo::PlaneDataContainer< readout::ROPID > const & PlaneToROP() const
The readout plane including each wire plane.
bool HasCryostat(readout::CryostatID const &cryoid) const
Returns whether the specified cryostat is known to the mapping.
void clear()
Frees the memory and leaves the object unusable until next set().
enum geo::_plane_sigtype SigType_t
virtual unsigned int NROPs(readout::TPCsetID const &tpcsetid) const override
Returns the total number of readout planes in the specified TPC set.
Collection of information on one plane.
ReadoutMappingInfo_t fReadoutMapInfo
Information about TPC sets and readout planes in the geometry.
readout::ROPID fROPID
Which readout plane this wire plane belongs to.
Collected information about TPC sets and readout planes in the geometry.
BEGIN_PROLOG vertical distance to the surface Name
TPCColl_t const & TPCsetTPCs(readout::TPCsetID const &sid) const
All geo::TPCGeo objects in the specified TPC set sid.
std::vector< geo::PlaneGeo const * > PlaneColl_t
Type of collection of planes (pointers to geo::PlaneGeo).
void set(std::vector< unsigned int > &&TPCsetCount, readout::TPCsetDataContainer< TPCColl_t > &&TPCsetTPCs, readout::TPCsetDataContainer< unsigned int > &&ROPcount, readout::ROPDataContainer< PlaneColl_t > &&ROPplanes, geo::TPCDataContainer< readout::TPCsetID > &&TPCtoTPCset, geo::PlaneDataContainer< readout::ROPID > &&PlaneToROP)
The data type to uniquely identify a TPC.
fhicl::Table< Config > Parameters
Type of FHiCL configuration table for this object.
Definition of data types for geometry description.
virtual geo::WireID NearestWireID(const TVector3 &worldPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const override
Returns the ID of the wire nearest to the specified position.
Class identifying a set of planes sharing readout channels.
virtual raw::ChannelID_t PlaneWireToChannel(geo::WireID const &wireID) const override
Returns the channel ID a wire is connected to.
virtual geo::TPCID FirstTPCinTPCset(readout::TPCsetID const &tpcsetid) const override
Returns the ID of the first TPC belonging to the specified TPC set.
readout::TPCsetDataContainer< unsigned int > const & ROPcount() const
Number of readout planes in each TPC set.
WirelessChannelCounts_t const fWirelessChannelCounts
Count of wireless channels on each plane.
virtual std::vector< geo::PlaneID > ROPtoWirePlanes(readout::ROPID const &ropid) const override
Returns a list of ID of wire planes belonging to the specified ROP.
constexpr raw::ChannelID_t lastChannel() const
Returns the ID of the last channel in the range.
fhicl::Atom< unsigned int > SecondInductionEvenPreChannels
A simple range of channels.
ReadoutMappingInfo_t()=default
void clear()
Makes the container empty, with no usable storage space.
icarus::details::TPCColl_t TPCColl_t
unsigned int MaxROPs() const
constexpr raw::ChannelID_t endChannel() const
Returns the ID of the channel after the last in the range.
ICARUSChannelMapAlg(Parameters const &config)
Constructor: takes a FHiCL table object.
geo::PlaneDataContainer< readout::ROPID > fPlaneToROP
The ROP each wire plane belongs to.
unsigned int ROPcount(readout::TPCsetID const &sid) const
Number of readout planes in the specified TPC set sid.
fhicl::Atom< unsigned int > SecondInductionOddPostChannels
void fillChannelToWireMap(geo::GeometryData_t::CryostatList_t const &Cryostats)
Fills the information about readout channel mapping.
constexpr raw::ChannelID_t firstChannel() const
Returns the ID of the last channel in the range.
readout::ROPDataContainer< PlaneColl_t > fROPplanes
All geo::PlaneGeo objects in each readout plane, sorted by z.
virtual geo::GeoObjectSorter const & Sorter() const override
Return the sorter.
Channel mapping for ICARUS detector with split wires.
std::vector< unsigned int > fTPCsetCount
Number of TPC sets in each cryostat.
bool empty() const
Returns whether the container has no elements (false by assumptions).
Interface to algorithm class for a specific detector channel mapping.
Data in the geometry description.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
readout::ROPDataContainer< PlaneColl_t > const & ROPplanes() const
All geo::PlaneGeo objects in each readout plane, sorted by z.
std::vector< geo::TPCGeo const * > TPCColl_t
Type of collection of TPCs (pointers to geo::TPCGeo).
Containers to hold one datum per TPC set or readout plane.
icarus::details::PlaneColl_t PlaneColl_t
unsigned int dimSize() const
Dimensions of the Level dimension of this container.
icarus::details::ChannelToWireMap fChannelToWireMap
Mapping of channels to wire planes and ROP's.
fhicl::Table< WirelessChannelStruct > WirelessChannels
readout::TPCsetDataContainer< TPCColl_t > const & TPCsetTPCs() const
All geo::TPCGeo objects in each TPC set, sorted by increasing z.
virtual readout::ROPID ChannelToROP(raw::ChannelID_t channel) const override
Returns the ID of the ROP the channel belongs to (invalid if none).
fhicl::Atom< unsigned int > SecondInductionEvenPostChannels
virtual unsigned int Nchannels() const override
Returns the number of readout channels (ID's go 0 to Nchannels()).
constexpr ChannelRange_t const & channelRange() const
Returns the range of channels covered by the wire plane.
static std::string PlaneTypeName(PlaneType_t planeType)
Returns the name of the specified plane type.
The data type to uniquely identify a cryostat.
virtual void Uninitialize() override
Frees the resources of this algorithm.
readout::ROPID const & PlaneToROP(geo::PlaneID const &pid) const
The readout plane the specified wire plane pid belongs to.
Geometry sorter having PMT channels follow the same order as TPC.
std::vector< unsigned int > const & TPCsetCount() const
Returns the number of TPC sets in each cryostat.
static constexpr PlaneType_t kUnknownType
Identifier for unknown plane type.
fhicl::Atom< unsigned int > FirstInductionPostChannels