Calculation of new variables needed for Non-id HBT added. (Z. Chajecki)
[u/mrichter/AliRoot.git] / Flugg / FGeometryInit.hh
CommitLineData
26911512 1
2// Flugg tag
3
4// modified 10/IX/99 for including preStepPoint
5// modified 28/IX/99 for delating allocated memory
6// modified 4/X/99 function FreeMemory
7// modified 2/III/00 base class G4TransportationManager included
8// modified 20/III/00 PrintHistories() included
9
10
11#ifndef FGeometryInit_h
12#define FGeometryInit_h 1
13
14//#include "g4std/fstream"
15//#include "g4std/iomanip"
16//#include "g4rw/cstring.h"
17#include "globals.hh"
18
19#include "G4LogicalVolume.hh"
20#include "G4PhysicalVolumeStore.hh"
21#include "G4VPhysicalVolume.hh"
22#include "G4Material.hh"
23#include "G4MaterialTable.hh"
24#include "G4Isotope.hh"
25#include "G4VUserDetectorConstruction.hh"
26#include "G4TouchableHistory.hh"
27#include "G4GeometryManager.hh"
28#include "G4FieldManager.hh"
29#include "G4UniformMagField.hh"
30#include "G4TransportationManager.hh"
31
32
26d97e06 33#include <map>
34
26911512 35class FluggNavigator;
26d97e06 36class FlukaMaterial;
37class FlukaCompound;
38
39class FGeometryInit : public G4TransportationManager {
40
41public:
42 ~FGeometryInit(); //destructor
43 static FGeometryInit *GetInstance();
44 inline FluggNavigator *getNavigatorForTracking();
45 inline G4FieldManager * getFieldManager();
46 inline void setDetConstruction(G4VUserDetectorConstruction* detector);
47 inline void setDetector();
48 inline void setMotherVolume();
49 void createFlukaMatFile();
50 void closeGeometry();
51
52 void PrintHistories();
53 void InitHistories();
54 void DeleteHistories();
55 void UpdateHistories(const G4NavigationHistory *, G4int);
56 inline G4TouchableHistory * GetTouchableHistory();
57 inline G4TouchableHistory * GetOldNavHist();
58 inline G4TouchableHistory * GetTempNavHist();
59
60 void InitHistArray();
61 inline void DelHistArray();
62 inline G4int * GetHistArray();
63
64 void InitJrLtGeantArray();
65 inline G4int * GetJrLtGeantArray();
66 inline G4int GetLttcFlagGeant();
67 void SetLttcFlagGeant(G4int);
bf547b2f 68 void PrintJrLtGeant();
0edf14e7 69 void Init();
bf547b2f 70
71 //Map access methods
1617d9fa 72 void BuildMediaMap();
6a53de92 73 void SetMediumFromName(const char* volName, int med, int volid);
1617d9fa 74 //G4int GetRegionFromName(const char* volName) const;
b9d7c32a 75 int GetLastMaterialIndex() const;
1617d9fa 76 G4int GetMedium(int) const;
6a53de92 77 int CurrentVolID(int ir, int& copyNo);
78 int CurrentVolOffID(int ir, int off, int& copyNo);
dc37cac6 79 void Gmtod(double* xm, double* xd, int iflag);
80 void Gdtom(double* xd, double* xm, int iflag);
26d97e06 81
82protected:
83 void BuildRegionsMap();
0edf14e7 84 void PrintRegionsMap(std::ostream& os);
26d97e06 85 void BuildMaterialTables();
86 FlukaMaterial* BuildFlukaMaterialFromElement(const G4Element* element,
87 G4double matDensity);
88 FlukaMaterial* BuildFlukaMaterialFromIsotope(const G4Isotope* isotope,
89 G4double matDensity);
90 FlukaCompound* BuildFlukaCompoundFromMaterial(const G4Material* material);
91 FlukaCompound* BuildFlukaCompoundFromElement(const G4Element* element,
92 G4double matDensity);
0edf14e7 93 void PrintMaterialTables(std::ostream& os);
94 void PrintAssignmat(std::ostream& os);
95 void PrintMagneticField(std::ostream& os);
26911512 96
26d97e06 97private:
98 FGeometryInit(); //costructor
99
100private:
101 G4VUserDetectorConstruction * fDetector;
102 G4FieldManager * fFieldManager;
103 G4TransportationManager * fTransportationManager;
104 static FGeometryInit *flagInstance;
105 G4VPhysicalVolume * myTopNode;
106 G4GeometryManager * ptrGeoMan;
107 G4int * ptrArray;
108 G4TouchableHistory * ptrTouchHist;
109 G4TouchableHistory * ptrOldNavHist;
110 G4TouchableHistory * ptrTempNavHist;
111 G4int * ptrJrLtGeant;
112 G4int flagLttcGeant;
1617d9fa 113 G4int fNRegions;
114 int* fRegionMediumMap;
115
0edf14e7 116 std::map<G4VPhysicalVolume*, int, std::less<G4VPhysicalVolume*> > fRegionVolumeMap;
117 std::map<G4VPhysicalVolume*, int, std::less<G4VPhysicalVolume*> > fMediumVolumeMap;
118 std::map<G4VPhysicalVolume*, int, std::less<G4VPhysicalVolume*> > fVolIdVolumeMap;
1617d9fa 119
0edf14e7 120 std::map<G4Material*, FlukaMaterial*, std::less<G4Material*> > G4FlukaMaterialMap;
121 std::map<G4Material*, FlukaCompound*, std::less<G4Material*> > G4FlukaCompoundMap;
26d97e06 122 //G4int NOfMaterials;
26911512 123};
124
0edf14e7 125typedef std::map<G4VPhysicalVolume*, int, std::less<G4VPhysicalVolume*> >::const_iterator RegionIterator;
126typedef std::vector<G4Material*>::const_iterator MatTableIterator;
26d97e06 127
26911512 128
129//Include the file with the inline methods
130#include "FGeometryInit.icc"
131
132#endif