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 // >> 28 // classes G4ParameterisationPolyhedraRho, >> 29 // G4ParameterisationPolyhedraPhi, >> 30 // G4ParameterisationPolyhedraZ 27 // 31 // 28 // Class description: 32 // Class description: 29 // 33 // 30 // These classes represent the parameterised p 34 // These classes represent the parameterised positioning equivalent to 31 // dividing a G4Polyhedra along one of each ax 35 // dividing a G4Polyhedra along one of each axis Rho, Phi, Z. 32 36 >> 37 // History: >> 38 // ------- 33 // 09.05.01 - P.Arce, Initial version 39 // 09.05.01 - P.Arce, Initial version 34 // 08.04.04 - I.Hrivnacova, Implemented reflec 40 // 08.04.04 - I.Hrivnacova, Implemented reflection 35 //-------------------------------------------- 41 //--------------------------------------------------------------------- 36 #ifndef G4PARAMETERISATIONPOLYHEDRA_HH << 42 #ifndef G4ParameterisationPolyhedra_H 37 #define G4PARAMETERISATIONPOLYHEDRA_HH 1 << 43 #define G4ParameterisationPolyhedra_H 1 38 44 39 #include "G4VDivisionParameterisation.hh" 45 #include "G4VDivisionParameterisation.hh" 40 #include "G4Polyhedra.hh" 46 #include "G4Polyhedra.hh" 41 47 42 class G4VPhysicalVolume; 48 class G4VPhysicalVolume; 43 49 44 // Dummy declarations to get rid of warnings . 50 // Dummy declarations to get rid of warnings ... 45 // 51 // 46 class G4Trd; 52 class G4Trd; 47 class G4Trap; 53 class G4Trap; 48 class G4Cons; 54 class G4Cons; 49 class G4Sphere; 55 class G4Sphere; 50 class G4Orb; 56 class G4Orb; 51 class G4Ellipsoid; 57 class G4Ellipsoid; 52 class G4Torus; 58 class G4Torus; 53 class G4Para; 59 class G4Para; 54 class G4Hype; 60 class G4Hype; 55 class G4Tubs; 61 class G4Tubs; 56 class G4Polycone; 62 class G4Polycone; 57 63 58 class G4VParameterisationPolyhedra : public G4 64 class G4VParameterisationPolyhedra : public G4VDivisionParameterisation 59 { 65 { 60 public: // with description 66 public: // with description 61 67 62 G4VParameterisationPolyhedra( EAxis axis, 68 G4VParameterisationPolyhedra( EAxis axis, G4int nCopies, 63 G4double offset, G 69 G4double offset, G4double step, 64 G4VSolid* msolid, 70 G4VSolid* msolid, DivisionType divType ); 65 71 66 ~G4VParameterisationPolyhedra() override; << 72 virtual ~G4VParameterisationPolyhedra(); 67 73 68 private: 74 private: 69 75 70 G4double ConvertRadiusFactor(const G4Polyh 76 G4double ConvertRadiusFactor(const G4Polyhedra& phedra) const; 71 // Converts radius of the sides to radiu 77 // Converts radius of the sides to radius of the corners: 72 // r_corners = r_sides/factor 78 // r_corners = r_sides/factor 73 }; 79 }; 74 80 75 //-------------------------------------------- 81 //--------------------------------------------------------------------- 76 // Class G4ParameterisationPolyhedraRho 82 // Class G4ParameterisationPolyhedraRho 77 //-------------------------------------------- 83 //--------------------------------------------------------------------- 78 84 79 class G4ParameterisationPolyhedraRho : public 85 class G4ParameterisationPolyhedraRho : public G4VParameterisationPolyhedra 80 { 86 { 81 public: // with description 87 public: // with description 82 88 83 G4ParameterisationPolyhedraRho( EAxis axis 89 G4ParameterisationPolyhedraRho( EAxis axis, G4int nCopies, 84 G4double o 90 G4double offset, G4double step, 85 G4VSolid* 91 G4VSolid* motherSolid, 86 DivisionTy 92 DivisionType divType ); 87 ~G4ParameterisationPolyhedraRho() override; << 93 ~G4ParameterisationPolyhedraRho(); 88 94 89 void CheckParametersValidity() override; << 95 void CheckParametersValidity(); 90 96 91 G4double GetMaxParameter() const override; << 97 G4double GetMaxParameter() const; 92 98 93 void ComputeTransformation( const G4int co 99 void ComputeTransformation( const G4int copyNo, 94 G4VPhysi << 100 G4VPhysicalVolume* physVol ) const; 95 void ComputeDimensions( G4Polyhedra& phedr 101 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, 96 const G4VPhysicalV << 102 const G4VPhysicalVolume* physVol ) const; 97 103 98 private: // Dummy declarations to get rid o 104 private: // Dummy declarations to get rid of warnings ... 99 105 100 void ComputeDimensions (G4Trd&,const G4int 106 void ComputeDimensions (G4Trd&,const G4int, 101 const G4VPhysicalV << 107 const G4VPhysicalVolume*) const {} 102 void ComputeDimensions (G4Trap&,const G4in 108 void ComputeDimensions (G4Trap&,const G4int, 103 const G4VPhysicalV << 109 const G4VPhysicalVolume*) const {} 104 void ComputeDimensions (G4Box&,const G4int 110 void ComputeDimensions (G4Box&,const G4int, 105 const G4VPhysicalV << 111 const G4VPhysicalVolume*) const {} 106 void ComputeDimensions (G4Sphere&,const G4 112 void ComputeDimensions (G4Sphere&,const G4int, 107 const G4VPhysicalV << 113 const G4VPhysicalVolume*) const {} 108 void ComputeDimensions (G4Orb&,const G4int 114 void ComputeDimensions (G4Orb&,const G4int, 109 const G4VPhysicalV << 115 const G4VPhysicalVolume*) const {} 110 void ComputeDimensions (G4Ellipsoid&,const 116 void ComputeDimensions (G4Ellipsoid&,const G4int, 111 const G4VPhysicalV << 117 const G4VPhysicalVolume*) const {} 112 void ComputeDimensions (G4Torus&,const G4i 118 void ComputeDimensions (G4Torus&,const G4int, 113 const G4VPhysicalV << 119 const G4VPhysicalVolume*) const {} 114 void ComputeDimensions (G4Para&,const G4in 120 void ComputeDimensions (G4Para&,const G4int, 115 const G4VPhysicalV << 121 const G4VPhysicalVolume*) const {} 116 void ComputeDimensions (G4Hype&,const G4in 122 void ComputeDimensions (G4Hype&,const G4int, 117 const G4VPhysicalV << 123 const G4VPhysicalVolume*) const {} 118 void ComputeDimensions (G4Tubs&,const G4in 124 void ComputeDimensions (G4Tubs&,const G4int, 119 const G4VPhysicalV << 125 const G4VPhysicalVolume*) const {} 120 void ComputeDimensions (G4Cons&,const G4in 126 void ComputeDimensions (G4Cons&,const G4int, 121 const G4VPhysicalV << 127 const G4VPhysicalVolume*) const {} 122 void ComputeDimensions (G4Polycone&,const 128 void ComputeDimensions (G4Polycone&,const G4int, 123 const G4VPhysicalV << 129 const G4VPhysicalVolume*) const {} 124 }; 130 }; 125 131 126 //-------------------------------------------- 132 //--------------------------------------------------------------------- 127 // Class G4ParameterisationPolyhedraPhi 133 // Class G4ParameterisationPolyhedraPhi 128 //-------------------------------------------- 134 //--------------------------------------------------------------------- 129 135 130 class G4ParameterisationPolyhedraPhi : public 136 class G4ParameterisationPolyhedraPhi : public G4VParameterisationPolyhedra 131 { 137 { 132 public: // with description 138 public: // with description 133 139 134 G4ParameterisationPolyhedraPhi( EAxis axis 140 G4ParameterisationPolyhedraPhi( EAxis axis, G4int nCopies, 135 G4double of 141 G4double offset, G4double step, 136 G4VSolid* m 142 G4VSolid* motherSolid, 137 DivisionTyp 143 DivisionType divType ); 138 ~G4ParameterisationPolyhedraPhi() override; << 144 ~G4ParameterisationPolyhedraPhi(); 139 145 140 void CheckParametersValidity() override; << 146 void CheckParametersValidity(); 141 147 142 G4double GetMaxParameter() const override; << 148 G4double GetMaxParameter() const; 143 149 144 void ComputeTransformation( const G4int co 150 void ComputeTransformation( const G4int copyNo, 145 G4VPhysi << 151 G4VPhysicalVolume* physVol ) const; 146 void ComputeDimensions( G4Polyhedra& phedr 152 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, 147 const G4VPhysicalV << 153 const G4VPhysicalVolume* physVol ) const; 148 154 149 private: // Dummy declarations to get rid o 155 private: // Dummy declarations to get rid of warnings ... 150 156 151 void ComputeDimensions (G4Trd&,const G4int 157 void ComputeDimensions (G4Trd&,const G4int, 152 const G4VPhysicalV << 158 const G4VPhysicalVolume*) const {} 153 void ComputeDimensions (G4Trap&,const G4in 159 void ComputeDimensions (G4Trap&,const G4int, 154 const G4VPhysicalV << 160 const G4VPhysicalVolume*) const {} 155 void ComputeDimensions (G4Box&,const G4int 161 void ComputeDimensions (G4Box&,const G4int, 156 const G4VPhysicalV << 162 const G4VPhysicalVolume*) const {} 157 void ComputeDimensions (G4Sphere&,const G4 163 void ComputeDimensions (G4Sphere&,const G4int, 158 const G4VPhysicalV << 164 const G4VPhysicalVolume*) const {} 159 void ComputeDimensions (G4Orb&,const G4int 165 void ComputeDimensions (G4Orb&,const G4int, 160 const G4VPhysicalV << 166 const G4VPhysicalVolume*) const {} 161 void ComputeDimensions (G4Ellipsoid&,const 167 void ComputeDimensions (G4Ellipsoid&,const G4int, 162 const G4VPhysicalV << 168 const G4VPhysicalVolume*) const {} 163 void ComputeDimensions (G4Torus&,const G4i 169 void ComputeDimensions (G4Torus&,const G4int, 164 const G4VPhysicalV << 170 const G4VPhysicalVolume*) const {} 165 void ComputeDimensions (G4Para&,const G4in 171 void ComputeDimensions (G4Para&,const G4int, 166 const G4VPhysicalV << 172 const G4VPhysicalVolume*) const {} 167 void ComputeDimensions (G4Hype&,const G4in 173 void ComputeDimensions (G4Hype&,const G4int, 168 const G4VPhysicalV << 174 const G4VPhysicalVolume*) const {} 169 void ComputeDimensions (G4Tubs&,const G4in 175 void ComputeDimensions (G4Tubs&,const G4int, 170 const G4VPhysicalV << 176 const G4VPhysicalVolume*) const {} 171 void ComputeDimensions (G4Cons&,const G4in 177 void ComputeDimensions (G4Cons&,const G4int, 172 const G4VPhysicalV << 178 const G4VPhysicalVolume*) const {} 173 void ComputeDimensions (G4Polycone&,const 179 void ComputeDimensions (G4Polycone&,const G4int, 174 const G4VPhysicalV << 180 const G4VPhysicalVolume*) const {} 175 }; 181 }; 176 182 177 //-------------------------------------------- 183 //--------------------------------------------------------------------- 178 // Class G4ParameterisationPolyhedraZ 184 // Class G4ParameterisationPolyhedraZ 179 //-------------------------------------------- 185 //--------------------------------------------------------------------- 180 186 181 class G4ParameterisationPolyhedraZ : public G4 187 class G4ParameterisationPolyhedraZ : public G4VParameterisationPolyhedra 182 { 188 { 183 public: // with description 189 public: // with description 184 190 185 G4ParameterisationPolyhedraZ( EAxis axis, 191 G4ParameterisationPolyhedraZ( EAxis axis, G4int nCopies, 186 G4double off 192 G4double offset, G4double step, 187 G4VSolid* mo 193 G4VSolid* motherSolid, 188 DivisionType 194 DivisionType divType ); 189 ~G4ParameterisationPolyhedraZ() override; << 195 ~G4ParameterisationPolyhedraZ(); 190 196 191 void CheckParametersValidity() override; << 197 void CheckParametersValidity(); 192 198 193 G4double GetMaxParameter() const override; << 199 G4double GetMaxParameter() const; 194 200 195 void ComputeTransformation( const G4int co 201 void ComputeTransformation( const G4int copyNo, 196 G4VPhysi << 202 G4VPhysicalVolume* physVol ) const; 197 void ComputeDimensions( G4Polyhedra& phedr 203 void ComputeDimensions( G4Polyhedra& phedra, const G4int copyNo, 198 const G4VPhysicalV << 204 const G4VPhysicalVolume* physVol ) const; 199 205 200 private: 206 private: 201 207 202 G4double GetR(G4double z, G4double z1, G4d 208 G4double GetR(G4double z, G4double z1, G4double r1, 203 G4double z2, G4double r2) co 209 G4double z2, G4double r2) const; 204 G4double GetRmin(G4double z, G4int nsegmen 210 G4double GetRmin(G4double z, G4int nsegment) const; 205 G4double GetRmax(G4double z, G4int nsegmen 211 G4double GetRmax(G4double z, G4int nsegment) const; 206 212 207 // Dummy declarations to get rid of warnin 213 // Dummy declarations to get rid of warnings ... 208 void ComputeDimensions (G4Trd&,const G4int 214 void ComputeDimensions (G4Trd&,const G4int, 209 const G4VPhysicalV << 215 const G4VPhysicalVolume*) const {} 210 void ComputeDimensions (G4Trap&,const G4in 216 void ComputeDimensions (G4Trap&,const G4int, 211 const G4VPhysicalV << 217 const G4VPhysicalVolume*) const {} 212 void ComputeDimensions (G4Box&,const G4int 218 void ComputeDimensions (G4Box&,const G4int, 213 const G4VPhysicalV << 219 const G4VPhysicalVolume*) const {} 214 void ComputeDimensions (G4Sphere&,const G4 220 void ComputeDimensions (G4Sphere&,const G4int, 215 const G4VPhysicalV << 221 const G4VPhysicalVolume*) const {} 216 void ComputeDimensions (G4Orb&,const G4int 222 void ComputeDimensions (G4Orb&,const G4int, 217 const G4VPhysicalV << 223 const G4VPhysicalVolume*) const {} 218 void ComputeDimensions (G4Ellipsoid&,const 224 void ComputeDimensions (G4Ellipsoid&,const G4int, 219 const G4VPhysicalV << 225 const G4VPhysicalVolume*) const {} 220 void ComputeDimensions (G4Torus&,const G4i 226 void ComputeDimensions (G4Torus&,const G4int, 221 const G4VPhysicalV << 227 const G4VPhysicalVolume*) const {} 222 void ComputeDimensions (G4Para&,const G4in 228 void ComputeDimensions (G4Para&,const G4int, 223 const G4VPhysicalV << 229 const G4VPhysicalVolume*) const {} 224 void ComputeDimensions (G4Hype&,const G4in 230 void ComputeDimensions (G4Hype&,const G4int, 225 const G4VPhysicalV << 231 const G4VPhysicalVolume*) const {} 226 void ComputeDimensions (G4Tubs&,const G4in 232 void ComputeDimensions (G4Tubs&,const G4int, 227 const G4VPhysicalV << 233 const G4VPhysicalVolume*) const {} 228 void ComputeDimensions (G4Cons&,const G4in 234 void ComputeDimensions (G4Cons&,const G4int, 229 const G4VPhysicalV << 235 const G4VPhysicalVolume*) const {} 230 void ComputeDimensions (G4Polycone&,const 236 void ComputeDimensions (G4Polycone&,const G4int, 231 const G4VPhysicalV << 237 const G4VPhysicalVolume*) const {} 232 private: 238 private: 233 239 234 G4int fNSegment = 0; << 240 G4int fNSegment; 235 G4PolyhedraHistorical* fOrigParamMother = << 241 G4PolyhedraHistorical* fOrigParamMother; 236 }; 242 }; 237 243 238 #endif 244 #endif 239 245