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 (  ) 

Definition at line 54 of file G4tgrLineProcessor.cc.

References G4tgrVolumeMgr::GetInstance().

00055 {
00056   volmgr = G4tgrVolumeMgr::GetInstance();
00057 }

G4tgrLineProcessor::~G4tgrLineProcessor (  )  [virtual]

Definition at line 61 of file G4tgrLineProcessor.cc.

00062 {
00063 }


Member Function Documentation

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

Definition at line 320 of file G4tgrLineProcessor.cc.

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

Referenced by ProcessLine().

00321 {
00322   G4tgrVolume* vol = volmgr->FindVolume( volname, 1);
00323 
00324   if( vol->GetType() == "VOLDivision" )
00325   {
00326     G4Exception("G4tgrLineProcessor::FindVolume()",
00327                 "InvalidSetup", FatalException,
00328                 "Using 'PLACE' for a volume created by a division !");
00329   }
00330 
00331   return vol;
00332 }

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

Definition at line 67 of file G4tgrLineProcessor.cc.

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

Referenced by G4tgrFileReader::ReadFiles().

00068 {
00069 #ifdef G4VERBOSE
00070   if( G4tgrMessenger::GetVerboseLevel() >= 1 )
00071   {
00072     G4tgrUtils::DumpVS(wl, "@@@ Processing input line");
00073   }
00074 #endif  
00075 
00076   G4String wl0 = wl[0];
00077   for( size_t ii = 0; ii < wl0.length(); ii++ )
00078   {
00079     wl0[ii] = toupper( wl0[ii] );
00080   }
00081 
00082   //------------------------------- parameter number
00083   if( wl0 == ":P" )
00084   {
00085     G4tgrParameterMgr::GetInstance()->AddParameterNumber( wl );
00086     
00087   //------------------------------- parameter string
00088   }
00089   else if( wl0 == ":PS" )
00090   {
00091     G4tgrParameterMgr::GetInstance()->AddParameterString( wl );
00092 
00093   //------------------------------- isotope
00094   }
00095   else if( wl0 == ":ISOT" )
00096   {
00097     G4tgrIsotope* isot = G4tgrMaterialFactory::GetInstance()
00098                        ->AddIsotope( wl );
00099     volmgr->RegisterMe( isot );
00100 
00101   //------------------------------- element
00102   }
00103   else if( wl0 == ":ELEM" )
00104   {
00105     G4tgrElementSimple* elem = G4tgrMaterialFactory::GetInstance()
00106                              ->AddElementSimple( wl );
00107     volmgr->RegisterMe( elem );
00108 
00109   //------------------------------- element from isotopes
00110   }
00111   else if( wl0 == ":ELEM_FROM_ISOT" )
00112   {
00113     //:ELEM_FROM_ISOT NAME SYMBOL N_ISOT (ISOT_NAME ISOT_ABUNDANCE)
00114     G4tgrElementFromIsotopes* elem = G4tgrMaterialFactory::GetInstance()
00115                                    ->AddElementFromIsotopes( wl );
00116     volmgr->RegisterMe( elem );
00117     
00118   //------------------------------- material
00119   }
00120   else if( wl0 == ":MATE" )
00121   {
00122 
00123     G4tgrMaterialSimple* mate = G4tgrMaterialFactory::GetInstance()
00124                               ->AddMaterialSimple( wl );
00125     volmgr->RegisterMe( mate );
00126     
00127     //------------------------------- material mixtures & by weight
00128   }
00129   else if( (wl0 == ":MIXT") || (wl0 == ":MIXT_BY_WEIGHT") )
00130   {
00131     G4tgrMaterialMixture* mate = G4tgrMaterialFactory::GetInstance()
00132                           ->AddMaterialMixture( wl, "MaterialMixtureByWeight" );
00133     volmgr->RegisterMe( mate );
00134 
00135     //------------------------------- material mixture by number of atoms
00136   }
00137   else if( wl0 == ":MIXT_BY_NATOMS" )
00138   {
00139     G4tgrMaterialMixture* mate = G4tgrMaterialFactory::GetInstance()
00140                           ->AddMaterialMixture(wl, "MaterialMixtureByNoAtoms");
00141     volmgr->RegisterMe( mate );
00142 
00143     //------------------------------- material mixture by volume
00144   }
00145   else if( wl0 == ":MIXT_BY_VOLUME" )
00146   {
00147     G4tgrMaterialMixture* mate = G4tgrMaterialFactory::GetInstance()
00148                           ->AddMaterialMixture( wl, "MaterialMixtureByVolume" );
00149     volmgr->RegisterMe( mate );
00150 
00151     //------------------------------- material Mean Excitation Energy of
00152     //                                Ionisation Potential
00153   }
00154   else if( wl0 == ":MATE_MEE" )
00155   {
00156     G4tgrMaterial* mate = G4tgrMaterialFactory::GetInstance()
00157                         ->FindMaterial( G4tgrUtils::GetString( wl[1] ) );
00158     if( mate == 0 )
00159     {
00160       G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
00161                   FatalException, G4tgrUtils::GetString( wl[1] ) );
00162       return false;
00163     }
00164     mate->SetIonisationMeanExcitationEnergy( G4tgrUtils::GetDouble( wl[2] ) );
00165 
00166     //------------------------------- material
00167   }
00168   else if( wl0 == ":MATE_STATE" )
00169   {
00170     G4tgrMaterial* mate = G4tgrMaterialFactory::GetInstance()
00171                         ->FindMaterial( G4tgrUtils::GetString( wl[1] ) );
00172     if( mate == 0 )
00173     {
00174       G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
00175                   FatalException, wl[1] );
00176     }
00177     mate->SetState( wl[2] );
00178 
00179     //------------------------------- material
00180   }
00181   else if( wl0 == ":MATE_TEMPERATURE" )
00182   {
00183     G4tgrMaterial* mate = G4tgrMaterialFactory::GetInstance()
00184                         ->FindMaterial( G4tgrUtils::GetString( wl[1] ) );
00185     if( mate == 0 )
00186     {
00187       G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
00188                   FatalException, wl[1] );
00189     }
00190     mate->SetTemperature( G4tgrUtils::GetDouble( wl[2], kelvin ) );
00191 
00192     //------------------------------- material
00193   }
00194   else if( wl0 == ":MATE_PRESSURE" )
00195   {
00196     G4tgrMaterial* mate = G4tgrMaterialFactory::GetInstance()
00197                         ->FindMaterial( G4tgrUtils::GetString( wl[1] ) );
00198     if( mate == 0 )
00199     {
00200       G4Exception("G4tgrLineProcessor::ProcessLine()", "Material not found",
00201                   FatalException, wl[1] );
00202     }
00203     mate->SetPressure( G4tgrUtils::GetDouble( wl[2], atmosphere ) );
00204 
00205     //------------------------------- solid
00206   }
00207   else if( wl0 == ":SOLID" )
00208   {                      // called from here or from G4tgrVolume::G4tgrVolume
00209     volmgr->CreateSolid( wl, 0 );
00210 
00211     //------------------------------- volume
00212   }
00213   else if( wl0 == ":VOLU" )
00214   {
00215     G4tgrVolume* vol = new G4tgrVolume( wl );
00216     volmgr->RegisterMe( vol );
00217     
00218     //--------------------------------- single placement
00219   }
00220   else if( wl0 == ":PLACE" )
00221   {
00222     G4tgrVolume* vol = FindVolume( G4tgrUtils::GetString( wl[1] ) );
00223     G4tgrPlace* vpl = vol->AddPlace( wl );
00224     volmgr->RegisterMe( vpl );
00225     
00226     //--------------------------------- parameterisation
00227   }
00228   else if( wl0 == ":PLACE_PARAM" )
00229   {
00230     G4tgrVolume* vol = FindVolume( G4tgrUtils::GetString( wl[1] ) );
00231     G4tgrPlaceParameterisation* vpl = vol->AddPlaceParam( wl );
00232     volmgr->RegisterMe( vpl );
00233 
00234     //--------------------------------- division
00235   }
00236   else if( (wl0 == ":DIV_NDIV") || (wl0 == ":DIV_WIDTH")
00237         || (wl0 == ":DIV_NDIV_WIDTH") )
00238   {
00239     //---------- Create G4tgrVolumeDivision and fill the volume params
00240     G4tgrVolumeDivision* vol = new G4tgrVolumeDivision( wl );
00241     volmgr->RegisterMe( vol );
00242 
00243     //--------------------------------- replica
00244   }
00245   else if( wl0 == ":REPL" )
00246   {
00247     G4tgrVolume* vol = FindVolume( G4tgrUtils::GetString( wl[1] ) );
00248     G4tgrPlaceDivRep* vpl = vol->AddPlaceReplica( wl );
00249     volmgr->RegisterMe( vpl );
00250     
00251     //----------------------------- assembly volume: definition of components
00252   }
00253   else if( wl0 == ":VOLU_ASSEMBLY" )
00254   {
00255     G4tgrVolumeAssembly* vol = new G4tgrVolumeAssembly( wl );
00256     volmgr->RegisterMe( vol );
00257     
00258     //----------------------------- assembly volume: definition of components
00259   }
00260   else if( wl0 == ":PLACE_ASSEMBLY" )
00261   {
00262     G4tgrVolume* vol = FindVolume( G4tgrUtils::GetString( wl[1] ) );
00263     G4tgrPlace* vpl = vol->AddPlace( wl );
00264     volmgr->RegisterMe( vpl );
00265 
00266     //---------------------------------  rotation matrix
00267   }
00268   else if( wl0 == ":ROTM" )
00269   {
00270     //---------- When second word is ':NEXT/:MNXT' it is used for defining a
00271     //           rotation matrix that will be used for the next placement/s
00272     G4tgrRotationMatrix* rm = G4tgrRotationMatrixFactory::GetInstance()
00273                             ->AddRotMatrix( wl );
00274     volmgr->RegisterMe( rm );
00275     
00276     //------------------------------- visualisation
00277   }
00278   else if( wl0 == ":VIS" )
00279   {
00280     std::vector<G4tgrVolume*> vols =
00281        volmgr->FindVolumes( G4tgrUtils::GetString( wl[1] ), 1 );
00282     for( size_t ii = 0; ii < vols.size(); ii++ )
00283     {
00284       vols[ii]->AddVisibility( wl );
00285     }
00286 
00287     //--------------------------------- colour
00288   }
00289   else if( (wl0 == ":COLOUR") || (wl0 == ":COLOR") )
00290   {
00291     std::vector<G4tgrVolume*> vols =
00292        volmgr->FindVolumes( G4tgrUtils::GetString( wl[1] ), 1 );
00293     for( size_t ii = 0; ii < vols.size(); ii++ )
00294     {
00295       vols[ii]->AddRGBColour( wl );
00296     }
00297 
00298     //--------------------------------- check overlaps
00299   }
00300   else if( wl0 == ":CHECK_OVERLAPS" )
00301   {
00302     std::vector<G4tgrVolume*> vols =
00303        volmgr->FindVolumes( G4tgrUtils::GetString( wl[1] ), 1 );
00304     for( size_t ii = 0; ii < vols.size(); ii++ )
00305     {
00306       vols[ii]->AddCheckOverlaps( wl );
00307     }
00308     //--------------------------------- ERROR
00309   }
00310   else
00311   {
00312     return 0;
00313   } 
00314 
00315   return 1;
00316 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:30 2013 for Geant4 by  doxygen 1.4.7