00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 // class G4PVParameterised 00031 // 00032 // Class description: 00033 // 00034 // Represents many touchable detector elements differing in their 00035 // positioning and dimensions. Both are calculated by means 00036 // of a G4VParameterisation object. The positioning is assumed to 00037 // be dominant along a cartesian axis (specified). 00038 00039 // History: 00040 // 29.07.95 P.Kent First non-stub version 00041 // ---------------------------------------------------------------------- 00042 #ifndef G4PVPARAMETERISED_HH 00043 #define G4PVPARAMETERISED_HH 00044 00045 #include "G4PVReplica.hh" 00046 00047 class G4PVParameterised : public G4PVReplica 00048 { 00049 public: // with description 00050 00051 G4PVParameterised(const G4String& pName, 00052 G4LogicalVolume* pLogical, 00053 G4LogicalVolume* pMotherLogical, 00054 const EAxis pAxis, 00055 const G4int nReplicas, 00056 G4VPVParameterisation *pParam, 00057 G4bool pSurfChk=false); 00058 // Replicate the volume nReplicas Times using the paramaterisation pParam, 00059 // within the mother volume pMotherLogical. 00060 // The positioning of the replicas is dominant along the specified axis. 00061 // pSurfChk if true activates check for overlaps with existing volumes. 00062 00063 public: // without description 00064 00065 G4PVParameterised(const G4String& pName, 00066 G4LogicalVolume* pLogical, 00067 G4VPhysicalVolume* pMother, 00068 const EAxis pAxis, 00069 const G4int nReplicas, 00070 G4VPVParameterisation *pParam, 00071 G4bool pSurfChk=false); 00072 // Almost exactly similar to first constructor, changing only mother 00073 // pointer's type to PhysicalVolume. 00074 00075 G4PVParameterised(__void__&); 00076 // Fake default constructor for usage restricted to direct object 00077 // persistency for clients requiring preallocation of memory for 00078 // persistifiable objects. 00079 00080 public: // with description 00081 00082 virtual ~G4PVParameterised(); 00083 // Virtual empty destructor. 00084 00085 G4bool IsParameterised() const; 00086 // Returns true to identify it is a parameterised physical volume. 00087 00088 G4VPVParameterisation* GetParameterisation() const; 00089 // Returns the current pointer to the parameterisation. 00090 00091 void GetReplicationData(EAxis& axis, 00092 G4int& nReplicas, 00093 G4double& width, 00094 G4double& offset, 00095 G4bool& consuming) const; 00096 // Fills arguments with the attributes from the base replica. 00097 virtual void SetRegularStructureId( G4int Code ); 00098 // Method sets code and can prepare for special type of regular volumes. 00099 00100 G4bool CheckOverlaps(G4int res=1000, G4double tol=0., G4bool verbose=true); 00101 // Verifies if each instance of the parameterised volume is overlapping 00102 // with other instances or with the mother volume. Provides default 00103 // resolution for the number of points to be generated and verified. 00104 // A tolerance for the precision of the overlap check can be specified, 00105 // by default it is set to maximum precision. 00106 // Returns true if an overlap occurs. 00107 00108 private: 00109 00110 G4VPVParameterisation *fparam; 00111 }; 00112 00113 #endif