Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -24,12 +24,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4LogicalVolume.icc 78050 2013-12-03 08:17:33Z gcosmo $
|
||||
//
|
||||
//
|
||||
// class G4LogicalVolume Inline Implementation file
|
||||
//
|
||||
// 10.20.97 - P. MoraDeFreitas : Added SetFastSimulation method.
|
||||
// 15.01.13 - G.Cosmo, A.Dotti: Modified for thread-safety for MT
|
||||
// 10.20.97 - P. MoraDeFreitas : Added SetFastSimulation method
|
||||
// 05.11.98 - M. Verderi: Add Get/Set methods for fBiasWeight
|
||||
// 09.11.98 - J. Apostolakis: Changed MagneticField to FieldManager
|
||||
// 12.02.99 - S.Giani: Added set/get methods for voxelization quality
|
||||
@@ -37,6 +38,19 @@
|
||||
// 17.05.02 - G.Cosmo: Added IsToOptimise() method
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
|
||||
// These macros change the references to fields that are now encapsulated
|
||||
// in the class G4LVData.
|
||||
//
|
||||
#define G4MT_solid ((subInstanceManager.offset[instanceID]).fSolid)
|
||||
#define G4MT_sdetector ((subInstanceManager.offset[instanceID]).fSensitiveDetector)
|
||||
#define G4MT_fmanager ((subInstanceManager.offset[instanceID]).fFieldManager)
|
||||
#define G4MT_material ((subInstanceManager.offset[instanceID]).fMaterial)
|
||||
#define G4MT_mass ((subInstanceManager.offset[instanceID]).fMass)
|
||||
#define G4MT_ccouple ((subInstanceManager.offset[instanceID]).fCutsCouple)
|
||||
#define G4MT_instance (subInstanceManager.offset[instanceID])
|
||||
|
||||
#include "G4Threading.hh"
|
||||
// ********************************************************************
|
||||
// GetName
|
||||
// ********************************************************************
|
||||
@@ -57,12 +71,39 @@ void G4LogicalVolume::SetName(const G4String& pName)
|
||||
fName = pName;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// GetInstanceID
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
G4int G4LogicalVolume::GetInstanceID() const
|
||||
{
|
||||
return instanceID;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// GetFieldManager
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
G4FieldManager* G4LogicalVolume::GetFieldManager() const
|
||||
{
|
||||
return G4MT_fmanager;
|
||||
}
|
||||
|
||||
inline void G4LogicalVolume::AssignFieldManager( G4FieldManager *fldMgr)
|
||||
{
|
||||
G4MT_fmanager= fldMgr;
|
||||
if(!G4Threading::IsWorkerThread()) fFieldManager = fldMgr;
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// GetMasterFieldManager
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
G4FieldManager* G4LogicalVolume::GetMasterFieldManager() const
|
||||
{
|
||||
return fFieldManager;
|
||||
}
|
||||
@@ -120,7 +161,9 @@ void G4LogicalVolume::AddDaughter(G4VPhysicalVolume* pNewDaughter)
|
||||
"Replica or parameterised volume must be the only daughter !");
|
||||
}
|
||||
|
||||
fMass = 0.;
|
||||
// Invalidate previous calculation of mass - if any - for all threads
|
||||
G4MT_mass = 0.;
|
||||
// SignalVolumeChange(); // fVolumeChanged= true;
|
||||
fDaughters.push_back(pNewDaughter);
|
||||
|
||||
G4LogicalVolume* pDaughterLogical = pNewDaughter->GetLogicalVolume();
|
||||
@@ -131,7 +174,7 @@ void G4LogicalVolume::AddDaughter(G4VPhysicalVolume* pNewDaughter)
|
||||
|
||||
if( pDaughterFieldManager == 0 )
|
||||
{
|
||||
pDaughterLogical->SetFieldManager(fFieldManager, false);
|
||||
pDaughterLogical->SetFieldManager(G4MT_fmanager, false);
|
||||
}
|
||||
if (fRegion)
|
||||
{
|
||||
@@ -175,7 +218,7 @@ void G4LogicalVolume::RemoveDaughter(const G4VPhysicalVolume* p)
|
||||
{
|
||||
fRegion->RegionModified(true);
|
||||
}
|
||||
fMass = 0.;
|
||||
G4MT_mass = 0.;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -194,15 +237,62 @@ void G4LogicalVolume::ClearDaughters()
|
||||
{
|
||||
fRegion->RegionModified(true);
|
||||
}
|
||||
fMass = 0.;
|
||||
G4MT_mass = 0.;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// CharacteriseDaughters
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
EVolume G4LogicalVolume::CharacteriseDaughters() const
|
||||
{
|
||||
EVolume type;
|
||||
G4VPhysicalVolume *pVol;
|
||||
|
||||
if ( GetNoDaughters()==1 )
|
||||
{
|
||||
pVol = GetDaughter(0);
|
||||
type = pVol->VolumeType();
|
||||
}
|
||||
else
|
||||
{
|
||||
type = kNormal;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4LogicalVolume::ResetMass()
|
||||
{
|
||||
G4MT_mass= 0.0;
|
||||
// Do not fChangedState= 1;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// GetSolid
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
G4VSolid* G4LogicalVolume::GetSolid(G4LVData &instLVdata) // const
|
||||
{
|
||||
return instLVdata.fSolid;
|
||||
}
|
||||
|
||||
inline
|
||||
G4VSolid* G4LogicalVolume::GetSolid() const
|
||||
{
|
||||
// return G4MT_solid;
|
||||
// return ((subInstanceManager.offset[instanceID]).fSolid);
|
||||
return this->GetSolid( subInstanceManager.offset[instanceID] );
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// GetMasterSolid
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
G4VSolid* G4LogicalVolume::GetMasterSolid() const
|
||||
{
|
||||
return fSolid;
|
||||
}
|
||||
@@ -214,9 +304,20 @@ G4VSolid* G4LogicalVolume::GetSolid() const
|
||||
inline
|
||||
void G4LogicalVolume::SetSolid(G4VSolid *pSolid)
|
||||
{
|
||||
assert(pSolid != 0);
|
||||
fSolid=pSolid;
|
||||
fMass = 0.;
|
||||
|
||||
// ((subInstanceManager.offset[instanceID]).fSolid) = pSolid;
|
||||
G4MT_solid=pSolid;
|
||||
// G4MT_mass = 0.;
|
||||
this->ResetMass();
|
||||
}
|
||||
|
||||
inline
|
||||
void G4LogicalVolume::SetSolid(G4LVData &instLVdata, G4VSolid *pSolid)
|
||||
{
|
||||
instLVdata.fSolid = pSolid;
|
||||
// G4MT_solid=pSolid;
|
||||
instLVdata.fMass= 0;
|
||||
// A fast way to reset the mass ... ie G4MT_mass = 0.;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -226,7 +327,7 @@ void G4LogicalVolume::SetSolid(G4VSolid *pSolid)
|
||||
inline
|
||||
G4Material* G4LogicalVolume::GetMaterial() const
|
||||
{
|
||||
return fMaterial;
|
||||
return G4MT_material;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -236,8 +337,8 @@ G4Material* G4LogicalVolume::GetMaterial() const
|
||||
inline
|
||||
void G4LogicalVolume::SetMaterial(G4Material *pMaterial)
|
||||
{
|
||||
fMaterial=pMaterial;
|
||||
fMass = 0.;
|
||||
G4MT_material=pMaterial;
|
||||
G4MT_mass = 0.;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -247,9 +348,9 @@ void G4LogicalVolume::SetMaterial(G4Material *pMaterial)
|
||||
inline
|
||||
void G4LogicalVolume::UpdateMaterial(G4Material *pMaterial)
|
||||
{
|
||||
fMaterial=pMaterial;
|
||||
if(fRegion) { fCutsCouple = fRegion->FindCouple(pMaterial); }
|
||||
fMass = 0.;
|
||||
G4MT_material=pMaterial;
|
||||
if(fRegion) { G4MT_ccouple = fRegion->FindCouple(pMaterial); }
|
||||
G4MT_mass = 0.;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -258,6 +359,16 @@ void G4LogicalVolume::UpdateMaterial(G4Material *pMaterial)
|
||||
//
|
||||
inline
|
||||
G4VSensitiveDetector* G4LogicalVolume::GetSensitiveDetector() const
|
||||
{
|
||||
return G4MT_sdetector;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
// GetMasterSensitiveDetector
|
||||
// ********************************************************************
|
||||
//
|
||||
inline
|
||||
G4VSensitiveDetector* G4LogicalVolume::GetMasterSensitiveDetector() const
|
||||
{
|
||||
return fSensitiveDetector;
|
||||
}
|
||||
@@ -269,7 +380,8 @@ G4VSensitiveDetector* G4LogicalVolume::GetSensitiveDetector() const
|
||||
inline
|
||||
void G4LogicalVolume::SetSensitiveDetector(G4VSensitiveDetector* pSDetector)
|
||||
{
|
||||
fSensitiveDetector = pSDetector;
|
||||
G4MT_sdetector = pSDetector;
|
||||
if(!G4Threading::IsWorkerThread()) fSensitiveDetector = pSDetector;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -423,7 +535,7 @@ void G4LogicalVolume::PropagateRegion()
|
||||
inline
|
||||
const G4MaterialCutsCouple* G4LogicalVolume::GetMaterialCutsCouple() const
|
||||
{
|
||||
return fCutsCouple;
|
||||
return G4MT_ccouple;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -433,7 +545,7 @@ const G4MaterialCutsCouple* G4LogicalVolume::GetMaterialCutsCouple() const
|
||||
inline
|
||||
void G4LogicalVolume::SetMaterialCutsCouple(G4MaterialCutsCouple* cuts)
|
||||
{
|
||||
fCutsCouple = cuts;
|
||||
G4MT_ccouple = cuts;
|
||||
}
|
||||
|
||||
// ********************************************************************
|
||||
@@ -495,4 +607,10 @@ G4double G4LogicalVolume::GetBiasWeight() const
|
||||
{
|
||||
return fBiasWeight;
|
||||
}
|
||||
|
||||
#undef G4MT_solid
|
||||
#undef G4MT_sdetector
|
||||
#undef G4MT_fmanager
|
||||
#undef G4MT_material
|
||||
// #undef G4MT_mass
|
||||
// #undef G4MT_ccouple
|
||||
#undef G4MT_instance
|
||||
|
||||
Reference in New Issue
Block a user