19 #include "TGeoManager.h" 28 std::unique_ptr<geo::GeometryCore>
32 std::unique_ptr<geo::ChannelMapAlg> channelMap
35 auto const bForceReload =
true;
40 auto geom = std::make_unique<geo::GeometryCore>(pset);
46 const bool disableWiresInG4 = pset.
get<
bool> (
"DisableWiresInG4",
false);
51 if (!relPath.empty() && (relPath.back() !=
'/')) relPath +=
'/';
62 std::string GDMLFilePathHint = relPath + GDMLFileName;
65 if(disableWiresInG4) {
66 GDMLFilePathHint.insert(
67 std::min(GDMLFilePathHint.rfind(
".gdml"), GDMLFilePathHint.length()),
73 if( !sp.
find_file(GDMLFilePathHint, GDMLFilePath) ) {
75 <<
"Can't find geometry file '" << GDMLFilePathHint
76 <<
"' (for GEANT4)!\n";
83 std::string ROOTFilePathHint = relPath + GDMLFileName;
86 if( !sp.
find_file(ROOTFilePathHint, ROOTFilePath) ) {
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.
T get(std::string const &key) const
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
std::unique_ptr< geo::GeometryCore > SetupGeometryWithChannelMapping(fhicl::ParameterSet const &pset, std::unique_ptr< geo::ChannelMapAlg > channelMap)
Initializes a LArSoft geometry object.
std::string find_file(std::string const &filename) const
Access the description of detector geometry.
Interface to algorithm class for a specific detector channel mapping.
cet::coded_exception< error, detail::translate > exception