#include <DetectorDescription/RegressionTest/interface/DDErrorDetection.h>
Public Member Functions | |
DDErrorDetection () | |
void | errors () |
const std::map< std::string, std::set< DDLogicalPart > > & | lp_cpv () |
const std::vector< std::pair < std::string, DDName > > & | ma () |
const std::map< DDMaterial, std::set< DDLogicalPart > > & | ma_lp () |
void | nix () |
void | report (std::ostream &) |
void | scan () |
const std::map< DDSolid, std::set< DDSolid > > & | so () |
const std::map< DDSolid, std::set< DDLogicalPart > > & | so_lp () |
void | warnings () |
Definition at line 116 of file DDErrorDetection.h.
DDErrorDetection::DDErrorDetection | ( | ) |
void DDErrorDetection::errors | ( | ) |
const map< string, set< DDLogicalPart > > & DDErrorDetection::lp_cpv | ( | ) |
Definition at line 47 of file DDErrorDetection.cc.
References begin, DDBase< N, C >::ddname(), graph< N, E >::edges(), end, g, DDCompactView::graph(), DDI::Singleton< I >::instance(), it, lp, graph< N, E >::nodeData(), and graph< N, E >::nodeIndex().
00048 { 00049 static map<string, set<DDLogicalPart> > result_; 00050 if (result_.size()) return result_; 00051 00052 DDCompactView cpv; 00053 const graph_type & g = cpv.graph(); 00054 00055 map<string, set<DDLogicalPart> >::const_iterator it(lp_err::instance().begin()), 00056 ed(lp_err::instance().end()); 00057 for (; it != ed; ++it) { 00058 set<DDLogicalPart>::const_iterator sit(it->second.begin()), sed(it->second.end()); 00059 for( ; sit != sed; ++sit) { 00060 const DDLogicalPart & lp = *sit; 00061 graph_type::const_edge_range er = g.edges(lp); 00062 if (g.nodeIndex(lp).second) { 00063 result_.insert(make_pair(string(lp.ddname()), set<DDLogicalPart>())); 00064 } 00065 for (; er.first != er.second; ++er.first) { 00066 result_[lp.ddname()].insert(g.nodeData(er.first->first)); 00067 } 00068 } 00069 } 00070 return result_; 00071 }
Definition at line 141 of file DDErrorDetection.cc.
References DDCheckMaterials().
Referenced by ma_lp(), and so().
00142 { 00143 static vector<pair<string,DDName> > result_; 00144 ofstream o("/dev/null"); 00145 00146 if (result_.size()) return result_; 00147 00148 DDCheckMaterials(o,&result_); 00149 return result_; 00150 00151 /* 00152 */ 00153 }
const map< DDMaterial, set< DDLogicalPart > > & DDErrorDetection::ma_lp | ( | ) |
Definition at line 113 of file DDErrorDetection.cc.
References i, it, m, ma(), and s.
00114 { 00115 static map<DDMaterial, set<DDLogicalPart> > result_; 00116 if (result_.size()) return result_; 00117 00118 const vector<pair<string,DDName> > & err_mat = ma(); 00119 vector<pair<string,DDName> >::const_iterator it(err_mat.begin()), ed(err_mat.end()); 00120 for (; it != ed; ++it) { 00121 set<DDLogicalPart> s; 00122 DDMaterial m(it->second); 00123 result_[m]=s; 00124 //cout << "insert: " << m.name() << endl; 00125 } 00126 DDLogicalPart::iterator<DDLogicalPart> lpit,lped; lped.end(); 00127 for (; lpit != lped; ++lpit) { 00128 if (lpit->isDefined().second) { 00129 map<DDMaterial, set<DDLogicalPart> >::iterator i = result_.find(lpit->material()); 00130 //cout << "searching: " << lpit->name() << endl; 00131 if ( i != result_.end() ) { 00132 //cout << endl << "FOUND: " << lpit->name() << endl << endl; 00133 i->second.insert(*lpit); 00134 } 00135 } 00136 } 00137 return result_; 00138 }
void DDErrorDetection::nix | ( | ) |
void DDErrorDetection::report | ( | std::ostream & | ) |
void DDErrorDetection::scan | ( | ) |
Definition at line 15 of file DDErrorDetection.cc.
References GenMuonPlsPt100GeV_cfg::cout, dd_error_scan(), lat::endl(), flush(), and DDI::Singleton< I >::instance().
Referenced by DDErrorDetection().
00016 { 00017 cout << "DDErrorDetection::scan(): Scanning for DDD errors ..." << flush; 00018 00019 DDLogicalPart lp_dummy; 00020 DDMaterial ma_dummy; 00021 DDRotation ro_dummy; 00022 DDSpecifics sp_dummy; 00023 DDSolid so_dummy; 00024 00025 lp_err::instance() = dd_error_scan(lp_dummy); 00026 ma_err::instance() = dd_error_scan(ma_dummy); 00027 ro_err::instance() = dd_error_scan(ro_dummy); 00028 sp_err::instance() = dd_error_scan(sp_dummy); 00029 so_err::instance() = dd_error_scan(so_dummy); 00030 00031 cout << " ... finished." << endl; 00032 }
Definition at line 156 of file DDErrorDetection.cc.
References a, b, GenMuonPlsPt100GeV_cfg::cout, ddintersection, ddsubtraction, ddunion, lat::endl(), DDBase< N, C >::isDefined(), it, m, ma(), muonGeometry::mag(), sh, DDSolid::shape(), DDBooleanSolid::solidA(), DDBooleanSolid::solidB(), and w.
Referenced by so_lp().
00157 { 00158 static map<DDSolid, set<DDSolid> > result_; 00159 if (result_.size()) return result_; 00160 00161 // build the material dependency graph 00162 typedef graph<DDSolid,double> ma_graph_t; 00163 typedef graphwalker<DDSolid,double> ma_walker_t; 00164 00165 ma_graph_t mag; 00166 vector<DDSolid> errs; 00167 DDSolid::iterator<DDSolid> it, ed; ed.end(); 00168 for (; it != ed; ++it) { 00169 DDSolid ma = *it; 00170 if (ma.isDefined().second) { 00171 DDSolidShape sh = ma.shape(); 00172 if ( (sh == ddunion) || (sh == ddintersection) || (sh == ddsubtraction) ) { 00173 DDBooleanSolid bs(ma); 00174 DDSolid a(bs.solidA()),b(bs.solidB()); 00175 //DDRotation r(bs.rotation()); 00176 //DDTranslation t(bs.translation); 00177 mag.addEdge(a, ma, 0); 00178 mag.addEdge(b, ma, 0); 00179 } 00180 } 00181 else { 00182 errs.push_back(ma); 00183 } 00184 } 00185 00186 vector<DDSolid>::const_iterator mit(errs.begin()), 00187 med(errs.end()); 00188 for (; mit != med; ++mit) { 00189 00190 try { 00191 // loop over erroreous materials 00192 ma_walker_t w(mag,*mit); 00193 while (w.next()) { 00194 result_[*mit].insert(w.current().first); 00195 } 00196 cout << endl; 00197 } 00198 catch(DDSolid m) { 00199 ; 00200 //cout << "no such material: " << m << " for creating a walker." << endl; 00201 } 00202 } 00203 return result_; 00204 }
const map< DDSolid, set< DDLogicalPart > > & DDErrorDetection::so_lp | ( | ) |
Definition at line 74 of file DDErrorDetection.cc.
References i, it, m, s, and so().
00075 { 00076 static map<DDSolid, set<DDLogicalPart> > result_; 00077 if (result_.size()) return result_; 00078 00079 const map<DDSolid, set<DDSolid> > & err_mat = so(); 00080 map<DDSolid, set<DDSolid> >::const_iterator it(err_mat.begin()), ed(err_mat.end()); 00081 for (; it != ed; ++it) { 00082 set<DDLogicalPart> s; 00083 DDSolid m(it->first); 00084 result_[m]=s; 00085 set<DDSolid>::const_iterator sit(it->second.begin()), sed(it->second.end()); 00086 for(; sit != sed; ++sit) { 00087 result_[*sit] = s; 00088 } 00089 //cout << "insert: " << m.name() << endl; 00090 } 00091 DDLogicalPart::iterator<DDLogicalPart> lpit,lped; lped.end(); 00092 for (; lpit != lped; ++lpit) { 00093 if (lpit->isDefined().second) { 00094 map<DDSolid, set<DDLogicalPart> >::iterator i = result_.find(lpit->solid()); 00095 //cout << "searching: " << lpit->name() << endl; 00096 if ( i != result_.end() ) { 00097 //cout << endl << "FOUND: " << lpit->name() << endl << endl; 00098 i->second.insert(*lpit); 00099 } 00100 } 00101 } 00102 return result_; 00103 }
void DDErrorDetection::warnings | ( | ) |