Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-05 09:09:58

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 // G4VPVParameterisation
0027 //
0028 // Class description:
0029 //
0030 // Parameterisation abstract base class, able to compute the transformation
0031 // and (indirectly) the dimensions of parameterised volumes, given a
0032 // replication number.
0033 
0034 // Author: Paul Kent (CERN), 25.07.1996, P.Kent - Initial stub version
0035 // --------------------------------------------------------------------
0036 #ifndef G4VPVPARAMETERISATION_HH
0037 #define G4VPVPARAMETERISATION_HH
0038 
0039 #include "G4Types.hh"
0040 #include "G4VVolumeMaterialScanner.hh"
0041 #include "G4VTouchable.hh"
0042 
0043 class G4VPhysicalVolume;
0044 class G4VSolid;
0045 class G4Material;
0046 
0047 // Entities which may be parameterised/replicated
0048 //
0049 class G4Box;
0050 class G4Tubs;
0051 class G4Trd;
0052 class G4Trap;
0053 class G4Cons;
0054 class G4Sphere;
0055 class G4Orb;
0056 class G4Ellipsoid;
0057 class G4Torus;
0058 class G4Para;
0059 class G4Polycone;
0060 class G4Polyhedra;
0061 class G4Hype;
0062 
0063 class G4VVolumeMaterialScanner; 
0064 
0065 /**
0066  * @brief G4VPVParameterisation ia an abstract base class for Parameterisation,
0067  * able to compute the transformation and (indirectly) the dimensions of
0068  * parameterised volumes, given a replication number.
0069  */
0070 
0071 class G4VPVParameterisation
0072 {
0073   public:
0074 
0075     /**
0076      * Default Constructor & Destructor.
0077      */
0078     G4VPVParameterisation() = default;
0079     virtual ~G4VPVParameterisation() = default;
0080 
0081     /**
0082      * Computes the transformation for the 'pv' volume and replica number 'no'.
0083      * It is a required method, as it is the reason for this class.
0084      *  @param[in] pv Pointer to the current physical volume.
0085      *  @param[in] no The copy number index.
0086      */
0087     virtual void ComputeTransformation(const G4int no,
0088                                        G4VPhysicalVolume* pv) const = 0;
0089 
0090     /**
0091      * Computes the solid for the 'pv' volume and replica number 'no'.
0092      * To be optionally defined in derived classes, for parameterisation of
0093      * the solid type.
0094      *  @param[in] no The copy number index.
0095      *  @param[in] pv Pointer to the current physical volume.
0096      */
0097     virtual G4VSolid* ComputeSolid(const G4int no, G4VPhysicalVolume* pv);
0098                        
0099     /**
0100      * Computes the material for the 'currentVol' and replica number 'repNo'.
0101      * Must cope with 'parentTouch' for navigator's SetupHierarchy() when
0102      * used for nested parameterisations.
0103      *  @param[in] currentVol Pointer to the current physical volume.
0104      *  @param[in] repNo The copy number index.
0105      *  @param[in] parentTouch Pointer to the touchable of the parent volume.
0106      *  @returns A pointer to the associated material.
0107      */
0108     virtual G4Material* ComputeMaterial(const G4int repNo, 
0109                                     G4VPhysicalVolume* currentVol,
0110                                     const G4VTouchable* parentTouch = nullptr);
0111 
0112     /**
0113      * Methods to identify nested parameterisations. Required in order
0114      * to enable material scan for nested parameterisations.
0115      */
0116     virtual G4bool IsNested() const;
0117     virtual G4VVolumeMaterialScanner* GetMaterialScanner(); 
0118 
0119     /**
0120      * Dispatch methods for the specific solids where parameterisation
0121      * is allowed.
0122      */
0123     virtual void ComputeDimensions(G4Box &,
0124                                    const G4int,
0125                                    const G4VPhysicalVolume *) const {}
0126     virtual void ComputeDimensions(G4Tubs &,
0127                                    const G4int,
0128                                    const G4VPhysicalVolume *) const {}
0129     virtual void ComputeDimensions(G4Trd &,
0130                                    const G4int,
0131                                    const G4VPhysicalVolume *) const {}
0132     virtual void ComputeDimensions(G4Trap &,
0133                                    const G4int,
0134                                    const G4VPhysicalVolume *) const {}
0135     virtual void ComputeDimensions(G4Cons &,
0136                                    const G4int,
0137                                    const G4VPhysicalVolume *) const {}
0138     virtual void ComputeDimensions(G4Sphere &,
0139                                    const G4int,
0140                                    const G4VPhysicalVolume *) const {}
0141     virtual void ComputeDimensions(G4Orb &,
0142                                    const G4int,
0143                                    const G4VPhysicalVolume *) const {}
0144     virtual void ComputeDimensions(G4Ellipsoid &,
0145                                    const G4int,
0146                                    const G4VPhysicalVolume *) const {}
0147     virtual void ComputeDimensions(G4Torus &,
0148                                    const G4int,
0149                                    const G4VPhysicalVolume *) const {}
0150     virtual void ComputeDimensions(G4Para &,
0151                                    const G4int,
0152                                    const G4VPhysicalVolume *) const {}
0153     virtual void ComputeDimensions(G4Polycone &,
0154                                    const G4int,
0155                                    const G4VPhysicalVolume *) const {}
0156     virtual void ComputeDimensions(G4Polyhedra &,
0157                                    const G4int,
0158                                    const G4VPhysicalVolume *) const {}
0159     virtual void ComputeDimensions(G4Hype &,
0160                                    const G4int,
0161                                    const G4VPhysicalVolume *) const {}
0162 };
0163 
0164 #endif