Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4SPSPosDistribution.hh
이 파일의 문서화 페이지로 가기
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 //
27 //
28 // MODULE: G4SPSPosDistribution.hh
29 //
30 // Version: 1.0
31 // Date: 5/02/04
32 // Author: Fan Lei
33 // Organisation: QinetiQ ltd.
34 // Customer: ESA/ESTEC
35 //
37 //
38 // CHANGE HISTORY
39 // --------------
40 //
41 // 30/04/2017 J Allison
42 // Added GetRotx,y,z access functions.
43 //
44 // 06/06/2014 A Dotti
45 // For thread safety: this is a shared object,
46 // mutex has been added to control access to shared resources (data members).
47 // in Getters and Setters, mutex is NOT used in GenerateOne because it is
48 // assumed that properties are not changed during event loop.
49 //
50 // Version 1.0, 05/02/2004, Fan Lei, Created.
51 // Based on the G4GeneralParticleSource class in Geant4 v6.0
52 //
54 //
55 //
56 // Class Description:
57 //
58 // To generate the position of a primary vertex according to the defined distribution
59 //
61 //
62 // MEMBER FUNCTIONS
63 // ----------------
64 //
65 // G4SPSPosDistribution ()
66 // Constructor: Initializes variables and instantiates the Navigator class
67 //
68 // ~G4SPSPosDistribution ()
69 // Destructor:
70 //
71 // void SetPosDisType(G4String)
72 // Allows user to choose Point, Plane, Surface or Volume source
73 // position distributions.
74 //
75 // void SetPosDisShape(G4String)
76 // Allows the user to choose the particular shape they wish for the
77 // position distribution. Choices are Square, Circle, Ellipse, Rectangle,
78 // Sphere, Ellipsoid, Cylinder, Parallelepiped.
79 //
80 // void SetCentreCoords(G4ThreeVector)
81 // Sets the co-ordinates of the centre of the position distribution.
82 //
83 // void SetPosRot1(G4ThreeVector)
84 // Used to specify the co-ordinate system for the position distribution
85 // along with SetPosRot2. SetPosRot1 sets the vector x' and need not be
86 // a unit vector.
87 //
88 // void SetPosRot2(G4ThreeVector)
89 // Used in connection with SetPosRot1. This sets a vector in the plane
90 // x'y'. By a series of cross products x', y', z' are generated. Again
91 // need not be a unit vector.
92 //
93 // void SetHalfX(G4double)
94 // Sets the half length in x.
95 //
96 // void SetHalfY(G4double)
97 // Sets the half length in y.
98 //
99 // void SetHalfZ(G4double)
100 // Sets the half length in z.
101 //
102 // void SetRadius(G4double)
103 // Sets the radius where appropriate for source distribution shapes.
104 //
105 // void SetRadius0(G4double)
106 // Sets the inner radius where appropriate for source distribution shapes.
107 //
108 // void SetBeamSigmaInR(G4double);
109 // Sets the sigma for 1D beam
110 //
111 // void SetBeamSigmaInX(G4double);
112 // Sets the first sigma for 2D beam
113 //
114 // void SetBeamSigmaInY(G4double);
115 // Sets the second sigma for 2D beam
116 //
117 // void SetParAlpha(G4double)
118 // Sets the angle Alpha in the Parallelepiped shapes.
119 //
120 // void SetParTheta(G4double)
121 // Sets the angle Theta in the Parallelepiped shapes.
122 //
123 // void SetParPhi(G4double)
124 // Sets the angle Phi in the Parallelepiped shapes.
125 //
126 // void ConfineSourceToVolume(G4String)
127 // Used to confine the start positions to a particular volume.
128 //
129 // void SetBiasRndm (G4SPSRandomGenerator* a) { posRndm = a ; };
130 // Sets the biased random number generator
131 //
132 // G4ThreeVector GenerateOne();
133 // Generate one random position
134 //
135 // void SetVerbosity(G4int)
136 // Sets the verbosity level.
137 //
139 //
140 #ifndef G4SPSPosDistribution_h
141 #define G4SPSPosDistribution_h 1
142 
143 #include "G4Navigator.hh"
144 #include "G4SPSRandomGenerator.hh"
145 #include "G4Threading.hh"
146 #include "G4Cache.hh"
147 
160 {
161 public:
164 
174  // methods to create source position dist.
175  void SetPosDisType(G4String); // Point, Plane, Surface, Volume
176  void SetPosDisShape(G4String);
177  // SetPosDisShape - Square, Circle, Annulus, Ellipse, Rectangle, Sphere,
178  // Ellipsoid, Cylinder, Right (parallelepiped).
180  void SetPosRot1(G4ThreeVector);
181  void SetPosRot2(G4ThreeVector);
182  void SetHalfX(G4double);
183  void SetHalfY(G4double);
184  void SetHalfZ(G4double);
185  void SetRadius(G4double);
186  void SetRadius0(G4double);
190  void SetParAlpha(G4double);
191  void SetParTheta(G4double);
192  void SetParPhi(G4double);
194  //
196  // Set the verbosity level.
197  void SetVerbosity(G4int a);
198  //
200 
201  G4String GetPosDisType() const;
202  G4String GetPosDisShape() const;
204  G4double GetHalfX() const;
205  G4double GetHalfY() const;
206  G4double GetHalfZ() const;
207  G4double GetRadius() const;
208  G4double GetRadius0() const {return Radius0;}
209  G4double GetParAlpha() const {return ParAlpha;}
210  G4double GetParTheta() const {return ParTheta;}
211  G4double GetParPhi() const {return ParPhi;}
212  const G4ThreeVector& GetRotx() const {return Rotx;}
213  const G4ThreeVector& GetRoty() const {return Roty;}
214  const G4ThreeVector& GetRotz() const {return Rotz;}
215 
219  G4String GetSourcePosType() const;
221 
222 private:
223 
225  // the following routines generate the source position
226  void GeneratePointSource(G4ThreeVector& outoutPos);
227  void GeneratePointsInBeam(G4ThreeVector& outoutPos);
228  void GeneratePointsInPlane(G4ThreeVector& outoutPos);
229  void GeneratePointsOnSurface(G4ThreeVector& outputPos);
230  void GeneratePointsInVolume(G4ThreeVector& outputPos);
231 
233 
234 private:
235  //VERY IMPORTANT:
236  //This is a shared resource, however setters that
237  //changes the parameters via UI commands are by design
238  //thread-safe because only one thread will call these methods
239  //See G4GeneralParticleSourceMessenger constructor for an explanation
240  struct thread_data_t {
241  //Caching of some data
246  thread_data_t();
247  };
248  //Point,Plane,Surface,Volume
250  //Circle,Square,Rectangle etc..
252  // Coords of centre of input shape
254  // Unit vectors defining rotation matrix
258  //half lengths
262  //Radius for circles or spheres
264  // The inner radius of an annulus
266  // Standard deviation in raduial, x, y for beam type source
270  //Angle for Right Parallellepipeds
274  //If true confines source distribution to VolName
277  // Verbosity
280  // biased random generator
283 };
284 
285 
286 #endif
287 
288 
289 
290 
G4ThreeVector GetSideRefVec1() const
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
G4ThreeVector GetCentreCoords() const
void GeneratePointSource(G4ThreeVector &outoutPos)
void GeneratePointsInBeam(G4ThreeVector &outoutPos)
G4ThreeVector GetSideRefVec3() const
const G4ThreeVector & GetRotz() const
G4double GetParTheta() const
G4double GetParPhi() const
G4bool IsSourceConfined(G4ThreeVector &outputPos)
G4String GetPosDisShape() const
void GeneratePointsOnSurface(G4ThreeVector &outputPos)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4String GetPosDisType() const
G4Cache< thread_data_t > ThreadData
void GeneratePointsInPlane(G4ThreeVector &outoutPos)
G4ThreeVector GetParticlePos() const
G4SPSRandomGenerator * PosRndm
G4double GetRadius0() const
G4ThreeVector GetSideRefVec2() const
void SetBiasRndm(G4SPSRandomGenerator *a)
G4double GetHalfZ() const
G4double GetParAlpha() const
void GeneratePointsInVolume(G4ThreeVector &outputPos)
void ConfineSourceToVolume(G4String)
int G4int
Definition: G4Types.hh:78
void SetPosRot2(G4ThreeVector)
void SetPosRot1(G4ThreeVector)
const G4ThreeVector & GetRotx() const
const G4ThreeVector & GetRoty() const
G4String GetSourcePosType() const
G4double GetHalfY() const
G4double GetHalfX() const
void SetCentreCoords(G4ThreeVector)
G4double GetRadius() const
std::mutex G4Mutex
Definition: G4Threading.hh:84