Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TwistTrapFlatSide.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4FlatTrapSurface
27//
28// Class description:
29//
30// Class describing a flat boundary surface for a trapezoid.
31
32// Author: 27-Oct-2004 - O.Link ([email protected])
33// --------------------------------------------------------------------
34#ifndef G4TWISTTRAPFLATSIDE_HH
35#define G4TWISTTRAPFLATSIDE_HH
36
37#include "G4VTwistSurface.hh"
38
40{
41 public:
42
43 G4TwistTrapFlatSide( const G4String& name,
44 G4double PhiTwist,
45 G4double pDx1,
46 G4double pDx2,
47 G4double pDy,
48 G4double pDz,
49 G4double pAlpha,
50 G4double pPhi,
51 G4double pTheta,
52 G4int handedness );
54
55 G4ThreeVector GetNormal(const G4ThreeVector& /* xx */ ,
56 G4bool isGlobal = false) override;
58 const G4ThreeVector& gv,
59 G4ThreeVector gxx[],
60 G4double distance[],
61 G4int areacode[],
62 G4bool isvalid[],
63 EValidate validate = kValidateWithTol) override;
64
66 G4ThreeVector gxx[],
67 G4double distance[],
68 G4int areacode[]) override;
69
71 G4bool isGlobal = false) override;
72 inline G4double GetBoundaryMin(G4double u) override;
73 inline G4double GetBoundaryMax(G4double u) override;
74 inline G4double GetSurfaceArea() override;
75 void GetFacets( G4int m, G4int n, G4double xyz[][3],
76 G4int faces[][4], G4int iside ) override;
77
78 G4TwistTrapFlatSide(__void__&);
79 // Fake default constructor for usage restricted to direct object
80 // persistency for clients requiring preallocation of memory for
81 // persistifiable objects.
82
83 protected:
84
86 G4bool withTol = true) override;
87
88 private:
89
90 void SetCorners() override;
91 void SetBoundaries() override;
92
93 inline G4double xAxisMax(G4double u, G4double fTanAlpha) const;
94
95 private:
96
97 G4double fDx1;
98 G4double fDx2;
99 G4double fDy;
100 G4double fDz;
101 G4double fPhiTwist;
102 G4double fAlpha;
103 G4double fTAlph;
104 G4double fPhi;
105 G4double fTheta;
106 G4double fdeltaX;
107 G4double fdeltaY;
108};
109
110//========================================================
111// inline functions
112//========================================================
113
114inline
115G4double G4TwistTrapFlatSide::xAxisMax(G4double u, G4double fTanAlpha) const
116{
117 return ( ( fDx2 + fDx1 )/2. + u*(fDx2 - fDx1)/(2.*fDy) + u *fTanAlpha ) ;
118}
119
120inline G4ThreeVector
122{
123 G4ThreeVector SurfPoint ( x,y,0);
124
125 if (isGlobal) { return (fRot*SurfPoint + fTrans); }
126 return SurfPoint;
127}
128
129inline
131{
132 return -xAxisMax(y, -fTAlph) ;
133}
134
135inline
137{
138 return xAxisMax(y, fTAlph) ;
139}
140
141inline
143{
144 return 2*(fDx1 + fDx2)*fDy ;
145}
146
147#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4int GetAreaCode(const G4ThreeVector &xx, G4bool withTol=true) override
~G4TwistTrapFlatSide() override
void GetFacets(G4int m, G4int n, G4double xyz[][3], G4int faces[][4], G4int iside) override
G4double GetBoundaryMax(G4double u) override
G4double GetSurfaceArea() override
G4ThreeVector SurfacePoint(G4double x, G4double y, G4bool isGlobal=false) override
G4ThreeVector GetNormal(const G4ThreeVector &, G4bool isGlobal=false) override
G4double GetBoundaryMin(G4double u) override
G4TwistTrapFlatSide(const G4String &name, G4double PhiTwist, G4double pDx1, G4double pDx2, G4double pDy, G4double pDz, G4double pAlpha, G4double pPhi, G4double pTheta, G4int handedness)
G4int DistanceToSurface(const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector gxx[], G4double distance[], G4int areacode[], G4bool isvalid[], EValidate validate=kValidateWithTol) override
G4RotationMatrix fRot
G4ThreeVector fTrans