Line data Source code
1 : #include "triggeralgs/ProtoDUNEBSMWindow/DetectorPlaneMap.hpp"
2 : #include <stdexcept>
3 :
4 : namespace triggeralgs {
5 :
6 0 : PlaneInfo DetectorPlaneMap::get_plane_info(std::string channel_map_name, int detelement, int plane) {
7 :
8 0 : const std::map<std::pair<int,int>, PlaneInfo> *plane_map;
9 0 : if (channel_map_name == "PD2HDTPCChannelMap") plane_map = &pdhd_plane_map;
10 0 : else if (channel_map_name == "PD2VDTPCChannelMap") plane_map = &pdvd_plane_map;
11 0 : else plane_map = &pdvd_plane_map;
12 :
13 0 : auto it = plane_map->find({detelement, plane});
14 0 : if (it == plane_map->end()) {
15 0 : throw std::out_of_range("Invalid detelement/plane combination");
16 : }
17 0 : return it->second;
18 : }
19 :
20 : } // triggeralgs
|