Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PVReplica Class Reference

#include <G4PVReplica.hh>

+ Inheritance 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
 
- 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)
 
virtual G4int GetMultiplicity () const
 
virtual G4bool IsMany () const =0
 
virtual G4int GetCopyNo () const =0
 
virtual void SetCopyNo (G4int CopyNo)=0
 
virtual G4bool IsReplicated () const =0
 
virtual G4bool IsParameterised () const =0
 
virtual G4VPVParameterisationGetParameterisation () const =0
 
virtual void GetReplicationData (EAxis &axis, G4int &nReplicas, G4double &width, G4double &offset, G4bool &consuming) const =0
 
virtual G4bool IsRegularStructure () const =0
 
virtual G4int GetRegularStructureId () const =0
 
virtual G4bool CheckOverlaps (G4int res=1000, G4double tol=0., G4bool verbose=true)
 
 G4VPhysicalVolume (__void__ &)
 

Protected Attributes

EAxis faxis
 
G4int fnReplicas
 
G4double fwidth
 
G4double foffset
 
G4int fcopyNo
 
- Protected Attributes inherited from G4VPhysicalVolume
G4RotationMatrixfrot
 
G4ThreeVector ftrans
 

Detailed Description

Definition at line 77 of file G4PVReplica.hh.

Constructor & Destructor Documentation

◆ G4PVReplica() [1/3]

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

86 : G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0),
87 fcopyNo(-1), fRegularVolsId(0)
88{
89 if (!pMotherLogical)
90 {
91 std::ostringstream message;
92 message << "NULL pointer specified as mother volume for "
93 << pName << ".";
94 G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
95 FatalException, message);
96 return;
97 }
98 if (pLogical == pMotherLogical)
99 {
100 G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
101 FatalException, "Cannot place a volume inside itself!");
102 return;
103 }
104 pMotherLogical->AddDaughter(this);
105 SetMotherLogical(pMotherLogical);
106 if (pMotherLogical->GetNoDaughters() != 1)
107 {
108 std::ostringstream message;
109 message << "Replica or parameterised volume must be the only daughter !"
110 << G4endl
111 << " Mother logical volume: " << pMotherLogical->GetName()
112 << G4endl
113 << " Replicated volume: " << pName;
114 G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
115 FatalException, message);
116 return;
117 }
118 CheckAndSetParameters (pAxis, nReplicas, width, offset);
119}
@ FatalException
CLHEP::Hep3Vector G4ThreeVector
#define G4endl
Definition: G4ios.hh:52
void SetMotherLogical(G4LogicalVolume *pMother)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ G4PVReplica() [2/3]

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

44 : G4VPhysicalVolume(0, G4ThreeVector(), pName, pLogical, pMother),
45 fcopyNo(-1), fRegularVolsId(0)
46{
47 if ((!pMother) || (!pMother->GetLogicalVolume()))
48 {
49 std::ostringstream message;
50 message << "NULL pointer specified as mother volume." << G4endl
51 << "The world volume cannot be sliced or parameterised !";
52 G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
53 FatalException, message);
54 return;
55 }
56 G4LogicalVolume* motherLogical = pMother->GetLogicalVolume();
57 if (pLogical == motherLogical)
58 {
59 G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
60 FatalException, "Cannot place a volume inside itself!");
61 return;
62 }
63 SetMotherLogical(motherLogical);
64 motherLogical->AddDaughter(this);
65 if (motherLogical->GetNoDaughters() != 1)
66 {
67 std::ostringstream message;
68 message << "Replica or parameterised volume must be the only daughter !"
69 << G4endl
70 << " Mother physical volume: " << pMother->GetName() << G4endl
71 << " Replicated volume: " << pName;
72 G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
73 FatalException, message);
74 return;
75 }
76 CheckAndSetParameters (pAxis, nReplicas, width, offset);
77}
G4int GetNoDaughters() const
void AddDaughter(G4VPhysicalVolume *p)
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const

◆ G4PVReplica() [3/3]

G4PVReplica::G4PVReplica ( __void__ &  a)

Definition at line 168 of file G4PVReplica.cc.

