StandardGeometryHelperGAr_service.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 /// \file StandardGeometryHelperGAr_service.cc
3 ///
4 /// \author rs@fnal.gov
5 ////////////////////////////////////////////////////////////////////////////////
6 
7 // class header
9 
10 // GArSoft libraries
18 #include "Geometry/GeometryCore.h"
19 
20 // C/C++ libraries
21 #include <string>
22 
23 namespace gar
24 {
25  namespace geo
26  {
27 
28  //----------------------------------------------------------------------------
31  : fPset( pset )
32  , fChannelMap()
33  , fECALSegmentationAlg()
34  , fMinervaSegmentationAlg()
35  , fMuIDSegmentationAlg()
36  {}
37 
38  //----------------------------------------------------------------------------
40  geo::GeometryCore * geom)
41  {
42  fChannelMap.reset();
43 
44  fChannelMap = std::make_shared<gar::geo::seg::ChannelMapStandardAlg>(sortingParameters);
45 
47 
48  return;
49 
50  } // StandardGeometryHelperGAr::doConfigureChannelMapAlg()
51 
52 
53  //----------------------------------------------------------------------------
55  {
56  return fChannelMap;
57  }
58 
59  //----------------------------------------------------------------------------
61  geo::GeometryCore * geom)
62  {
63  fECALSegmentationAlg.reset();
64  auto SegmentationAlgName = segParameters.get<std::string>("SegmentationAlgName");
65 
66  if(SegmentationAlgName.compare("GridXY") == 0)
67  fECALSegmentationAlg = std::make_shared<gar::geo::seg::SegmentationGridXYAlg>(segParameters);
68  else if(SegmentationAlgName.compare("MultiGridStripXY") == 0)
69  fECALSegmentationAlg = std::make_shared<gar::geo::seg::SegmentationMultiGridStripXYAlg>(segParameters);
70  else{
71  throw cet::exception("StandardGeometryHelperGAr::doConfigureECALSegmentationAlg")
72  << "Unable to determine which ECAL Segmentation algorithm to use, bail";
73  }
74 
76 
77  return;
78 
79  } // StandardGeometryHelperGAr::doConfigureECALSegmentationAlg()
80 
81  //----------------------------------------------------------------------------
83  geo::GeometryCore * geom)
84  {
86 
87  auto SegmentationAlgName = segParameters.get<std::string>("SegmentationAlgName");
88 
89  if(SegmentationAlgName.compare("Minerva") == 0)
90  fMinervaSegmentationAlg = std::make_shared<gar::geo::seg::MinervaSegmentationAlg>(segParameters);
91  else{
92  throw cet::exception("StandardGeometryHelperGAr::doConfigureMinervaSegmentationAlg")
93  << "Unable to determine which Tracker Sc Segmentation algorithm to use, bail";
94  }
95 
97 
98  return;
99 
100  } // StandardGeometryHelperGAr::doConfigureMinervaSegmentationAlg()
101 
102  //----------------------------------------------------------------------------
104  geo::GeometryCore * geom)
105  {
106  fMuIDSegmentationAlg.reset();
107 
108  auto SegmentationAlgName = segParameters.get<std::string>("SegmentationAlgName");
109 
110  if(SegmentationAlgName.compare("SegmentationStripXAlg") == 0)
111  fMuIDSegmentationAlg = std::make_shared<gar::geo::seg::SegmentationStripXAlg>(segParameters);
112  else if(SegmentationAlgName.compare("SegmentationStripYAlg") == 0)
113  fMuIDSegmentationAlg = std::make_shared<gar::geo::seg::SegmentationStripYAlg>(segParameters);
114  else if(SegmentationAlgName.compare("SegmentationMuIDAlg") == 0)
115  fMuIDSegmentationAlg = std::make_shared<gar::geo::seg::SegmentationMuIDAlg>(segParameters);
116  else{
117  throw cet::exception("StandardGeometryHelperGAr::doConfigureMuIDSegmentationAlg")
118  << "Unable to determine which MuID Segmentation algorithm to use, bail";
119  }
120 
122 
123  return;
124 
125  } // StandardGeometryHelperGAr::doConfigureMuIDSegmentationAlg()
126 
127  //----------------------------------------------------------------------------
129  {
130  return fECALSegmentationAlg;
131  }
132 
133  //----------------------------------------------------------------------------
135  {
137  }
138 
139  //----------------------------------------------------------------------------
141  {
142  return fMuIDSegmentationAlg;
143  }
144 
145  //----------------------------------------------------------------------------
146 
147  } // namespace geo
148 } // namespace gar
149 
std::string string
Definition: nybbler.cc:12
std::shared_ptr< const seg::ChannelMapAlg > ChannelMapAlgPtr_t
std::shared_ptr< const seg::SegmentationAlg > SegmentationAlgPtr_t
Description of geometry of one entire detector.
Definition: GeometryCore.h:436
std::shared_ptr< geo::seg::SegmentationAlg > fECALSegmentationAlg
ECAL Segmentation Alg.
virtual void doConfigureMuIDSegmentationAlg(fhicl::ParameterSet const &segParameters, geo::GeometryCore *geom) override
Implementation of ConfigureECALSegmentationAlg (pure virtual)
std::shared_ptr< geo::seg::SegmentationAlg > fMinervaSegmentationAlg
Tracker Sc Segmentation Alg.
void ApplyMinervaSegmentationAlg(std::shared_ptr< gar::geo::seg::SegmentationAlg > pMinervaSegmentationAlg)
Interface to a service with detector-specific geometry knowledge.
virtual ChannelMapAlgPtr_t doGetChannelMapAlg() const override
Returns the ChannelMapAlg.
T get(std::string const &key) const
Definition: ParameterSet.h:271
virtual SegmentationAlgPtr_t doGetMinervaSegmentationAlg() const override
Returns the Tracker Sc SegmentationAlg.
void ApplyChannelMap(std::shared_ptr< gar::geo::seg::ChannelMapAlg > pChannelMap)
Initializes the geometry to work with this channel map.
Simple implementation of channel mapping.
virtual SegmentationAlgPtr_t doGetECALSegmentationAlg() const override
Returns the ECAL SegmentationAlg.
virtual void doConfigureChannelMapAlg(fhicl::ParameterSet const &sortingParameters, geo::GeometryCore *geom) override
Implementation of ConfigureChannelMapAlg (pure virtual)
StandardGeometryHelperGAr(fhicl::ParameterSet const &pset,::art::ActivityRegistry &reg)
Constructor; follows the standard art service signature.
virtual void doConfigureMinervaSegmentationAlg(fhicl::ParameterSet const &segParameters, geo::GeometryCore *geom) override
Implementation of ConfigureECALSegmentationAlg (pure virtual)
virtual void doConfigureECALSegmentationAlg(fhicl::ParameterSet const &segParameters, geo::GeometryCore *geom) override
Implementation of ConfigureECALSegmentationAlg (pure virtual)
General GArSoft Utilities.
void ApplyMuIDSegmentationAlg(std::shared_ptr< gar::geo::seg::SegmentationAlg > pMuIDSegmentationAlg)
std::shared_ptr< geo::seg::SegmentationAlg > fMuIDSegmentationAlg
MuID Segmentation Alg.
virtual SegmentationAlgPtr_t doGetMuIDSegmentationAlg() const override
Returns the MuID SegmentationAlg.
void ApplyECALSegmentationAlg(std::shared_ptr< gar::geo::seg::SegmentationAlg > pECALSegmentationAlg)
std::shared_ptr< geo::seg::ChannelMapAlg > fChannelMap
channel map algorithm
Geometry helper service for detectors with strictly standard mapping.
LArSoft geometry interface.
Definition: ChannelGeo.h:16
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)