CMS 3D CMS Logo

DDDetector.cc
Go to the documentation of this file.
2 #include <DD4hep/Detector.h>
3 #include <DD4hep/Volumes.h>
4 
5 #include <iostream>
6 
7 using namespace cms;
8 using namespace std;
9 
10 DDDetector::DDDetector(const string& tag, const string& fileName)
11  : m_tag(tag)
12 {
13  m_description = &Detector::getInstance(tag);
14  m_description->addExtension<DDVectorsMap>(&m_vectors);
15  m_description->addExtension<DDPartSelectionMap>(&m_partsels);
16  m_description->addExtension<DDSpecParRegistry>(&m_specpars);
17  process(fileName);
18 }
19 
21 {
22  Detector::destroyInstance(m_tag);
23 }
24 
25 void
27 {
28  std::string name("DD4hep_CompactLoader");
29  const char* files[] = { fileName.c_str(), nullptr };
30  m_description->apply( name.c_str(), 2, (char**)files );
31 }
32 
35  assert(m_description);
36  return m_description->worldVolume();
37 }
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< std::string >> DDPartSelectionMap
void process(const std::string &)
Definition: DDDetector.cc:26
DDDetector()=delete
Volume worldVolume() const
Definition: DDDetector.cc:34
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< double >> DDVectorsMap
dd4hep::Volume Volume
Namespace of DDCMS conversion namespace.