LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
AuxDetReadoutGeom.h
Go to the documentation of this file.
1 
7 #ifndef LARCOREALG_GEOMETRY_AUXDETREADOUTGEOM_H
8 #define LARCOREALG_GEOMETRY_AUXDETREADOUTGEOM_H
9 
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  using chanAndSV = std::pair<std::uint32_t, std::size_t>;
23 
25  std::map<std::size_t, std::string> ADGeoToName;
26  std::map<std::string, std::size_t> NameToADGeo;
27  std::map<std::size_t, std::vector<chanAndSV>>
29  };
31 
33  public:
34  AuxDetReadoutInitializers init(std::vector<AuxDetGeo> const& ads) const;
35  virtual ~AuxDetInitializer();
36 
37  private:
38  virtual AuxDetReadoutInitializers initialize(std::vector<AuxDetGeo> const& ads) const = 0;
39  };
40 
43  public:
44  explicit AuxDetReadoutGeom(AuxDetReadoutInitializers initializers);
45 
46  // method returns the entry in the sorted AuxDetGeo vector so that the Geometry in
47  // turn can return that object
48  std::size_t NearestAuxDet(Point_t const& point,
49  std::vector<AuxDetGeo> const& auxDets,
50  double tolerance = 0,
51  bool throwIfAbsent = true) const;
52  std::size_t NearestSensitiveAuxDet(Point_t const& point,
53  std::vector<AuxDetGeo> const& auxDets,
54  double tolerance = 0,
55  bool throwIfAbsent = true) const;
56  std::pair<std::size_t, std::size_t> ChannelToSensitiveAuxDet(std::string const& detName,
57  std::uint32_t channel) const;
58 
59  Point_t AuxDetChannelToPosition(std::uint32_t channel,
60  std::string const& auxDetName,
61  std::vector<AuxDetGeo> const& auxDets) const;
62 
63  private:
64  std::size_t DetNameToAuxDet(std::string const& detName) const;
65 
66  std::map<std::size_t, std::string> fADGeoToName;
67  std::map<std::string, std::size_t> fNameToADGeo;
68  std::map<std::size_t, std::vector<chanAndSV>>
70  };
72 }
73 #endif // LARCOREALG_GEOMETRY_AUXDETREADOUTGEOM_H
std::map< std::string, std::size_t > NameToADGeo
map the names to the AuxDetGeo index
std::map< std::size_t, std::string > ADGeoToName
map the AuxDetGeo index to the name
std::map< std::size_t, std::vector< chanAndSV > > fADGeoToChannelAndSV
Definitions of geometry vector data types.
std::pair< std::uint32_t, std::size_t > chanAndSV
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
std::map< std::string, std::size_t > fNameToADGeo
map the names to the AuxDetGeo index
ROOT libraries.
std::map< std::size_t, std::string > fADGeoToName
map the AuxDetGeo index to the name
std::map< std::size_t, std::vector< chanAndSV > > ADGeoToChannelAndSV