6 #include "CLHEP/Units/GlobalSystemOfUnits.h"
26 return ns + nm +
".html";
35 os <<
"numSides=" << p[0] <<
" ";
38 os <<
"startPhi[deg]=" << p[
i]/deg <<
" deltaPhi[deg]" << p[i+1]/deg << std::endl;
40 os <<
"<table><tr><td>z[cm]</td><td>rMin[cm]</td><td>rMax[cm]</td></tr>";
41 while ( i+1 < p.size()) {
42 os <<
"<tr><td>" << p[
i]/cm <<
"</td>";
43 os <<
"<td>" << p[i+1]/cm <<
"</td>";
44 os <<
"<td>" << p[i+2]/cm <<
"</td></tr>" << std::endl;
47 os <<
"</table>" << std::endl;
54 void generateHtml(std::vector<DDLogicalPart> &
v, std::map<DDLogicalPart,int> &
c)
60 std::ofstream
file(fname.c_str());
63 file <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" << std::endl;
64 file <<
"<html><head><title>DDD-part:" << ns <<
" " << name <<
"</title>";
66 <<
"name=" << name <<
" namespace=" << ns <<
"</h2>" << std::endl;
67 file <<
"<br>weight = " << cpv.
weight(v.back())/kg <<
"kg<br>" << std::endl;
71 file <<
"<br>" << std::endl;
72 std::string mname = v.back().material().name().name();
75 file <<
"material = " <<
"<a href=\"" << lk <<
"\">"
76 << mname <<
"</a>" << std::endl;
77 file <<
"density = " << v.back().material().density()/
g*cm3 <<
"g/cm3<br>" << std::endl;
80 file <<
"<br>Children:<br>" << std::endl;
81 std::map<DDLogicalPart,int>::iterator cit = c.begin();
82 for (; cit != c.end(); ++cit) {
84 nm = cit->first.name().name(); nsp = cit->first.name().ns();
85 file <<
"<a href=\"" <<
link(nm,nsp) <<
"\">"
86 << nm <<
"(" << cit->second <<
")</a> " << std::endl;
89 file <<
"<br><br>Ancestors:<br>";
94 nm = v[
s].name().name();
95 nsp = v[
s].name().ns();
97 << nm <<
"</a><br> " << std::endl;
99 file <<
"<br>SpecPars:<br>" << std::endl;
100 file <<
"<table><tbody>" << std::endl;
101 typedef std::vector< std::pair<DDPartSelection*,DDsvalues_type*> > sv_type;
102 sv_type sv = v.back().attachedSpecifics();
103 sv_type::iterator sit = sv.begin();
104 for (; sit != sv.end(); ++sit) {
105 file <<
"<tr>" << std::endl
106 <<
" <td>" << *(sit->first) <<
"</td>" << std::endl;
108 DDsvalues_type::iterator svit = sit->second->begin();
109 for(; svit != sit->second->end(); ++svit) {
110 file << svit->second <<
"<br>" <<std::endl;
112 file <<
"</td>" << std::endl
113 <<
"</tr>" << std::endl;
116 file <<
"</table></tbody>" << std::endl;
118 file <<
"<br></body></html>" <<std::endl;
124 std::map<std::string, std::set<DDMaterial> >::iterator it =
m.begin();
125 for (; it !=
m.end(); ++it) {
127 std::ofstream
file(fname.c_str());
128 file <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" << std::endl;
129 file <<
"<html><head><title>DDD-Materials</title>";
131 std::set<DDMaterial>::iterator mit = it->second.begin();
132 for (; mit != it->second.end(); ++mit) {
133 file <<
"<a name=\"" << mit->name().name() <<
"\">";
134 file << mit->name().name() <<
" d=" << mit->density()/
g*cm3
139 file <<
"</body></html>" << std::endl;
149 static std::vector<DDLogicalPart> history;
150 static std::map<std::string,std::set<DDMaterial> > materials;
153 history.push_back(parent);
158 std::map<DDLogicalPart,int> children;
159 for (; eit != er.second; ++eit) {
165 std::map<DDLogicalPart,int>::iterator cit = children.begin();
166 for (; cit != children.end(); ++cit) {
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
void writeMaterials(std::map< std::string, std::set< DDMaterial > > &m)
void streamSolid(DDSolid s, std::ostream &os)
std::pair< edge_iterator, edge_iterator > edge_range
double weight(const DDLogicalPart &p) const
Prototype version of calculating the weight of a detector component.
const graph_type & graph() const
Provides read-only access to the data structure of the compact-view.
const std::string & ns() const
Returns the namespace.
const N & nodeData(const edge_type &) const
type of data representation of DDCompactView
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.
void hierarchy(const DDLogicalPart &parent, int count=0)
std::string link(std::string &nm, std::string &ns)
edge_range edges(index_type nodeIndex)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
DDSolidShape shape(void) const
The type of the solid.
edge_list::iterator edge_iterator
void generateHtml(std::vector< DDLogicalPart > &v, std::map< DDLogicalPart, int > &c)
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.