Public Member Functions | Private Member Functions | Private Attributes | List of all members
dune::DUNEGeometryHelper Class Reference

#include <DUNEGeometryHelper.h>

Inheritance diagram for dune::DUNEGeometryHelper:
geo::ExptGeoHelperInterface

Public Member Functions

 DUNEGeometryHelper (fhicl::ParameterSet const &pset)
 
- Public Member Functions inherited from geo::ExptGeoHelperInterface
virtual ~ExptGeoHelperInterface ()=default
 Virtual destructor; does nothing. More...
 
ChannelMapAlgPtr_t ConfigureChannelMapAlg (fhicl::ParameterSet const &sortingParameters, std::string const &detectorName) const
 Configure and initialize the channel map. More...
 

Private Member Functions

std::unique_ptr< geo::ChannelMapAlgdoConfigureChannelMapAlg (fhicl::ParameterSet const &sortingParameters, std::string const &detectorName) const override
 

Private Attributes

std::string fChannelMapClass
 
std::string fGeoSorterClass
 

Additional Inherited Members

- Public Types inherited from geo::ExptGeoHelperInterface
using ChannelMapAlgPtr_t = std::unique_ptr< ChannelMapAlg >
 

Detailed Description

Definition at line 30 of file DUNEGeometryHelper.h.

Constructor & Destructor Documentation

DUNEGeometryHelper::DUNEGeometryHelper ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 41 of file DUNEGeometryHelper_service.cc.

42  : fChannelMapClass{pset.get<string>("ChannelMapClass", {})}
43  , fGeoSorterClass{pset.get<string>("GeoSorterClass", {})}
44 {}

Member Function Documentation

std::unique_ptr< geo::ChannelMapAlg > DUNEGeometryHelper::doConfigureChannelMapAlg ( fhicl::ParameterSet const &  sortingParameters,
std::string const &  detectorName 
) const
overrideprivatevirtual

Implements geo::ExptGeoHelperInterface.

Definition at line 49 of file DUNEGeometryHelper_service.cc.

