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 
35  : m_tag(iConfig.getParameter<ESInputTag>("DDDetector"))
36 {}
37 
38 void
39 DDCMSDetector::analyze(const Event&, const EventSetup& iEventSetup)
40 {
42  iEventSetup.get<GeometryFileRcd>().get(m_tag.module(), det);
43 
44  LogVerbatim("Geometry") << "Iterate over the detectors:\n";
45  LogVerbatim("Geometry").log([&](auto& log) {
46  for(auto const& it : det->description()->detectors()) {
47  dd4hep::DetElement det(it.second);
48  log << it.first << ": " << det.path();
49  }
50  });
51  LogVerbatim("Geometry") << "..done!";
52 
54  iEventSetup.get<DDVectorRegistryRcd>().get(m_tag.module(), registry);
55 
56  LogVerbatim("Geometry") << "DD Vector Registry size: " << registry->vectors.size();
57  LogVerbatim("Geometry").log([&](auto& log) {
58  for(const auto& p: registry->vectors) {
59  log << " " << p.first << " => ";
60  for(const auto& i : p.second)
61  log << i << ", ";
62  log << '\n';
63  }
64  });
65 }
66 
67 void
69 {
70 }
71 
DDCMSDetector(const ParameterSet &p)
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< double > > vectors
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void analyze(Event const &iEvent, EventSetup const &) override
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
LogVerbatim & log(F &&iF)
Namespace of DDCMS conversion namespace.
void endJob() override
HLT enums.
T get() const
Definition: EventSetup.h:71
const ESInputTag m_tag
static Interceptor::Registry registry("Interceptor")
const std::string & module() const
Definition: ESInputTag.h:99
void beginJob() override
Detector const * description() const
Definition: DDDetector.h:24