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& iConfig );
18 
19  void beginJob() override {}
20  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
21  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
22  void endRun(edm::Run const& iEvent, 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 &iEvent, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
type of data representation of DDCompactView
Definition: DDCompactView.h:90
int iEvent
Definition: GenABIO.cc:230
bool parseOneFile(const std::string &filename)
Process a single files.
Definition: DDLParser.cc:96
DDLParser is the main class of Detector Description Language Parser.
Definition: DDLParser.h:62
DDComparators need to know if names of DDRotation matter.
CompareDDCompactViews(const edm::ParameterSet &iConfig)
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
bool DDCheckMaterials(std::ostream &, std::vector< std::pair< std::string, DDName > > *=0)
Checks all registered materials and sends a report /p os.
Definition: Run.h:42