LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
geo::ChannelMapAlg Class Referenceabstract

Interface for a class providing readout channel mapping to geometry. More...

#include "ChannelMapAlg.h"

Inheritance diagram for geo::ChannelMapAlg:
geo::ChannelMapStandardAlg

Public Member Functions

virtual ~ChannelMapAlg ()=default
 Virtual destructor. More...
 
virtual geo::GeoObjectSorter const & Sorter () const =0
 Returns the object to sort geometry with. More...
 
Geometry and mapping initialization and management
virtual void Initialize (GeometryData_t const &geodata)=0
 Geometry initialisation. More...
 
virtual void Uninitialize ()=0
 Deconfiguration: prepare for a following call of Initialize() More...
 
Optical detector channel mapping
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...
 
Mapping of position to wires
virtual double WireCoordinate (double YPos, double ZPos, geo::PlaneID const &planeID) const
 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 =0
 Returns the index of the wire nearest to the specified position. More...
 
virtual geo::WireID NearestWireID (const TVector3 &worldPos, geo::PlaneID const &planeID) const
 Returns the ID of the wire nearest to the specified position. More...
 
virtual geo::WireID NearestWireID (const TVector3 &worldPos, unsigned int PlaneNo, unsigned int TPCNo, unsigned int cstat) const =0
 Returns the ID of the wire nearest to the specified position. 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...
 
