26#include "FairModule.h"
27#include "FairRunSim.h"
34#include <boost/algorithm/string.hpp>
43 std::vector<ECbmModuleId> GetModuleLoadingOrder()
56 module.SetActive(active);
57 fSetup.GetModuleMap()[moduleId] =
module;
74 if (!
fSetup.GetModuleMap().size()) {
75 LOG(error) <<
"-E- RegisterSetup: setup " <<
fSetup.GetName() <<
" is empty!";
80 FairRunSim* run = FairRunSim::Instance();
82 LOG(error) <<
"-E- RegisterSetup: No FairRunSim instance!";
87 run->SetMaterials(
fSetup.GetMedia().GetFilePath().c_str());
90 auto& moduleMap =
fSetup.GetModuleMap();
91 if (moduleMap.find(moduleId) == moduleMap.end())
continue;
93 auto& geoModule =
fSetup.GetModuleMap()[moduleId];
94 std::string fileName = geoModule.GetFilePath();
96 Bool_t isActive = geoModule.GetActive();
97 std::string geoTag = geoModule.GetTag();
98 std::string modulName = geoModule.GetName();
100 std::vector<std::string> _geom;
101 std::vector<std::string> _tag;
102 boost::split(_geom, fileName, [](
char c) {
return c ==
':'; });
103 boost::split(_tag, geoTag, [](
char c) {
return c ==
':'; });
105 for (
auto&
string : _geom) {
107 LOG(info) <<
"-I- RegisterSetup: Registering " << modulName <<
" " << _tag[
counter]
109 ? (isActive ?
" -ACTIVE- " :
" - INACTIVE- ")
111 <<
" using " <<
string;
113 FairModule* fairModule = NULL;
119 std::string volname{
"PIPE"};
120 volname += std::to_string(
counter);
121 fairModule =
new CbmPipe(volname.c_str());
136 default: LOG(error) <<
"-E- RegisterSetup: Unknown fairModule ID " << moduleId;
break;
142 if (strstr(
fSetup.GetTag().data(),
"mcbm") != NULL) {
143 fairModule->SetMotherVolume(
"cave");
145 fairModule->SetGeometryFileName(
string.c_str());
146 run->AddModule(fairModule);
156 std::string geoFilePath = std::string(gSystem->Getenv(
"VMCWORKDIR")) +
"/geometry/cave.geo";
159 module.SetName("CAVE");
160 module.SetFilePath("cave.geo");
161 module.SetTag("default");
162 module.SetModuleId(ECbmModuleId::kCave);
ECbmModuleId
Enumerator for module Identifiers.
@ kMvd
Micro-Vertex Detector.
@ kHodo
Hodoscope (for test beam times)
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kPsd
Projectile spectator detector.
@ kSts
Silicon Tracking System.
@ kMust
MuSt detection system.
@ kPlatform
RICH rail platform.
@ kMuch
Muon detection system.
@ kFsd
Forward spectator detector.
@ kNofSystems
For loops over active systems.
@ kRich
Ring-Imaging Cherenkov Detector.
ClassImp(CbmGeoSetupProvider)
Defines the active detector RICH. Constructs the geometry and creates MCPoints.
Defines the active detector TRD. Constructs the geometry and registers MCPoints.
Class for the MC transport of the CBM-FSD.
void SetMatrix(TGeoTranslation value)
void SetScale(Double_t value)
Abstract interface class for providing the CBM detector setup description, module list,...
virtual CbmGeoSetupModule GetModuleByTag(ECbmModuleId moduleId, std::string tag)=0
Abstract method for constructing the module by id and tag.
CbmGeoSetupModule GetDefaultCaveModule()
Gets defauk cave if none was provided by the other means.
void Reset()
Resets the setup to default (empty)
void SetModuleTag(ECbmModuleId moduleId, std::string tag, Bool_t active)
Loads the detector with a tag into setup, will invoke GetModuleByTag.
void SetFieldTag(std::string tag)
Loads the field with a tag and adds it to the setup.
void RemoveModule(ECbmModuleId moduleId)
Removes the module from setup.
void RegisterSetup()
Registers the previously loaded setup with FairRoot. Replaces the registerSetup.C macro.
virtual CbmGeoSetupField GetFieldByTag(std::string tag)=0
Abstract method for constructing the field by tag.
Data transfer object to represent the CBM Detector setup.
Class for the MC transport of the CBM-PSD.
Defines the active detector RICH. Constructs the geometry and creates MCPoints.
Class for the MC transport of the CBM-STS.
Class for constructing the geometry of the CBM target.
Defines the active detector TRD. Constructs the geometry and registers MCPoints.