source: trunk/source/geometry/navigation/include/G4VIntersectionLocator.hh @ 1198

Last change on this file since 1198 was 985, checked in by garnier, 15 years ago

fichiers manquants

File size: 7.2 KB
Line 
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//
27// $Id: G4VIntersectionLocator.hh,v 1.4 2008/11/14 18:26:35 gcosmo Exp $
28// GEANT4 tag $Name: geant4-09-02-cand-01 $
29//
30//
31// Class G4VIntersectionLocator
32//
33// class description:
34//
35// Base class for the calculation of the intersection point with a boundary
36// when PropagationInField is used.
37// Gives possibility to choose the method of intersection; concrete locators
38// implemented are: G4SimpleLocator, G4MultiLevelLocator, G4BrentLocator.
39//
40// Key Method: EstimateIntersectionPoint()
41
42// History:
43// -------
44// 27.10.08 - John Apostolakis, Tatiana Nikitina: Design and implementation
45// ---------------------------------------------------------------------------
46
47#ifndef G4VINTERSECTIONLOCATOR_HH
48#define G4VINTERSECTIONLOCATOR_HH
49
50#include "G4Types.hh"
51#include "G4ThreeVector.hh"
52#include "G4FieldTrack.hh"
53
54#include "G4Navigator.hh"
55#include "G4ChordFinder.hh"
56
57class G4VIntersectionLocator
58 {
59   public:  // with description
60 
61     G4VIntersectionLocator(G4Navigator *theNavigator);
62       // Constructor
63     virtual ~G4VIntersectionLocator();
64       // Default destructor
65     
66     virtual G4bool EstimateIntersectionPoint( 
67         const  G4FieldTrack&       curveStartPointTangent,  // A
68         const  G4FieldTrack&       curveEndPointTangent,    // B
69         const  G4ThreeVector&      trialPoint,              // E
70                G4FieldTrack&       intersectPointTangent,   // Output
71                G4bool&             recalculatedEndPoint,    // Out
72                G4double&           fPreviousSafety,         // In/Out
73                G4ThreeVector&      fPreviousSftOrigin) = 0; // In/Out   
74       // If such an intersection exists, this function calculates the
75       // intersection point of the true path of the particle with the surface
76       // of the current volume (or of one of its daughters).
77       // Should use lateral displacement as measure of convergence
78       // NOTE: changes the safety!
79
80     void printStatus( const G4FieldTrack& startFT,
81                       const G4FieldTrack& currentFT, 
82                             G4double      requestStep, 
83                             G4double      safety,
84                             G4int         step);
85       // Print Method, useful mostly for debugging
86
87     inline G4bool IntersectChord( G4ThreeVector  StartPointA, 
88                                   G4ThreeVector  EndPointB,
89                                   G4double      &NewSafety,
90                                   G4double      &fPreviousSafety,    // In/Out
91                                   G4ThreeVector &fPreviousSftOrigin, // In/Out
92                                   G4double      &LinearStepLength,
93                                   G4ThreeVector &IntersectionPoint);
94       // Intersect the chord from StartPointA to EndPointB and return
95       // whether an intersection occurred. NOTE: changes the Safety!
96
97  public:  // without description
98
99    // inline Set/Get methods used for IntersctionLocator
100
101    inline G4double  GetDeltaIntersectionFor();
102    inline G4double  GetEpsilonStepFor();
103    inline G4Navigator*  GetNavigatorFor();
104    inline G4ChordFinder*  GetChordFinderFor();
105    inline G4int  GetVerboseFor();
106
107    inline void SetEpsilonStepFor( G4double EpsilonStep );
108    inline void SetDeltaIntersectionFor( G4double deltaIntersection );
109    inline void SetNavigatorFor( G4Navigator *fNavigator );
110    inline void SetChordFinderFor(G4ChordFinder *fCFinder );
111    inline void SetSafetyParametersFor(G4bool UseSafety );
112    inline void SetVerboseFor(G4int fVerbose);
113
114    inline void AddAdjustementOfFoundIntersection(G4bool UseCorrection);
115    inline G4bool GetAdjustementOfFoundIntersection();
116
117  protected:  // with description
118
119    G4FieldTrack ReEstimateEndpoint( const G4FieldTrack &CurrentStateA, 
120                                     const G4FieldTrack &EstimtdEndStateB,
121                                           G4double      linearDistSq,
122                                           G4double      curveDist);
123      // Return new estimate for state after curveDist starting from
124      // CurrentStateA, to replace EstimtdEndStateB, and report displacement
125      // (if field is compiled verbose)
126
127     
128    G4ThreeVector GetLocalSurfaceNormal(const G4ThreeVector &CurrentE_Point,
129                                              G4bool &validNormal);
130      // Return the SurfaceNormal of Intersecting Solid
131
132    G4bool AdjustmentOfFoundIntersection(const G4ThreeVector &A,
133                                         const G4ThreeVector &CurrentE_Point, 
134                                         const G4ThreeVector &CurrentF_Point,
135                                         const G4ThreeVector &MomentumDir,
136                                         const G4bool         IntersectAF, 
137                                               G4ThreeVector &IntersectionPoint,
138                                               G4double      &NewSafety,
139                                               G4double      &fPrevSafety,
140                                               G4ThreeVector &fPrevSftOrigin );
141      // Optional method for adjustment of located intersection point
142      // using the surface-normal
143 
144  protected:
145
146    G4double kCarTolerance;
147    G4int    fVerboseLevel;
148      // For verbose purposes
149    G4bool   fUseNormalCorrection;
150
151    G4double       fiEpsilonStep;
152    G4double       fiDeltaIntersection;
153    G4Navigator   *fiNavigator;
154    G4ChordFinder *fiChordFinder;
155    G4bool         fiUseSafety;
156      // For passing the parameters from G4PropagatorInField
157
158    G4Navigator *fHelpingNavigator;
159      // Helper for location
160};
161
162#include "G4VIntersectionLocator.icc"
163
164#endif
Note: See TracBrowser for help on using the repository browser.