Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G3Division Class Reference

#include <G3Division.hh>

Public Member Functions

 G3Division (G3DivType type, G3VolTableEntry *vte, G3VolTableEntry *mvte, G4int nofDivision, G4int iaxis, G4int nmed, G4double c0, G4double step)
 
 G3Division (G3VolTableEntry *vte, G3VolTableEntry *mvte, const G3Division &division)
 
virtual ~G3Division ()
 
void UpdateVTE ()
 
void CreatePVReplica ()
 

Detailed Description

Definition at line 54 of file G3Division.hh.

Constructor & Destructor Documentation

◆ G3Division() [1/2]

G3Division::G3Division ( G3DivType type,
G3VolTableEntry * vte,
G3VolTableEntry * mvte,
G4int nofDivision,
G4int iaxis,
G4int nmed,
G4double c0,
G4double step )

Definition at line 49 of file G3Division.cc.

52 : fType(type),
53 fVTE(vte),
54 fMVTE(mvte),
55 fNofDivisions(nofDivisions),
56 fIAxis(iaxis),
57 fNmed(nmed),
58 fC0(c0),
59 fStep(step),
60 fLowRange(0.),
61 fHighRange(0.),
62 fWidth(0.),
63 fOffset(0.),
64 fAxis(kXAxis)
65{
66 fVTE->SetHasNegPars(true);
67}
void SetHasNegPars(G4bool hasNegPars)
@ kXAxis
Definition geomdefs.hh:55

◆ G3Division() [2/2]

G3Division::G3Division ( G3VolTableEntry * vte,
G3VolTableEntry * mvte,
const G3Division & division )

Definition at line 69 of file G3Division.cc.

71 : fVTE(vte),
72 fMVTE(mvte)
73{
74 // only "input" parameters are copied from division
75 fType = division.fType;
76 fNofDivisions = division.fNofDivisions;
77 fIAxis = division.fIAxis;
78 fNmed = division.fNmed;
79 fC0 = division.fC0;
80 fStep = division.fStep;
81
82 // other parameters are set as in standard constructor
83 fLowRange = 0.;
84 fHighRange = 0.;
85 fWidth = 0.;
86 fOffset = 0.;
87 fAxis = kXAxis;
88 fVTE->SetHasNegPars(true);
89}

◆ ~G3Division()

G3Division::~G3Division ( )
virtual

Definition at line 91 of file G3Division.cc.

92{}

Member Function Documentation

◆ CreatePVReplica()

void G3Division::CreatePVReplica ( )

Definition at line 127 of file G3Division.cc.

128{
129 G4String name = fVTE->GetName();
130 G4LogicalVolume* lv = fVTE->GetLV();
131 G4LogicalVolume* mlv = fMVTE->GetLV();
132
133 G4String shape = fMVTE->GetShape();
134 if (shape == "PARA") {
135 // The para volume cannot be replicated using G4PVReplica.
136 // (Replicating a volume along a cartesian axis means "slicing" it
137 // with slices -perpendicular- to that axis.)
138
139 // position the replicated elements
140 for (G4int i=0; i<fNofDivisions; i++) {
142 position[fIAxis-1] = fLowRange + fWidth/2. + i*fWidth;
143 if (position.y()!=0.)
144 position.setX(position.y()*((G4Para*)lv->GetSolid())->GetTanAlpha());
145
146 #ifndef G3G4_NO_REFLECTION
148 ->Place(G4Translate3D(position), name, lv, mlv, 0, i);
149
150 #else
151 new G4PVPlacement(0, position, lv, name, mlv, 0, i);
152
153 #endif
154 }
155
156 // G4PVReplica cannot be created
157 return;
158 }
159
160 #ifdef G3G4DEBUG
161 G4cout << "Create G4PVReplica name " << name << " logical volume name "
162 << lv->GetName() << " mother logical volme name "
163 << mlv->GetName() << " axis " << fAxis << " ndivisions "
164 << fNofDivisions << " width " << fWidth << " Offset "
165 << fOffset << G4endl;
166 #endif
167
168 #ifndef G3G4_NO_REFLECTION
170 ->Replicate(name, lv, mlv, fAxis, fNofDivisions, fWidth, fOffset);
171
172 #else
173 new G4PVReplica(name, lv, mlv, fAxis, fNofDivisions, fWidth, fOffset);
174
175 #endif
176}
CLHEP::Hep3Vector G4ThreeVector
HepGeom::Translate3D G4Translate3D
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4LogicalVolume * GetLV()
G4VSolid * GetSolid() const
const G4String & GetName() const
static G4ReflectionFactory * Instance()
G4PhysicalVolumesPair Place(const G4Transform3D &transform3D, const G4String &name, G4LogicalVolume *LV, G4LogicalVolume *motherLV, G4bool isMany, G4int copyNo, G4bool surfCheck=false)
G4PhysicalVolumesPair Replicate(const G4String &name, G4LogicalVolume *LV, G4LogicalVolume *motherLV, EAxis axis, G4int nofReplicas, G4double width, G4double offset=0.)
const char * name(G4int ptype)

Referenced by G3toG4BuildPVTree().

◆ UpdateVTE()

void G3Division::UpdateVTE ( )

Definition at line 96 of file G3Division.cc.

97{
98 if (fVTE->HasNegPars() && !(fMVTE->HasNegPars())) {
99
100 // set nmed from mother
101 if (fNmed == 0) fNmed = fMVTE->GetNmed();
102 fVTE->SetNmed(fNmed);
103
104 SetRangeAndAxis();
105
106 // create envelope (if necessary)
107 // and solid
108 G3VolTableEntry* envVTE = 0;
109 if (fType == kDvn) envVTE = Dvn();
110 else if (fType == kDvn2) envVTE = Dvn2();
111 else if (fType == kDvt) envVTE = Dvt();
112 else if (fType == kDvt2) envVTE = Dvt2();
113
114 if (envVTE) {
115 // reset mother <-> daughter
116 fMVTE->ReplaceDaughter(fVTE, envVTE);
117 fVTE->ReplaceMother(fMVTE, envVTE);
118 envVTE->AddDaughter(fVTE);
119 envVTE->AddMother(fMVTE);
120
121 // replace mother with envelope
122 fMVTE = envVTE;
123 }
124 }
125}
@ kDvt
Definition G3Division.hh:52
@ kDvt2
Definition G3Division.hh:52
@ kDvn2
Definition G3Division.hh:52
@ kDvn
Definition G3Division.hh:52
void AddMother(G3VolTableEntry *aDaughter)
void SetNmed(G4int nmed)
void ReplaceDaughter(G3VolTableEntry *vteOld, G3VolTableEntry *vteNew)
void ReplaceMother(G3VolTableEntry *vteOld, G3VolTableEntry *vteNew)
void AddDaughter(G3VolTableEntry *aDaughter)

Referenced by G4CloneDaughters(), G4CreateCloneVTEWithDivision(), and G4ProcessDaughters().


The documentation for this class was generated from the following files: