Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4tgrVolumeDivision Class Reference

#include <G4tgrVolumeDivision.hh>

+ Inheritance diagram for G4tgrVolumeDivision:

Public Member Functions

 G4tgrVolumeDivision (const std::vector< G4String > &wl)
 
 ~G4tgrVolumeDivision ()
 
G4bool SetSolid (G4tgrVolume *parentDU, G4bool byStep, EAxis axis, G4double div_step, G4double offset)
 
G4tgrPlaceDivRepGetPlaceDivision ()
 
- Public Member Functions inherited from G4tgrVolume
 G4tgrVolume ()
 
 G4tgrVolume (const std::vector< G4String > &wl)
 
 G4tgrVolume (const G4tgrVolume &vol)
 
virtual ~G4tgrVolume ()
 
virtual G4tgrPlaceAddPlace (const std::vector< G4String > &wl)
 
G4tgrPlaceDivRepAddPlaceReplica (const std::vector< G4String > &wl)
 
G4tgrPlaceParameterisationAddPlaceParam (const std::vector< G4String > &wl)
 
void AddVisibility (const std::vector< G4String > &wl)
 
void AddRGBColour (const std::vector< G4String > &wl)
 
void AddCheckOverlaps (const std::vector< G4String > &wl)
 
const G4StringGetName () const
 
void SetName (const G4String &name)
 
const G4StringGetType () const
 
G4tgrSolidGetSolid () const
 
const G4StringGetMaterialName () const
 
const std::vector< G4tgrPlace * > GetPlacements () const
 
G4bool GetVisibility () const
 
G4doubleGetColour () const
 
G4doubleGetRGBColour () const
 
G4bool GetCheckOverlaps () const
 
virtual G4tgrVolumeGetVolume (G4int ii) const
 

Static Public Member Functions

static void SetSupportedAxis ()
 

Friends

std::ostream & operator<< (std::ostream &os, const G4tgrVolumeDivision &obj)
 

Additional Inherited Members

- Protected Attributes inherited from G4tgrVolume
G4String theName
 
G4String theType
 
G4String theMaterialName
 
G4tgrSolidtheSolid
 
std::vector< G4tgrPlace * > thePlacements
 
G4bool theVisibility
 
G4doubletheRGBColour
 
G4bool theCheckOverlaps
 

Detailed Description

Definition at line 59 of file G4tgrVolumeDivision.hh.

Constructor & Destructor Documentation

◆ G4tgrVolumeDivision()

G4tgrVolumeDivision::G4tgrVolumeDivision ( const std::vector< G4String > &  wl)

Definition at line 57 of file G4tgrVolumeDivision.cc.

