4 #include "DetectorDescription/Core/interface/Singleton.icc"
32 using namespace geant_units::operators;
42 os_ <<
"<html>\n<head>\n<title>" << title <<
"</title>" << endl;
43 os_ <<
"<link rel=\"stylesheet\" type=\"text/css\" href=\"" << style <<
"\">" << endl;
50 os_ << lnk(url, txt, target) << endl;
64 os_ <<
"</body></html>" << endl;
73 os_ << f.
header(title_,
"../style.css");
74 os_ << f.
h2(title_) << f.
p(text_);
75 ns_type::const_iterator it = n_.begin();
76 ns_type::const_iterator ed = n_.end();
78 for (; it != ed; ++it) {
79 os_ << f.
li(f.
lnk(it->first +
"/list.html", it->first, target_));
81 os_ << f.
ulEnd() << endl;
118 os <<
f_.
header(
"Solid Details") <<
f_.
h3(
">> formatting under construction <<");
124 os <<
f_.
header(
"SpecPars Details") <<
f_.
h3(
">> formatting under construction <<");
130 os <<
f_.
header(
"Rotations Details");
134 os <<
"<b>ERROR!</b><br><p>The Rotation " << nm <<
" is not defined!</p>" << endl;
138 ddr.
matrix().GetComponents(x, y, z);
140 os <<
f_.
h3(
"GEANT3 style:");
141 os <<
"<table border=\"0\">" << endl
142 <<
"<tr><td>thetaX =</td><td>" <<
convertRadToDeg(x.Theta()) <<
" deg</td><tr>" << endl
143 <<
"<tr><td>phiX =</td><td>" <<
convertRadToDeg(x.Phi()) <<
" deg</td><tr>" << endl
144 <<
"<tr><td>thetaY =</td><td>" <<
convertRadToDeg(y.Theta()) <<
" deg</td><tr>" << endl
145 <<
"<tr><td>phiY =</td><td>" <<
convertRadToDeg(y.Phi()) <<
" deg</td><tr>" << endl
146 <<
"<tr><td>thetaZ =</td><td>" <<
convertRadToDeg(z.Theta()) <<
" deg</td><tr>" << endl
147 <<
"<tr><td>phiZ =</td><td>" <<
convertRadToDeg(z.Phi()) <<
" deg</td><tr>" << endl
150 os <<
f_.
h3(
"Rotation axis & angle (theta,phi,angle)") << endl;
157 static bool once =
false;
160 DDLogicalPart::iterator<DDLogicalPart> it, ed;
163 for (; it != ed; ++it) {
164 if (it->isDefined().second)
169 string s = nm.
ns() +
" : " + nm.
name();
172 os <<
f_.
h2(
"Material <b>" + s +
"</b>");
175 os <<
"<b>ERROR!<b><br><p>The Material is not defined in namespace " << nm.
ns() <<
"! </p>" << endl;
182 os <<
f_.
p(
"Composites by fraction-mass:");
185 for (
int i = 0;
i <
co; ++
i) {
187 string elem =
"ERROR";
189 double frac = fm.second;
197 os <<
f_.
tr() <<
"<td>" << frac <<
"</td>"
203 os <<
f_.
p(
"ElementaryMaterial:");
204 os <<
"<p>z = " << ma.
z() <<
"</p>" << endl;
205 os <<
"<p>a = " <<
convertUnitsTo(1._g_per_mole, ma.
a()) <<
"g/mole</p>" << endl;
209 set<DDLogicalPart>::const_iterator it(lps.begin()), ed(lps.end());
211 os <<
f_.
h3(
"Material used in following LogicalParts:") << endl;
214 for (; it != ed; ++it) {
215 const DDName&
n = it->ddname();
218 os <<
"</p>" << endl;
223 static bool once =
false;
227 DDSpecifics::iterator<DDSpecifics> it, ed;
229 for (; it != ed; ++it) {
230 if (it->isDefined().second) {
231 const vector<DDPartSelection>& ps = it->selection();
232 vector<DDPartSelection>::const_iterator pit(ps.begin()), ped(ps.end());
233 for (; pit != ped; ++pit) {
241 string s = nm.
ns() +
" : " + nm.
name();
244 os <<
f_.
h2(
"LogicalPart <b>" + s +
"</b>");
247 os <<
"<b>ERROR!<b><br><p>The LogicalPart is not defined in namespace " << nm.
ns() <<
"! </p>" << endl;
260 typedef map<DDLogicalPart, set<DDSpecifics> > lp_sp_type;
262 lp_sp_type::const_iterator lpspit = lp_sp.find(lp);
263 if (lpspit != lp_sp.end()) {
264 os <<
f_.
h3(
"assigned SpecPars (Specifics):");
265 set<DDSpecifics>::const_iterator it(lpspit->second.begin()), ed(lpspit->second.end());
267 for (; it != ed; ++it) {
268 os <<
f_.
link(
"../../sp/" + it->ddname().ns() +
"/" + it->ddname().name() +
".html",
269 it->ddname().fullname(),
273 os <<
"</p>" << endl;
283 cout <<
"---> dd_to_html() called with category=" << dtls.
category() << endl;
288 mkdir(category.c_str(), 0755);
291 string ns_fname = category +
"/ns.html";
292 ofstream ns_file(ns_fname.c_str());
298 ns_type::const_iterator it(names.begin()), ed(names.end());
299 for (; it != ed; ++it) {
300 const string& ns = it->first;
303 string dir = category +
"/" + ns;
304 mkdir(dir.c_str(), 0755);
307 string fname = category +
"/" + ns +
"/list.html";
308 ofstream list_file(fname.c_str());
310 list_file << f.header(text) << f.p(
"Instances in Namespace <b>" + ns +
"</b><br>");
313 set<string>::const_iterator nit(it->second.begin()), ned(it->second.end());
314 for (; nit != ned; ++nit) {
315 const string& nm = *nit;
316 string result_s = nm;
319 string d_fname = category +
"/" + ns +
"/" + nm +
".html";
320 ofstream detail_file(d_fname.c_str());
325 result_s =
">> ERROR: " + nm +
" <<";
326 list_file << f.li(f.lnk(nm +
".html", result_s,
"_details"));
328 list_file << f.ulEnd() << f.footer();
338 os_ <<
"<frameset cols=\"25%,*\">" << endl;
339 os_ <<
" <frameset rows=\"50%,*\">" << endl;
340 os_ <<
" <frame src=\"" <<
u1_ <<
"\" name=\"" <<
n1_ <<
"\">" << endl;
341 os_ <<
" <frame src=\"" <<
u2_ <<
"\" name=\"" <<
n2_ <<
"\">" << endl;
342 os_ <<
" </frameset>" << endl;
343 os_ <<
" <frame src=\"" <<
u3_ <<
"\" name=\"" <<
n3_ <<
"\">" << endl;
344 os_ <<
"</frameset>" << endl;
350 os << f.
header(
"DDD Reports");
351 os <<
"<frameset rows=\"50%,50%\"> " << endl
352 <<
" <frameset cols=\"50%,50%\">" << endl
353 <<
" <frame name=\"_ns\" src=\"ns.html\">" << endl
354 <<
" <frame name=\"_list\">" << endl
355 <<
" </frameset>" << endl
356 <<
" <frameset cols=\"50%,50%\">" << endl
357 <<
" <frame name=\"_details\">" << endl
358 <<
" <frame name=\"_popup\">" << endl
359 <<
" </frameset>" << endl
360 <<
"</frameset>" << endl
367 os << f.
header(
"DDD Web Representation");
368 os <<
"<frameset cols=\"20%,80%\">" << endl
369 <<
" <frame name=\"_menu\" src=\"menu.html\">" << endl
370 <<
" <frame name=\"_selection\" >" << endl
371 <<
"</frameset>" << endl;
378 os << f.
header(
"DDD Web Main Menu",
"style.css");
379 os << f.
h1(
"Select a Category:") << f.
p(f.
lnk(
"lp/index.html",
"LogicalParts",
"_selection"))
380 << f.
p(f.
lnk(
"ma/index.html",
"Materials",
"_selection")) << f.
p(f.
lnk(
"so/index.html",
"Solids",
"_selection"))
381 << f.
p(f.
lnk(
"ro/index.html",
"Rotations",
"_selection")) << 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
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> DD3Vector
ns_type & names() override
std::ostream & operator<<(std::ostream &out, const std::tuple< Types...> &value)
static const char category[]
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
constexpr NumType convertRadToDeg(NumType radians)
bool details(std::ostream &os, const DDName &) override
const std::string & ns() const
Returns the namespace.
DDName is used to identify DDD entities uniquely.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
__host__ __device__ VT * co
bool details(std::ostream &os, const DDName &) override
const std::string names[nVars_]
A DDSolid represents the shape of a part.
constexpr NumType convertUnitsTo(double desiredUnits, NumType val)
Represents a uniquely identifyable rotation matrix.
double z() const
retruns the atomic number
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
ns_type & names() override
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()