Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Attributes
G4PVReplica Class Reference

#include <G4PVReplica.hh>

Inheritance diagram for G4PVReplica:
G4VPhysicalVolume G4PVParameterised

Public Member Functions

 G4PVReplica (const G4String &pName, G4LogicalVolume *pLogical, G4LogicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset=0)
 
 G4PVReplica (const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother, const EAxis pAxis, const G4int nReplicas, const G4double width, const G4double offset=0)
 
 G4PVReplica (__void__ &)
 
virtual ~G4PVReplica ()
 
G4bool IsMany () const
 
G4bool IsReplicated () const
 
virtual G4int GetCopyNo () const
 
virtual void SetCopyNo (G4int CopyNo)
 
virtual G4bool IsParameterised () const
 
virtual G4VPVParameterisationGetParameterisation () const
 
virtual G4int GetMultiplicity () const
 
virtual void GetReplicationData (EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const
 
virtual void SetRegularStructureId (G4int Code)
 
G4bool IsRegularStructure () const
 
G4int GetRegularStructureId () const
 
G4int GetInstanceID () const
 
void InitialiseWorker (G4PVReplica *pMasterObject)
 
void TerminateWorker (G4PVReplica *pMasterObject)
 
- Public Member Functions inherited from G4VPhysicalVolume
 G4VPhysicalVolume (G4RotationMatrix *pRot, const G4ThreeVector &tlate, const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother)
 
virtual ~G4VPhysicalVolume ()
 
G4bool operator== (const G4VPhysicalVolume &p) const
 
G4RotationMatrixGetObjectRotation () const
 
G4RotationMatrix GetObjectRotationValue () const
 
G4ThreeVector GetObjectTranslation () const
 
const G4RotationMatrixGetFrameRotation () const
 
G4ThreeVector GetFrameTranslation () const
 
const G4ThreeVectorGetTranslation () const
 
const G4RotationMatrixGetRotation () const
 
void SetTranslation (const G4ThreeVector &v)
 
G4RotationMatrixGetRotation ()
 
void SetRotation (G4RotationMatrix *)
 
G4LogicalVolumeGetLogicalVolume () const
 
void SetLogicalVolume (G4LogicalVolume *pLogical)
 
G4LogicalVolumeGetMotherLogical () const
 
void SetMotherLogical (G4LogicalVolume *pMother)
 
const G4StringGetName () const
 
void SetName (const G4String &pName)
 
EVolume VolumeType () const
 
virtual G4bool CheckOverlaps (G4int res=1000, G4double tol=0., G4bool verbose=true, G4int errMax=1)
 
 G4VPhysicalVolume (__void__ &)
 
G4int GetInstanceID () const
 

Static Public Member Functions

static const G4PVRManagerGetSubInstanceManager ()
 
- Static Public Member Functions inherited from G4VPhysicalVolume
static const G4PVManagerGetSubInstanceManager ()
 

Protected Attributes

EAxis faxis
 
G4int fnReplicas
 
G4double fwidth
 
G4double foffset
 
- Protected Attributes inherited from G4VPhysicalVolume
G4int instanceID
 

Additional Inherited Members

- Protected Member Functions inherited from G4VPhysicalVolume
void InitialiseWorker (G4VPhysicalVolume *pMasterObject, G4RotationMatrix *pRot, const G4ThreeVector &tlate)
 
void TerminateWorker (G4VPhysicalVolume *pMasterObject)
 
- Static Protected Attributes inherited from G4VPhysicalVolume
static G4GEOM_DLL G4PVManager subInstanceManager
 

Detailed Description

Definition at line 119 of file G4PVReplica.hh.

Constructor & Destructor Documentation

G4PVReplica::G4PVReplica ( const G4String pName,
G4LogicalVolume pLogical,
G4LogicalVolume pMother,
const EAxis  pAxis,
const G4int  nReplicas,
const G4double  width,
const G4double  offset = 0 
)

Definition at line 91 of file G4PVReplica.cc.

References G4LogicalVolume::AddDaughter(), G4GeomSplitter< T >::CreateSubInstance(), FatalException, G4endl, G4Exception(), G4MT_copyNo, G4LogicalVolume::GetName(), G4LogicalVolume::GetNoDaughters(), and G4VPhysicalVolume::SetMotherLogical().

98  : G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0), fRegularVolsId(0)
99 {
100 
101  instanceID = subInstanceManager.CreateSubInstance();
102  G4MT_copyNo = -1;
103 
104  if (!pMotherLogical)
105  {
106  std::ostringstream message;
107  message << "NULL pointer specified as mother volume for "
108  << pName << ".";
109  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
110  FatalException, message);
111  return;
112  }
113  if (pLogical == pMotherLogical)
114  {
115  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
116  FatalException, "Cannot place a volume inside itself!");
117  return;
118  }
119  pMotherLogical->AddDaughter(this);
120  SetMotherLogical(pMotherLogical);
121  if (pMotherLogical->GetNoDaughters() != 1)
122  {
123  std::ostringstream message;
124  message << "Replica or parameterised volume must be the only daughter !"
125  << G4endl
126  << " Mother logical volume: " << pMotherLogical->GetName()
127  << G4endl
128  << " Replicated volume: " << pName;
129  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
130  FatalException, message);
131  return;
132  }
133  CheckAndSetParameters (pAxis, nReplicas, width, offset);
134 }
G4VPhysicalVolume(G4RotationMatrix *pRot, const G4ThreeVector &tlate, const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother)
CLHEP::Hep3Vector G4ThreeVector
#define width
G4int CreateSubInstance()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
void SetMotherLogical(G4LogicalVolume *pMother)
#define G4MT_copyNo
Definition: G4PVReplica.hh:117
G4PVReplica::G4PVReplica ( const G4String pName,
G4LogicalVolume pLogical,
G4VPhysicalVolume pMother,
const EAxis  pAxis,
const G4int  nReplicas,
const G4double  width,
const G4double  offset = 0 
)

