Geant4-11
Public Member Functions | Protected Member Functions | Private Attributes
G4tgrLineProcessor Class Reference

#include <G4tgrLineProcessor.hh>

Public Member Functions

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

Protected Member Functions

G4tgrVolumeFindVolume (const G4String &volname)
 

Private Attributes

G4tgrVolumeMgrvolmgr = nullptr
 

Detailed Description

Definition at line 44 of file G4tgrLineProcessor.hh.

Constructor & Destructor Documentation

◆ G4tgrLineProcessor()

G4tgrLineProcessor::G4tgrLineProcessor ( )

Definition at line 50 of file G4tgrLineProcessor.cc.

51{
53}
G4tgrVolumeMgr * volmgr
static G4tgrVolumeMgr * GetInstance()

References G4tgrVolumeMgr::GetInstance(), and volmgr.

◆ ~G4tgrLineProcessor()

G4tgrLineProcessor::~G4tgrLineProcessor ( )
virtual

Definition at line 56 of file G4tgrLineProcessor.cc.

57{
58}

Member Function Documentation

◆ FindVolume()

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

Definition at line 314 of file G4tgrLineProcessor.cc.

315{
316 G4tgrVolume* vol = volmgr->FindVolume(volname, 1);
317
318 if(vol->GetType() == "VOLDivision")
319 {
320 G4Exception("G4tgrLineProcessor::FindVolume()", "InvalidSetup",
322 "Using 'PLACE' for a volume created by a division !");
323 }
324
325 return vol;
326}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
G4tgrVolume * FindVolume(const G4String &volname, G4bool exists=false)
const G4String & GetType() const
Definition: G4tgrVolume.hh:85

References FatalException, G4tgrVolumeMgr::FindVolume(), G4Exception(), G4tgrVolume::GetType(), and volmgr.

Referenced by ProcessLine().

◆ ProcessLine()

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

Definition at line 61 of file G4tgrLineProcessor.cc.

