Geant4 VMC
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
source
geometry
src
TG4Medium.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Geant4 Virtual Monte Carlo package
3
// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4
// All rights reserved.
5
//
6
// For the licensing terms see geant4_vmc/LICENSE.
7
// Contact: root-vmc@cern.ch
8
//-------------------------------------------------
9
14
15
#include "
TG4Medium.h
"
16
#include "
TG4Globals.h
"
17
#include "
TG4Limits.h
"
18
19
#include <G4LogicalVolume.hh>
20
#include <G4Material.hh>
21
#include <G4UserLimits.hh>
22
23
const
G4String
TG4Medium::fgkUndefinedName
=
"UndefinedMediumName"
;
24
const
G4int
TG4Medium::fgkDefaultIfield
= 1;
25
26
//_____________________________________________________________________________
27
TG4Medium::TG4Medium
(G4int
id
)
28
:
fID
(id),
29
fName
(
fgkUndefinedName
),
30
fMaterial
(0),
31
fLimits
(0),
32
fIfield
(
fgkDefaultIfield
)
33
{
35
}
36
37
//_____________________________________________________________________________
38
TG4Medium::~TG4Medium
()
39
{
41
}
42
43
//_____________________________________________________________________________
44
void
TG4Medium::Print
()
const
45
{
47
48
G4cout <<
"ID = "
<<
fID
<<
" name = "
<<
fName
<<
" limits = "
<<
fLimits
;
49
50
TG4Limits
* limits =
dynamic_cast<
TG4Limits
*
>
(
fLimits
);
51
if
(limits) limits->
Print
();
52
}
53
54
//_____________________________________________________________________________
55
void
TG4Medium::SetName
(
const
G4String& name)
56
{
59
60
if
(
fName
!=
fgkUndefinedName
&&
fName
!= name) {
61
TG4Globals::Warning
(
"TG4Medium"
,
"SetName"
,
62
"Reseting name "
+ TString(
fName
) +
" to "
+ TString(name));
63
}
64
fName
= name;
65
}
66
67
//_____________________________________________________________________________
68
void
TG4Medium::SetMaterial
(G4Material* material)
69
{
72
73
if
(
fMaterial
&&
fMaterial
!= material) {
74
G4cout <<
fMaterial
->GetName() <<
" "
<< material->GetName() << G4endl;
75
TG4Globals::Warning
(
"TG4Medium"
,
"SetMaterial"
,
76
"Reseting material "
+ TString(
fMaterial
->GetName()) +
" to "
+
77
TString(material->GetName()));
78
}
79
fMaterial
= material;
80
}
81
82
//_____________________________________________________________________________
83
void
TG4Medium::SetLimits
(
G4UserLimits
* limits)
84
{
86
87
// if ( fLimits && fLimits != limits ) {
88
// TG4Globals::Warning(
89
// "TG4Medium", "SetLimits", "Reseting medium limits");
90
//}
91
fLimits
= limits;
92
}
TG4Globals.h
Definition of the TG4Globals class and basic container types.
TG4Limits.h
Definition of the TG4Limits class.
TG4Medium.h
Definition of the TG4Medium class.
G4UserLimits
TG4Globals::Warning
static void Warning(const TString &className, const TString &methodName, const TString &text)
Definition
TG4Globals.cxx:48
TG4Limits
Extended G4UserLimits class.
Definition
TG4Limits.h:38
TG4Limits::Print
void Print() const
Definition
TG4Limits.cxx:265
TG4Medium::fLimits
G4UserLimits * fLimits
user limits associated with this medium
Definition
TG4Medium.h:66
TG4Medium::fgkDefaultIfield
static const G4int fgkDefaultIfield
the default ifield value
Definition
TG4Medium.h:60
TG4Medium::fgkUndefinedName
static const G4String fgkUndefinedName
the default (undefined) name
Definition
TG4Medium.h:59
TG4Medium::~TG4Medium
~TG4Medium()
Definition
TG4Medium.cxx:38
TG4Medium::fMaterial
G4Material * fMaterial
material associated with this medium
Definition
TG4Medium.h:65
TG4Medium::Print
void Print() const
Definition
TG4Medium.cxx:44
TG4Medium::fID
G4int fID
medium ID
Definition
TG4Medium.h:63
TG4Medium::SetLimits
void SetLimits(G4UserLimits *limits)
Definition
TG4Medium.cxx:83
TG4Medium::fName
G4String fName
medium name
Definition
TG4Medium.h:64
TG4Medium::SetMaterial
void SetMaterial(G4Material *material)
Definition
TG4Medium.cxx:68
TG4Medium::TG4Medium
TG4Medium()
Not implemented.
TG4Medium::SetName
void SetName(const G4String &name)
Definition
TG4Medium.cxx:55
TG4Medium::fIfield
G4int fIfield
Definition
TG4Medium.h:74
Generated on
for Geant4 VMC by
1.17.0