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

#include <G4ParameterisationBox.hh>

+ Inheritance diagram for G4ParameterisationBoxY:

Public Member Functions

 G4ParameterisationBoxY (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
 ~G4ParameterisationBoxY () override
 
G4double GetMaxParameter () const override
 
void ComputeTransformation (const G4int copyNo, G4VPhysicalVolume *physVol) const override
 
void ComputeDimensions (G4Box &box, const G4int copyNo, const G4VPhysicalVolume *physVol) const override
 
- Public Member Functions inherited from G4VParameterisationBox
 G4VParameterisationBox (EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)
 
 ~G4VParameterisationBox () 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 113 of file G4ParameterisationBox.hh.

Constructor & Destructor Documentation

◆ G4ParameterisationBoxY()

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

Definition at line 167 of file G4ParameterisationBox.cc.

171 : G4VParameterisationBox( axis, nDiv, width, offset, msolid, divType )
172{
174 SetType( "DivisionBoxY" );
175
176 auto mbox = (G4Box*)(fmotherSolid);
177 if( divType == DivWIDTH )
178 {
179 fnDiv = CalculateNDiv( 2*mbox->GetYHalfLength(), width, offset );
180 }
181 else if( divType == DivNDIV )
182 {
183 fwidth = CalculateWidth( 2*mbox->GetYHalfLength(), nDiv, offset );
184 }
185
186#ifdef G4DIVDEBUG
187 if( verbose >= 1 )
188 {
189 G4cout << " G4ParameterisationBoxY - no divisions " << fnDiv << " = "
190 << nDiv << ". Offset " << foffset << " = " << offset
191 << ". Width " << fwidth << " = " << width << G4endl;
192 }
193#endif
194}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
Definition G4Box.hh:56
void SetType(const G4String &type)
G4double CalculateWidth(G4double motherDim, G4int nDiv, G4double offset) const
G4int CalculateNDiv(G4double motherDim, G4double width, G4double offset) const
G4VParameterisationBox(EAxis axis, G4int nCopies, G4double offset, G4double step, G4VSolid *msolid, DivisionType divType)

◆ ~G4ParameterisationBoxY()

G4ParameterisationBoxY::~G4ParameterisationBoxY ( )
overridedefault

Member Function Documentation

◆ ComputeDimensions()

void G4ParameterisationBoxY::ComputeDimensions ( G4Box & box,
const G4int copyNo,
const G4VPhysicalVolume * physVol ) const
overridevirtual

Reimplemented from G4VPVParameterisation.

Definition at line 242 of file G4ParameterisationBox.cc.

245{
246 auto msol = (G4Box*)(fmotherSolid);
247
248 G4double pDx = msol->GetXHalfLength();
249 G4double pDy = fwidth/2. - fhgap;
250 G4double pDz = msol->GetZHalfLength();
251
252 box.SetXHalfLength( pDx );
253 box.SetYHalfLength( pDy );
254 box.SetZHalfLength( pDz );
255
256#ifdef G4DIVDEBUG
257 if( verbose >= 2 )
258 {
259 G4cout << " G4ParameterisationBoxY::ComputeDimensions()" << G4endl
260 << " pDx: " << pDz << G4endl;
261 box.DumpInfo();
262 }
263#endif
264}
double G4double
Definition G4Types.hh:83
void SetZHalfLength(G4double dz)
Definition G4Box.cc:167
void SetYHalfLength(G4double dy)
Definition G4Box.cc:144
void SetXHalfLength(G4double dx)
Definition G4Box.cc:120
void DumpInfo() const

◆ ComputeTransformation()

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

Implements G4VDivisionParameterisation.

Definition at line 208 of file G4ParameterisationBox.cc.

210{
211 auto msol = (G4Box*)(fmotherSolid);
212 G4double mdy = msol->GetYHalfLength();
213
214 //----- translation
215 G4ThreeVector origin(0.,0.,0.);
216 G4double posi = -mdy + foffset + (copyNo+0.5)*fwidth;
217 if( faxis == kYAxis )
218 {
219 origin.setY( posi );
220 }
221 else
222 {
223 std::ostringstream message;
224 message << "Only axes along Y are allowed ! Axis: " << faxis;
225 G4Exception("G4ParameterisationBoxY::ComputeTransformation()",
226 "GeomDiv0002", FatalException, message);
227 }
228#ifdef G4DIVDEBUG
229 if( verbose >= 2 )
230 {
231 G4cout << std::setprecision(8) << " G4ParameterisationBoxY: "
232 << copyNo << G4endl
233 << " Position " << origin << " Axis " << faxis << G4endl;
234 }
235#endif
236 //----- set translation
237 physVol->SetTranslation( origin );
238}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void SetTranslation(const G4ThreeVector &v)
@ kYAxis
Definition geomdefs.hh:56

◆ GetMaxParameter()

G4double G4ParameterisationBoxY::GetMaxParameter ( ) const
overridevirtual

Implements G4VDivisionParameterisation.

Definition at line 200 of file G4ParameterisationBox.cc.

201{
202 auto msol = (G4Box*)(fmotherSolid);
203 return 2*msol->GetYHalfLength();
204}

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