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 G4PVReplica 00031 // 00032 // Class description: 00033 // 00034 // Represents many touchable detector elements differing only in their 00035 // positioning. The elements' positions are calculated by means of a simple 00036 // linear formula, and the elements completely fill the containing mother 00037 // volume. 00038 // 00039 // G4PVReplica(const G4String& pName, 00040 // G4LogicalVolume *pLogical, 00041 // G4LogicalVolume *pMother, 00042 // const EAxis pAxis, 00043 // const G4int nReplicas, 00044 // const G4double width, 00045 // const G4double offset=0); 00046 // 00047 // Replication may occur along: 00048 // 00049 // o Cartesian axes (kXAxis,kYAxis,kZAxis) 00050 // 00051 // The replications, of specified width have coordinates of 00052 // form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1 00053 // for the case of kXAxis, and are unrotated. 00054 // 00055 // o Radial axis (cylindrical polar) (kRho) 00056 // 00057 // The replications are cons/tubs sections, centred on the origin 00058 // and are unrotated. 00059 // They have radii of width*n+offset to width*(n+1)+offset 00060 // where n=0..nReplicas-1 00061 // 00062 // o Phi axis (cylindrical polar) (kPhi) 00063 // The replications are `phi sections' or wedges, and of cons/tubs form 00064 // They have phi of offset+n*width to offset+(n+1)*width where 00065 // n=0..nReplicas-1 00066 00067 // History: 00068 // 29.07.95 P.Kent First non-stub version 00069 // 26.10.97 J.Apostolakis Added constructor that takes mother logical volume 00070 // 16.02.98 J.Apostolakis Added copy number 00071 // ---------------------------------------------------------------------- 00072 #ifndef G4PVREPLICA_HH 00073 #define G4PVREPLICA_HH 00074 00075 #include "G4VPhysicalVolume.hh" 00076 00077 class G4PVReplica : public G4VPhysicalVolume 00078 { 00079 public: // with description 00080 00081 G4PVReplica(const G4String& pName, 00082 G4LogicalVolume* pLogical, 00083 G4LogicalVolume* pMother, 00084 const EAxis pAxis, 00085 const G4int nReplicas, 00086 const G4double width, 00087 const G4double offset=0); 00088 00089 public: // without description 00090 00091 G4PVReplica(const G4String& pName, 00092 G4LogicalVolume* pLogical, 00093 G4VPhysicalVolume* pMother, 00094 const EAxis pAxis, 00095 const G4int nReplicas, 00096 const G4double width, 00097 const G4double offset=0); 00098 00099 G4PVReplica(__void__&); 00100 // Fake default constructor for usage restricted to direct object 00101 // persistency for clients requiring preallocation of memory for 00102 // persistifiable objects. 00103 00104 public: // with description 00105 00106 virtual ~G4PVReplica(); 00107 00108 G4bool IsMany() const; 00109 G4bool IsReplicated() const; 00110 00111 virtual G4int GetCopyNo() const; 00112 virtual void SetCopyNo(G4int CopyNo); 00113 virtual G4bool IsParameterised() const; 00114 virtual G4VPVParameterisation* GetParameterisation() const; 00115 virtual G4int GetMultiplicity() const; 00116 virtual void GetReplicationData(EAxis& axis, 00117 G4int& nReplicas, 00118 G4double& width, 00119 G4double& offset, 00120 G4bool& consuming) const; 00121 00122 virtual void SetRegularStructureId( G4int Code ); 00123 // This method must set a unique code for each type of regular structure. 00124 // - It must be called only during detector construction. 00125 // - It can also be used to prepare any corresponding special 00126 // navigation 'conditions'. 00127 00128 G4bool IsRegularStructure() const; 00129 G4int GetRegularStructureId() const; 00130 // Accessors for specialised geometries 00131 00132 protected: 00133 00134 EAxis faxis; 00135 G4int fnReplicas; 00136 G4double fwidth,foffset; 00137 G4int fcopyNo; 00138 00139 private: 00140 00141 void CheckAndSetParameters(const EAxis pAxis, const G4int nReplicas, 00142 const G4double width, const G4double offset); 00143 G4PVReplica(const G4PVReplica&); 00144 const G4PVReplica& operator=(const G4PVReplica&); 00145 00146 private: 00147 00148 G4int fRegularStructureCode; 00149 G4int fRegularVolsId; 00150 }; 00151 00152 #endif