| [831] | 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: G4ReplicaNavigation.hh,v 1.6 2007/05/18 07:31:09 gcosmo Exp $
|
|---|
| [921] | 28 | // GEANT4 tag $Name: geant4-09-02-cand-01 $
|
|---|
| [831] | 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | // class G4ReplicaNavigation
|
|---|
| 32 | //
|
|---|
| 33 | // Class description:
|
|---|
| 34 | //
|
|---|
| 35 | // Utility for navigation in volumes containing a single G4PVParameterised
|
|---|
| 36 | // volume for which voxels for the replicated volumes have been constructed.
|
|---|
| 37 | // [Voxels MUST be along one axis only: NOT refined]
|
|---|
| 38 |
|
|---|
| 39 | // History:
|
|---|
| 40 | // - Created. Paul Kent, Aug 96
|
|---|
| 41 | // --------------------------------------------------------------------
|
|---|
| 42 | #ifndef G4REPLICANAVIGATION_HH
|
|---|
| 43 | #define G4REPLICANAVIGATION_HH
|
|---|
| 44 |
|
|---|
| 45 | #include "G4Types.hh"
|
|---|
| 46 | #include "G4NavigationHistory.hh"
|
|---|
| 47 | #include "G4LogicalVolume.hh"
|
|---|
| 48 | #include "G4VPhysicalVolume.hh"
|
|---|
| 49 | #include "G4ThreeVector.hh"
|
|---|
| 50 | #include "G4BlockingList.hh"
|
|---|
| 51 |
|
|---|
| 52 | // Required for voxel handling
|
|---|
| 53 | //
|
|---|
| 54 | #include "G4SmartVoxelHeader.hh"
|
|---|
| 55 |
|
|---|
| 56 | class G4VSolid;
|
|---|
| 57 |
|
|---|
| 58 | class G4ReplicaNavigation
|
|---|
| 59 | {
|
|---|
| 60 | friend class G4ReplicaNavigationTester;
|
|---|
| 61 |
|
|---|
| 62 | public: // with description
|
|---|
| 63 |
|
|---|
| 64 | G4ReplicaNavigation();
|
|---|
| 65 | ~G4ReplicaNavigation();
|
|---|
| 66 |
|
|---|
| 67 | inline G4bool LevelLocate( G4NavigationHistory& history,
|
|---|
| 68 | const G4VPhysicalVolume *blockedVol,
|
|---|
| 69 | const G4int blockedNum,
|
|---|
| 70 | const G4ThreeVector &globalPoint,
|
|---|
| 71 | const G4ThreeVector* globalDirection,
|
|---|
| 72 | const G4bool pLocatedOnEdge,
|
|---|
| 73 | G4ThreeVector &localPoint );
|
|---|
| 74 |
|
|---|
| 75 | G4double ComputeStep( const G4ThreeVector &globalPoint,
|
|---|
| 76 | const G4ThreeVector &globalDirection,
|
|---|
| 77 | const G4ThreeVector &localPoint,
|
|---|
| 78 | const G4ThreeVector &localDirection,
|
|---|
| 79 | const G4double currentProposedStepLength,
|
|---|
| 80 | G4double &newSafety,
|
|---|
| 81 | G4NavigationHistory &history,
|
|---|
| 82 | G4bool &validExitNormal,
|
|---|
| 83 | G4ThreeVector &exitNormal,
|
|---|
| 84 | G4bool &exiting,
|
|---|
| 85 | G4bool &entering,
|
|---|
| 86 | G4VPhysicalVolume *(*pBlockedPhysical),
|
|---|
| 87 | G4int &blockedReplicaNo );
|
|---|
| 88 |
|
|---|
| 89 | G4double ComputeSafety( const G4ThreeVector &globalPoint,
|
|---|
| 90 | const G4ThreeVector &localPoint,
|
|---|
| 91 | G4NavigationHistory &history,
|
|---|
| 92 | const G4double pProposedMaxLength=DBL_MAX );
|
|---|
| 93 |
|
|---|
| 94 | EInside BackLocate( G4NavigationHistory &history,
|
|---|
| 95 | const G4ThreeVector &globalPoint,
|
|---|
| 96 | G4ThreeVector &localPoint,
|
|---|
| 97 | const G4bool &exiting,
|
|---|
| 98 | G4bool ¬KnownInside ) const;
|
|---|
| 99 |
|
|---|
| 100 | void ComputeTransformation( const G4int replicaNo,
|
|---|
| 101 | G4VPhysicalVolume *pVol,
|
|---|
| 102 | G4ThreeVector &point ) const;
|
|---|
| 103 | void ComputeTransformation( const G4int replicaNo,
|
|---|
| 104 | G4VPhysicalVolume *pVol ) const;
|
|---|
| 105 |
|
|---|
| 106 | EInside Inside( const G4VPhysicalVolume *pVol,
|
|---|
| 107 | const G4int replicaNo,
|
|---|
| 108 | const G4ThreeVector &localPoint ) const;
|
|---|
| 109 | G4double DistanceToOut( const G4VPhysicalVolume *pVol,
|
|---|
| 110 | const G4int replicaNo,
|
|---|
| 111 | const G4ThreeVector &localPoint ) const;
|
|---|
| 112 | G4double DistanceToOut( const G4VPhysicalVolume *pVol,
|
|---|
| 113 | const G4int replicaNo,
|
|---|
| 114 | const G4ThreeVector &localPoint,
|
|---|
| 115 | const G4ThreeVector &localDirection ) const;
|
|---|
| 116 |
|
|---|
| 117 | inline G4int GetVerboseLevel() const;
|
|---|
| 118 | inline void SetVerboseLevel(G4int level);
|
|---|
| 119 | // Get/Set Verbose(ness) level.
|
|---|
| 120 | // [if level>0 && G4VERBOSE, printout can occur]
|
|---|
| 121 |
|
|---|
| 122 | inline void CheckMode(G4bool mode);
|
|---|
| 123 | // Run navigation in "check-mode", therefore using additional
|
|---|
| 124 | // verifications and more strict correctness conditions.
|
|---|
| 125 | // Is effective only with G4VERBOSE set.
|
|---|
| 126 |
|
|---|
| 127 | private:
|
|---|
| 128 |
|
|---|
| 129 | inline G4int VoxelLocate( const G4SmartVoxelHeader *pHead,
|
|---|
| 130 | const G4ThreeVector &localPoint,
|
|---|
| 131 | const G4int blocked=-1 ) const;
|
|---|
| 132 |
|
|---|
| 133 | G4double DistanceToOutPhi( const G4ThreeVector &localPoint,
|
|---|
| 134 | const G4ThreeVector &localDirection,
|
|---|
| 135 | const G4double width ) const;
|
|---|
| 136 |
|
|---|
| 137 | G4double DistanceToOutRad( const G4ThreeVector &localPoint,
|
|---|
| 138 | const G4ThreeVector &localDirection,
|
|---|
| 139 | const G4double width,
|
|---|
| 140 | const G4double offset,
|
|---|
| 141 | const G4int replicaNo ) const;
|
|---|
| 142 | inline void SetPhiTransformation( const G4double ang,
|
|---|
| 143 | G4VPhysicalVolume *pVol=0 ) const;
|
|---|
| 144 | private:
|
|---|
| 145 |
|
|---|
| 146 | G4bool fCheck;
|
|---|
| 147 | G4int fVerbose;
|
|---|
| 148 | G4double kCarTolerance, kRadTolerance, kAngTolerance;
|
|---|
| 149 | };
|
|---|
| 150 |
|
|---|
| 151 | #include "G4ReplicaNavigation.icc"
|
|---|
| 152 |
|
|---|
| 153 | #endif
|
|---|