CMS 3D CMS Logo

Classes | Functions
DDHtmlFormatter.h File Reference
#include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include "DetectorDescription/RegressionTest/interface/DDErrorDetection.h"

Go to the source code of this file.

Classes

class  DDFrameGenerator
 
class  DDHtmlDetails
 
class  DDHtmlFormatter
 
class  DDHtmlLpDetails
 
class  DDHtmlMaDetails
 
class  DDHtmlRoDetails
 
class  DDHtmlSoDetails
 
class  DDHtmlSpDetails
 
class  DDNsGenerator
 

Functions

void dd_html_frameset (std::ostream &os)
 
void dd_html_menu (std::ostream &os)
 
void dd_html_menu_frameset (std::ostream &os)
 
void dd_html_ro ()
 
void dd_to_html (DDHtmlDetails &det)
 
std::ostream & operator<< (std::ostream &o, const DDHtmlFormatter &f)
 

Function Documentation

◆ dd_html_frameset()

void dd_html_frameset ( std::ostream &  os)

◆ dd_html_menu()

void dd_html_menu ( std::ostream &  os)

◆ dd_html_menu_frameset()

void dd_html_menu_frameset ( std::ostream &  os)

◆ dd_html_ro()

void dd_html_ro ( )

◆ dd_to_html()

void dd_to_html ( DDHtmlDetails det)

Definition at line 282 of file DDHtmlFormatter.cc.

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 }

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().

◆ operator<<()

std::ostream& operator<< ( std::ostream &  o,
const DDHtmlFormatter f 
)
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:31
DDHtmlFormatter
Definition: DDHtmlFormatter.h:17
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DDNsGenerator
Definition: DDHtmlFormatter.h:112
ns_type
std::map< std::string, std::set< std::string > > ns_type
Definition: DDErrorDetection.h:33
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
eostools.mkdir
def mkdir(path)
Definition: eostools.py:251
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
mps_fire.result
result
Definition: mps_fire.py:311
runonSM.text
text
Definition: runonSM.py:43
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23