CMS 3D CMS Logo

CompareDDCompactViews.cc
Go to the documentation of this file.
12 
13 class CompareDDCompactViews : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
14 public:
16  ~CompareDDCompactViews() override {}
17 
18  void beginJob() override {}
19  void beginRun(edm::Run const&, edm::EventSetup const&) override;
20  void analyze(edm::Event const&, edm::EventSetup const&) override {}
21  void endRun(edm::Run const&, edm::EventSetup const&) override {}
22  void endJob() override {}
23 
24 private:
27 };
28 
30  m_fname1 = iConfig.getUntrackedParameter<std::string>("XMLFileName1");
31  m_fname2 = iConfig.getUntrackedParameter<std::string>("XMLFileName2");
32 }
33 
35  DDCompactView cpv1;
36  DDLParser parser1(cpv1);
37  parser1.parseOneFile(m_fname1);
39  cpv1.lockdown();
40 
41  DDCompactView cpv2;
42  DDLParser parser2(cpv2);
43  parser2.parseOneFile(m_fname2);
45  cpv2.lockdown();
46 
47  DDCompOptions ddco;
48  bool graphmatch = DDCompareCPV(cpv1, cpv2, ddco);
49 
50  if (graphmatch) {
51  std::cout << "DDCompactView graphs match" << std::endl;
52  } else {
53  std::cout << "DDCompactView graphs do NOT match" << std::endl;
54  }
55 }
56 
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(edm::Run const &, edm::EventSetup const &) override
void endRun(edm::Run const &, edm::EventSetup const &) override
CompareDDCompactViews(const edm::ParameterSet &)
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
void analyze(edm::Event const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool parseOneFile(const std::string &filename)
Process a single files.
Definition: DDLParser.cc:80
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:63
DDComparators need to know if names of DDRotation matter.
bool DDCheckMaterials(std::ostream &, std::vector< std::pair< std::string, std::string > > *=0)
Definition: Run.h:45
bool DDCompareCPV(const DDCompactView &lhs, const DDCompactView &rhs, const DDCompOptions &ddco)