forked from cms-sw/cmssw
/
DDTestSpecPars.cc
58 lines (50 loc) · 1.66 KB
/
DDTestSpecPars.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "Geometry/Records/interface/DDSpecParRegistryRcd.h"
#include "DetectorDescription/DDCMS/interface/DDSpecParRegistry.h"
#include <iostream>
using namespace std;
using namespace cms;
using namespace edm;
class DDTestSpecPars : public one::EDAnalyzer<> {
public:
explicit DDTestSpecPars(const ParameterSet& iConfig)
: m_tag(iConfig.getParameter<ESInputTag>("DDDetector")) {}
void beginJob() override {}
void analyze(Event const& iEvent, EventSetup const&) override;
void endJob() override {}
private:
const ESInputTag m_tag;
};
void
DDTestSpecPars::analyze(const Event&, const EventSetup& iEventSetup)
{
LogVerbatim("Geometry") << "DDTestSpecPars::analyze: " << m_tag;
ESTransientHandle<DDSpecParRegistry> registry;
iEventSetup.get<DDSpecParRegistryRcd>().get(m_tag.module(), registry);
LogVerbatim("Geometry").log([®istry](auto& log) {
log << "DD SpecPar Registry size: " << registry->specpars.size();
for(const auto& i: registry->specpars) {
log << " " << i.first << " => ";
for(const auto& k : i.second.paths)
log << k << ", ";
for(const auto& l : i.second.spars) {
log << l.first << " => ";
for(const auto& il : l.second) {
log << il << ", ";
}
}
for(const auto& m : i.second.numpars) {
log << m.first << " => ";
for(const auto& im : m.second) {
log << im << ", ";
}
}
log << '\n';
}
});
}
DEFINE_FWK_MODULE(DDTestSpecPars);