G4ParameterisationBoxX Class Reference

#include <G4ParameterisationBox.hh>

Inheritance diagram for G4ParameterisationBoxX:

G4VParameterisationBox G4VDivisionParameterisation G4VPVParameterisation

Public Member Functions

 G4ParameterisationBoxX (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 ~G4ParameterisationBoxX ()
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 75 of file G4ParameterisationBox.hh.


Constructor & Destructor Documentation

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

Definition at line 72 of file G4ParameterisationBox.cc.

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

00075   :  G4VParameterisationBox( axis, nDiv, width, offset, msolid, divType )
00076 {
00077   CheckParametersValidity();
00078   SetType( "DivisionBoxX" );
00079 
00080   G4Box* mbox = (G4Box*)(fmotherSolid);
00081   if( divType == DivWIDTH )
00082   {
00083     fnDiv = CalculateNDiv( 2*mbox->GetXHalfLength(), width, offset );
00084   }
00085   else if( divType == DivNDIV )
00086   {
00087     fwidth = CalculateWidth( 2*mbox->GetXHalfLength(), nDiv, offset );
00088   }
00089 #ifdef G4DIVDEBUG
00090   if( verbose >= 1 )
00091   {
00092     G4cout << " G4ParameterisationBoxX - no divisions "
00093            << fnDiv << " = " << nDiv << G4endl
00094            << " Offset " << foffset << " = " << offset << G4endl
00095            << " Width " << fwidth << " = " << width << G4endl;
00096   }
00097 #endif
00098 }

G4ParameterisationBoxX::~G4ParameterisationBoxX (  ) 

Definition at line 101 of file G4ParameterisationBox.cc.

00102 {
00103 }


Member Function Documentation

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

Reimplemented from G4VPVParameterisation.

Definition at line 150 of file G4ParameterisationBox.cc.

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

00152 {
00153   G4Box* msol = (G4Box*)(fmotherSolid);
00154 
00155   G4double pDx = fwidth/2. - fhgap;
00156   G4double pDy = msol->GetYHalfLength();
00157   G4double pDz = msol->GetZHalfLength();
00158 
00159   box.SetXHalfLength( pDx );
00160   box.SetYHalfLength( pDy );
00161   box.SetZHalfLength( pDz );
00162 
00163 #ifdef G4DIVDEBUG
00164   if( verbose >= 2 )
00165   {
00166     G4cout << " G4ParameterisationBoxX::ComputeDimensions()" << G4endl
00167            << " pDx: " << pDz << G4endl;
00168     box.DumpInfo();
00169   }
00170 #endif
00171 }

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

Implements G4VDivisionParameterisation.

Definition at line 115 of file G4ParameterisationBox.cc.

References FatalException, G4VDivisionParameterisation::faxis, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::foffset, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Exception(), G4Box::GetXHalfLength(), kXAxis, G4VPhysicalVolume::SetTranslation(), and G4VDivisionParameterisation::verbose.

00116 {
00117   G4Box* msol = (G4Box*)(fmotherSolid );
00118   G4double mdx = msol->GetXHalfLength( );
00119 
00120   //----- translation 
00121   G4ThreeVector origin(0.,0.,0.); 
00122   G4double posi = -mdx + foffset+(copyNo+0.5)*fwidth;
00123 
00124   if( faxis == kXAxis )
00125   {
00126     origin.setX( posi ); 
00127   }
00128   else
00129   {
00130     std::ostringstream message;
00131     message << "Only axes along X are allowed !  Axis: " << faxis;
00132     G4Exception("G4ParameterisationBoxX::ComputeTransformation()",
00133                 "GeomDiv0002", FatalException, message);
00134   }
00135 #ifdef G4DIVDEBUG
00136   if( verbose >= 2 )
00137   {
00138     G4cout << std::setprecision(8) << " G4ParameterisationBoxX: "
00139            << copyNo << G4endl
00140            << " Position " << origin << " Axis " << faxis << G4endl;
00141   }
00142 #endif
00143   //----- set translation 
00144   physVol->SetTranslation( origin );
00145 }

G4double G4ParameterisationBoxX::GetMaxParameter (  )  const [virtual]

Implements G4VDivisionParameterisation.

Definition at line 106 of file G4ParameterisationBox.cc.

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

00107 {
00108   G4Box* msol = (G4Box*)(fmotherSolid);
00109   return 2*msol->GetXHalfLength();
00110 }


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