19 #include "cetlib/search_path.h" 20 #include "cetlib_except/exception.h" 33 , fRelPath(pset.
get<
std::string>(
"RelativePath",
""))
34 , fForceUseFCLOnly(pset.
get<bool>(
"ForceUseFCLOnly", false))
35 , fSortingParameters(pset.
get<
fhicl::ParameterSet>(
"SortingParameters", {}))
49 std::string GDMLFileName = pset.get<std::string>(
"GDML");
50 std::string ROOTFileName = pset.get<std::string>(
"GDML");
72 <<
"cannot find sumdata::RunData object to grab detector name\n" 73 <<
"this is expected if generating MC files\n" 74 <<
"using default geometry from configuration file\n";
79 std::string newDetectorName = rdcol.front()->DetName();
80 if (
GetProvider().DetectorName() == newDetectorName)
return;
99 throw cet::exception(
"ChannelMapLoadFail") <<
" failed to load new channel map";
111 ROOTFileName.append(gdmlfile);
112 GDMLFileName.append(gdmlfile);
118 cet::search_path sp(
"FW_SEARCH_PATH");
120 std::string GDMLfile;
121 if (!sp.find_file(GDMLFileName, GDMLfile)) {
122 throw cet::exception(
"AuxDetGeometry") <<
"cannot find the gdml geometry file:" 124 << GDMLFileName <<
"\nbail ungracefully.\n";
127 std::string ROOTfile;
128 if (!sp.find_file(ROOTFileName, ROOTfile)) {
129 throw cet::exception(
"AuxDetGeometry") <<
"cannot find the root geometry file:\n" 131 << ROOTFileName <<
"\nbail ungracefully.\n";
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.
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
AuxDetGeometryCore const & GetProvider() const
Returns a constant reference to the service provider.
void LoadNewGeometry(std::string gdmlfile, std::string rootfile)
Expands the provided paths and loads the geometry description(s)
Interface to a service that handles any experiment-specific knowledge that is needed by the AuxDetGeo...
art framework interface to geometry description for auxiliary detectors
AuxDetGeometry(fhicl::ParameterSet const &pset, art::ActivityRegistry ®)
void preBeginRun(art::Run const &run)
Updates the geometry if needed at the beginning of each new run.
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
AuxDetGeometryCore fProvider
the actual service provider
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void InitializeChannelMap()
Namespace collecting geometry-related classes utilities.
cet::coded_exception< error, detail::translate > exception
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const