Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
G4AllITManager Class Reference

#include <G4AllITManager.hh>

Public Member Functions

 ~G4AllITManager ()
 
template<typename T >
G4ITManager< T > * Instance ()
 
G4VITManagerGetInstance (G4ITType)
 
G4ITBoxGetBox (const G4Track *)
 
void RegisterManager (G4VITManager *manager)
 
void Push (G4Track *track)
 
void SetVerboseLevel (G4int level)
 
G4int GetVerboseLevel ()
 
void UpdatePositionMap ()
 
void CreateTree ()
 
template<typename T >
std::vector< std::pair< G4IT
*, double > > * 
FindNearest (const G4ThreeVector &pos, const T *it)
 
template<typename T >
std::vector< std::pair< G4IT
*, double > > * 
FindNearest (const T *it0, const T *it)
 
template<typename T >
std::vector< std::pair< G4IT
*, double > > * 
FindNearestInRange (const G4ThreeVector &pos, const T *it, G4double range)
 
template<typename T >
std::vector< std::pair< G4IT
*, double > > * 
FindNearestInRange (const T *it0, const T *it, G4double range)
 

Static Public Member Functions

static G4AllITManagerInstance ()
 
static void DeleteInstance ()
 

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 60 of file G4AllITManager.hh.

Constructor & Destructor Documentation

G4AllITManager::~G4AllITManager ( )

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

Definition at line 58 of file G4AllITManager.cc.

59 {
60  std::map<G4ITType, G4VITManager*>::iterator it ;
61  std::map<G4ITType, G4VITManager*>::iterator it_tmp ;
62 
63  for(it = fITSubManager.begin(); it!=fITSubManager.end() ; )
64  {
65  if(it->second) delete it->second;
66  it_tmp = it;
67  it++;
68  fITSubManager.erase(it_tmp);
69  }
70  fpInstance = 0;
71 }

Member Function Documentation

void G4AllITManager::CreateTree ( )

Definition at line 83 of file G4AllITManager.cc.

84 {
85  std::map<G4ITType, G4VITManager*>::iterator it = fITSubManager.begin() ;
86 
87  for(; it!=fITSubManager.end() ; it++)
88  {
89  it->second->CreateTree();
90  }
91 }
void G4AllITManager::DeleteInstance ( )
static

Definition at line 53 of file G4AllITManager.cc.

54 {
55  if(fpInstance) delete fpInstance;
56 }
template<typename T >
std::vector< std::pair< G4IT *, double > > * G4AllITManager::FindNearest ( const G4ThreeVector pos,
const T *  it 
)
inline

Definition at line 111 of file G4AllITManager.hh.

References G4ITManager< T >::Instance().

112 {
113  return G4ITManager<T>::Instance()->FindNearest(pos,it);
114 }
static G4ITManager< T > * Instance()
template<typename T >
std::vector< std::pair< G4IT *, double > > * G4AllITManager::FindNearest ( const T *  it0,
const T *  it 
)
inline

Definition at line 117 of file G4AllITManager.hh.

References G4ITManager< T >::Instance().

118 {
119  return G4ITManager<T>::Instance()->FindNearest(it0, it) ;
120 }
static G4ITManager< T > * Instance()
template<typename T >
std::vector< std::pair< G4IT *, double > > * G4AllITManager::FindNearestInRange ( const G4ThreeVector pos,
const T *  it,
G4double  range 
)
inline

Definition at line 123 of file G4AllITManager.hh.

References G4ITManager< T >::Instance().

124 {
125  return G4ITManager<T>::Instance()->FindNearestInRange(pos, it, range);
126 }
static G4ITManager< T > * Instance()
template<typename T >
std::vector< std::pair< G4IT *, double > > * G4AllITManager::FindNearestInRange ( const T *  it0,
const T *  it,
G4double  range 
)
inline

Definition at line 129 of file G4AllITManager.hh.

References G4ITManager< T >::Instance().

130 {
131  return G4ITManager<T>::Instance()->FindNearestInRange(it0, it, range);
132 }
static G4ITManager< T > * Instance()
G4ITBox * G4AllITManager::GetBox ( const G4Track track)

Definition at line 112 of file G4AllITManager.cc.

References GetIT().

113 {
114  map<G4ITType, G4VITManager*>::iterator it = fITSubManager.find(GetIT(track)->GetITType());
115 
116  if(it == fITSubManager.end()) return 0;
117 
118  return it->second->GetBox(track);
119 }
G4IT * GetIT(const G4Track *track)
Definition: G4IT.cc:48
G4VITManager * G4AllITManager::GetInstance ( G4ITType  type)

Definition at line 98 of file G4AllITManager.cc.

Referenced by G4VITManager::allbox_iterator::allbox_iterator().

99 {
100  map<G4ITType, G4VITManager*>::iterator it = fITSubManager.find(type);
101 
102  if(it == fITSubManager.end()) return 0;
103 
104  return it->second;
105 }
G4int G4AllITManager::GetVerboseLevel ( )
inline

Definition at line 88 of file G4AllITManager.hh.

89  {
90  return fVerbose;
91  }
G4AllITManager * G4AllITManager::Instance ( void  )
static

Definition at line 47 of file G4AllITManager.cc.

Referenced by G4VITManager::allbox_iterator::allbox_iterator().

48 {
49  if (!fpInstance) fpInstance = new G4AllITManager();
50  return fpInstance ;
51 }
template<typename T >
G4ITManager< T > * G4AllITManager::Instance ( void  )

Definition at line 93 of file G4AllITManager.cc.

References G4ITManager< T >::Instance().

94 {
95  return G4ITManager<T>::Instance();
96 }
static G4ITManager< T > * Instance()
void G4AllITManager::Push ( G4Track track)

Definition at line 121 of file G4AllITManager.cc.

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

122 {
123  fITSubManager[GetIT(track)->GetITType()]->Push(track);
124 }
G4IT * GetIT(const G4Track *track)
Definition: G4IT.cc:48
virtual const G4ITType GetITType() const =0
void G4AllITManager::RegisterManager ( G4VITManager manager)

Definition at line 107 of file G4AllITManager.cc.

References G4VITManager::GetITType().

108 {
109  fITSubManager[manager->GetITType()] = manager;
110 }
G4ITType GetITType()
Definition: G4ITManager.hh:78
void G4AllITManager::SetVerboseLevel ( G4int  level)
inline

Set General verbose for all IT Manager See ITManager builder

Definition at line 84 of file G4AllITManager.hh.

85  {
86  fVerbose = level;
87  }
void G4AllITManager::UpdatePositionMap ( )

Definition at line 73 of file G4AllITManager.cc.

74 {
75  std::map<G4ITType, G4VITManager*>::iterator it = fITSubManager.begin() ;
76 
77  for(; it!=fITSubManager.end() ; it++)
78  {
79  it->second->UpdatePositionMap();
80  }
81 }

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