G4gsvolu.cc File Reference

#include <iomanip>
#include "G3VolTable.hh"
#include "globals.hh"
#include "G3toG4.hh"
#include "G3toG4MakeSolid.hh"

Go to the source code of this file.

Functions

void PG4gsvolu (G4String *tokens)
G3VolTableEntryG4CreateVTE (G4String vname, G4String shape, G4int nmed, G4double rpar[], G4int npar)
void G4gsvolu (G4String vname, G4String shape, G4int nmed, G4double *rpar, G4int npar)


Function Documentation

G3VolTableEntry* G4CreateVTE ( G4String  vname,
G4String  shape,
G4int  nmed,
G4double  rpar[],
G4int  npar 
)

Definition at line 51 of file G4gsvolu.cc.

References G3toG4MakeSolid(), G3Vol, and G3VolTable::PutVTE().

Referenced by G4gsvolu().

00053 {    
00054   // create the solid
00055   G4bool hasNegPars;
00056   G4bool deferred;   
00057   G4bool okAxis[3];
00058   G4VSolid* solid
00059     = G3toG4MakeSolid(vname, shape, rpar, npar, hasNegPars, deferred, okAxis);  
00060 
00061   // if solid has been deferred 
00062   // VTE is created with hasNegPars = true  
00063   if (deferred) hasNegPars = true;   
00064 
00065   // create VTE
00066   G3VolTableEntry* vte 
00067      = new G3VolTableEntry(vname, shape, rpar, npar, nmed, solid, hasNegPars);
00068   G3Vol.PutVTE(vte);
00069   
00070   return vte;
00071 }

void G4gsvolu ( G4String  vname,
G4String  shape,
G4int  nmed,
G4double rpar,
G4int  npar 
)

Definition at line 73 of file G4gsvolu.cc.

References FatalException, G3Vol, G4CreateVTE(), G4Exception(), and G3VolTable::GetVTE().

Referenced by PG4gsvolu().

00075 {
00076   /*
00077   G4cout << "Creating logical volume " << vname << " shape " << shape
00078          << " nmed " << nmed << " #pars "<< npar << " parameters (cm): ";
00079   for (int ipar=0; ipar< npar; ipar++) G4cout << std::setw(8) << rpar[ipar];
00080   G4cout << G4endl;
00081   */
00082   if (G3Vol.GetVTE(vname)) {
00083     // abort if VTE with given name exists
00084     G4String text = "G4gsvolu: Attempt to create volume " + vname + " twice.";
00085     G4Exception("G4gsvolu()", "G3toG40024", FatalException, text);
00086     return;
00087   }
00088   else {  
00089     G4CreateVTE(vname, shape, nmed, rpar, npar);
00090   }  
00091 }

void PG4gsvolu ( G4String tokens  ) 

Definition at line 37 of file G4gsvolu.cc.

References G3fillParams(), G4gsvolu(), Ipar, PTgsvolu, Rpar, and Spar.

Referenced by G3CLEval().

00037                                  {
00038     // fill the parameter containers
00039     G3fillParams(tokens,PTgsvolu);
00040 
00041     // interpret the parameters
00042     G4String vname = Spar[0];
00043     G4String shape = Spar[1];
00044     G4int nmed = Ipar[0];
00045     G4int npar = Ipar[1];
00046     G4double *pars = Rpar;
00047 
00048     G4gsvolu(vname, shape, nmed, pars, npar);
00049 }


Generated on Mon May 27 17:50:46 2013 for Geant4 by  doxygen 1.4.7