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[ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 // class G4LogicalVolume inline implementation
 27 //
 28 // 15.01.13 - G.Cosmo, A.Dotti: Modified for thread-safety for MT
 29 // 10.20.97 - P. MoraDeFreitas : Added SetFastSimulation method
 30 // 05.11.98 - M. Verderi: Add Get/Set methods for fBiasWeight
 31 // 09.11.98 - J.Apostolakis:  Changed MagneticField to FieldManager
 32 // 12.02.99 - S.Giani: Added set/get methods for voxelization quality
 33 // 18.04.01 - G.Cosmo: Migrated to STL vector
 34 // 17.05.02 - G.Cosmo: Added IsToOptimise() method
 35 // --------------------------------------------------------------------
 36 
 37 // ********************************************************************
 38 // GetName
 39 // ********************************************************************
 40 //
 41 inline
 42 const G4String& G4LogicalVolume::GetName() const
 43 {
 44   return fName;
 45 }
 46     
 47 // ********************************************************************
 48 // GetInstanceID
 49 // ********************************************************************
 50 //
 51 inline
 52 G4int G4LogicalVolume::GetInstanceID() const
 53 {
 54   return instanceID;
 55 }
 56 
 57 // ********************************************************************
 58 // GetMasterFieldManager
 59 // ********************************************************************
 60 //
 61 inline
 62 G4FieldManager* G4LogicalVolume::GetMasterFieldManager() const
 63 {
 64   return fFieldManager;
 65 }
 66 
 67 // ********************************************************************
 68 // GetNoDaughters
 69 // ********************************************************************
 70 //
 71 inline
 72 std::size_t G4LogicalVolume::GetNoDaughters() const
 73 {
 74   return fDaughters.size();
 75 }
 76 
 77 // ********************************************************************
 78 // GetDaughter
 79 // ********************************************************************
 80 //
 81 inline
 82 G4VPhysicalVolume* G4LogicalVolume::GetDaughter(const std::size_t i) const
 83 {
 84   return fDaughters[i];
 85 }
 86 
 87 // ********************************************************************
 88 // GetFastSimulationManager
 89 // ********************************************************************
 90 //
 91 inline
 92 G4FastSimulationManager* G4LogicalVolume::GetFastSimulationManager () const 
 93 {
 94   G4FastSimulationManager* fFSM = nullptr;
 95   if(fRegion != nullptr) fFSM = fRegion->GetFastSimulationManager();
 96   return fFSM;
 97 }
 98 
 99 // ********************************************************************
100 // IsDaughter
101 // ********************************************************************
102 //
103 inline
104 G4bool G4LogicalVolume::IsDaughter(const G4VPhysicalVolume* p) const
105 {
106   for (const auto & daughter : fDaughters)
107   {
108     if (*daughter==*p) return true;
109   }
110   return false;
111 }
112 
113 // ********************************************************************
114 // CharacteriseDaughters
115 // ********************************************************************
116 //
117 inline
118 EVolume G4LogicalVolume::CharacteriseDaughters() const
119 {
120   return fDaughtersVolumeType;
121 }
122 
123 // ********************************************************************
124 // DeduceDaughtersType
125 // ********************************************************************
126 //
127 inline
128 EVolume G4LogicalVolume::DeduceDaughtersType() const
129 {
130   EVolume type= kNormal;
131   G4VPhysicalVolume* pVol;
132     
133   if ( GetNoDaughters() >= 1 )
134   {
135     pVol = GetDaughter(0);
136     type = pVol->VolumeType();
137   }
138   return type;
139 }
140 
141 // ********************************************************************
142 // GetMasterSolid
143 // ********************************************************************
144 //
145 inline
146 G4VSolid* G4LogicalVolume::GetMasterSolid() const
147 {
148   return fSolid;
149 }
150 
151 // ********************************************************************
152 // GetMasterSensitiveDetector
153 // ********************************************************************
154 //
155 inline
156 G4VSensitiveDetector* G4LogicalVolume::GetMasterSensitiveDetector() const
157 {
158   return fSensitiveDetector;
159 }
160 
161 // ********************************************************************
162 // GetUserLimits
163 // ********************************************************************
164 //
165 inline
166 G4UserLimits* G4LogicalVolume::GetUserLimits() const
167 {
168   if(fUserLimits != nullptr) return fUserLimits;
169   if(fRegion != nullptr) return fRegion->GetUserLimits();
170   return nullptr;
171 }
172 
173 // ********************************************************************
174 // SetUserLimits
175 // ********************************************************************
176 //
177 inline
178 void G4LogicalVolume::SetUserLimits(G4UserLimits* pULimits)
179 {
180   fUserLimits = pULimits;
181 }
182 
183 // ********************************************************************
184 // GetVoxelHeader
185 // ********************************************************************
186 //
187 inline
188 G4SmartVoxelHeader* G4LogicalVolume::GetVoxelHeader() const
189 {
190   return fVoxel;
191 }
192 
193 // ********************************************************************
194 // SetVoxelHeader
195 // ********************************************************************
196 //
197 inline
198 void G4LogicalVolume::SetVoxelHeader(G4SmartVoxelHeader* pVoxel)
199 {
200   fVoxel = pVoxel;
201 }
202 
203 // ********************************************************************
204 // GetSmartless
205 // ********************************************************************
206 //
207 inline
208 G4double G4LogicalVolume::GetSmartless() const
209 {
210   return fSmartless;
211 }
212 
213 // ********************************************************************
214 // SetSmartless
215 // ********************************************************************
216 //
217 inline
218 void G4LogicalVolume::SetSmartless(G4double smt)
219 {
220   fSmartless = smt;
221 }
222 
223 // ********************************************************************
224 // IsToOptimise
225 // ********************************************************************
226 //
227 inline
228 G4bool G4LogicalVolume::IsToOptimise() const
229 {
230   return fOptimise;
231 }
232 
233 // ********************************************************************
234 // SetOptimisation
235 // ********************************************************************
236 //
237 inline
238 void G4LogicalVolume::SetOptimisation(G4bool optim)
239 {
240   fOptimise = optim;
241 }
242 
243 // ********************************************************************
244 // IsRootRegion
245 // ********************************************************************
246 //
247 inline
248 G4bool G4LogicalVolume::IsRootRegion() const
249 {
250   return fRootRegion;
251 }
252 
253 // ********************************************************************
254 // SetRegionRootFlag
255 // ********************************************************************
256 //
257 inline
258 void G4LogicalVolume::SetRegionRootFlag(G4bool rreg)
259 {
260   fRootRegion = rreg;
261 }
262 
263 // ********************************************************************
264 // IsRegion
265 // ********************************************************************
266 //
267 inline
268 G4bool G4LogicalVolume::IsRegion() const
269 {
270   G4bool reg = false;
271   if (fRegion != nullptr) reg = true;
272   return reg;
273 }
274 
275 // ********************************************************************
276 // SetRegion
277 // ********************************************************************
278 //
279 inline
280 void G4LogicalVolume::SetRegion(G4Region* reg)
281 {
282   fRegion = reg;
283 }
284 
285 // ********************************************************************
286 // GetRegion
287 // ********************************************************************
288 //
289 inline
290 G4Region* G4LogicalVolume::GetRegion() const
291 {
292   return fRegion;
293 }
294 
295 // ********************************************************************
296 // PropagateRegion
297 // ********************************************************************
298 //
299 inline
300 void G4LogicalVolume::PropagateRegion()
301 {
302   fRegion->ScanVolumeTree(this, true);
303 }
304 
305 // ********************************************************************
306 // Lock
307 // ********************************************************************
308 //
309 inline
310 void G4LogicalVolume::Lock()
311 {
312   fLock = true;
313 }
314 
315 // ********************************************************************
316 // Operator ==
317 // ********************************************************************
318 //
319 inline
320 G4bool G4LogicalVolume::operator == ( const G4LogicalVolume& lv) const
321 {
322   return this==&lv;
323 }
324 
325 // ********************************************************************
326 // SetBiasWeight
327 // ********************************************************************
328 //
329 inline
330 void G4LogicalVolume::SetBiasWeight(G4double weight)
331 {
332   fBiasWeight = weight;
333 }
334 
335 // ********************************************************************
336 // GetBiasWeight
337 // ********************************************************************
338 //
339 inline
340 G4double G4LogicalVolume::GetBiasWeight() const
341 {
342   return fBiasWeight;
343 }
344 
345 // ********************************************************************
346 // GetVisAttributes
347 // ********************************************************************
348 //
349 inline
350 const G4VisAttributes* G4LogicalVolume::GetVisAttributes () const
351 {
352   return fVisAttributes.get();
353 }
354