Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:11:35

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 // G4SmartVoxelStat
0027 //
0028 // Class description:
0029 //
0030 // Stores information on the performance of the smart voxel algorithm
0031 // for an individual logical volume.
0032 
0033 // Author: D.C.Williams (UCSC), 1998
0034 // --------------------------------------------------------------------
0035 #ifndef G4SmartVoxelStat_hh
0036 #define G4SmartVoxelStat_hh
0037 
0038 #include "G4Types.hh"
0039 
0040 class G4LogicalVolume;
0041 class G4SmartVoxelHeader;
0042 
0043 /**
0044  * @brief G4SmartVoxelStat stores the information on the performance of the
0045  * smart voxel optimisation algorithm for an individual logical volume.
0046  */
0047 
0048 class G4SmartVoxelStat
0049 {
0050   public:
0051   
0052     /**
0053      * Constructs the information on one volume's voxels.
0054      *  @param[in] theVolume Pointer to the logical volume concerned.
0055      *  @param[in] theVoxel Pointer to the associated voxel header.
0056      *  @param[in] theSysTime System time.
0057      *  @param[in] theUserTime User time.
0058      */
0059     G4SmartVoxelStat( const G4LogicalVolume* theVolume,
0060                       const G4SmartVoxelHeader* theVoxel,
0061                             G4double theSysTime,
0062                             G4double theUserTime );
0063 
0064     /**
0065      * Returns a pointer to the logical volume.
0066      */
0067     const G4LogicalVolume* GetVolume() const;
0068   
0069     /**
0070      * Returns a pointer to the voxel header.
0071      */
0072     const G4SmartVoxelHeader* GetVoxel() const;
0073   
0074     /**
0075      * Gets the amount of system CPU time needed to build voxels.
0076      */
0077     G4double GetSysTime() const;
0078   
0079     /**
0080      * Gets the amount of user CPU time needed to build voxels.
0081      */
0082     G4double GetUserTime() const;
0083   
0084     /**
0085      * Gets the total amount of CPU time needed to build voxels.
0086      */
0087     G4double GetTotalTime() const;
0088   
0089     /**
0090      * Gets the number of voxel headers used in the volume.
0091      */
0092     G4long GetNumberHeads() const;
0093   
0094     /**
0095      * Gets the number of voxel slices used in the volume.
0096      */
0097     G4long GetNumberNodes() const;
0098 
0099     /**
0100      * Gets the number of voxel proxy pointers used in the volume.
0101      */
0102     G4long GetNumberPointers() const;
0103   
0104     /**
0105      * Gets the number of bytes needed to store voxel information.
0106      */
0107     G4long GetMemoryUse() const;
0108 
0109 
0110   private:
0111   
0112     /**
0113      * Counts headers and nodes from provided 'head' header.
0114      */
0115     void CountHeadsAndNodes( const G4SmartVoxelHeader* head );
0116   
0117   private:
0118 
0119     const G4LogicalVolume* volume;
0120     const G4SmartVoxelHeader* voxel;
0121   
0122     G4double sysTime;
0123     G4double userTime;
0124   
0125     G4long heads = 1;
0126     G4long nodes = 0;
0127     G4long pointers = 0;
0128 };
0129 
0130 #endif