4 #include "DetectorDescription/Core/interface/Singleton.icc" 36 o << f.
os_.str(); f.
os_.str(
"");
43 os_ <<
"<html>\n<head>\n<title>" << title <<
"</title>" << endl;
44 os_ <<
"<link rel=\"stylesheet\" type=\"text/css\" href=\"" << style <<
"\">" << endl;
52 os_ << lnk(url,txt,target) << endl;
68 os_ <<
"</body></html>" << endl;
80 os_ << f.
header(title_,
"../style.css");
81 os_ << f.
h2(title_) << f.
p(text_);
82 ns_type::const_iterator it = n_.begin();
83 ns_type::const_iterator ed = n_.end();
85 for (; it != ed; ++it) {
86 os_ << f.
li(f.
lnk(it->first +
"/list.html" , it->first, target_));
88 os_ << f.
ulEnd() << endl;
133 <<
f_.
h3(
">> formatting under construction <<");
134 os <<
DDSolid(nm);
return true;
140 <<
f_.
h3(
">> formatting under construction <<");
146 os <<
f_.
header(
"Rotations Details");
150 os <<
"<b>ERROR!</b><br><p>The Rotation " << nm <<
" is not defined!</p>" << endl;
154 ddr.
matrix().GetComponents(x, y, z);
156 os <<
f_.
h3(
"GEANT3 style:");
157 os <<
"<table border=\"0\">" << endl
158 <<
"<tr><td>thetaX =</td><td>" <<
convertRadToDeg( x.Theta() ) <<
" deg</td><tr>" << endl
159 <<
"<tr><td>phiX =</td><td>" <<
convertRadToDeg( x.Phi() ) <<
" deg</td><tr>" << endl
160 <<
"<tr><td>thetaY =</td><td>" <<
convertRadToDeg( y.Theta() ) <<
" deg</td><tr>" << endl
161 <<
"<tr><td>phiY =</td><td>" <<
convertRadToDeg( y.Phi() ) <<
" deg</td><tr>" << endl
162 <<
"<tr><td>thetaZ =</td><td>" <<
convertRadToDeg( z.Theta() ) <<
" deg</td><tr>" << endl
163 <<
"<tr><td>phiZ =</td><td>" <<
convertRadToDeg( z.Phi() ) <<
" deg</td><tr>" << endl
166 os <<
f_.
h3(
"Rotation axis & angle (theta,phi,angle)") << endl;
173 static bool once =
false;
176 DDLogicalPart::iterator<DDLogicalPart> it, ed;
179 for (; it != ed; ++it) {
180 if (it->isDefined().second)
185 string s = nm.
ns() +
" : " + nm.
name();
188 os <<
f_.
h2(
"Material <b>" + s +
"</b>");
191 os <<
"<b>ERROR!<b><br><p>The Material is not defined in namespace " << nm.
ns() <<
"! </p>" << endl;
198 os <<
f_.
p(
"Composites by fraction-mass:");
201 for(
int i=0;
i<co; ++
i) {
203 string elem =
"ERROR";
205 double frac = fm.second;
213 os <<
f_.
tr() <<
"<td>" << frac <<
"</td>" 220 os <<
f_.
p(
"ElementaryMaterial:");
221 os <<
"<p>z = " << ma.
z() <<
"</p>" << endl;
222 os <<
"<p>a = " <<
convertUnitsTo(1._g_per_mole, ma.
a()) <<
"g/mole</p>" << endl;
227 set<DDLogicalPart>::const_iterator it(lps.begin()), ed(lps.end());
229 os <<
f_.
h3(
"Material used in following LogicalParts:") << endl;
232 for (; it != ed; ++it ) {
233 const DDName &
n = it->ddname();
236 os <<
"</p>" << endl;
242 static bool once =
false;
246 DDSpecifics::iterator<DDSpecifics> it, ed;
248 for (; it != ed; ++it ) {
249 if (it->isDefined().second) {
250 const vector<DDPartSelection> & ps = it->selection();
251 vector<DDPartSelection>::const_iterator pit(ps.begin()), ped(ps.end());
252 for (; pit != ped; ++pit) {
260 string s = nm.
ns() +
" : " + nm.
name();
263 os <<
f_.
h2(
"LogicalPart <b>" + s +
"</b>");
266 os <<
"<b>ERROR!<b><br><p>The LogicalPart is not defined in namespace " << nm.
ns() <<
"! </p>" << endl;
280 typedef map<DDLogicalPart, set<DDSpecifics> > lp_sp_type;
282 lp_sp_type::const_iterator lpspit = lp_sp.find(lp);
283 if (lpspit != lp_sp.end()) {
284 os <<
f_.
h3(
"assigned SpecPars (Specifics):");
285 set<DDSpecifics>::const_iterator it(lpspit->second.begin()), ed(lpspit->second.end());
287 for (; it != ed; ++it) {
288 os <<
f_.
link(
"../../sp/" + it->ddname().ns() +
"/" + it->ddname().name() +
".html", it->ddname().fullname(),
"_popup")
291 os <<
"</p>" << endl;
302 cout <<
"---> dd_to_html() called with category=" << dtls.
category() << endl;
307 mkdir( category.c_str(), 0755 );
310 string ns_fname = category +
"/ns.html";
311 ofstream ns_file(ns_fname.c_str());
317 ns_type::const_iterator it(names.begin()), ed(names.end());
318 for( ; it != ed; ++it ) {
320 const string & ns = it->first;
323 string dir = category +
"/" + ns;
324 mkdir( dir.c_str(), 0755 );
327 string fname = category +
"/" + ns +
"/list.html";
328 ofstream list_file(fname.c_str());
330 list_file << f.header(text)
331 << f.p(
"Instances in Namespace <b>" + ns +
"</b><br>");
334 set<string>::const_iterator nit(it->second.begin()), ned(it->second.end());
335 for(; nit != ned; ++nit) {
337 const string & nm = *nit;
338 string result_s = nm;
341 string d_fname = category +
"/" + ns +
"/" + nm +
".html";
342 ofstream detail_file(d_fname.c_str());
346 if (!result) result_s =
">> ERROR: " + nm +
" <<";
347 list_file << f.li(f.lnk(nm+
".html", result_s,
"_details"));
350 list_file << f.ulEnd() << f.footer();
362 os_ <<
"<frameset cols=\"25%,*\">" << endl;
363 os_ <<
" <frameset rows=\"50%,*\">" << endl;
364 os_ <<
" <frame src=\"" << u1_ <<
"\" name=\"" << n1_ <<
"\">" << endl;
365 os_ <<
" <frame src=\"" << u2_ <<
"\" name=\"" << n2_ <<
"\">" << endl;
366 os_ <<
" </frameset>" << endl;
367 os_ <<
" <frame src=\"" << u3_ <<
"\" name=\"" << n3_ <<
"\">" << endl;
368 os_ <<
"</frameset>" << endl;
369 os_ << f.
footer() << endl;
375 os << f.
header(
"DDD Reports");
376 os <<
"<frameset rows=\"50%,50%\"> " << endl
377 <<
" <frameset cols=\"50%,50%\">" << endl
378 <<
" <frame name=\"_ns\" src=\"ns.html\">" << endl
379 <<
" <frame name=\"_list\">" << endl
380 <<
" </frameset>" << endl
381 <<
" <frameset cols=\"50%,50%\">" << endl
382 <<
" <frame name=\"_details\">" << endl
383 <<
" <frame name=\"_popup\">" << endl
384 <<
" </frameset>" << endl
385 <<
"</frameset>" << endl
394 os << f.
header(
"DDD Web Representation");
395 os <<
"<frameset cols=\"20%,80%\">" << endl
396 <<
" <frame name=\"_menu\" src=\"menu.html\">" << endl
397 <<
" <frame name=\"_selection\" >" << endl
398 <<
"</frameset>" << endl;
407 os << f.
header(
"DDD Web Main Menu",
"style.css");
408 os << f.
h1(
"Select a Category:")
409 << f.
p(f.
lnk(
"lp/index.html",
"LogicalParts",
"_selection"))
410 << f.
p(f.
lnk(
"ma/index.html",
"Materials",
"_selection"))
411 << f.
p(f.
lnk(
"so/index.html",
"Solids",
"_selection"))
412 << f.
p(f.
lnk(
"ro/index.html",
"Rotations",
"_selection"))
413 << f.
p(f.
lnk(
"sp/index.html",
"SpecPars",
"_selection"))
bool details(std::ostream &os, const DDName &) override
double a() const
returns the atomic mass
def_type isDefined() const
constexpr NumType convertUnitsTo(long double desiredUnits, NumType val)
ns_type & names() override
static PFTauRenderPlugin instance
DDMaterial is used to define and access material information.
DDEnums::Category category(void) const
Returns the categorization of the DDLogicalPart (sensitive detector element, cable, ...)
bool details(std::ostream &os, const DDName &) override
virtual bool details(std::ostream &os, const DDName &)=0
bool details(std::ostream &os, const DDName &) override
const std::string & ns() const
Returns the namespace.
DDName is used to identify DDD entities uniquely.
constexpr NumType convertRadToDeg(NumType radians)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
bool details(std::ostream &os, const DDName &) override
A DDSolid represents the shape of a part.
Represents a uniquely identifyable rotation matrix.
double z() const
retruns the atomic number
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
std::map< std::string, std::set< std::string >> ns_type
const std::string fullname() const
FractionV::value_type constituent(int i) const
returns the i-th compound material and its fraction-mass
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
bool details(std::ostream &os, const DDName &) override
virtual ns_type & names()=0
std::ostream & operator<<(std::ostream &out, const std::tuple< Types... > &value)
ns_type & names() override
def elem(elemtype, innerHTML='', html_class='', kwargs)
DDHtmlDetails(const std::string &cat, const std::string &txt)
double density() const
returns the density
int noOfConstituents() const
returns the number of compound materials or 0 for elementary materials
ns_type & names() override
const std::string & text()
bool findNameSpaces(T dummy, ns_type &m)
const std::string & category()
ns_type & names() override
static const char *const categoryName(Category s)
const std::string & name() const
Returns the name.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
Interface to attach user specific data to nodes in the expanded-view.
ns_type & names() override
DDRotationMatrix & matrix()