forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DDDetector.cc
27 lines (22 loc) · 840 Bytes
/
DDDetector.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "DetectorDescription/DDCMS/interface/DDDetector.h"
#include <DD4hep/Detector.h>
#include <DD4hep/Volumes.h>
#include <iostream>
using namespace cms;
using namespace std;
DDDetector::DDDetector(const string& tag, const string& fileName) : m_tag(tag) {
m_description = &Detector::getInstance(tag);
m_description->addExtension<DDVectorsMap>(&m_vectors);
m_description->addExtension<DDPartSelectionMap>(&m_partsels);
m_description->addExtension<DDSpecParRegistry>(&m_specpars);
process(fileName);
}
void DDDetector::process(const string& fileName) {
std::string name("DD4hep_CompactLoader");
const char* files[] = {fileName.c_str(), nullptr};
m_description->apply(name.c_str(), 2, (char**)files);
}
dd4hep::Volume DDDetector::worldVolume() const {
assert(m_description);
return m_description->worldVolume();
}