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 
EDAnalyzer.h
CompareDDCompactViews::endJob
void endJob() override
Definition: CompareDDCompactViews.cc:22
ESTransientHandle.h
CompareDDCompactViews::analyze
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition: CompareDDCompactViews.cc:20
DDCompareCPV
bool DDCompareCPV(const DDCompactView &lhs, const DDCompactView &rhs, const DDCompOptions &ddco)
Definition: DDCompareTools.cc:63
edm::Run
Definition: Run.h:45
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DDCompactView::lockdown
void lockdown()
Definition: DDCompactView.cc:94
CompareDDCompactViews::CompareDDCompactViews
CompareDDCompactViews(const edm::ParameterSet &)
Definition: CompareDDCompactViews.cc:29
DDLParser.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
DDCompactView.h
DDCheck.h
CompareDDCompactViews::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: CompareDDCompactViews.cc:21
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
CompareDDCompactViews::~CompareDDCompactViews
~CompareDDCompactViews() override
Definition: CompareDDCompactViews.cc:16
DDCompareTools.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
DDLParser
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:63
CompareDDCompactViews::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: CompareDDCompactViews.cc:34
edm::EventSetup
Definition: EventSetup.h:57
CompareDDCompactViews::m_fname2
std::string m_fname2
Definition: CompareDDCompactViews.cc:26
DDCompOptions
DDComparators need to know if names of DDRotation matter.
Definition: DDCompareTools.h:22
CompareDDCompactViews::m_fname1
std::string m_fname1
Definition: CompareDDCompactViews.cc:25
CompareDDCompactViews
Definition: CompareDDCompactViews.cc:13
DDLParser::parseOneFile
bool parseOneFile(const std::string &filename)
Process a single files.
Definition: DDLParser.cc:80
EventSetup.h
FIPConfiguration.h
ParameterSet.h
edm::Event
Definition: Event.h:73
DDCheckMaterials
bool DDCheckMaterials(std::ostream &, std::vector< std::pair< std::string, std::string > > *=nullptr)
CompareDDCompactViews::beginJob
void beginJob() override
Definition: CompareDDCompactViews.cc:18