LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
AuxDetGeometryCore.h
Go to the documentation of this file.
1 
8 #ifndef GEO_AUXDETGEOMETRYCORE_H
9 #define GEO_AUXDETGEOMETRYCORE_H
10 
11 // LArSoft libraries
15 
16 // Framework and infrastructure libraries
17 #include "fhiclcpp/ParameterSet.h"
18 
19 // C/C++ standard libraries
20 #include <cstddef> // size_t
21 #include <cstdint> // uint32_t
22 #include <memory> // std::shared_ptr<>
23 #include <string>
24 #include <vector>
25 
27 namespace geo {
28 
29  // Forward declarations within namespace.
30  class AuxDetSensitiveGeo;
31 
35 
37  using AuxDetList_t = std::vector<AuxDetGeo>;
38 
40 
41  }; // AuxDetGeometryData_t
42 
89  public:
92 
101 
102  // You shall not copy or move or assign me!
103  AuxDetGeometryCore(AuxDetGeometryCore const&) = delete;
105  AuxDetGeometryCore& operator=(AuxDetGeometryCore const&) = delete;
106  AuxDetGeometryCore& operator=(AuxDetGeometryCore&&) = delete;
107 
115  std::string const& ROOTFile() const { return fROOTfile; }
116 
124  std::string const& GDMLFile() const { return fGDMLfile; }
125 
127  std::string const& DetectorName() const { return fDetectorName; }
128 
129  //
130  // object description and information
131  //
132 
134 
135  //
136  // group features
137  //
138 
147  unsigned int NAuxDets() const { return AuxDets().size(); }
148 
155  unsigned int NAuxDetSensitive(size_t const& aid) const;
156 
157  //
158  // access
159  //
160 
162  std::vector<AuxDetGeo> const& AuxDetGeoVec() const { return AuxDets(); }
163 
172  AuxDetGeo const& AuxDet(unsigned int const ad = 0) const;
173 
181  unsigned int FindAuxDetAtPosition(Point_t const& worldLoc, double tolerance = 0) const;
182 
190  void FindAuxDetSensitiveAtPosition(Point_t const& worldLoc,
191  size_t& adg,
192  size_t& sv,
193  double tolerance = 0) const;
194 
204  AuxDetGeo const& PositionToAuxDet(Point_t const& worldLoc,
205  unsigned int& ad,
206  double tolerance = 0) const;
207 
218  AuxDetSensitiveGeo const& PositionToAuxDetSensitive(Point_t const& worldLoc,
219  size_t& ad,
220  size_t& sv,
221  double tolerance = 0) const;
222 
223  uint32_t PositionToAuxDetChannel(Point_t const& worldLoc, size_t& ad, size_t& sv) const;
224 
225  Point_t AuxDetChannelToPosition(std::string const& auxDetName, uint32_t channel) const;
226 
227  AuxDetGeo const& ChannelToAuxDet(
228  std::string const& auxDetName,
229  uint32_t channel) const; // return the AuxDetGeo for the given detector
230  // name and channel
231 
232  AuxDetSensitiveGeo const& ChannelToAuxDetSensitive(
233  std::string const& auxDetName,
234  uint32_t channel) const; // return the AuxDetSensitiveGeo for the given
235 
238 
261  void LoadGeometryFile(std::string gdmlfile, std::string rootfile);
262 
264  bool hasAuxDetChannelMap() const { return bool(fChannelMapAlg); }
265 
284  void ApplyChannelMap(std::unique_ptr<geo::AuxDetChannelMapAlg> pChannelMap);
286 
287  protected:
289  geo::AuxDetChannelMapAlg const* AuxDetChannelMap() const { return fChannelMapAlg.get(); }
290 
292  AuxDetList_t& AuxDets() { return fGeoData.auxDets; }
294  AuxDetList_t const& AuxDets() const { return fGeoData.auxDets; }
296 
297  private:
299  void ClearGeometry();
300 
302 
303  std::string fDetectorName;
304  std::string fGDMLfile;
305  std::string fROOTfile;
307  std::unique_ptr<AuxDetChannelMapAlg const>
309  }; // class GeometryCore
310 
311 } // namespace geo
312 
313 #endif // GEO_AUXDETGEOMETRYCORE_H
AuxDetGeometryData_t fGeoData
The detector description data.
std::vector< AuxDetGeo > AuxDetList_t
Type of list of auxiliary detectors.
std::string fDetectorName
Name of the detector.
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
std::string const & GDMLFile() const
Returns the full directory path to the GDML file source.
Description of geometry of one set of auxiliary detectors.
bool hasAuxDetChannelMap() const
Returns whether we have a channel map.
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
Definitions of geometry vector data types.
std::string const & ROOTFile() const
Returns the full directory path to the geometry file source.
geo::AuxDetChannelMapAlg const * AuxDetChannelMap() const
Returns the object handling the channel map.
fhicl::ParameterSet fBuilderParameters
Configuration of geometry builder.
Encapsulate the geometry of an auxiliary detector.
AuxDetList_t auxDets
The auxiliary detectors.
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::string fROOTfile
path to geometry file for geometry in GeometryCore
std::vector< AuxDetGeo > const & AuxDetGeoVec() const
Returns the full list of pointer to the auxiliary detectors.
std::string fGDMLfile
path to geometry file used for Geant4 simulation
Namespace collecting geometry-related classes utilities.
AuxDetGeometryData_t::AuxDetList_t AuxDetList_t
Type of list of auxiliary detectors.
AuxDetList_t const & AuxDets() const
Return the internal auxiliary detectors list.
std::unique_ptr< AuxDetChannelMapAlg const > fChannelMapAlg
Object containing the channel to wire mapping.