64 edm::LogInfo(
"OutputMagneticFieldDDToDDL" ) <<
"OutputMagneticFieldDDToDDL::beginRun";
69 DDCompactView::DDCompactView::graph_type gra = pDD->graph();
72 std::set<DDLogicalPart> lpStore;
73 std::set<DDMaterial> matStore;
74 std::set<DDSolid> solStore;
76 std::map<const DDsvalues_type, std::set<const DDPartSelection*>, ddsvaluesCmp > specStore;
77 std::set<DDRotation> rotStore;
82 size_t foundLastDot= rn.find_last_of(
'.');
83 size_t foundLastSlash= rn.find_last_of(
'/');
85 if( foundLastSlash > foundLastDot && foundLastSlash != std::string::npos )
87 edm::LogError(
"OutputMagneticFieldDDToDDL" ) <<
"What? last . before last / in path for filename... this should die...";
89 if( foundLastDot != std::string::npos && foundLastSlash != std::string::npos )
91 out.
ns_ = rn.substr( foundLastSlash, foundLastDot );
93 else if ( foundLastDot != std::string::npos )
95 out.
ns_ = rn.substr(0, foundLastDot);
99 edm::LogError(
"OutputMagneticFieldDDToDDL" ) <<
"What? no file name? Attempt at namespace =\"" << out.
ns_ <<
"\" filename was " <<
m_fname;
105 ( *m_xos ) << std::fixed << std::setprecision( 18 );
109 adjl_iterator git = gra.begin();
110 adjl_iterator gend = gra.end();
113 ( *m_xos) <<
"<PosPartSection label=\"" << ns_ <<
"\">\n";
115 for( ; git != gend; ++git )
118 if( lpStore.find(ddLP) != lpStore.end())
122 lpStore.insert( ddLP );
129 DDCompactView::graph_type::edge_list::const_iterator cit = git->begin();
130 DDCompactView::graph_type::edge_list::const_iterator cend = git->end();
131 for( ; cit != cend; ++cit )
134 if( lpStore.find(ddcurLP) != lpStore.end())
138 lpStore.insert( ddcurLP );
141 rotStore.insert( gra.edgeData( cit->second )->rot_ );
147 ( *m_xos ) <<
"</PosPartSection>\n";
149 ( *m_xos ) << std::scientific << std::setprecision( 18 );
150 std::set<DDMaterial>::const_iterator it( matStore.begin()), ed( matStore.end());
151 ( *m_xos) <<
"<MaterialSection label=\"" << ns_ <<
"\">\n";
152 for( ; it != ed; ++it )
154 if( ! it->isDefined().second )
continue;
157 ( *m_xos ) <<
"</MaterialSection>\n";
159 ( *m_xos ) <<
"<RotationSection label=\"" << ns_ <<
"\">\n";
160 ( *m_xos ) << std::fixed << std::setprecision( 18 );
161 std::set<DDRotation>::iterator rit( rotStore.begin()),
red( rotStore.end());
162 for( ; rit !=
red; ++rit )
164 if( ! rit->isDefined().second )
continue;
165 if( rit->toString() !=
":" )
171 ( *m_xos ) <<
"</RotationSection>\n";
173 ( *m_xos ) << std::fixed << std::setprecision( 18 );
174 std::set<DDSolid>::const_iterator sit( solStore.begin()), sed( solStore.end());
175 ( *m_xos ) <<
"<SolidSection label=\"" << ns_ <<
"\">\n";
176 for( ; sit != sed; ++sit)
178 if( ! sit->isDefined().second )
continue;
181 ( *m_xos ) <<
"</SolidSection>\n";
183 std::set<DDLogicalPart>::iterator lpit( lpStore.begin()), lped( lpStore.end());
184 ( *m_xos ) <<
"<LogicalPartSection label=\"" << ns_ <<
"\">\n";
185 for( ; lpit != lped; ++lpit )
187 if( ! lpit->isDefined().first )
continue;
191 ( *m_xos ) <<
"</LogicalPartSection>\n";
193 ( *m_xos ) << std::fixed << std::setprecision( 18 );
194 std::map<DDsvalues_type, std::set<const DDPartSelection*> >::const_iterator mit( specStore.begin()), mend( specStore.end());
195 ( *m_xos ) <<
"<SpecParSection label=\"" << ns_ <<
"\">\n";
196 for( ; mit != mend; ++mit )
200 ( *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.