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

Protected Attributes

EAxis faxis
G4int fnReplicas
G4double fwidth
G4double foffset
G4int fcopyNo

Detailed Description

Definition at line 77 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 79 of file G4PVReplica.cc.

References G4LogicalVolume::AddDaughter(), FatalException, G4endl, G4Exception(), G4LogicalVolume::GetName(), G4LogicalVolume::GetNoDaughters(), and G4VPhysicalVolume::SetMotherLogical().

00086   : G4VPhysicalVolume(0,G4ThreeVector(),pName,pLogical,0),
00087     fcopyNo(-1), fRegularVolsId(0)
00088 {
00089   if (!pMotherLogical)
00090   {
00091     std::ostringstream message;
00092     message << "NULL pointer specified as mother volume for "
00093             << pName << ".";
00094     G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
00095                 FatalException, message);
00096     return;
00097   }
00098   if (pLogical == pMotherLogical)
00099   {
00100     G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
00101                 FatalException, "Cannot place a volume inside itself!");
00102     return;
00103   }
00104   pMotherLogical->AddDaughter(this);
00105   SetMotherLogical(pMotherLogical);
00106   if (pMotherLogical->GetNoDaughters() != 1)
00107   {
00108     std::ostringstream message;
00109     message << "Replica or parameterised volume must be the only daughter !"
00110             << G4endl
00111             << "     Mother logical volume: " << pMotherLogical->GetName()
00112             << G4endl
00113             << "     Replicated volume: " << pName;
00114     G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
00115                 FatalException, message);
00116     return;
00117   }
00118   CheckAndSetParameters (pAxis, nReplicas, width, offset);
00119 }

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.

References G4LogicalVolume::AddDaughter(), FatalException, G4endl, G4Exception(), G4VPhysicalVolume::GetLogicalVolume(), G4VPhysicalVolume::GetName(), G4LogicalVolume::GetNoDaughters(), and G4VPhysicalVolume::SetMotherLogical().

00044   : G4VPhysicalVolume(0, G4ThreeVector(), pName, pLogical, pMother),
00045     fcopyNo(-1), fRegularVolsId(0)
00046 {
00047   if ((!pMother) || (!pMother->GetLogicalVolume()))
00048   {
00049     std::ostringstream message;
00050     message << "NULL pointer specified as mother volume." << G4endl
00051             << "The world volume cannot be sliced or parameterised !";
00052     G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
00053                 FatalException, message);
00054     return;
00055   }
00056   G4LogicalVolume* motherLogical = pMother->GetLogicalVolume();
00057   if (pLogical == motherLogical)
00058   {
00059     G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
00060                 FatalException, "Cannot place a volume inside itself!");
00061     return;
00062   }
00063   SetMotherLogical(motherLogical);
00064   motherLogical->AddDaughter(this);
00065   if (motherLogical->GetNoDaughters() != 1)
00066   {
00067     std::ostringstream message;
00068     message << "Replica or parameterised volume must be the only daughter !"
00069             << G4endl
00070             << "     Mother physical volume: " << pMother->GetName() << G4endl
00071             << "     Replicated volume: " << pName;
00072     G4Exception("G4PVReplica::G4PVReplica()", "GeomVol0002",
00073                 FatalException, message);
00074     return;
00075   }
00076   CheckAndSetParameters (pAxis, nReplicas, width, offset);
00077 }

G4PVReplica::G4PVReplica ( __void__ &   ) 

Definition at line 168 of file G4PVReplica.cc.

00169   : G4VPhysicalVolume(a), faxis(kZAxis), fnReplicas(0), fwidth(0.),
00170     foffset(0.), fcopyNo(-1), fRegularStructureCode(0), fRegularVolsId(0)
00171 {
00172 }

G4PVReplica::~G4PVReplica (  )  [virtual]

Definition at line 174 of file G4PVReplica.cc.

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

00175 {
00176   if ( faxis==kPhi )
00177   {
00178     delete GetRotation();
00179   }
00180 }


Member Function Documentation

G4int G4PVReplica::GetCopyNo (  )  const [virtual]

Implements G4VPhysicalVolume.

Definition at line 187 of file G4PVReplica.cc.

References fcopyNo.

00188 {
00189   return fcopyNo;
00190 }

G4int G4PVReplica::GetMultiplicity (  )  const [virtual]

Reimplemented from G4VPhysicalVolume.

Definition at line 212 of file G4PVReplica.cc.

References fnReplicas.

Referenced by G4PVParameterised::CheckOverlaps().

00213 {
00214   return fnReplicas;
00215 }

G4VPVParameterisation * G4PVReplica::GetParameterisation (  )  const [virtual]

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 207 of file G4PVReplica.cc.

00208 {
00209   return 0;
00210 }

G4int G4PVReplica::GetRegularStructureId (  )  const [virtual]

Implements G4VPhysicalVolume.

Definition at line 237 of file G4PVReplica.cc.

00238 {
00239   return fRegularVolsId; 
00240 }

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.

References faxis, fnReplicas, foffset, and fwidth.

Referenced by G4tgbGeometryDumper::DumpPVReplica().

00224 {
00225   axis = faxis;
00226   nReplicas = fnReplicas;
00227   width = fwidth;
00228   offset = foffset;
00229   consuming = true;
00230 }

G4bool G4PVReplica::IsMany (  )  const [virtual]

Implements G4VPhysicalVolume.

Definition at line 182 of file G4PVReplica.cc.

00183 {
00184   return false; 
00185 }

G4bool G4PVReplica::IsParameterised (  )  const [virtual]

Implements G4VPhysicalVolume.

Reimplemented in G4PVParameterised.

Definition at line 202 of file G4PVReplica.cc.

00203 {
00204   return false;
00205 }

G4bool G4PVReplica::IsRegularStructure (  )  const [virtual]

Implements G4VPhysicalVolume.

Definition at line 232 of file G4PVReplica.cc.

00233 {
00234   return (fRegularVolsId!=0); 
00235 }

G4bool G4PVReplica::IsReplicated (  )  const [virtual]

Implements G4VPhysicalVolume.

Definition at line 197 of file G4PVReplica.cc.

00198 {
00199   return true;
00200 }

void G4PVReplica::SetCopyNo ( G4int  CopyNo  )  [virtual]

Implements G4VPhysicalVolume.

Definition at line 192 of file G4PVReplica.cc.

References fcopyNo.

00193 {
00194   fcopyNo = newCopyNo;
00195 }

void G4PVReplica::SetRegularStructureId ( G4int  Code  )  [virtual]

Reimplemented in G4PVParameterised.

Definition at line 242 of file G4PVReplica.cc.

Referenced by G4PVParameterised::SetRegularStructureId().

00243 {
00244   fRegularVolsId= Code; 
00245 } 


Field Documentation

EAxis G4PVReplica::faxis [protected]

Definition at line 134 of file G4PVReplica.hh.

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

G4int G4PVReplica::fcopyNo [protected]

Definition at line 137 of file G4PVReplica.hh.

Referenced by GetCopyNo(), and SetCopyNo().

G4int G4PVReplica::fnReplicas [protected]

Definition at line 135 of file G4PVReplica.hh.

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

G4double G4PVReplica::foffset [protected]

Definition at line 136 of file G4PVReplica.hh.

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

G4double G4PVReplica::fwidth [protected]

Definition at line 136 of file G4PVReplica.hh.

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


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:04 2013 for Geant4 by  doxygen 1.4.7