Auxiliary detectors
virtual size_t NearestAuxDet (const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
 Returns the auxiliary detector closest to the specified point. More...
 
virtual size_t NearestSensitiveAuxDet (const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) 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...
 
TPC set mapping
virtual unsigned int NTPCsets (readout::CryostatID const &cryoid) const =0
 Returns the total number of TPC sets in the specified cryostat. More...
 
virtual unsigned int MaxTPCsets () const =0
 Returns the largest number of TPC sets any cryostat in the detector has. More...
 
virtual bool HasTPCset (readout::TPCsetID const &tpcsetid) const =0
 
virtual readout::TPCsetID TPCtoTPCset (geo::TPCID const &tpcid) const =0
 Returns the ID of the TPC set tpcid belongs to. More...
 
virtual std::vector< geo::TPCIDTPCsetToTPCs (readout::TPCsetID const &tpcsetid) const =0
 Returns a list of ID of TPCs belonging to the specified TPC set. More...
 
virtual geo::TPCID FirstTPCinTPCset (readout::TPCsetID const &tpcsetid) const =0
 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 =0
 Returns the total number of ROP in the specified TPC set. More...
 
virtual unsigned int MaxROPs () const =0
 Returns the largest number of ROPs a TPC set in the detector has. More...
 
virtual bool HasROP (readout::ROPID const &ropid) const =0
 
virtual readout::ROPID WirePlaneToROP (geo::PlaneID const &planeid) const =0
 Returns the ID of the ROP planeid belongs to. More...
 
virtual std::vector< geo::PlaneIDROPtoWirePlanes (readout::ROPID const &ropid) const =0
 Returns a list of ID of planes belonging to the specified ROP. More...
 
virtual geo::PlaneID FirstWirePlaneInROP (readout::ROPID const &ropid) const =0
 Returns the ID of the first plane belonging to the specified ROP. More...
 
virtual std::vector< geo::TPCIDROPtoTPCs (readout::ROPID const &ropid) const =0
 Returns a list of ID of TPCs the specified ROP spans. More...
 
virtual readout::ROPID ChannelToROP (raw::ChannelID_t channel) const =0
 Returns the ID of the ROP the channel belongs to. More...
 
virtual raw::ChannelID_t FirstChannelInROP (readout::ROPID const &ropid) const =0
 Returns the ID of the first channel in the specified readout plane. More...
 
Testing (not in the interface)
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...
 

Protected Types

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

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...
 
Internal structure data access

These functions allow access to the XxxInfoMap_t types based on geometry element IDs. They are strictly internal.

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
 Returns the specified element of the TPC map. More...
 
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
 Returns whether the ID specifies a valid entry. More...
 
template<typename T >
bool isValidElement (PlaneInfoMap_t< T > const &map, geo::PlaneID const &id) const
 Returns whether the ID specifies a valid entry. More...
 

Protected Attributes

PlaneInfoMap_t< raw::ChannelID_tfFirstChannelInThisPlane
 
PlaneInfoMap_t< raw::ChannelID_tfFirstChannelInNextPlane
 
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
 

TPC channel mapping

virtual unsigned int Nchannels () const =0
 Returns the total number of channels present (not necessarily contiguous) More...
 
virtual unsigned int Nchannels (readout::ROPID const &ropid) const =0
 Returns the number of channels in the specified ROP. 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...
 
virtual std::vector< WireIDChannelToWire (raw::ChannelID_t channel) const =0
 
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...
 
virtual std::set< geo::PlaneID > const & PlaneIDs () const =0
 Returns a list of the plane IDs in the whole detector. More...
 
virtual raw::ChannelID_t PlaneWireToChannel (geo::WireID const &wireID) const
 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 =0
 Returns the channel ID a wire is connected to. More...
 
virtual geo::SigType_t SignalTypeForChannelImpl (raw::ChannelID_t const channel) const =0
 Return the signal type of the specified channel. More...
 
virtual geo::SigType_t SignalTypeForROPIDImpl (readout::ROPID const &ropid) const
 Return the signal type on the specified readout plane. More...
 

Detailed Description

Interface for a class providing readout channel mapping to geometry.

Note
A number of methods react specifically when provided with invalid IDs as arguments. An invalid ID is an ID with the isValid flag unset, or, in case of channel IDs, an ID with value raw::InvalidChannelID. An ID that does not present this feature is by definition "valid"; this does not imply that the represented entity (channel, geometry entity or readout group) actually exists. The behaviour of the methods to valid, non-existent IDs should be considered undefined, and it is recommended that the existence of the entity is checked beforehand. Unless the documentation explicitly defines a behaviour, an undefined behaviour should be assumed; nevertheless, the documentation of some of the methods still reminds of this.

Definition at line 55 of file ChannelMapAlg.h.

Member Typedef Documentation

template<typename T >
using geo::ChannelMapAlg::PlaneInfoMap_t = TPCInfoMap_t<std::vector<T>>
protected

Data type for per-plane information.

Definition at line 610 of file ChannelMapAlg.h.

template<typename T >
using geo::ChannelMapAlg::TPCInfoMap_t = std::vector<std::vector<T>>
protected

Data type for per-TPC information.

Definition at line 606 of file ChannelMapAlg.h.

Constructor & Destructor Documentation

virtual geo::ChannelMapAlg::~ChannelMapAlg ( )
virtualdefault

Virtual destructor.

Member Function Documentation

template<typename T >
T const& geo::ChannelMapAlg::AccessElement ( TPCInfoMap_t< T > const &  map,
geo::TPCID const &  id 
) const
inlineprotected

Returns the specified element of the TPC map.

Definition at line 633 of file ChannelMapAlg.h.

References AccessElementSize().

Referenced by geo::ChannelMapStandardAlg::FirstChannelInROP(), isValidElement(), geo::ChannelMapStandardAlg::NROPs(), geo::ChannelMapStandardAlg::WireCoordinate(), and geo::ChannelMapStandardAlg::WireCount().

634  { return map[id.Cryostat][id.TPC]; }
template<typename T >
T const& geo::ChannelMapAlg::AccessElement ( PlaneInfoMap_t< T > const &  map,
geo::PlaneID const &  id 
) const
inlineprotected

Returns the specified element of the plane map.

Definition at line 660 of file ChannelMapAlg.h.

References AccessElementSize().

661  { return map[id.Cryostat][id.TPC][id.Plane]; }
template<typename T >
size_t geo::ChannelMapAlg::AccessElementSize ( TPCInfoMap_t< T > const &  map,
geo::CryostatID const &  id 
) const
inlineprotected

Returns the number of elements in the specified cryostat of the TPC map.

Definition at line 639 of file ChannelMapAlg.h.

References isValidElement().

Referenced by AccessElement().

640  { return map[id.Cryostat].size(); }
template<typename T >
size_t geo::ChannelMapAlg::AccessElementSize ( PlaneInfoMap_t< T > const &  map,
geo::TPCID const &  id 
) const
inlineprotected

Returns the number of elements in the specified TPC of the plane map.

Definition at line 666 of file ChannelMapAlg.h.

References isValidElement().

667  { return map[id.Cryostat][id.TPC].size(); }
size_t geo::ChannelMapAlg::ChannelToAuxDet ( std::vector< geo::AuxDetGeo * > const &  auxDets,
std::string const &  detName,
uint32_t const &  channel 
) const
virtual

Returns the index of the detector containing the specified channel.

Parameters
auxDetslist of the auxiliary detectors
detNamename of the auxiliary detector being investigated
channelnumber of the channel within that auxiliary detector
Returns
index of the sought auxiliary detector within auxDets
Bug:
This function is somehow broken in that it ignores the auxDets in the arguments and instead relies on a cache that is never filled by this class (derived classes can fill it though).

Definition at line 151 of file ChannelMapAlg.cxx.

References fADNameToGeo.

Referenced by ChannelToSensitiveAuxDet(), and NearestWire().

154  {
155  // loop over the map of AuxDet names to Geo object numbers to determine which auxdet
156  // we have. If no name in the map matches the provided string, throw an exception
157  for(auto itr : fADNameToGeo)
158  if( itr.first.compare(detName) == 0 ) return itr.second;
159 
160 
161  throw cet::exception("Geometry") << "No AuxDetGeo matching name: " << detName;
162 
163  return UINT_MAX;
164  }
std::map< std::string, size_t > fADNameToGeo
map the names of the dets to the AuxDetGeo objects
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
virtual readout::ROPID geo::ChannelMapAlg::ChannelToROP ( raw::ChannelID_t  channel) const
pure virtual

Returns the ID of the ROP the channel belongs to.

Returns
the ID of the ROP the channel belongs to (invalid if channel is)
See also
HasChannel()

The channel must exist, or be the invalid channel value. With a channel that is not present in the mapping and that is not the invalid channel (raw::InvalidChannelID), the result is undefined.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

std::pair< size_t, size_t > geo::ChannelMapAlg::ChannelToSensitiveAuxDet ( std::vector< geo::AuxDetGeo * > const &  auxDets,
std::string const &  detName,
uint32_t const &  channel 
) const
virtual

Returns the index of the sensitive detector containing the channel.

Parameters
auxDetslist of the sensitive auxiliary detectors
detNamename of the auxiliary detector being investigated
channelnumber of the channel within that auxiliary detector
Returns
index of the sought sensitive auxiliary detector within auxDets

Definition at line 169 of file ChannelMapAlg.cxx.

References ChannelToAuxDet(), and fADChannelToSensitiveGeo.

Referenced by NearestWire().

172  {
173  size_t adGeoIdx = this->ChannelToAuxDet(auxDets, detName, channel);
174 
175  // look for the index of the sensitive volume for the given channel
176  if( fADChannelToSensitiveGeo.count(adGeoIdx) > 0 ){
177 
178  auto itr = fADChannelToSensitiveGeo.find(adGeoIdx);
179 
180  // get the vector of channels to AuxDetSensitiveGeo index
181  if( channel < itr->second.size() )
182  return std::make_pair(adGeoIdx, itr->second[channel]);
183 
184  throw cet::exception("Geometry") << "Given AuxDetSensitive channel, " << channel
185  << ", cannot be found in vector associated to AuxDetGeo index: "
186  << adGeoIdx << ". Vector has size " << itr->second.size();
187  }
188 
189  throw cet::exception("Geometry") << "Given AuxDetGeo with index " << adGeoIdx
190  << " does not correspond to any vector of sensitive volumes";
191 
192  return std::make_pair(adGeoIdx, UINT_MAX);
193  }
std::map< size_t, std::vector< size_t > > fADChannelToSensitiveGeo
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.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
virtual std::vector<WireID> geo::ChannelMapAlg::ChannelToWire ( raw::ChannelID_t  channel) const
pure virtual

Returns a list of TPC wires connected to the specified readout channel ID

Exceptions
cet::exception(category: "Geometry") if non-existent channel

Implemented in geo::ChannelMapStandardAlg.

Referenced by HasChannel().

const std::vector<std::vector<std::vector<raw::ChannelID_t> > > geo::ChannelMapAlg::FirstChannelInNextPlane ( ) const
inline

Retrieve the private fFirstChannelInNextPlane vector for testing.

Definition at line 591 of file ChannelMapAlg.h.

References fFirstChannelInThisPlane.

592  { return fFirstChannelInThisPlane; }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInThisPlane
virtual raw::ChannelID_t geo::ChannelMapAlg::FirstChannelInROP ( readout::ROPID const &  ropid) const
pure virtual

Returns the ID of the first channel in the specified readout plane.

Parameters
ropidID of the readout plane
Returns
ID of first channel, or raw::InvalidChannelID if ID is invalid

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.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire(), and SignalTypeForROPIDImpl().

const std::vector<std::vector<std::vector<raw::ChannelID_t> > > geo::ChannelMapAlg::FirstChannelInThisPlane ( ) const
inline

Retrieve the private fFirstChannelInThisPlane vector for testing.

Definition at line 595 of file ChannelMapAlg.h.

References fFirstChannelInNextPlane.

596  { return fFirstChannelInNextPlane; }
PlaneInfoMap_t< raw::ChannelID_t > fFirstChannelInNextPlane
virtual geo::TPCID geo::ChannelMapAlg::FirstTPCinTPCset ( readout::TPCsetID const &  tpcsetid) const
pure virtual

Returns the ID of the first TPC belonging to the specified TPC set.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual geo::PlaneID geo::ChannelMapAlg::FirstWirePlaneInROP ( readout::ROPID const &  ropid) const
pure virtual

Returns the ID of the first plane belonging to the specified ROP.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

template<typename T >
T const* geo::ChannelMapAlg::GetElementPtr ( PlaneInfoMap_t< T > const &  map,
geo::PlaneID const &  id 
) const
inlineprotected

Returns a pointer to the specified element, or nullptr if invalid.

Definition at line 693 of file ChannelMapAlg.h.

Referenced by isValidElement(), and geo::ChannelMapStandardAlg::PlaneWireToChannel().

694  {
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];
701  return &plane_map;
702  } // GetElementPtr()
recob::tracking::Plane Plane
Definition: TrackState.h:17
unsigned int geo::ChannelMapAlg::HardwareChannelFromOpChannel ( unsigned int  opChannel) const
virtual