Definition at line 45 of file G4PVReplica.cc.

References G4LogicalVolume::AddDaughter(), G4GeomSplitter< T >::CreateSubInstance(), FatalException, G4endl, G4Exception(), G4MT_copyNo, G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetName(), G4LogicalVolume::GetNoDaughters(), and G4VPhysicalVolume::SetMotherLogical().

52  : G4VPhysicalVolume(0, G4ThreeVector(), pName, pLogical, pMother), fRegularVolsId(0)
53 {
54 
55  instanceID = subInstanceManager.CreateSubInstance();
56 
57  G4MT_copyNo = -1;
58 
59  if ((!pMother) || (!pMother->GetLogicalVolume()))
60  {
61  std::ostringstream message;
62  message << "NULL pointer specified as mother volume." << G4endl
63  << "The world volume cannot be sliced or parameterised !";
64  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
65  FatalException, message);
66  return;
67  }
68  G4LogicalVolume* motherLogical = pMother->GetLogicalVolume();
69  if (pLogical == motherLogical)
70  {
71  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
72  FatalException, "Cannot place a volume inside itself!");
73  return;
74  }
75  SetMotherLogical(motherLogical);
76  motherLogical->AddDaughter(this);
77  if (motherLogical->GetNoDaughters() != 1)
78  {
79  std::ostringstream message;
80  message << "Replica or parameterised volume must be the only daughter !"
81  << G4endl
82  << " Mother physical volume: " << pMother->GetName() << G4endl
83  << " Replicated volume: " << pName;
84  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
85  FatalException, message);
86  return;
87  }
88  CheckAndSetParameters (pAxis, nReplicas, width, offset);
89 }
G4VPhysicalVolume(G4RotationMatrix *pRot, const G4ThreeVector &tlate, const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother)
CLHEP::Hep3Vector G4ThreeVector
#define width
G4int CreateSubInstance()
const G4String & GetName() const
G4int GetNoDaughters() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4LogicalVolume * GetLogicalVolume() const
#define G4endl
Definition: G4ios.hh:61
void SetMotherLogical(G4LogicalVolume *pMother)
#define G4MT_copyNo
Definition: G4PVReplica.hh:117
void AddDaughter(G4VPhysicalVolume *p)
G4PVReplica::G4PVReplica ( __void__ &  a)

Definition at line 183 of file G4PVReplica.cc.

References G4GeomSplitter< T >::CreateSubInstance(), and G4MT_copyNo.

185  foffset(0.), fRegularStructureCode(0), fRegularVolsId(0)
186 {
187  instanceID = subInstanceManager.CreateSubInstance();
188  G4MT_copyNo = -1;
189 }
G4VPhysicalVolume(G4RotationMatrix *pRot, const G4ThreeVector &tlate, const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother)
G4double fwidth
Definition: G4PVReplica.hh:194
G4int CreateSubInstance()
G4double foffset
Definition: G4PVReplica.hh:194
G4int fnReplicas
Definition: G4PVReplica.hh:193
#define G4MT_copyNo
Definition: G4PVReplica.hh:117
G4PVReplica::~G4PVReplica ( )
virtual

Definition at line 191 of file G4PVReplica.cc.

References faxis, G4VPhysicalVolume::GetRotation(), and kPhi.

192 {
193  if ( faxis==kPhi )
194  {
195  delete GetRotation();
196  }
197 }
Definition: geomdefs.hh:54
const G4RotationMatrix * GetRotation() const

Member Function Documentation

G4int G4PVReplica::GetCopyNo ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 204 of file G4PVReplica.cc.

References G4MT_copyNo.

205 {
206  return G4MT_copyNo;
207 }
#define G4MT_copyNo
Definition: G4PVReplica.hh:117
G4int G4PVReplica::GetInstanceID ( ) const
inline

Definition at line 176 of file G4PVReplica.hh.

