Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:50

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // class G4ParameterisedNavigation
0027 //
0028 // Class description:
0029 //
0030 // Utility for navigation in volumes containing a single G4PVParameterised
0031 // volume for which voxels for the replicated volumes have been constructed.
0032 // [Voxels MUST be along one axis only: NOT refined]
0033 
0034 // History:
0035 // - Created. Paul Kent, Aug 96
0036 // --------------------------------------------------------------------
0037 #ifndef G4PARAMETERISEDNAVIGATION_HH
0038 #define G4PARAMETERISEDNAVIGATION_HH
0039 
0040 #include "G4Types.hh"
0041 
0042 #include <vector>
0043 
0044 #include "G4VoxelNavigation.hh"
0045 #include "G4NavigationHistory.hh"
0046 #include "G4AffineTransform.hh"
0047 #include "G4VPhysicalVolume.hh"
0048 #include "G4VPVParameterisation.hh"
0049 #include "G4LogicalVolume.hh"
0050 #include "G4VSolid.hh"
0051 #include "G4ThreeVector.hh"
0052 #include "G4BlockingList.hh"
0053 
0054 class G4ParameterisedNavigation : public G4VoxelNavigation
0055 {
0056   public:  // with description
0057 
0058     G4ParameterisedNavigation();
0059     ~G4ParameterisedNavigation() override;
0060 
0061     inline G4SmartVoxelNode* ParamVoxelLocate( G4SmartVoxelHeader* pHead,
0062                                          const G4ThreeVector& localPoint );
0063 
0064     G4bool LevelLocate( G4NavigationHistory& history,
0065                   const G4VPhysicalVolume* blockedVol,
0066                   const G4int blockedNum,
0067                   const G4ThreeVector& globalPoint,
0068                   const G4ThreeVector* globalDirection,
0069                   const G4bool pLocatedOnEdge, 
0070                         G4ThreeVector& localPoint ) override;
0071 
0072     G4double ComputeStep( const G4ThreeVector& globalPoint,
0073                           const G4ThreeVector& globalDirection,
0074                           const G4double currentProposedStepLength,
0075                                 G4double& newSafety,
0076                                 G4NavigationHistory& history,
0077                                 G4bool& validExitNormal,
0078                                 G4ThreeVector& exitNormal,
0079                                 G4bool& exiting,
0080                                 G4bool& entering,
0081                                 G4VPhysicalVolume *(*pBlockedPhysical),
0082                                 G4int& blockedReplicaNo ) override;
0083 
0084     G4double ComputeSafety( const G4ThreeVector& localPoint,
0085                             const G4NavigationHistory& history,
0086                             const G4double pProposedMaxLength=DBL_MAX ) override;
0087 
0088     void RelocateWithinVolume( G4VPhysicalVolume* motherPhysical,
0089                                const G4ThreeVector& localPoint ) override;
0090 
0091   private:
0092 
0093     G4double ComputeVoxelSafety( const G4ThreeVector& localPoint,
0094                                  const EAxis pAxis ) const;
0095     G4bool LocateNextVoxel( const G4ThreeVector& localPoint,
0096                             const G4ThreeVector& localDirection,
0097                             const G4double currentStep,
0098                             const EAxis pAxis );
0099   private:
0100 
0101     // Necessary to resolve cases with nested parameterisations
0102 
0103     inline G4VSolid* IdentifyAndPlaceSolid( G4int num,
0104                                      G4VPhysicalVolume* apparentPhys, 
0105                                      G4VPVParameterisation* curParam );
0106        // Call virtual 'Compute' methods, and copy information if nested.
0107        // 'ApparentPhys' is potentially a PhysV or PhysT.
0108 
0109     G4VPhysicalVolume* CreateVolumeWithParent(G4VPhysicalVolume* curPhysical,
0110                                               const G4NavigationHistory& hist );
0111        // Create necessary parent touchable and physical with parent.
0112 
0113   private:
0114 
0115     //  Voxel Stack information (for 1D optimisation only)
0116     //
0117     EAxis fVoxelAxis = kUndefined;
0118     G4int fVoxelNoSlices = 0;
0119     G4double fVoxelSliceWidth = 0.0; 
0120     std::size_t fVoxelNodeNo = 0;  
0121     G4SmartVoxelHeader* fVoxelHeader = nullptr;
0122 };
0123 
0124 #include "G4ParameterisedNavigation.icc"
0125 
0126 #endif