Geant4 11.1.1
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 57 of file G4FieldManagerStore.cc.

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

◆ G4FieldManagerStore()

G4FieldManagerStore::G4FieldManagerStore ( )
protected

Definition at line 47 of file G4FieldManagerStore.cc.

48 : std::vector<G4FieldManager*>()
49{
50 reserve(100);
51}

Referenced by GetInstance().

Member Function Documentation

◆ Clean()

void G4FieldManagerStore::Clean ( )
static

Definition at line 67 of file G4FieldManagerStore.cc.

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

Referenced by ~G4FieldManagerStore().

◆ ClearAllChordFindersState()

void G4FieldManagerStore::ClearAllChordFindersState ( )

Definition at line 140 of file G4FieldManagerStore.cc.

141{
142 G4ChordFinder* pChordFnd;
143
144 for (auto i=GetInstance()->cbegin(); i!=GetInstance()->cend(); ++i)
145 {
146 pChordFnd = (*i)->GetChordFinder();
147 if( pChordFnd != nullptr )
148 {
149 pChordFnd->ResetStepEstimate();
150 }
151 }
152}
void ResetStepEstimate()

Referenced by G4Transportation::StartTracking().

◆ DeRegister()

void G4FieldManagerStore::DeRegister ( G4FieldManager pVolume)
static

Definition at line 98 of file G4FieldManagerStore.cc.

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

Referenced by G4FieldManager::~G4FieldManager().

◆ GetInstance()

G4FieldManagerStore * G4FieldManagerStore::GetInstance ( )
static

Definition at line 117 of file G4FieldManagerStore.cc.

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

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

◆ GetInstanceIfExist()

G4FieldManagerStore * G4FieldManagerStore::GetInstanceIfExist ( )
static

Definition at line 130 of file G4FieldManagerStore.cc.

131{
132 return fgInstance;
133}

Referenced by G4RunManagerKernel::~G4RunManagerKernel().

◆ Register()

void G4FieldManagerStore::Register ( G4FieldManager pVolume)
static

Definition at line 89 of file G4FieldManagerStore.cc.

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

Referenced by G4FieldManager::G4FieldManager().


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