00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 // class G4RegularNavigation 00031 // 00032 // Class description: 00033 // 00034 // Utility for fast navigation in volumes containing a regular 00035 // parameterisation. If two contiguous voxels have the same material, 00036 // navigation does not stop at the surface 00037 00038 // History: 00039 // - Created. P. Arce, May 2007 00040 // -------------------------------------------------------------------- 00041 #ifndef G4RegularNavigation_HH 00042 #define G4RegularNavigation_HH 00043 00044 #include <vector> 00045 00046 #include "G4Types.hh" 00047 #include "G4ThreeVector.hh" 00048 00049 class G4NormalNavigation; 00050 class G4VPhysicalVolume; 00051 class G4Navigator; 00052 class G4NavigationHistory; 00053 00054 class G4RegularNavigation 00055 { 00056 public: // with description 00057 00058 G4RegularNavigation(); 00059 ~G4RegularNavigation(); 00060 00061 G4bool LevelLocate( G4NavigationHistory& history, 00062 const G4VPhysicalVolume* blockedVol, 00063 const G4int blockedNum, 00064 const G4ThreeVector& globalPoint, 00065 const G4ThreeVector* globalDirection, 00066 const G4bool pLocatedOnEdge, 00067 G4ThreeVector& localPoint ); 00068 // Locate point using its position with respect to regular 00069 // parameterisation container volume. 00070 00071 G4double ComputeStep( const G4ThreeVector& globalPoint, 00072 const G4ThreeVector& globalDirection, 00073 const G4double currentProposedStepLength, 00074 G4double& newSafety, 00075 G4NavigationHistory& history, 00076 G4bool& validExitNormal, 00077 G4ThreeVector& exitNormal, 00078 G4bool& exiting, 00079 G4bool& entering, 00080 G4VPhysicalVolume *(*pBlockedPhysical), 00081 G4int& blockedReplicaNo ); 00082 // Method never called because to be called the daughter has to be a 00083 // 'regular' volume. This would only happen if the track is in the 00084 // mother of voxels volume. But the voxels fill completely their mother, 00085 // so when a track enters the mother it automatically enters a voxel. 00086 00087 G4double ComputeStepSkippingEqualMaterials( 00088 G4ThreeVector& localPoint, 00089 const G4ThreeVector& globalDirection, 00090 const G4double currentProposedStepLength, 00091 G4double& newSafety, 00092 G4NavigationHistory& history, 00093 G4bool& validExitNormal, 00094 G4ThreeVector& exitNormal, 00095 G4bool& exiting, 00096 G4bool& entering, 00097 G4VPhysicalVolume *(*pBlockedPhysical), 00098 G4int& blockedReplicaNo, 00099 G4VPhysicalVolume* pCurrentPhysical); 00100 // Compute the step skipping surfaces when they separate voxels with 00101 // equal materials. Loop to voxels until a different material is found: 00102 // invokes G4NormalNavigation::ComputeStep() in each voxel and move the 00103 // point to the next voxel. 00104 00105 G4double ComputeSafety( const G4ThreeVector& localPoint, 00106 const G4NavigationHistory& history, 00107 const G4double pProposedMaxLength=DBL_MAX ); 00108 // Method never called because to be called the daughter has to be a 00109 // 'regular' volume. This would only happen if the track is in the 00110 // mother of voxels volume. But the voxels fill completely their mother, 00111 // so when a track enters the mother it automatically enters a voxel. 00112 00113 public: // without description 00114 00115 // Set and Get methods 00116 00117 void SetVerboseLevel(G4int level) { fverbose = level; } 00118 void CheckMode(G4bool mode) { fcheck = mode; } 00119 void SetNormalNavigation( G4NormalNavigation* fnormnav ) 00120 { fnormalNav = fnormnav; } 00121 00122 private: 00123 00124 G4int fverbose; 00125 G4bool fcheck; 00126 00127 G4NormalNavigation* fnormalNav; 00128 G4double kCarTolerance; 00129 }; 00130 00131 #endif