CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
cms::DDDetector Class Reference

#include <DDDetector.h>

Public Member Functions

 DDDetector ()=delete
 
 DDDetector (const std::string &, const std::string &, bool bigXML=false)
 
dd4hep::Detector const * description () const
 
dd4hep::DetElement findElement (const std::string &) const
 Find DetElement as child of the top level volume by it's absolute path. More...
 
TGeoManager & manager () const
 The geometry manager of this instance. More...
 
dd4hep::PartSelectionMap const & partsels () const
 
dd4hep::SpecParRegistry const & specpars () const
 
cms::DDVectorsMap const & vectors () const
 
dd4hep::DetElement world () const
 Reference to the top-most (world) detector element. More...
 
dd4hep::Volume worldVolume () const
 Handle to the world volume containing everything. More...
 

Private Member Functions

void process (const std::string &)
 
void processXML (const std::string &)
 

Private Attributes

dd4hep::Detector * m_description = nullptr
 
dd4hep::PartSelectionMap m_partsels
 
dd4hep::SpecParRegistry m_specpars
 
const std::string m_tag
 
cms::DDVectorsMap m_vectors
 

Detailed Description

Definition at line 12 of file DDDetector.h.

Constructor & Destructor Documentation

◆ DDDetector() [1/2]

cms::DDDetector::DDDetector ( const std::string &  tag,
const std::string &  fileName,
bool  bigXML = false 
)
explicit

Definition at line 13 of file DDDetector.cc.

13  : m_tag(tag) {
14  m_description = &dd4hep::Detector::getInstance(tag);
15  m_description->addExtension<cms::DDVectorsMap>(&m_vectors);
16  m_description->addExtension<dd4hep::PartSelectionMap>(&m_partsels);
17  m_description->addExtension<dd4hep::SpecParRegistry>(&m_specpars);
18  if (bigXML)
20  else
22  }

References MillePedeFileConverter_cfg::fileName, m_description, m_partsels, m_specpars, m_vectors, process(), processXML(), and GlobalPosition_Frontier_DevDB_cff::tag.

◆ DDDetector() [2/2]

cms::DDDetector::DDDetector ( )
delete

Member Function Documentation

◆ description()

dd4hep::Detector const* cms::DDDetector::description ( ) const
inline

Definition at line 35 of file DDDetector.h.

35 { return m_description; }

References m_description.

Referenced by DDCMSDetector::analyze(), cms::DDG4Builder::BuildGeometry(), and cms::DDDWorld::DDDWorld().

◆ findElement()

dd4hep::DetElement cms::DDDetector::findElement ( const std::string &  path) const

Find DetElement as child of the top level volume by it's absolute path.

Definition at line 55 of file DDDetector.cc.

55  {
57  return dd4hep::detail::tools::findElement(*m_description, path);
58  }

References cms::cuda::assert(), m_description, and castor_dqm_sourceclient_file_cfg::path.

◆ manager()

TGeoManager & cms::DDDetector::manager ( ) const

The geometry manager of this instance.

Definition at line 50 of file DDDetector.cc.

50  {
52  return m_description->manager();
53  }

References cms::cuda::assert(), and m_description.

◆ partsels()

dd4hep::PartSelectionMap const& cms::DDDetector::partsels ( ) const
inline

Definition at line 19 of file DDDetector.h.

19 { return m_partsels; }

References m_partsels.

◆ process()

void cms::DDDetector::process ( const std::string &  fileName)
private

Definition at line 24 of file DDDetector.cc.

24  {
25  std::string name("DD4hep_CompactLoader");
26  const char* files[] = {fileName.c_str(), nullptr};
27  m_description->apply(name.c_str(), 2, (char**)files);
28  }

References MillePedeFileConverter_cfg::fileName, submitPVResolutionJobs::files, m_description, Skims_PA_cff::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DDDetector().

◆ processXML()

void cms::DDDetector::processXML ( const std::string &  xml)
private

Definition at line 30 of file DDDetector.cc.

30  {
31  edm::LogVerbatim("Geometry") << "DDDetector::processXML process string size " << xml.size() << " with max_size "
32  << xml.max_size();
33  std::string name("DD4hep_XMLProcessor");
34  dd4hep::xml::DocumentHolder doc(dd4hep::xml::DocumentHandler().parse(xml.c_str(), xml.length()));
35 
36  char* args[] = {(char*)doc.root().ptr(), nullptr};
37  m_description->apply(name.c_str(), 1, (char**)args);
38  }

References writedatasetfile::args, common_cff::doc, m_description, Skims_PA_cff::name, dumpparser::parse(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DDDetector().

◆ specpars()

dd4hep::SpecParRegistry const& cms::DDDetector::specpars ( ) const
inline

Definition at line 21 of file DDDetector.h.

21 { return m_specpars; }

References m_specpars.

Referenced by cms::DDG4Builder::BuildGeometry(), DDDWorld::DDDWorld(), and cms::DDCompactView::specpars().

◆ vectors()

cms::DDVectorsMap const& cms::DDDetector::vectors ( ) const
inline

◆ world()

dd4hep::DetElement cms::DDDetector::world ( ) const

Reference to the top-most (world) detector element.

Definition at line 45 of file DDDetector.cc.

45  {
47  return m_description->world();
48  }

References cms::cuda::assert(), and m_description.

◆ worldVolume()

dd4hep::Volume cms::DDDetector::worldVolume ( ) const

Member Data Documentation

◆ m_description

dd4hep::Detector* cms::DDDetector::m_description = nullptr
private

◆ m_partsels

dd4hep::PartSelectionMap cms::DDDetector::m_partsels
private

Definition at line 43 of file DDDetector.h.

Referenced by DDDetector(), and partsels().

◆ m_specpars

dd4hep::SpecParRegistry cms::DDDetector::m_specpars
private

Definition at line 44 of file DDDetector.h.

Referenced by DDDetector(), and specpars().

◆ m_tag

const std::string cms::DDDetector::m_tag
private

Definition at line 45 of file DDDetector.h.

◆ m_vectors

cms::DDVectorsMap cms::DDDetector::m_vectors
private

Definition at line 42 of file DDDetector.h.

Referenced by DDDetector(), and vectors().

writedatasetfile.args
args
Definition: writedatasetfile.py:18
cms::DDDetector::m_tag
const std::string m_tag
Definition: DDDetector.h:45
common_cff.doc
doc
Definition: common_cff.py:54
cms::cuda::assert
assert(be >=bs)
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
submitPVResolutionJobs.files
files
Definition: submitPVResolutionJobs.py:373
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
cms::DDDetector::process
void process(const std::string &)
Definition: DDDetector.cc:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::DDDetector::m_partsels
dd4hep::PartSelectionMap m_partsels
Definition: DDDetector.h:43
dumpparser.parse
def parse(path, config)
Definition: dumpparser.py:13
cms::DDDetector::m_specpars
dd4hep::SpecParRegistry m_specpars
Definition: DDDetector.h:44
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
cms::DDDetector::m_vectors
cms::DDVectorsMap m_vectors
Definition: DDDetector.h:42
cms::DDVectorsMap
std::unordered_map< std::string, std::vector< double > > DDVectorsMap
Definition: DDNamespace.h:14
cms::DDDetector::processXML
void processXML(const std::string &)
Definition: DDDetector.cc:30
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
cms::DDDetector::m_description
dd4hep::Detector * m_description
Definition: DDDetector.h:41