44 const std::string& test;
45 FND(
const std::string& c) : test(c) {}
46 bool operator()(
const PlacedVolume::VolIDs::value_type& c)
const {
return c.first == test; }
54 virtual ~GeometryWalk() {}
60 static long run(
Detector& description,
int argc,
char** argv);
69 if ( !m_det.isValid() ) {
70 std::stringstream err;
71 err <<
"The subdetector " << m_det.
name() <<
" is not known to the geometry.";
72 printout(INFO,
"GeometryWalk",err.str().c_str());
73 throw std::runtime_error(err.str());
80 std::stringstream log;
87 log <<
"Lookup " << std::left << std::setw(32) << pv.
name() <<
" Detector[" << det_elts.size() <<
"]: " << elt_path;
88 printout(INFO,m_det.name(),log.str());
90 log <<
" " << std::left << std::setw(32) <<
" " <<
" Places[" << all_nodes.size() <<
"]: " << node_path;
91 printout(INFO,m_det.name(),log.str());
93 log <<
" " << std::left << std::setw(32) <<
" " <<
" detail::matrix[" << all_nodes.size() <<
"]: ";
94 for(PlacementPath::const_iterator i=all_nodes.begin(); i!=all_nodes.end(); ++i) {
95 log << (
void*)((*i)->GetMatrix()) <<
" ";
96 if ( i+1 == all_nodes.end() ) log <<
"( -> " << (*i)->GetName() <<
")";
98 printout(INFO, m_det.name(), log.str());
107 child_ids.insert(child_ids.end(),pv.
volIDs().begin(),pv.
volIDs().end());
108 for (_C::const_iterator i=children.begin(); i!=children.end(); ++i) {
109 walk((*i).second,child_ids);
114 long GeometryWalk::run(
Detector& description,
int argc,
char** argv) {
115 std::cout <<
"++ Processing plugin....GeometryWalker.." << std::endl;
117 for(
int in=1; in < argc; ++in) {
118 std::string name = argv[in]+1;
119 if ( name ==
"all" || name ==
"All" || name ==
"ALL" ) {
121 for (_C::const_iterator i=children.begin(); i!=children.end(); ++i) {
123 std::cout <<
"++ Processing subdetector: " << sdet.
name() << std::endl;
124 GeometryWalk test(description, sdet);
128 std::cout <<
"++ Processing subdetector: " << name << std::endl;
129 GeometryWalk test(description, description.
detector(name));
137 using ::GeometryWalk;