Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4ParameterisationPolyhedra[Rho/Phi/Z] << 26 // >> 27 // $Id$ >> 28 // >> 29 // classes G4ParameterisationPolyhedraRho, >> 30 // G4ParameterisationPolyhedraPhi, >> 31 // G4ParameterisationPolyhedraZ 27 // 32 // 28 // Class description: 33 // Class description: 29 // 34 // 30 // These classes represent the parameterised p 35 // These classes represent the parameterised positioning equivalent to 31 // dividing a G4Polyhedra along one of each ax 36 // dividing a G4Polyhedra along one of each axis Rho, Phi, Z. 32 37 >> 38 // History: >> 39 // ------- 33 // 09.05.01 - P.Arce, Initial version 40 // 09.05.01 - P.Arce, Initial version 34 // 08.04.04 - I.Hrivnacova, Implemented reflec 41 // 08.04.04 - I.Hrivnacova, Implemented reflection 35 //-------------------------------------------- 42 //--------------------------------------------------------------------- 36 #ifndef G4PARAMETERISATIONPOLYHEDRA_HH << 43 #ifndef G4ParameterisationPolyhedra_H 37 #define G4PARAMETERISATIONPOLYHEDRA_HH 1 << 44 #define G4ParameterisationPolyhedra_H 1 38 45 39 #include "G4VDivisionParameterisation.hh" 46 #include "G4VDivisionParameterisation.hh" 40 #include "G4Polyhedra.hh" 47 #include "G4Polyhedra.hh" 41 48 42 class G4VPhysicalVolume; 49 class G4VPhysicalVolume; 43 50 44 // Dummy declarations to get rid of warnings . 51 // Dummy declarations to get rid of warnings ... 45 // 52 // 46 class G4Trd; 53 class G4Trd; 47 class G4Trap; 54 class G4Trap; 48 class G4Cons; 55 class G4Cons; 49 class G4Sphere; 56 class G4Sphere; 50 class G4Orb; 57 class G4Orb; 51 class G4Ellipsoid; 58 class G4Ellipsoid; 52 class G4Torus; 59 class G4Torus; 53 class G4Para; 60 class G4Para; 54 class G4Hype; 61 class G4Hype; 55 class G4Tubs; 62 class G4Tubs; 56 class G4Polycone; 63 class G4Polycone; 57 64 58 class G4VParameterisationPolyhedra : public G4 65 class G4VParameterisationPolyhedra : public G4VDivisionParameterisation 59 { 66 { 60 public: // with description 67 public: // with description 61 68 62 G4VParameterisationPolyhedra( EAxis axis, 69 G4VParameterisationPolyhedra( EAxis axis, G4int nCopies, 63 G4double offset, G 70 G4double offset, G4double step, 64 G4VSolid* msolid, 71 G4VSolid* msolid, DivisionType divType ); 65 72 66 ~G4VParameterisationPolyhedra() override; << 73 virtual ~G4VParameterisationPolyhedra(); 67 74 68 private: 75 private: 69 76 70 G4double ConvertRadiusFactor(const G4Polyh 77 G4double ConvertRadiusFactor(const G4Polyhedra& phedra) const; 71 // Converts radius of the sides to radiu 78 // Converts radius of the sides to radius of the corners: 72 // r_corners = r_sides/factor 79 // r_corners = r_sides/factor 73 }; 80 }; 74 81 75 //-------------------------------------------- 82 //--------------------------------------------------------------------- 76 // Class G4ParameterisationPolyhedraRho 83 // Class G4ParameterisationPolyhedraRho 77 //-------------------------------------------- 84 //--------------------------------------------------------------------- 78 85 79 class G4ParameterisationPolyhedraRho : public 86 class G4ParameterisationPolyhedraRho : public G4VParameterisationPolyhedra 80 { 87 { 81 public: // with description 88 public: // with description 82 89 83 G4ParameterisationPolyhedraRho( EAxis axis 90 G4ParameterisationPolyhedraRho( EAxis axis, G4int nCopies, 84 G4double o 91 G4double offset, G4double step, 85 G4VSolid* 92 G4VSolid* motherSolid, 86 DivisionTy 93 DivisionType divType ); 87 ~G4ParameterisationPolyhedraRho() override; << 94 ~G4ParameterisationPolyhedraRho(); 88 95 89 void CheckParametersValidity() override; << 96 void CheckParametersValidity(); 90 97 91 G4double GetMaxParameter() const override; << 98 G4double GetMaxParameter() const; 92 99 93 void ComputeTransformation( const G4int co 100 void ComputeTransformation( const G4int copyNo, 94 G4VPhysi << 101 G4VPhysicalVolume* physVol ) const; 95 void ComputeDimensions( G4Polyhedra& phedr 102 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, 96 const G4VPhysicalV << 103 const G4VPhysicalVolume* physVol ) const; 97 104 98 private: // Dummy declarations to get rid o 105 private: // Dummy declarations to get rid of warnings ... 99 106 100 void ComputeDimensions (G4Trd&,const G4int 107 void ComputeDimensions (G4Trd&,const G4int, 101 const G4VPhysicalV << 108 const G4VPhysicalVolume*) const {} 102 void ComputeDimensions (G4Trap&,const G4in 109 void ComputeDimensions (G4Trap&,const G4int, 103 const G4VPhysicalV << 110 const G4VPhysicalVolume*) const {} 104 void ComputeDimensions (G4Box&,const G4int 111 void ComputeDimensions (G4Box&,const G4int, 105 const G4VPhysicalV << 112 const G4VPhysicalVolume*) const {} 106 void ComputeDimensions (G4Sphere&,const G4 113 void ComputeDimensions (G4Sphere&,const G4int, 107 const G4VPhysicalV << 114 const G4VPhysicalVolume*) const {} 108 void ComputeDimensions (G4Orb&,const G4int 115 void ComputeDimensions (G4Orb&,const G4int, 109 const G4VPhysicalV << 116 const G4VPhysicalVolume*) const {} 110 void ComputeDimensions (G4Ellipsoid&,const 117 void ComputeDimensions (G4Ellipsoid&,const G4int, 111 const G4VPhysicalV << 118 const G4VPhysicalVolume*) const {} 112 void ComputeDimensions (G4Torus&,const G4i 119 void ComputeDimensions (G4Torus&,const G4int, 113 const G4VPhysicalV << 120 const G4VPhysicalVolume*) const {} 114 void ComputeDimensions (G4Para&,const G4in 121 void ComputeDimensions (G4Para&,const G4int, 115 const G4VPhysicalV << 122 const G4VPhysicalVolume*) const {} 116 void ComputeDimensions (G4Hype&,const G4in 123 void ComputeDimensions (G4Hype&,const G4int, 117 const G4VPhysicalV << 124 const G4VPhysicalVolume*) const {} 118 void ComputeDimensions (G4Tubs&,const G4in 125 void ComputeDimensions (G4Tubs&,const G4int, 119 const G4VPhysicalV << 126 const G4VPhysicalVolume*) const {} 120 void ComputeDimensions (G4Cons&,const G4in 127 void ComputeDimensions (G4Cons&,const G4int, 121 const G4VPhysicalV << 128 const G4VPhysicalVolume*) const {} 122 void ComputeDimensions (G4Polycone&,const 129 void ComputeDimensions (G4Polycone&,const G4int, 123 const G4VPhysicalV << 130 const G4VPhysicalVolume*) const {} 124 }; 131 }; 125 132 126 //-------------------------------------------- 133 //--------------------------------------------------------------------- 127 // Class G4ParameterisationPolyhedraPhi 134 // Class G4ParameterisationPolyhedraPhi 128 //-------------------------------------------- 135 //--------------------------------------------------------------------- 129 136 130 class G4ParameterisationPolyhedraPhi : public 137 class G4ParameterisationPolyhedraPhi : public G4VParameterisationPolyhedra 131 { 138 { 132 public: // with description 139 public: // with description 133 140 134 G4ParameterisationPolyhedraPhi( EAxis axis 141 G4ParameterisationPolyhedraPhi( EAxis axis, G4int nCopies, 135 G4double of 142 G4double offset, G4double step, 136 G4VSolid* m 143 G4VSolid* motherSolid, 137 DivisionTyp 144 DivisionType divType ); 138 ~G4ParameterisationPolyhedraPhi() override; << 145 ~G4ParameterisationPolyhedraPhi(); 139 146 140 void CheckParametersValidity() override; << 147 void CheckParametersValidity(); 141 148 142 G4double GetMaxParameter() const override; << 149 G4double GetMaxParameter() const; 143 150 144 void ComputeTransformation( const G4int co 151 void ComputeTransformation( const G4int copyNo, 145 G4VPhysi << 152 G4VPhysicalVolume* physVol ) const; 146 void ComputeDimensions( G4Polyhedra& phedr 153 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, 147 const G4VPhysicalV << 154 const G4VPhysicalVolume* physVol ) const; 148 155 149 private: // Dummy declarations to get rid o 156 private: // Dummy declarations to get rid of warnings ... 150 157 151 void ComputeDimensions (G4Trd&,const G4int 158 void ComputeDimensions (G4Trd&,const G4int, 152 const G4VPhysicalV << 159 const G4VPhysicalVolume*) const {} 153 void ComputeDimensions (G4Trap&,const G4in 160 void ComputeDimensions (G4Trap&,const G4int, 154 const G4VPhysicalV << 161 const G4VPhysicalVolume*) const {} 155 void ComputeDimensions (G4Box&,const G4int 162 void ComputeDimensions (G4Box&,const G4int, 156 const G4VPhysicalV << 163 const G4VPhysicalVolume*) const {} 157 void ComputeDimensions (G4Sphere&,const G4 164 void ComputeDimensions (G4Sphere&,const G4int, 158 const G4VPhysicalV << 165 const G4VPhysicalVolume*) const {} 159 void ComputeDimensions (G4Orb&,const G4int 166 void ComputeDimensions (G4Orb&,const G4int, 160 const G4VPhysicalV << 167 const G4VPhysicalVolume*) const {} 161 void ComputeDimensions (G4Ellipsoid&,const 168 void ComputeDimensions (G4Ellipsoid&,const G4int, 162 const G4VPhysicalV << 169 const G4VPhysicalVolume*) const {} 163 void ComputeDimensions (G4Torus&,const G4i 170 void ComputeDimensions (G4Torus&,const G4int, 164 const G4VPhysicalV << 171 const G4VPhysicalVolume*) const {} 165 void ComputeDimensions (G4Para&,const G4in 172 void ComputeDimensions (G4Para&,const G4int, 166 const G4VPhysicalV << 173 const G4VPhysicalVolume*) const {} 167 void ComputeDimensions (G4Hype&,const G4in 174 void ComputeDimensions (G4Hype&,const G4int, 168 const G4VPhysicalV << 175 const G4VPhysicalVolume*) const {} 169 void ComputeDimensions (G4Tubs&,const G4in 176 void ComputeDimensions (G4Tubs&,const G4int, 170 const G4VPhysicalV << 177 const G4VPhysicalVolume*) const {} 171 void ComputeDimensions (G4Cons&,const G4in 178 void ComputeDimensions (G4Cons&,const G4int, 172 const G4VPhysicalV << 179 const G4VPhysicalVolume*) const {} 173 void ComputeDimensions (G4Polycone&,const 180 void ComputeDimensions (G4Polycone&,const G4int, 174 const G4VPhysicalV << 181 const G4VPhysicalVolume*) const {} 175 }; 182 }; 176 183 177 //-------------------------------------------- 184 //--------------------------------------------------------------------- 178 // Class G4ParameterisationPolyhedraZ 185 // Class G4ParameterisationPolyhedraZ 179 //-------------------------------------------- 186 //--------------------------------------------------------------------- 180 187 181 class G4ParameterisationPolyhedraZ : public G4 188 class G4ParameterisationPolyhedraZ : public G4VParameterisationPolyhedra 182 { 189 { 183 public: // with description 190 public: // with description 184 191 185 G4ParameterisationPolyhedraZ( EAxis axis, 192 G4ParameterisationPolyhedraZ( EAxis axis, G4int nCopies, 186 G4double off 193 G4double offset, G4double step, 187 G4VSolid* mo 194 G4VSolid* motherSolid, 188 DivisionType 195 DivisionType divType ); 189 ~G4ParameterisationPolyhedraZ() override; << 196 ~G4ParameterisationPolyhedraZ(); 190 197 191 void CheckParametersValidity() override; << 198 void CheckParametersValidity(); 192 199 193 G4double GetMaxParameter() const override; << 200 G4double GetMaxParameter() const; 194 201 195 void ComputeTransformation( const G4int co 202 void ComputeTransformation( const G4int copyNo, 196 G4VPhysi << 203 G4VPhysicalVolume* physVol ) const; 197 void ComputeDimensions( G4Polyhedra& phedr 204 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, 198 const G4VPhysicalV << 205 const G4VPhysicalVolume* physVol ) const; 199 206 200 private: 207 private: 201 208 202 G4double GetR(G4double z, G4double z1, G4d 209 G4double GetR(G4double z, G4double z1, G4double r1, 203 G4double z2, G4double r2) co 210 G4double z2, G4double r2) const; 204 G4double GetRmin(G4double z, G4int nsegmen 211 G4double GetRmin(G4double z, G4int nsegment) const; 205 G4double GetRmax(G4double z, G4int nsegmen 212 G4double GetRmax(G4double z, G4int nsegment) const; 206 213 207 // Dummy declarations to get rid of warnin 214 // Dummy declarations to get rid of warnings ... 208 void ComputeDimensions (G4Trd&,const G4int 215 void ComputeDimensions (G4Trd&,const G4int, 209 const G4VPhysicalV << 216 const G4VPhysicalVolume*) const {} 210 void ComputeDimensions (G4Trap&,const G4in 217 void ComputeDimensions (G4Trap&,const G4int, 211 const G4VPhysicalV << 218 const G4VPhysicalVolume*) const {} 212 void ComputeDimensions (G4Box&,const G4int 219 void ComputeDimensions (G4Box&,const G4int, 213 const G4VPhysicalV << 220 const G4VPhysicalVolume*) const {} 214 void ComputeDimensions (G4Sphere&,const G4 221 void ComputeDimensions (G4Sphere&,const G4int, 215 const G4VPhysicalV << 222 const G4VPhysicalVolume*) const {} 216 void ComputeDimensions (G4Orb&,const G4int 223 void ComputeDimensions (G4Orb&,const G4int, 217 const G4VPhysicalV << 224 const G4VPhysicalVolume*) const {} 218 void ComputeDimensions (G4Ellipsoid&,const 225 void ComputeDimensions (G4Ellipsoid&,const G4int, 219 const G4VPhysicalV << 226 const G4VPhysicalVolume*) const {} 220 void ComputeDimensions (G4Torus&,const G4i 227 void ComputeDimensions (G4Torus&,const G4int, 221 const G4VPhysicalV << 228 const G4VPhysicalVolume*) const {} 222 void ComputeDimensions (G4Para&,const G4in 229 void ComputeDimensions (G4Para&,const G4int, 223 const G4VPhysicalV << 230 const G4VPhysicalVolume*) const {} 224 void ComputeDimensions (G4Hype&,const G4in 231 void ComputeDimensions (G4Hype&,const G4int, 225 const G4VPhysicalV << 232 const G4VPhysicalVolume*) const {} 226 void ComputeDimensions (G4Tubs&,const G4in 233 void ComputeDimensions (G4Tubs&,const G4int, 227 const G4VPhysicalV << 234 const G4VPhysicalVolume*) const {} 228 void ComputeDimensions (G4Cons&,const G4in 235 void ComputeDimensions (G4Cons&,const G4int, 229 const G4VPhysicalV << 236 const G4VPhysicalVolume*) const {} 230 void ComputeDimensions (G4Polycone&,const 237 void ComputeDimensions (G4Polycone&,const G4int, 231 const G4VPhysicalV << 238 const G4VPhysicalVolume*) const {} 232 private: 239 private: 233 240 234 G4int fNSegment = 0; << 241 G4int fNSegment; 235 G4PolyhedraHistorical* fOrigParamMother = << 242 G4PolyhedraHistorical* fOrigParamMother; 236 }; 243 }; 237 244 238 #endif 245 #endif 239 246