Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-30 09:08:24

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 // G4VExternalPhysicalVolume
0027 //
0028 // Class description:
0029 //
0030 // Base class to represent a physical volume managed by an external 
0031 // sub-navigator.
0032 // 
0033 // Intial assumptions:
0034 //   * volume type is similar to G4PVPlacement -- not replicated
0035 //   * external navigator may provide 'many'/Boolean operation
0036 
0037 // Author: John Apostolakis (CERN), 24.10.2019
0038 // ----------------------------------------------------------------------
0039 #ifndef G4VEXTERNALPHYSICSVOLUME_HH
0040 #define G4VEXTERNALPHYSICSVOLUME_HH
0041 
0042 #include "G4VPhysicalVolume.hh"
0043 #include "G4Transform3D.hh"
0044 
0045 /**
0046  * @brief G4VExternalPhysicalVolume is a base class to represent a physical
0047  * volume managed by an external sub-navigator.
0048  */
0049 
0050 class G4VExternalPhysicalVolume : public G4VPhysicalVolume
0051 {
0052   public:
0053 
0054     /**
0055      * Constructor implementing G4VPhysicalVolume signature.
0056      *  @param[in] pRot The pointer to the rotation in the mother volume.
0057      *  @param[in] tlate Traslation vector in the mother volume.
0058      *  @param[in] pCurrentLogical Pointer to its logical volume.
0059      *  @param[in] pName The volume name.
0060      *  @param[in] pMotherLogical Pointer to the logical volume of the mother.
0061      */
0062     G4VExternalPhysicalVolume( G4RotationMatrix* pRot,
0063                                const G4ThreeVector& tlate,
0064                                G4LogicalVolume* pCurrentLogical,                            
0065                                const G4String& pName,
0066                                G4VPhysicalVolume* pMother );
0067        
0068     /**
0069      * Fake default constructor for usage restricted to direct object
0070      * persistency for clients requiring preallocation of memory for
0071      * persistifiable objects.
0072      */
0073     G4VExternalPhysicalVolume(__void__&);
0074 
0075     /**
0076      * Copy constructor and assignment operator not allowed.
0077      */
0078     G4VExternalPhysicalVolume(const G4VExternalPhysicalVolume&) = delete;
0079     G4VExternalPhysicalVolume& operator=(const G4VExternalPhysicalVolume&) = delete;
0080 
0081     /**
0082      * Default Destructor.
0083      */
0084     ~G4VExternalPhysicalVolume() override = default;
0085 
0086     /**
0087      * Verifies if the placed volume is overlapping with existing daughters
0088      * or with the mother volume. Provides default resolution for the number
0089      * of points to be generated and verified.
0090      * A tolerance for the precision of the overlap check can be specified,
0091      * by default it is set to maximum precision.
0092      * Reports a maximum of overlaps errors according to parameter in input.
0093      *  @param[in] res The number of points to generate on volume's surface.
0094      *  @param[in] tol The precision tolerance for the overlap check, below
0095      *             which to ignore overlaps (deafult is maximim precision).
0096      *  @param[in] verbose Verbosity mode (default is true).
0097      *  @param[in] maxErr Maximum of overlaps errors to report (default is 1).
0098      *  @returns True if an overlap occurs.
0099      */
0100     G4bool CheckOverlaps(G4int res=1000, G4double tol=0.,
0101                          G4bool verbose=true, G4int maxErr=1) override = 0;
0102 
0103     /**
0104      * Returns the volume type characterisation, i.e. kExternal.
0105      */
0106     EVolume VolumeType() const final;
0107 
0108     /**
0109      * Stub methods, unused for placed volumes.
0110      */
0111     G4bool IsMany() const final;
0112     void SetMany(G4bool overlap);
0113     G4bool IsReplicated() const final;
0114     G4bool IsParameterised() const final;
0115     G4VPVParameterisation* GetParameterisation() const final;
0116     void GetReplicationData(EAxis& axis,
0117                             G4int& nReplicas,
0118                             G4double& width,
0119                             G4double& offset,
0120                             G4bool& consuming) const final;
0121 
0122     /**
0123      * Used only for specialised repeated volumes. Always false with Id 0.
0124      */
0125     G4bool IsRegularStructure() const final; 
0126     G4int GetRegularStructureId() const final; 
0127 
0128   private:
0129 
0130     G4bool fMany = false;
0131 };
0132 
0133 #endif