|
|
|||
File indexing completed on 2026-09-18 08:33:01
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 /// \file RE02NestedPhantomParameterisation.hh 0027 /// \brief Definition of the RE02NestedPhantomParameterisation class 0028 0029 #ifndef RE02NESTEDPARAMETERISATION_HH 0030 #define RE02NESTEDPARAMETERISATION_HH 0031 0032 #include "G4ThreeVector.hh" 0033 #include "G4Types.hh" 0034 #include "G4VNestedParameterisation.hh" 0035 #include "G4VTouchable.hh" 0036 0037 #include <vector> 0038 0039 class G4VPhysicalVolume; 0040 class G4VSolid; 0041 class G4Material; 0042 0043 // CSG Entities which may be parameterised/replicated 0044 // 0045 class G4Box; 0046 class G4Tubs; 0047 class G4Trd; 0048 class G4Trap; 0049 class G4Cons; 0050 class G4Sphere; 0051 class G4Orb; 0052 class G4Ellipsoid; 0053 class G4Torus; 0054 class G4Para; 0055 class G4Polycone; 0056 class G4Polyhedra; 0057 class G4Hype; 0058 0059 // 0060 /// A nested parameterisation class for a phantom 0061 /// 0062 /// (Description) 0063 /// This parameterisation handles material and transfomation of voxles. 0064 /// 0065 /// - G4Material* ComputeMaterial(G4VPhysicalVolume *currentVol, 0066 /// const G4int repNo, 0067 /// const G4VTouchable *parentTouch=0) 0068 /// returns material. 0069 /// if ix%2==0 && iy%2==0 && iz%2==0 then fMat[0] 0070 /// else fMat[1] 0071 /// 0072 /// - G4int GetNumberOfMaterials() const 0073 /// returns the number of material defined in fMat 0074 /// 0075 /// - G4Material* GetMaterial(G4int idx) const 0076 /// returns the i-th material of fMat 0077 /// 0078 /// - void ComputeTransformation(const G4int no, 0079 /// G4VPhysicalVolume *currentPV) const 0080 /// returns a transformation with the physical volume of the 2nd argument 0081 /// according to copyNo 0082 /// Its position is defined as G4ThreeVector(0.,0.,fpZ[copyNo]). 0083 /// 0084 /// - void ComputeDimensions(G4Box &, const G4int, 0085 /// const G4VPhysicalVolume *) const 0086 /// returns dimensions of this parameterized volume with the physical 0087 /// volume of the 3rd argument. 0088 /// 0089 // 0090 class RE02NestedPhantomParameterisation : public G4VNestedParameterisation 0091 { 0092 public: // with description 0093 RE02NestedPhantomParameterisation(const G4ThreeVector& voxelSize, G4int nz, 0094 std::vector<G4Material*>& mat); 0095 ~RE02NestedPhantomParameterisation(); 0096 0097 // Methods required in derived classes 0098 // ----------------------------------- 0099 G4Material* ComputeMaterial(G4VPhysicalVolume* currentVol, const G4int repNo, 0100 const G4VTouchable* parentTouch = 0); 0101 // Required method, as it is the reason for this class. 0102 // Must cope with parentTouch=0 for navigator's SetupHierarchy 0103 0104 G4int GetNumberOfMaterials() const; 0105 G4Material* GetMaterial(G4int idx) const; 0106 // Needed to define materials for instances of Nested Parameterisation 0107 // Current convention: each call should return the materials 0108 // of all instances with the same mother/ancestor volume. 0109 0110 void ComputeTransformation(const G4int no, G4VPhysicalVolume* currentPV) const; 0111 0112 // Methods optional in derived classes 0113 // ----------------------------------- 0114 0115 // Additional standard Parameterisation methods, 0116 // which can be optionally defined, in case solid is used. 0117 0118 void ComputeDimensions(G4Box&, const G4int, const G4VPhysicalVolume*) const; 0119 0120 private: // Dummy declarations to get rid of warnings ... 0121 void ComputeDimensions(G4Trd&, const G4int, const G4VPhysicalVolume*) const {} 0122 void ComputeDimensions(G4Trap&, const G4int, const G4VPhysicalVolume*) const {} 0123 void ComputeDimensions(G4Cons&, const G4int, const G4VPhysicalVolume*) const {} 0124 void ComputeDimensions(G4Sphere&, const G4int, const G4VPhysicalVolume*) const {} 0125 void ComputeDimensions(G4Orb&, const G4int, const G4VPhysicalVolume*) const {} 0126 void ComputeDimensions(G4Ellipsoid&, const G4int, const G4VPhysicalVolume*) const {} 0127 void ComputeDimensions(G4Torus&, const G4int, const G4VPhysicalVolume*) const {} 0128 void ComputeDimensions(G4Para&, const G4int, const G4VPhysicalVolume*) const {} 0129 void ComputeDimensions(G4Hype&, const G4int, const G4VPhysicalVolume*) const {} 0130 void ComputeDimensions(G4Tubs&, const G4int, const G4VPhysicalVolume*) const {} 0131 void ComputeDimensions(G4Polycone&, const G4int, const G4VPhysicalVolume*) const {} 0132 void ComputeDimensions(G4Polyhedra&, const G4int, const G4VPhysicalVolume*) const {} 0133 // G4Material* ComputeMaterial(const G4int repNo, 0134 // G4VPhysicalVolume* currentVol, 0135 // const G4VTouchable* parentTouch) 0136 // { return ComputeMaterial( currentVol, repNo, parentTouch ); } 0137 using G4VNestedParameterisation::ComputeMaterial; 0138 0139 private: 0140 G4double fdX, fdY, fdZ; 0141 G4int fNz; 0142 // 0143 std::vector<G4double> fpZ; 0144 std::vector<G4Material*> fMat; 0145 }; 0146 0147 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|