Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4PVReplica Class Reference

#include <G4PVReplica.hh>

Inheritance diagram for G4PVReplica:
Collaboration diagram for G4PVReplica:

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 87 of file G4PVReplica.cc.

94  : G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0), fRegularVolsId(0)
95 {
96 
97  instanceID = subInstanceManager.CreateSubInstance();
98  G4MT_copyNo = -1;
99 
100  if (!pMotherLogical)
101  {
102  std::ostringstream message;
103  message << "NULL pointer specified as mother volume for "
104  << pName << ".";
105  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
106  FatalException, message);
107  return;
108  }
109  if (pLogical == pMotherLogical)
110  {
111  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
112  FatalException, "Cannot place a volume inside itself!");
113  return;
114  }
115  pMotherLogical->AddDaughter(this);
116  SetMotherLogical(pMotherLogical);
117  if (pMotherLogical->GetNoDaughters() != 1)
118  {
119  std::ostringstream message;
120  message << "Replica or parameterised volume must be the only daughter !"
121  << G4endl
122  << " Mother logical volume: " << pMotherLogical->GetName()
123  << G4endl
124  << " Replicated volume: " << pName;
125  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
126  FatalException, message);
127  return;
128  }
129  CheckAndSetParameters (pAxis, nReplicas, width, offset);
130 }
G4VPhysicalVolume(G4RotationMatrix *pRot, const G4ThreeVector &tlate, const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother)
CLHEP::Hep3Vector G4ThreeVector
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

Here is the call graph for this function:

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 40 of file G4PVReplica.cc.

47  : G4VPhysicalVolume(0, G4ThreeVector(), pName, pLogical, pMother),
48  fRegularVolsId(0)
49 {
50 
51  instanceID = subInstanceManager.CreateSubInstance();
52 
53  G4MT_copyNo = -1;
54 
55  if ((!pMother) || (!pMother->GetLogicalVolume()))
56  {
57  std::ostringstream message;
58  message << "NULL pointer specified as mother volume." << G4endl
59  << "The world volume cannot be sliced or parameterised !";
60  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
61  FatalException, message);
62  return;
63  }
64  G4LogicalVolume* motherLogical = pMother->GetLogicalVolume();
65  if (pLogical == motherLogical)
66  {
67  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
68  FatalException, "Cannot place a volume inside itself!");
69  return;
70  }
71  SetMotherLogical(motherLogical);
72  motherLogical->AddDaughter(this);
73  if (motherLogical->GetNoDaughters() != 1)
74  {
75  std::ostringstream message;
76  message << "Replica or parameterised volume must be the only daughter !"
77  << G4endl
78  << " Mother physical volume: " << pMother->GetName() << G4endl
79  << " Replicated volume: " << pName;
80  G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
81  FatalException, message);
82  return;
83  }
84  CheckAndSetParameters (pAxis, nReplicas, width, offset);
85 }
G4VPhysicalVolume(G4RotationMatrix *pRot, const G4ThreeVector &tlate, const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother)
CLHEP::Hep3Vector G4ThreeVector
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)

Here is the call graph for this function:

G4PVReplica::G4PVReplica ( __void__ &  a)

Definition at line 179 of file G4PVReplica.cc.

181  foffset(0.), fRegularStructureCode(0), fRegularVolsId(0)
182 {
183  instanceID = subInstanceManager.CreateSubInstance();
184  G4MT_copyNo = -1;
185 }
G4VPhysicalVolume(G4RotationMatrix *pRot, const G4ThreeVector &tlate, const G4String &pName, G4LogicalVolume *pLogical, G4VPhysicalVolume *pMother)
G4double fwidth
Definition: G4PVReplica.hh:201
G4int CreateSubInstance()
G4double foffset
Definition: G4PVReplica.hh:201
G4int fnReplicas
Definition: G4PVReplica.hh:200
#define G4MT_copyNo
Definition: G4PVReplica.hh:117

Here is the call graph for this function:

G4PVReplica::~G4PVReplica ( )
virtual

Definition at line 187 of file G4PVReplica.cc.

188 {
189  if ( faxis==kPhi )
190  {
191  delete GetRotation();
192  }
193 }
Definition: geomdefs.hh:54
const G4RotationMatrix * GetRotation() const

Here is the call graph for this function:

Member Function Documentation

G4int G4PVReplica::GetCopyNo ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 200 of file G4PVReplica.cc.

201 {
202  return G4MT_copyNo;
203 }
#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 225 of file G4PVReplica.cc.

226 {
227  return fnReplicas;
228 }
G4int fnReplicas
Definition: G4PVReplica.hh:200

Here is the caller graph for this function:

G4VPVParameterisation * G4PVReplica::GetParameterisation ( ) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 220 of file G4PVReplica.cc.

