ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VExternalNavigation.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VExternalNavigation.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 //
26 // G4VExternalNavigation
27 //
28 // Class description:
29 //
30 // Pure virtual class to be specialised by the user for tracking with
31 // an external navigation
32 
33 // Authors: V.Vlachoudis, G.Cosmo - CERN, 2019
34 // --------------------------------------------------------------------
35 #ifndef G4VEXTERNALNAVIGATION_HH
36 #define G4VEXTERNALNAVIGATION_HH
37 
38 #include "G4NavigationHistory.hh"
39 #include "G4VPhysicalVolume.hh"
40 #include "G4LogicalVolume.hh"
41 #include "G4VSolid.hh"
42 #include "G4ThreeVector.hh"
43 
45 {
46  public: // with description
47 
49  // Constructor
50 
51  virtual ~G4VExternalNavigation();
52  // Destructor
53 
55  const G4VPhysicalVolume* blockedVol,
56  const G4int blockedNum,
57  const G4ThreeVector& globalPoint,
58  const G4ThreeVector* globalDirection,
59  const G4bool pLocatedOnEdge,
60  G4ThreeVector& localPoint) = 0;
61  // Search positioned volumes in mother at current top level of history
62  // for volume containing globalPoint. Do not test the blocked volume.
63  // If a containing volume is found, `stack' the new volume and return
64  // true, else return false (the point lying in the mother but not any
65  // of the daughters). localPoint = global point in local system on entry,
66  // point in new system on exit.
67 
68  virtual G4double ComputeStep( const G4ThreeVector& localPoint,
69  const G4ThreeVector& localDirection,
70  const G4double currentProposedStepLength,
71  G4double& newSafety,
72  G4NavigationHistory& history,
73  G4bool& validExitNormal,
74  G4ThreeVector& exitNormal,
75  G4bool& exiting,
76  G4bool& entering,
77  G4VPhysicalVolume** pBlockedPhysical,
78  G4int& blockedReplicaNo ) = 0;
79  // Compute the length of a step to the next boundary.
80  // Ignore the (input) pBlockedPhysical volume (with replica/parameterisation
81  // number 'blockedReplica')
82  // Identify the next candidate volume (if a daughter of current volume),
83  // and return it in pBlockedPhysical, blockedReplicaNo
84  // In/Out Navigation history: to be update for volume of next intersection.
85  // In/out 'newsafety' is the known isotropic safety of the initial point:
86  // an earlier (likely crude) estimate on input,
87  // to be updated with new estimate for the same (start) point.
88 
89  virtual G4double ComputeSafety( const G4ThreeVector& globalpoint,
90  const G4NavigationHistory& history,
91  const G4double pMaxLength = DBL_MAX ) = 0;
92 
93  virtual G4VExternalNavigation* Clone() = 0;
94 
95  // Optional methods - may be necessary under particular circumstances
96 
97  virtual EInside Inside( const G4VSolid* solid,
98  const G4ThreeVector& position,
99  const G4ThreeVector& direction );
100  // Special 'Inside' call that includes direction of next motion
101  // provided for potential optimisations.
102 
103  virtual void RelocateWithinVolume( G4VPhysicalVolume* motherPhysical,
104  const G4ThreeVector& localPoint );
105  // Update any relevant internal state to take account that
106  // - the location has been moved to 'localPoint'
107  // - it remains in the current (mother) physical volume 'motherPhysical'
108 
109  inline G4int GetVerboseLevel() const { return fVerbose; }
110  inline void SetVerboseLevel(G4int level) { fVerbose = level; }
111  // Get/Set verbosity level.
112 
113  inline void CheckMode(G4bool mode) { fCheck = mode; }
114  // Run navigation in "check-mode", therefore using additional
115  // verifications and more strict correctness conditions.
116  // Should be effective only with G4VERBOSE set.
117 
118  protected:
119 
120  G4bool fCheck = false;
122 };
123 
124 #endif