Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
G4AllITFinder Class Reference

#include <G4AllITFinder.hh>

Public Member Functions

template<typename T >
G4KDTreeResultHandle FindNearest (const G4ThreeVector &pos, const T *it)
 
template<typename T >
G4KDTreeResultHandle FindNearest (const T *it0, const T *it)
 
template<typename T >
G4KDTreeResultHandle FindNearestInRange (const G4ThreeVector &pos, const T *it, G4double range)
 
template<typename T >
G4KDTreeResultHandle FindNearestInRange (const T *it0, const T *it, G4double range)
 
G4ITBoxGetBox (const G4Track *)
 
G4VITFinderGetInstance (G4ITType)
 
G4int GetVerboseLevel ()
 
void Push (G4Track *track)
 
void RegisterManager (G4VITFinder *manager)
 
void SetVerboseLevel (G4int level)
 
void UpdatePositionMap ()
 
 ~G4AllITFinder ()
 

Static Public Member Functions

static void DeleteInstance ()
 
static G4AllITFinderInstance ()
 

Private Member Functions

 G4AllITFinder ()
 

Private Attributes

std::map< G4ITType, G4VITFinder * > fITSubManager
 
int fVerbose
 

Static Private Attributes

static G4ThreadLocal G4AllITFinderfpInstance = 0
 

Detailed Description

Holds all IT Manager, and take care of deleting them when AllITManager is deleted Set general verbose for all IT Manager

Definition at line 70 of file G4AllITFinder.hh.

Constructor & Destructor Documentation

◆ ~G4AllITFinder()

G4AllITFinder::~G4AllITFinder ( )

To delete the Instance you should use DeleteInstance() rather than the destructor

Definition at line 61 of file G4AllITFinder.cc.

62{
63 std::map<G4ITType, G4VITFinder*>::iterator it;
64 std::map<G4ITType, G4VITFinder*>::iterator it_tmp;
65
66 for (it = fITSubManager.begin(); it != fITSubManager.end();)
67 {
68 if (it->second) delete it->second;
69 it_tmp = it;
70 it++;
71 fITSubManager.erase(it_tmp);
72 }
73 fpInstance = 0;
74}
std::map< G4ITType, G4VITFinder * > fITSubManager
static G4ThreadLocal G4AllITFinder * fpInstance

References fITSubManager, and fpInstance.

◆ G4AllITFinder()

G4AllITFinder::G4AllITFinder ( )
private

Definition at line 41 of file G4AllITFinder.cc.

42{
43 fVerbose = 0;
44}

References fVerbose.

Referenced by Instance().

Member Function Documentation

◆ DeleteInstance()

void G4AllITFinder::DeleteInstance ( )
static

Definition at line 52 of file G4AllITFinder.cc.

53{
54 if (fpInstance)
55 {
56 delete fpInstance;
57 fpInstance = 0;
58 }
59}

References fpInstance.

Referenced by G4Scheduler::ClearList().

◆ FindNearest() [1/2]

template<typename T >
G4KDTreeResultHandle G4AllITFinder::FindNearest ( const G4ThreeVector pos,
const T *  it 
)
inline

Definition at line 126 of file G4AllITFinder.hh.

128 {
130 }
static const G4double pos
G4KDTreeResultHandle FindNearest(const G4ThreeVector &, int key)
static G4ITFinder * Instance()

References G4ITFinder< T >::FindNearest(), G4ITFinder< T >::Instance(), and pos.

◆ FindNearest() [2/2]

template<typename T >
G4KDTreeResultHandle G4AllITFinder::FindNearest ( const T *  it0,
const T *  it 
)
inline

Definition at line 133 of file G4AllITFinder.hh.

135 {
136 return G4ITFinder<T>::Instance()->FindNearest(it0, it);
137 }

References G4ITFinder< T >::FindNearest(), and G4ITFinder< T >::Instance().

◆ FindNearestInRange() [1/2]

