1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: G4Region.icc,v 1.16 2009/11/27 16:34:37 gcosmo Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
29 | // |
---|
30 | // |
---|
31 | // class G4Region Inline Implementation file |
---|
32 | // |
---|
33 | // 19.09.02 - G.Cosmo: Created |
---|
34 | // -------------------------------------------------------------------- |
---|
35 | |
---|
36 | // ******************************************************************** |
---|
37 | // Equality operator, defined by address only |
---|
38 | // ******************************************************************** |
---|
39 | // |
---|
40 | inline |
---|
41 | G4bool G4Region::operator==(const G4Region& rg) const |
---|
42 | { |
---|
43 | return (this==&rg) ? true : false; |
---|
44 | } |
---|
45 | |
---|
46 | // ******************************************************************** |
---|
47 | // GetName |
---|
48 | // ******************************************************************** |
---|
49 | // |
---|
50 | inline |
---|
51 | const G4String& G4Region::GetName() const |
---|
52 | { |
---|
53 | return fName; |
---|
54 | } |
---|
55 | |
---|
56 | // ******************************************************************** |
---|
57 | // SetName |
---|
58 | // ******************************************************************** |
---|
59 | // |
---|
60 | inline |
---|
61 | void G4Region::SetName(const G4String& pName) |
---|
62 | { |
---|
63 | fName = pName; |
---|
64 | } |
---|
65 | |
---|
66 | // ******************************************************************** |
---|
67 | // RegionModified |
---|
68 | // ******************************************************************** |
---|
69 | // |
---|
70 | inline |
---|
71 | void G4Region::RegionModified(G4bool flag) |
---|
72 | { |
---|
73 | fRegionMod = flag; |
---|
74 | } |
---|
75 | |
---|
76 | // ******************************************************************** |
---|
77 | // IsModified |
---|
78 | // ******************************************************************** |
---|
79 | // |
---|
80 | inline |
---|
81 | G4bool G4Region::IsModified() const |
---|
82 | { |
---|
83 | return fRegionMod; |
---|
84 | } |
---|
85 | |
---|
86 | // ******************************************************************** |
---|
87 | // SetProductionCuts |
---|
88 | // ******************************************************************** |
---|
89 | // |
---|
90 | inline |
---|
91 | void G4Region::SetProductionCuts(G4ProductionCuts* cut) |
---|
92 | { |
---|
93 | fCut = cut; |
---|
94 | fRegionMod = true; |
---|
95 | } |
---|
96 | |
---|
97 | // ******************************************************************** |
---|
98 | // GetProductionCuts |
---|
99 | // ******************************************************************** |
---|
100 | // |
---|
101 | inline |
---|
102 | G4ProductionCuts* G4Region::GetProductionCuts() const |
---|
103 | { |
---|
104 | return fCut; |
---|
105 | } |
---|
106 | |
---|
107 | // ******************************************************************** |
---|
108 | // GetLogicalVolumeIterator |
---|
109 | // ******************************************************************** |
---|
110 | // |
---|
111 | inline |
---|
112 | std::vector<G4LogicalVolume*>::iterator |
---|
113 | G4Region::GetRootLogicalVolumeIterator() |
---|
114 | { |
---|
115 | G4RootLVList::iterator iterator = |
---|
116 | G4RootLVList::iterator(fRootVolumes.begin()); |
---|
117 | return iterator; |
---|
118 | } |
---|
119 | |
---|
120 | // ******************************************************************** |
---|
121 | // GetMaterialIterator |
---|
122 | // ******************************************************************** |
---|
123 | // |
---|
124 | inline |
---|
125 | std::vector<G4Material*>::const_iterator |
---|
126 | G4Region::GetMaterialIterator() const |
---|
127 | { |
---|
128 | G4MaterialList::const_iterator iterator = fMaterials.begin(); |
---|
129 | return iterator; |
---|
130 | } |
---|
131 | |
---|
132 | // ******************************************************************** |
---|
133 | // GetNumberOfMaterials |
---|
134 | // ******************************************************************** |
---|
135 | // |
---|
136 | inline |
---|
137 | size_t G4Region::GetNumberOfMaterials() const |
---|
138 | { |
---|
139 | return fMaterials.size(); |
---|
140 | } |
---|
141 | |
---|
142 | // ******************************************************************** |
---|
143 | // GetNumberOfRootVolumes |
---|
144 | // ******************************************************************** |
---|
145 | // |
---|
146 | inline |
---|
147 | size_t G4Region::GetNumberOfRootVolumes() const |
---|
148 | { |
---|
149 | return fRootVolumes.size(); |
---|
150 | } |
---|
151 | |
---|
152 | // ******************************************************************** |
---|
153 | // SetUserInformation |
---|
154 | // ******************************************************************** |
---|
155 | // |
---|
156 | inline |
---|
157 | void G4Region::SetUserInformation(G4VUserRegionInformation* ui) |
---|
158 | { |
---|
159 | fUserInfo = ui; |
---|
160 | } |
---|
161 | |
---|
162 | // ******************************************************************** |
---|
163 | // GetUserInformation |
---|
164 | // ******************************************************************** |
---|
165 | // |
---|
166 | inline |
---|
167 | G4VUserRegionInformation* G4Region::GetUserInformation() const |
---|
168 | { |
---|
169 | return fUserInfo; |
---|
170 | } |
---|
171 | |
---|
172 | // ******************************************************************** |
---|
173 | // SetUserLimits |
---|
174 | // ******************************************************************** |
---|
175 | // |
---|
176 | inline |
---|
177 | void G4Region::SetUserLimits(G4UserLimits* ul) |
---|
178 | { |
---|
179 | fUserLimits = ul; |
---|
180 | } |
---|
181 | |
---|
182 | // ******************************************************************** |
---|
183 | // GetUserLimits |
---|
184 | // ******************************************************************** |
---|
185 | // |
---|
186 | inline |
---|
187 | G4UserLimits* G4Region::GetUserLimits() const |
---|
188 | { |
---|
189 | return fUserLimits; |
---|
190 | } |
---|
191 | |
---|
192 | // ******************************************************************** |
---|
193 | // ClearMap |
---|
194 | // ******************************************************************** |
---|
195 | // |
---|
196 | inline |
---|
197 | void G4Region::ClearMap() |
---|
198 | { |
---|
199 | if(!(fMaterialCoupleMap.empty())) |
---|
200 | { |
---|
201 | G4MaterialCoupleMap::iterator b = fMaterialCoupleMap.begin(); |
---|
202 | G4MaterialCoupleMap::iterator e = fMaterialCoupleMap.end(); |
---|
203 | fMaterialCoupleMap.erase(b,e); |
---|
204 | } |
---|
205 | } |
---|
206 | |
---|
207 | // ******************************************************************** |
---|
208 | // RegisterMateralCouplePair |
---|
209 | // ******************************************************************** |
---|
210 | // |
---|
211 | inline |
---|
212 | void G4Region::RegisterMaterialCouplePair(G4Material* mat, |
---|
213 | G4MaterialCutsCouple* couple) |
---|
214 | { |
---|
215 | fMaterialCoupleMap.insert(G4MaterialCouplePair(mat,couple)); |
---|
216 | } |
---|
217 | |
---|
218 | // ******************************************************************** |
---|
219 | // FindCouple |
---|
220 | // ******************************************************************** |
---|
221 | // |
---|
222 | inline |
---|
223 | G4MaterialCutsCouple* G4Region::FindCouple(G4Material* mat) |
---|
224 | { |
---|
225 | G4MaterialCoupleMap::iterator c = fMaterialCoupleMap.find(mat); |
---|
226 | G4MaterialCutsCouple* couple = 0; |
---|
227 | if(c!=fMaterialCoupleMap.end()) couple = (*c).second; |
---|
228 | return couple; |
---|
229 | } |
---|
230 | |
---|
231 | // ******************************************************************** |
---|
232 | // SetFastSimulationManager |
---|
233 | // ******************************************************************** |
---|
234 | // |
---|
235 | inline |
---|
236 | void G4Region::SetFastSimulationManager(G4FastSimulationManager* fsm) |
---|
237 | { |
---|
238 | fFastSimulationManager = fsm; |
---|
239 | } |
---|
240 | |
---|
241 | // ******************************************************************** |
---|
242 | // GetFastSimulationManager |
---|
243 | // ******************************************************************** |
---|
244 | // |
---|
245 | inline |
---|
246 | G4FastSimulationManager* G4Region::GetFastSimulationManager() const |
---|
247 | { |
---|
248 | return fFastSimulationManager; |
---|
249 | } |
---|
250 | |
---|
251 | // ******************************************************************** |
---|
252 | // GetFieldManager |
---|
253 | // ******************************************************************** |
---|
254 | // |
---|
255 | inline |
---|
256 | G4FieldManager* G4Region::GetFieldManager() const |
---|
257 | { |
---|
258 | return fFieldManager; |
---|
259 | } |
---|
260 | |
---|
261 | // ******************************************************************** |
---|
262 | // SetFieldManager |
---|
263 | // ******************************************************************** |
---|
264 | // |
---|
265 | inline |
---|
266 | void G4Region::SetFieldManager(G4FieldManager* fm) |
---|
267 | { |
---|
268 | fFieldManager = fm; |
---|
269 | } |
---|
270 | |
---|
271 | // ******************************************************************** |
---|
272 | // GetWorldPhysical |
---|
273 | // ******************************************************************** |
---|
274 | // |
---|
275 | inline |
---|
276 | G4VPhysicalVolume* G4Region::GetWorldPhysical() const |
---|
277 | { |
---|
278 | return fWorldPhys; |
---|
279 | } |
---|
280 | |
---|
281 | // ******************************************************************** |
---|
282 | // AddMaterial |
---|
283 | // ******************************************************************** |
---|
284 | // |
---|
285 | inline |
---|
286 | void G4Region::AddMaterial(G4Material* aMaterial) |
---|
287 | { |
---|
288 | G4MaterialList::iterator pos = |
---|
289 | std::find(fMaterials.begin(),fMaterials.end(),aMaterial); |
---|
290 | if (pos == fMaterials.end()) |
---|
291 | { |
---|
292 | fMaterials.push_back(aMaterial); |
---|
293 | fRegionMod = true; |
---|
294 | } |
---|
295 | } |
---|
296 | |
---|
297 | // ******************************************************************** |
---|
298 | // SetRegionalSteppingAction |
---|
299 | // ******************************************************************** |
---|
300 | // |
---|
301 | inline |
---|
302 | void G4Region::SetRegionalSteppingAction(G4UserSteppingAction* rusa) |
---|
303 | { fRegionalSteppingAction = rusa; } |
---|
304 | |
---|
305 | // ******************************************************************** |
---|
306 | // GetRegionalSteppingAction |
---|
307 | // ******************************************************************** |
---|
308 | // |
---|
309 | inline |
---|
310 | G4UserSteppingAction* G4Region::GetRegionalSteppingAction() const |
---|
311 | { return fRegionalSteppingAction; } |
---|
312 | |
---|
313 | |
---|