G4ParameterisationBoxZ Class Reference

#include <G4ParameterisationBox.hh>

Inheritance diagram for G4ParameterisationBoxZ:

G4VParameterisationBox G4VDivisionParameterisation G4VPVParameterisation

Public Member Functions

 G4ParameterisationBoxZ (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 ~G4ParameterisationBoxZ ()
G4double GetMaxParameter () const
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
void ComputeDimensions (G4Box &box, const G4int copyNo, const G4VPhysicalVolume *physVol) const

Detailed Description

Definition at line 160 of file G4ParameterisationBox.hh.


Constructor & Destructor Documentation

G4ParameterisationBoxZ::G4ParameterisationBoxZ ( EAxis  axis,
G4int  nCopies,
G4double  offset,
G4double  step,
G4VSolid msolid,
DivisionType  divType 
)

Definition at line 277 of file G4ParameterisationBox.cc.

References G4VDivisionParameterisation::CalculateNDiv(), G4VDivisionParameterisation::CalculateWidth(), G4VDivisionParameterisation::CheckParametersValidity(), DivNDIV, DivWIDTH, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fnDiv, G4VDivisionParameterisation::foffset, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Box::GetZHalfLength(), G4VDivisionParameterisation::SetType(), and G4VDivisionParameterisation::verbose.

00280   :  G4VParameterisationBox( axis, nDiv, width, offset, msolid, divType )
00281 {
00282   CheckParametersValidity();
00283   SetType( "DivisionBoxZ" );
00284 
00285   G4Box* mbox = (G4Box*)(fmotherSolid);
00286   if( divType == DivWIDTH )
00287   {
00288     fnDiv = CalculateNDiv( 2*mbox->GetZHalfLength(), width, offset );
00289   }
00290   else if ( divType == DivNDIV )
00291   {
00292     fwidth = CalculateWidth( 2*mbox->GetZHalfLength(), nDiv, offset );
00293   }
00294 #ifdef G4DIVDEBUG
00295   if( verbose >= 1 )
00296   {
00297     G4cout << " G4ParameterisationBoxZ - no divisions " << fnDiv << " = "
00298            << nDiv << ". Offset " << foffset << " = " << offset
00299            << ". Width " << fwidth << " = " << width << G4endl;
00300   }
00301 #endif
00302 }

G4ParameterisationBoxZ::~G4ParameterisationBoxZ (  ) 

Definition at line 305 of file G4ParameterisationBox.cc.

00306 {
00307 }


Member Function Documentation

void G4ParameterisationBoxZ::ComputeDimensions ( G4Box box,
const G4int  copyNo,
const G4VPhysicalVolume physVol 
) const [virtual]

Reimplemented from G4VPVParameterisation.

Definition at line 354 of file G4ParameterisationBox.cc.

References G4VSolid::DumpInfo(), G4VDivisionParameterisation::fhgap, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Box::GetXHalfLength(), G4Box::GetYHalfLength(), G4Box::SetXHalfLength(), G4Box::SetYHalfLength(), G4Box::SetZHalfLength(), and G4VDivisionParameterisation::verbose.

00356 {
00357   G4Box* msol = (G4Box*)(fmotherSolid);
00358 
00359   G4double pDx = msol->GetXHalfLength();
00360   G4double pDy = msol->GetYHalfLength();
00361   G4double pDz = fwidth/2. - fhgap;
00362 
00363   box.SetXHalfLength( pDx );
00364   box.SetYHalfLength( pDy );
00365   box.SetZHalfLength( pDz );
00366 
00367 #ifdef G4DIVDEBUG
00368   if( verbose >= 2 )
00369   {
00370     G4cout << " G4ParameterisationBoxZ::ComputeDimensions()" << G4endl
00371            << " pDx: " << pDz << G4endl;
00372     box.DumpInfo();
00373   }
00374 #endif
00375 }

void G4ParameterisationBoxZ::ComputeTransformation ( const G4int  copyNo,
G4VPhysicalVolume physVol 
) const [virtual]

Implements G4VDivisionParameterisation.

Definition at line 319 of file G4ParameterisationBox.cc.

References FatalException, G4VDivisionParameterisation::faxis, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Exception(), G4Box::GetZHalfLength(), kZAxis, G4VDivisionParameterisation::OffsetZ(), G4VPhysicalVolume::SetTranslation(), and G4VDivisionParameterisation::verbose.

00320 {
00321   G4Box* msol = (G4Box*)(fmotherSolid );
00322   G4double mdz = msol->GetZHalfLength();
00323 
00324    //----- translation 
00325   G4ThreeVector origin(0.,0.,0.); 
00326   G4double posi = -mdz + OffsetZ() + (copyNo+0.5)*fwidth;
00327 
00328   if( faxis == kZAxis )
00329   {
00330     origin.setZ( posi ); 
00331   }
00332   else
00333   { 
00334     std::ostringstream message;
00335     message << "Only axes along Z are allowed !  Axis: " << faxis;
00336     G4Exception("G4ParameterisationBoxZ::ComputeTransformation()",
00337                 "GeomDiv0002", FatalException, message);
00338   }
00339 #ifdef G4DIVDEBUG
00340   if( verbose >= 2 )
00341   {
00342     G4cout << std::setprecision(8) << " G4ParameterisationBoxZ: "
00343            << copyNo << G4endl
00344            << " Position " << origin << " Axis " << faxis << G4endl;
00345   }
00346 #endif
00347    //----- set translation 
00348   physVol->SetTranslation( origin );
00349 }

G4double G4ParameterisationBoxZ::GetMaxParameter (  )  const [virtual]

Implements G4VDivisionParameterisation.

Definition at line 310 of file G4ParameterisationBox.cc.

References G4VDivisionParameterisation::fmotherSolid, and G4Box::GetZHalfLength().

00311 {
00312   G4Box* msol = (G4Box*)(fmotherSolid);
00313   return 2*msol->GetZHalfLength();
00314 }


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