Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4PartialPhantomParameterisation.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 // G4PartialPhantomParameterisation
0027 //
0028 // Class description:
0029 // 
0030 // Describes partial regular parameterisations, i.e. the voxels do not 
0031 // completely fill the container in the three dimensions.
0032 
0033 // Author: Pedro Arce (CIEMAT), September 2010
0034 // --------------------------------------------------------------------
0035 #ifndef G4PartialPhantomParameterisation_hh
0036 #define G4PartialPhantomParameterisation_hh 1
0037 
0038 #include <map>
0039 #include <set>
0040 #include <utility>
0041 #include <vector>
0042 
0043 #include "G4Types.hh"
0044 #include "G4PhantomParameterisation.hh"
0045 #include "G4AffineTransform.hh"
0046 #include "G4VTouchable.hh"
0047 
0048 class G4VPhysicalVolume;
0049 class G4VSolid;
0050 class G4Material;
0051 
0052 /**
0053  * @brief G4PartialPhantomParameterisation describes partial regular
0054  * parameterisations, i.e. the voxels do not completely fill the container
0055  * in the three dimensions.
0056  */
0057 
0058 class G4PartialPhantomParameterisation : public G4PhantomParameterisation
0059 {
0060   public:
0061 
0062     /**
0063      * Default Constructor and Destructor.
0064      */
0065     G4PartialPhantomParameterisation() = default;
0066    ~G4PartialPhantomParameterisation() override = default;
0067 
0068     void ComputeTransformation(const G4int, G4VPhysicalVolume *) const override;
0069   
0070     G4Material* ComputeMaterial(const G4int repNo, 
0071                                       G4VPhysicalVolume *currentVol,
0072                                 const G4VTouchable *parentTouch = nullptr) override;
0073 
0074     /**
0075      * Gets the voxel number corresponding to the point in the container
0076      * frame. Use 'localDir' to avoid precision problems at the surfaces.
0077      *  @param[in] localPoint Point in local coordinates system.
0078      *  @param[in] localDir Local direction to overcome precision issues.
0079      *  @returns The voxel number for the specified point.
0080      */
0081     G4int GetReplicaNo( const G4ThreeVector& localPoint,
0082                         const G4ThreeVector& localDir ) override;
0083 
0084     G4ThreeVector GetTranslation(const G4int copyNo ) const;
0085 
0086     std::size_t GetMaterialIndex( std::size_t nx, std::size_t ny, std::size_t nz) const;
0087     std::size_t GetMaterialIndex( std::size_t copyNo) const;
0088 
0089     G4Material* GetMaterial( std::size_t nx, std::size_t ny, std::size_t nz) const;
0090     G4Material* GetMaterial( std::size_t copyNo ) const;
0091 
0092     inline void SetFilledIDs( std::multimap<G4int,G4int> fid )
0093     {
0094       fFilledIDs = std::move(fid); 
0095     }
0096 
0097     inline void SetFilledMins( std::map< G4int, std::map<G4int,G4int> > fmins )
0098     {
0099       fFilledMins = std::move(fmins);
0100     }
0101 
0102     void BuildContainerWalls();
0103 
0104   private:
0105 
0106     /**
0107      * Converts the copyNo to voxel numbers in x, y and z.
0108      */
0109     void ComputeVoxelIndices(const G4int copyNo, std::size_t& nx,
0110                                    std::size_t& ny, std::size_t& nz ) const;
0111 
0112     /**
0113      * Checks that the copy number is within limits.
0114      */
0115     void CheckCopyNo( const G4long copyNo ) const;
0116 
0117   private:
0118 
0119     std::multimap<G4int,G4int> fFilledIDs;
0120     std::map< G4int, std::map<G4int,G4int> > fFilledMins;
0121 };
0122 
0123 #endif