All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Functions
geometry_iterator_loop_sbnd_test.cxx File Reference

Test for geometry iterator loops on SBND detector. More...

#include "sbndcode/Geometry/ChannelMapSBNDAlg.h"
#include "test/Geometry/geometry_unit_test_sbnd.h"
#include "larcorealg/test/Geometry/GeometryIteratorLoopTestAlg.h"
#include "larcorealg/Geometry/GeometryCore.h"
#include "messagefacility/MessageLogger/MessageLogger.h"

Go to the source code of this file.

Typedefs

using SBNDGeometryConfiguration = sbnd::testing::SBNDGeometryEnvironmentConfiguration< geo::ChannelMapSBNDAlg >
 
using SBNDGeometryTestEnvironment = testing::GeometryTesterEnvironment< SBNDGeometryConfiguration >
 

Functions

int main (int argc, char const **argv)
 Runs the test. More...
 

Detailed Description

Test for geometry iterator loops on SBND detector.

Date
May 11th, 2015
Author
petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov

Usage: geometry_iterator_loop_sbnd_test [ConfigurationFile [GeometryTestParameterSet]]

By default, an internal configuration is used or GeometryTestParameterSet is set to "physics.analyzers.geotest".

Definition in file geometry_iterator_loop_sbnd_test.cxx.

Typedef Documentation

Definition at line 37 of file geometry_iterator_loop_sbnd_test.cxx.

Definition at line 47 of file geometry_iterator_loop_sbnd_test.cxx.

Function Documentation

int main ( int  argc,
char const **  argv 
)

Runs the test.


Parameters
argcnumber of arguments in argv
argvarguments to the function
Returns
number of detected errors (0 on success)
Exceptions
cet::exceptionmost of error situations throw

The arguments in argv are: 0. name of the executable ("Geometry_test")

  1. path to the FHiCL configuration file
  2. FHiCL path to the configuration of the geometry test (default: physics.analysers.geotest)
  3. FHiCL path to the configuration of the geometry (default: services.Geometry)

Definition at line 71 of file geometry_iterator_loop_sbnd_test.cxx.

71  {
72 
74  ("geometry_iterator_loop_test_SBND");
75  config.SetMainTesterParameterSetName("geotest");
76 
77  //
78  // parameter parsing
79  //
80  int iParam = 0;
81 
82  // first argument: configuration file (mandatory)
83  if (++iParam < argc) config.SetConfigurationPath(argv[iParam]);
84 
85  // second argument: path of the parameter set for geometry test configuration
86  // (optional; default: "physics.analyzers.geotest");
87  // if no path is provided, we have a empty default configuration;
88  // if path is provided, we don't have any default configuration
89  // and if the configuration is missing there will be an error
90  if (++iParam < argc) config.SetMainTesterParameterSetPath(argv[iParam]);
91  else config.AddDefaultTesterConfiguration("");
92 
93  // third argument: path of the parameter set for geometry configuration
94  // (optional; default: "services.Geometry" from the inherited object)
95  if (++iParam < argc) config.SetGeometryParameterSetPath(argv[iParam]);
96 
97  //
98  // testing environment setup
99  //
101 
102  //
103  // run the test algorithm
104  //
105 
106  // 1. we initialize it from the configuration in the environment,
108 
109  // 2. we set it up with the geometry from the environment
110  Tester.Setup(*TestEnvironment.Geometry());
111 
112  // 3. then we run it!
113  unsigned int nErrors = Tester.Run();
114 
115  // 4. And finally we cross fingers.
116  if (nErrors > 0) {
117  mf::LogError("geometry_iterator_loop_test_SBND")
118  << nErrors << " errors detected!";
119  }
120 
121  return nErrors;
122 } // main()
fhicl::ParameterSet TesterParameters(std::string test_name) const
Returns the configuration of the specified test.
virtual void Setup(geo::GeometryCore const &new_geo)
Algorithm set up.
A test environment with some support for service providers.
testing::TesterEnvironment< testing::BasicEnvironmentConfiguration > TestEnvironment