Geant4_10
G4AllITManager.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4AllITManager.hh 71827 2013-06-25 15:58:24Z gcosmo $
27 //
28 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
29 //
30 // WARNING : This class is released as a prototype.
31 // It might strongly evolve or even disapear in the next releases.
32 //
33 // History:
34 // -----------
35 // 10 Oct 2011 M.Karamitros created
36 //
37 // -------------------------------------------------------------------
38 
39 #ifndef G4AllITManager_h
40 #define G4AllITManager_h 1
41 #include <globals.hh>
42 #include <map>
43 #include <vector>
44 #include "G4ITType.hh"
45 #include "G4ThreeVector.hh"
46 #include <memory>
47 
48 class G4IT;
49 class G4VITManager;
50 class G4ITBox;
51 class G4Track;
52 template<typename T> class G4ITManager;
53 
61 {
62 public :
63  static G4AllITManager* Instance();
64  static void DeleteInstance();
71 
72  template<typename T> G4ITManager<T>* Instance();
73 
75  G4ITBox* GetBox(const G4Track*);
76 
77  void RegisterManager(G4VITManager* manager);
78  void Push(G4Track* track);
79 
84  void SetVerboseLevel(G4int level)
85  {
86  fVerbose = level;
87  }
89  {
90  return fVerbose;
91  }
92 
93  void UpdatePositionMap();
94  void CreateTree();
95 
96  template<typename T> inline std::vector<std::pair<G4IT*, double> >* FindNearest(const G4ThreeVector& pos, const T* it);
97  template<typename T> inline std::vector<std::pair<G4IT*, double> >* FindNearest(const T* it0, const T* it);
98  template<typename T> inline std::vector<std::pair<G4IT*, double> >* FindNearestInRange(const G4ThreeVector& pos,
99  const T* it, G4double range);
100  template<typename T> inline std::vector<std::pair<G4IT*, double> >* FindNearestInRange(const T* it0, const T* it, G4double range);
101 
102 private :
103  G4AllITManager();
104  static G4ThreadLocal G4AllITManager* fpInstance;
105  std::map<G4ITType, G4VITManager*> fITSubManager ;
106 
107  int fVerbose ;
108 };
109 
110 template<typename T>
111 inline std::vector<std::pair<G4IT*, double> >* G4AllITManager::FindNearest(const G4ThreeVector& pos, const T* it)
112 {
113  return G4ITManager<T>::Instance()->FindNearest(pos,it);
114 }
115 
116 template<typename T>
117 inline std::vector<std::pair<G4IT*, double> >* G4AllITManager::FindNearest(const T* it0, const T* it)
118 {
119  return G4ITManager<T>::Instance()->FindNearest(it0, it) ;
120 }
121 
122 template<typename T>
123 inline std::vector<std::pair<G4IT*, double> >* G4AllITManager::FindNearestInRange(const G4ThreeVector& pos, const T* it, G4double range)
124 {
125  return G4ITManager<T>::Instance()->FindNearestInRange(pos, it, range);
126 }
127 
128 template<typename T>
129 inline std::vector<std::pair<G4IT*, double> >* G4AllITManager::FindNearestInRange(const T* it0, const T* it, G4double range)
130 {
131  return G4ITManager<T>::Instance()->FindNearestInRange(it0, it, range);
132 }
133 
134 #endif
Definition: G4IT.hh:82
static G4AllITManager * Instance()
static void DeleteInstance()
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
void UpdatePositionMap()
G4VITManager * GetInstance(G4ITType)
static G4ITManager< T > * Instance()
const G4ParticleDefinition const G4Material *G4double range
std::vector< std::pair< G4IT *, double > > * FindNearest(const G4ThreeVector &pos, const T *it)
std::vector< std::pair< G4IT *, double > > * FindNearestInRange(const G4ThreeVector &pos, const T *it, G4double range)
G4int GetVerboseLevel()
void SetVerboseLevel(G4int level)
G4ITBox * GetBox(const G4Track *)
double G4double
Definition: G4Types.hh:76
void RegisterManager(G4VITManager *manager)
void Push(G4Track *track)