78{
79
80
81
82
83
84
86 {
88 = G4LogicalVolumeStore::GetInstance()->GetVolume("phantomContainer");
89 if(envLV)
91 }
92
94 {
95 fEnvelopeVol = G4PhysicalVolumeStore::GetInstance()->GetVolume(
"phantomContainer");
96 }
97
98
100 {
102 }
103 else
104 {
105 G4ExceptionDescription msg;
106 msg << "Envelope physical volume not found.\n";
107 msg << "The gun will be place at the center.";
108 G4Exception("Dicom2PrimaryGeneratorAction::GeneratePrimaries()",
109 "DICOM20002",JustWarning, msg);
110 }
111
112
114 {
118 }
119 else
120 {
121 G4ExceptionDescription msg;
122 msg << "Envelope volume of box shape not found.\n";
123 msg << "The gun will be place at the center.";
124 G4Exception("Dicom2PrimaryGeneratorAction::GeneratePrimaries()",
125 "DICOM20003",JustWarning, msg);
126 }
127
128
130
131 G4ThreeVector delta(
fPosDelta.x() * (G4UniformRand()-0.5),
134
136
137
138
139
140
141
142
144 fParticleGun->SetParticleMomentumDirection(G4RandomDirection());
146}