template<typename T >
G4KDTreeResultHandle G4AllITFinder::FindNearestInRange ( const G4ThreeVector pos,
const T *  it,
G4double  range 
)
inline

Definition at line 140 of file G4AllITFinder.hh.

143 {
144 return G4ITFinder<T>::Instance()->FindNearestInRange(pos, it, range);
145 }
G4KDTreeResultHandle FindNearestInRange(const T *point, int key, G4double)

References G4ITFinder< T >::FindNearestInRange(), G4ITFinder< T >::Instance(), and pos.

◆ FindNearestInRange() [2/2]

template<typename T >
G4KDTreeResultHandle G4AllITFinder::FindNearestInRange ( const T *  it0,
const T *  it,
G4double  range 
)
inline

Definition at line 148 of file G4AllITFinder.hh.

151 {
152 return G4ITFinder<T>::Instance()->FindNearestInRange(it0, it, range);
153 }

References G4ITFinder< T >::FindNearestInRange(), and G4ITFinder< T >::Instance().

◆ GetBox()

G4ITBox * G4AllITFinder::GetBox ( const G4Track )

◆ GetInstance()

G4VITFinder * G4AllITFinder::GetInstance ( G4ITType  type)

Definition at line 86 of file G4AllITFinder.cc.

87{
88 map<G4ITType, G4VITFinder*>::iterator it = fITSubManager.find(type);
89
90 if (it == fITSubManager.end()) return 0;
91
92 return it->second;
93}

References fITSubManager.

◆ GetVerboseLevel()

G4int G4AllITFinder::GetVerboseLevel ( )
inline

Definition at line 96 of file G4AllITFinder.hh.

97 {
98 return fVerbose;
99 }

References fVerbose.

◆ Instance()

G4AllITFinder * G4AllITFinder::Instance ( )
static

Definition at line 46 of file G4AllITFinder.cc.

47{
49 return fpInstance;
50}

References fpInstance, and G4AllITFinder().

◆ Push()

void G4AllITFinder::Push ( G4Track track)

Definition at line 100 of file G4AllITFinder.cc.

101{
102 fITSubManager[GetIT(track)->GetITType()]->Push(track);
103}
G4IT * GetIT(const G4Track *track)
Definition: G4IT.cc:48
virtual const G4ITType GetITType() const =0

References fITSubManager, GetIT(), and G4IT::GetITType().

◆ RegisterManager()

void G4AllITFinder::RegisterManager ( G4VITFinder manager)

Definition at line 95 of file G4AllITFinder.cc.

96{
97 fITSubManager[manager->GetITType()] = manager;
98}
virtual G4ITType GetITType()=0

References fITSubManager, and G4VITFinder::GetITType().

◆ SetVerboseLevel()

void G4AllITFinder::SetVerboseLevel ( G4int  level)
inline

Set General verbose for all IT Manager See ITManager builder

Definition at line 92 of file G4AllITFinder.hh.

93 {
94 fVerbose = level;
95 }

References fVerbose.

◆ UpdatePositionMap()

void G4AllITFinder::UpdatePositionMap ( )

Definition at line 76 of file G4AllITFinder.cc.

77{
78 std::map<G4ITType, G4VITFinder*>::iterator it = fITSubManager.begin();
79
80 for (; it != fITSubManager.end(); it++)
81 {
82 it->second->UpdatePositionMap();
83 }
84}

References fITSubManager.

Field Documentation

◆ fITSubManager

std::map<G4ITType, G4VITFinder*> G4AllITFinder::fITSubManager
private

◆ fpInstance

G4ThreadLocal G4AllITFinder * G4AllITFinder::fpInstance = 0
staticprivate

Definition at line 119 of file G4AllITFinder.hh.

Referenced by DeleteInstance(), Instance(), and ~G4AllITFinder().

◆ fVerbose

int G4AllITFinder::fVerbose
private

Definition at line 122 of file G4AllITFinder.hh.

Referenced by G4AllITFinder(), GetVerboseLevel(), and SetVerboseLevel().


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