#include <ChannelMapStandardAlg.h>
Public Member Functions | |
ChannelMapStandardAlg (fhicl::ParameterSet const &p) | |
virtual void | Initialize (GeometryData_t const &geodata) override |
Geometry initialisation. More... | |
virtual void | Uninitialize () override |
Deconfiguration: prepare for a following call of Initialize() More... | |
virtual std::vector< WireID > | ChannelToWire (raw::ChannelID_t channel) const override |
virtual unsigned int | Nchannels () const override |
Returns the total number of channels present (not necessarily contiguous) More... | |
virtual unsigned int | Nchannels (readout::ROPID const &ropid) const override |
Returns the number of channels in the specified ROP. More... | |
virtual std::set< PlaneID > const & | PlaneIDs () const override |
Returns a list of the plane IDs in the whole detector. More... | |
virtual geo::GeoObjectSorter const & | Sorter () const override |
Return the sorter. More... | |
virtual double | WireCoordinate (double YPos, double ZPos, geo::PlaneID const &planeID) const override |
Returns the index of the wire nearest to the specified position. More... | |
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. More... | |
virtual WireID | NearestWireID (const TVector3 &worldPos, geo::PlaneID const &planeID) const override |
Returns the ID of the wire nearest to the specified position. More... | |
virtual 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. More... | |
virtual raw::ChannelID_t | PlaneWireToChannel (geo::WireID const &wireID) const override |
Returns the channel ID a wire is connected to. More... | |
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. More... | |
TPC set mapping | |
virtual unsigned int | NTPCsets (readout::CryostatID const &cryoid) const override |
Returns the total number of TPC sets in the specified cryostat. More... | |
virtual unsigned int | MaxTPCsets () const override |
Returns the largest number of TPC sets any cryostat in the detector has. More... | |
virtual bool | HasTPCset (readout::TPCsetID const &tpcsetid) const override |
virtual readout::TPCsetID | TPCtoTPCset (geo::TPCID const &tpcid) const override |
Returns the ID of the TPC set the specified TPC belongs to. More... | |
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. More... | |
virtual geo::TPCID | FirstTPCinTPCset (readout::TPCsetID const &tpcsetid) const override |
Returns the ID of the first TPC belonging to the specified TPC set. More... | |
Readout plane mapping | |
virtual unsigned int | NROPs (readout::TPCsetID const &tpcsetid) const override |
Returns the total number of ROPs in the specified TPC set. More... | |
virtual unsigned int | MaxROPs () const override |
Returns the largest number of ROPs a TPC set in the detector has. More... | |
virtual bool | HasROP (readout::ROPID const &ropid) const override |
virtual readout::ROPID | WirePlaneToROP (geo::PlaneID const &planeid) const override |
Returns the ID of the ROP planeid belongs to, or invalid if none. More... | |
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. More... | |
virtual std::vector< geo::TPCID > | ROPtoTPCs (readout::ROPID const &ropid) const override |
Returns a list of ID of TPCs the specified ROP spans. More... | |
virtual readout::ROPID | ChannelToROP (raw::ChannelID_t channel) const override |
Returns the ID of the ROP the channel belongs to (invalid if none) More... | |
virtual raw::ChannelID_t | FirstChannelInROP (readout::ROPID const &ropid) const override |
Returns the ID of the first channel in the specified readout plane. More... | |
virtual geo::PlaneID | FirstWirePlaneInROP (readout::ROPID const &ropid) const override |
Returns the ID of the first plane belonging to the specified ROP. More... | |
Public Member Functions inherited from geo::ChannelMapAlg | |
virtual | ~ChannelMapAlg ()=default |
Virtual destructor. More... | |
virtual unsigned int | NOpChannels (unsigned int NOpDets) const |
Returns the number of optical channels contained in some detectors. More... | |
virtual unsigned int | MaxOpChannel (unsigned int NOpDets) const |
Returns the number of optical channels contained in some detectors. More... | |
virtual unsigned int | NOpHardwareChannels (unsigned int opDet) const |
Returns the number of channels in the specified optical detectors. More... | |
virtual bool | IsValidOpChannel (unsigned int opChannel, unsigned int NOpDets) const |
Returns whether the ID identifies a valid optical detector channel. More... | |
virtual unsigned int | OpChannel (unsigned int detNum, unsigned int hwchannel=0) const |
Returns the channel ID of the specified hardware channel. More... | |
virtual unsigned int | OpDetFromOpChannel (unsigned int opChannel) const |
Returns the optical detector the specified optical channel belongs. More... | |
virtual unsigned int | HardwareChannelFromOpChannel (unsigned int opChannel) const |
Returns the hardware channel number of specified optical channel. More... | |
unsigned int | NearestWire (const TVector3 &worldPos, geo::PlaneID const &planeID) const |
Returns the index of the wire nearest to the specified position. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
const std::vector< std::vector< std::vector< raw::ChannelID_t > > > | FirstChannelInNextPlane () const |
Retrieve the private fFirstChannelInNextPlane vector for testing. More... | |
const std::vector< std::vector< std::vector< raw::ChannelID_t > > > | FirstChannelInThisPlane () const |
Retrieve the private fFirstChannelInThisPlane vector for testing. More... | |
virtual bool | HasChannel (raw::ChannelID_t channel) const |
Returns whether the specified channel is valid This default implementation assumes all channels up to Nchannels() valid. More... | |
geo::SigType_t | SignalTypeForChannel (raw::ChannelID_t const channel) const |
Return the signal type of the specified channel. More... | |
geo::SigType_t | SignalTypeForROPID (readout::ROPID const &ropid) const |
Return the signal type on the specified readout plane. More... | |
Private Member Functions | |
virtual SigType_t | SignalTypeForChannelImpl (raw::ChannelID_t const channel) const override |
Return the signal type of the specified channel. More... | |
unsigned int | WireCount (geo::PlaneID const &id) const |
Retrieved the wire cound for the specified plane ID. More... | |
unsigned int | MaxTPCs () const |
Returns the largest number of TPCs in a single cryostat. More... | |
Static Private Member Functions | |
static readout::TPCsetID | ConvertTPCtoTPCset (geo::TPCID const &tpcid) |
Converts a TPC ID into a TPC set ID using the same numerical indices. More... | |
static geo::TPCID | ConvertTPCsetToTPC (readout::TPCsetID const &tpcsetid) |
Converts a TPC set ID into a TPC ID using the same numerical indices. More... | |
static readout::ROPID | ConvertWirePlaneToROP (geo::PlaneID const &planeid) |
Converts a ROP ID into a wire plane ID using the same numerical indices. More... | |
static geo::PlaneID | ConvertROPtoWirePlane (readout::ROPID const &ropid) |
Converts a wire plane ID into a ROP ID using the same numerical indices. More... | |
Private Attributes | |
unsigned int | fNcryostat |
number of cryostats in the detector More... | |
unsigned int | fNchannels |
number of channels in the detector More... | |
raw::ChannelID_t | fTopChannel |
book keeping highest channel # More... | |
std::vector< unsigned int > | fNTPC |
number of TPCs in each cryostat More... | |
std::set< View_t > | fViews |
vector of the views present in the detector More... | |
std::set< PlaneID > | fPlaneIDs |
vector of the PlaneIDs present in the detector More... | |
PlaneInfoMap_t< float > | fFirstWireProj |
PlaneInfoMap_t< float > | fOrthVectorsY |
Unit vectors orthogonal to wires in. More... | |
PlaneInfoMap_t< float > | fOrthVectorsZ |
PlaneInfoMap_t< float > | fWireCounts |
TPCInfoMap_t< unsigned int > | fNPlanes |
PlaneInfoMap_t< unsigned int > | fPlaneBaselines |
PlaneInfoMap_t< unsigned int > | fWiresPerPlane |
geo::GeoObjectSorterStandard | fSorter |
class to sort geo objects More... | |
Additional Inherited Members | |
Protected Types inherited from geo::ChannelMapAlg | |
template<typename T > | |
using | TPCInfoMap_t = std::vector< std::vector< T >> |
Data type for per-TPC information. More... | |
template<typename T > | |
using | PlaneInfoMap_t = TPCInfoMap_t< std::vector< T >> |
Data type for per-plane information. More... | |
Protected Member Functions inherited from geo::ChannelMapAlg | |
template<typename T > | |
T const & | AccessElement (PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const |
Returns the specified element of the plane map. More... | |
template<typename T > | |
size_t | AccessElementSize (PlaneInfoMap_t< T > const &map, geo::TPCID const &id) const |
Returns the number of elements in the specified TPC of the plane map. More... | |
template<typename T > | |
T const * | GetElementPtr (PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const |
Returns a pointer to the specified element, or nullptr if invalid. More... | |
template<typename T > | |
T const & | AccessElement (TPCInfoMap_t< T > const &map, geo::TPCID const &id) const |
Returns the specified element of the TPC map. More... | |
template<typename T > | |
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. More... | |
template<typename T > | |
bool | isValidElement (TPCInfoMap_t< T > const &map, geo::CryostatID const &id) const |
Returns whether the ID specifies a valid entry. More... | |
template<typename T > | |
bool | isValidElement (TPCInfoMap_t< T > const &map, geo::TPCID const &id) const |
template<typename T > | |
bool | isValidElement (PlaneInfoMap_t< T > const &map, geo::CryostatID const &id) const |
Returns whether the ID specifies a valid entry. More... | |
template<typename T > | |
bool | isValidElement (PlaneInfoMap_t< T > const &map, geo::TPCID const &id) const |
template<typename T > | |
bool | isValidElement (PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const |
virtual geo::SigType_t | SignalTypeForROPIDImpl (readout::ROPID const &ropid) const |
Return the signal type on the specified readout plane. More... | |
Protected Attributes inherited from geo::ChannelMapAlg | |
PlaneInfoMap_t< raw::ChannelID_t > | fFirstChannelInThisPlane |
PlaneInfoMap_t< raw::ChannelID_t > | fFirstChannelInNextPlane |
std::map< std::string, size_t > | fADNameToGeo |
map the names of the dets to the AuxDetGeo objects More... | |
std::map< size_t, std::vector< size_t > > | fADChannelToSensitiveGeo |
Definition at line 22 of file ChannelMapStandardAlg.h.
geo::ChannelMapStandardAlg::ChannelMapStandardAlg | ( | fhicl::ParameterSet const & | p | ) |
Definition at line 24 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the ID of the ROP the channel belongs to (invalid if none)
Implements geo::ChannelMapAlg.
Definition at line 433 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns a list of TPC wires connected to the specified readout channel ID
cet::exception | (category: "Geometry") if non-existent channel |
Implements geo::ChannelMapAlg.
Definition at line 146 of file ChannelMapStandardAlg.cxx.
|
staticprivate |
Converts a wire plane ID into a ROP ID using the same numerical indices.
Definition at line 506 of file ChannelMapStandardAlg.cxx.
|
staticprivate |
Converts a TPC set ID into a TPC ID using the same numerical indices.
Definition at line 480 of file ChannelMapStandardAlg.cxx.
|
staticprivate |
Converts a TPC ID into a TPC set ID using the same numerical indices.
Definition at line 468 of file ChannelMapStandardAlg.cxx.
|
staticprivate |
Converts a ROP ID into a wire plane ID using the same numerical indices.
Definition at line 492 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the ID of the first channel in the specified readout plane.
ropid | ID of the readout plane |
Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists. Check if the ROP exists with HasROP(). The behaviour for non-existing readout planes is undefined.
Implements geo::ChannelMapAlg.
Definition at line 450 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the ID of the first TPC belonging to the specified TPC set.
Implements geo::ChannelMapAlg.
Definition at line 362 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the ID of the first plane belonging to the specified ROP.
Implements geo::ChannelMapAlg.
Definition at line 460 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns whether we have the specified ROP
Implements geo::ChannelMapAlg.
Definition at line 397 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns whether we have the specified TPC set
Implements geo::ChannelMapAlg.
Definition at line 336 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Geometry initialisation.
Implements geo::ChannelMapAlg.
Definition at line 30 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the largest number of ROPs a TPC set in the detector has.
Implements geo::ChannelMapAlg.
Definition at line 387 of file ChannelMapStandardAlg.cxx.
|
private |
Returns the largest number of TPCs in a single cryostat.
Definition at line 369 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the largest number of TPC sets any cryostat in the detector has.
Implements geo::ChannelMapAlg.
Definition at line 329 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the total number of channels present (not necessarily contiguous)
Implements geo::ChannelMapAlg.
Definition at line 186 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the number of channels in the specified ROP.
Implements geo::ChannelMapAlg.
Definition at line 193 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the ID of the wire nearest to the specified position.
worldPos | position to be tested |
planeID | plane containing the wire |
InvalidWireIDError | the ID found is not present in the detector |
The plane is required to be valid and exist in the detector. Otherwise, the behaviour is undefined. An exception is thrown if the wire that would be the closest is actually not present; but no check is performed whether the specified position is outside the wire plane: wires are extrapolated to be infinitely long. In other words, the result can be trusted only as long as the position is within the specified wire plane.
Reimplemented from geo::ChannelMapAlg.
Definition at line 216 of file ChannelMapStandardAlg.cxx.
|
inlineoverridevirtual |
Returns the ID of the wire nearest to the specified position.
worldPos | position to be tested |
PlaneNo | number of plane containing the wire |
TPCNo | number of TPC containing the wire |
cstat | number of cryostat containing the wire |
geo::PlaneID
instead Implements geo::ChannelMapAlg.
Definition at line 50 of file ChannelMapStandardAlg.h.
|
overridevirtual |
Returns the total number of ROPs in the specified TPC set.
tpcsetid | TPC set ID |
Note that this methods explicitly check the existence of the TPC set.
In this mapping, planes have independent readout and there is one wire plane in each readout plane and one readout plane for each wire plane.
Implements geo::ChannelMapAlg.
Definition at line 379 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the total number of TPC sets in the specified cryostat.
cryoid | cryostat ID |
In this mapping, TPCs have independent readout and there is one TPC in each TPC set and one TPC set for each TPC.
Implements geo::ChannelMapAlg.
Definition at line 320 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns a list of the plane IDs in the whole detector.
Implements geo::ChannelMapAlg.
Definition at line 312 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the channel ID a wire is connected to.
wireID | ID of the wire |
Behaviour on an invalid or not present wires is undefined.
geo::WireID
Reimplemented from geo::ChannelMapAlg.
Definition at line 261 of file ChannelMapStandardAlg.cxx.
|
inlineoverridevirtual |
Returns the channel ID a wire is connected to.
plane | number of plane |
wire | number of wire |
tpc | number of TPC |
cstat | number of cryostat |
geo::WireID
Implements geo::ChannelMapAlg.
Definition at line 60 of file ChannelMapStandardAlg.h.
|
overridevirtual |
Returns a list of ID of TPCs the specified ROP spans.
ropid | ID of the readout plane |
In this mapping, readout planes and wire planes are mapped one-to-one. The returned list contains always one entry, unless the specified readout plane ID is invalid, in which case the list is empty. Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists. Check if the ROP exists with HasROP(). The behaviour on non-existing readout planes is undefined.
Implements geo::ChannelMapAlg.
Definition at line 422 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns a list of ID of wire planes belonging to the specified ROP.
ropid | ID of the readout plane to convert into wire planes |
In this mapping, readout planes and wire planes are mapped one-to-one. The returned list contains always one entry, unless the specified readout plane ID is invalid, in which case the list is empty. Note that this check is performed on the validity of the readout plane ID, that does not necessarily imply that the readout plane specified by the ID actually exists.
Implements geo::ChannelMapAlg.
Definition at line 412 of file ChannelMapStandardAlg.cxx.
|
overrideprivatevirtual |
Return the signal type of the specified channel.
channel | ID of the channel |
On any type of error (e.g., invalid or unknown channel ID), geo::kMysteryType is returned.
Implements geo::ChannelMapAlg.
Definition at line 285 of file ChannelMapStandardAlg.cxx.
|
inlineoverridevirtual |
Return the sorter.
Implements geo::ChannelMapAlg.
Definition at line 228 of file ChannelMapStandardAlg.h.
|
overridevirtual |
Returns a list of ID of TPCs belonging to the specified TPC set.
tpcsetid | ID of the TPC set to convert into TPC IDs |
In this mapping, TPC sets and TPCs are mapped one-to-one. The returned list contains always one entry, unless the specified TPC set ID is invalid, in which case the list is empty. Note that the check is performed on the validity of the TPC set ID, that does not necessarily imply that the TPC set specified by the ID actually exists. Check the existence of the TPC set first (HasTPCset()). Behaviour on valid, non-existent TPC set IDs is undefined.
Implements geo::ChannelMapAlg.
Definition at line 352 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the ID of the TPC set the specified TPC belongs to.
tpcid | ID of the TPC |
In this mapping, TPC sets and TPCs are mapped one-to-one. The returned value mirrors the TPC ID in the readout space. If the TPC ID is not valid, an invalid TPC set ID is returned. Note that this check is performed on the validity of the TPC ID, that does not necessarily imply that the TPC specified by the ID actually exists.
Implements geo::ChannelMapAlg.
Definition at line 344 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Deconfiguration: prepare for a following call of Initialize()
Implements geo::ChannelMapAlg.
Definition at line 141 of file ChannelMapStandardAlg.cxx.
|
overridevirtual |
Returns the index of the wire nearest to the specified position.
YPos | y coordinate on the wire plane |
ZPos | z coordinate on the wire plane |
planeID | ID of the plane |
Respect to NearestWireID(), this method returns a real number, representing a continuous coordinate in the wire axis, with the round values corresponding to the actual wires.
The plane is required to be valid and exist in the detector. Otherwise, the behaviour is undefined.
Reimplemented from geo::ChannelMapAlg.
Definition at line 203 of file ChannelMapStandardAlg.cxx.
|
inlineoverridevirtual |
Returns the index of the wire nearest to the specified position.
YPos | y coordinate on the wire plane |
ZPos | z coordinate on the wire plane |
PlaneNo | number of plane |
TPCNo | number of TPC |
cstat | number of cryostat |
geo::PlaneID
instead Implements geo::ChannelMapAlg.
Definition at line 40 of file ChannelMapStandardAlg.h.
|
inlineprivate |
Retrieved the wire cound for the specified plane ID.
Definition at line 261 of file ChannelMapStandardAlg.h.
|
overridevirtual |
Returns the ID of the ROP planeid belongs to, or invalid if none.
planeid | ID of the plane |
In this mapping, readout planes and wire planes are mapped one-to-one. The returned value mirrors the plane ID in the readout space. If the plane ID is not valid, an invalid readout plane ID is returned. Note that this check is performed on the validity of the plane ID, that does not necessarily imply that the plane specified by the ID actually exists.
Implements geo::ChannelMapAlg.
Definition at line 404 of file ChannelMapStandardAlg.cxx.
|
private |
Distance (0,0,0) to first wire along orth vector per plane per TPC
Definition at line 239 of file ChannelMapStandardAlg.h.
|
private |
number of channels in the detector
Definition at line 234 of file ChannelMapStandardAlg.h.
|
private |
number of cryostats in the detector
Definition at line 233 of file ChannelMapStandardAlg.h.
|
private |
Number of planes in each TPC - for range checking after calculation
Definition at line 247 of file ChannelMapStandardAlg.h.
|
private |
number of TPCs in each cryostat
Definition at line 236 of file ChannelMapStandardAlg.h.
|
private |
Unit vectors orthogonal to wires in.
Definition at line 241 of file ChannelMapStandardAlg.h.
|
private |
each plane - stored as 2 components to avoid having to invoke any bulky TObjects / CLHEP vectors etc
Definition at line 242 of file ChannelMapStandardAlg.h.
|
private |
The number of wires in all the tpcs and planes up to this one in the heirachy
Definition at line 249 of file ChannelMapStandardAlg.h.
|
private |
vector of the PlaneIDs present in the detector
Definition at line 238 of file ChannelMapStandardAlg.h.
|
private |
class to sort geo objects
Definition at line 255 of file ChannelMapStandardAlg.h.
|
private |
book keeping highest channel #
Definition at line 235 of file ChannelMapStandardAlg.h.
|
private |
vector of the views present in the detector
Definition at line 237 of file ChannelMapStandardAlg.h.
|
private |
Number of wires in each plane - for range checking after calculation
Definition at line 245 of file ChannelMapStandardAlg.h.
|
private |
The number of wires in this plane in the heirachy
Definition at line 252 of file ChannelMapStandardAlg.h.