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

Unit test for geometry on ICARUS detector. More...

#include "icarusalg/Geometry/ICARUSChannelMapAlg.h"
#include "test/Geometry/geometry_unit_test_icarus.h"
#include "larcorealg/test/Geometry/GeometryTestAlg.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

Unit test for geometry on ICARUS detector.

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

Usage:

geometry_icarus_test  [ConfigurationFile [GeometryTestParameterSet]]

By default, GeometryTestParameterSet is set to "physics.analyzers.geotest".

Definition in file geometry_icarus_test.cxx.

Typedef Documentation

Definition at line 37 of file geometry_icarus_test.cxx.

Definition at line 47 of file geometry_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 71 of file geometry_icarus_test.cxx.

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