20 #include "cetlib_except/exception.h" 25 #include <TGeoManager.h> 41 : fDetectorName(pset.
get<
std::string>(
"Name"))
42 , fBuilderParameters(pset.
get<
fhicl::ParameterSet>(
"Builder",
fhicl::ParameterSet()))
58 if (gdmlfile.empty()) {
59 throw cet::exception(
"AuxDetGeometryCore") <<
"No GDML Geometry file specified!\n";
62 if (rootfile.empty()) {
63 throw cet::exception(
"AuxDetGeometryCore") <<
"No ROOT Geometry file specified!\n";
75 TGeoManager::LockDefaultUnits(
false);
76 TGeoManager::SetDefaultUnits(TGeoManager::kRootUnits);
77 TGeoManager::LockDefaultUnits(
true);
78 TGeoManager::Import(rootfile.c_str());
79 gGeoManager->LockGeometry();
91 mf::LogInfo(
"AuxDetGeometryCore") <<
"New detector geometry loaded from " 107 <<
"Requested AuxDet index " << aid <<
" is out of range: " <<
NAuxDets();
109 return AuxDets()[aid].NSensitiveVolume();
124 throw cet::exception(
"AuxDetGeometryCore") <<
"AuxDet " << ad <<
" does not exist\n";
131 double tolerance)
const 139 double tolerance)
const 150 double tolerance)
const 160 double tolerance)
const 177 uint32_t
const channel)
const 184 uint32_t
const channel)
const 192 std::string
const& auxDetName,
193 uint32_t
const channel)
const
void LoadGeometryFile(std::string gdmlfile, std::string rootfile)
Loads the geometry information from the specified files.
void ApplyChannelMap(std::unique_ptr< geo::AuxDetChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
AuxDetGeo const & ChannelToAuxDet(std::string const &auxDetName, uint32_t channel) const
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
AuxDetGeometryData_t fGeoData
The detector description data.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
AuxDetSensitiveGeo const & SensitiveVolume(size_t sv) const
std::string fDetectorName
Name of the detector.
Interface for geometry extractor classes.
unsigned int NAuxDetSensitive(size_t const &aid) const
Returns the number of sensitive components of auxiliary detector.
Class representing a path in ROOT geometry.
Point_t AuxDetChannelToPosition(std::string const &auxDetName, uint32_t channel) const
virtual void Initialize(AuxDetGeometryData_t &geodata)=0
Access the description of auxiliary detector geometry.
void FindAuxDetSensitiveAtPosition(Point_t const &worldLoc, size_t &adg, size_t &sv, double tolerance=0) const
Fills the indices of the sensitive auxiliary detector at location.
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
unsigned int FindAuxDetAtPosition(Point_t const &worldLoc, double tolerance=0) const
Returns the index of the auxiliary detector at specified location.
AuxDets_t extractAuxiliaryDetectors(Path_t const &path)
Looks for all auxiliary detectors under the specified path.
AuxDetList_t & AuxDets()
Return the internal auxiliary detectors list.
AuxDetGeo const & PositionToAuxDet(Point_t const &worldLoc, unsigned int &ad, double tolerance=0) const
Returns the auxiliary detector at specified location.
fhicl::ParameterSet fBuilderParameters
Configuration of geometry builder.
Encapsulate the geometry of an auxiliary detector.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Standard implementation of geometry extractor.
std::string fROOTfile
path to geometry file for geometry in GeometryCore
AuxDetSensitiveGeo const & PositionToAuxDetSensitive(Point_t const &worldLoc, size_t &ad, size_t &sv, double tolerance=0) const
Returns the auxiliary detector at specified location.
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
AuxDetGeometryCore(fhicl::ParameterSet const &pset)
Initialize geometry from a given configuration.
void ClearGeometry()
Deletes the detector geometry structures.
uint32_t PositionToAuxDetChannel(Point_t const &worldLoc, size_t &ad, size_t &sv) const
std::string fGDMLfile
path to geometry file used for Geant4 simulation
Representation of a node and its ancestry.
Namespace collecting geometry-related classes utilities.
Extracts of LArSoft geometry information from ROOT.
cet::coded_exception< error, detail::translate > exception
std::unique_ptr< AuxDetChannelMapAlg const > fChannelMapAlg
Object containing the channel to wire mapping.
AuxDetSensitiveGeo const & ChannelToAuxDetSensitive(std::string const &auxDetName, uint32_t channel) const