G4gsdvt.cc File Reference

#include "G3Division.hh"
#include "G3VolTableEntry.hh"
#include "G3VolTable.hh"
#include "globals.hh"
#include "G3toG4.hh"

Go to the source code of this file.

Functions

void G4CreateCloneVTEWithDivision (G4String vname, G3VolTableEntry *mvte, G3DivType divType, G4int nofDivisions, G4int iaxis, G4int nmed, G4double c0, G4double step)
void PG4gsdvt (G4String *tokens)
void G4gsdvt (G4String vname, G4String vmoth, G4double step, G4int iaxis, G4int numed, G4int ndvmx)


Function Documentation

void G4CreateCloneVTEWithDivision ( G4String  vname,
G3VolTableEntry mvte,
G3DivType  divType,
G4int  nofDivisions,
G4int  iaxis,
G4int  nmed,
G4double  c0,
G4double  step 
)

Definition at line 52 of file G4gsdvn.cc.

00055 {       
00056   G3VolTableEntry* vte=0;
00057 
00058   // loop over all mothers
00059   for (G4int i=0; i<mvte->GetNoClones(); i++) {
00060     G3VolTableEntry* mvteClone =  mvte->GetClone(i);
00061     G4String shape = mvteClone->GetShape();
00062     G4int    nmed  = mvteClone->GetNmed();
00063     G4String mvteName = mvteClone->GetName();
00064     
00065     G4String newName = vname;
00066     if (i>0) {
00067       char index[5]; sprintf(index, "%d", i);
00068       newName.append(gSeparator); newName = newName + index;
00069     }   
00070 
00071     // create new VTE with 0 solid
00072     // and let vol table know about it
00073     G3VolTableEntry* vteClone
00074       = new G3VolTableEntry(newName, shape, 0, 0, nmed, 0, true);
00075     G3Vol.PutVTE(vteClone);
00076 
00077     // set mother <-> daughter
00078     // (mother/daughter are reset in case an envelope
00079     //  needs to be created in G3Division::UpdateVTE)
00080     mvteClone->AddDaughter(vteClone);
00081     vteClone->AddMother(mvteClone);
00082 
00083     // create new G3Division 
00084     G3Division* division
00085       = new G3Division(divType, vteClone, mvteClone,
00086                        nofDivisions, iaxis, nmed, c0, step);
00087 
00088     // set division to vte and update it
00089     vteClone->SetDivision(division);
00090     division->UpdateVTE();
00091       
00092     if (i == 0) {
00093       // keep the first clone copy
00094       vte = vteClone;
00095     }
00096     else {              
00097       // let vte know about this clone copy
00098       vte->AddClone(vteClone);     
00099     }
00100   }
00101 }    

void G4gsdvt ( G4String  vname,
G4String  vmoth,
G4double  step,
G4int  iaxis,
G4int  numed,
G4int  ndvmx 
)

Definition at line 57 of file G4gsdvt.cc.

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

Referenced by PG4gsdvt().

00059 {
00060   // find mother VTE
00061   G3VolTableEntry* mvte = G3Vol.GetVTE(vmoth);
00062   if (mvte == 0) {
00063     G4String text = "G4gsdvt:'" + vmoth + "' has no VolTableEntry";
00064     G4Exception("G4gsdvt()", "G3toG40014", FatalException, text);
00065     return;
00066   }    
00067   else {
00068     // a new vte clone copy with division is created
00069     // for each mother (clone copy)
00070     
00071     G4CreateCloneVTEWithDivision(vname, mvte, 
00072                                   kDvt, ndvmx, iaxis, numed, 0., step); 
00073   }  
00074 }

void PG4gsdvt ( G4String tokens  ) 

Definition at line 41 of file G4gsdvt.cc.

References G3fillParams(), G4gsdvt(), Ipar, PTgsdvt, Rpar, and Spar.

Referenced by G3CLEval().

00042 {
00043   // fill the parameter containers
00044   G3fillParams(tokens,PTgsdvt);
00045   
00046   // interpret the parameters
00047   G4String vname = Spar[0];
00048   G4String vmoth = Spar[1];
00049   G4int iaxis = Ipar[0];
00050   G4int numed = Ipar[1];
00051   G4int ndvmx = Ipar[2];
00052   G4double Step = Rpar[0];
00053   
00054   G4gsdvt(vname,vmoth,Step,iaxis,numed,ndvmx);
00055 }


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