11 #include "DD4hep/Detector.h" 12 #include "DD4hep/DD4hepRootPersistency.h" 13 #include "DD4hep/DetectorTools.h" 14 #include "DD4hep/VolumeProcessor.h" 40 : m_tag(iConfig.getParameter<
ESInputTag>(
"DDDetector")),
41 m_detElementPath(iConfig.getParameter<
string>(
"detElementPath")),
42 m_placedVolPath(iConfig.getParameter<
string>(
"placedVolumePath"))
55 for(
const auto&
p: reg->vectors) {
56 log <<
"\n " << p.first <<
" => ";
57 for(const auto& i : p.second)
68 DetElement startDetEl, world = detector.world();
69 LogVerbatim(
"Geometry") <<
"World placement path " << world.placementPath()
70 <<
", path " << world.path();
75 if(startDetEl.isValid())
76 LogVerbatim(
"Geometry") <<
"Found starting DetElement!\n";
80 startPVol = dd4hep::detail::tools::findNode(world.placement(),
m_placedVolPath);
81 if(startPVol.isValid())
82 LogVerbatim(
"Geometry") <<
"Found srarting PlacedVolume!\n";
84 if( !startPVol.isValid()) {
85 if( !startDetEl.isValid()) {
86 except(
"VolumeScanner",
"Failed to find start conditions for the volume scan");
88 startPVol = startDetEl.placement();
93 PlacedVolumeScanner().scanPlacements(proc, startPVol, 0,
true);
95 LogVerbatim(
"Geometry") <<
"VolumeScanner" <<
"+++ Visited a total of %d placed volumes." << proc.
count();
DDTestNavigateGeometry(const ParameterSet &)
TrainProcessor *const proc
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
#define DEFINE_FWK_MODULE(type)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
dd4hep::PlacedVolume PlacedVolume
LogVerbatim & log(F &&iF)
Namespace of DDCMS conversion namespace.
const string m_placedVolPath
const string m_detElementPath
void analyze(Event const &iEvent, EventSetup const &) override