7 #include "DetectorDescription/Core/interface/Singleton.icc" 55 std::cout <<
"DDErrorDetection::scan(): Scanning for DDD errors ..." << std::flush;
69 std::cout <<
" ... finished." << std::endl;
78 static std::map<std::string, std::set<DDLogicalPart>> result_;
82 const auto&
g = cpv.
graph();
84 std::map<std::string, std::set<DDLogicalPart>>::const_iterator it(
lp_err::instance().begin()),
86 for (; it != ed; ++it) {
87 std::set<DDLogicalPart>::const_iterator sit(it->second.begin()), sed(it->second.end());
88 for (; sit != sed; ++sit) {
90 auto er =
g.edges(lp);
91 if (
g.nodeIndex(lp).second) {
92 result_.insert(make_pair(lp.
ddname().
fullname(), std::set<DDLogicalPart>()));
94 for (; er.first != er.second; ++er.first) {
103 static std::map<DDSolid, std::set<DDLogicalPart>> result_;
104 if (!result_.empty())
107 const std::map<DDSolid, std::set<DDSolid>>& err_mat = so();
108 std::map<DDSolid, std::set<DDSolid>>::const_iterator it(err_mat.begin()), ed(err_mat.end());
109 for (; it != ed; ++it) {
110 std::set<DDLogicalPart>
s;
113 std::set<DDSolid>::const_iterator sit(it->second.begin()), sed(it->second.end());
114 for (; sit != sed; ++sit) {
119 DDLogicalPart::iterator<DDLogicalPart> lpit, lped;
121 for (; lpit != lped; ++lpit) {
122 if (lpit->isDefined().second) {
123 std::map<DDSolid, std::set<DDLogicalPart>>::iterator
i = result_.find(lpit->solid());
125 if (
i != result_.end()) {
127 i->second.insert(*lpit);
143 static std::map<DDMaterial, std::set<DDLogicalPart>> result_;
144 if (!result_.empty())
147 const std::vector<pair<std::string, std::string>>& err_mat = ma();
148 std::vector<pair<std::string, std::string>>::const_iterator it(err_mat.begin()), ed(err_mat.end());
149 for (; it != ed; ++it) {
150 std::set<DDLogicalPart>
s;
154 DDLogicalPart::iterator<DDLogicalPart> lpit, lped;
156 for (; lpit != lped; ++lpit) {
157 if (lpit->isDefined().second) {
158 std::map<DDMaterial, std::set<DDLogicalPart>>::iterator
i = result_.find(lpit->material());
159 if (
i != result_.end()) {
161 i->second.insert(*lpit);
169 static std::vector<pair<std::string, std::string>> result_;
170 ofstream
o(
"/dev/null");
172 if (!result_.empty())
183 static std::map<DDSolid, std::set<DDSolid>> result_;
184 if (!result_.empty())
192 std::vector<DDSolid> errs;
193 DDSolid::iterator<DDSolid> it, ed;
195 for (; it != ed; ++it) {
205 mag.addEdge(
a, ma, 0);
206 mag.addEdge(
b, ma, 0);
209 errs.emplace_back(ma);
213 std::vector<DDSolid>::const_iterator mit(errs.begin()), med(errs.end());
214 for (; mit != med; ++mit) {
215 ma_walker_t
w(
mag, *mit);
217 result_[*mit].insert(
w.current().first);
226 o << std::endl << std::endl <<
"---> DDD ERROR REPORT <---" << std::endl << std::endl;
227 o <<
"MISSING DEFINITIONS:" << std::endl << std::endl;
233 o << std::endl <<
"IMPLICATIONS OF MISSING DEFINITIONS:" << std::endl << std::endl;
235 o <<
"A) LogicalParts that have missing definitions but are used in the geometr. hierarchy (PosParts):" << std::endl
236 <<
" Format: namespace:name: [name of child]*" << std::endl;
237 o << lp_cpv(cpv) << std::endl;
239 o <<
"B) Detailed report on Materials:" << std::endl;
240 const std::vector<pair<std::string, std::string>>&
res = ma();
241 std::vector<pair<std::string, std::string>>::const_iterator it(
res.begin()), ed(
res.end());
242 for (; it != ed; ++it) {
243 std::cout << it->second <<
": " << it->first << std::endl;
247 o <<
"C) Solids affected by Solids that have missing definitions:" << std::endl;
248 o << so() << std::endl;
250 o <<
"D) LogicalParts affected by Materials of B):" << std::endl;
251 o << ma_lp() << std::endl;
253 o <<
"E) LogicalParts affected by Solids of C):" << std::endl;
254 o << so_lp() << std::endl;
265 so().empty() && ma_lp().empty() && so_lp().empty();
void scan(const DDCompactView &cpv)
const std::map< DDSolid, std::set< DDSolid > > & so()
const std::vector< std::pair< std::string, std::string > > & ma()
DDMaterial is used to define and access material information.
const std::map< DDMaterial, std::set< DDLogicalPart > > & ma_lp()
Compact representation of the geometrical detector hierarchy.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
A DDSolid represents the shape of a part.
Represents a uniquely identifyable rotation matrix.
static value_type & instance()
const std::map< std::string, std::set< DDLogicalPart > > & lp_cpv(const DDCompactView &cpv)
const std::map< std::string, std::set< C > > & dd_error_scan(const C &)
bool noErrorsInTheReport(const DDCompactView &cpv)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
DDSolidShape shape(void) const
The type of the solid.
const std::map< DDSolid, std::set< DDLogicalPart > > & so_lp()
void report(const DDCompactView &cpv, std::ostream &o)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const std::string fullname() const
bool DDCheckMaterials(std::ostream &, std::vector< std::pair< std::string, std::string > > *=nullptr)
const Graph & graph() const
Provides read-only access to the data structure of the compact-view.
def_type isDefined() const
Interface to attach user specific data to nodes in the expanded-view.