/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/PosGen_TriMeshSurface.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/gen/include/RAT/PosGen_TriMeshSurface.hh Source File
Ratpac-two
PosGen_TriMeshSurface.hh
1 /* This position generator reads in the TriMeshSurface ratdb table and
2  generates positions uniformly on the surface of the triangle mesh.
3  Multiple triangle meshes can be read using /proc/pos/set multiple times.
4  Optionally, one can extrude the triangle a fixed thickness and generate
5  positions uniformly in that volume. One can also extrude the volume in
6  the direction of the normal, in the opposite direction, or both where
7  the normal is defined by the counterclockwise orientation of the vertices.
8  */
9 
10 #ifndef __RAT_PosGen_TriMeshSurface__
11 #define __RAT_PosGen_TriMeshSurface__
12 
13 #include <RAT/GLG4PosGen.hh>
14 #include <vector>
15 
16 namespace RAT {
17 
19  public:
20  PosGen_TriMeshSurface(const char *arg_dbname = "triMeshSurface") : GLG4PosGen(arg_dbname), totalArea(0.0) {}
21 
22  void GeneratePosition(G4ThreeVector &argResult);
23 
24  void SetState(G4String newValues);
25 
26  G4String GetState() const { return state; };
27 
28  protected:
29  std::vector<G4ThreeVector> point; // the first vertex
30  std::vector<G4ThreeVector> edge0; // 2nd vertex minus first vertex
31  std::vector<G4ThreeVector> edge1; // 3rd vertex minus first vertex
32  std::vector<G4ThreeVector> normal; // normal vector with vertices counterclockwise
33  std::vector<double> area; // area of all triangles up to this one
34  double totalArea;
35  std::vector<double> thickness; // thickness of volume for each type
36  std::vector<int> direction; // direction to extrude
37  std::vector<int> ntriangles; // number of triangles of this type
38  G4String state;
39 };
40 
41 } // namespace RAT
42 
43 #endif
Definition: GLG4PosGen.hh:18
Definition: PosGen_TriMeshSurface.hh:18
Definition: CCCrossSecMessenger.hh:29