LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
AuxDetChannelMapAlg.h
Go to the documentation of this file.
1 #ifndef GEO_AUXDETCHANNELMAPALG_H
9 #define GEO_AUXDETCHANNELMAPALG_H
10 
12 
13 // C/C++ standard libraries
14 #include <cstddef>
15 #include <cstdint>
16 #include <map>
17 #include <string>
18 #include <vector>
19 
20 namespace geo {
21 
22  // forward-declaration from geometry
23  struct AuxDetGeometryData_t;
24  class AuxDetGeo;
25 
28 
29  using chanAndSV = std::pair<uint32_t, size_t>;
30 
31  public:
32  virtual ~AuxDetChannelMapAlg() = default;
33 
34  virtual void Initialize(AuxDetGeometryData_t& geodata) = 0;
35  virtual void Uninitialize() = 0;
36 
37  // method returns the entry in the sorted AuxDetGeo vector so that the
38  // Geometry in turn can return that object
39  virtual size_t NearestAuxDet(Point_t const& point,
40  std::vector<AuxDetGeo> const& auxDets,
41  double tolerance = 0) const;
42  virtual size_t NearestSensitiveAuxDet(Point_t const& point,
43  std::vector<AuxDetGeo> const& auxDets,
44  size_t& ad,
45  double tolerance = 0) const;
46  virtual size_t ChannelToAuxDet(std::vector<AuxDetGeo> const& auxDets,
47  std::string const& detName,
48  uint32_t channel) const;
49  virtual std::pair<size_t, size_t> ChannelToSensitiveAuxDet(
50  std::vector<AuxDetGeo> const& auxDets,
51  std::string const& detName,
52  uint32_t channel) const;
53 
54  // Experiments must implement these method. It accounts for auxiliary detectors like
55  // Multiwire proportional chambers where there is only a single sensitive volume, but
56  // multiple channels running through that volume.
57  virtual uint32_t PositionToAuxDetChannel(Point_t const& worldLoc,
58  std::vector<AuxDetGeo> const& auxDets,
59  size_t& ad,
60  size_t& sv) const = 0;
61 
62  virtual Point_t AuxDetChannelToPosition(uint32_t channel,
63  std::string const& auxDetName,
64  std::vector<AuxDetGeo> const& auxDets) const = 0;
65 
66  protected:
67  std::map<size_t, std::string> fADGeoToName;
68  std::map<std::string, size_t> fNameToADGeo;
69  std::map<size_t, std::vector<chanAndSV>>
71  };
74 }
75 #endif // GEO_AUXDETCHANNELMAPALG_H
std::map< std::string, size_t > fNameToADGeo
map the names to the AuxDetGeo index
virtual uint32_t PositionToAuxDetChannel(Point_t const &worldLoc, std::vector< AuxDetGeo > const &auxDets, size_t &ad, size_t &sv) const =0
std::map< size_t, std::vector< chanAndSV > > fADGeoToChannelAndSV
std::pair< uint32_t, size_t > chanAndSV
virtual ~AuxDetChannelMapAlg()=default
virtual void Initialize(AuxDetGeometryData_t &geodata)=0
virtual Point_t AuxDetChannelToPosition(uint32_t channel, std::string const &auxDetName, std::vector< AuxDetGeo > const &auxDets) const =0
virtual std::pair< size_t, size_t > ChannelToSensitiveAuxDet(std::vector< AuxDetGeo > const &auxDets, std::string const &detName, uint32_t channel) const
Definitions of geometry vector data types.
virtual size_t NearestAuxDet(Point_t const &point, std::vector< AuxDetGeo > const &auxDets, double tolerance=0) const
virtual size_t ChannelToAuxDet(std::vector< AuxDetGeo > const &auxDets, std::string const &detName, uint32_t channel) const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
virtual void Uninitialize()=0
virtual size_t NearestSensitiveAuxDet(Point_t const &point, std::vector< AuxDetGeo > const &auxDets, size_t &ad, double tolerance=0) const
std::map< size_t, std::string > fADGeoToName
map the AuxDetGeo index to the name
Namespace collecting geometry-related classes utilities.