170 foffset(0.), fcopyNo(-1), fRegularStructureCode(0), fRegularVolsId(0)
171{
172}
G4double fwidth
Definition: G4PVReplica.hh:136
G4int fnReplicas
Definition: G4PVReplica.hh:135
G4double foffset
Definition: G4PVReplica.hh:136
@ kZAxis
Definition: geomdefs.hh:54

◆ ~G4PVReplica()

G4PVReplica::~G4PVReplica ( )
virtual

Definition at line 174 of file G4PVReplica.cc.

175{
176 if ( faxis==kPhi )
177 {
178 delete GetRotation();
179 }
180}
const G4RotationMatrix * GetRotation() const
@ kPhi
Definition: geomdefs.hh:54

Member Function Documentation

◆ GetCopyNo()

G4int G4PVReplica::GetCopyNo ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 187 of file G4PVReplica.cc.

188{
189 return fcopyNo;
190}

◆ GetMultiplicity()

G4int G4PVReplica::GetMultiplicity ( ) const
virtual

Reimplemented from G4VPhysicalVolume.

Definition at line 212 of file G4PVReplica.cc.

213{
214 return fnReplicas;
215}

Referenced by G4PVParameterised::CheckOverlaps().

◆ GetParameterisation()

G4VPVParameterisation * G4PVReplica::GetParameterisation ( ) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 207 of file G4PVReplica.cc.

208{
209 return 0;
210}

◆ GetRegularStructureId()

G4int G4PVReplica::GetRegularStructureId ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 237 of file G4PVReplica.cc.

238{
239 return fRegularVolsId;
240}

◆ GetReplicationData()

void G4PVReplica::GetReplicationData ( EAxis axis,
G4int nReplicas,
G4double width,
G4double offset,
G4bool consuming 
) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 219 of file G4PVReplica.cc.

224{
225 axis = faxis;
226 nReplicas = fnReplicas;
227 width = fwidth;
228 offset = foffset;
229 consuming = true;
230}

Referenced by G4tgbGeometryDumper::DumpPVReplica().

◆ IsMany()

G4bool G4PVReplica::IsMany ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 182 of file G4PVReplica.cc.

183{
184 return false;
185}

◆ IsParameterised()

G4bool G4PVReplica::IsParameterised ( ) const
virtual

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 202 of file G4PVReplica.cc.

203{
204 return false;
205}

◆ IsRegularStructure()

G4bool G4PVReplica::IsRegularStructure ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 232 of file G4PVReplica.cc.

233{
234 return (fRegularVolsId!=0);
235}

◆ IsReplicated()

G4bool G4PVReplica::IsReplicated ( ) const
virtual

Implements G4VPhysicalVolume.

Definition at line 197 of file G4PVReplica.cc.

198{
199 return true;
200}

◆ SetCopyNo()

void G4PVReplica::SetCopyNo ( G4int  CopyNo)
virtual

Implements G4VPhysicalVolume.

Definition at line 192 of file G4PVReplica.cc.

193{
194 fcopyNo = newCopyNo;
195}

◆ SetRegularStructureId()

void G4PVReplica::SetRegularStructureId ( G4int  Code)
virtual

Reimplemented in G4PVParameterised.

Definition at line 242 of file G4PVReplica.cc.

243{
244 fRegularVolsId= Code;
245}
#define Code
Definition: deflate.h:70

Referenced by G4PVParameterised::SetRegularStructureId().

Member Data Documentation

◆ faxis

EAxis G4PVReplica::faxis
protected

◆ fcopyNo

G4int G4PVReplica::fcopyNo
protected

Definition at line 137 of file G4PVReplica.hh.

Referenced by GetCopyNo(), and SetCopyNo().

◆ fnReplicas

G4int G4PVReplica::fnReplicas
protected

◆ foffset

G4double G4PVReplica::foffset
protected

Definition at line 136 of file G4PVReplica.hh.

Referenced by G4PVParameterised::GetReplicationData(), and GetReplicationData().

◆ fwidth

G4double G4PVReplica::fwidth
protected

Definition at line 136 of file G4PVReplica.hh.

Referenced by G4PVParameterised::GetReplicationData(), and GetReplicationData().


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