47 void addToSolStore(
const DDSolid& sol, std::set<DDSolid>& solStore, std::set<DDRotation>& rotStore);
57 if (sv1.size() < sv2.size())
59 if (sv2.size() < sv1.size())
62 for (; ind < sv1.size(); ++ind) {
84 (*m_xos) <<
"<?xml version=\"1.0\"?>\n";
85 (*m_xos) <<
"<DDDefinition xmlns=\"http://www.cern.ch/cms/DDL\"\n";
86 (*m_xos) <<
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n";
87 (*m_xos) <<
"xsi:schemaLocation=\"http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd\">\n";
88 (*m_xos) <<
std::fixed << std::setprecision(18);
92 (*m_xos) <<
"</DDDefinition>\n";
93 (*m_xos) << std::endl;
98 edm::LogInfo(
"OutputMagneticFieldDDToDDL") <<
"OutputMagneticFieldDDToDDL::beginRun";
103 const auto& gra = pDD->
graph();
106 std::set<DDLogicalPart> lpStore;
107 std::set<DDMaterial> matStore;
108 std::set<DDSolid> solStore;
110 std::map<const DDsvalues_type, std::set<const DDPartSelection*>, ddsvaluesCmp> specStore;
111 std::set<DDRotation> rotStore;
116 size_t foundLastDot = rn.find_last_of(
'.');
117 size_t foundLastSlash = rn.find_last_of(
'/');
119 if (foundLastSlash > foundLastDot && foundLastSlash != std::string::npos) {
121 <<
"What? last . before last / in path for filename... this should die...";
123 if (foundLastDot != std::string::npos && foundLastSlash != std::string::npos) {
124 out.ns_ = rn.substr(foundLastSlash, foundLastDot);
125 }
else if (foundLastDot != std::string::npos) {
126 out.ns_ = rn.substr(0, foundLastDot);
129 <<
"What? no file name? Attempt at namespace =\"" <<
out.ns_ <<
"\" filename was " <<
m_fname;
135 (*m_xos) <<
std::fixed << std::setprecision(18);
144 (*m_xos) <<
"<PosPartSection label=\"" << ns_ <<
"\">\n";
146 for (; git != gend; ++git) {
148 if (lpStore.find(ddLP) != lpStore.end()) {
151 lpStore.insert(ddLP);
157 auto cit = git->begin();
158 auto cend = git->end();
159 for (; cit != cend; ++cit) {
161 if (lpStore.find(ddcurLP) != lpStore.end()) {
164 lpStore.insert(ddcurLP);
167 rotStore.insert(gra.edgeData(cit->second)->ddrot());
173 (*m_xos) <<
"</PosPartSection>\n";
175 (*m_xos) << std::scientific << std::setprecision(18);
176 std::set<DDMaterial>::const_iterator it(matStore.begin()), ed(matStore.end());
177 (*m_xos) <<
"<MaterialSection label=\"" << ns_ <<
"\">\n";
178 for (; it != ed; ++it) {
179 if (!it->isDefined().second)
183 (*m_xos) <<
"</MaterialSection>\n";
185 (*m_xos) <<
"<RotationSection label=\"" << ns_ <<
"\">\n";
186 (*m_xos) <<
std::fixed << std::setprecision(18);
187 std::set<DDRotation>::iterator rit(rotStore.begin()),
red(rotStore.end());
188 for (; rit !=
red; ++rit) {
189 if (!rit->isDefined().second)
191 if (rit->toString() !=
":") {
196 (*m_xos) <<
"</RotationSection>\n";
198 (*m_xos) <<
std::fixed << std::setprecision(18);
199 std::set<DDSolid>::const_iterator sit(solStore.begin()), sed(solStore.end());
200 (*m_xos) <<
"<SolidSection label=\"" << ns_ <<
"\">\n";
201 for (; sit != sed; ++sit) {
202 if (!sit->isDefined().second)
206 (*m_xos) <<
"</SolidSection>\n";
208 std::set<DDLogicalPart>::iterator lpit(lpStore.begin()), lped(lpStore.end());
209 (*m_xos) <<
"<LogicalPartSection label=\"" << ns_ <<
"\">\n";
210 for (; lpit != lped; ++lpit) {
211 if (!lpit->isDefined().first)
216 (*m_xos) <<
"</LogicalPartSection>\n";
218 (*m_xos) <<
std::fixed << std::setprecision(18);
219 std::map<DDsvalues_type, std::set<const DDPartSelection*> >::const_iterator mit(specStore.begin()),
220 mend(specStore.end());
221 (*m_xos) <<
"<SpecParSection label=\"" << ns_ <<
"\">\n";
222 for (; mit != mend; ++mit) {
225 (*m_xos) <<
"</SpecParSection>\n";
229 matStore.insert(mat);
234 if (matStore.find(mat.
constituent(findex).first) == matStore.end()) {
243 std::set<DDSolid>& solStore,
244 std::set<DDRotation>& rotStore) {
245 solStore.insert(sol);
249 if (solStore.find(
bs.solidA()) == solStore.end()) {
252 if (solStore.find(
bs.solidB()) == solStore.end()) {
255 rotStore.insert(
bs.rotation());
262 std::vector<std::pair<const DDPartSelection*, const DDsvalues_type*> >::const_iterator spit(
265 for (; spit != spend; ++spit) {
266 specStore[*spit->second].insert(spit->first);