G4ParameterisationPolyconePhi Class Reference

#include <G4ParameterisationPolycone.hh>

Inheritance diagram for G4ParameterisationPolyconePhi:

G4VParameterisationPolycone G4VDivisionParameterisation G4VPVParameterisation

Public Member Functions

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

Detailed Description

Definition at line 128 of file G4ParameterisationPolycone.hh.


Constructor & Destructor Documentation

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

Definition at line 246 of file G4ParameterisationPolycone.cc.

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

00249   :  G4VParameterisationPolycone( axis, nDiv, width, offset, msolid, divType )
00250 { 
00251   CheckParametersValidity();
00252   SetType( "DivisionPolyconePhi" );
00253 
00254   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
00255   G4double deltaPhi = msol->GetEndPhi() - msol->GetStartPhi();
00256 
00257   if( divType == DivWIDTH )
00258   {
00259     fnDiv = CalculateNDiv( deltaPhi, width, offset );
00260   }
00261   else if( divType == DivNDIV )
00262   {
00263     fwidth = CalculateWidth( deltaPhi, nDiv, offset );
00264   }
00265 
00266 #ifdef G4DIVDEBUG
00267   if( verbose >= 1 )
00268   {
00269     G4cout << " G4ParameterisationPolyconePhi - # divisions " << fnDiv
00270            << " = " << nDiv << G4endl
00271            << " Offset " << foffset/deg << " = " << offset/deg << G4endl
00272            << " Width " << fwidth/deg << " = " << width/deg << G4endl;
00273   }
00274 #endif
00275 }

G4ParameterisationPolyconePhi::~G4ParameterisationPolyconePhi (  ) 

Definition at line 278 of file G4ParameterisationPolycone.cc.

00279 {
00280 }


Member Function Documentation

void G4ParameterisationPolyconePhi::ComputeDimensions ( G4Polycone pcone,
const G4int  copyNo,
const G4VPhysicalVolume physVol 
) const [virtual]

Reimplemented from G4VPVParameterisation.

Definition at line 328 of file G4ParameterisationPolycone.cc.

References G4VSolid::DumpInfo(), G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Polycone::GetOriginalParameters(), G4PolyconeHistorical::Opening_angle, G4Polycone::Reset(), G4Polycone::SetOriginalParameters(), G4PolyconeHistorical::Start_angle, and G4VDivisionParameterisation::verbose.

00330 {
00331   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
00332 
00333   G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
00334   G4PolyconeHistorical origparam( *origparamMother );
00335   origparam.Start_angle = origparamMother->Start_angle;
00336   origparam.Opening_angle = fwidth;
00337 
00338   pcone.SetOriginalParameters(&origparam);  // copy values & transfer pointers
00339   pcone.Reset();                            // reset to new solid parameters
00340 
00341 #ifdef G4DIVDEBUG
00342   if( verbose >= 2 )
00343   {
00344     G4cout << "G4ParameterisationPolyconePhi::ComputeDimensions():" << G4endl;
00345     pcone.DumpInfo();
00346   }
00347 #endif
00348 }

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

Implements G4VDivisionParameterisation.

Definition at line 292 of file G4ParameterisationPolycone.cc.

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

00293 {
00294   //----- translation 
00295   G4ThreeVector origin(0.,0.,0.); 
00296   //----- set translation 
00297   physVol->SetTranslation( origin );
00298 
00299   //----- calculate rotation matrix (so that all volumes point to the centre)
00300   G4double posi = foffset + copyNo*fwidth;
00301 
00302 #ifdef G4DIVDEBUG
00303   if( verbose >= 2 )
00304   {
00305     G4cout << " G4ParameterisationPolyconePhi - position: " << posi/deg
00306            << G4endl
00307            << " copyNo: " << copyNo << " - foffset: " << foffset/deg
00308            << " - fwidth: " << fwidth/deg << G4endl;
00309   }
00310 #endif
00311 
00312   ChangeRotMatrix( physVol, -posi );
00313 
00314 #ifdef G4DIVDEBUG
00315   if( verbose >= 2 )
00316   {
00317     G4cout << std::setprecision(8) << " G4ParameterisationPolyconePhi "
00318            << copyNo << G4endl
00319            << " Position: " << origin << " - Width: " << fwidth
00320            << " - Axis: " << faxis  << G4endl;
00321   }
00322 #endif
00323 }

G4double G4ParameterisationPolyconePhi::GetMaxParameter (  )  const [virtual]

Implements G4VDivisionParameterisation.

Definition at line 283 of file G4ParameterisationPolycone.cc.

References G4VDivisionParameterisation::fmotherSolid, G4Polycone::GetEndPhi(), and G4Polycone::GetStartPhi().

00284 {
00285   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
00286   return msol->GetEndPhi() - msol->GetStartPhi();
00287 }


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