LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
AuxDetGeometryCore.h
Go to the documentation of this file.
1 
8 #ifndef LARCOREALG_GEOMETRY_AUXDETGEOMETRYCORE_H
9 #define LARCOREALG_GEOMETRY_AUXDETGEOMETRYCORE_H
10 
11 // LArSoft libraries
17 
18 // Framework and infrastructure libraries
19 #include "fhiclcpp/ParameterSet.h"
20 
21 // C/C++ standard libraries
22 #include <cstddef> // size_t
23 #include <cstdint> // uint32_t
24 #include <memory> // std::shared_ptr<>
25 #include <string>
26 #include <vector>
27 
28 namespace geo {
29 
70  public:
79  std::unique_ptr<AuxDetGeoObjectSorter> sorter = nullptr,
80  std::unique_ptr<AuxDetInitializer> initializer = nullptr);
81 
82  // You shall not copy or move or assign me!
83  AuxDetGeometryCore(AuxDetGeometryCore const&) = delete;
87 
95  std::string const& GDMLFile() const { return fGDMLfile; }
96 
98  std::string const& DetectorName() const { return fDetectorName; }
99 
100  //
101  // object description and information
102  //
103 
105 
106  //
107  // group features
108  //
109 
116  std::size_t NAuxDets() const { return fAuxDets.size(); }
117 
124  std::size_t NAuxDetSensitive(size_t ad) const;
125 
126  //
127  // access
128  //
129 
131  std::vector<AuxDetGeo> const& AuxDetGeoVec() const { return fAuxDets; }
132 
142  AuxDetGeo const& AuxDet(std::size_t const ad = 0) const;
143 
144  Point_t AuxDetChannelToPosition(std::string const& auxDetName, uint32_t channel) const;
145 
147  std::string const& auxDetName,
148  uint32_t channel) const; // return the AuxDetSensitiveGeo for the given
149 
159  std::size_t FindAuxDetAtPosition(Point_t const& point, double tolerance = 0) const;
160 
167  [[nodiscard]] AuxDetGeo const& PositionToAuxDet(Point_t const& point,
168  double tolerance = 0.) const;
169 
177  void FindAuxDetSensitiveAtPosition(Point_t const& point,
178  std::size_t& adg,
179  std::size_t& sv,
180  double tolerance = 0) const;
181 
184 
186  bool hasAuxDetChannelMap() const { return bool(fReadoutGeom); }
187 
189 
190  private:
191  void LoadGeometryFile();
192  void ApplyChannelMap();
193 
194  std::vector<AuxDetGeo> fAuxDets;
195 
196  std::unique_ptr<AuxDetGeoObjectSorter> fSorter;
197  std::unique_ptr<AuxDetInitializer> fInitializer;
198  std::string fGDMLfile;
199  std::string fDetectorName;
201  std::unique_ptr<AuxDetReadoutGeom const>
204  }; // class GeometryCore
205 
206 } // namespace geo
207 
208 #endif // LARCOREALG_GEOMETRY_AUXDETGEOMETRYCORE_H
AuxDetGeo const & AuxDet(std::size_t const ad=0) const
Returns the specified auxiliary detector.
std::size_t FindAuxDetAtPosition(Point_t const &point, double tolerance=0) const
Returns the index of the auxiliary detector at specified location.
std::size_t NAuxDetSensitive(size_t ad) const
Returns the number of sensitive components of auxiliary detector.
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
Point_t AuxDetChannelToPosition(std::string const &auxDetName, uint32_t channel) const
std::string const & GDMLFile() const
Returns the full directory path to the GDML file source.
Description of physical geometry of one set of auxiliary detectors.
std::size_t NAuxDets() const
Returns the number of auxiliary detectors.
std::unique_ptr< AuxDetReadoutGeom const > fReadoutGeom
Object containing the channel to wire mapping.
bool hasAuxDetChannelMap() const
Returns whether we have a channel map.
Definitions of geometry vector data types.
std::unique_ptr< AuxDetGeoObjectSorter > fSorter
fhicl::ParameterSet fBuilderParameters
Configuration of geometry builder.
Encapsulate the geometry of an auxiliary detector.
void FindAuxDetSensitiveAtPosition(Point_t const &point, std::size_t &adg, std::size_t &sv, double tolerance=0) const
Fills the indices of the sensitive auxiliary detector at location.
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::vector< AuxDetGeo > const & AuxDetGeoVec() const
Returns the full list of pointer to the auxiliary detectors.
std::vector< AuxDetGeo > fAuxDets
AuxDetGeometryCore(fhicl::ParameterSet const &pset, std::unique_ptr< AuxDetGeoObjectSorter > sorter=nullptr, std::unique_ptr< AuxDetInitializer > initializer=nullptr)
Initialize geometry from a given configuration.
std::string fGDMLfile
path to geometry file used for Geant4 simulation
AuxDetGeo const & PositionToAuxDet(Point_t const &point, double tolerance=0.) const
Returns the auxiliary detector at specified location.
AuxDetGeometryCore & operator=(AuxDetGeometryCore const &)=delete
ROOT libraries.
Interface to auxiliary-detector geometry for wire readouts. .
std::unique_ptr< AuxDetInitializer > fInitializer
AuxDetSensitiveGeo const & ChannelToAuxDetSensitive(std::string const &auxDetName, uint32_t channel) const