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

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

#include "icarusalg/Geometry/ICARUSChannelMapAlg.h"
#include "test/Geometry/geometry_unit_test_icarus.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 IcarusGeometryConfiguration = icarus::testing::IcarusGeometryEnvironmentConfiguration< icarus::ICARUSChannelMapAlg >
 
using IcarusGeometryTestEnvironment = testing::GeometryTesterEnvironment< IcarusGeometryConfiguration >
 

Functions

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

Detailed Description

Test for geometry iterator loops on ICARUS detector.

Date
October 10, 2017
Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.fnal..nosp@m.gov)

Usage:

geometry_iterator_loop_icarus_test [ConfigurationFile [GeometryTestParameterSet]]

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

Definition in file geometry_iterator_loop_icarus_test.cxx.

Typedef Documentation

Definition at line 39 of file geometry_iterator_loop_icarus_test.cxx.

Definition at line 49 of file geometry_iterator_loop_icarus_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 73 of file geometry_iterator_loop_icarus_test.cxx.

73  {
74 
76  ("geometry_iterator_loop_test_ICARUS");
77  config.SetMainTesterParameterSetName("geoitertest");
78 
79  //
80  // parameter parsing
81  //
82  int iParam = 0;
83 
84  // first argument: configuration file (mandatory)
85  if (++iParam < argc) config.SetConfigurationPath(argv[iParam]);
86 
87  // second argument: path of the parameter set for geometry test configuration
88  // (optional; default: "physics.analyzers.geotest");
89  // if no path is provided, we have a empty default configuration;
90  // if path is provided, we don't have any default configuration
91  // and if the configuration is missing there will be an error
92  if (++iParam < argc) config.SetMainTesterParameterSetPath(argv[iParam]);
93  else config.AddDefaultTesterConfiguration("");
94 
95  // third argument: path of the parameter set for geometry configuration
96  // (optional; default: "services.Geometry" from the inherited object)
97  if (++iParam < argc) config.SetGeometryParameterSetPath(argv[iParam]);
98 
99  //
100  // testing environment setup
101  //
103 
104  //
105  // run the test algorithm
106  //
107 
108  // 1. we initialize it from the configuration in the environment,
110 
111  // 2. we set it up with the geometry from the environment
112  Tester.Setup(*TestEnvironment.Geometry());
113 
114  // 3. then we run it!
115  unsigned int nErrors = Tester.Run();
116 
117  // 4. And finally we cross fingers.
118  if (nErrors > 0) {
119  mf::LogError("geometry_iterator_loop_test_ICARUS")
120  << nErrors << " errors detected!";
121  }
122 
123  return nErrors;
124 } // 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