G4VoxelSafety.hh

Go to the documentation of this file.
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 // $Id$
00027 //
00028 // class G4VoxelSafety
00029 //
00030 // Class description:
00031 //
00032 // Utility for isotropic safety in volumes containing only G4PVPlacement
00033 // daughter volumes for which voxels have been constructed.
00034 
00035 // History:
00036 // - Created. John Apostolakis,  30 April 2010
00037 // --------------------------------------------------------------------
00038 #ifndef G4VOXELSAFETY_HH
00039 #define G4VOXELSAFETY_HH
00040 
00041 #include "geomdefs.hh"
00042 #include "G4NavigationHistory.hh"
00043 #include "G4AffineTransform.hh"
00044 #include "G4VPhysicalVolume.hh"
00045 #include "G4LogicalVolume.hh"
00046 #include "G4VSolid.hh"
00047 #include "G4ThreeVector.hh"
00048 
00049 #include "G4BlockingList.hh"
00050 
00051 #include <vector>  // Required for voxel handling & voxel stack
00052 
00053 class G4SmartVoxelNode;
00054 class G4SmartVoxelHeader;
00055 
00056 class G4VoxelSafety
00057 {
00058   public:  // with description
00059 
00060     G4VoxelSafety();
00061     ~G4VoxelSafety();
00062 
00063     G4SmartVoxelNode* VoxelLocate( G4SmartVoxelHeader* pHead,
00064                              const G4ThreeVector& localPoint );
00065 
00066     G4double ComputeSafety( const G4ThreeVector&     localPoint,
00067                             const G4VPhysicalVolume& currentPhysical, 
00068                                   G4double           maxLength=DBL_MAX );
00069 
00070     inline G4int GetVerboseLevel() const { return fVerbose; } 
00071     inline void  SetVerboseLevel(G4int level) { fVerbose= level; } 
00072       //
00073       // If level>0 && G4VERBOSE, printout can occur
00074 
00075   protected:
00076 
00077     G4double  SafetyForVoxelHeader( const G4SmartVoxelHeader* pHead,
00078                                     const G4ThreeVector& localPoint,
00079                                     G4double maxLength,
00080                                     const G4VPhysicalVolume& currentPhysical,
00081                                     G4double  distUpperDepth = 0.0,
00082                                     G4double  previousMinSafety= DBL_MAX
00083                                    );
00084 
00085     G4double  SafetyForVoxelNode(   const G4SmartVoxelNode *curVoxelNode,
00086                               const G4ThreeVector& localPoint ); 
00087 
00088     G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
00089                                         const G4ThreeVector& localPoint ) const;
00090   private:
00091 
00092     // BEGIN State - values used during computation of Safety 
00093     // 
00094     G4BlockingList fBlockList;
00095       // Blocked volumes
00096 
00097     G4LogicalVolume* fpMotherLogical;
00098 
00099     //  BEGIN Voxel Stack information
00100     //
00101     G4int fVoxelDepth;
00102       // Note: fVoxelDepth==0+ => fVoxelAxisStack(0+) contains axes of voxel
00103       //       fVoxelDepth==-1 -> not in voxel
00104 
00105     std::vector<EAxis> fVoxelAxisStack;
00106       // Voxel axes
00107 
00108     std::vector<G4int> fVoxelNoSlicesStack;
00109       // No slices per voxel at each level
00110 
00111     std::vector<G4double> fVoxelSliceWidthStack; 
00112       // Width of voxels at each level 
00113 
00114     std::vector<G4int> fVoxelNodeNoStack;    
00115       // Node no point is inside at each level 
00116 
00117     std::vector<const G4SmartVoxelHeader*> fVoxelHeaderStack;
00118       // Voxel headers at each level
00119 
00120     G4SmartVoxelNode* fVoxelNode;
00121       // Node containing last located point
00122 
00123     //
00124     //  END Voxel Stack information
00125 
00126     G4bool fCheck;
00127     G4int  fVerbose;
00128     G4double kCarTolerance;
00129 };
00130 
00131 #endif

Generated on Mon May 27 17:50:18 2013 for Geant4 by  doxygen 1.4.7