#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 | PG4gsdvn2 (G4String *tokens) |
void | G4gsdvn2 (G4String vname, G4String vmoth, G4int ndiv, G4int iaxis, G4double c0, G4int numed) |
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 }
Definition at line 56 of file G4gsdvn2.cc.
References FatalException, G3Vol, G4CreateCloneVTEWithDivision(), G4Exception(), G3VolTable::GetVTE(), and kDvn2.
00058 { 00059 // find mother VTE 00060 G3VolTableEntry* mvte = G3Vol.GetVTE(vmoth); 00061 if (mvte == 0) { 00062 G4String text = "G4gsdvn2:'" + vmoth + "' has no VolTableEntry"; 00063 G4Exception("G4gsdvn2()", "G3toG40025", FatalException, text); 00064 return; 00065 } 00066 else { 00067 // a new vte clone copy with division is created 00068 // for each mother (clone copy) 00069 00070 G4CreateCloneVTEWithDivision(vname, mvte, 00071 kDvn2, ndiv, iaxis, numed, c0, 0.); 00072 } 00073 }
void PG4gsdvn2 | ( | G4String * | tokens | ) |
Definition at line 41 of file G4gsdvn2.cc.
References G3fillParams(), G4gsdvn2(), Ipar, PTgsdvn2, Rpar, and Spar.
Referenced by G3CLEval().
00041 { 00042 // fill the parameter containers 00043 G3fillParams(tokens, PTgsdvn2); 00044 00045 // interpret the parameters 00046 G4String vname = Spar[0]; 00047 G4String vmoth = Spar[1]; 00048 G4int ndiv = Ipar[0]; 00049 G4int iaxis = Ipar[1]; 00050 G4int numed = Ipar[2]; 00051 G4double c0 = Rpar[0]; 00052 00053 G4gsdvn2(vname, vmoth, ndiv, iaxis, c0, numed); 00054 }