221 {
222  return 0;
223 }
G4int G4PVReplica::GetRegularStructureId ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 248 of file G4PVReplica.cc.

249 {
250  return fRegularVolsId;
251 }
void G4PVReplica::GetReplicationData ( EAxis axis,
G4int nReplicas,
G4double width,
G4double offset,
G4bool consuming 
) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 230 of file G4PVReplica.cc.

235 {
236  axis = faxis;
237  nReplicas = fnReplicas;
238  width = fwidth;
239  offset = foffset;
240  consuming = true;
241 }
G4double fwidth
Definition: G4PVReplica.hh:201
G4double foffset
Definition: G4PVReplica.hh:201
G4int fnReplicas
Definition: G4PVReplica.hh:200

Here is the caller graph for this function:

const G4PVRManager & G4PVReplica::GetSubInstanceManager ( )
static

Definition at line 260 of file G4PVReplica.cc.

261 {
262  return subInstanceManager;
263 }

Here is the caller graph for this function:

void G4PVReplica::InitialiseWorker ( G4PVReplica pMasterObject)

Definition at line 271 of file G4PVReplica.cc.

272 {
273 
275  subInstanceManager.SlaveCopySubInstanceArray();
276  G4MT_copyNo = -1;
277 
278  // This call causes "self-assignment" of the input paramters
279  // Issue reported by DRD since TerminateWorker below can be called
280  // at the same time by another thread
281  // What we need here is the splic-class component of this funciton
282  // that is copied here
283  // CheckAndSetParameters (faxis, fnReplicas, fwidth, foffset);
284 
285  // Create rotation matrix for phi axis case & check axis is valid
286  //
287  G4RotationMatrix* pRMat=0;
288  switch (faxis)
289  {
290  case kPhi:
291  pRMat=new G4RotationMatrix();
292  if (!pRMat)
293  {
294  G4Exception("G4PVReplica::InitialiseWorker(...)", "GeomVol0003",
295  FatalException, "Rotation matrix allocation failed.");
296  }
297  SetRotation(pRMat);
298  break;
299  case kRho:
300  case kXAxis:
301  case kYAxis:
302  case kZAxis:
303  case kUndefined:
304  break;
305  default:
306  G4Exception("G4PVReplica::InitialiseWorker(...)", "GeomVol0002",
307  FatalException, "Unknown axis of replication.");
308  break;
309  }
310 }
Definition: geomdefs.hh:54
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
void SetRotation(G4RotationMatrix *)
void InitialiseWorker(G4VPhysicalVolume *pMasterObject, G4RotationMatrix *pRot, const G4ThreeVector &tlate)
void SlaveCopySubInstanceArray()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
Definition: geomdefs.hh:54
#define G4MT_copyNo
Definition: G4PVReplica.hh:117

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4PVReplica::IsMany ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 195 of file G4PVReplica.cc.

196 {
197  return false;
198 }
G4bool G4PVReplica::IsParameterised ( ) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 215 of file G4PVReplica.cc.

216 {
217  return false;
218 }

Here is the caller graph for this function:

G4bool G4PVReplica::IsRegularStructure ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 243 of file G4PVReplica.cc.

244 {
245  return (fRegularVolsId!=0);
246 }
G4bool G4PVReplica::IsReplicated ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 210 of file G4PVReplica.cc.

211 {
212  return true;
213 }
void G4PVReplica::SetCopyNo ( G4int  CopyNo)
virtual

Implements G4VPhysicalVolume.

Definition at line 205 of file G4PVReplica.cc.

206 {
207  G4MT_copyNo = newCopyNo;
208 }
#define G4MT_copyNo
Definition: G4PVReplica.hh:117
void G4PVReplica::SetRegularStructureId ( G4int  Code)
virtual

Reimplemented in G4PVParameterised.

Definition at line 253 of file G4PVReplica.cc.

254 {
255  fRegularVolsId= Code;
256 }
#define Code
Definition: deflate.h:77

Here is the caller graph for this function:

void G4PVReplica::TerminateWorker ( G4PVReplica pMasterObject)

Definition at line 316 of file G4PVReplica.cc.

317 {
318  if ( faxis==kPhi )
319  {
320  delete GetRotation();
321  }
322 }
Definition: geomdefs.hh:54
const G4RotationMatrix * GetRotation() const

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

EAxis G4PVReplica::faxis
protected

Definition at line 199 of file G4PVReplica.hh.

G4int G4PVReplica::fnReplicas
protected

Definition at line 200 of file G4PVReplica.hh.

G4double G4PVReplica::foffset
protected

Definition at line 201 of file G4PVReplica.hh.

G4double G4PVReplica::fwidth
protected

Definition at line 201 of file G4PVReplica.hh.


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