7 #include "DetectorDescription/Core/interface/Singleton.icc" 58 std::cout <<
"DDErrorDetection::scan(): Scanning for DDD errors ..." << std::flush;
72 std::cout <<
" ... finished." << std::endl;
77 std::cout <<
"What does DDErrorDetection::errors() do? nothing." << std::endl;
82 std::cout <<
"What does DDErrorDetection::warnings() do? nothing." << std::endl;
88 static std::map<std::string, std::set<DDLogicalPart> > result_;
89 if (!result_.empty())
return result_;
91 const auto &
g = cpv.
graph();
95 for (; it != ed; ++it) {
96 std::set<DDLogicalPart>::const_iterator sit(it->second.begin()), sed(it->second.end());
97 for( ; sit != sed; ++sit) {
99 auto er =
g.edges(lp);
100 if (
g.nodeIndex(lp).second) {
101 result_.insert(make_pair(lp.
ddname().
fullname(), std::set<DDLogicalPart>()));
103 for (; er.first != er.second; ++er.first) {
114 static std::map<DDSolid, std::set<DDLogicalPart> > result_;
115 if (!result_.empty())
return result_;
117 const std::map<DDSolid, std::set<DDSolid> > & err_mat = so();
118 std::map<DDSolid, std::set<DDSolid> >::const_iterator it(err_mat.begin()), ed(err_mat.end());
119 for (; it != ed; ++it) {
120 std::set<DDLogicalPart>
s;
123 std::set<DDSolid>::const_iterator sit(it->second.begin()), sed(it->second.end());
124 for(; sit != sed; ++sit) {
129 DDLogicalPart::iterator<DDLogicalPart> lpit,lped; lped.end();
130 for (; lpit != lped; ++lpit) {
131 if (lpit->isDefined().second) {
132 std::map<DDSolid, std::set<DDLogicalPart> >::iterator
i = result_.find(lpit->solid());
134 if ( i != result_.end() ) {
136 i->second.insert(*lpit);
153 static std::map<DDMaterial, std::set<DDLogicalPart> > result_;
154 if (!result_.empty())
return result_;
156 const std::vector<pair<std::string,DDName> > & err_mat = ma();
157 std::vector<pair<std::string,DDName> >::const_iterator it(err_mat.begin()), ed(err_mat.end());
158 for (; it != ed; ++it) {
159 std::set<DDLogicalPart>
s;
164 DDLogicalPart::iterator<DDLogicalPart> lpit,lped; lped.end();
165 for (; lpit != lped; ++lpit) {
166 if (lpit->isDefined().second) {
167 std::map<DDMaterial, std::set<DDLogicalPart> >::iterator
i = result_.find(lpit->material());
169 if ( i != result_.end() ) {
171 i->second.insert(*lpit);
181 static std::vector<pair<std::string,DDName> > result_;
182 ofstream
o(
"/dev/null");
184 if (!result_.empty())
return result_;
196 static std::map<DDSolid, std::set<DDSolid> > result_;
197 if (!result_.empty())
return result_;
204 std::vector<DDSolid> errs;
205 DDSolid::iterator<DDSolid> it, ed; ed.end();
206 for (; it != ed; ++it) {
215 mag.addEdge(
a, ma, 0);
216 mag.addEdge(
b, ma, 0);
220 errs.emplace_back(ma);
224 std::vector<DDSolid>::const_iterator mit(errs.begin()),
226 for (; mit != med; ++mit) {
228 ma_walker_t
w(mag,*mit);
230 result_[*mit].insert(w.current().first);
242 o << std::endl << std::endl <<
"---> DDD ERROR REPORT <---" << std::endl << std::endl;
243 o <<
"MISSING DEFINITIONS:" << std::endl << std::endl;
244 o <<
"LogicalParts:" << std::endl
246 o <<
"Materials:" << std::endl
248 o <<
"Solids:" << std::endl
250 o <<
"Rotations:" << std::endl
252 o <<
"Specifics:" << std::endl
254 o << std::endl <<
"IMPLICATIONS OF MISSING DEFINITIONS:" << std::endl << std::endl;
256 o <<
"A) LogicalParts that have missing definitions but are used in the geometr. hierarchy (PosParts):" << std::endl
257 <<
" Format: namespace:name: [name of child]*" << std::endl;
258 o << lp_cpv(cpv) << std::endl;
260 o <<
"B) Detailed report on Materials:" << std::endl;
261 const std::vector<pair<std::string,DDName> > &
res = ma();
262 std::vector<pair<std::string,DDName> >::const_iterator it(res.begin()), ed(res.end());
263 for (; it != ed; ++it) {
264 std::cout << it->second <<
": " << it->first << std::endl;
269 o <<
"C) Solids affected by Solids that have missing definitions:" << std::endl;
270 o << so() << std::endl;
272 o <<
"D) LogicalParts affected by Materials of B):" << std::endl;
273 o << ma_lp() << std::endl;
275 o <<
"E) LogicalParts affected by Solids of C):" << std::endl;
276 o << so_lp() << std::endl;
291 lp_cpv(cpv).empty() &&
void scan(const DDCompactView &cpv)
def_type isDefined() const
const std::map< DDSolid, std::set< DDSolid > > & so()
DDMaterial is used to define and access material information.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
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.
DDSolid solidB(void) const
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)
const std::string fullname() const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
DDSolidShape shape(void) const
The type of the solid.
const std::vector< std::pair< std::string, DDName > > & ma()
DDSolid solidA(void) const
const Graph & graph() const
Provides read-only access to the data structure of the compact-view.
const std::map< DDSolid, std::set< DDLogicalPart > > & so_lp()
void report(const DDCompactView &cpv, std::ostream &o)
bool DDCheckMaterials(std::ostream &, std::vector< std::pair< std::string, DDName > > *=0)
Checks all registered materials and sends a report /p os.
Interface to attach user specific data to nodes in the expanded-view.