CbmRoot
Loading...
Searching...
No Matches
CbmGeoNodeMapBuilder.h
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10
11#ifndef CbmGeoNodeMapBuilder_h
12#define CbmGeoNodeMapBuilder_h 1
13
14#include "CbmDefs.h"
15#include "CbmGeoNodeMap.h"
16
17#include <Logger.h>
18
19#include <type_traits>
20#include <unordered_set>
21
22namespace cbm
23{
27 public:
30 void Request(ECbmModuleId moduleId) { fDetToBuildNodes.insert(moduleId); }
31
33 GeoNodeMap Build() const;
34
35 private:
36 std::unordered_set<ECbmModuleId> fDetToBuildNodes;
37
39 template<ECbmModuleId ModuleId>
40 static std::unordered_map<uint32_t, std::string> Add()
41 {
42 // Non-specialized definition
43 LOG(warn) << "cbm::GeoNodeMapBuilder: adding geo-nodes for " << ModuleId << "was requested, but no rule for that "
44 << "was provided. Please, provide this method, or ignore the warning, if you do not need it";
45 return {};
46 }
47 };
48} // namespace cbm
49
50#endif // CbmGeoNodeMapBuilder_h
ECbmModuleId
Enumerator for module Identifiers.
Definition CbmDefs.h:45
A common map for hardware address -> node path in TGeoManager (source)
A builder for GeoNodeMap in CBM.
static std::unordered_map< uint32_t, std::string > Add()
Adds nodes for a given detector ID.
void Request(ECbmModuleId moduleId)
Requests the builder to add geo-nodes for the detector subsystem.
GeoNodeMap Build() const
Builds the geo-node map.
std::unordered_set< ECbmModuleId > fDetToBuildNodes
A list of detectors requested to build nodes.
A class to keep paths to nodes vs. hardware addresses for different detectors.