Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4EnclosingCylinder.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// G4EnclosingCylinder
27//
28// Class description:
29//
30// A utility class for quickly deciding if a point is clearly outside a
31// polyhedra or polycone or deciding if a trajectory is clearly going to
32// miss those shapes.
33
34// Author: David C. Williams (UCSC), 1998 - Created
35// --------------------------------------------------------------------
36#ifndef G4ENCLOSINGCYLINDER_HH
37#define G4ENCLOSINGCYLINDER_HH
38
39#include "G4Types.hh"
40#include "geomdefs.hh"
41#include "G4ThreeVector.hh"
42
44
45/**
46 * @brief G4EnclosingCylinder is a utility class defining an envelope for
47 * quickly deciding if a point is clearly outside a polyhedra or polycone or
48 * deciding if a trajectory is clearly going to miss those shapes.
49 */
50
52{
53 public:
54
55 /**
56 * Constructs the envelope, given its parameters.
57 * @param[in] rz Pointer to the polygon structure.
58 * @param[in] phiIsOpen Boolean flag to indicate if it is a section in Phi.
59 * @param[in] startPhi Starting Phi angle.
60 * @param[in] totalPhi Total Phi angle of the section.
61 */
63 G4bool phiIsOpen,
64 G4double startPhi, G4double totalPhi );
65
66 /**
67 * Default Destructor.
68 */
70
71 /**
72 * Decides very rapidly if the point 'p' is outside the cylinder.
73 * @returns If not certain to be outside, return false.
74 */
75 G4bool MustBeOutside( const G4ThreeVector& p ) const;
76
77 /**
78 * Decides very rapidly if the trajectory is going to miss the cylinder.
79 * @returns If not certain to miss, return false.
80 */
81 G4bool ShouldMiss( const G4ThreeVector& p, const G4ThreeVector& v ) const;
82
83 /**
84 * Fake default constructor for usage restricted to direct object
85 * persistency for clients requiring preallocation of memory for
86 * persistifiable objects.
87 */
88 G4EnclosingCylinder(__void__&);
89
90 private:
91
92 G4double radius; // radius of our cylinder
93 G4double zLo, zHi; // z extent
94
95 G4bool phiIsOpen; // true if there is a phi segment
96 G4double startPhi, // for isPhiOpen==true, starting of phi segment
97 totalPhi; // for isPhiOpen==true, size of phi segment
98
99 G4double rx1=0.0, ry1=0.0,
100 dx1=0.0, dy1=0.0;
101 G4double rx2=0.0, ry2=0.0,
102 dx2=0.0, dy2=0.0;
103
104 G4bool concave; // true, if x/y cross section is concave
105};
106
107#endif
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
G4bool ShouldMiss(const G4ThreeVector &p, const G4ThreeVector &v) const
G4EnclosingCylinder(const G4ReduciblePolygon *rz, G4bool phiIsOpen, G4double startPhi, G4double totalPhi)
~G4EnclosingCylinder()=default
G4bool MustBeOutside(const G4ThreeVector &p) const
G4ReduciblePolygon is a utility class used to specify, test, reduce, and/or otherwise manipulate a 2D...