16 #include "art/Framework/Principal/Run.h"
17 #include "art/Framework/Services/Registry/ActivityRegistry.h"
18 #include "art/Framework/Services/Registry/ServiceHandle.h"
19 #include "messagefacility/MessageLogger/MessageLogger.h"
20 #include "fhiclcpp/ParameterSet.h"
21 #include "cetlib_except/exception.h"
22 #include "cetlib/search_path.h"
34 , fRelPath (pset.
get<
std::string >(
"RelativePath",
"" ))
35 , fForceUseFCLOnly (pset.
get<
bool >(
"ForceUseFCLOnly" ,
false))
36 , fSortingParameters(pset.
get<fhicl::ParameterSet>(
"SortingParameters", {}))
73 mf::LogWarning(
"LoadNewGeometry") <<
"cannot find sumdata::RunData object to grab detector name\n"
74 <<
"this is expected if generating MC files\n"
75 <<
"using default geometry from configuration file\n";
80 std::string newDetectorName = rdcol.front()->
DetName();
81 if (
GetProvider().DetectorName() == newDetectorName)
return;
100 auto channelMap = art::ServiceHandle<geo::AuxDetExptGeoHelperInterface>()->ConfigureAuxDetChannelMapAlg(
fSortingParameters);
102 throw cet::exception(
"ChannelMapLoadFail") <<
" failed to load new channel map";
114 ROOTFileName.append(gdmlfile);
121 cet::search_path sp(
"FW_SEARCH_PATH");
123 std::string GDMLfile;
125 throw cet::exception(
"AuxDetGeometry") <<
"cannot find the gdml geometry file:"
127 <<
"\nbail ungracefully.\n";
130 std::string ROOTfile;
131 if( !sp.find_file(ROOTFileName, ROOTfile) ) {
132 throw cet::exception(
"AuxDetGeometry") <<
"cannot find the root geometry file:\n"
133 <<
"\n" << ROOTFileName
134 <<
"\nbail ungracefully.\n";
void LoadGeometryFile(std::string gdmlfile, std::string rootfile)
Loads the geometry information from the specified files.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
void ApplyChannelMap(std::unique_ptr< geo::AuxDetChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
std::string const & DetName() const
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.
AuxDetGeometryCore fProvider
the actual service provider
void InitializeChannelMap()