GeometryTest_module.cc
Go to the documentation of this file.
1 /** ****************************************************************************
2  * @file GeometryTest_module.cc
3  * @brief Runs geometry unit tests from a test algorithm
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date May 8th, 2015
6  */
7 
8 // LArSoft includes
9 #include "test/Geometry/GeometryTestAlg.h"
11 
12 // Framework includes
16 
17 // C/C++ standard library
18 #include <memory> // std::unique_ptr<>
19 
20 
21 namespace art { class Event; } // art::Event declaration
22 namespace fhicl { class ParameterSet; }
23 
24 namespace geo {
25  /**
26  * @brief Performs tests on the geometry as seen by Geometry service
27  *
28  * Configuration parameters
29  * =========================
30  *
31  * See GeometryTestAlg.
32  */
33  class GeometryTest: public art::EDAnalyzer {
34  public:
35  explicit GeometryTest(fhicl::ParameterSet const& pset);
36 
37  virtual void analyze(art::Event const&) {}
38  virtual void beginJob();
39 
40  private:
41 
42  std::unique_ptr<geo::GeometryTestAlg> tester; ///< the test algorithm
43 
44  }; // class GeometryTest
45 } // namespace geo
46 
47 
48 //******************************************************************************
49 namespace geo {
50 
51  //......................................................................
52  GeometryTest::GeometryTest(fhicl::ParameterSet const& pset)
53  : EDAnalyzer(pset)
54  , tester(new geo::GeometryTestAlg(pset))
55  {
56  } // GeometryTest::GeometryTest()
57 
58 
59  //......................................................................
61  {
63 
64  // 1. we set it up with the geometry from the environment
65  tester->Setup(*geom);
66 
67  // 2. then we run it!
68  tester->Run();
69 
70  } // GeometryTest::beginJob()
71 
72 
73  //......................................................................
75 
76 } // namespace geo
Performs tests on the geometry as seen by Geometry service.
std::unique_ptr< geo::GeometryTestAlg > tester
the test algorithm
virtual void analyze(art::Event const &)
art framework interface to geometry description
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
Performs tests on the geometry as seen by Geometry service.
void beginJob()
Definition: Breakpoints.cc:14
virtual void beginJob()
Definition: types.h:32
LArSoft geometry interface.
Definition: ChannelGeo.h:16