176 { return instanceID; }
G4int G4PVReplica::GetMultiplicity ( ) const
virtual

Reimplemented from G4VPhysicalVolume.

Definition at line 229 of file G4PVReplica.cc.

References fnReplicas.

Referenced by G4PVParameterised::CheckOverlaps(), G4GeometryWorkspace::CloneParameterisedSolids(), and export_G4PVReplica().

230 {
231  return fnReplicas;
232 }
G4int fnReplicas
Definition: G4PVReplica.hh:193
G4VPVParameterisation * G4PVReplica::GetParameterisation ( ) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 224 of file G4PVReplica.cc.

225 {
226  return 0;
227 }
G4int G4PVReplica::GetRegularStructureId ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 254 of file G4PVReplica.cc.

255 {
256  return fRegularVolsId;
257 }
void G4PVReplica::GetReplicationData ( EAxis axis,
G4int nReplicas,
G4double width,
G4double offset,
G4bool consuming 
) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 236 of file G4PVReplica.cc.

References faxis, fnReplicas, foffset, and fwidth.

Referenced by G4tgbGeometryDumper::DumpPVReplica().

241 {
242  axis = faxis;
243  nReplicas = fnReplicas;
244  width = fwidth;
245  offset = foffset;
246  consuming = true;
247 }
#define width
G4double fwidth
Definition: G4PVReplica.hh:194
G4double foffset
Definition: G4PVReplica.hh:194
G4int fnReplicas
Definition: G4PVReplica.hh:193
const G4PVRManager & G4PVReplica::GetSubInstanceManager ( )
static

Definition at line 275 of file G4PVReplica.cc.

Referenced by G4GeometryWorkspace::G4GeometryWorkspace().

276 {
277  return subInstanceManager;
278 }
void G4PVReplica::InitialiseWorker ( G4PVReplica pMasterObject)

Definition at line 287 of file G4PVReplica.cc.

References faxis, fnReplicas, foffset, fwidth, G4MT_copyNo, G4VPhysicalVolume::InitialiseWorker(), and G4GeomSplitter< T >::SlaveCopySubInstanceArray().

Referenced by G4GeometryWorkspace::InitialisePhysicalVolumes().

288 {
289 
291  subInstanceManager.SlaveCopySubInstanceArray();
292  G4MT_copyNo = -1;
293  CheckAndSetParameters (faxis, fnReplicas, fwidth, foffset);
294 }
CLHEP::Hep3Vector G4ThreeVector
G4double fwidth
Definition: G4PVReplica.hh:194
G4double foffset
Definition: G4PVReplica.hh:194
void InitialiseWorker(G4VPhysicalVolume *pMasterObject, G4RotationMatrix *pRot, const G4ThreeVector &tlate)
G4int fnReplicas
Definition: G4PVReplica.hh:193
void SlaveCopySubInstanceArray()
#define G4MT_copyNo
Definition: G4PVReplica.hh:117
G4bool G4PVReplica::IsMany ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 199 of file G4PVReplica.cc.

200 {
201  return false;
202 }
G4bool G4PVReplica::IsParameterised ( ) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 219 of file G4PVReplica.cc.

Referenced by G4GeometryWorkspace::InitialisePhysicalVolumes().

220 {
221  return false;
222 }
G4bool G4PVReplica::IsRegularStructure ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 249 of file G4PVReplica.cc.

250 {
251  return (fRegularVolsId!=0);
252 }
G4bool G4PVReplica::IsReplicated ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 214 of file G4PVReplica.cc.

215 {
216  return true;
217 }
void G4PVReplica::SetCopyNo ( G4int  CopyNo)
virtual

Implements G4VPhysicalVolume.

Definition at line 209 of file G4PVReplica.cc.

References G4MT_copyNo.

210 {
211  G4MT_copyNo = newCopyNo;
212 }
#define G4MT_copyNo
Definition: G4PVReplica.hh:117
void G4PVReplica::SetRegularStructureId ( G4int  Code)
virtual

Reimplemented in G4PVParameterised.

Definition at line 259 of file G4PVReplica.cc.

References Code.

Referenced by G4PVParameterised::SetRegularStructureId().

260 {
261  fRegularVolsId= Code;
262 }
#define Code
Definition: deflate.h:77
void G4PVReplica::TerminateWorker ( G4PVReplica pMasterObject)

Definition at line 300 of file G4PVReplica.cc.

References faxis, G4VPhysicalVolume::GetRotation(), and kPhi.

Referenced by G4GeometryWorkspace::DestroyWorkspace().

301 {
302  if ( faxis==kPhi )
303  {
304  delete GetRotation();
305  }
306 }
Definition: geomdefs.hh:54
const G4RotationMatrix * GetRotation() const

Field Documentation

EAxis G4PVReplica::faxis
protected
G4int G4PVReplica::fnReplicas
protected
G4double G4PVReplica::foffset
protected
G4double G4PVReplica::fwidth
protected

The documentation for this class was generated from the following files: