Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FieldManagerStore Class Reference

#include <G4FieldManagerStore.hh>

+ Inheritance diagram for G4FieldManagerStore:

Public Member Functions

void ClearAllChordFindersState ()
 
 ~G4FieldManagerStore ()
 

Static Public Member Functions

static void Register (G4FieldManager *pVolume)
 
static void DeRegister (G4FieldManager *pVolume)
 
static G4FieldManagerStoreGetInstance ()
 
static G4FieldManagerStoreGetInstanceIfExist ()
 
static void Clean ()
 

Protected Member Functions

 G4FieldManagerStore ()
 

Detailed Description

Definition at line 49 of file G4FieldManagerStore.hh.

Constructor & Destructor Documentation

◆ ~G4FieldManagerStore()

G4FieldManagerStore::~G4FieldManagerStore ( )

Definition at line 56 of file G4FieldManagerStore.cc.

57{
58 Clean();
59 fgInstance = nullptr;
60}

◆ G4FieldManagerStore()

G4FieldManagerStore::G4FieldManagerStore ( )
protected

Definition at line 47 of file G4FieldManagerStore.cc.

48{
49 reserve(100);
50}

Referenced by GetInstance().

Member Function Documentation

◆ Clean()

void G4FieldManagerStore::Clean ( )
static

Definition at line 66 of file G4FieldManagerStore.cc.

67{
68 // Locks store for deletion of field managers. De-registration will be
69 // performed at this stage. G4FieldManagers will not de-register themselves.
70 //
71 locked = true;
72
74
75 for(const auto & pos : *store)
76 {
77 if (pos != nullptr) { delete pos; }
78 }
79
80 locked = false;
81 store->clear();
82}
static G4FieldManagerStore * GetInstance()

Referenced by ~G4FieldManagerStore().

◆ ClearAllChordFindersState()

void G4FieldManagerStore::ClearAllChordFindersState ( )

Definition at line 139 of file G4FieldManagerStore.cc.

140{
141 G4ChordFinder* pChordFnd;
142
143 for (const auto & mgr : *GetInstance())
144 {
145 pChordFnd = mgr->GetChordFinder();
146 if( pChordFnd != nullptr )
147 {
148 pChordFnd->ResetStepEstimate();
149 }
150 }
151}
void ResetStepEstimate()

Referenced by G4Transportation::StartTracking().

◆ DeRegister()

void G4FieldManagerStore::DeRegister ( G4FieldManager * pVolume)
static

Definition at line 97 of file G4FieldManagerStore.cc.

98{
99 if (!locked) // Do not de-register if locked !
100 {
101 for (auto i=GetInstance()->cbegin(); i!=GetInstance()->cend(); ++i)
102 {
103 if (*i==pFieldMgr) // For LogVol was **i == *pLogVolume ... Reason?
104 {
105 GetInstance()->erase(i);
106 break;
107 }
108 }
109 }
110}

Referenced by G4FieldManager::~G4FieldManager().

◆ GetInstance()

G4FieldManagerStore * G4FieldManagerStore::GetInstance ( )
static

Definition at line 116 of file G4FieldManagerStore.cc.

117{
118 if (fgInstance == nullptr)
119 {
120 fgInstance = new G4FieldManagerStore;
121 }
122 return fgInstance;
123}

Referenced by Clean(), ClearAllChordFindersState(), DeRegister(), Register(), G4ITTransportation::StartTracking(), and G4Transportation::StartTracking().

◆ GetInstanceIfExist()

G4FieldManagerStore * G4FieldManagerStore::GetInstanceIfExist ( )
static

Definition at line 129 of file G4FieldManagerStore.cc.

130{
131 return fgInstance;
132}

Referenced by G4RunManagerKernel::~G4RunManagerKernel().

◆ Register()

void G4FieldManagerStore::Register ( G4FieldManager * pVolume)
static

Definition at line 88 of file G4FieldManagerStore.cc.

89{
90 GetInstance()->push_back(pFieldManager);
91}

Referenced by G4FieldManager::G4FieldManager(), and G4FieldManager::G4FieldManager().


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