Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
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
23const G4String TG4Medium::fgkUndefinedName = "UndefinedMediumName";
24const G4int TG4Medium::fgkDefaultIfield = 1;
25
26//_____________________________________________________________________________
28 : fID(id),
29 fName(fgkUndefinedName),
30 fMaterial(0),
31 fLimits(0),
32 fIfield(fgkDefaultIfield)
33{
35}
36
37//_____________________________________________________________________________
42
43//_____________________________________________________________________________
44void 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//_____________________________________________________________________________
55void 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//_____________________________________________________________________________
68void 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//_____________________________________________________________________________
84{
86
87 // if ( fLimits && fLimits != limits ) {
88 // TG4Globals::Warning(
89 // "TG4Medium", "SetLimits", "Reseting medium limits");
90 //}
91 fLimits = limits;
92}
Definition of the TG4Globals class and basic container types.
Definition of the TG4Limits class.
Definition of the TG4Medium class.
static void Warning(const TString &className, const TString &methodName, const TString &text)
Extended G4UserLimits class.
Definition TG4Limits.h:38
void Print() const
G4UserLimits * fLimits
user limits associated with this medium
Definition TG4Medium.h:66
static const G4int fgkDefaultIfield
the default ifield value
Definition TG4Medium.h:60
static const G4String fgkUndefinedName
the default (undefined) name
Definition TG4Medium.h:59
G4Material * fMaterial
material associated with this medium
Definition TG4Medium.h:65
void Print() const
Definition TG4Medium.cxx:44
G4int fID
medium ID
Definition TG4Medium.h:63
void SetLimits(G4UserLimits *limits)
Definition TG4Medium.cxx:83
G4String fName
medium name
Definition TG4Medium.h:64
void SetMaterial(G4Material *material)
Definition TG4Medium.cxx:68
TG4Medium()
Not implemented.
void SetName(const G4String &name)
Definition TG4Medium.cxx:55