62{
63#ifdef G4VERBOSE
65 {
66 G4tgrUtils::DumpVS(wl, "@@@ Processing input line");
67 }
68#endif
69
70 G4String wl0 = wl[0];
71 for(std::size_t ii = 0; ii < wl0.length(); ++ii)
72 {
73 wl0[ii] = toupper(wl0[ii]);
74 }
75
76 //------------------------------- parameter number
77 if(wl0 == ":P")
78 {
80
81 //------------------------------- parameter string
82 }
83 else if(wl0 == ":PS")
84 {
86
87 //------------------------------- isotope
88 }
89 else if(wl0 == ":ISOT")
90 {
92 volmgr->RegisterMe(isot);
93
94 //------------------------------- element
95 }
96 else if(wl0 == ":ELEM")
97 {
101
102 //------------------------------- element from isotopes
103 }
104 else if(wl0 == ":ELEM_FROM_ISOT")
105 {
106 //:ELEM_FROM_ISOT NAME SYMBOL N_ISOT (ISOT_NAME ISOT_ABUNDANCE)
110
111 //------------------------------- material
112 }
113 else if(wl0 == ":MATE")
114 {
115 G4tgrMaterialSimple* mate =
117 volmgr->RegisterMe(mate);
118
119 //------------------------------- material mixtures & by weight
120 }
121 else if((wl0 == ":MIXT") || (wl0 == ":MIXT_BY_WEIGHT"))
122 {
125 wl, "MaterialMixtureByWeight");
126 volmgr->RegisterMe(mate);
127
128 //------------------------------- material mixture by number of atoms
129 }
130 else if(wl0 == ":MIXT_BY_NATOMS")
131 {
134 wl, "MaterialMixtureByNoAtoms");
135 volmgr->RegisterMe(mate);
136
137 //------------------------------- material mixture by volume
138 }
139 else if(wl0 == ":MIXT_BY_VOLUME")
140 {
143 wl, "MaterialMixtureByVolume");
144 volmgr->RegisterMe(mate);
145
146 //------------------------------- material Mean Excitation Energy of
147 // Ionisation Potential
148 }
149 else if(wl0 == ":MATE_MEE")
150 {
152 G4tgrUtils::GetString(wl[1]));
153 if(mate == 0)
154 {
155 G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
157 return false;
158 }
160
161 //------------------------------- material
162 }
163 else if(wl0 == ":MATE_STATE")
164 {
166 G4tgrUtils::GetString(wl[1]));
167 if(mate == 0)
168 {
169 G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
170 FatalException, wl[1]);
171 }
172 mate->SetState(wl[2]);
173
174 //------------------------------- material
175 }
176 else if(wl0 == ":MATE_TEMPERATURE")
177 {
179 G4tgrUtils::GetString(wl[1]));
180 if(mate == 0)
181 {
182 G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
183 FatalException, wl[1]);
184 }
186
187 //------------------------------- material
188 }
189 else if(wl0 == ":MATE_PRESSURE")
190 {
192 G4tgrUtils::GetString(wl[1]));
193 if(mate == 0)
194 {
195 G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
196 FatalException, wl[1]);
197 }
199
200 //------------------------------- solid
201 }
202 else if(wl0 == ":SOLID")
203 { // called from here or from G4tgrVolume::G4tgrVolume
204 volmgr->CreateSolid(wl, 0);
205
206 //------------------------------- volume
207 }
208 else if(wl0 == ":VOLU")
209 {
210 G4tgrVolume* vol = new G4tgrVolume(wl);
211 volmgr->RegisterMe(vol);
212
213 //--------------------------------- single placement
214 }
215 else if(wl0 == ":PLACE")
216 {
218 G4tgrPlace* vpl = vol->AddPlace(wl);
219 volmgr->RegisterMe(vpl);
220
221 //--------------------------------- parameterisation
222 }
223 else if(wl0 == ":PLACE_PARAM")
224 {
227 volmgr->RegisterMe(vpl);
228
229 //--------------------------------- division
230 }
231 else if((wl0 == ":DIV_NDIV") || (wl0 == ":DIV_WIDTH") ||
232 (wl0 == ":DIV_NDIV_WIDTH"))
233 {
234 //---------- Create G4tgrVolumeDivision and fill the volume params
236 volmgr->RegisterMe(vol);
237
238 //--------------------------------- replica
239 }
240 else if(wl0 == ":REPL")
241 {
243 G4tgrPlaceDivRep* vpl = vol->AddPlaceReplica(wl);
244 volmgr->RegisterMe(vpl);
245
246 //----------------------------- assembly volume: definition of components
247 }
248 else if(wl0 == ":VOLU_ASSEMBLY")
249 {
251 volmgr->RegisterMe(vol);
252
253 //----------------------------- assembly volume: definition of components
254 }
255 else if(wl0 == ":PLACE_ASSEMBLY")
256 {
258 G4tgrPlace* vpl = vol->AddPlace(wl);
259 volmgr->RegisterMe(vpl);
260
261 //--------------------------------- rotation matrix
262 }
263 else if(wl0 == ":ROTM")
264 {
265 //---------- When second word is ':NEXT/:MNXT' it is used for defining a
266 // rotation matrix that will be used for the next placement/s
269 volmgr->RegisterMe(rm);
270
271 //------------------------------- visualisation
272 }
273 else if(wl0 == ":VIS")
274 {
275 std::vector<G4tgrVolume*> vols =
277 for(std::size_t ii = 0; ii < vols.size(); ++ii)
278 {
279 vols[ii]->AddVisibility(wl);
280 }
281
282 //--------------------------------- colour
283 }
284 else if((wl0 == ":COLOUR") || (wl0 == ":COLOR"))
285 {
286 std::vector<G4tgrVolume*> vols =
288 for(std::size_t ii = 0; ii < vols.size(); ++ii)
289 {
290 vols[ii]->AddRGBColour(wl);
291 }
292
293 //--------------------------------- check overlaps
294 }
295 else if(wl0 == ":CHECK_OVERLAPS")
296 {
297 std::vector<G4tgrVolume*> vols =
299 for(std::size_t ii = 0; ii < vols.size(); ++ii)
300 {
301 vols[ii]->AddCheckOverlaps(wl);
302 }
303 //--------------------------------- ERROR
304 }
305 else
306 {
307 return false;
308 }
309
310 return true;
311}
#define elem(i, j)
static constexpr double kelvin
Definition: G4SIunits.hh:274
static constexpr double atmosphere
Definition: G4SIunits.hh:225
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 SetTemperature(G4double val)
void SetPressure(G4double val)
void SetIonisationMeanExcitationEnergy(G4double mee)
void SetState(const G4String &val)
static G4int GetVerboseLevel()
void AddParameterNumber(const std::vector< G4String > &wl, G4bool mustBeNew=false)
void AddParameterString(const std::vector< G4String > &wl, G4bool mustBeNew=false)
static G4tgrParameterMgr * GetInstance()
G4tgrRotationMatrix * AddRotMatrix(const std::vector< G4String > &wl)
static G4tgrRotationMatrixFactory * GetInstance()
static G4String GetString(const G4String &str)
Definition: G4tgrUtils.cc:173
static void DumpVS(const std::vector< G4String > &wl, const char *msg)
Definition: G4tgrUtils.cc:153
static G4double GetDouble(const G4String &str, G4double unitval=1.)
Definition: G4tgrUtils.cc:198
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:126
G4tgrPlaceParameterisation * AddPlaceParam(const std::vector< G4String > &wl)
Definition: G4tgrVolume.cc:201
G4tgrPlaceDivRep * AddPlaceReplica(const std::vector< G4String > &wl)
Definition: G4tgrVolume.cc:164

References G4tgrMaterialFactory::AddElementFromIsotopes(), G4tgrMaterialFactory::AddElementSimple(), G4tgrMaterialFactory::AddIsotope(), G4tgrMaterialFactory::AddMaterialMixture(), G4tgrMaterialFactory::AddMaterialSimple(), G4tgrParameterMgr::AddParameterNumber(), G4tgrParameterMgr::AddParameterString(), G4tgrVolume::AddPlace(), G4tgrVolume::AddPlaceParam(), G4tgrVolume::AddPlaceReplica(), G4tgrRotationMatrixFactory::AddRotMatrix(), atmosphere, G4tgrVolumeMgr::CreateSolid(), G4tgrUtils::DumpVS(), elem, FatalException, G4tgrMaterialFactory::FindMaterial(), FindVolume(), G4tgrVolumeMgr::FindVolumes(), G4Exception(), G4tgrUtils::GetDouble(), G4tgrMaterialFactory::GetInstance(), G4tgrParameterMgr::GetInstance(), G4tgrRotationMatrixFactory::GetInstance(), G4tgrUtils::GetString(), G4tgrMessenger::GetVerboseLevel(), kelvin, G4tgrVolumeMgr::RegisterMe(), G4tgrMaterial::SetIonisationMeanExcitationEnergy(), G4tgrMaterial::SetPressure(), G4tgrMaterial::SetState(), G4tgrMaterial::SetTemperature(), and volmgr.

Referenced by G4tgrFileReader::ReadFiles().

Field Documentation

◆ volmgr

G4tgrVolumeMgr* G4tgrLineProcessor::volmgr = nullptr
private

Definition at line 59 of file G4tgrLineProcessor.hh.

Referenced by FindVolume(), G4tgrLineProcessor(), and ProcessLine().


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