7#include <unordered_map>
14 using Record = std::map<unsigned int, uint64_t>;
17 void add(
unsigned int trigID,
R3B::Side side,
unsigned int counts = 1);
18 [[nodiscard]]
auto findID(
R3B::Side side)
const -> std::optional<unsigned int>;
24 using TrigIDMap = std::unordered_map<unsigned int, std::pair<unsigned int, unsigned int>>;
28 void clear() { records_.clear(); }
30 auto extract_trigIDMap(
bool force_find =
false) -> TrigIDMap;
33 std::unordered_map<unsigned int, TrigIDMappingRecorder> records_;
36 static void AutoResolve(TrigIDMap& trigIDMap);
51 void SetFileName(std::string_view filename) { filename_ = filename; }
52 void SetDir(std::string_view dirname) { fileDir_ = dirname; }
59 unsigned int numOfPlane_ = 0;
60 unsigned int numOfBar_ = 0;
61 unsigned int numOfModule_ = 0;
63 std::
string filename_ =
"trigIDMap.json";
64 std::
string fileDir_ =
".";
void add_id_pair(std::pair< unsigned int, unsigned int > pair, R3B::Side side, unsigned int counts=1)
std::unordered_map< unsigned int, std::pair< unsigned int, unsigned int > > TrigIDMap
void set_trigIDMap(TrigIDMap idMap)
TrigIDMappingFinder()=default
void SetNumOfModule(unsigned int num)
void SetFileName(std::string_view filename)
void SetFormat(TrigIDMappingPrintFormat format)
void SetDir(std::string_view dirname)
Simulation of NeuLAND Bar/Paddle.
std::map< unsigned int, uint64_t > Record
void add(unsigned int trigID, R3B::Side side, unsigned int counts=1)
auto findID(R3B::Side side) const -> std::optional< unsigned int >