Returns the hardware channel number of specified optical channel.

Parameters
opChannelthe optical detector channel being queried
Returns
the optical detector the specified optical channel belongs to

If the specified optical channel is invalid, behaviour is undefined.

Definition at line 57 of file ChannelMapAlg.cxx.

Referenced by IsValidOpChannel(), and PlaneWireToChannel().

58  {
59  return 0;
60  }
virtual bool geo::ChannelMapAlg::HasChannel ( raw::ChannelID_t  channel) const
inlinevirtual

Returns whether the specified channel is valid This default implementation assumes all channels up to Nchannels() valid.

Definition at line 90 of file ChannelMapAlg.h.

References ChannelToWire(), raw::isValidChannelID(), Nchannels(), PlaneIDs(), SignalTypeForChannel(), SignalTypeForChannelImpl(), SignalTypeForROPID(), and SignalTypeForROPIDImpl().

91  { return raw::isValidChannelID(channel)? channel < Nchannels(): false; }
virtual unsigned int Nchannels() const =0
Returns the total number of channels present (not necessarily contiguous)
constexpr bool isValidChannelID(raw::ChannelID_t channel)
Definition: RawTypes.h:36
virtual bool geo::ChannelMapAlg::HasROP ( readout::ROPID const &  ropid) const
pure virtual

Returns whether we have the specified ROP

Returns
whether the readout plane is valid and exists

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual bool geo::ChannelMapAlg::HasTPCset ( readout::TPCsetID const &  tpcsetid) const
pure virtual

Returns whether we have the specified TPC set

Returns
whether the TPC set is valid and exists

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual void geo::ChannelMapAlg::Initialize ( GeometryData_t const &  geodata)
pure virtual

Geometry initialisation.

Implemented in geo::ChannelMapStandardAlg.

template<typename T >
bool geo::ChannelMapAlg::isValidElement ( TPCInfoMap_t< T > const &  map,
geo::CryostatID const &  id 
) const
inlineprotected

Returns whether the ID specifies a valid entry.

Definition at line 646 of file ChannelMapAlg.h.

Referenced by AccessElementSize(), and isValidElement().

647  { return id.Cryostat < map.size(); }
template<typename T >
bool geo::ChannelMapAlg::isValidElement ( TPCInfoMap_t< T > const &  map,
geo::TPCID const &  id 
) const
inlineprotected

Returns the specified element of the TPC map.

Definition at line 649 of file ChannelMapAlg.h.

References AccessElement(), and isValidElement().

650  {
651  return isValidElement(map, id.asCryostatID())
652  && (id.TPC < map[id.Cryostat].size());
653  }
bool isValidElement(TPCInfoMap_t< T > const &map, geo::CryostatID const &id) const
Returns whether the ID specifies a valid entry.
template<typename T >
bool geo::ChannelMapAlg::isValidElement ( PlaneInfoMap_t< T > const &  map,
geo::CryostatID const &  id 
) const
inlineprotected

Returns whether the ID specifies a valid entry.

Definition at line 673 of file ChannelMapAlg.h.

674  { return id.Cryostat < map.size(); }
template<typename T >
bool geo::ChannelMapAlg::isValidElement ( PlaneInfoMap_t< T > const &  map,
geo::TPCID const &  id 
) const
inlineprotected

Returns whether the ID specifies a valid entry.

Definition at line 676 of file ChannelMapAlg.h.

References isValidElement().

677  {
678  return isValidElement(map, id.asCryostatID())
679  && (id.TPC < map[id.Cryostat].size());
680  }
bool isValidElement(TPCInfoMap_t< T > const &map, geo::CryostatID const &id) const
Returns whether the ID specifies a valid entry.
template<typename T >
bool geo::ChannelMapAlg::isValidElement ( PlaneInfoMap_t< T > const &  map,
geo::PlaneID const &  id 
) const
inlineprotected

Returns whether the ID specifies a valid entry.

Definition at line 683 of file ChannelMapAlg.h.

References GetElementPtr(), and isValidElement().

684  {
685  return isValidElement(map, id.asTPCID())
686  && (id.Plane < AccessSize(map, id.asTPCID()));
687  }
bool isValidElement(TPCInfoMap_t< T > const &map, geo::CryostatID const &id) const
Returns whether the ID specifies a valid entry.
bool geo::ChannelMapAlg::IsValidOpChannel ( unsigned int  opChannel,
unsigned int  NOpDets 
) const
virtual

Returns whether the ID identifies a valid optical detector channel.

Parameters
opChannelchannel number
NOpDetsnumber of optical detectors in the detector
Returns
whether opChannel would be a valid channel

The specification of the number of optical channels reflects the logic described in NOpChannel().

Definition at line 63 of file ChannelMapAlg.cxx.

References HardwareChannelFromOpChannel(), NOpChannels(), NOpHardwareChannels(), and OpDetFromOpChannel().

Referenced by PlaneWireToChannel().

64  {
65  // Check channel number
66  if ( opChannel >= this->NOpChannels(NOpDets) ) return false;
67 
68  // Check opdet number
69  unsigned int opdet = this->OpDetFromOpChannel(opChannel);
70  if (opdet >= NOpDets) return false;
71 
72  // Check hardware channel number
73  unsigned int hChan = this->HardwareChannelFromOpChannel(opChannel);
74  if (hChan >= this->NOpHardwareChannels(opdet)) return false;
75 
76  return true;
77  }
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 unsigned int HardwareChannelFromOpChannel(unsigned int opChannel) const
Returns the hardware channel number of specified optical channel.
virtual unsigned int NOpHardwareChannels(unsigned int opDet) const
Returns the number of channels in the specified optical detectors.
unsigned int geo::ChannelMapAlg::MaxOpChannel ( unsigned int  NOpDets) const
virtual

Returns the number of optical channels contained in some detectors.

Parameters
NOpDetsnumber of optical detectors
Returns
optical channels contained in NOpDets detectors

This function returns the first optical channel ID larger than the last channel ID in a detector with NOpDets optical detectors (with the same logic as NOpChannels()). For example, in a detector with 32 channels with contiguous IDs starting at 0, this function would return 32. If the channels started with ID 1, this function would instead return 33 and if there were a 16 channel gap, so that valid channels are from 0 to 15 and from 32 to 47, this function would return 48.

Definition at line 29 of file ChannelMapAlg.cxx.

References NOpChannels().

Referenced by PlaneWireToChannel().

30  {
31  // By default just return the number of optical detectos
32  return NOpChannels(NOpDets);
33  }
virtual unsigned int NOpChannels(unsigned int NOpDets) const
Returns the number of optical channels contained in some detectors.
virtual unsigned int geo::ChannelMapAlg::MaxROPs ( ) const
pure virtual

Returns the largest number of ROPs a TPC set in the detector has.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual unsigned int geo::ChannelMapAlg::MaxTPCsets ( ) const
pure virtual

Returns the largest number of TPC sets any cryostat in the detector has.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual unsigned int geo::ChannelMapAlg::Nchannels ( ) const
pure virtual

