CMS 3D CMS Logo

List of all members | Public Member Functions
DDHtmlMaDetails Class Reference

#include <DDHtmlFormatter.h>

Inheritance diagram for DDHtmlMaDetails:
DDHtmlDetails

Public Member Functions

 DDHtmlMaDetails (const std::string &cat, const std::string &txt)
 
bool details (std::ostream &os, const DDName &) override
 
ns_typenames () override
 
- Public Member Functions inherited from DDHtmlDetails
const std::string & category ()
 
 DDHtmlDetails (const std::string &cat, const std::string &txt)
 
const std::string & text ()
 
virtual ~DDHtmlDetails ()
 

Additional Inherited Members

- Protected Attributes inherited from DDHtmlDetails
std::string cat_
 
DDHtmlFormatter f_
 
ns_type names_
 
std::string txt_
 

Detailed Description

Definition at line 170 of file DDHtmlFormatter.h.

Constructor & Destructor Documentation

◆ DDHtmlMaDetails()

DDHtmlMaDetails::DDHtmlMaDetails ( const std::string &  cat,
const std::string &  txt 
)
inline

Definition at line 172 of file DDHtmlFormatter.h.

172 : DDHtmlDetails(cat, txt) {}
def cat(path)
Definition: eostools.py:401
DDHtmlDetails(const std::string &cat, const std::string &txt)

Member Function Documentation

◆ details()

bool DDHtmlMaDetails::details ( std::ostream &  os,
const DDName  
)
overridevirtual

Implements DDHtmlDetails.

Definition at line 155 of file DDHtmlFormatter.cc.

References DDMaterial::a(), DDHtmlFormatter::br(), cms::cuda::co, DDMaterial::constituent(), geant_units::operators::convertUnitsTo(), DDMaterial::density(), DDHtmlDetails::f_, DivergingColor::frac, DDHtmlFormatter::h2(), DDHtmlFormatter::h3(), DDHtmlFormatter::header(), mps_fire::i, instance, DDBase< N, C >::isDefined(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, DDHtmlFormatter::link(), DDHtmlFormatter::lnk(), visualization-live-secondInstance_cfg::m, dqmiodumpmetadata::n, DDName::name(), DDMaterial::noOfConstituents(), DDName::ns(), l1tGTMenu_BTagSeeds_cff::os, DDHtmlFormatter::p(), alignCSCRings::s, DDHtmlFormatter::table(), DDHtmlFormatter::tableEnd(), DDHtmlFormatter::td(), DDHtmlFormatter::tr(), DDHtmlFormatter::trEnd(), and DDMaterial::z().

155  {
157  static bool once = false;
158  if (!once) {
159  once = true;
160  DDLogicalPart::iterator<DDLogicalPart> it, ed;
161  ed.end();
162 
163  for (; it != ed; ++it) {
164  if (it->isDefined().second)
165  parts_t::instance()[it->material()].insert(*it);
166  }
167  }
168 
169  string s = nm.ns() + " : " + nm.name();
170  DDMaterial ma(nm);
171  os << f_.header(s);
172  os << f_.h2("Material <b>" + s + "</b>");
173  os << f_.br();
174  if (ma.isDefined().second == false) {
175  os << "<b>ERROR!<b><br><p>The Material is not defined in namespace " << nm.ns() << "! </p>" << endl;
176  return false;
177  }
178 
179  os << "<p>density = " << convertUnitsTo(1._g_per_cm3, ma.density()) << " g/cm3 </p>" << endl;
180  int co = ma.noOfConstituents();
181  if (co) {
182  os << f_.p("Composites by fraction-mass:");
183  os << f_.table() << f_.tr() << f_.td("<b>fm</b>") << f_.td("<b>Material</b>") << f_.td("<b>elementary?</b>")
184  << f_.trEnd();
185  for (int i = 0; i < co; ++i) {
186  pair<DDMaterial, double> fm = ma.constituent(i);
187  string elem = "ERROR";
188  DDMaterial m = fm.first;
189  double frac = fm.second;
190 
191  if (m.isDefined().second) {
192  if (m.noOfConstituents())
193  elem = "no";
194  else
195  elem = "yes";
196  }
197  os << f_.tr() << "<td>" << frac << "</td>"
198  << f_.td(f_.lnk("../" + m.ddname().ns() + "/" + m.ddname().name() + ".html", m.ddname().fullname(), "_popup"))
199  << f_.td(elem) << f_.trEnd();
200  }
201  os << f_.tableEnd();
202  } else { // if ( co ) ...
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;
206  }
207 
208  const set<DDLogicalPart>& lps = parts_t::instance()[ma];
209  set<DDLogicalPart>::const_iterator it(lps.begin()), ed(lps.end());
210  if (it != ed) {
211  os << f_.h3("Material used in following LogicalParts:") << endl;
212  os << "<p>" << endl;
213  }
214  for (; it != ed; ++it) {
215  const DDName& n = it->ddname();
216  os << f_.link("../../lp/" + n.ns() + "/" + n.name() + ".html", n.fullname(), "_popup");
217  }
218  os << "</p>" << endl;
219  return true;
220 }
static PFTauRenderPlugin instance
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
DDHtmlFormatter br()
DDHtmlFormatter h3(const std::string &content)
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
__host__ __device__ VT * co
Definition: prefixScan.h:47
constexpr NumType convertUnitsTo(double desiredUnits, NumType val)
Definition: GeantUnits.h:73
DDHtmlFormatter td(const std::string &content)
DDHtmlFormatter f_
DDHtmlFormatter p(const std::string &content)
DDHtmlFormatter h2(const std::string &content)
DDHtmlFormatter table(int border=0)
DDHtmlFormatter tableEnd()
DDHtmlFormatter tr()
DDHtmlFormatter header(const std::string &text, const std::string &style="../../style.css")
std::string lnk(const std::string &url, const std::string &text, const std::string &target="_self")
DDHtmlFormatter trEnd()
DDHtmlFormatter link(const std::string &url, const std::string &text, const std::string &target="_self")

◆ names()

ns_type & DDHtmlMaDetails::names ( void  )
overridevirtual

Implements DDHtmlDetails.

Definition at line 93 of file DDHtmlFormatter.cc.

References findNameSpaces(), and DDHtmlDetails::names_.

93  {
94  DDMaterial lp;
96  return names_;
97 }
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
bool findNameSpaces(T dummy, ns_type &m)