All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeometryIteratorLoopTest_module.cc
Go to the documentation of this file.
1 /**
2  * @file GeometryIteratorLoopTest_module.cc
3  * @brief Tests the correct iteration of the geo::Geometry iterators
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date August 25, 2014
6  */
7 
8 // LArSoft includes
11 
12 // Framework includes
13 #include "art/Framework/Core/ModuleMacros.h"
14 #include "art/Framework/Core/EDAnalyzer.h"
15 #include "art/Framework/Services/Registry/ServiceHandle.h"
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 GeometryIteratorLoopTestAlg.
32  */
33  class GeometryIteratorLoopTest: public art::EDAnalyzer {
34  public:
35  explicit GeometryIteratorLoopTest(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::GeometryIteratorLoopTestAlg> tester; ///< the test algorithm
43 
44  }; // class GeometryIteratorLoopTest
45 } // namespace geo
46 
47 
48 //******************************************************************************
49 namespace geo {
50 
51  //......................................................................
52  GeometryIteratorLoopTest::GeometryIteratorLoopTest(fhicl::ParameterSet const& pset)
53  : EDAnalyzer(pset)
54  , tester(new geo::GeometryIteratorLoopTestAlg(pset))
55  {
56  } // GeometryIteratorLoopTest::GeometryIteratorLoopTest()
57 
58 
59  //......................................................................
61  {
62  art::ServiceHandle<geo::Geometry const> geom;
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  //......................................................................
74  DEFINE_ART_MODULE(GeometryIteratorLoopTest)
75 
76 } // namespace geo
Performs tests on the geometry as seen by Geometry service.
virtual void analyze(art::Event const &)
GeometryIteratorLoopTest(fhicl::ParameterSet const &pset)
Tests the correct iteration of the geo::Geometry iterators.
std::unique_ptr< geo::GeometryIteratorLoopTestAlg > tester
the test algorithm
art framework interface to geometry description