]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4GeometryServices.h
Update of SSD simulation and reconstruction code by Boris and Enrico.
[u/mrichter/AliRoot.git] / TGeant4 / TG4GeometryServices.h
1 // $Id$
2 // Category: geometry
3 //
4 // Geometry services
5 // The class provides service methods for accessing to Geant4 geometry,
6 // namely using AliMC volumes and materials identifiers. 
7
8 #ifndef TG4_GEOMETRY_SERVICES_H
9 #define TG4_GEOMETRY_SERVICES_H
10
11 #include "TG4NameMap.h"
12 #include "TG4Globals.h"
13
14 #include <globals.hh>
15
16 #include <Rtypes.h>
17
18 class TG4CutVector;
19 class TG4FlagVector;
20 class TG4GeometryOutputManager;
21
22 class G4Material;
23 class G4VPhysicalVolume;
24 class G4LogicalVolume;
25 class G4UserLimits;
26
27 class TG4GeometryServices
28 {
29   public:
30     TG4GeometryServices(TG4intVector* mediumIdVector, TG4NameMap* nameMap);
31     // --> protected
32     // TG4GeometryServices();
33     // TG4GeometryServices(const TG4GeometryServices& right);
34     virtual ~TG4GeometryServices();
35
36     // static access method
37     static TG4GeometryServices* Instance();
38
39     // methods
40     G4double* CreateG4doubleArray(Float_t* array, G4int size) const;
41     G4String  CutName(const char* name) const;
42     void G4ToG3VolumeName(G4String& name) const;
43     G4int SetUserLimits(G4UserLimits* userLimits, G4LogicalVolume* lv);              
44     G4Material* MixMaterials(G4String name, G4double density,
45                      TG4StringVector* matNames, TG4doubleVector* matWeights);
46
47     // get methods
48     Int_t NofG3Volumes() const; 
49     Int_t NofG4LogicalVolumes() const; 
50     Int_t NofG4PhysicalVolumes() const; 
51     Int_t NofSensitiveDetectors() const; 
52
53     G4int GetVolumeID(const G4String& volumeName) const;
54     G4int GetVolumeID(G4LogicalVolume* volume) const;
55     G4String GetVolumeName(G4int volumeId) const;
56     G4LogicalVolume* GetLogicalVolume(G4int volumeId) const;
57     G4bool IsG3Volume(const G4String& lvName) const;
58     const G4String& GetMapSecond(const G4String& name);
59
60           // materials
61     G4int GetMediumId(G4Material* material) const;    
62     G4int GetMediumId(G4int volumeId) const;    
63     G4double GetEffA(G4Material* material) const;
64     G4double GetEffZ(G4Material* material) const;
65
66   protected:
67     TG4GeometryServices();
68     TG4GeometryServices(const TG4GeometryServices& right);
69
70     // operators
71     TG4GeometryServices& operator=(const TG4GeometryServices& right);
72
73   private:        
74     // static data members
75     static TG4GeometryServices*  fgInstance;    //this instance
76
77     // data members
78     TG4intVector*  fMediumIdVector;  //vector of second indexes for materials
79     TG4NameMap*    fNameMap;         //map of volumes names to modules names
80 };
81
82 // inline methods
83 inline TG4GeometryServices* TG4GeometryServices::Instance()
84 { return fgInstance; }
85
86 #endif //TG4_GEOMETRY_SERVICES_H
87