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) {}

Member Function Documentation

◆ details()

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

Implements DDHtmlDetails.

Definition at line 155 of file DDHtmlFormatter.cc.

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 }

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

◆ names()

ns_type & DDHtmlMaDetails::names ( void  )
overridevirtual

Implements DDHtmlDetails.

Definition at line 93 of file DDHtmlFormatter.cc.

93  {
94  DDMaterial lp;
96  return names_;
97 }

References findNameSpaces(), and DDHtmlDetails::names_.

DDHtmlFormatter::h3
DDHtmlFormatter h3(const std::string &content)
Definition: DDHtmlFormatter.h:64
DDHtmlFormatter::p
DDHtmlFormatter p(const std::string &content)
Definition: DDHtmlFormatter.h:32
mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
DDHtmlFormatter::lnk
std::string lnk(const std::string &url, const std::string &text, const std::string &target="_self")
Definition: DDHtmlFormatter.cc:54
geant_units::operators::convertUnitsTo
constexpr NumType convertUnitsTo(long double desiredUnits, NumType val)
Definition: GeantUnits.h:87
cropTnPTrees.frac
frac
Definition: cropTnPTrees.py:18
eostools.cat
def cat(path)
Definition: eostools.py:401
DDI::Singleton
Definition: Singleton.h:6
DDHtmlFormatter::br
DDHtmlFormatter br()
Definition: DDHtmlFormatter.h:27
cms::cuda::co
T *__restrict__ co
Definition: prefixScan.h:46
findNameSpaces
bool findNameSpaces(T dummy, ns_type &m)
Definition: DDErrorDetection.h:68
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DDMaterial
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
DDHtmlFormatter::link
DDHtmlFormatter link(const std::string &url, const std::string &text, const std::string &target="_self")
Definition: DDHtmlFormatter.cc:48
DDHtmlDetails::DDHtmlDetails
DDHtmlDetails(const std::string &cat, const std::string &txt)
Definition: DDHtmlFormatter.cc:85
DDHtmlFormatter::tableEnd
DDHtmlFormatter tableEnd()
Definition: DDHtmlFormatter.h:78
DDHtmlFormatter::td
DDHtmlFormatter td(const std::string &content)
Definition: DDHtmlFormatter.h:93
DDHtmlFormatter::header
DDHtmlFormatter header(const std::string &text, const std::string &style="../../style.css")
Definition: DDHtmlFormatter.cc:40
DDHtmlFormatter::trEnd
DDHtmlFormatter trEnd()
Definition: DDHtmlFormatter.h:88
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
DDHtmlFormatter::tr
DDHtmlFormatter tr()
Definition: DDHtmlFormatter.h:83
DDHtmlFormatter::table
DDHtmlFormatter table(int border=0)
Definition: DDHtmlFormatter.h:73
DDHtmlDetails::names_
ns_type names_
Definition: DDHtmlFormatter.h:158
DDHtmlFormatter::h2
DDHtmlFormatter h2(const std::string &content)
Definition: DDHtmlFormatter.h:59
DDHtmlDetails::f_
DDHtmlFormatter f_
Definition: DDHtmlFormatter.h:160