24#include "FairModule.h"
25#include "FairRunSim.h"
34#include <boost/algorithm/string.hpp>
43 std::vector<ECbmModuleId> GetModuleLoadingOrder()
59 module.SetActive(active);
78 LOG(error) <<
"-E- RegisterSetup: setup " <<
fSetup.
GetName() <<
" is empty!";
83 FairRunSim* run = FairRunSim::Instance();
85 LOG(error) <<
"-E- RegisterSetup: No FairRunSim instance!";
94 if (moduleMap.find(moduleId) == moduleMap.end())
continue;
97 std::string fileName = geoModule.GetFilePath();
99 Bool_t isActive = geoModule.GetActive();
100 std::string geoTag = geoModule.GetTag();
101 std::string modulName = geoModule.GetName();
103 std::vector<std::string> _geom;
104 std::vector<std::string> _tag;
105 boost::split(_geom, fileName, [](
char c) {
return c ==
':'; });
106 boost::split(_tag, geoTag, [](
char c) {
return c ==
':'; });
108 for (
auto&
string : _geom) {
110 LOG(info) <<
"-I- RegisterSetup: Registering " << modulName <<
" " << _tag[
counter]
112 ? (isActive ?
" -ACTIVE- " :
" - INACTIVE- ")
114 <<
" using " <<
string;
116 FairModule* fairModule = NULL;
122 std::string volname {
"PIPE"};
123 volname += std::to_string(
counter);
124 fairModule =
new CbmPipe(volname.c_str());
134 fairModule =
new CbmTof(
"TOF", isActive);
139 fairModule =
new CbmFsdMC(isActive);
144 default: LOG(error) <<
"-E- RegisterSetup: Unknown fairModule ID " << moduleId;
break;
150 fairModule->SetGeometryFileName(
string.c_str());
151 run->AddModule(fairModule);
161 std::string geoFilePath = std::string(gSystem->Getenv(
"VMCWORKDIR")) +
"/geometry/cave.geo";
164 module.SetName("CAVE");
165 module.SetFilePath("cave.geo");
166 module.SetTag("default");
167 module.SetModuleId(ECbmModuleId::kCave);
@ 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.
@ 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.
TGeoTranslation & GetMatrix()
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.
void SetField(CbmGeoSetupField value)
CbmGeoSetupField & GetField()
CbmGeoSetupMedia & GetMedia()
std::map< ECbmModuleId, CbmGeoSetupModule > & GetModuleMap()
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.