Returns the total number of channels present (not necessarily contiguous)

Implemented in geo::ChannelMapStandardAlg.

Referenced by HasChannel().

virtual unsigned int geo::ChannelMapAlg::Nchannels ( readout::ROPID const &  ropid) const
pure virtual

Returns the number of channels in the specified ROP.

Returns
number of channels in the specified ROP, 0 if non-existent

Implemented in geo::ChannelMapStandardAlg.

size_t geo::ChannelMapAlg::NearestAuxDet ( const double *  point,
std::vector< geo::AuxDetGeo * > const &  auxDets 
) const
virtual

Returns the auxiliary detector closest to the specified point.

Parameters
pointcoordinates of the position to be investigated (x, y, z)
auxDetslist of the sought auxiliary detectors
Returns
index of auxiliary detector within auxDets

Definition at line 80 of file ChannelMapAlg.cxx.

Referenced by NearestSensitiveAuxDet(), and NearestWire().

82  {
83  double HalfCenterWidth = 0.;
84  double localPoint[3] = {0.};
85 
86  for(size_t a = 0; a < auxDets.size(); ++a) {
87 
88  auxDets[a]->WorldToLocal(point, localPoint);
89 
90  HalfCenterWidth = 0.5 * (auxDets[a]->HalfWidth1() + auxDets[a]->HalfWidth2());
91 
92  if( localPoint[2] >= - auxDets[a]->Length()/2 &&
93  localPoint[2] <= auxDets[a]->Length()/2 &&
94  localPoint[1] >= - auxDets[a]->HalfHeight() &&
95  localPoint[1] <= auxDets[a]->HalfHeight() &&
96  // if AuxDet a is a box, then HalfSmallWidth = HalfWidth
97  localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - auxDets[a]->HalfWidth2())/(0.5 * auxDets[a]->Length()) &&
98  localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - auxDets[a]->HalfWidth2())/(0.5 * auxDets[a]->Length())
99  ) return a;
100 
101  }// for loop over AudDet a
102 
103  // throw an exception because we couldn't find the sensitive volume
104  throw cet::exception("ChannelMap") << "Can't find AuxDet for position ("
105  << point[0] << ","
106  << point[1] << ","
107  << point[2] << ")\n";
108 
109  return UINT_MAX;
110 
111  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
size_t geo::ChannelMapAlg::NearestSensitiveAuxDet ( const double *  point,
std::vector< geo::AuxDetGeo * > const &  auxDets 
) const
virtual

Returns sensitive auxiliary detector closest to specified point.

Parameters
pointcoordinates of the position to be investigated (x, y, z)
auxDetslist of the auxiliary detectors
Returns
index of sought sensitive auxiliary detector within auxDets

Definition at line 114 of file ChannelMapAlg.cxx.

References geo::AuxDetSensitiveGeo::HalfHeight(), geo::AuxDetSensitiveGeo::HalfWidth1(), geo::AuxDetSensitiveGeo::HalfWidth2(), geo::AuxDetSensitiveGeo::Length(), NearestAuxDet(), geo::AuxDetGeo::NSensitiveVolume(), geo::AuxDetGeo::SensitiveVolume(), and geo::AuxDetSensitiveGeo::WorldToLocal().

Referenced by NearestWire().

116  {
117  double HalfCenterWidth = 0.;
118  double localPoint[3] = {0.};
119 
120  size_t auxDetIdx = this->NearestAuxDet(point, auxDets);
121 
122  geo::AuxDetGeo* adg = auxDets[auxDetIdx];
123 
124  for(size_t a = 0; a < adg->NSensitiveVolume(); ++a) {
125 
126  geo::AuxDetSensitiveGeo const& adsg = adg->SensitiveVolume(a);
127  adsg.WorldToLocal(point, localPoint);
128 
129  HalfCenterWidth = 0.5 * (adsg.HalfWidth1() + adsg.HalfWidth2());
130 
131  if( localPoint[2] >= - adsg.Length()/2 &&
132  localPoint[2] <= adsg.Length()/2 &&
133  localPoint[1] >= - adsg.HalfHeight() &&
134  localPoint[1] <= adsg.HalfHeight() &&
135  // if AuxDet a is a box, then HalfSmallWidth = HalfWidth
136  localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - adsg.HalfWidth2())/(0.5 * adsg.Length()) &&
137  localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - adsg.HalfWidth2())/(0.5 * adsg.Length())
138  ) return a;
139  }// for loop over AuxDetSensitive a
140 
141  // throw an exception because we couldn't find the sensitive volume
142  throw cet::exception("Geometry") << "Can't find AuxDetSensitive for position ("
143  << point[0] << ","
144  << point[1] << ","
145  << point[2] << ")\n";
146 
147  return UINT_MAX;
148  }
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:159
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo * > const &auxDets) const
Returns the auxiliary detector closest to the specified point.
size_t NSensitiveVolume() const
Definition: AuxDetGeo.h:160
void WorldToLocal(const double *world, double *auxdet) const
Transform point from world frame to local auxiliary detector frame.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int geo::ChannelMapAlg::NearestWire ( const TVector3 &  worldPos,
geo::PlaneID const &  planeID 
) const

Returns the index of the wire nearest to the specified position.

Parameters
worldPosposition to be tested
planeIDplane containing the wire
Returns
the ID of the wire closest to worldPos in the specified plane
See also
NearestWireID(const TVector3&, geo::PlaneID const&)
Deprecated:
Use NearestWireID(const TVector3&, geo::PlaneID const&) instead.