58{
59 // wl: NAME PARENT MATERIAL AXIS STEP/NDIV OFFSET
60
62 "G4tgrVolumeDivision::G4tgrVolumeDivision" );
64 "G4tgrVolumeDivision::G4tgrVolumeDivision" );
65
66 theType = "VOLDivision";
67
68 // :DIV NAME PARENT MATERIAL AXIS STEP/NDIV OFFSET
69
70 //---------- set name
72
73 //---------- set the pointer to the parent DU
74 G4String parentName = G4tgrUtils::GetString(wl[2]);
75 G4tgrVolumeMgr::GetInstance()->FindVolume( parentName, 1); // check existance
76
77 //---------- initialize G4tgrPlace
78 thePlaceDiv = new G4tgrPlaceDivRep();
79 thePlaceDiv->SetParentName( parentName );
80 thePlaceDiv->SetType("PlaceDivision");
81 thePlaceDiv->SetVolume( this );
82
83 //---------- set material name
85
86 //----- set axis of replica
87 thePlaceDiv->SetAxis( thePlaceDiv->BuildAxis(G4tgrUtils::GetString(wl[4])) );
88
89 //------ register parent - child
90 G4tgrVolumeMgr::GetInstance()->RegisterParentChild( parentName, thePlaceDiv );
91#ifdef G4VERBOSE
93 {
94 G4cout << " G4tgrVolumeDivision::G4tgrVolumeDivision() -"
95 << " Replica register parent - child " << G4endl;
96 }
97#endif
98
99 //---------- set if division is given by number of divisions of by width
100 G4String wl0 = wl[0];
101 for( size_t ii = 0; ii < wl0.length(); ii++ )
102 {
103 wl0[ii] = toupper( wl0[ii] );
104 }
105
106 if( wl0 == ":DIV_NDIV" )
107 {
108 thePlaceDiv->SetDivType( DivByNdiv );
109 thePlaceDiv->SetNDiv( G4tgrUtils::GetInt( wl[5] ) );
110 if( wl.size() == 7 )
111 {
112 thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[6] )*mm );
113 }
114 }
115 else if( wl0 == ":DIV_WIDTH" )
116 {
117 thePlaceDiv->SetDivType( DivByWidth );
118 thePlaceDiv->SetWidth( G4tgrUtils::GetDouble( wl[5] )*mm );
119 if( wl.size() == 7 )
120 {
121 thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[6] )*mm );
122 }
123 }
124 else if( wl0 == ":DIV_NDIV_WIDTH" )
125 {
126 thePlaceDiv->SetDivType( DivByNdivAndWidth );
127 thePlaceDiv->SetNDiv( G4tgrUtils::GetInt( wl[5] ) );
128 thePlaceDiv->SetWidth( G4tgrUtils::GetDouble( wl[6] )*mm );
129 if( wl.size() == 8 )
130 {
131 thePlaceDiv->SetOffset( G4tgrUtils::GetDouble( wl[7] )*mm );
132 }
133 }
134 else
135 {
136 G4String ErrMessage = "Division type not supported, sorry... " + wl[0];
137 G4Exception("G4tgrVolumeDivision::G4tgrVolumeDivision()",
138 "NotImplemented", FatalException, ErrMessage);
139 }
140
141 theVisibility = 1;
142 theRGBColour = new G4double[3];
143 for(size_t ii=0; ii<3; ii++) { theRGBColour[ii] = -1.; }
144
145#ifdef G4VERBOSE
147 {
148 G4cout << " Created " << *this << G4endl;
149 }
150#endif
151
152 theSolid = 0;
153}
@ FatalException
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
@ DivByNdiv
@ DivByWidth
@ DivByNdivAndWidth
@ WLSIZE_GE
Definition: G4tgrUtils.hh:52
@ WLSIZE_LE
Definition: G4tgrUtils.hh:52
static G4int GetVerboseLevel()
void SetDivType(G4DivType typ)
void SetParentName(const G4String &parentName)
void SetAxis(EAxis axis)
void SetNDiv(G4int ndiv)
void SetWidth(G4double width)
void SetOffset(G4double offset)
EAxis BuildAxis(const G4String &axisName)
void SetType(const G4String &typ)
Definition: G4tgrPlace.hh:63
void SetVolume(G4tgrVolume *vol)
Definition: G4tgrPlace.hh:62
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:178
static void CheckWLsize(const std::vector< G4String > &wl, unsigned int nWCheck, WLSIZEtype st, const G4String &methodName)
Definition: G4tgrUtils.cc:472
static G4int GetInt(const G4String &str)
Definition: G4tgrUtils.cc:427
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:203
G4tgrVolume * FindVolume(const G4String &volname, G4bool exists=false)
void RegisterParentChild(const G4String &parentName, const G4tgrPlace *pl)
static G4tgrVolumeMgr * GetInstance()
G4String theMaterialName
Definition: G4tgrVolume.hh:112
G4String theType
Definition: G4tgrVolume.hh:110
G4String theName
Definition: G4tgrVolume.hh:108
G4tgrSolid * theSolid
Definition: G4tgrVolume.hh:114
G4bool theVisibility
Definition: G4tgrVolume.hh:119
G4double * theRGBColour
Definition: G4tgrVolume.hh:120
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ ~G4tgrVolumeDivision()

G4tgrVolumeDivision::~G4tgrVolumeDivision ( )

Definition at line 51 of file G4tgrVolumeDivision.cc.

52{
53}

Member Function Documentation

◆ GetPlaceDivision()

G4tgrPlaceDivRep * G4tgrVolumeDivision::GetPlaceDivision ( )
inline

Definition at line 73 of file G4tgrVolumeDivision.hh.

73{ return thePlaceDiv; }

Referenced by G4tgbVolume::ConstructG4PhysVol().

◆ SetSolid()

G4bool G4tgrVolumeDivision::SetSolid ( G4tgrVolume parentDU,
G4bool  byStep,
EAxis  axis,
G4double  div_step,
G4double  offset 
)

◆ SetSupportedAxis()

static void G4tgrVolumeDivision::SetSupportedAxis ( )
static

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const G4tgrVolumeDivision obj 
)
friend

Definition at line 157 of file G4tgrVolumeDivision.cc.

158{
159 os << "G4tgrVolumeDivision= " << obj.theName
160 << " Placement= " << *(obj.thePlaceDiv) << G4endl;
161
162 return os;
163}

The documentation for this class was generated from the following files: