Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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

◆ G4CreateCloneVTEWithDivision()

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

Definition at line 51 of file G4gsdvn.cc.

54{
55 G3VolTableEntry* vte=0;
56
57 // loop over all mothers
58 for (G4int i=0; i<mvte->GetNoClones(); i++) {
59 G3VolTableEntry* mvteClone = mvte->GetClone(i);
60 G4String shape = mvteClone->GetShape();
61 G4int nmed = mvteClone->GetNmed();
62 G4String mvteName = mvteClone->GetName();
63
64 G4String newName = vname;
65 if (i>0) {
66 newName += gSeparator;
67 newName = newName + std::to_string(i);
68 }
69
70 // create new VTE with 0 solid
71 // and let vol table know about it
72 G3VolTableEntry* vteClone
73 = new G3VolTableEntry(newName, shape, 0, 0, nmed, 0, true);
74 G3Vol.PutVTE(vteClone);
75
76 // set mother <-> daughter
77 // (mother/daughter are reset in case an envelope
78 // needs to be created in G3Division::UpdateVTE)
79 mvteClone->AddDaughter(vteClone);
80 vteClone->AddMother(mvteClone);
81
82 // create new G3Division
83 G3Division* division
84 = new G3Division(divType, vteClone, mvteClone,
85 nofDivisions, iaxis, nmed, c0, step);
86
87 // set division to vte and update it
88 vteClone->SetDivision(division);
89 division->UpdateVTE();
90
91 if (i == 0) {
92 // keep the first clone copy
93 vte = vteClone;
94 }
95 else {
96 // let vte know about this clone copy
97 vte->AddClone(vteClone);
98 }
99 }
100}
G3G4DLL_API G3VolTable G3Vol
Definition: clparse.cc:53
G3G4DLL_API char gSeparator
int G4int
Definition: G4Types.hh:85
void UpdateVTE()
Definition: G3Division.cc:96
void AddClone(G3VolTableEntry *aDaughter)
void AddMother(G3VolTableEntry *aDaughter)
void SetDivision(G3Division *division)
G3VolTableEntry * GetClone(G4int i)
void AddDaughter(G3VolTableEntry *aDaughter)
G3VolTableEntry * PutVTE(G3VolTableEntry *aVTE)
Definition: G3VolTable.cc:75

Referenced by G4gsdvt().

◆ G4gsdvt()

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

Definition at line 56 of file G4gsdvt.cc.

58{
59 // find mother VTE
60 G3VolTableEntry* mvte = G3Vol.GetVTE(vmoth);
61 if (mvte == 0) {
62 G4String text = "G4gsdvt:'" + vmoth + "' has no VolTableEntry";
63 G4Exception("G4gsdvt()", "G3toG40014", FatalException, text);
64 return;
65 }
66 else {
67 // a new vte clone copy with division is created
68 // for each mother (clone copy)
69
71 kDvt, ndvmx, iaxis, numed, 0., step);
72 }
73}
@ kDvt
Definition: G3Division.hh:52
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
void G4CreateCloneVTEWithDivision(G4String vname, G3VolTableEntry *mvte, G3DivType divType, G4int nofDivisions, G4int iaxis, G4int nmed, G4double c0, G4double step)
Definition: G4gsdvn.cc:51
G3VolTableEntry * GetVTE(const G4String &Vname)
Definition: G3VolTable.cc:53

Referenced by PG4gsdvt().

◆ PG4gsdvt()

void PG4gsdvt ( G4String tokens)

Definition at line 40 of file G4gsdvt.cc.

41{
42 // fill the parameter containers
43 G3fillParams(tokens,PTgsdvt);
44
45 // interpret the parameters
46 G4String vname = Spar[0];
47 G4String vmoth = Spar[1];
48 G4int iaxis = Ipar[0];
49 G4int numed = Ipar[1];
50 G4int ndvmx = Ipar[2];
51 G4double Step = Rpar[0];
52
53 G4gsdvt(vname,vmoth,Step,iaxis,numed,ndvmx);
54}
G3G4DLL_API G4int Ipar[1000]
Definition: clparse.cc:65
#define PTgsdvt
Definition: G3toG4.hh:57
void G3fillParams(G4String *tokens, const char *ptypes)
Definition: clparse.cc:216
G3G4DLL_API G4double Rpar[1000]
Definition: clparse.cc:66
G3G4DLL_API G4String Spar[1000]
Definition: clparse.cc:67
double G4double
Definition: G4Types.hh:83
void G4gsdvt(G4String vname, G4String vmoth, G4double step, G4int iaxis, G4int numed, G4int ndvmx)
Definition: G4gsdvt.cc:56

Referenced by G3CLEval().