CMS 3D CMS Logo

Functions
DDHtmlFormatter.cc File Reference
#include "DetectorDescription/Core/interface/DDRotationMatrix.h"
#include "DetectorDescription/Core/interface/DDTranslation.h"
#include "DetectorDescription/Core/interface/Singleton.h"
#include "DetectorDescription/Core/interface/Singleton.icc"
#include "DetectorDescription/Core/interface/DDBase.h"
#include "DetectorDescription/Core/interface/DDEnums.h"
#include "DetectorDescription/Core/interface/DDLogicalPart.h"
#include "DetectorDescription/Core/interface/DDMaterial.h"
#include "DetectorDescription/Core/interface/DDName.h"
#include "DetectorDescription/Core/interface/DDPartSelection.h"
#include "DetectorDescription/Core/interface/DDSolid.h"
#include "DetectorDescription/Core/interface/DDSpecifics.h"
#include "DetectorDescription/Core/interface/DDTransform.h"
#include "DetectorDescription/Core/interface/LogicalPart.h"
#include "DetectorDescription/Core/interface/Material.h"
#include "DetectorDescription/Core/interface/Specific.h"
#include "DetectorDescription/Core/interface/Solid.h"
#include "DataFormats/Math/interface/GeantUnits.h"
#include "DetectorDescription/RegressionTest/interface/DDErrorDetection.h"
#include "DetectorDescription/RegressionTest/interface/DDHtmlFormatter.h"
#include <fstream>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <sys/stat.h>
#include <utility>
#include <vector>

Go to the source code of this file.

Functions

void dd_html_frameset (ostream &os)
 
void dd_html_menu (ostream &os)
 
void dd_html_menu_frameset (ostream &os)
 
void dd_to_html (DDHtmlDetails &dtls)
 
ostream & operator<< (ostream &o, const DDHtmlFormatter &f)
 

Function Documentation

◆ dd_html_frameset()

void dd_html_frameset ( ostream &  os)

Definition at line 348 of file DDHtmlFormatter.cc.

References f.

348  {
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
361  << endl;
362  os << f.footer();
363 }
double f[11][100]

◆ dd_html_menu()

void dd_html_menu ( ostream &  os)

Definition at line 376 of file DDHtmlFormatter.cc.

References f.

376  {
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"));
382 
383  os << f.footer();
384 }
double f[11][100]

◆ dd_html_menu_frameset()

void dd_html_menu_frameset ( ostream &  os)

Definition at line 365 of file DDHtmlFormatter.cc.

References f.

365  {
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;
372 
373  os << f.footer();
374 }
double f[11][100]

◆ dd_to_html()

void dd_to_html ( DDHtmlDetails dtls)

Definition at line 282 of file DDHtmlFormatter.cc.

References taus_updatedMVAIds_cff::category, DDHtmlDetails::category(), gather_cfg::cout, DDHtmlDetails::details(), DeadROC_duringRun::dir, f, alignmentValidation::fname, eostools::mkdir(), names, DDHtmlDetails::names(), mps_fire::result, runonSM::text, and DDHtmlDetails::text().

282  {
283  cout << "---> dd_to_html() called with category=" << dtls.category() << endl;
284  const string& category = dtls.category();
285  const string& text = dtls.text();
286  ns_type& names = dtls.names();
287 
288  mkdir(category.c_str(), 0755);
289 
290  // first the namespaces
291  string ns_fname = category + "/ns.html";
292  ofstream ns_file(ns_fname.c_str());
293  DDNsGenerator ns_gen(ns_file, text, "_list", names, "");
294  ns_gen.doit();
295  ns_file.close();
296 
297  // list all logical parts per namespace
298  ns_type::const_iterator it(names.begin()), ed(names.end());
299  for (; it != ed; ++it) {
300  const string& ns = it->first;
301 
302  // create directories named like the namespaces
303  string dir = category + "/" + ns;
304  mkdir(dir.c_str(), 0755);
305 
306  // create a html file listing all instances of a namespace
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>");
311  list_file << f.ul();
312  // loop over all instances of a single namespace
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;
317 
318  // details for each instance
319  string d_fname = category + "/" + ns + "/" + nm + ".html";
320  ofstream detail_file(d_fname.c_str());
321  DDName an(nm, ns);
322  bool result = dtls.details(detail_file, an);
323 
324  if (!result)
325  result_s = ">> ERROR: " + nm + " <<";
326  list_file << f.li(f.lnk(nm + ".html", result_s, "_details"));
327  }
328  list_file << f.ulEnd() << f.footer();
329  }
330 }
virtual bool details(std::ostream &os, const DDName &)=0
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
const std::string names[nVars_]
std::map< std::string, std::set< std::string > > ns_type
double f[11][100]
virtual ns_type & names()=0
const std::string & text()
string fname
main script
def mkdir(path)
Definition: eostools.py:251
const std::string & category()

◆ operator<<()

ostream& operator<< ( ostream &  o,
const DDHtmlFormatter f 
)

Definition at line 34 of file DDHtmlFormatter.cc.

References f, and EcalTangentSkim_cfg::o.

34  {
35  o << f.os_.str();
36  f.os_.str("");
37  return o;
38 }
double f[11][100]