1 #ifndef DETECTOR_DESCRIPTION_DD_VOLUME_PROCESSOR_H 2 #define DETECTOR_DESCRIPTION_DD_VOLUME_PROCESSOR_H 4 #include "DD4hep/VolumeProcessor.h" 25 auto first = v.find_first_of(
":");
31 auto found = v.find_last_of(
"_");
33 v.remove_suffix(v.size() -
found);
38 std::vector<std::string_view>
split(std::string_view
str,
const char* delims) {
39 std::vector<std::string_view> ret;
42 auto pos = str.find_first_of(delims, start);
43 while(
pos != std::string_view::npos) {
45 ret.emplace_back(str.substr(start,
pos - start));
48 pos = str.find_first_of(delims, start);
50 if(start < str.length())
51 ret.emplace_back(str.substr(start, str.length() -
start));
55 bool compare(std::string_view s1, std::string_view
s2) {
58 edm::LogVerbatim(
"Geometry") <<
'\"' << s1 <<
"\" does not match \"" << s2 <<
"\"\n";
74 log <<
"\nHierarchical level:" << level <<
" Placement:";
76 log <<
"/" <<
i <<
", \n";
77 log <<
"\n\tMaterial:" << vol.material().name()
78 <<
"\tSolid: " << vol.solid().name() <<
"\n";
dd4hep::PlacedVolumeProcessor PlacedVolumeProcessor
int operator()(PlacedVolume pv, int level) override
Volume callback.
dd4hep::PlacedVolume PlacedVolume
bool compare(std::string_view s1, std::string_view s2)
LogVerbatim & log(F &&iF)
std::vector< std::string_view > m_volumes
~DDVolumeProcessor() override=default
std::vector< std::string_view > split(std::string_view str, const char *delims)
int process(PlacedVolume pv, int level, bool recursive) override
Callback to retrieve PlacedVolume information of an entire Placement.
DDVolumeProcessor()=default
Namespace of DDCMS conversion namespace.
std::string_view stripNamespace(std::string_view v)
dd4hep::PlacedVolume PlacedVolume
std::string_view stripCopyNo(std::string_view v)