51 {
52  std::unique_ptr<geo::ChannelMapAlg> channelMap{nullptr};
53 
54  // The APA sorting algorithm requires special handling.
55  // This flag is set if that map is used.
56  bool useApaMap = false;
57  bool is35t = false;
58 
59  // If class name is given use it.
60  if ( fChannelMapClass.size() ) {
61  if ( fChannelMapClass == "DuneApaChannelMapAlg" ) {
62  useApaMap = true;
63  } else if ( fChannelMapClass == "ChannelMap35Alg" ) {
64  channelMap = std::make_unique<geo::ChannelMap35Alg>(pset);
65  } else if ( fChannelMapClass == "ChannelMap35OptAlg" ) {
66  channelMap = std::make_unique<geo::ChannelMap35OptAlg>(pset);
67  } else if ( fChannelMapClass == "ChannelMapAPAAlg" ) {
68  channelMap = std::make_unique<geo::ChannelMapAPAAlg>(pset);
69  } else if ( fChannelMapClass == "ProtoDUNEChannelMapAlg" ) {
70  channelMap = std::make_unique<geo::ProtoDUNEChannelMapAlg>(pset);
71  } else if ( fChannelMapClass == "ProtoDUNEChannelMapAlgv7" ) {
72  channelMap = std::make_unique<geo::ProtoDUNEChannelMapAlgv7>(pset);
73  } else if ( fChannelMapClass == "ProtoDUNEChannelMapAlgv8" ) {
74  channelMap = std::make_unique<geo::ProtoDUNEChannelMapAlgv8>(pset);
75  } else {
76  throw cet::exception("DUNEGeometryHelper") << "Invalid channel map class name:" << fChannelMapClass << "\n";
77  }
78 
79  // Otherwise derive class name from detector name.
80  } else {
81  // DUNE 35t prototype
82  if ( ( detectorName.find("dune35t") != std::string::npos ) ||
83  ( detectorName.find("lbne35t") != std::string::npos ) ) {
84  std::string const detectorVersion = pset.get< std::string >("DetectorVersion");
85  if (( detectorVersion.find("v3") != std::string::npos )
86  || ( detectorVersion.find("v4") != std::string::npos )
87  || ( detectorVersion.find("v5") != std::string::npos )
88  || ( detectorVersion.find("v6") != std::string::npos )) {
89  useApaMap = true;
90  is35t = true;
91  } else {
92  channelMap = std::make_unique<geo::ChannelMap35Alg>(pset);
93  }
94 
95  // DUNE 10kt
96  } else if (( detectorName.find("dune10kt") != std::string::npos )
97  || ( detectorName.find("lbne10kt") != std::string::npos )) {
98  useApaMap = true;
99 
100  // DUNE 10kt dual phase
101  } else if ( detectorName.find("dunedphase10kt") != std::string::npos ) {
102  channelMap = std::make_unique<geo::ChannelMapCRMAlg>(pset);
103 
104  // DUNE 10kt vd
105  } else if ( ( detectorName.find("dunevd10kt") != std::string::npos ) ) {
106  channelMap = std::make_unique<geo::ChannelMapCRUAlg>(pset);
107 
108  // VD CRP cold box channel map
109  } else if ( ( detectorName.find("dunevdcb") != std::string::npos ) ) {
110  channelMap = std::make_unique<geo::ColdBoxChannelMapAlg>(pset);
111  //channelMap = std::make_unique<geo::ChannelMapCRUAlg>(pset);
112 
113  // protoDUNE 6x6x6 dual phase
114  } else if ( detectorName.find("protodunedphase") != std::string::npos ) {
115  channelMap = std::make_unique<geo::ChannelMapCRMAlg>(pset);
116 
117  // 3x1x1 dual phase
118  } else if ( detectorName.find("3x1x1dphase") != std::string::npos ) {
119  channelMap = std::make_unique<geo::ChannelMapCRMAlg>(pset);
120 
121  // DUNE 34kt
122  } else if ( ( detectorName.find("dune34kt") != std::string::npos )
123  || ( detectorName.find("lbne34kt") != std::string::npos ) ) {
124  channelMap = std::make_unique<geo::ChannelMapAPAAlg>(pset);
125 
126  // protoDUNE with arapucas
127  } else if ( detectorName.find("protodunev7") != std::string::npos ) {
128  channelMap = std::make_unique<geo::ProtoDUNEChannelMapAlgv7>(pset);
129 
130  // protoDUNE with arapucas and updated paddles
131  } else if ( detectorName.find("protodunev8") != std::string::npos ) {
132  channelMap = std::make_unique<geo::ProtoDUNEChannelMapAlgv8>(pset);
133 
134  // protoDUNE
135  } else if ( ( detectorName.find("protodune") != std::string::npos )
136  || ( detectorName.find("protolbne") != std::string::npos ) ) {
137  channelMap = std::make_unique<geo::ProtoDUNEChannelMapAlg>(pset);
138 
139  // iceberg
140  } else if ( detectorName.find("iceberg") != std::string::npos ) {
141  channelMap = std::make_unique<geo::ProtoDUNEChannelMapAlg>(pset);
142 
143  // LArND
144  } else if ( detectorName.find("larnd") != std::string::npos ) {
145  channelMap = std::make_unique<geo::ChannelMapAPAAlg>(pset);
146  }
147  else {
148  throw cet::exception("DUNEGeometryHelper") << "Unsupported detector: '" << detectorName << "'\n";
149  }
150  }
151 
152  if ( useApaMap ) {
153  // Find the sorter.
154  bool useApaSort = false;
155  bool use35tSort = false;
156  GeoObjectSorter* psort = nullptr;
157  if ( fGeoSorterClass.size() ) {
158  if ( fGeoSorterClass == "GeoObjectSorterAPA" ) {
159  useApaSort = true;
160  } else if ( fGeoSorterClass == "GeoObjectSorter35" ) {
161  use35tSort = true;
162  }
163  } else {
164  if ( is35t ) use35tSort = true;
165  else useApaSort = true;
166  }
167  // Construct the sorter.
168  if ( useApaSort ) {
169  psort = new GeoObjectSorterAPA(pset);
170  } else if ( use35tSort ) {
171  psort = new GeoObjectSorter35(pset);
172  }
173  // Create channel map and set sorter.
174  auto alg = new geo::DuneApaChannelMapAlg(pset);
175  alg->setSorter(*psort);
176  channelMap = std::unique_ptr<geo::DuneApaChannelMapAlg>(alg);
177  }
178 
179  return channelMap;
180 }
std::string string
Definition: nybbler.cc:12
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

std::string dune::DUNEGeometryHelper::fChannelMapClass
private

Definition at line 42 of file DUNEGeometryHelper.h.

std::string dune::DUNEGeometryHelper::fGeoSorterClass
private

Definition at line 43 of file DUNEGeometryHelper.h.


The documentation for this class was generated from the following files: