CbmRoot
Loading...
Searching...
No Matches
CbmGeoNodeMap.cxx
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#include "CbmGeoNodeMap.h"
11
12#include <Logger.h>
13
14using cbm::GeoNodeMap;
15
16// ---------------------------------------------------------------------------------------------------------------------
17//
18GeoNodeMap::GeoNodeMap(std::unordered_map<uint32_t, std::string>&& nodeMap) : fNodeMap(std::move(nodeMap))
19{
20 fNodeMap[0] = "";
21}
22
23// ---------------------------------------------------------------------------------------------------------------------
24//
26{
27 const std::string& path = GetNodePath(address);
28 if (path.empty()) {
29 // TODO: Provide a common ToString method for each detector subsystem, replace address with ToString(address)
30 LOG(fatal) << "GeoNodeMap: the address 0x" << std::hex << address << std::dec << " ("
31 << static_cast<ECbmModuleId>(CbmAddress::GetSystemId(address)) << ") was not registered";
32 }
33
34 return RecoSetupUtils::ReadVolume(path);
35}
ECbmModuleId
Enumerator for module Identifiers.
Definition CbmDefs.h:45
A common map for hardware address -> node path in TGeoManager (source)
static int32_t GetSystemId(uint32_t address)
Definition CbmAddress.h:47
GeoNodeMap(std::unordered_map< uint32_t, std::string > &&nodeMap)
Constructor.
A class to keep paths to nodes vs. hardware addresses for different detectors.
algo::GeoVolume ReadGeoVolume(uint32_t address)
Read volume properties of the node.
const std::string & GetNodePath(uint32_t address) const
A common function to get a path of a node.
std::unordered_map< uint32_t, std::string > fNodeMap
Map of geometrical nodes vs hardware address.
A representation of a geometrical volume of different tracking stations.
Definition GeoVolume.h:25
Hash for CbmL1LinkKey.
static algo::GeoVolume ReadVolume(const TString &path)
Creates a volume info from a geo node, provided by path.