Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4IntersectingCone.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// G4IntersectingCone
27//
28// Class description:
29//
30// Utility class which calculates the intersection
31// of an arbitrary line with a fixed cone.
32
33// Author: David C. Williams (UCSC), 1998 - Created
34// --------------------------------------------------------------------
35#ifndef G4INTERSECTINGCONE_HH
36#define G4INTERSECTINGCONE_HH
37
38#include "G4Types.hh"
39#include "geomdefs.hh"
40#include "G4ThreeVector.hh"
41
42/**
43 * @brief G4IntersectingCone is a utility class used to calculate the
44 * intersection of an arbitrary line with a fixed cone.
45 */
46
48{
49 public:
50
51 /**
52 * Constructor given r,z values.
53 * @param[in] r r values.
54 * @param[in] z Z values.
55 */
56 G4IntersectingCone( const G4double r[2], const G4double z[2] );
57
58 /**
59 * Default Destructor.
60 */
62
63 /**
64 * Calculates the intersection of a line with the conical surface,
65 * ignoring any Phi division.
66 */
68 G4double* s1, G4double* s2 );
69
70 /**
71 * Checks r or z extent, as appropriate, to see if the point is
72 * possibly on the cone.
73 */
74 G4bool HitOn( const G4double r, const G4double z );
75
76 /**
77 * Accessors for R and Z bounds of side.
78 */
79 inline G4double RLo() const { return rLo; }
80 inline G4double RHi() const { return rHi; }
81 inline G4double ZLo() const { return zLo; }
82 inline G4double ZHi() const { return zHi; }
83
84 /**
85 * Fake default constructor for usage restricted to direct object
86 * persistency for clients requiring preallocation of memory for
87 * persistifiable objects.
88 */
89 G4IntersectingCone(__void__&);
90
91 private:
92
93 /**
94 * Calculating the intersection of a line with the conical surface.
95 * Internal methods used by LineHitsCone().
96 */
97 G4int LineHitsCone1( const G4ThreeVector& p, const G4ThreeVector& v,
98 G4double* s1, G4double* s2 );
99 G4int LineHitsCone2( const G4ThreeVector& p, const G4ThreeVector& v,
100 G4double* s1, G4double* s2 );
101 private:
102
103 /** Z, R bounds of side. */
104 G4double zLo, zHi, rLo, rHi;
105
106 /** True if cone is type 1. */
107 G4bool type1 = false; // (std::fabs(z1-z2)>std::fabs(r1-r2))
108
109 /** Cone radius parameters - type 1: r = A + B*z; type 2: z = A + B*r. */
110 G4double A, B;
111};
112
113#endif
G4double B(G4double temperature)
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
const G4double A[17]
G4bool HitOn(const G4double r, const G4double z)
~G4IntersectingCone()=default
G4int LineHitsCone(const G4ThreeVector &p, const G4ThreeVector &v, G4double *s1, G4double *s2)
G4IntersectingCone(const G4double r[2], const G4double z[2])