349 lines
9.7 KiB
Plaintext
349 lines
9.7 KiB
Plaintext
//
|
|
// ********************************************************************
|
|
// * License and Disclaimer *
|
|
// * *
|
|
// * The Geant4 software is copyright of the Copyright Holders of *
|
|
// * the Geant4 Collaboration. It is provided under the terms and *
|
|
// * conditions of the Geant4 Software License, included in the file *
|
|
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
|
// * include a list of copyright holders. *
|
|
// * *
|
|
// * Neither the authors of this software system, nor their employing *
|
|
// * institutes,nor the agencies providing financial support for this *
|
|
// * work make any representation or warranty, express or implied, *
|
|
// * regarding this software system or assume any liability for its *
|
|
// * use. Please see the license in the file LICENSE and URL above *
|
|
// * for the full disclaimer and the limitation of liability. *
|
|
// * *
|
|
// * This code implementation is the result of the scientific and *
|
|
// * technical work of the GEANT4 collaboration. *
|
|
// * By using, copying, modifying or distributing the software (or *
|
|
// * any work based on the software) you agree to acknowledge its *
|
|
// * use in resulting scientific publications, and indicate your *
|
|
// * acceptance of all terms of the Geant4 Software license. *
|
|
// ********************************************************************
|
|
//
|
|
// class G4LogicalVolume inline implementation
|
|
//
|
|
// Author: Paul Kent (CERN), 11.07.1995 - Initial version
|
|
// --------------------------------------------------------------------
|
|
|
|
// ********************************************************************
|
|
// GetName
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
const G4String& G4LogicalVolume::GetName() const
|
|
{
|
|
return fName;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetInstanceID
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4int G4LogicalVolume::GetInstanceID() const
|
|
{
|
|
return instanceID;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetMasterFieldManager
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4FieldManager* G4LogicalVolume::GetMasterFieldManager() const
|
|
{
|
|
return fFieldManager;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetNoDaughters
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
std::size_t G4LogicalVolume::GetNoDaughters() const
|
|
{
|
|
return fDaughters.size();
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetDaughter
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4VPhysicalVolume* G4LogicalVolume::GetDaughter(const std::size_t i) const
|
|
{
|
|
return fDaughters[i];
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetFastSimulationManager
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4FastSimulationManager* G4LogicalVolume::GetFastSimulationManager () const
|
|
{
|
|
G4FastSimulationManager* fFSM = nullptr;
|
|
if(fRegion != nullptr) { fFSM = fRegion->GetFastSimulationManager(); }
|
|
return fFSM;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// IsDaughter
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4bool G4LogicalVolume::IsDaughter(const G4VPhysicalVolume* p) const
|
|
{
|
|
for (const auto & daughter : fDaughters)
|
|
{
|
|
if (*daughter==*p) { return true; }
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// CharacteriseDaughters
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
EVolume G4LogicalVolume::CharacteriseDaughters() const
|
|
{
|
|
return fDaughtersVolumeType;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// DeduceDaughtersType
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
EVolume G4LogicalVolume::DeduceDaughtersType() const
|
|
{
|
|
EVolume type= kNormal;
|
|
G4VPhysicalVolume* pVol;
|
|
|
|
if ( GetNoDaughters() >= 1 )
|
|
{
|
|
pVol = GetDaughter(0);
|
|
type = pVol->VolumeType();
|
|
}
|
|
return type;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetMasterSolid
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4VSolid* G4LogicalVolume::GetMasterSolid() const
|
|
{
|
|
return fSolid;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetMasterSensitiveDetector
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4VSensitiveDetector* G4LogicalVolume::GetMasterSensitiveDetector() const
|
|
{
|
|
return fSensitiveDetector;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetUserLimits
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4UserLimits* G4LogicalVolume::GetUserLimits() const
|
|
{
|
|
if(fUserLimits != nullptr) { return fUserLimits;
|
|
}
|
|
if(fRegion != nullptr) { return fRegion->GetUserLimits(); }
|
|
return nullptr;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// SetUserLimits
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::SetUserLimits(G4UserLimits* pULimits)
|
|
{
|
|
fUserLimits = pULimits;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetVoxelHeader
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4SmartVoxelHeader* G4LogicalVolume::GetVoxelHeader() const
|
|
{
|
|
return fVoxel;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// SetVoxelHeader
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::SetVoxelHeader(G4SmartVoxelHeader* pVoxel)
|
|
{
|
|
fVoxel = pVoxel;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetSmartless
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4double G4LogicalVolume::GetSmartless() const
|
|
{
|
|
return fSmartless;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// SetSmartless
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::SetSmartless(G4double smt)
|
|
{
|
|
fSmartless = smt;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// IsToOptimise
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4bool G4LogicalVolume::IsToOptimise() const
|
|
{
|
|
return fOptimise;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// SetOptimisation
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::SetOptimisation(G4bool optim)
|
|
{
|
|
fOptimise = optim;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// IsRootRegion
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4bool G4LogicalVolume::IsRootRegion() const
|
|
{
|
|
return fRootRegion;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// SetRegionRootFlag
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::SetRegionRootFlag(G4bool rreg)
|
|
{
|
|
fRootRegion = rreg;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// IsRegion
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4bool G4LogicalVolume::IsRegion() const
|
|
{
|
|
G4bool reg = false;
|
|
if (fRegion != nullptr) { reg = true; }
|
|
return reg;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// SetRegion
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::SetRegion(G4Region* reg)
|
|
{
|
|
fRegion = reg;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetRegion
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4Region* G4LogicalVolume::GetRegion() const
|
|
{
|
|
return fRegion;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// PropagateRegion
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::PropagateRegion()
|
|
{
|
|
fRegion->ScanVolumeTree(this, true);
|
|
}
|
|
|
|
// ********************************************************************
|
|
// Lock
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::Lock()
|
|
{
|
|
fLock = true;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// Operator ==
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4bool G4LogicalVolume::operator == ( const G4LogicalVolume& lv) const
|
|
{
|
|
return this==&lv;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// SetBiasWeight
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
void G4LogicalVolume::SetBiasWeight(G4double weight)
|
|
{
|
|
fBiasWeight = weight;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetBiasWeight
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
G4double G4LogicalVolume::GetBiasWeight() const
|
|
{
|
|
return fBiasWeight;
|
|
}
|
|
|
|
// ********************************************************************
|
|
// GetVisAttributes
|
|
// ********************************************************************
|
|
//
|
|
inline
|
|
const G4VisAttributes* G4LogicalVolume::GetVisAttributes () const
|
|
{
|
|
return fVisAttributes.get();
|
|
}
|