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

#include <G4tgrLineProcessor.hh>

Public Member Functions

 G4tgrLineProcessor ()
 
virtual ~G4tgrLineProcessor ()
 
virtual G4bool ProcessLine (const std::vector< G4String > &wl)
 

Protected Member Functions

G4tgrVolumeFindVolume (const G4String &volname)
 

Detailed Description

Definition at line 50 of file G4tgrLineProcessor.hh.

Constructor & Destructor Documentation

◆ G4tgrLineProcessor()

G4tgrLineProcessor::G4tgrLineProcessor ( )

Definition at line 54 of file G4tgrLineProcessor.cc.

55{
57}
static G4tgrVolumeMgr * GetInstance()

◆ ~G4tgrLineProcessor()

G4tgrLineProcessor::~G4tgrLineProcessor ( )
virtual

Definition at line 61 of file G4tgrLineProcessor.cc.

62{
63}

Member Function Documentation

◆ FindVolume()

G4tgrVolume * G4tgrLineProcessor::FindVolume ( const G4String volname)
protected

Definition at line 320 of file G4tgrLineProcessor.cc.

321{
322 G4tgrVolume* vol = volmgr->FindVolume( volname, 1);
323
324 if( vol->GetType() == "VOLDivision" )
325 {
326 G4Exception("G4tgrLineProcessor::FindVolume()",
327 "InvalidSetup", FatalException,
328 "Using 'PLACE' for a volume created by a division !");
329 }
330
331 return vol;
332}
@ FatalException
G4tgrVolume * FindVolume(const G4String &volname, G4bool exists=false)
const G4String & GetType() const
Definition: G4tgrVolume.hh:91
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by ProcessLine().

◆ ProcessLine()

G4bool G4tgrLineProcessor::ProcessLine ( const std::vector< G4String > &  wl)
virtual

Definition at line 67 of file G4tgrLineProcessor.cc.

