All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IcarusGeometryHelper_service.cc
Go to the documentation of this file.
1 /**
2  * @file icaruscode/Geometry/IcarusGeometryHelper_service.cc
3  * @brief Geometry helper service for ICARUS geometries: implementation file.
4  * @see `icaruscode/Geometry/IcarusGeometryHelper.h`
5  */
6 
7 // library header
9 
10 // LArSoft libraries
13 
14 // framework libraries
15 #include "art/Utilities/make_tool.h"
16 #include "art/Framework/Services/Registry/ServiceDefinitionMacros.h"
17 #include "messagefacility/MessageLogger/MessageLogger.h"
18 
19 // C/C++ standard libraries
20 #include <string>
21 
22 
23 
24 //------------------------------------------------------------------------------
25 namespace {
26 
27  // name of the tool to create the default channel mapping algorithm
28  std::string const DefaultChannelMapSetupTool
29  = "ICARUSsplitInductionChannelMapSetupTool";
30 
31 } // local namespace
32 
33 
34 //------------------------------------------------------------------------------
36  fhicl::ParameterSet const& /* sortingParameters */,
37  std::string const& detectorName
38  ) const -> ChannelMapAlgPtr_t
39 {
40  //
41  // detector type check
42  //
43  if (detectorName.find("icarus") == std::string::npos) {
44  MF_LOG_WARNING("IcarusGeometryHelper")
45  << "Using a ICARUS channel mapping with an unsupported (non-ICARUS?)"
46  " detector geometry";
47  } // if not ICARUS detector
48 
49  //
50  // channel mapping creation and setup
51  //
52  return makeChannelMapping(fPset);
53 
54 } // icarus::IcarusGeometryHelper::doConfigureChannelMapAlg()
55 
56 
57 //------------------------------------------------------------------------------
58 std::unique_ptr<geo::ChannelMapAlg>
60  (fhicl::ParameterSet const& parameters) const
61 {
62  fhicl::ParameterSet mapperDefaultSet;
63  mapperDefaultSet.put("tool_type", DefaultChannelMapSetupTool);
64  auto channelMapSetupTool = art::make_tool<geo::ChannelMapSetupTool>
65  (parameters.get<fhicl::ParameterSet>("Mapper", mapperDefaultSet));
66 
67  return channelMapSetupTool->setupChannelMap();
68 } // icarus::IcarusGeometryHelper::makeChannelMapping()
69 
70 
71 //------------------------------------------------------------------------------
72 DEFINE_ART_SERVICE_INTERFACE_IMPL
74 
75 
76 //------------------------------------------------------------------------------
std::unique_ptr< geo::ChannelMapAlg > makeChannelMapping(fhicl::ParameterSet const &parameters) const
Creates and returns the channel mapping instance via a art tool.
Interface for a tool to configure a geometry channel mapper.
Interface to a service with detector-specific geometry knowledge.
std::unique_ptr< ChannelMapAlg > ChannelMapAlgPtr_t
Implementation of geo::ExptGeoHelperInterface for ICARUS.
MF_LOG_WARNING("SimWire")<< "SimWire is an example module that works for the "<< "MicroBooNE detector. Each experiment should implement "<< "its own version of this module to simulate electronics "<< "response."
Geometry helper service for ICARUS geometries.
virtual ChannelMapAlgPtr_t doConfigureChannelMapAlg(fhicl::ParameterSet const &, std::string const &detectorName) const override
Interface to algorithm class for a specific detector channel mapping.