Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4VPVDivisionFactory
0027 //
0028 // Class description:
0029 //
0030 // Abstract factory that defines interfaces for creating volume divisions. 
0031 
0032 // Author: Ivana Hrivnacova (IJCLab, Orsay), 04.05.2004
0033 // ------------------------------------------------------------------------
0034 #ifndef G4VPVDIVISIONFACTORY_HH
0035 #define G4VPVDIVISIONFACTORY_HH
0036 
0037 #include "geomdefs.hh"
0038 
0039 class G4LogicalVolume;
0040 class G4VPhysicalVolume;
0041 class G4VPVParameterisation;
0042 
0043 /**
0044  * @brief G4VPVDivisionFactory is an abstract factory that defines the
0045  * interfaces for creating volume divisions.
0046  */
0047 
0048 class G4VPVDivisionFactory
0049 {
0050   public:
0051 
0052     /**
0053      * Default Destructor.
0054      */
0055     virtual ~G4VPVDivisionFactory() = default;
0056     
0057     /**
0058      * Returns a pointer to the unique instance of the factory.
0059      */
0060     static G4VPVDivisionFactory* Instance();
0061     
0062     /**
0063      * Creates a division, using number of divisions and width.
0064      *  @param[in] pName The volume name.
0065      *  @param[in] pLogical Pointer to the logical volume of the division.
0066      *  @param[in] pMother Pointer to the logical volume of the mother.
0067      *  @param[in] pAxis The axis along which do the division.
0068      *  @param[in] nReplicas The number of copies to replicate.
0069      *  @param[in] width The witdh of the divided slice along the axis.
0070      *  @param[in] offset The optional offset distance from mother's border.
0071      *  @returns The pointer to physical divided volume.
0072      */
0073     virtual G4VPhysicalVolume* CreatePVDivision(
0074                              const G4String& pName,
0075                                    G4LogicalVolume* pLogical,
0076                                    G4LogicalVolume* pMother,
0077                              const EAxis pAxis,
0078                              const G4int nReplicas,
0079                              const G4double width,
0080                              const G4double offset ) = 0;
0081 
0082     /**
0083      * Creates a division, using the number of divisions.
0084      *  @param[in] pName The volume name.
0085      *  @param[in] pLogical Pointer to the logical volume of the division.
0086      *  @param[in] pMother Pointer to the logical volume of the mother.
0087      *  @param[in] pAxis The axis along which do the division.
0088      *  @param[in] nReplicas The number of copies to replicate.
0089      *  @param[in] offset The optional offset distance from mother's border.
0090      *  @returns The pointer to physical divided volume.
0091      */
0092     virtual G4VPhysicalVolume* CreatePVDivision(
0093                              const G4String& pName,
0094                                    G4LogicalVolume* pLogical,
0095                                    G4LogicalVolume* pMother,
0096                              const EAxis pAxis,
0097                              const G4int nReplicas,
0098                              const G4double offset ) = 0;
0099 
0100     /**
0101      * Creates a division, using the width of the division slice.
0102      *  @param[in] pName The volume name.
0103      *  @param[in] pLogical Pointer to the logical volume of the division.
0104      *  @param[in] pMother Pointer to the logical volume of the mother.
0105      *  @param[in] pAxis The axis along which do the division.
0106      *  @param[in] width The witdh of the divided slice along the axis.
0107      *  @param[in] offset The optional offset distance from mother's border.
0108      *  @returns The pointer to physical divided volume.
0109      */
0110     virtual G4VPhysicalVolume* CreatePVDivision(
0111                              const G4String& pName,
0112                                    G4LogicalVolume* pLogical,
0113                                    G4LogicalVolume* pMother,
0114                              const EAxis pAxis,
0115                              const G4double width,
0116                              const G4double offset ) = 0;
0117 
0118     /**
0119      * Creates a division, using a parameterisation algorithm.
0120      *  @param[in] pName The volume name.
0121      *  @param[in] pLogical Pointer to the logical volume of the division.
0122      *  @param[in] pMother Pointer to the logical volume of the mother.
0123      *  @param[in] param The pointer to the parameterisation algorithm.
0124      *  @returns The pointer to physical divided volume.
0125      */
0126     virtual G4VPhysicalVolume* CreatePVDivision(
0127                              const G4String& pName,
0128                                    G4LogicalVolume* pLogical,
0129                                    G4LogicalVolume* pMother,
0130                              const G4VPVParameterisation* param) = 0;
0131 
0132     /**
0133      * Returns true if 'pv' is a pointer to a division.
0134      */
0135     virtual G4bool IsPVDivision(const G4VPhysicalVolume* pv) const = 0;
0136 
0137   protected:
0138 
0139     /**
0140      * Protected default Constructor.
0141      */
0142     G4VPVDivisionFactory() = default;
0143 
0144   protected:
0145 
0146     /** The static pointer of the singleton instance. */
0147     static G4ThreadLocal G4VPVDivisionFactory* fgInstance;
0148 };
0149 
0150 #endif