17 #include "cetlib_except/exception.h" 18 #include "cetlib/search_path.h" 33 , fRelPath (pset.get<
std::string >(
"RelativePath",
"" ))
34 , fForceUseFCLOnly (pset.get< bool >(
"ForceUseFCLOnly" , false))
35 , fSortingParameters(pset.get<
fhicl::ParameterSet>(
"SortingParameters",
fhicl::ParameterSet() ))
49 std::string GDMLFileName = pset.
get<std::string>(
"GDML");
50 std::string ROOTFileName = pset.
get<std::string>(
"GDML");
68 std::vector< art::Handle<sumdata::RunData> > rdcol;
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;
101 throw cet::exception(
"ChannelMapLoadFail") <<
" failed to load new channel map";
113 ROOTFileName.append(gdmlfile);
114 GDMLFileName.append(gdmlfile);
120 cet::search_path sp(
"FW_SEARCH_PATH");
122 std::string GDMLfile;
123 if( !sp.find_file(GDMLFileName, GDMLfile) ) {
124 throw cet::exception(
"AuxDetGeometry") <<
"cannot find the gdml geometry file:" 125 <<
"\n" << GDMLFileName
126 <<
"\nbail ungracefully.\n";
129 std::string ROOTfile;
130 if( !sp.find_file(ROOTFileName, ROOTfile) ) {
131 throw cet::exception(
"AuxDetGeometry") <<
"cannot find the root geometry file:\n" 132 <<
"\n" << ROOTFileName
133 <<
"\nbail ungracefully.\n";
void LoadGeometryFile(std::string gdmlfile, std::string rootfile)
Loads the geometry information from the specified files.
#define DEFINE_ART_SERVICE(svc)
AuxDetGeometryCore const * GetProviderPtr() const
Returns a constant pointer to the service provider.
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)
bool hasAuxDetChannelMap() const
Returns whether we have a channel map.
Interface to a service that handles any experiment-specific knowledge that is needed by the AuxDetGeo...
T get(std::string const &key) const
art framework interface to geometry description for auxiliary detectors
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition of data types for geometry description.
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.
GlobalSignal< detail::SignalResponseType::FIFO, void(Run const &)> sPreBeginRun
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void InitializeChannelMap()
Namespace collecting geometry-related classes utilities.
cet::coded_exception< error, detail::translate > exception