Definition at line 15 of file ChannelMapAlg.cxx.

References NearestWireID(), and geo::WireID::Wire.

Referenced by NearestWire(), and NearestWireID().

17  {
18  return NearestWireID(worldPos, planeID).Wire;
19  }
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:313
virtual geo::WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the ID of the wire nearest to the specified position.
unsigned int geo::ChannelMapAlg::NearestWire ( const TVector3 &  worldPos,
unsigned int  PlaneNo,
unsigned int  TPCNo,
unsigned int  cstat 
) const
inline

Returns the index of the wire nearest to the specified position.

Parameters
worldPosposition to be tested
PlaneNonumber of plane containing the wire
TPCNonumber of TPC containing the wire
cstatnumber of cryostat containing the wire
Returns
the ID of the wire closest to worldPos in the specified plane
See also
NearestWireID(const TVector3&, geo::PlaneID const&)
Deprecated:
Use NearestWireID(const TVector3&, geo::PlaneID const&) instead.

Definition at line 408 of file ChannelMapAlg.h.

References ChannelToAuxDet(), ChannelToROP(), ChannelToSensitiveAuxDet(), FirstChannelInROP(), FirstTPCinTPCset(), FirstWirePlaneInROP(), HasROP(), HasTPCset(), MaxROPs(), MaxTPCsets(), NearestAuxDet(), NearestSensitiveAuxDet(), NearestWire(), NROPs(), NTPCsets(), ROPtoTPCs(), ROPtoWirePlanes(), Sorter(), TPCsetToTPCs(), TPCtoTPCset(), and WirePlaneToROP().

