Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:25

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 // G4VNestedParameterisation
0027 //
0028 // Class description:
0029 //
0030 // Base class for parameterisations that use information from the parent
0031 // volume to compute the material of a copy/instance of this volume. 
0032 // This is in addition to using the current replication number.
0033 // 
0034 // Notes:
0035 //  - Such a volume can be nested inside a placement volume or a parameterised  
0036 //    volume.
0037 //  - The user can modify the solid type, size or transformation using only
0038 //    the replication number of this parameterised volume.
0039 //    He/she is NOT allowed to change these attributes using information of
0040 //    parent volumes - otherwise incorrect results will occur.
0041 //  Also note that the usual restrictions apply: 
0042 //   - the mother volume, in which these copies are placed, must always be
0043 //     of the same dimensions
0044 
0045 // 24.02.05, J.Apostolakis - First created version.
0046 // --------------------------------------------------------------------
0047 #ifndef G4VNESTEDPARAMETERISATION_HH
0048 #define G4VNESTEDPARAMETERISATION_HH 1
0049 
0050 #include "G4Types.hh"
0051 #include "G4VPVParameterisation.hh" 
0052 #include "G4VVolumeMaterialScanner.hh"
0053 #include "G4VTouchable.hh"
0054 
0055 class G4VPhysicalVolume;
0056 class G4VSolid;
0057 class G4Material;
0058 
0059 // CSG Entities which may be parameterised/replicated
0060 //
0061 class G4Box;
0062 class G4Tubs;
0063 class G4Trd;
0064 class G4Trap;
0065 class G4Cons;
0066 class G4Sphere;
0067 class G4Orb;
0068 class G4Ellipsoid;
0069 class G4Torus;
0070 class G4Para;
0071 class G4Polycone;
0072 class G4Polyhedra;
0073 class G4Hype;
0074 
0075 class G4VNestedParameterisation : public G4VPVParameterisation, 
0076                                   public G4VVolumeMaterialScanner
0077 {
0078   public:
0079 
0080     G4VNestedParameterisation() = default; 
0081     ~G4VNestedParameterisation() override = default; 
0082 
0083     // Methods required in derived classes
0084     // -----------------------------------
0085 
0086     virtual G4Material* ComputeMaterial(G4VPhysicalVolume* currentVol,
0087                                  const G4int repNo, 
0088                                  const G4VTouchable* parentTouch = nullptr)=0;
0089       // Required method, as it is the reason for this class.
0090       // Must cope with parentTouch=nullptr for navigator's SetupHierarchy.
0091 
0092     G4int       GetNumberOfMaterials() const override =0;
0093     G4Material* GetMaterial(G4int idx) const override =0;
0094       // Needed to define materials for instances of Nested Parameterisation 
0095       // Current convention: each call should return the materials 
0096       // of all instances with the same mother/ancestor volume.
0097 
0098     void ComputeTransformation(const G4int no,
0099                                G4VPhysicalVolume* currentPV) const override=0;
0100 
0101     // Methods optional in derived classes
0102     // -----------------------------------
0103 
0104     G4VSolid* ComputeSolid(const G4int no, G4VPhysicalVolume* thisVol) override;
0105       // Additional standard parameterisation methods, 
0106       // which can be optionally defined, in case solid is used.
0107 
0108     void ComputeDimensions(G4Box &,
0109                            const G4int,
0110                            const G4VPhysicalVolume *) const override {}
0111 
0112     void ComputeDimensions(G4Tubs &,
0113                            const G4int,
0114                            const G4VPhysicalVolume *) const override {}
0115 
0116     void ComputeDimensions(G4Trd &,
0117                            const G4int,
0118                            const G4VPhysicalVolume *) const override {}
0119 
0120     void ComputeDimensions(G4Trap &,
0121                            const G4int,
0122                            const G4VPhysicalVolume *) const override {}
0123 
0124     void ComputeDimensions(G4Cons &,
0125                            const G4int,
0126                            const G4VPhysicalVolume *) const override {}
0127 
0128     void ComputeDimensions(G4Sphere &,
0129                            const G4int,
0130                            const G4VPhysicalVolume *) const override {}
0131 
0132     void ComputeDimensions(G4Orb &,
0133                            const G4int,
0134                            const G4VPhysicalVolume *) const override {}
0135 
0136     void ComputeDimensions(G4Ellipsoid &,
0137                            const G4int,
0138                            const G4VPhysicalVolume *) const override {}
0139 
0140     void ComputeDimensions(G4Torus &,
0141                            const G4int,
0142                            const G4VPhysicalVolume *) const override {}
0143 
0144     void ComputeDimensions(G4Para &,
0145                            const G4int,
0146                            const G4VPhysicalVolume *) const override {}
0147 
0148     void ComputeDimensions(G4Polycone &,
0149                            const G4int,
0150                            const G4VPhysicalVolume *) const override {}
0151 
0152     void ComputeDimensions(G4Polyhedra &,
0153                            const G4int,
0154                            const G4VPhysicalVolume *) const override {}
0155 
0156     void ComputeDimensions(G4Hype &,
0157                            const G4int,
0158                            const G4VPhysicalVolume *) const override {}
0159 
0160     G4Material* ComputeMaterial(const G4int repNo, 
0161                            G4VPhysicalVolume* currentVol,
0162                            const G4VTouchable* parentTouch = nullptr) override;
0163       // Method implemented in this class in terms of the above
0164       // ComputeMaterial() method.
0165 
0166     G4bool IsNested() const override;
0167     G4VVolumeMaterialScanner* GetMaterialScanner() override; 
0168       // Methods to identify nested parameterisations. Required in order
0169       // to enable material scan for nested parameterisations.
0170 };
0171 
0172 #endif