17 #include "cetlib_except/exception.h" 32 , fRelPath (pset.
get<
std::
string >(
"RelativePath",
"" ))
33 , fForceUseFCLOnly (pset.
get<
bool >(
"ForceUseFCLOnly" , false))
34 , fSortingParameters(pset.
get<
fhicl::ParameterSet>(
"SortingParameters", {}))
71 mf::LogWarning(
"LoadNewGeometry") <<
"cannot find sumdata::RunData object to grab detector name\n" 72 <<
"this is expected if generating MC files\n" 73 <<
"using default geometry from configuration file\n";
78 std::string newDetectorName = rdcol.front()->DetName();
79 if (
GetProvider().DetectorName() == newDetectorName)
return;
100 throw cet::exception(
"ChannelMapLoadFail") <<
" failed to load new channel map";
112 ROOTFileName.append(gdmlfile);
113 GDMLFileName.append(gdmlfile);
122 if( !sp.
find_file(GDMLFileName, GDMLfile) ) {
123 throw cet::exception(
"AuxDetGeometry") <<
"cannot find the gdml geometry file:" 124 <<
"\n" << GDMLFileName
125 <<
"\nbail ungracefully.\n";
129 if( !sp.
find_file(ROOTFileName, ROOTfile) ) {
130 throw cet::exception(
"AuxDetGeometry") <<
"cannot find the root geometry file:\n" 131 <<
"\n" << ROOTFileName
132 <<
"\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.
The geometry of one entire detector, as served by art.
void LoadNewGeometry(std::string gdmlfile, std::string rootfile)
Expands the provided paths and loads the geometry description(s)
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
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.
#define DEFINE_ART_SERVICE(svc)
AuxDetGeometryCore fProvider
the actual service provider
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::string find_file(std::string const &filename) const
void InitializeChannelMap()
auto const & get(AssnsNode< L, R, D > const &r)
LArSoft geometry interface.
cet::coded_exception< error, detail::translate > exception