16 #include "fhiclcpp/ParameterSet.h"
19 #include "TGeoManager.h"
28 std::unique_ptr<geo::GeometryCore>
31 fhicl::ParameterSet
const& pset,
32 std::unique_ptr<geo::ChannelMapAlg> channelMap
35 auto const bForceReload =
true;
40 auto geom = std::make_unique<geo::GeometryCore>(pset);
45 std::string relPath = pset.get<std::string>(
"RelativePath",
"" );
46 const bool disableWiresInG4 = pset.get<
bool> (
"DisableWiresInG4",
false);
47 const std::string
GDMLFileName = pset.get<std::string>(
"GDML" );
51 if (!relPath.empty() && (relPath.back() !=
'/')) relPath +=
'/';
56 cet::search_path sp(
"FW_SEARCH_PATH");
65 if(disableWiresInG4) {
66 GDMLFilePathHint.insert(
67 std::min(GDMLFilePathHint.rfind(
".gdml"), GDMLFilePathHint.length()),
72 std::string GDMLFilePath;
73 if( !sp.find_file(GDMLFilePathHint, GDMLFilePath) ) {
74 throw cet::exception(
"StaticLoadGeometry")
75 <<
"Can't find geometry file '" << GDMLFilePathHint
76 <<
"' (for GEANT4)!\n";
85 std::string ROOTFilePath;
86 if( !sp.find_file(ROOTFilePathHint, ROOTFilePath) ) {
87 throw cet::exception(
"StaticLoadGeometry")
88 <<
"Can't find geometry file '" << ROOTFilePathHint
89 <<
"' (for geometry)!\n";
95 geom->LoadGeometryFile(GDMLFilePath, ROOTFilePath, bForceReload);
101 geom->ApplyChannelMap(move(channelMap));
Utilities for one-line geometry initialization.
Access the description of detector geometry.
std::unique_ptr< geo::GeometryCore > SetupGeometryWithChannelMapping(fhicl::ParameterSet const &pset, std::unique_ptr< geo::ChannelMapAlg > channelMap)
Initializes a LArSoft geometry object.
Interface to algorithm class for a specific detector channel mapping.