Geant4 9.6.0
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 ()
 
virtual ~G4FieldManagerStore ()
 

Static Public Member Functions

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

Protected Member Functions

 G4FieldManagerStore ()
 

Detailed Description

Definition at line 58 of file G4FieldManagerStore.hh.

Constructor & Destructor Documentation

◆ ~G4FieldManagerStore()

G4FieldManagerStore::~G4FieldManagerStore ( )
virtual

Definition at line 63 of file G4FieldManagerStore.cc.

64{
65 Clean();
66}

◆ G4FieldManagerStore()

G4FieldManagerStore::G4FieldManagerStore ( )
protected

Definition at line 53 of file G4FieldManagerStore.cc.

54 : std::vector<G4FieldManager*>()
55{
56 reserve(100);
57}

Member Function Documentation

◆ Clean()

void G4FieldManagerStore::Clean ( )
static

Definition at line 72 of file G4FieldManagerStore.cc.

73{
74 // Locks store for deletion of field managers. De-registration will be
75 // performed at this stage. G4FieldManagers will not de-register themselves.
76 //
77 locked = true;
78
79 size_t i=0;
81
82 for(iterator pos=store->begin(); pos!=store->end(); pos++)
83 {
84 if (*pos) { delete *pos; }
85 i++;
86 }
87
88#ifdef G4GEOMETRY_DEBUG
89 if (store->size() < i-1)
90 { G4cout << "No field managers deleted. Already deleted by user ?" << G4endl; }
91 else
92 { G4cout << i-1 << " field managers deleted !" << G4endl; }
93#endif
94
95 locked = false;
96 store->clear();
97}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static G4FieldManagerStore * GetInstance()

Referenced by ~G4FieldManagerStore().

◆ ClearAllChordFindersState()

void G4FieldManagerStore::ClearAllChordFindersState ( )

Definition at line 146 of file G4FieldManagerStore.cc.

147{
148 G4ChordFinder *pChordFnd;
149
150 for (iterator i=GetInstance()->begin(); i!=GetInstance()->end(); i++)
151 {
152 pChordFnd = (*i)->GetChordFinder();
153 if( pChordFnd )
154 {
155 pChordFnd->ResetStepEstimate();
156 }
157 }
158}
void ResetStepEstimate()

Referenced by G4ITTransportation::StartTracking(), G4CoupledTransportation::StartTracking(), and G4Transportation::StartTracking().

◆ DeRegister()

void G4FieldManagerStore::DeRegister ( G4FieldManager pVolume)
static

Definition at line 112 of file G4FieldManagerStore.cc.

113{
114 if (!locked) // Do not de-register if locked !
115 {
116 for (iterator i=GetInstance()->begin(); i!=GetInstance()->end(); i++)
117 {
118 if (*i==pFieldMgr) // For LogVol was **i == *pLogVolume ... Reason?
119 {
120 GetInstance()->erase(i);
121 break;
122 }
123 }
124 }
125}

Referenced by G4FieldManager::~G4FieldManager().

◆ GetInstance()

G4FieldManagerStore * G4FieldManagerStore::GetInstance ( )
static

Definition at line 131 of file G4FieldManagerStore.cc.

132{
133 static G4FieldManagerStore worldStore;
134 if (!fgInstance)
135 {
136 fgInstance = &worldStore;
137 }
138 return fgInstance;
139}

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

◆ Register()

void G4FieldManagerStore::Register ( G4FieldManager pVolume)
static

Definition at line 103 of file G4FieldManagerStore.cc.

104{
105 GetInstance()->push_back(pFieldManager);
106}

Referenced by G4FieldManager::G4FieldManager().


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