Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:10:39

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