103 edm::LogInfo(
"OutputMagneticFieldDDToDDL" ) <<
"OutputMagneticFieldDDToDDL::beginRun";
108 DDCompactView::DDCompactView::graph_type gra = pDD->graph();
111 std::set<DDLogicalPart> lpStore;
112 std::set<DDMaterial> matStore;
113 std::set<DDSolid> solStore;
115 std::map<const DDsvalues_type, std::set<const DDPartSelection*>, ddsvaluesCmp > specStore;
116 std::set<DDRotation> rotStore;
121 size_t foundLastDot= rn.find_last_of(
'.');
122 size_t foundLastSlash= rn.find_last_of(
'/');
124 if( foundLastSlash > foundLastDot && foundLastSlash != std::string::npos )
126 edm::LogError(
"OutputMagneticFieldDDToDDL" ) <<
"What? last . before last / in path for filename... this should die...";
128 if( foundLastDot != std::string::npos && foundLastSlash != std::string::npos )
130 out.
ns_ = rn.substr( foundLastSlash, foundLastDot );
132 else if ( foundLastDot != std::string::npos )
134 out.
ns_ = rn.substr(0, foundLastDot);
138 edm::LogError(
"OutputMagneticFieldDDToDDL" ) <<
"What? no file name? Attempt at namespace =\"" << out.
ns_ <<
"\" filename was " <<
m_fname;
144 ( *m_xos ) << std::fixed << std::setprecision( 18 );
148 adjl_iterator git = gra.begin();
149 adjl_iterator gend = gra.end();
152 ( *m_xos) <<
"<PosPartSection label=\"" << ns_ <<
"\">\n";
154 for( ; git != gend; ++git )
157 if( lpStore.find(ddLP) != lpStore.end())
161 lpStore.insert( ddLP );
168 DDCompactView::graph_type::edge_list::const_iterator cit = git->begin();
169 DDCompactView::graph_type::edge_list::const_iterator cend = git->end();
170 for( ; cit != cend; ++cit )
173 if( lpStore.find(ddcurLP) != lpStore.end())
177 lpStore.insert( ddcurLP );
180 rotStore.insert( gra.edgeData( cit->second )->rot_ );
186 ( *m_xos ) <<
"</PosPartSection>\n";
188 ( *m_xos ) << std::scientific << std::setprecision( 18 );
189 std::set<DDMaterial>::const_iterator it( matStore.begin()), ed( matStore.end());
190 ( *m_xos) <<
"<MaterialSection label=\"" << ns_ <<
"\">\n";
191 for( ; it != ed; ++it )
193 if( ! it->isDefined().second )
continue;
196 ( *m_xos ) <<
"</MaterialSection>\n";
198 ( *m_xos ) <<
"<RotationSection label=\"" << ns_ <<
"\">\n";
199 ( *m_xos ) << std::fixed << std::setprecision( 18 );
200 std::set<DDRotation>::iterator rit( rotStore.begin()),
red( rotStore.end());
201 for( ; rit !=
red; ++rit )
203 if( ! rit->isDefined().second )
continue;
204 if( rit->toString() !=
":" )
210 ( *m_xos ) <<
"</RotationSection>\n";
212 ( *m_xos ) << std::fixed << std::setprecision( 18 );
213 std::set<DDSolid>::const_iterator sit( solStore.begin()), sed( solStore.end());
214 ( *m_xos ) <<
"<SolidSection label=\"" << ns_ <<
"\">\n";
215 for( ; sit != sed; ++sit)
217 if( ! sit->isDefined().second )
continue;
220 ( *m_xos ) <<
"</SolidSection>\n";
222 std::set<DDLogicalPart>::iterator lpit( lpStore.begin()), lped( lpStore.end());
223 ( *m_xos ) <<
"<LogicalPartSection label=\"" << ns_ <<
"\">\n";
224 for( ; lpit != lped; ++lpit )
226 if( ! lpit->isDefined().first )
continue;
230 ( *m_xos ) <<
"</LogicalPartSection>\n";
232 ( *m_xos ) << std::fixed << std::setprecision( 18 );
233 std::map<DDsvalues_type, std::set<const DDPartSelection*> >::const_iterator mit( specStore.begin()), mend( specStore.end());
234 ( *m_xos ) <<
"<SpecParSection label=\"" << ns_ <<
"\">\n";
235 for( ; mit != mend; ++mit )
239 ( *m_xos ) <<
"</SpecParSection>\n";
void addToSpecStore(const DDLogicalPart &lp, std::map< const DDsvalues_type, std::set< const DDPartSelection * >, ddsvaluesCmp > &specStore)
void rotation(DDRotation &rotation, std::ostream &xos, const std::string &rotn="")
void specpar(const DDSpecifics &sp, std::ostream &xos)
void addToMatStore(const DDMaterial &mat, std::set< DDMaterial > &matStore)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
std::vector< double >::size_type index_type
Represents a uniquely identifyable rotation matrix.
void position(const DDLogicalPart &parent, const DDLogicalPart &child, DDPosData *edgeToChild, int &rotNameSeed, std::ostream &xos)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
void addToSolStore(const DDSolid &sol, std::set< DDSolid > &solStore, std::set< DDRotation > &rotStore)
void logicalPart(const DDLogicalPart &lp, std::ostream &xos)
adj_list::const_iterator const_adj_iterator
void material(const DDMaterial &material, std::ostream &xos)
void solid(const DDSolid &solid, std::ostream &xos)
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.