G4ParameterisationConsRho Class Reference

#include <G4ParameterisationCons.hh>

Inheritance diagram for G4ParameterisationConsRho:

G4VParameterisationCons G4VDivisionParameterisation G4VPVParameterisation

Public Member Functions

 G4ParameterisationConsRho (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
 ~G4ParameterisationConsRho ()
G4double GetMaxParameter () const
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const
void ComputeDimensions (G4Cons &tubs, const G4int copyNo, const G4VPhysicalVolume *physVol) const

Detailed Description

Definition at line 76 of file G4ParameterisationCons.hh.


Constructor & Destructor Documentation

G4ParameterisationConsRho::G4ParameterisationConsRho ( EAxis  axis,
G4int  nCopies,
G4double  offset,
G4double  step,
G4VSolid motherSolid,
DivisionType  divType 
)

Definition at line 82 of file G4ParameterisationCons.cc.

References G4VDivisionParameterisation::CalculateNDiv(), G4VDivisionParameterisation::CalculateWidth(), G4VDivisionParameterisation::CheckParametersValidity(), DivNDIV, DivWIDTH, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fnDiv, G4VDivisionParameterisation::foffset, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Exception(), G4Cons::GetInnerRadiusMinusZ(), G4Cons::GetInnerRadiusPlusZ(), G4Cons::GetOuterRadiusMinusZ(), JustWarning, G4VDivisionParameterisation::SetType(), and G4VDivisionParameterisation::verbose.

00085   :  G4VParameterisationCons( axis, nDiv, width, offset, msolid, divType )
00086 {
00087   CheckParametersValidity();
00088   SetType( "DivisionConsRho" );
00089 
00090   G4Cons* msol = (G4Cons*)(fmotherSolid);
00091   if( msol->GetInnerRadiusPlusZ() == 0. )
00092   {
00093     std::ostringstream message;
00094     message << "OuterRadiusMinusZ = 0" << G4endl 
00095             << "Width is calculated as that of OuterRadiusMinusZ !";
00096     G4Exception("G4ParameterisationConsRho::G4ParameterisationConsRho()",
00097                 "GeomDiv1001", JustWarning, message);
00098   } 
00099 
00100   if( divType == DivWIDTH )
00101   {
00102     fnDiv = CalculateNDiv( msol->GetOuterRadiusMinusZ()
00103                          - msol->GetInnerRadiusMinusZ(), width, offset );
00104   }
00105   else if( divType == DivNDIV )
00106   {
00107     G4Cons* mconsol = (G4Cons*)(msolid);
00108     fwidth = CalculateWidth( mconsol->GetOuterRadiusMinusZ()
00109                            - mconsol->GetInnerRadiusMinusZ(), nDiv, offset );
00110   }
00111 
00112 #ifdef G4DIVDEBUG
00113   if( verbose >= 1 )
00114   {
00115     G4cout << " G4ParameterisationConsRho - no divisions " << fnDiv << " = "
00116            << nDiv << G4endl
00117            << " Offset " << foffset << " = " << offset
00118            << " - Width " << fwidth << " = " << width << G4endl;
00119   }
00120 #endif
00121 }

G4ParameterisationConsRho::~G4ParameterisationConsRho (  ) 

Definition at line 124 of file G4ParameterisationCons.cc.

00125 {
00126 }


Member Function Documentation

void G4ParameterisationConsRho::ComputeDimensions ( G4Cons tubs,
const G4int  copyNo,
const G4VPhysicalVolume physVol 
) const [virtual]

Reimplemented from G4VPVParameterisation.

Definition at line 171 of file G4ParameterisationCons.cc.

References G4VDivisionParameterisation::CalculateWidth(), G4VSolid::DumpInfo(), G4VDivisionParameterisation::fhgap, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fnDiv, G4VDivisionParameterisation::foffset, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Cons::GetDeltaPhiAngle(), G4Cons::GetInnerRadiusMinusZ(), G4Cons::GetInnerRadiusPlusZ(), G4Cons::GetOuterRadiusPlusZ(), G4Cons::GetStartPhiAngle(), G4Cons::GetZHalfLength(), G4Cons::SetDeltaPhiAngle(), G4Cons::SetInnerRadiusMinusZ(), G4Cons::SetInnerRadiusPlusZ(), G4Cons::SetOuterRadiusMinusZ(), G4Cons::SetOuterRadiusPlusZ(), G4Cons::SetStartPhiAngle(), G4Cons::SetZHalfLength(), and G4VDivisionParameterisation::verbose.

00173 {
00174   G4Cons* msol = (G4Cons*)(fmotherSolid);
00175 
00176   G4double pRMin1 = msol->GetInnerRadiusMinusZ() + foffset + fwidth * copyNo;
00177   G4double pRMax1 = msol->GetInnerRadiusMinusZ() + foffset + fwidth * (copyNo+1);
00178  
00179   //width at Z Plus
00180   //- G4double fwidthPlus =
00181   //   fwidth * ( msol->GetOuterRadiusPlusZ()/ msol->GetInnerRadiusPlusZ())
00182   //-         / ( msol->GetOuterRadiusMinusZ() - msol->GetInnerRadiusMinusZ());
00183   G4double fwidthPlus = CalculateWidth( msol->GetOuterRadiusPlusZ()
00184                            - msol->GetInnerRadiusPlusZ(), fnDiv, foffset );
00185   G4double pRMin2 = msol->GetInnerRadiusPlusZ()
00186                   + foffset + fwidthPlus * copyNo;
00187   G4double pRMax2 = msol->GetInnerRadiusPlusZ()
00188                   + foffset + fwidthPlus * (copyNo+1);
00189   G4double pDz = msol->GetZHalfLength();
00190 
00191   G4double d_half_gap = fhgap * pRMax2 / pRMax1;
00192   //- already rotated  double pSR = foffset + copyNo*fwidth;
00193   G4double pSPhi = msol->GetStartPhiAngle();
00194   G4double pDPhi = msol->GetDeltaPhiAngle();;
00195 
00196   cons.SetInnerRadiusMinusZ( pRMin1 + fhgap );
00197   cons.SetOuterRadiusMinusZ( pRMax1 - fhgap );
00198   cons.SetInnerRadiusPlusZ( pRMin2 + d_half_gap );
00199   cons.SetOuterRadiusPlusZ( pRMax2 - d_half_gap );
00200   cons.SetZHalfLength( pDz );
00201   cons.SetStartPhiAngle( pSPhi, false );
00202   cons.SetDeltaPhiAngle( pDPhi );
00203 
00204 #ifdef G4DIVDEBUG
00205   if( verbose >= 2 )
00206   {
00207     G4cout << " G4ParameterisationConsRho::ComputeDimensions()" << G4endl
00208            << " pRMin: " << pRMin1 << " - pRMax: " << pRMax1 << G4endl;
00209     if( verbose >= 4 ) cons.DumpInfo();
00210   }
00211 #endif
00212 }

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

Implements G4VDivisionParameterisation.

Definition at line 138 of file G4ParameterisationCons.cc.

References G4VDivisionParameterisation::ChangeRotMatrix(), G4VDivisionParameterisation::faxis, G4VDivisionParameterisation::foffset, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4VPhysicalVolume::SetTranslation(), and G4VDivisionParameterisation::verbose.

00139 {
00140   //----- translation 
00141   G4ThreeVector origin(0.,0.,0.); 
00142   //----- set translation 
00143   physVol->SetTranslation( origin );
00144 
00145   //----- calculate rotation matrix: unit
00146 
00147 #ifdef G4DIVDEBUG
00148   if( verbose >= 2 )
00149   {
00150     G4cout <<  " G4ParameterisationConsRho " << G4endl
00151            << " Offset: " << foffset
00152            << " - Width: " << fwidth << G4endl;
00153   }
00154 #endif
00155 
00156   ChangeRotMatrix( physVol );
00157 
00158 #ifdef G4DIVDEBUG
00159   if( verbose >= 2 )
00160   {
00161     G4cout << std::setprecision(8) << " G4ParameterisationConsRho" << G4endl
00162            << " Position: " << origin << " - Width: " << fwidth
00163            << " - Axis: " << faxis  << G4endl;
00164   }
00165 #endif
00166 }

G4double G4ParameterisationConsRho::GetMaxParameter (  )  const [virtual]

Implements G4VDivisionParameterisation.

Definition at line 129 of file G4ParameterisationCons.cc.

References G4VDivisionParameterisation::fmotherSolid, G4Cons::GetInnerRadiusMinusZ(), and G4Cons::GetOuterRadiusMinusZ().

00130 {
00131   G4Cons* msol = (G4Cons*)(fmotherSolid);
00132   return msol->GetOuterRadiusMinusZ() - msol->GetInnerRadiusMinusZ();
00133 }


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