22#include <FairRuntimeDb.h>
40 LOG(warn) <<
"cbm::RecoSetupManager: the geo node map was not built. Please, request the geo node map building "
41 "with the cbm::RecoSetupManager::Instance()->BuildGeoNodeMaps() method at a point of registering "
42 "the task in FairRunAna";
55 auto CreateSetupUnit = [&](
auto&& factory) {
56 using RecoSetupUnit_t =
typename std::remove_reference_t<
decltype(factory)>::RecoSetupUnit_t;
57 LOG(info) <<
"Creating reconstruction setup unit for " << RecoSetupUnit_t::GetDetectorName();
58 return factory.Create();
85 LOG(info) <<
"RecoSetupManager: building geo-node map ...";
86 fGeoNodeMap = std::make_shared<const GeoNodeMap>(std::move(nodeMapBuilder.
Build()));
87 LOG(info) <<
"RecoSetupManager: building geo-node map ... done";
90 LOG(info) <<
fSetup.ToString();
97 throw std::logic_error(
"cbm::RecoSetupManager: attempt to store a setup from uninitialized manager instance");
101 LOG(info) <<
"RecoSetupManger: storing setup to file: done";
106catch (
const std::exception& err) {
107 LOG(error) <<
"RecoSetupManager: Initialization failed, because " << err.what();
124 LOG(error) <<
"The cbm::RecoSetupManager is not initialized. Please, register the cbm::RecoSetupManager instance "
125 "as a FairTask in your FairRunAna: \n run->AddTask(cbm::RecoSetupManager::Instance())";
134 LOG(info) <<
"RecoSetupManger: loading setup from file " << filename;
136 LOG(info) <<
"RecoSetupManger: loading setup from file: done";
144 auto* db = FairRun::Instance()->GetRuntimeDb();
146 db->getContainer(
"CbmStsParSetModule");
147 db->getContainer(
"CbmStsParSetSensor");
148 db->getContainer(
"CbmStsParSetSensorCond");
150 db->getContainer(
"CbmTrdParSetAsic");
151 db->getContainer(
"CbmTrdParSetGas");
152 db->getContainer(
"CbmTrdParSetDigi");
153 db->getContainer(
"CbmTrdParSetGain");
154 db->getContainer(
"CbmTrdParSetGeo");
156 db->getContainer(
"CbmTofDigiPar");
157 db->getContainer(
"CbmTofDigiBdfPar");
@ kMvd
Micro-Vertex Detector.
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kSts
Silicon Tracking System.
@ kMuch
Muon detection system.
A builder for the cbm::GeoNodeMap class (source)
A factory for the MuCh RecoSetupUnit.
A factory for the MVD RecoSetupUnit.
A manager for setup representation in CBM reconstruction.
A factory for the STS RecoSetupUnit.
A factory for the TOF RecoSetupUnit.
A factory for the TOF RecoSetupUnit.
static CbmSetup * Instance()
RecoSetupManager()
Constructor.
A builder for GeoNodeMap in CBM.
void Request(ECbmModuleId moduleId)
Requests the builder to add geo-nodes for the detector subsystem.
GeoNodeMap Build() const
Builds the geo-node map.
A manager for setup representation in CBM reconstruction.
std::shared_ptr< const GeoNodeMap > fGeoNodeMap
A mapper for node address -> path in TGeoManager.
RecoSetupManager(const RecoSetupManager &)=delete
static RecoSetupManager * Instance()
Instance access.
bool fbInitialized
Flag, if the instance was initialized.
bool IsInitialized() const
Returns initialization status.
algo::RecoSetup fSetup
Instance of reconstruction setup.
void LoadSetup(const std::string &filename)
Loads setup from a binary file.
void SetParContainers() override
Sets parameter containers for different subsystems.
bool fbBuildGeoNodeMaps
Flag, if to create the geo node map.
bool HasGeoNodeMaps() const
Checks, if the geo node maps were built.
std::string fSetupOutFilename
Output name for the setup (if not empty, the setup is stored)
InitStatus Init() override
Initialization method.
static RecoSetup Load(const std::string &filename)
Loads setup from a file.
static void Store(const RecoSetup &setup, const std::string &filename)
Stores setup in a file.
A factory class for the MuCh RecoSetupUnit.
A factory class for the MVD RecoSetupUnit.
A factory class for the STS RecoSetupUnit.
A builder class for the STS RecoSetupUnit.
A factory class for the STS RecoSetupUnit.