Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4GeometryManager.h
Go to the documentation of this file.
1#ifndef TG4_GEOMETRY_MANAGER_H
2#define TG4_GEOMETRY_MANAGER_H
3
4//------------------------------------------------
5// The Geant4 Virtual Monte Carlo package
6// Copyright (C) 2007 - 2015 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
17
19#include "TG4FieldParameters.h"
20#include "TG4Globals.h"
21#include "TG4Verbose.h"
22
23#include <vector>
24
25class TG4Field;
30class TG4G3CutVector;
35class TG4RootDetectorConstruction;
36
37class G4LogicalVolume;
39class G4MagIntegratorStepper;
40
42class TVirtualMagField;
43
49
51{
52 public:
53 TG4GeometryManager(const TString& userGeometry);
54 virtual ~TG4GeometryManager();
55
56 // static access method
58
63
64 // functions for building geometry
65 void ConstructGeometry();
67 void FinishGeometry();
68 void UpdateField();
69 void CreateFieldParameters(const G4String& fieldVolName);
70 TG4RadiatorDescription* CreateRadiator(const G4String& volName);
71 void SetUserLimits(
72 const TG4G3CutVector& cuts, const TG4G3ControlVector& controls) const;
73 void SetIsLocalField(G4bool isLocalField);
74 void SetIsZeroField(G4bool isZeroField);
75 void SetIsUserMaxStep(G4bool isUserMaxStep);
76 void SetIsMaxStepInLowDensityMaterials(G4bool isMaxStep);
77
78 // set Root detector construction
80 TG4RootDetectorConstruction* rootDetectorConstruction);
81 // set user region construction
83 TG4VUserRegionConstruction* userRegionConstruction);
85 TG4VUserPostDetConstruction* userPostDetConstruction);
87 G4EquationOfMotion* equation, G4String volumeName = "");
88 void SetUserStepper(
89 G4MagIntegratorStepper* stepper, G4String volumeName = "");
90
91 void SetLimitDensity(G4double density);
92 void SetMaxStepInLowDensityMaterials(G4double maxStep);
93
94 // printing
95 void PrintFieldStatistics() const;
96
97 // get methods
98 const std::vector<TG4RadiatorDescription*>& GetRadiators() const;
99
100 private:
105
106 // methods
107 void CreateMCGeometry();
110 void ConstructG4Geometry();
111 void FillMediumMapFromG3();
112 void FillMediumMapFromG4();
114 void FillMediumMap();
115 TG4FieldParameters* GetOrCreateFieldParameters(const G4String& volumeName);
116 void CreateField(TVirtualMagField* magField,
117 TG4FieldParameters* fieldParameters, G4LogicalVolume* lv);
119 void ConstructZeroFields();
121
122 // static data members
124
126 static const G4double fgDefaultLimitDensity;
127
129 static const G4double fgDefaultMaxStep;
130
131 // data members
135 TG4RootDetectorConstruction* fRootDetectorConstruction;
137
140
143
146
149
151 std::vector<TG4FieldParameters*> fFieldParameters;
152
154 static G4ThreadLocal std::vector<TG4Field*>* fgFields;
155
157 std::vector<TG4RadiatorDescription*> fRadiators;
158
161
164
167
170
173
176
179
182
185};
186
187// inline methods
188
194
200
207
214
216 TG4RootDetectorConstruction* rootDetectorConstruction)
217{
219 fRootDetectorConstruction = rootDetectorConstruction;
220}
221
222inline void TG4GeometryManager::SetLimitDensity(G4double density)
223{
225 fLimitDensity = density;
226}
227
229 G4double maxStep)
230{
233}
234
235inline const std::vector<TG4RadiatorDescription*>&
237{
239 return fRadiators;
240}
241
242#endif // TG4_GEOMETRY_MANAGER_H
Definition of the TG4DetConstructionMessenger class.
Definition of the TG4FieldParameters class.
Definition of the TG4Globals class and basic container types.
Definition of the TG4Verbose class.
The biasing manager.
Messenger class that defines commands for TG4DetConstruction.
The magnetic field parameters.
The class for constructing magnetic, electromagnetic and gravity fields which strength is defined via...
Definition TG4Field.h:48
Vector of control process values with convenient set/get methods.
Vector of kinetic energy cut values with convenient set/get methods.
The manager class for building Geant4 geometry depending on a selected user input.
G4bool fIsZeroField
option to activate propagating 'ifield = 0' defined in tracking media
static const G4double fgDefaultMaxStep
default max allowed step in materials with density < fLimitDensity
static TG4GeometryManager * fgInstance
this instance
G4bool fIsLocalField
option to activate getting local magnetic fields from Root geometry
TG4BiasingManager * fBiasingManager
Biasing manager.
TG4ModelConfigurationManager * fFastModelsManager
Fast simulation models manager.
TVirtualMCGeometry * GetMCGeometry() const
G4bool fIsCachedMagneticField
info if a cached magnetic field is in use
static G4ThreadLocal std::vector< TG4Field * > * fgFields
Fields.
void CreateField(TVirtualMagField *magField, TG4FieldParameters *fieldParameters, G4LogicalVolume *lv)
TG4GeometryManager & operator=(const TG4GeometryManager &right)
Not implemented.
void SetIsLocalField(G4bool isLocalField)
TG4FieldParameters * GetOrCreateFieldParameters(const G4String &volumeName)
void SetIsMaxStepInLowDensityMaterials(G4bool isMaxStep)
TG4DetConstructionMessenger fMessenger
messenger
std::vector< TG4FieldParameters * > fFieldParameters
Field parameters.
TG4GeometryManager(const TString &userGeometry)
void SetUserEquationOfMotion(G4EquationOfMotion *equation, G4String volumeName="")
void SetUserPostDetConstruction(TG4VUserPostDetConstruction *userPostDetConstruction)
TG4GeometryServices * fGeometryServices
geometry services
TG4ModelConfigurationManager * GetEmModelsManager() const
G4bool fIsUserMaxStep
option to activate max step defined in tracking media
void SetRootDetectorConstruction(TG4RootDetectorConstruction *rootDetectorConstruction)
void SetIsZeroField(G4bool isZeroField)
void CreateFieldParameters(const G4String &fieldVolName)
G4double fLimitDensity
material density limit for setting max allowed step
TG4ModelConfigurationManager * GetFastModelsManager() const
TG4OpGeometryManager * fOpManager
optical geometry manager
G4bool fIsMaxStepInLowDensityMaterials
option to activate max step defined in low density materials
TG4VUserRegionConstruction * fUserRegionConstruction
User region construction.
TG4RadiatorDescription * CreateRadiator(const G4String &volName)
TG4ModelConfigurationManager * fEmModelsManager
EM models manager.
void SetUserRegionConstruction(TG4VUserRegionConstruction *userRegionConstruction)
std::vector< TG4RadiatorDescription * > fRadiators
Radiators.
void SetMaxStepInLowDensityMaterials(G4double maxStep)
TG4RootDetectorConstruction * fRootDetectorConstruction
Root detector construction.
static const G4double fgDefaultLimitDensity
default material density limit for setting max allowed step
static TG4GeometryManager * Instance()
void SetIsUserMaxStep(G4bool isUserMaxStep)
void SetUserLimits(const TG4G3CutVector &cuts, const TG4G3ControlVector &controls) const
TG4GeometryManager(const TG4GeometryManager &right)
Not implemented.
void SetLimitDensity(G4double density)
TG4VUserPostDetConstruction * fUserPostDetConstruction
User post detector construction.
const std::vector< TG4RadiatorDescription * > & GetRadiators() const
G4String fUserGeometry
User geometry input.
TG4OpGeometryManager * GetOpManager() const
void SetUserStepper(G4MagIntegratorStepper *stepper, G4String volumeName="")
G4double fMaxStepInLowDensityMaterials
max allowed step in materials with density < fLimitDensity
TVirtualMCGeometry * fMCGeometry
VirtualMC geometry.
Services for accessing to Geant4 geometry.
The model configuration vector with suitable setters and a messenger.
Geant4 implementation of the TVirtualMC interface methods for definition of material properties for o...
The radiator description.
The abstract base class for user defined class to customize geometry.
The abstract base class for user defined regions.
Base class for defining the verbose level and a common messenger.
Definition TG4Verbose.h:36