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 {
15 public:
16  explicit CompareDDCompactViews( const edm::ParameterSet& );
17  ~CompareDDCompactViews() override {}
18 
19  void beginJob() override {}
20  void beginRun( edm::Run const& , edm::EventSetup const& ) override;
21  void analyze( edm::Event const& , edm::EventSetup const& ) override {}
22  void endRun( edm::Run const& , edm::EventSetup const& ) override {}
23  void endJob() override {}
24 
25 private:
28 };
29 
31 {
32  m_fname1 = iConfig.getUntrackedParameter<std::string>( "XMLFileName1" );
33  m_fname2 = iConfig.getUntrackedParameter<std::string>( "XMLFileName2" );
34 }
35 
36 void
38 {
39  DDCompactView cpv1;
40  DDLParser parser1( cpv1 );
41  parser1.parseOneFile( m_fname1 );
43  cpv1.lockdown();
44 
45  DDCompactView cpv2;
46  DDLParser parser2( cpv2 );
47  parser2.parseOneFile( m_fname2 );
49  cpv2.lockdown();
50 
51  DDCompOptions ddco;
52  DDCompareCPV ddccpv( ddco );
53  bool graphmatch = ddccpv( cpv1, cpv2 );
54 
55  if( graphmatch ) {
56  std::cout << "DDCompactView graphs match" << std::endl;
57  } else {
58  std::cout << "DDCompactView graphs do NOT match" << std::endl;
59  }
60 }
61 
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(edm::Run const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
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
bool parseOneFile(const std::string &filename)
Process a single files.
Definition: DDLParser.cc:99
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:44