68{
69#ifdef G4VERBOSE
71 {
72 G4tgrUtils::DumpVS(wl, "@@@ Processing input line");
73 }
74#endif
75
76 G4String wl0 = wl[0];
77 for( size_t ii = 0; ii < wl0.length(); ii++ )
78 {
79 wl0[ii] = toupper( wl0[ii] );
80 }
81
82 //------------------------------- parameter number
83 if( wl0 == ":P" )
84 {
86
87 //------------------------------- parameter string
88 }
89 else if( wl0 == ":PS" )
90 {
92
93 //------------------------------- isotope
94 }
95 else if( wl0 == ":ISOT" )
96 {
98 ->AddIsotope( wl );
99 volmgr->RegisterMe( isot );
100
101 //------------------------------- element
102 }
103 else if( wl0 == ":ELEM" )
104 {
106 ->AddElementSimple( wl );
107 volmgr->RegisterMe( elem );
108
109 //------------------------------- element from isotopes
110 }
111 else if( wl0 == ":ELEM_FROM_ISOT" )
112 {
113 //:ELEM_FROM_ISOT NAME SYMBOL N_ISOT (ISOT_NAME ISOT_ABUNDANCE)
116 volmgr->RegisterMe( elem );
117
118 //------------------------------- material
119 }
120 else if( wl0 == ":MATE" )
121 {
122
124 ->AddMaterialSimple( wl );
125 volmgr->RegisterMe( mate );
126
127 //------------------------------- material mixtures & by weight
128 }
129 else if( (wl0 == ":MIXT") || (wl0 == ":MIXT_BY_WEIGHT") )
130 {
132 ->AddMaterialMixture( wl, "MaterialMixtureByWeight" );
133 volmgr->RegisterMe( mate );
134
135 //------------------------------- material mixture by number of atoms
136 }
137 else if( wl0 == ":MIXT_BY_NATOMS" )
138 {
140 ->AddMaterialMixture(wl, "MaterialMixtureByNoAtoms");
141 volmgr->RegisterMe( mate );
142
143 //------------------------------- material mixture by volume
144 }
145 else if( wl0 == ":MIXT_BY_VOLUME" )
146 {
148 ->AddMaterialMixture( wl, "MaterialMixtureByVolume" );
149 volmgr->RegisterMe( mate );
150
151 //------------------------------- material Mean Excitation Energy of
152 // Ionisation Potential
153 }
154 else if( wl0 == ":MATE_MEE" )
155 {
158 if( mate == 0 )
159 {
160 G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
162 return false;
163 }
165
166 //------------------------------- material
167 }
168 else if( wl0 == ":MATE_STATE" )
169 {
172 if( mate == 0 )
173 {
174 G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
175 FatalException, wl[1] );
176 }
177 mate->SetState( wl[2] );
178
179 //------------------------------- material
180 }
181 else if( wl0 == ":MATE_TEMPERATURE" )
182 {
185 if( mate == 0 )
186 {
187 G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
188 FatalException, wl[1] );
189 }
190 mate->SetTemperature( G4tgrUtils::GetDouble( wl[2], kelvin ) );
191
192 //------------------------------- material
193 }
194 else if( wl0 == ":MATE_PRESSURE" )
195 {
198 if( mate == 0 )
199 {
200 G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
201 FatalException, wl[1] );
202 }
203 mate->SetPressure( G4tgrUtils::GetDouble( wl[2], atmosphere ) );
204
205 //------------------------------- solid
206 }
207 else if( wl0 == ":SOLID" )
208 { // called from here or from G4tgrVolume::G4tgrVolume
209 volmgr->CreateSolid( wl, 0 );
210
211 //------------------------------- volume
212 }
213 else if( wl0 == ":VOLU" )
214 {
215 G4tgrVolume* vol = new G4tgrVolume( wl );
216 volmgr->RegisterMe( vol );
217
218 //--------------------------------- single placement
219 }
220 else if( wl0 == ":PLACE" )
221 {
223 G4tgrPlace* vpl = vol->AddPlace( wl );
224 volmgr->RegisterMe( vpl );
225
226 //--------------------------------- parameterisation
227 }
228 else if( wl0 == ":PLACE_PARAM" )
229 {
232 volmgr->RegisterMe( vpl );
233
234 //--------------------------------- division
235 }
236 else if( (wl0 == ":DIV_NDIV") || (wl0 == ":DIV_WIDTH")
237 || (wl0 == ":DIV_NDIV_WIDTH") )
238 {
239 //---------- Create G4tgrVolumeDivision and fill the volume params
241 volmgr->RegisterMe( vol );
242
243 //--------------------------------- replica
244 }
245 else if( wl0 == ":REPL" )
246 {
248 G4tgrPlaceDivRep* vpl = vol->AddPlaceReplica( wl );
249 volmgr->RegisterMe( vpl );
250
251 //----------------------------- assembly volume: definition of components
252 }
253 else if( wl0 == ":VOLU_ASSEMBLY" )
254 {
256 volmgr->RegisterMe( vol );
257
258 //----------------------------- assembly volume: definition of components
259 }
260 else if( wl0 == ":PLACE_ASSEMBLY" )
261 {
263 G4tgrPlace* vpl = vol->AddPlace( wl );
264 volmgr->RegisterMe( vpl );
265
266 //--------------------------------- rotation matrix
267 }
268 else if( wl0 == ":ROTM" )
269 {
270 //---------- When second word is ':NEXT/:MNXT' it is used for defining a
271 // rotation matrix that will be used for the next placement/s
273 ->AddRotMatrix( wl );
274 volmgr->RegisterMe( rm );
275
276 //------------------------------- visualisation
277 }
278 else if( wl0 == ":VIS" )
279 {
280 std::vector<G4tgrVolume*> vols =
281 volmgr->FindVolumes( G4tgrUtils::GetString( wl[1] ), 1 );
282 for( size_t ii = 0; ii < vols.size(); ii++ )
283 {
284 vols[ii]->AddVisibility( wl );
285 }
286
287 //--------------------------------- colour
288 }
289 else if( (wl0 == ":COLOUR") || (wl0 == ":COLOR") )
290 {
291 std::vector<G4tgrVolume*> vols =
292 volmgr->FindVolumes( G4tgrUtils::GetString( wl[1] ), 1 );
293 for( size_t ii = 0; ii < vols.size(); ii++ )
294 {
295 vols[ii]->AddRGBColour( wl );
296 }
297
298 //--------------------------------- check overlaps
299 }
300 else if( wl0 == ":CHECK_OVERLAPS" )
301 {
302 std::vector<G4tgrVolume*> vols =
303 volmgr->FindVolumes( G4tgrUtils::GetString( wl[1] ), 1 );
304 for( size_t ii = 0; ii < vols.size(); ii++ )
305 {
306 vols[ii]->AddCheckOverlaps( wl );
307 }
308 //--------------------------------- ERROR
309 }
310 else
311 {
312 return 0;
313 }
314
315 return 1;
316}
G4tgrVolume * FindVolume(const G4String &volname)
G4tgrMaterial * FindMaterial(const G4String &name) const
static G4tgrMaterialFactory * GetInstance()
G4tgrElementFromIsotopes * AddElementFromIsotopes(const std::vector< G4String > &wl)
G4tgrElementSimple * AddElementSimple(const std::vector< G4String > &wl)
G4tgrMaterialMixture * AddMaterialMixture(const std::vector< G4String > &wl, const G4String &mixtType)
G4tgrIsotope * AddIsotope(const std::vector< G4String > &wl)
G4tgrMaterialSimple * AddMaterialSimple(const std::vector< G4String > &wl)
void SetState(G4String val)
void SetTemperature(G4double val)
void SetPressure(G4double val)
void SetIonisationMeanExcitationEnergy(G4double mee)
static G4int GetVerboseLevel()
void AddParameterNumber(const std::vector< G4String > &wl, G4bool mustBeNew=0)
void AddParameterString(const std::vector< G4String > &wl, G4bool mustBeNew=0)
static G4tgrParameterMgr * GetInstance()
G4tgrRotationMatrix * AddRotMatrix(const std::vector< G4String > &wl)
static G4tgrRotationMatrixFactory * GetInstance()
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:178
static void DumpVS(const std::vector< G4String > &wl, const char *msg)
Definition: G4tgrUtils.cc:156
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:203
std::vector< G4tgrVolume * > FindVolumes(const G4String &volname, G4bool exists)
void RegisterMe(G4tgrSolid *vol)
G4tgrSolid * CreateSolid(const std::vector< G4String > &wl, G4bool bVOLUtag)
virtual G4tgrPlace * AddPlace(const std::vector< G4String > &wl)
Definition: G4tgrVolume.cc:138
G4tgrPlaceParameterisation * AddPlaceParam(const std::vector< G4String > &wl)
Definition: G4tgrVolume.cc:218
G4tgrPlaceDivRep * AddPlaceReplica(const std::vector< G4String > &wl)
Definition: G4tgrVolume.cc:180

Referenced by G4tgrFileReader::ReadFiles().


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