Go to the documentation of this file.
8 #include "FairLogger.h"
9 #include "FairModule.h"
10 #include "FairRunSim.h"
28 #include <boost/algorithm/string.hpp>
36 std::vector<ECbmModuleId> GetModuleLoadingOrder() {
86 FairRunSim* run = FairRunSim::Instance();
88 LOG(error) <<
"-E- RegisterSetup: No FairRunSim instance!";
97 if (moduleMap.find(moduleId) == moduleMap.end())
continue;
100 std::string fileName = geoModule.GetFilePath();
102 Bool_t isActive = geoModule.GetActive();
103 std::string geoTag = geoModule.GetTag();
104 std::string modulName = geoModule.GetName();
106 std::vector<std::string> _geom;
107 std::vector<std::string> _tag;
108 boost::split(_geom, fileName, [](
char c) {
return c ==
':'; });
109 boost::split(_tag, geoTag, [](
char c) {
return c ==
':'; });
111 for (
auto&
string : _geom) {
113 LOG(info) <<
"-I- RegisterSetup: Registering " << modulName <<
" "
117 ? (isActive ?
" -ACTIVE- " :
" - INACTIVE- ")
119 <<
" using " <<
string;
121 FairModule* fairModule = NULL;
126 std::string volname {
"PIPE"};
127 volname += std::to_string(
counter);
128 fairModule =
new CbmPipe(volname.c_str());
133 fairModule =
new CbmMvd(
"MVD", isActive);
137 fairModule =
new CbmRich(
"RICH", isActive);
140 fairModule =
new CbmMuch(
"MUCH", isActive);
143 fairModule =
new CbmTrd(
"TRD", isActive);
146 fairModule =
new CbmTof(
"TOF", isActive);
150 fairModule =
new CbmPsdMC(isActive);
158 LOG(error) <<
"-E- RegisterSetup: Unknown fairModule ID " << moduleId;
165 fairModule->SetMotherVolume(
"pipevac1");
166 fairModule->SetGeometryFileName(
string.c_str());
167 run->AddModule(fairModule);
176 std::string geoFilePath =
177 std::string(gSystem->Getenv(
"VMCWORKDIR")) +
"/geometry/cave.geo";
Class for the MC transport of the CBM-STS.
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
TGeoTranslation & GetMatrix()
void SetModuleTag(ECbmModuleId moduleId, std::string tag, Bool_t active)
Loads the detector with a tag into setup, will invoke GetModuleByTag.
ClassImp(CbmGeoSetupProvider)
void SetField(CbmGeoSetupField value)
void SetMatrix(TGeoTranslation value)
void SetTag(std::string value)
CbmGeoSetupModule GetDefaultCaveModule()
Gets defauk cave if none was provided by the other means.
Defines the active detector RICH. Constructs the geometry and creates MCPoints.
@ kMvd
Micro-Vertex Detector.
CbmGeoSetupMedia & GetMedia()
@ kTof
Time-of-flight Detector.
Class for constructing the geometry of the CBM target.
Defines the active detector TRD. Constructs the geometry and registers MCPoints.
void SetName(std::string value)
void SetActive(Bool_t value)
@ kHodo
Hodoscope (for test beam times)
Defines the active detector RICH. Constructs the geometry and creates MCPoints.
void SetScale(Double_t value)
@ kRich
Ring-Imaging Cherenkov Detector.
virtual CbmGeoSetupField GetFieldByTag(std::string tag)=0
Abstract method for constructing the field by tag.
void SetFieldTag(std::string tag)
Loads the field with a tag and adds it to the setup.
Class for the MC transport of the CBM-PSD.
Data transfer object to represent the CBM Detector setup.
@ kTrd
Transition Radiation Detector.
Defines the active detector TRD. Constructs the geometry and registers MCPoints.
void SetModuleId(ECbmModuleId value)
void SetFilePath(std::string value)
void RemoveModule(ECbmModuleId moduleId)
Removes the module from setup.
CbmGeoSetupField & GetField()
@ kMuch
Muon detection system.
void Reset()
Resets the setup to default (empty)
@ kPsd
Projectile spectator detector.
@ kPlatform
RICH rail platform.
@ kSts
Silicon Tracking System.
Abstract interface class for providing the CBM detector setup description, module list,...
std::map< ECbmModuleId, CbmGeoSetupModule > & GetModuleMap()
void RegisterSetup()
Registers the previously loaded setup with FairRoot. Replaces the registerSetup.C macro.
virtual CbmGeoSetupModule GetModuleByTag(ECbmModuleId moduleId, std::string tag)=0
Abstract method for constructing the module by id and tag.