#include "G3G4Interface.hh"
#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 | PG4gsdvn (G4String *tokens) |
void | G4CreateCloneVTEWithDivision (G4String vname, G3VolTableEntry *mvte, G3DivType divType, G4int nofDivisions, G4int iaxis, G4int, G4double c0, G4double step) |
void | G4gsdvn (G4String vname, G4String vmoth, G4int ndiv, G4int iaxis) |
void G4CreateCloneVTEWithDivision | ( | G4String | vname, | |
G3VolTableEntry * | mvte, | |||
G3DivType | divType, | |||
G4int | nofDivisions, | |||
G4int | iaxis, | |||
G4int | , | |||
G4double | c0, | |||
G4double | step | |||
) |
Definition at line 52 of file G4gsdvn.cc.
References G3VolTableEntry::AddClone(), G3VolTableEntry::AddDaughter(), G3VolTableEntry::AddMother(), G4String::append(), G3Vol, G3VolTableEntry::GetClone(), G3VolTableEntry::GetNoClones(), G3VolTableEntry::GetShape(), gSeparator, G3VolTable::PutVTE(), G3VolTableEntry::SetDivision(), and G3Division::UpdateVTE().
Referenced by G4gsdvn(), G4gsdvn2(), G4gsdvt(), and G4gsdvt2().
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 103 of file G4gsdvn.cc.
References FatalException, G3Vol, G4CreateCloneVTEWithDivision(), G4Exception(), G3VolTable::GetVTE(), and kDvn.
Referenced by PG4gsdvn().
00104 { 00105 // find mother VTE 00106 G3VolTableEntry* mvte = G3Vol.GetVTE(vmoth); 00107 00108 if (mvte == 0) { 00109 G4String text = "G4gsdvn:'" + vmoth + "' has no VolTableEntry"; 00110 G4Exception("G4gsdvn()", "G3toG40013", FatalException, text); 00111 return; 00112 } 00113 else { 00114 // a new vte clone copy with division is created 00115 // for each mother (clone copy) 00116 00117 G4CreateCloneVTEWithDivision(vname, mvte, kDvn, ndiv, iaxis, 0, 0., 0.); 00118 } 00119 }
void PG4gsdvn | ( | G4String * | tokens | ) |
Definition at line 38 of file G4gsdvn.cc.
References G3fillParams(), G4gsdvn(), Ipar, PTgsdvn, and Spar.
Referenced by G3CLEval().
00039 { 00040 // fill the parameter containers 00041 G3fillParams(tokens,PTgsdvn); 00042 00043 // interpret the parameters 00044 G4String vname = Spar[0]; 00045 G4String vmoth = Spar[1]; 00046 G4int ndiv = Ipar[0]; 00047 G4int iaxis = Ipar[1]; 00048 00049 G4gsdvn(vname, vmoth, ndiv, iaxis); 00050 }