CMS 3D CMS Logo

DDCMSDetector.cc
Go to the documentation of this file.
12 #include "DD4hep/Detector.h"
13 
14 #include <memory>
15 #include <string>
16 
17 using namespace std;
18 using namespace cms;
19 using namespace edm;
20 using namespace dd4hep;
21 
22 class DDCMSDetector : public one::EDAnalyzer<> {
23 public:
24  explicit DDCMSDetector(const ParameterSet& p);
25 
26  void beginJob() override {}
27  void analyze(Event const& iEvent, EventSetup const&) override;
28  void endJob() override;
29 
30 private:
32 };
33 
34 DDCMSDetector::DDCMSDetector(const ParameterSet& iConfig) : m_tag(iConfig.getParameter<ESInputTag>("DDDetector")) {}
35 
36 void DDCMSDetector::analyze(const Event&, const EventSetup& iEventSetup) {
38  iEventSetup.get<IdealGeometryRecord>().get(m_tag, det);
39 
40  LogVerbatim("Geometry") << "Iterate over the detectors:\n";
41  LogVerbatim("Geometry").log([&](auto& log) {
42  for (auto const& it : det->description()->detectors()) {
43  dd4hep::DetElement det(it.second);
44  log << it.first << ": " << det.path();
45  }
46  });
47  LogVerbatim("Geometry") << "..done!";
48 
50  iEventSetup.get<DDVectorRegistryRcd>().get(m_tag, registry);
51 
52  LogVerbatim("Geometry") << "DD Vector Registry size: " << registry->vectors.size();
53  LogVerbatim("Geometry").log([&](auto& log) {
54  for (const auto& p : registry->vectors) {
55  log << " " << p.first << " => ";
56  for (const auto& i : p.second)
57  log << i << ", ";
58  log << '\n';
59  }
60  });
61 }
62 
64 
EDAnalyzer.h
edm::ESInputTag
Definition: ESInputTag.h:87
ESTransientHandle.h
MessageLogger.h
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DDCMSDetector::endJob
void endJob() override
Definition: DDCMSDetector.cc:63
DDVectorRegistryRcd
Definition: DDVectorRegistryRcd.h:8
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
DDDetector.h
cms::DDDetector::description
dd4hep::Detector const * description() const
Definition: DDDetector.h:35
DDCMSDetector
Definition: DDCMSDetector.cc:22
FileInPath.h
MakerMacros.h
cms::DDVectorRegistry::vectors
DDVectorsMap vectors
Definition: DDVectorRegistry.h:12
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
DDVectorRegistry.h
edm::ParameterSet
Definition: ParameterSet.h:47
DDCMSDetector::m_tag
const ESInputTag m_tag
Definition: DDCMSDetector.cc:31
DDCMSDetector::beginJob
void beginJob() override
Definition: DDCMSDetector.cc:26
iEvent
int iEvent
Definition: GenABIO.cc:224
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
IdealGeometryRecord.h
DDCMSDetector::analyze
void analyze(Event const &iEvent, EventSetup const &) override
Definition: DDCMSDetector.cc:36
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
DDCMSDetector::DDCMSDetector
DDCMSDetector(const ParameterSet &p)
Definition: DDCMSDetector.cc:34
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
std
Definition: JetResolutionObject.h:76
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dd4hep
Definition: DDPlugins.h:8
EventSetup.h
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
ParameterSet.h
edm::Event
Definition: Event.h:73
DDVectorRegistryRcd.h
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21