All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
geo::ChannelMapSBNDAlg Class Reference

Custom channel mapping algorithm for SBND. More...

#include <ChannelMapSBNDAlg.h>

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

Public Member Functions

 ChannelMapSBNDAlg (fhicl::ParameterSet const &p)
 
virtual geo::GeoObjectSorter
const & 
Sorter () const override
 Returns a custom SBND sorter. More...
 
virtual size_t NearestAuxDet (const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const override
 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 override
 Returns sensitive auxiliary detector closest to specified point. More...
 
- Public Member Functions inherited from geo::ChannelMapStandardAlg
 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< WireIDChannelToWire (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 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...
 
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::TPCIDTPCsetToTPCs (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...
 
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::PlaneIDROPtoWirePlanes (readout::ROPID const &ropid) const override
 Returns a list of ID of wire planes belonging to the specified ROP. More...
 
virtual std::vector< geo::TPCIDROPtoTPCs (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 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 Attributes

geo::GeoObjectSorterSBND fSBNDsorter
 Sorts geo::XXXGeo 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_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
 

Detailed Description

Custom channel mapping algorithm for SBND.

This uses the standard channel mapping, and the custom sorter GeoObjectSortersbnd.

Definition at line 32 of file ChannelMapSBNDAlg.h.

Constructor & Destructor Documentation

geo::ChannelMapSBNDAlg::ChannelMapSBNDAlg ( fhicl::ParameterSet const &  p)
inline

Definition at line 38 of file ChannelMapSBNDAlg.h.

40  , fSBNDsorter(p)
41  {}
pdgs p
Definition: selectors.fcl:22
geo::GeoObjectSorterSBND fSBNDsorter
Sorts geo::XXXGeo objects.
ChannelMapStandardAlg(fhicl::ParameterSet const &p)

Member Function Documentation

size_t geo::ChannelMapSBNDAlg::NearestAuxDet ( const double *  point,
std::vector< geo::AuxDetGeo > const &  auxDets,
double  tolerance = 0 
) const
overridevirtual

Returns the auxiliary detector closest to the specified point.

Reimplemented from geo::ChannelMapAlg.

Definition at line 12 of file ChannelMapSBNDAlg.cxx.

13  {
14  double HalfCenterWidth = 0.;
15  double localPoint[3] = {0.};
16 
17 
18  for(size_t a = 0; a < auxDets.size(); ++a) {
19 
20  auxDets[a].WorldToLocal(point, localPoint);
21 
22  HalfCenterWidth = 0.5 * (auxDets[a].HalfWidth1() + auxDets[a].HalfWidth2());
23 
24  if( localPoint[2] >= - (auxDets[a].Length()/2 + tolerance) &&
25  localPoint[2] <= (auxDets[a].Length()/2 + tolerance) &&
26  localPoint[1] >= - auxDets[a].HalfHeight() - tolerance &&
27  localPoint[1] <= auxDets[a].HalfHeight() + tolerance &&
28  // if AuxDet a is a box, then HalfSmallWidth = HalfWidth
29  localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - auxDets[a].HalfWidth2())/(0.5 * auxDets[a].Length()) - tolerance &&
30  localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - auxDets[a].HalfWidth2())/(0.5 * auxDets[a].Length()) + tolerance
31  ) return a;
32 
33  }// for loop over AudDet a
34 
35  // log a message because we couldn't find the aux det volume, exception in base class
36  mf::LogDebug("ChannelMapSBND") << "Can't find AuxDet for position ("
37  << point[0] << ","
38  << point[1] << ","
39  << point[2] << ")\n";
40 
41  return UINT_MAX;
42 
43  }
float Length(const PFPStruct &pfp)
Definition: PFPUtils.cxx:3304
auto const tolerance
process_name gaushit a
size_t geo::ChannelMapSBNDAlg::NearestSensitiveAuxDet ( const double *  point,
std::vector< geo::AuxDetGeo > const &  auxDets,
double  tolerance = 0 
) const
overridevirtual

Returns sensitive auxiliary detector closest to specified point.

Reimplemented from geo::ChannelMapAlg.

Definition at line 46 of file ChannelMapSBNDAlg.cxx.

47  {
48  double HalfCenterWidth = 0.;
49  double localPoint[3] = {0.};
50 
51  size_t auxDetIdx = this->NearestAuxDet(point, auxDets, tolerance);
52 
53  if(auxDetIdx == UINT_MAX)
54  return UINT_MAX;
55 
56  geo::AuxDetGeo const& adg = auxDets[auxDetIdx];
57 
58  for(size_t a = 0; a < adg.NSensitiveVolume(); ++a) {
59 
60  geo::AuxDetSensitiveGeo const& adsg = adg.SensitiveVolume(a);
61  adsg.WorldToLocal(point, localPoint);
62 
63  HalfCenterWidth = 0.5 * (adsg.HalfWidth1() + adsg.HalfWidth2());
64 
65  if( localPoint[2] >= - (adsg.Length()/2 + tolerance) &&
66  localPoint[2] <= (adsg.Length()/2 + tolerance) &&
67  localPoint[1] >= - adsg.HalfHeight() - tolerance &&
68  localPoint[1] <= adsg.HalfHeight() + tolerance &&
69  // if AuxDet a is a box, then HalfSmallWidth = HalfWidth
70  localPoint[0] >= - HalfCenterWidth + localPoint[2]*(HalfCenterWidth - adsg.HalfWidth2())/(0.5 * adsg.Length()) - tolerance &&
71  localPoint[0] <= HalfCenterWidth - localPoint[2]*(HalfCenterWidth - adsg.HalfWidth2())/(0.5 * adsg.Length()) + tolerance
72  ) return a;
73  }// for loop over AuxDetSensitive a
74 
75  // log a message because we couldn't find the sensitive aux det volume, exception in base class
76  mf::LogDebug("ChannelMapSBND") << "Can't find AuxDetSensitive for position ("
77  << point[0] << ","
78  << point[1] << ","
79  << point[2] << ")\n";
80 
81  return UINT_MAX;
82  }
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
Definition: AuxDetGeo.h:171
auto const tolerance
process_name gaushit a
size_t NSensitiveVolume() const
Definition: AuxDetGeo.h:172
void WorldToLocal(const double *world, double *auxdet) const
Transform point from world frame to local auxiliary detector frame.
virtual size_t NearestAuxDet(const double *point, std::vector< geo::AuxDetGeo > const &auxDets, double tolerance=0) const override
Returns the auxiliary detector closest to the specified point.
virtual geo::GeoObjectSorter const& geo::ChannelMapSBNDAlg::Sorter ( ) const
inlineoverridevirtual

Returns a custom SBND sorter.

Reimplemented from geo::ChannelMapStandardAlg.

Definition at line 44 of file ChannelMapSBNDAlg.h.

45  { return fSBNDsorter; }
geo::GeoObjectSorterSBND fSBNDsorter
Sorts geo::XXXGeo objects.

Member Data Documentation

geo::GeoObjectSorterSBND geo::ChannelMapSBNDAlg::fSBNDsorter
private

Sorts geo::XXXGeo objects.

Definition at line 34 of file ChannelMapSBNDAlg.h.


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