Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParameterisationConsRho Class Reference

#include <G4ParameterisationCons.hh>

+ Inheritance diagram for G4ParameterisationConsRho:

Public Member Functions

 G4ParameterisationConsRho (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *motherSolid, DivisionType divType)
 
 ~G4ParameterisationConsRho () override
 
G4double GetMaxParameter () const override
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const override
 
void ComputeDimensions (G4Cons &tubs, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
 
- Public Member Functions inherited from G4VParameterisationCons
 G4VParameterisationCons (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
 ~G4VParameterisationCons () override
 
- Public Member Functions inherited from G4VDivisionParameterisation
 G4VDivisionParameterisation (EAxis axis, G4int nDiv, G4double width, G4double offset, DivisionType divType, G4VSolid *motherSolid=nullptr)
 
 ~G4VDivisionParameterisation () override
 
G4VSolidComputeSolid (const G4int, G4VPhysicalVolume *) override
 
const G4StringGetType () const
 
EAxis GetAxis () const
 
G4int GetNoDiv () const
 
G4double GetWidth () const
 
G4double GetOffset () const
 
G4VSolidGetMotherSolid () const
 
void SetType (const G4String &type)
 
G4int VolumeFirstCopyNo () const
 
void SetHalfGap (G4double hg)
 
G4double GetHalfGap () const
 
- Public Member Functions inherited from G4VPVParameterisation
 G4VPVParameterisation ()=default
 
virtual ~G4VPVParameterisation ()=default
 
virtual G4MaterialComputeMaterial (const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
 
virtual G4bool IsNested () const
 
virtual G4VVolumeMaterialScannerGetMaterialScanner ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4VDivisionParameterisation
void ChangeRotMatrix (G4VPhysicalVolume *physVol, G4double rotZ=0.0) const
 
G4int CalculateNDiv (G4double motherDim, G4double width, G4double offset) const
 
G4double CalculateWidth (G4double motherDim, G4int nDiv, G4double offset) const
 
virtual void CheckParametersValidity ()
 
void CheckOffset (G4double maxPar)
 
void CheckNDivAndWidth (G4double maxPar)
 
G4double OffsetZ () const
 
- Protected Attributes inherited from G4VDivisionParameterisation
G4String ftype
 
EAxis faxis
 
G4int fnDiv = 0
 
G4double fwidth = 0.0
 
G4double foffset = 0.0
 
DivisionType fDivisionType
 
G4VSolidfmotherSolid = nullptr
 
G4bool fReflectedSolid = false
 
G4bool fDeleteSolid = false
 
G4int theVoluFirstCopyNo = 1
 
G4double kCarTolerance
 
G4double fhgap = 0.0
 
- Static Protected Attributes inherited from G4VDivisionParameterisation
static G4ThreadLocal G4RotationMatrixfRot = nullptr
 
static const G4int verbose = 5
 

Detailed Description

Definition at line 70 of file G4ParameterisationCons.hh.

Constructor & Destructor Documentation

◆ G4ParameterisationConsRho()

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

Definition at line 76 of file G4ParameterisationCons.cc.

80 : G4VParameterisationCons( axis, nDiv, width, offset, msolid, divType )
81{
83 SetType( "DivisionConsRho" );
84
85 auto msol = (G4Cons*)(fmotherSolid);
86 if( msol->GetInnerRadiusPlusZ() == 0. )
87 {
88 std::ostringstream message;
89 message << "OuterRadiusMinusZ = 0" << G4endl
90 << "Width is calculated as that of OuterRadiusMinusZ !";
91 G4Exception("G4ParameterisationConsRho::G4ParameterisationConsRho()",
92 "GeomDiv1001", JustWarning, message);
93 }
94
95 if( divType == DivWIDTH )
96 {
97 fnDiv = CalculateNDiv( msol->GetOuterRadiusMinusZ()
98 - msol->GetInnerRadiusMinusZ(), width, offset );
99 }
100 else if( divType == DivNDIV )
101 {
102 auto mconsol = (G4Cons*)(msolid);
103 fwidth = CalculateWidth( mconsol->GetOuterRadiusMinusZ()
104 - mconsol->GetInnerRadiusMinusZ(), nDiv, offset );
105 }
106
107#ifdef G4DIVDEBUG
108 if( verbose >= 1 )
109 {
110 G4cout << " G4ParameterisationConsRho - no divisions " << fnDiv << " = "
111 << nDiv << G4endl
112 << " Offset " << foffset << " = " << offset
113 << " - Width " << fwidth << " = " << width << G4endl;
114 }
115#endif
116}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void SetType(const G4String &type)
G4double CalculateWidth(G4double motherDim, G4int nDiv, G4double offset) const
G4int CalculateNDiv(G4double motherDim, G4double width, G4double offset) const
G4VParameterisationCons(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)

◆ ~G4ParameterisationConsRho()

G4ParameterisationConsRho::~G4ParameterisationConsRho ( )
overridedefault

Member Function Documentation

◆ ComputeDimensions()

void G4ParameterisationConsRho::ComputeDimensions ( G4Cons & tubs,
const G4int copyNo,
const G4VPhysicalVolume * physVol ) const
overridevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 163 of file G4ParameterisationCons.cc.

166{
167 auto msol = (G4Cons*)(fmotherSolid);
168
169 G4double pRMin1 = msol->GetInnerRadiusMinusZ() + foffset + fwidth*copyNo;
170 G4double pRMax1 = msol->GetInnerRadiusMinusZ() + foffset + fwidth*(copyNo+1);
171
172 //width at Z Plus
173 //- G4double fwidthPlus =
174 // fwidth * ( msol->GetOuterRadiusPlusZ()/ msol->GetInnerRadiusPlusZ())
175 //- / ( msol->GetOuterRadiusMinusZ() - msol->GetInnerRadiusMinusZ());
176 G4double fwidthPlus = CalculateWidth( msol->GetOuterRadiusPlusZ()
177 - msol->GetInnerRadiusPlusZ(), fnDiv, foffset );
178 G4double pRMin2 = msol->GetInnerRadiusPlusZ()
179 + foffset + fwidthPlus * copyNo;
180 G4double pRMax2 = msol->GetInnerRadiusPlusZ()
181 + foffset + fwidthPlus * (copyNo+1);
182 G4double pDz = msol->GetZHalfLength();
183
184 G4double d_half_gap = fhgap * pRMax2 / pRMax1;
185 //- already rotated double pSR = foffset + copyNo*fwidth;
186 G4double pSPhi = msol->GetStartPhiAngle();
187 G4double pDPhi = msol->GetDeltaPhiAngle();;
188
189 cons.SetInnerRadiusMinusZ( pRMin1 + fhgap );
190 cons.SetOuterRadiusMinusZ( pRMax1 - fhgap );
191 cons.SetInnerRadiusPlusZ( pRMin2 + d_half_gap );
192 cons.SetOuterRadiusPlusZ( pRMax2 - d_half_gap );
193 cons.SetZHalfLength( pDz );
194 cons.SetStartPhiAngle( pSPhi, false );
195 cons.SetDeltaPhiAngle( pDPhi );
196
197#ifdef G4DIVDEBUG
198 if( verbose >= 2 )
199 {
200 G4cout << " G4ParameterisationConsRho::ComputeDimensions()" << G4endl
201 << " pRMin: " << pRMin1 << " - pRMax: " << pRMax1 << G4endl;
202 if( verbose >= 4 ) cons.DumpInfo();
203 }
204#endif
205}
double G4double
Definition G4Types.hh:83

◆ ComputeTransformation()

void G4ParameterisationConsRho::ComputeTransformation ( const G4int copyNo,
G4VPhysicalVolume * physVol ) const
overridevirtual

Implements G4VDivisionParameterisation.

Definition at line 130 of file G4ParameterisationCons.cc.

132{
133 //----- translation
134 G4ThreeVector origin(0.,0.,0.);
135 //----- set translation
136 physVol->SetTranslation( origin );
137
138 //----- calculate rotation matrix: unit
139
140#ifdef G4DIVDEBUG
141 if( verbose >= 2 )
142 {
143 G4cout << " G4ParameterisationConsRho " << G4endl
144 << " Offset: " << foffset
145 << " - Width: " << fwidth << G4endl;
146 }
147#endif
148
149 ChangeRotMatrix( physVol );
150
151#ifdef G4DIVDEBUG
152 if( verbose >= 2 )
153 {
154 G4cout << std::setprecision(8) << " G4ParameterisationConsRho" << G4endl
155 << " Position: " << origin << " - Width: " << fwidth
156 << " - Axis: " << faxis << G4endl;
157 }
158#endif
159}
void ChangeRotMatrix(G4VPhysicalVolume *physVol, G4double rotZ=0.0) const
void SetTranslation(const G4ThreeVector &v)

◆ GetMaxParameter()

G4double G4ParameterisationConsRho::GetMaxParameter ( ) const
overridevirtual

Implements G4VDivisionParameterisation.

Definition at line 122 of file G4ParameterisationCons.cc.

123{
124 auto msol = (G4Cons*)(fmotherSolid);
125 return msol->GetOuterRadiusMinusZ() - msol->GetInnerRadiusMinusZ();
126}

The documentation for this class was generated from the following files: