27#include <G4EllipticalTube.hh>
29#include <G4LogicalBorderSurface.hh>
30#include <G4LogicalSkinSurface.hh>
31#include <G4LogicalVolume.hh>
32#include <G4Material.hh>
33#include <G4MaterialPropertiesTable.hh>
34#include <G4MaterialTable.hh>
35#include <G4OpticalSurface.hh>
37#include <G4Polycone.hh>
38#include <G4Polyhedra.hh>
39#include <G4ReflectedSolid.hh>
41#include <G4SystemOfUnits.hh>
43#include <G4Transform3D.hh>
47#include <G4TwistedTrap.hh>
55 :
TG4Verbose(
"opGeometryManager"), fGeometryServices(0), fOpSurfaceMap(0)
62 "TG4GeometryServices have to be defined first");
79 const G4String& propertyName, Double_t value)
const
87 if (propertyName ==
"ABSLENGTH" ||
88 propertyName ==
"RAYLEIGH" ||
89 propertyName ==
"WLSABSLENGTH" ||
90 propertyName ==
"WLSABSLENGTH2" ||
91 propertyName ==
"MIEHG") {
95 if (propertyName ==
"BIRKS_CONSTANT") {
100 if (propertyName ==
"ALPHASCINTILLATIONYIELD" ||
101 propertyName ==
"DEUTERONSCINTILLATIONYIELD" ||
102 propertyName ==
"ELECTRONSCINTILLATIONYIELD" ||
103 propertyName ==
"IONSCINTILLATIONYIELD" ||
104 propertyName ==
"PROTONSCINTILLATIONYIELD" ||
105 propertyName ==
"SCINTILLATIONYIELD" ||
106 propertyName ==
"TRITONSCINTILLATIONYIELD") {
111 if (propertyName ==
"SCINTILLATIONRISETIME1" ||
112 propertyName ==
"SCINTILLATIONRISETIME2" ||
113 propertyName ==
"SCINTILLATIONRISETIME3" ||
114 propertyName ==
"SCINTILLATIONTIMECONSTANT1" ||
115 propertyName ==
"SCINTILLATIONTIMECONSTANT2" ||
116 propertyName ==
"SCINTILLATIONTIMECONSTANT3" ||
117 propertyName ==
"WLSTIMECONSTANT" ||
118 propertyName ==
"WLSTIMECONSTANT2") {
123 if (propertyName ==
"ISOTHERMAL_COMPRESSIBILITY" ) {
127 if (propertyName ==
"ALPHASCINTILLATIONYIELD1" ||
128 propertyName ==
"ALPHASCINTILLATIONYIELD2" ||
129 propertyName ==
"ALPHASCINTILLATIONYIELD3" ||
130 propertyName ==
"DEUTERONCINTILLATIONYIELD1" ||
131 propertyName ==
"DEUTERONCINTILLATIONYIELD2" ||
132 propertyName ==
"DEUTERONCINTILLATIONYIELD3" ||
133 propertyName ==
"ELECTRONINTILLATIONYIELD1" ||
134 propertyName ==
"ELECTRONINTILLATIONYIELD2" ||
135 propertyName ==
"ELECTRONINTILLATIONYIELD3" ||
136 propertyName ==
"IONSCINTILLATIONYIELD1" ||
137 propertyName ==
"IONSCINTILLATIONYIELD2" ||
138 propertyName ==
"IONSCINTILLATIONYIELD3" ||
139 propertyName ==
"PROTONSCINTILLATIONYIELD1" ||
140 propertyName ==
"PROTONSCINTILLATIONYIELD2" ||
141 propertyName ==
"PROTONSCINTILLATIONYIELD3" ||
142 propertyName ==
"RESOLUTIONSCALE" ||
143 propertyName ==
"SCINTILLATIONCOMPONENT1" ||
144 propertyName ==
"SCINTILLATIONCOMPONENT2" ||
145 propertyName ==
"SCINTILLATIONCOMPONENT3" ||
146 propertyName ==
"SCINTILLATIONYIELD1" ||
147 propertyName ==
"SCINTILLATIONYIELD2" ||
148 propertyName ==
"SCINTILLATIONYIELD3" ||
149 propertyName ==
"TRITONSCINTILLATIONYIELD1" ||
150 propertyName ==
"TRITONSCINTILLATIONYIELD2" ||
151 propertyName ==
"TRITONSCINTILLATIONYIELD3" ||
152 propertyName ==
"RS_SCALE_FACTOR" ||
153 propertyName ==
"WLSCOMPONENT" ||
154 propertyName ==
"WLSCOMPONENT2" ||
155 propertyName ==
"WLSMEANNUMBERPHOTONS" ||
156 propertyName ==
"WLSMEANNUMBERPHOTONS2" ||
157 propertyName ==
"MIEHG_BACKWARD" ||
158 propertyName ==
"MIEHG_FORWARD" ||
159 propertyName ==
"MIEHG_FORWARD_RATIO" ||
160 propertyName ==
"BACKSCATTERCONSTANT" ||
161 propertyName ==
"EFFICIENCY" ||
162 propertyName ==
"GROUPVEL" ||
163 propertyName ==
"IMAGINARYRINDEX" ||
164 propertyName ==
"REFLECTIVITY" ||
165 propertyName ==
"REALRINDEX" ||
166 propertyName ==
"RINDEX" ||
167 propertyName ==
"SPECULARLOBECONSTANT" ||
168 propertyName ==
"SPECULARSPIKECONSTANT" ||
169 propertyName ==
"SURFACEROUGHNESS" ||
170 propertyName ==
"TRANSMITTANCE") {
176 TString text =
"Unknown material property ";
177 text += propertyName.data();
179 text +=
"No units conversion performed.";
190 Float_t* ppckov, Float_t* absco, Float_t* effic, Float_t* rindex,
191 Bool_t aspline, Bool_t rspline)
217 itmed, npckov, ppckovDbl, abscoDbl, efficDbl, rindexDbl, aspline, rspline);
227 Double_t* ppckov, Double_t* absco, Double_t* , Double_t* rindex,
228 Bool_t aspline, Bool_t rspline)
249 G4bool isRindex =
false;
252 for (G4int i = 0; i < npckov; i++) {
255 if (rindex[i] != 0.0) isRindex =
true;
261 TString text =
"Medium ";
263 text +=
" not found.";
273 G4MaterialPropertiesTable* table = material->GetMaterialPropertiesTable();
275 table =
new G4MaterialPropertiesTable();
276 material->SetMaterialPropertiesTable(table);
280 table->AddProperty(
"ABSLENGTH", ppckov2, absco2, npckov,
false, aspline);
291 table->AddProperty(
"RINDEX", ppckov2, rindex, npckov,
false, rspline);
300 G4cout <<
"The tables for UV photon tracking set for "
301 << material->GetName() << G4endl;
307 EMCOpSurfaceModel model, EMCOpSurfaceType surfaceType,
308 EMCOpSurfaceFinish surfaceFinish, Double_t sigmaAlpha)
316 new G4OpticalSurface(name, g4Model, g4Finish, g4Type, sigmaAlpha);
319 (*fOpSurfaceMap)[name] = surface;
324 const char* vol1Name,
int vol1CopyNo,
const char* vol2Name,
int vol2CopyNo,
325 const char* opSurfaceName)
330 G4VPhysicalVolume* pv1 =
332 G4VPhysicalVolume* pv2 =
338 text = TString(
"Cannot find physical volume: ") + vol1Name;
341 if (!pv2) text += TString(
"Cannot find physical volume: ") + vol2Name;
347 TG4OpSurfaceMap::iterator it =
fOpSurfaceMap->find(opSurfaceName);
350 TString(
"Cannot find optical surface: ") + opSurfaceName);
353 G4OpticalSurface* surface = (*it).second;
356 new G4LogicalBorderSurface(name, pv1, pv2, surface);
361 const char* name,
const char* volName,
const char* opSurfaceName)
370 "SetSkinSurface:",
"Cannot find logical volume: " + TString(volName));
375 TG4OpSurfaceMap::iterator it =
fOpSurfaceMap->find(opSurfaceName);
378 "Cannot find optical surface: " + TString(opSurfaceName));
381 G4OpticalSurface* surface = (*it).second;
384 new G4LogicalSkinSurface(name, lv, surface);
389 const char* propertyName, Int_t np, Double_t* pp, Double_t* values,
390 Bool_t createNewKey, Bool_t spline)
398 TString text =
"Medium ";
400 text +=
"not found.";
408 G4MaterialPropertiesTable* table = material->GetMaterialPropertiesTable();
410 table =
new G4MaterialPropertiesTable();
411 material->SetMaterialPropertiesTable(table);
417 for (G4int i = 0; i < np; i++) {
419 val2[i] =
AddUnit(propertyName, values[i]);
421 table->AddProperty(propertyName, pp2, val2, np, createNewKey, spline);
428 G4cout <<
"The material properties " << propertyName <<
" set for "
429 << material->GetName() << G4endl;
435 Int_t itmed,
const char* propertyName, Double_t value)
443 TString text =
"Medium ";
445 text +=
"not found.";
453 G4MaterialPropertiesTable* table = material->GetMaterialPropertiesTable();
455 table =
new G4MaterialPropertiesTable();
456 material->SetMaterialPropertiesTable(table);
460 value =
AddUnit(propertyName, value);
463 if (G4String(propertyName) ==
"BIRKS_CONSTANT") {
464 material->GetIonisation()->SetBirksConstant(value);
467 table->AddConstProperty(propertyName, value);
472 G4cout <<
"The material property " << propertyName <<
" set for "
473 << material->GetName() << G4endl;
479 const char* propertyName, Int_t np, Double_t* pp, Double_t* values,
480 Bool_t createNewKey, Bool_t spline)
487 TG4OpSurfaceMap::iterator it =
fOpSurfaceMap->find(surfaceName);
490 "Cannot find optical surface: " + TString(surfaceName));
493 G4OpticalSurface* surface = (*it).second;
497 G4MaterialPropertiesTable* table = surface->GetMaterialPropertiesTable();
499 table =
new G4MaterialPropertiesTable();
500 surface->SetMaterialPropertiesTable(table);
506 for (G4int i = 0; i < np; i++) {
508 val2[i] =
AddUnit(propertyName, values[i]);
510 table->AddProperty(propertyName, pp2, val2, np, createNewKey, spline);
516 G4cout <<
"The material properties " << propertyName
517 <<
" set for optical surface " << surface->GetName() << G4endl;
523 Float_t& z, Float_t& dens, Float_t& radl, Float_t& absl, Float_t* ubuf,
528 G4double da, dz, ddens, dradl, dabsl;
530 Gfmate(imat, name, da, dz, ddens, dradl, dabsl, dubuf, nbuf);
537 for (Int_t i = 0; i < nbuf; i++) ubuf[i] = dubuf[i];
542 Double_t& z, Double_t& dens, Double_t& radl, Double_t& absl,
543 Double_t* , Int_t& nbuf)
548 "Deprecated function - now replaced with GetMaterial(Int_t imat, ...)");
550 G4Material* material = G4Material::GetMaterialTable()->at(imat - 1);
553 const char* chName = material->GetName();
554 strcpy(name, chName);
558 dens = material->GetDensity();
561 radl = material->GetRadlen();
569 TString text =
"Material ";
571 text +=
" has not been found.";
578 Double_t& z, Double_t& density, Double_t& radl, Double_t& inter, TArrayD& par)
583 G4Material* material = G4Material::GetMaterialTable()->at(imat - 1);
586 TString text =
"Material ";
588 text +=
" has not been found.";
593 name = material->GetName();
597 density = material->GetDensity();
600 radl = material->GetRadlen();
Definition of the TG4G3ControlVector class.
Definition of the TG4G3CutVector class.
Definition of the TG4G3Units class.
Definition of the TG4GeometryServices class.
Definition of the TG4Globals class and basic container types.
Definition of the TG4Limits class.
Definition of the TG4MediumMap class.
Definition of the TG4Medium class.
Definition of the TG4OpGeometryManager class.
static G4double InverseEnergy()
static G4double MassDensity()
G4OpticalSurfaceFinish SurfaceFinish(EMCOpSurfaceFinish finish) const
G4double * CreateG4doubleArray(Float_t *array, G4int size, G4bool copyValues=true) const
G4LogicalVolume * FindLogicalVolume(const G4String &name, G4bool silent=false) const
static TG4GeometryServices * Instance()
G4SurfaceType SurfaceType(EMCOpSurfaceType surfType) const
G4VPhysicalVolume * FindPhysicalVolume(const G4String &name, G4int copyNo, G4bool silent=false) const
G4double GetEffA(G4Material *material) const
G4OpticalSurfaceModel SurfaceModel(EMCOpSurfaceModel model) const
TG4MediumMap * GetMediumMap() const
TG4OpSurfaceMap * GetOpSurfaceMap() const
G4double GetEffZ(G4Material *material) const
static void Warning(const TString &className, const TString &methodName, const TString &text)
static void Exception(const TString &className, const TString &methodName, const TString &text)
TG4Medium * GetMedium(G4int mediumID, G4bool warn=true) const
Helper class to keep medium data.
G4Material * GetMaterial() const
virtual void SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov, Float_t *absco, Float_t *effic, Float_t *rindex, Bool_t aspline, Bool_t rspline)
virtual Bool_t GetMaterial(Int_t imat, TString &name, Double_t &a, Double_t &z, Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par)
TG4OpSurfaceMap * fOpSurfaceMap
map of optical surfaces names to their objects
virtual void SetMaterialProperty(Int_t itmed, const char *propertyName, Int_t np, Double_t *pp, Double_t *values, Bool_t createNewKey, Bool_t spline)
virtual void Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl, Float_t *ubuf, Int_t &nbuf)
virtual void SetSkinSurface(const char *name, const char *volName, const char *opSurfaceName)
TG4GeometryServices * fGeometryServices
geometry services
Double_t AddUnit(const G4String &propertyName, Double_t value) const
virtual void SetBorderSurface(const char *name, const char *vol1Name, int vol1CopyNo, const char *vol2Name, int vol2CopyNo, const char *opSurfaceName)
virtual ~TG4OpGeometryManager()
virtual void DefineOpSurface(const char *name, EMCOpSurfaceModel model, EMCOpSurfaceType surfaceType, EMCOpSurfaceFinish surfaceFinish, Double_t sigmaAlpha)
Base class for defining the verbose level and a common messenger.
virtual G4int VerboseLevel() const