23 #include "cetlib/search_path.h" 24 #include "cetlib_except/exception.h" 44 , fRelPath(pset.
get<
std::string>(
"RelativePath",
""))
45 , fDisableWiresInG4(pset.
get<bool>(
"DisableWiresInG4", false))
46 , fNonFatalConfCheck(pset.
get<bool>(
"SkipConfigurationCheck", false))
47 , fSortingParameters(pset.
get<
fhicl::ParameterSet>(
"SortingParameters",
fhicl::ParameterSet()))
48 , fBuilderParameters(pset.
get<
fhicl::ParameterSet>(
"Builder",
fhicl::ParameterSet()))
51 if (pset.
has_key(
"ForceUseFCLOnly")) {
53 <<
"Geometry service does not support `ForceUseFCLOnly` configuration parameter any " 69 std::string GDMLFileName = pset.
get<std::string>(
"GDML");
70 std::string ROOTFileName = pset.
get<std::string>(
"GDML");
87 <<
" is incompatible with the one configured in the job.";
91 <<
"Geometry used for run " << run.
id()
92 <<
" is incompatible with the one configured in the job!" 93 <<
"\n=== job configuration " << std::string(50,
'=') <<
"\n" 94 <<
fConfInfo <<
"\n=== run configuration " << std::string(50,
'=') <<
"\n" 95 << inputGeomInfo <<
"\n======================" << std::string(50,
'=') <<
"\n";
108 if (!channelMapAlg) {
109 throw cet::exception(
"ChannelMapLoadFail") <<
" failed to load new channel map";
124 ROOTFileName.append(gdmlfile);
125 GDMLFileName.append(gdmlfile);
128 if (
fDisableWiresInG4) GDMLFileName.insert(GDMLFileName.find(
".gdml"),
"_nowires");
134 cet::search_path
const sp{
"FW_SEARCH_PATH"};
136 std::string GDMLfile;
137 if (!sp.find_file(GDMLFileName, GDMLfile)) {
138 throw cet::exception(
"Geometry") <<
"cannot find the gdml geometry file:" 140 << GDMLFileName <<
"\nbail ungracefully.\n";
143 std::string ROOTfile;
144 if (!sp.find_file(ROOTFileName, ROOTfile)) {
145 throw cet::exception(
"Geometry") <<
"cannot find the root geometry file:\n" 147 << ROOTFileName <<
"\nbail ungracefully.\n";
202 "Can't read geometry configuration information.\n" 203 "Is `GeometryConfigurationWriter` service configured?\n",
222 mf::LogWarning(
"Geometry") <<
"Geometry::CompareConfigurationInfo(): " 223 "invalid version for configuration A:\n" 228 mf::LogWarning(
"Geometry") <<
"Geometry::CompareConfigurationInfo(): " 229 "invalid version for configuration B:\n" 237 assert(commonVersion >= 1);
240 mf::LogWarning(
"Geometry") <<
"Geometry::CompareConfigurationInfo(): " 241 "detector name mismatch: '"
void LoadGeometryFile(std::string gdmlfile, std::string rootfile, GeometryBuilder &builder, bool bForceReload=false)
Loads the geometry information from the specified files.
Utilities related to art service access.
fhicl::ParameterSet fSortingParameters
Parameter set to define the channel map sorting.
DataVersion_t dataVersion
Version of the data in this object (0 is invalid version).
std::string geometryServiceConfiguration
geo::Geometry service configuration, as FHiCL table.
void FillGeometryConfigurationInfo(fhicl::ParameterSet const &config)
Fills the service configuration information into fConfInfo.
static bool CompareConfigurationInfo(sumdata::GeometryConfigurationInfo const &A, sumdata::GeometryConfigurationInfo const &B)
Returns if A and B are compatible geometry service configurations.
bool CheckConfigurationInfo(sumdata::GeometryConfigurationInfo const &other) const
Returns if the other configuration is compatible with our current.
void preBeginRun(art::Run const &run)
Updates the geometry if needed at the beginning of each new run.
static sumdata::GeometryConfigurationInfo const & ReadConfigurationInfo(art::Run const &run)
Reads and returns the geometry configuration information from the run.
fhicl::ParameterSet fBuilderParameters
Parameter set for geometry builder.
T get(std::string const &key) const
bool isDataValid() const noexcept
Protocol: whether the data content is valid.
void LoadNewGeometry(std::string gdmlfile, std::string rootfile, bool bForceReload=false)
Expands the provided paths and loads the geometry description(s)
std::string to_indented_string() const
bool has_key(std::string const &key) const
Interface to a service that handles any experiment-specific knowledge that is needed by the Geometry ...
Description of geometry of one entire detector.
sumdata::GeometryConfigurationInfo fConfInfo
Summary of service configuration.
Description of the current configuration of detector geometry.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
GlobalSignal< detail::SignalResponseType::FIFO, void(Run const &)> sPreBeginRun
Standard implementation of geometry extractor.
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
unsigned int DataVersion_t
Type used for the version of data.
void ApplyChannelMap(std::unique_ptr< ChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
Namespace collecting geometry-related classes utilities.
PROD const & getProduct(InputTag const &tag) const
Extracts of LArSoft geometry information from ROOT.
void InitializeChannelMap()
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Description of the current configuration of detector geometry.