412  { return NearestWire(worldPos, geo::PlaneID(cstat, TPCNo, PlaneNo)); }
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
unsigned int NearestWire(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the index of the wire nearest to the specified position.
virtual geo::WireID geo::ChannelMapAlg::NearestWireID ( const TVector3 &  worldPos,
geo::PlaneID const &  planeID 
) const
inlinevirtual

Returns the ID of the wire nearest to the specified position.

Parameters
worldPosposition to be tested
planeIDplane containing the wire
Returns
the ID of the wire closest to worldPos in the specified plane
Exceptions
InvalidWireIDErrorthe ID found is not present in the detector
See also
WireCoordinate(double, double, geo::PlaneID const&)

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 in geo::ChannelMapStandardAlg.

Definition at line 361 of file ChannelMapAlg.h.

References geo::CryostatID::Cryostat, NearestWire(), geo::PlaneID::Plane, and geo::TPCID::TPC.

Referenced by NearestWire(), and WireCoordinate().

362  {
363  return
364  NearestWireID(worldPos, planeID.Plane, planeID.TPC, planeID.Cryostat);
365  }
virtual geo::WireID NearestWireID(const TVector3 &worldPos, geo::PlaneID const &planeID) const
Returns the ID of the wire nearest to the specified position.
virtual geo::WireID geo::ChannelMapAlg::NearestWireID ( const TVector3 &  worldPos,
unsigned int  PlaneNo,
unsigned int  TPCNo,
unsigned int  cstat 
) const
pure virtual

Returns the ID of the wire nearest to the specified position.

Parameters
worldPosposition to be tested
PlaneNonumber of plane containing the wire
TPCNonumber of TPC containing the wire
cstatnumber of cryostat containing the wire
Returns
the ID of the wire closest to worldPos in the specified plane
See also
NearestWireID(const TVector3&, geo::PlaneID const&)
Deprecated:
Use the version with geo::PlaneID instead

Implemented in geo::ChannelMapStandardAlg.

unsigned int geo::ChannelMapAlg::NOpChannels ( unsigned int  NOpDets) const
virtual

Returns the number of optical channels contained in some detectors.

Parameters
NOpDetsnumber of optical detectors
Returns
optical channels contained in NOpDets detectors

This function returns how many channels can be expected to be present in a detector with NOpDets optical detectors. This is an upper limit, as not all channels have necessarily to be present.

For example: if a detector has four channels per optical detector, the returned value will be four times the argument NOpDets. If there is a single channel on each optical detector, the return value will be the value NOpDets (this is in fact the fallback implementation). If each optical detector can have anywhere between 2 and 12 channels, the returned value is 12 times NOpDets, and it will be an overestimation of the number of channels.

Definition at line 22 of file ChannelMapAlg.cxx.

Referenced by IsValidOpChannel(), MaxOpChannel(), and PlaneWireToChannel().

23  {
24  // By default just return the number of optical detectos
25  return NOpDets;
26  }
unsigned int geo::ChannelMapAlg::NOpHardwareChannels ( unsigned int  opDet) const
virtual

Returns the number of channels in the specified optical detectors.

Parameters
opDetID of the chosen optical detector
Returns
optical channels contained in optical detector with ID opDet

This function returns how many channels are actually present in the optical detector with the specified ID.

For example: if a detector has four channels per optical detector, the returned value will be four, regardless opDet, and . If there is a single channel on each optical detector, the return value will be 1, again ignoring opDet (this is in fact the fallback implementation). If each optical detector can have anywhere between 2 and 12 channels, the returned value will be 2, 12, etc., that is the exact number of channels in opDet.

Although implementations are encouraged to return 0 on invalid optical detectors, the actual return value in that case is undefined.

Definition at line 36 of file ChannelMapAlg.cxx.

Referenced by IsValidOpChannel(), and PlaneWireToChannel().

37  {
38  // By defualt, 1 channel per optical detector
39  return 1;
40  }
virtual unsigned int geo::ChannelMapAlg::NROPs ( readout::TPCsetID const &  tpcsetid) const
pure virtual

Returns the total number of ROP in the specified TPC set.

Parameters
tpcsetidTPC set ID
Returns
number of readout planes in the TPC set, or 0 if no TPC set found

Note that this methods explicitly check the existence of the TPC set.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual unsigned int geo::ChannelMapAlg::NTPCsets ( readout::CryostatID const &  cryoid) const
pure virtual

Returns the total number of TPC sets in the specified cryostat.

Parameters
cryoidcryostat ID
Returns
number of TPC sets in the cryostat, or 0 if no cryostat found

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

unsigned int geo::ChannelMapAlg::OpChannel ( unsigned int  detNum,
unsigned int  hwchannel = 0 
) const
virtual

Returns the channel ID of the specified hardware channel.

Parameters
detNumoptical detector ID
hwchannelhardware channel within the specified optical detector
Returns
ID of the channel identified by detector and hardware channel IDs

If the input IDs identify a non-existing channel, the result is undefined.

Definition at line 45 of file ChannelMapAlg.cxx.

Referenced by PlaneWireToChannel().

46  {
47  return detNum;
48  }
unsigned int geo::ChannelMapAlg::OpDetFromOpChannel ( unsigned int  opChannel) const
virtual

Returns the optical detector the specified optical channel belongs.

Parameters
opChannelthe optical detector channel being queried
Returns
the optical detector the specified optical channel belongs to

If the specified optical channel is invalid, behaviour is undefined.

Definition at line 51 of file ChannelMapAlg.cxx.

Referenced by IsValidOpChannel(), and PlaneWireToChannel().

52  {
53  return opChannel;
54  }
virtual std::set<geo::PlaneID> const& geo::ChannelMapAlg::PlaneIDs ( ) const
pure virtual

Returns a list of the plane IDs in the whole detector.

Implemented in geo::ChannelMapStandardAlg.

Referenced by HasChannel().

virtual raw::ChannelID_t geo::ChannelMapAlg::PlaneWireToChannel ( geo::WireID const &  wireID) const
inlinevirtual

Returns the channel ID a wire is connected to.

Parameters
wireIDID of the wire
Returns
the ID of the channel
See also
PlaneWireToChannel(geo::WireID const&)

Behaviour on an invalid or not present wires is undefined.

Deprecated:
Use the version with geo::WireID

Reimplemented in geo::ChannelMapStandardAlg.

Definition at line 167 of file ChannelMapAlg.h.

References geo::CryostatID::Cryostat, HardwareChannelFromOpChannel(), IsValidOpChannel(), MaxOpChannel(), NOpChannels(), NOpHardwareChannels(), OpChannel(), OpDetFromOpChannel(), geo::PlaneID::Plane, geo::TPCID::TPC, and geo::WireID::Wire.

168  {
169  return PlaneWireToChannel
170  (wireID.Plane, wireID.Wire, wireID.TPC, wireID.Cryostat);
171  }
virtual raw::ChannelID_t PlaneWireToChannel(geo::WireID const &wireID) const
Returns the channel ID a wire is connected to.
virtual raw::ChannelID_t geo::ChannelMapAlg::PlaneWireToChannel ( unsigned int  plane,
unsigned int  wire,
unsigned int  tpc,
unsigned int  cstat 
) const
pure virtual

Returns the channel ID a wire is connected to.

Parameters
planenumber of plane
wirenumber of wire
tpcnumber of TPC
cstatnumber of cryostat
Returns
the ID of the channel
See also
PlaneWireToChannel(geo::WireID const&)
Deprecated:
Use the version with geo::WireID

Implemented in geo::ChannelMapStandardAlg.

virtual std::vector<geo::TPCID> geo::ChannelMapAlg::ROPtoTPCs ( readout::ROPID const &  ropid) const
pure virtual

Returns a list of ID of TPCs the specified ROP spans.

Parameters
ropidID of the readout plane
Returns
the list of TPC IDs, empty if readout plane ID is invalid

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.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual std::vector<geo::PlaneID> geo::ChannelMapAlg::ROPtoWirePlanes ( readout::ROPID const &  ropid) const
pure virtual

Returns a list of ID of planes belonging to the specified ROP.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

geo::SigType_t geo::ChannelMapAlg::SignalTypeForChannel ( raw::ChannelID_t const  channel) const

Return the signal type of the specified channel.

Parameters
channelID of the channel
Returns
signal type of the channel, or geo::kMysteryType if not known

On any type of error (e.g., invalid or unknown channel ID), geo::kMysteryType is returned.

Definition at line 195 of file ChannelMapAlg.cxx.

References SignalTypeForChannelImpl().

Referenced by HasChannel(), and SignalTypeForROPIDImpl().

196  {
197  return SignalTypeForChannelImpl(channel);
198  }
virtual geo::SigType_t SignalTypeForChannelImpl(raw::ChannelID_t const channel) const =0
Return the signal type of the specified channel.
virtual geo::SigType_t geo::ChannelMapAlg::SignalTypeForChannelImpl ( raw::ChannelID_t const  channel) const
protectedpure virtual

Return the signal type of the specified channel.

Parameters
channelID of the channel
Returns
signal type of the channel, or geo::kMysteryType if not known

On any type of error (e.g., invalid or unknown channel ID), geo::kMysteryType is returned.

Implemented in geo::ChannelMapStandardAlg.

Referenced by HasChannel(), and SignalTypeForChannel().

geo::SigType_t geo::ChannelMapAlg::SignalTypeForROPID ( readout::ROPID const &  ropid) const

Return the signal type on the specified readout plane.

Parameters
ropidID of the readout plane
Returns
signal type on the plane, or geo::kMysteryType if not known

If the readout plane ID is marked invalid, geo::kMysteryType is returned. If the readout plane is not marked invalid, but it does not match an existing readout plane, the result is undefined.

The default implementation uses readout plane to channel mapping. Other implementation may decide to do the opposite.

Definition at line 200 of file ChannelMapAlg.cxx.

References SignalTypeForROPIDImpl().

Referenced by HasChannel().

201  {
202  return SignalTypeForROPIDImpl(ropid);
203  }
virtual geo::SigType_t SignalTypeForROPIDImpl(readout::ROPID const &ropid) const
Return the signal type on the specified readout plane.
geo::SigType_t geo::ChannelMapAlg::SignalTypeForROPIDImpl ( readout::ROPID const &  ropid) const
protectedvirtual

Return the signal type on the specified readout plane.

Parameters
ropidID of the readout plane
Returns
signal type on the plane, or geo::kMysteryType if not known

If the readout plane ID is marked invalid, geo::kMysteryType is returned. If the readout plane is not marked invalid, but it does not match an existing readout plane, the result is undefined.

The default implementation uses readout plane to channel mapping. Other implementation may decide to do the opposite.

Definition at line 205 of file ChannelMapAlg.cxx.

References FirstChannelInROP(), and SignalTypeForChannel().

Referenced by HasChannel(), and SignalTypeForROPID().

206  {
208  }
geo::SigType_t SignalTypeForChannel(raw::ChannelID_t const channel) const
Return the signal type of the specified channel.
virtual raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const =0
Returns the ID of the first channel in the specified readout plane.
virtual geo::GeoObjectSorter const& geo::ChannelMapAlg::Sorter ( ) const
pure virtual

Returns the object to sort geometry with.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual std::vector<geo::TPCID> geo::ChannelMapAlg::TPCsetToTPCs ( readout::TPCsetID const &  tpcsetid) const
pure virtual

Returns a list of ID of TPCs belonging to the specified TPC set.

Parameters
tpcsetidID of the TPC set to convert into TPC IDs
Returns
the list of TPCs, empty if TPC set is invalid

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.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual readout::TPCsetID geo::ChannelMapAlg::TPCtoTPCset ( geo::TPCID const &  tpcid) const
pure virtual

Returns the ID of the TPC set tpcid belongs to.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

virtual void geo::ChannelMapAlg::Uninitialize ( )
pure virtual

Deconfiguration: prepare for a following call of Initialize()

Implemented in geo::ChannelMapStandardAlg.

virtual double geo::ChannelMapAlg::WireCoordinate ( double  YPos,
double  ZPos,
geo::PlaneID const &  planeID 
) const
inlinevirtual

Returns the index of the wire nearest to the specified position.

Parameters
YPosy coordinate on the wire plane
ZPosz coordinate on the wire plane
planeIDID of the plane
Returns
an index interpolation between the two nearest wires
See also
NearestWireID()

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 in geo::ChannelMapStandardAlg.

Definition at line 317 of file ChannelMapAlg.h.

References geo::CryostatID::Cryostat, NearestWireID(), geo::PlaneID::Plane, and geo::TPCID::TPC.

320  {
321  return WireCoordinate
322  (YPos, ZPos, planeID.Plane, planeID.TPC, planeID.Cryostat);
323  }
virtual double WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeID) const
Returns the index of the wire nearest to the specified position.
virtual double geo::ChannelMapAlg::WireCoordinate ( double  YPos,
double  ZPos,
unsigned int  PlaneNo,
unsigned int  TPCNo,
unsigned int  cstat 
) const
pure virtual

