CbmRoot
Loading...
Searching...
No Matches
CbmSetup Class Reference

#include <CbmSetup.h>

Inheritance diagram for CbmSetup:
[legend]
Collaboration diagram for CbmSetup:
[legend]

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)
 
CbmFieldMapCreateFieldMap ()
 
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.
 
CbmGeoSetupProviderGetProvider ()
 Get the geo setup provider.
 
void SetProvider (CbmGeoSetupProvider *value)
 Set the geo setup provider.
 

Static Public Member Functions

static CbmSetupInstance ()
 

Private Member Functions

 CbmSetup ()
 ! Setup provider
 
 CbmSetup (const CbmSetup &)
 
CbmSetup operator= (const CbmSetup &)
 
 ClassDef (CbmSetup, 3)
 

Private Attributes

CbmGeoSetupProviderfProvider {new CbmGeoSetupRepoProvider()}
 

Static Private Attributes

static CbmSetupfgInstance = NULL
 Pointer to static instance.
 

Detailed Description

Definition at line 43 of file CbmSetup.h.

Constructor & Destructor Documentation

◆ ~CbmSetup()

CbmSetup::~CbmSetup ( )
inline

Destructor

Definition at line 46 of file CbmSetup.h.

◆ CbmSetup() [1/2]

CbmSetup::CbmSetup ( )
inlineprivate

! Setup provider

Default constructor

Definition at line 217 of file CbmSetup.h.

Referenced by Instance().

◆ CbmSetup() [2/2]

CbmSetup::CbmSetup ( const CbmSetup & )
private

Copy constructor and assignment operator (not implemented )

Member Function Documentation

◆ ClassDef()

CbmSetup::ClassDef ( CbmSetup ,
3  )
private

◆ Clear()

void CbmSetup::Clear ( Option_t * opt = "")
virtual

Clear the setup

All settings are removed.

Definition at line 42 of file CbmSetup.cxx.

References fProvider, and CbmGeoSetupProvider::Reset().

◆ CreateFieldMap()

◆ GetGeoFileName()

Bool_t CbmSetup::GetGeoFileName ( ECbmModuleId moduleId,
TString & fileName )

Get a geometry file name

Parameters
[in]moduleIdModule identifier (type ESystemId or EPassiveId)
[out]fileNameGeometry file name for this module
Returns
kTRUE if module is present in setup; else kFALSE

Definition at line 112 of file CbmSetup.cxx.

References fProvider, CbmGeoSetup::GetModuleMap(), and CbmGeoSetupProvider::GetSetup().

◆ GetGeoTag()

Bool_t CbmSetup::GetGeoTag ( ECbmModuleId moduleId,
TString & tag )

Get a geometry tag

Parameters
[in]moduleIdModule identifier (type ESystemId or EPassiveId)
[out]tagGeometry tag for this module
Returns
kTRUE if module is present in setup; else kFALSE

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().

◆ GetHash()

size_t CbmSetup::GetHash ( )

Get a hash of the setup

Returns
A 64-bit integer, representing the hash value

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().

◆ GetMediaFilePath()

std::string CbmSetup::GetMediaFilePath ( )
inline

Get materials (media) file path

Definition at line 73 of file CbmSetup.h.

References fProvider, CbmGeoSetupMedia::GetFilePath(), CbmGeoSetup::GetMedia(), and CbmGeoSetupProvider::GetSetup().

◆ GetNofModules()

Int_t CbmSetup::GetNofModules ( ) const
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().

◆ GetProvider()

CbmGeoSetupProvider * CbmSetup::GetProvider ( )
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().

◆ Instance()

◆ IsActive()

Bool_t CbmSetup::IsActive ( ECbmModuleId moduleId)

Get the activity flag of a detector

Parameters
moduleIdModule identifier (type ESystemId or EPassiveId)
Returns
kTRUE if detector and active, else kFALSE

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().

◆ IsEmpty()

Bool_t CbmSetup::IsEmpty ( ) const
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().

◆ LoadSetup()

void CbmSetup::LoadSetup ( const char * setupName)
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().

◆ LoadStoredSetup()

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().

◆ operator=()

CbmSetup CbmSetup::operator= ( const CbmSetup & )
private

◆ Print()

virtual void CbmSetup::Print ( Option_t * = "") const
inlinevirtual

Info to screen.

Definition at line 132 of file CbmSetup.h.

References ToString().

◆ RegisterSetup()

void CbmSetup::RegisterSetup ( )
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().

◆ RemoveModule()

void CbmSetup::RemoveModule ( ECbmModuleId moduleId)

Remove a module from the current setup

Parameters
moduleIdModule identifier (enum SystemId or kMagnet etc.)

Definition at line 180 of file CbmSetup.cxx.

References fProvider, and CbmGeoSetupProvider::RemoveModule().

Referenced by CbmTransportConfig::SetGeometry().

◆ SetActive()

void CbmSetup::SetActive ( ECbmModuleId moduleId,
Bool_t active = kTRUE )

Activate a module (detector)

Parameters
moduleIdModule identifier. SystemId for detectors, or kMagnet, kPipe, kTarget
activeActivity 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().

◆ SetField()

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

Parameters
tagField map tag
scaleField 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().

◆ SetFieldScale()

void CbmSetup::SetFieldScale ( Double_t scale)
inline

Set the field scaling factor

Parameters
scaleField 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().

◆ SetMediaFilePath()

void CbmSetup::SetMediaFilePath ( std::string filePath)
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().

◆ SetModule()

void CbmSetup::SetModule ( ECbmModuleId moduleId,
const char * geoTag,
Bool_t active = kTRUE )

Add a module to the setup

Parameters
moduleIdModule identifier. SystemId for detectors, or kMagnet, kPipe, kTarget
geoTagGeometry version for module
activeActivity 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().

◆ SetProvider()

void CbmSetup::SetProvider ( CbmGeoSetupProvider * value)
inline

Set the geo setup provider.

Parameters
valueprovider This class takes the ownership of the provider

Definition at line 204 of file CbmSetup.h.

References fProvider.

Referenced by LoadStoredSetup(), and SetSetupSource().

◆ SetSetupSource()

void CbmSetup::SetSetupSource ( ECbmSetupSource setupSource)

Set the source the setup will be loaded from.

Parameters
setupSourceenum value ECbmSetupSource

Definition at line 263 of file CbmSetup.cxx.

References kDb, kRepo, and SetProvider().

Referenced by CbmTransport::SetSetupSource().

◆ ToString()

Member Data Documentation

◆ fgInstance

CbmSetup * CbmSetup::fgInstance = NULL
staticprivate

Pointer to static instance.

Definition at line 211 of file CbmSetup.h.

Referenced by Instance().

◆ fProvider


The documentation for this class was generated from the following files: