]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TGeant4/TG4GeometryServices.h
Enable creation of fast rec points for ITS, when input argument for ITS = 2.
[u/mrichter/AliRoot.git] / TGeant4 / TG4GeometryServices.h
CommitLineData
b68f7176 1// $Id$
2// Category: geometry
3//
e5967ab3 4// Author: I. Hrivnacova
5//
6// Class TG4GeometryServices
7// -------------------------
b68f7176 8// The class provides service methods for accessing to Geant4 geometry,
9// namely using AliMC volumes and materials identifiers.
10
11#ifndef TG4_GEOMETRY_SERVICES_H
12#define TG4_GEOMETRY_SERVICES_H
13
5b6ecd36 14#include "TG4Verbose.h"
b68f7176 15#include "TG4Globals.h"
16
17#include <globals.hh>
18
19#include <Rtypes.h>
20
e5967ab3 21class TG4IntMap;
22class TG4NameMap;
23class TG4Limits;
24class TG4G3ControlVector;
b68f7176 25
26class G4Material;
b68f7176 27class G4LogicalVolume;
7220494a 28class G4VPhysicalVolume;
e4a64a3a 29class G4UserLimits;
b68f7176 30
5b6ecd36 31class TG4GeometryServices : public TG4Verbose
b68f7176 32{
33 public:
e5967ab3 34 TG4GeometryServices(TG4IntMap* mediumMap, TG4NameMap* nameMap);
b68f7176 35 // --> protected
36 // TG4GeometryServices();
37 // TG4GeometryServices(const TG4GeometryServices& right);
38 virtual ~TG4GeometryServices();
39
40 // static access method
41 static TG4GeometryServices* Instance();
42
43 // methods
e5967ab3 44 // utilities
b68f7176 45 G4double* CreateG4doubleArray(Float_t* array, G4int size) const;
46 G4String CutName(const char* name) const;
e5967ab3 47 G4String CutMaterialName(const char* name) const;
48 G4String G4ToG3VolumeName(const G4String& name) const;
49 G4String GenerateLimitsName(G4int id, const G4String& medName,
50 const G4String& matName) const;
51
b68f7176 52 G4Material* MixMaterials(G4String name, G4double density,
e5967ab3 53 const TG4StringVector& matNames,
54 const TG4doubleVector& matWeights);
55 // printing
56 void PrintNameMap() const;
57 void PrintLimits(const G4String& name) const;
58 void PrintVolumeLimits(const G4String& volumeName) const;
59 void PrintStatistics(G4bool open, G4bool close) const;
8ffaafc3 60 void PrintLogicalVolumeStore() const;
b68f7176 61
7220494a 62 // set methods
63 void SetWorld(G4VPhysicalVolume* world);
64
b68f7176 65 // get methods
e5967ab3 66 // volumes
b68f7176 67 Int_t NofG3Volumes() const;
68 Int_t NofG4LogicalVolumes() const;
69 Int_t NofG4PhysicalVolumes() const;
e5967ab3 70 G4bool IsSpecialControls() const;
7220494a 71 G4VPhysicalVolume* GetWorld() const;
b68f7176 72
e5967ab3 73 TG4Limits* GetLimits(G4UserLimits* limits) const;
b68f7176 74 const G4String& GetMapSecond(const G4String& name);
75
e5967ab3 76 G4LogicalVolume* FindLogicalVolume(const G4String& name,
77 G4bool silent = false) const;
78 TG4Limits* FindLimits(const G4String& name,
79 G4bool silent = false) const;
80
b68f7176 81 // materials
e5967ab3 82 G4int GetMediumId(G4LogicalVolume* lv) const;
b68f7176 83 G4double GetEffA(G4Material* material) const;
84 G4double GetEffZ(G4Material* material) const;
e5967ab3 85 G4Material* FindMaterial(G4double a, G4double z, G4double density) const;
86 G4Material* FindMaterial(G4double* a, G4double* z, G4double density,
87 G4int nmat, G4double* wmat) const;
b68f7176 88
89 protected:
90 TG4GeometryServices();
91 TG4GeometryServices(const TG4GeometryServices& right);
92
93 // operators
94 TG4GeometryServices& operator=(const TG4GeometryServices& right);
95
e5967ab3 96 private:
97 // methods
98 G4bool IsG3Volume(const G4String& lvName) const;
99 G4bool CompareElement(G4double a, G4double z, const G4Element* elem) const;
100 G4bool CompareMaterial(G4int nofElements, G4double density,
101 const G4Material* material) const;
102 G4double* ConvertAtomWeight(G4int nmat, G4double* a, G4double* wmat) const;
b68f7176 103
e5967ab3 104 // static data members
105 static TG4GeometryServices* fgInstance; //this instance
106 static const G4double fgkAZTolerance; //A,Z tolerance
107 static const G4double fgkDensityTolerance;//density tolerance (percentual)
108
b68f7176 109 // data members
7220494a 110 TG4IntMap* fMediumMap; //map of volumes names to medias IDs
111 TG4NameMap* fNameMap; //map of volumes names to modules names
112 G4VPhysicalVolume* fWorld; //top pgysical volume (world)
b68f7176 113};
114
115// inline methods
116inline TG4GeometryServices* TG4GeometryServices::Instance()
117{ return fgInstance; }
118
7220494a 119inline void TG4GeometryServices::SetWorld(G4VPhysicalVolume* world)
120{ fWorld = world; }
121
122inline G4VPhysicalVolume* TG4GeometryServices::GetWorld() const
123{ return fWorld; }
124
b68f7176 125#endif //TG4_GEOMETRY_SERVICES_H
126