Returns the index of the wire nearest to the specified position.

Parameters
YPosy coordinate on the wire plane
ZPosz coordinate on the wire plane
PlaneNonumber of plane
TPCNonumber of TPC
cstatnumber of cryostat
Returns
an index interpolation between the two nearest wires
See also
WireCoordinate(double, double, geo::PlaneID const&)
Deprecated:
Use the version with geo::PlaneID instead

Implemented in geo::ChannelMapStandardAlg.

virtual readout::ROPID geo::ChannelMapAlg::WirePlaneToROP ( geo::PlaneID const &  planeid) const
pure virtual

Returns the ID of the ROP planeid belongs to.

Implemented in geo::ChannelMapStandardAlg.

Referenced by NearestWire().

Member Data Documentation

std::map<size_t, std::vector<size_t> > geo::ChannelMapAlg::fADChannelToSensitiveGeo
protected

map the AuxDetGeo index to a vector of indices corresponding to the AuxDetSensitiveGeo index

Definition at line 618 of file ChannelMapAlg.h.

Referenced by ChannelToSensitiveAuxDet().

std::map<std::string, size_t> geo::ChannelMapAlg::fADNameToGeo
protected

map the names of the dets to the AuxDetGeo objects

Definition at line 617 of file ChannelMapAlg.h.

Referenced by ChannelToAuxDet().


The documentation for this class was generated from the following files: