2// ********************************************************************
3// * License and Disclaimer *
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. *
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. *
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// ********************************************************************
26// class G4LogicalVolume inline implementation
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// --------------------------------------------------------------------
37// ********************************************************************
39// ********************************************************************
42const G4String& G4LogicalVolume::GetName() const
47// ********************************************************************
49// ********************************************************************
52G4int G4LogicalVolume::GetInstanceID() const
57// ********************************************************************
58// GetMasterFieldManager
59// ********************************************************************
62G4FieldManager* G4LogicalVolume::GetMasterFieldManager() const
67// ********************************************************************
69// ********************************************************************
72size_t G4LogicalVolume::GetNoDaughters() const
74 return fDaughters.size();
77// ********************************************************************
79// ********************************************************************
82G4VPhysicalVolume* G4LogicalVolume::GetDaughter(const G4int i) const
87// ********************************************************************
88// GetFastSimulationManager
89// ********************************************************************
92G4FastSimulationManager* G4LogicalVolume::GetFastSimulationManager () const
94 G4FastSimulationManager* fFSM = nullptr;
95 if(fRegion != nullptr) fFSM = fRegion->GetFastSimulationManager();
99// ********************************************************************
101// ********************************************************************
104G4bool G4LogicalVolume::IsDaughter(const G4VPhysicalVolume* p) const
106 for (auto i=fDaughters.cbegin(); i!=fDaughters.cend(); ++i)
108 if (**i==*p) return true;
113// ********************************************************************
114// CharacteriseDaughters
115// ********************************************************************
118EVolume G4LogicalVolume::CharacteriseDaughters() const
120 return fDaughtersVolumeType;
123// ********************************************************************
124// DeduceDaughtersType
125// ********************************************************************
128EVolume G4LogicalVolume::DeduceDaughtersType() const
130 EVolume type= kNormal;
131 G4VPhysicalVolume* pVol;
133 if ( GetNoDaughters() >= 1 )
135 pVol = GetDaughter(0);
136 type = pVol->VolumeType();
141// ********************************************************************
143// ********************************************************************
146G4VSolid* G4LogicalVolume::GetMasterSolid() const
151// ********************************************************************
152// GetMasterSensitiveDetector
153// ********************************************************************
156G4VSensitiveDetector* G4LogicalVolume::GetMasterSensitiveDetector() const
158 return fSensitiveDetector;
161// ********************************************************************
163// ********************************************************************
166G4UserLimits* G4LogicalVolume::GetUserLimits() const
168 if(fUserLimits != nullptr) return fUserLimits;
169 if(fRegion != nullptr) return fRegion->GetUserLimits();
173// ********************************************************************
175// ********************************************************************
178void G4LogicalVolume::SetUserLimits(G4UserLimits* pULimits)
180 fUserLimits = pULimits;
183// ********************************************************************
185// ********************************************************************
188G4SmartVoxelHeader* G4LogicalVolume::GetVoxelHeader() const
193// ********************************************************************
195// ********************************************************************
198void G4LogicalVolume::SetVoxelHeader(G4SmartVoxelHeader* pVoxel)
203// ********************************************************************
205// ********************************************************************
208G4double G4LogicalVolume::GetSmartless() const
213// ********************************************************************
215// ********************************************************************
218void G4LogicalVolume::SetSmartless(G4double smt)
223// ********************************************************************
225// ********************************************************************
228G4bool G4LogicalVolume::IsToOptimise() const
233// ********************************************************************
235// ********************************************************************
238void G4LogicalVolume::SetOptimisation(G4bool optim)
243// ********************************************************************
245// ********************************************************************
248G4bool G4LogicalVolume::IsRootRegion() const
253// ********************************************************************
255// ********************************************************************
258void G4LogicalVolume::SetRegionRootFlag(G4bool rreg)
263// ********************************************************************
265// ********************************************************************
268G4bool G4LogicalVolume::IsRegion() const
271 if (fRegion != nullptr) reg = true;
275// ********************************************************************
277// ********************************************************************
280void G4LogicalVolume::SetRegion(G4Region* reg)
285// ********************************************************************
287// ********************************************************************
290G4Region* G4LogicalVolume::GetRegion() const
295// ********************************************************************
297// ********************************************************************
300void G4LogicalVolume::PropagateRegion()
302 fRegion->ScanVolumeTree(this, true);
305// ********************************************************************
307// ********************************************************************
310void G4LogicalVolume::Lock()
315// ********************************************************************
317// ********************************************************************
320G4bool G4LogicalVolume::operator == ( const G4LogicalVolume& lv) const
322 return (this==&lv) ? true : false;
325// ********************************************************************
327// ********************************************************************
330const G4VisAttributes* G4LogicalVolume::GetVisAttributes () const
332 return fVisAttributes;
335// ********************************************************************
337// ********************************************************************
340void G4LogicalVolume::SetVisAttributes (const G4VisAttributes* pVA)
342 fVisAttributes = pVA;
345// ********************************************************************
347// ********************************************************************
350void G4LogicalVolume::SetBiasWeight(G4double weight)
352 fBiasWeight = weight;
355// ********************************************************************
357// ********************************************************************
360G4double G4LogicalVolume::GetBiasWeight() const