DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DetectorPlaneMap.cpp
Go to the documentation of this file.
2#include <stdexcept>
3
4namespace triggeralgs {
5
6PlaneInfo DetectorPlaneMap::get_plane_info(std::string channel_map_name, int detelement, int plane) {
7
8 const std::map<std::pair<int,int>, PlaneInfo> *plane_map;
9 if (channel_map_name == "PD2HDTPCChannelMap") plane_map = &pdhd_plane_map;
10 else if (channel_map_name == "PD2VDTPCChannelMap") plane_map = &pdvd_plane_map;
11 else plane_map = &pdvd_plane_map;
12
13 auto it = plane_map->find({detelement, plane});
14 if (it == plane_map->end()) {
15 throw std::out_of_range("Invalid detelement/plane combination");
16 }
17 return it->second;
18}
19
20} // triggeralgs
const std::map< std::pair< int, int >, PlaneInfo > pdhd_plane_map
PlaneInfo get_plane_info(std::string channel_map_name, int detelement, int plane)
const std::map< std::pair< int, int >, PlaneInfo > pdvd_plane_map