CbmRoot
|
#include <CbmSetup.h>
Public Member Functions | |
~CbmSetup () | |
virtual void | Clear (Option_t *opt="") |
void | LoadStoredSetup (CbmSetupStorable *setupIn) |
void | LoadSetup (const char *setupName) |
void | RegisterSetup () |
std::string | GetMediaFilePath () |
void | SetMediaFilePath (std::string filePath) |
CbmFieldMap * | CreateFieldMap () |
Bool_t | GetGeoTag (ECbmModuleId moduleId, TString &tag) |
Bool_t | GetGeoFileName (ECbmModuleId moduleId, TString &fileName) |
size_t | GetHash () |
Int_t | GetNofModules () const |
Bool_t | IsActive (ECbmModuleId moduleId) |
Bool_t | IsEmpty () const |
virtual void | Print (Option_t *="") const |
Info to screen. | |
void | RemoveModule (ECbmModuleId moduleId) |
void | SetActive (ECbmModuleId moduleId, Bool_t active=kTRUE) |
void | SetField (const char *tag, Double_t scale=1., Double_t xPos=0., Double_t yPos=0., Double_t zPos=0.) |
void | SetFieldScale (Double_t scale) |
void | SetModule (ECbmModuleId moduleId, const char *geoTag, Bool_t active=kTRUE) |
std::string | ToString () const |
Info to string. | |
void | SetSetupSource (ECbmSetupSource setupSource) |
Set the source the setup will be loaded from. | |
CbmGeoSetupProvider * | GetProvider () |
Get the geo setup provider. | |
void | SetProvider (CbmGeoSetupProvider *value) |
Set the geo setup provider. | |
Static Public Member Functions | |
static CbmSetup * | Instance () |
Private Member Functions | |
CbmSetup () | |
! Setup provider | |
CbmSetup (const CbmSetup &) | |
CbmSetup | operator= (const CbmSetup &) |
ClassDef (CbmSetup, 3) | |
Private Attributes | |
CbmGeoSetupProvider * | fProvider {new CbmGeoSetupRepoProvider()} |
Static Private Attributes | |
static CbmSetup * | fgInstance = NULL |
Pointer to static instance. | |
Definition at line 43 of file CbmSetup.h.
|
inline |
Destructor
Definition at line 46 of file CbmSetup.h.
|
inlineprivate |
! Setup provider
Default constructor
Definition at line 217 of file CbmSetup.h.
Referenced by Instance().
|
private |
Copy constructor and assignment operator (not implemented )
|
private |
|
virtual |
Clear the setup
All settings are removed.
Definition at line 42 of file CbmSetup.cxx.
References fProvider, and CbmGeoSetupProvider::Reset().
CbmFieldMap * CbmSetup::CreateFieldMap | ( | ) |
Create the field map using the given settings
Definition at line 66 of file CbmSetup.cxx.
References fProvider, CbmGeoSetup::GetField(), CbmGeoSetupField::GetFilePath(), CbmGeoSetupField::GetMatrix(), CbmGeoSetupField::GetScale(), CbmGeoSetupProvider::GetSetup(), CbmGeoSetupField::GetTag(), CbmFieldMapData::GetType(), CbmFieldMap::SetPosition(), and CbmFieldMap::SetScale().
Referenced by CbmTransport::Run().
Bool_t CbmSetup::GetGeoFileName | ( | ECbmModuleId | moduleId, |
TString & | fileName ) |
Get a geometry file name
[in] | moduleId | Module identifier (type ESystemId or EPassiveId) |
[out] | fileName | Geometry file name for this module |
Definition at line 112 of file CbmSetup.cxx.
References fProvider, CbmGeoSetup::GetModuleMap(), and CbmGeoSetupProvider::GetSetup().
Bool_t CbmSetup::GetGeoTag | ( | ECbmModuleId | moduleId, |
TString & | tag ) |
Get a geometry tag
[in] | moduleId | Module identifier (type ESystemId or EPassiveId) |
[out] | tag | Geometry tag for this module |
Definition at line 127 of file CbmSetup.cxx.
References fProvider, CbmGeoSetup::GetModuleMap(), and CbmGeoSetupProvider::GetSetup().
Referenced by CbmOnlineParWrite::AddSts(), CbmOnlineParWrite::AddTof(), CbmOnlineParWrite::AddTrd(), and CbmDeviceUnpack::InitContainers().
size_t CbmSetup::GetHash | ( | ) |
Get a hash of the setup
The hash is formed from a string of pairs "module name -- module tag", separated by semicolon. Only active modules are considered.
Definition at line 142 of file CbmSetup.cxx.
References fProvider, CbmGeoSetup::GetModuleMap(), and CbmGeoSetupProvider::GetSetup().
|
inline |
Get materials (media) file path
Definition at line 73 of file CbmSetup.h.
References fProvider, CbmGeoSetupMedia::GetFilePath(), CbmGeoSetup::GetMedia(), and CbmGeoSetupProvider::GetSetup().
|
inline |
Get number of modules in the setup @value Number of modules in setup
Definition at line 111 of file CbmSetup.h.
References fProvider, CbmGeoSetup::GetModuleMap(), and CbmGeoSetupProvider::GetSetup().
Referenced by IsEmpty(), and ToString().
|
inline |
Get the geo setup provider.
Definition at line 197 of file CbmSetup.h.
References fProvider.
Referenced by CbmSetupStorable::CbmSetupStorable(), and cbm::kf::TrackingSetupBuilder::Instance().
|
static |
Get singleton instance of CbmSetup
Definition at line 160 of file CbmSetup.cxx.
References CbmSetup(), and fgInstance.
Referenced by cbm::kf::TrackingSetupBuilder::CheckDetectorPresence(), cbm::atconverter::Run::Exec(), cbm::reco::offline::Run::Exec(), cbm::sim::digitization::Run::Exec(), cbm::ca::IdealHitProducer::Init(), CbmDeviceBmonMonitor::InitContainers(), CbmDeviceUnpack::InitContainers(), CbmRecoQaTask::InitDefault(), CbmRecoQaTask::InitMcbm22(), CbmRecoQaTask::InitMcbm24(), ParameterMQServer::InitTask(), cbm::kf::TrackingSetupBuilder::Instance(), cbm::reco::offline::TaskFactory::RegisterMuchReco(), and CbmOnlineParWrite::Run().
Bool_t CbmSetup::IsActive | ( | ECbmModuleId | moduleId | ) |
Get the activity flag of a detector
moduleId | Module identifier (type ESystemId or EPassiveId) |
Definition at line 169 of file CbmSetup.cxx.
References fProvider, CbmGeoSetup::GetModuleMap(), and CbmGeoSetupProvider::GetSetup().
Referenced by CbmOnlineParWrite::AddTof(), CbmOnlineParWrite::AddTrd(), cbm::kf::TrackingSetupBuilder::CheckDetectorPresence(), cbm::ca::IdealHitProducer::Init(), CbmRecoQaTask::InitDefault(), CbmRecoQaTask::InitMcbm22(), and CbmRecoQaTask::InitMcbm24().
|
inline |
Check whether the setup is empty (contains no modules) @value kTRUE if the number of modules is null
Definition at line 128 of file CbmSetup.h.
References GetNofModules().
|
inline |
Load setup modules, field and media. Afterward the parameters can be overriden over the provider See CbmGeoSetupProvider::GetSetup() for details Actual functionality is implemented in the CbmGeoSetupProvider
Definition at line 64 of file CbmSetup.h.
References fProvider, and CbmGeoSetupProvider::LoadSetup().
Referenced by cbm::atconverter::Run::Exec(), cbm::reco::offline::Run::Exec(), cbm::sim::digitization::Run::Exec(), ParameterMQServer::InitTask(), CbmTransport::LoadSetup(), CbmOnlineParWrite::Run(), and CbmTransportConfig::SetGeometry().
void CbmSetup::LoadStoredSetup | ( | CbmSetupStorable * | setupIn | ) |
Load a stored/exchanged copy of the setup
To avoid clang format one-lining
Definition at line 46 of file CbmSetup.cxx.
References CbmSetupStorable::GetDbProvPtr(), CbmSetupStorable::GetRepoProvPtr(), and SetProvider().
Referenced by CbmDeviceBmonMonitor::InitContainers(), and CbmDeviceUnpack::InitContainers().
|
inlinevirtual |
|
inline |
Register setup modules, field and media with FairRoot Actual functionality is implemented in the CbmGeoSetupProvider
Definition at line 69 of file CbmSetup.h.
References fProvider, and CbmGeoSetupProvider::RegisterSetup().
Referenced by CbmTransport::RegisterSetup().
void CbmSetup::RemoveModule | ( | ECbmModuleId | moduleId | ) |
Remove a module from the current setup
moduleId | Module identifier (enum SystemId or kMagnet etc.) |
Definition at line 180 of file CbmSetup.cxx.
References fProvider, and CbmGeoSetupProvider::RemoveModule().
Referenced by CbmTransportConfig::SetGeometry().
void CbmSetup::SetActive | ( | ECbmModuleId | moduleId, |
Bool_t | active = kTRUE ) |
Activate a module (detector)
moduleId | Module identifier. SystemId for detectors, or kMagnet, kPipe, kTarget |
active | Activity tag for module (only in case of detectors) |
Activate or deactivate a detector already present in the setup. The method will have no effect if called for a passive module (target, pipe, magnet). If a detector is flagged active, its ProcessHits method will be called during the transport simulation.
Definition at line 185 of file CbmSetup.cxx.
References fProvider, CbmGeoSetup::GetModuleMap(), and CbmGeoSetupProvider::GetSetup().
Referenced by CbmOnlineParWrite::AddTof(), and CbmOnlineParWrite::AddTrd().
void CbmSetup::SetField | ( | const char * | tag, |
Double_t | scale = 1., | ||
Double_t | xPos = 0., | ||
Double_t | yPos = 0., | ||
Double_t | zPos = 0. ) |
Set the magnetic field map
tag | Field map tag |
scale | Field scaling factor |
The magnetic field map is automatically selected according to the magnet geometry version. The user can, however, override this by choosing a different field map. In this case, consistency between field map and magnet geometry is within the responsibility of the user.
Definition at line 203 of file CbmSetup.cxx.
References fProvider, CbmGeoSetup::GetField(), CbmGeoSetupProvider::GetFieldByTag(), CbmGeoSetupField::GetMatrix(), CbmGeoSetupProvider::GetSetup(), CbmGeoSetupField::GetTag(), CbmGeoSetup::SetField(), and CbmGeoSetupField::SetScale().
Referenced by CbmTransportConfig::SetGeometry().
|
inline |
Set the field scaling factor
scale | Field scaling factor |
The currently selected field map will be scaled by the specified factor.
Definition at line 172 of file CbmSetup.h.
References fProvider, CbmGeoSetup::GetField(), CbmGeoSetupProvider::GetSetup(), and CbmGeoSetupField::SetScale().
Referenced by CbmTransportConfig::SetGeometry().
|
inline |
Set materials (media) file path
Definition at line 77 of file CbmSetup.h.
References fProvider, CbmGeoSetup::GetMedia(), CbmGeoSetupProvider::GetSetup(), and CbmGeoSetupMedia::SetFilePath().
Referenced by CbmTransport::SetMediaFileName().
void CbmSetup::SetModule | ( | ECbmModuleId | moduleId, |
const char * | geoTag, | ||
Bool_t | active = kTRUE ) |
Add a module to the setup
moduleId | Module identifier. SystemId for detectors, or kMagnet, kPipe, kTarget |
geoTag | Geometry version for module |
active | Activity tag for module (only in case of detectors) |
The module / detector will be added to the setup. If a detector is flagged active, its ProcessHits method will be called during the transport simulation.
Definition at line 218 of file CbmSetup.cxx.
References fProvider, CbmGeoSetup::GetModuleMap(), CbmGeoSetupProvider::GetSetup(), CbmGeoSetupModule::GetTag(), and CbmGeoSetupProvider::SetModuleTag().
Referenced by CbmTransportConfig::SetGeometry().
|
inline |
Set the geo setup provider.
value | provider This class takes the ownership of the provider |
Definition at line 204 of file CbmSetup.h.
References fProvider.
Referenced by LoadStoredSetup(), and SetSetupSource().
void CbmSetup::SetSetupSource | ( | ECbmSetupSource | setupSource | ) |
Set the source the setup will be loaded from.
setupSource | enum value ECbmSetupSource |
Definition at line 263 of file CbmSetup.cxx.
References kDb, kRepo, and SetProvider().
Referenced by CbmTransport::SetSetupSource().
string CbmSetup::ToString | ( | ) | const |
Info to string.
Definition at line 235 of file CbmSetup.cxx.
References fProvider, CbmGeoSetupModule::GetActive(), CbmGeoSetup::GetField(), CbmGeoSetupModule::GetFilePath(), CbmGeoSetupField::GetMatrix(), CbmGeoSetup::GetModuleMap(), CbmModuleList::GetModuleNameCaps(), CbmGeoSetup::GetName(), GetNofModules(), CbmGeoSetupField::GetScale(), CbmGeoSetupProvider::GetSetup(), CbmGeoSetupField::GetTag(), and CbmGeoSetupModule::GetTag().
Referenced by Print().
|
staticprivate |
|
private |
Definition at line 213 of file CbmSetup.h.
Referenced by Clear(), CreateFieldMap(), GetGeoFileName(), GetGeoTag(), GetHash(), GetMediaFilePath(), GetNofModules(), GetProvider(), IsActive(), LoadSetup(), RegisterSetup(), RemoveModule(), SetActive(), SetField(), SetFieldScale(), SetMediaFilePath(), SetModule(), SetProvider(), and ToString().