G4ParameterisationPolyconeRho Class Reference

#include <G4ParameterisationPolycone.hh>

Inheritance diagram for G4ParameterisationPolyconeRho:

G4VParameterisationPolycone G4VDivisionParameterisation G4VPVParameterisation

Public Member Functions

 G4ParameterisationPolyconeRho (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
 ~G4ParameterisationPolyconeRho ()
void CheckParametersValidity ()
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 79 of file G4ParameterisationPolycone.hh.


Constructor & Destructor Documentation

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

Definition at line 99 of file G4ParameterisationPolycone.cc.

References G4VDivisionParameterisation::CalculateNDiv(), G4VDivisionParameterisation::CalculateWidth(), CheckParametersValidity(), DivNDIV, DivWIDTH, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fnDiv, G4VDivisionParameterisation::foffset, G4VDivisionParameterisation::fwidth, G4cout, G4endl, G4Polycone::GetOriginalParameters(), G4PolyconeHistorical::Rmax, G4PolyconeHistorical::Rmin, G4VDivisionParameterisation::SetType(), and G4VDivisionParameterisation::verbose.

00102   :  G4VParameterisationPolycone( axis, nDiv, width, offset, msolid, divType )
00103 {
00104   CheckParametersValidity();
00105   SetType( "DivisionPolyconeRho" );
00106 
00107   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
00108   G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
00109 
00110   if( divType == DivWIDTH )
00111   {
00112     fnDiv = CalculateNDiv( origparamMother->Rmax[0]
00113                          - origparamMother->Rmin[0], width, offset );
00114   }
00115   else if( divType == DivNDIV )
00116   {
00117     fwidth = CalculateWidth( origparamMother->Rmax[0]
00118                            - origparamMother->Rmin[0], nDiv, offset );
00119   }
00120 
00121 #ifdef G4DIVDEBUG
00122   if( verbose >= -1 )
00123   {
00124     G4cout << " G4ParameterisationPolyconeRho - # divisions " << fnDiv
00125            << " = " << nDiv << G4endl
00126            << " Offset " << foffset << " = " << offset << G4endl
00127            << " Width " << fwidth << " = " << width << G4endl;
00128   }
00129 #endif
00130 }

G4ParameterisationPolyconeRho::~G4ParameterisationPolyconeRho (  ) 

Definition at line 133 of file G4ParameterisationPolycone.cc.

00134 {
00135 }


Member Function Documentation

void G4ParameterisationPolyconeRho::CheckParametersValidity (  )  [virtual]

Reimplemented from G4VDivisionParameterisation.

Definition at line 138 of file G4ParameterisationPolycone.cc.

References G4VDivisionParameterisation::CheckParametersValidity(), DivNDIVandWIDTH, DivWIDTH, G4VDivisionParameterisation::fDivisionType, G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::foffset, G4endl, G4Exception(), G4VSolid::GetName(), and JustWarning.

Referenced by G4ParameterisationPolyconeRho().

00139 {
00140   G4VDivisionParameterisation::CheckParametersValidity();
00141 
00142   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
00143 
00144   if( fDivisionType == DivNDIVandWIDTH || fDivisionType == DivWIDTH )
00145   {
00146     std::ostringstream message;
00147     message << "In solid " << msol->GetName() << G4endl
00148             << "Division along R will be done with a width "
00149             << "different for each solid section." << G4endl
00150             << "WIDTH will not be used !";
00151     G4Exception("G4VParameterisationPolycone::CheckParametersValidity()",
00152                 "GeomDiv1001", JustWarning, message);
00153   }
00154   if( foffset != 0. )
00155   {
00156     std::ostringstream message;
00157     message << "In solid " << msol->GetName() << G4endl
00158             << "Division along  R will be done with a width "
00159             << "different for each solid section." << G4endl
00160             << "OFFSET will not be used !";
00161     G4Exception("G4VParameterisationPolycone::CheckParametersValidity()",
00162                 "GeomDiv1001", JustWarning, message);
00163   }
00164 }

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

Reimplemented from G4VPVParameterisation.

Definition at line 213 of file G4ParameterisationPolycone.cc.

References G4VDivisionParameterisation::CalculateWidth(), G4VSolid::DumpInfo(), G4VDivisionParameterisation::fmotherSolid, G4VDivisionParameterisation::fnDiv, G4VDivisionParameterisation::foffset, G4cout, G4endl, G4Polycone::GetOriginalParameters(), G4PolyconeHistorical::Num_z_planes, G4Polycone::Reset(), G4PolyconeHistorical::Rmax, G4PolyconeHistorical::Rmin, G4Polycone::SetOriginalParameters(), and G4VDivisionParameterisation::verbose.

00215 {
00216   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
00217 
00218   G4PolyconeHistorical* origparamMother = msol->GetOriginalParameters();
00219   G4PolyconeHistorical origparam( *origparamMother );
00220   G4int nZplanes = origparamMother->Num_z_planes;
00221 
00222   G4double width = 0.;
00223   for( G4int ii = 0; ii < nZplanes; ii++ )
00224   {
00225     width = CalculateWidth( origparamMother->Rmax[ii]
00226                           - origparamMother->Rmin[ii], fnDiv, foffset );
00227     origparam.Rmin[ii] = origparamMother->Rmin[ii]+foffset+width*copyNo;
00228     origparam.Rmax[ii] = origparamMother->Rmin[ii]+foffset+width*(copyNo+1);
00229   }
00230 
00231   pcone.SetOriginalParameters(&origparam);  // copy values & transfer pointers
00232   pcone.Reset();                            // reset to new solid parameters
00233 
00234 #ifdef G4DIVDEBUG
00235   if( verbose >= -2 )
00236   {
00237     G4cout << "G4ParameterisationPolyconeRho::ComputeDimensions()" << G4endl
00238            << "-- Parametrised pcone copy-number: " << copyNo << G4endl;
00239     pcone.DumpInfo();
00240   }
00241 #endif
00242 }

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

Implements G4VDivisionParameterisation.

Definition at line 178 of file G4ParameterisationPolycone.cc.

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

00179 {
00180   //----- translation 
00181   G4ThreeVector origin(0.,0.,0.); 
00182   //----- set translation 
00183   physVol->SetTranslation( origin );
00184 
00185   //----- calculate rotation matrix: unit
00186 
00187 #ifdef G4DIVDEBUG
00188   if( verbose >= 2 )
00189   {
00190     G4cout << " G4ParameterisationPolyconeRho " << G4endl
00191            << " foffset: " << foffset
00192            << " - fwidth: " << fwidth << G4endl;
00193   }
00194 #endif
00195 
00196   ChangeRotMatrix( physVol );
00197 
00198 #ifdef G4DIVDEBUG
00199   if( verbose >= 2 )
00200   {
00201     G4cout << std::setprecision(8) << " G4ParameterisationPolyconeRho "
00202            << G4endl
00203            << " Position: " << origin/mm
00204            << " - Width: " << fwidth/deg
00205            << " - Axis: " << faxis  << G4endl;
00206   }
00207 #endif
00208 }

G4double G4ParameterisationPolyconeRho::GetMaxParameter (  )  const [virtual]

Implements G4VDivisionParameterisation.

Definition at line 167 of file G4ParameterisationPolycone.cc.

References G4VDivisionParameterisation::fmotherSolid, G4Polycone::GetOriginalParameters(), G4PolyconeHistorical::Rmax, and G4PolyconeHistorical::Rmin.

00168 {
00169   G4Polycone* msol = (G4Polycone*)(fmotherSolid);
00170   G4PolyconeHistorical* original_pars = msol->GetOriginalParameters();
00171   return original_pars->Rmax[0] - original_pars->Rmin[0];
00172 }


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