Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // class G4ParameterisationPara[X,Y,Z] impleme << 23 // >> 24 // $Id: G4ParameterisationPara.cc,v 1.10 2004/12/10 16:20:21 gcosmo Exp $ >> 25 // GEANT4 tag $Name: geant4-07-00-patch-01 $ >> 26 // >> 27 // class G4ParameterisationPara Implementation file 27 // 28 // 28 // 26.05.03 - P.Arce, Initial version 29 // 26.05.03 - P.Arce, Initial version 29 // 08.04.04 - I.Hrivnacova, Implemented reflec 30 // 08.04.04 - I.Hrivnacova, Implemented reflection 30 // 21.04.10 - M.Asai, Added gaps << 31 // ------------------------------------------- 31 // -------------------------------------------------------------------- 32 32 33 #include "G4ParameterisationPara.hh" 33 #include "G4ParameterisationPara.hh" 34 34 35 #include <iomanip> 35 #include <iomanip> 36 36 37 #include "G4PhysicalConstants.hh" << 38 #include "G4ThreeVector.hh" 37 #include "G4ThreeVector.hh" 39 #include "G4Transform3D.hh" 38 #include "G4Transform3D.hh" 40 #include "G4RotationMatrix.hh" 39 #include "G4RotationMatrix.hh" 41 #include "G4VPhysicalVolume.hh" 40 #include "G4VPhysicalVolume.hh" 42 #include "G4ReflectedSolid.hh" 41 #include "G4ReflectedSolid.hh" 43 #include "G4Para.hh" 42 #include "G4Para.hh" 44 43 45 //-------------------------------------------- 44 //-------------------------------------------------------------------------- 46 G4VParameterisationPara:: 45 G4VParameterisationPara:: 47 G4VParameterisationPara( EAxis axis, G4int nDi 46 G4VParameterisationPara( EAxis axis, G4int nDiv, G4double width, 48 G4double offset, G4VS 47 G4double offset, G4VSolid* msolid, 49 DivisionType divType 48 DivisionType divType ) 50 : G4VDivisionParameterisation( axis, nDiv, 49 : G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid ) 51 { 50 { 52 auto msol = (G4Para*)(msolid); << 51 G4Para* msol = (G4Para*)(msolid); 53 if (msolid->GetEntityType() == "G4ReflectedS 52 if (msolid->GetEntityType() == "G4ReflectedSolid") 54 { 53 { 55 // Get constituent solid 54 // Get constituent solid 56 G4VSolid* mConstituentSolid 55 G4VSolid* mConstituentSolid 57 = ((G4ReflectedSolid*)msolid)->GetConst 56 = ((G4ReflectedSolid*)msolid)->GetConstituentMovedSolid(); 58 msol = (G4Para*)(mConstituentSolid); 57 msol = (G4Para*)(mConstituentSolid); 59 fmotherSolid = msol; 58 fmotherSolid = msol; 60 59 61 // Create a new solid with inversed parame 60 // Create a new solid with inversed parameters 62 auto newSolid << 61 G4Para* newSolid 63 = new G4Para(msol->GetName(), 62 = new G4Para(msol->GetName(), 64 msol->GetXHalfLength(), 63 msol->GetXHalfLength(), 65 msol->GetYHalfLength(), 64 msol->GetYHalfLength(), 66 msol->GetZHalfLength(), 65 msol->GetZHalfLength(), 67 std::atan(msol->GetTanAlpha 66 std::atan(msol->GetTanAlpha()), 68 pi - msol->GetSymAxis().the 67 pi - msol->GetSymAxis().theta(), 69 msol->GetSymAxis().phi()); 68 msol->GetSymAxis().phi()); 70 69 71 msol = newSolid; 70 msol = newSolid; 72 fmotherSolid = newSolid; 71 fmotherSolid = newSolid; 73 fReflectedSolid = true; 72 fReflectedSolid = true; 74 fDeleteSolid = true; 73 fDeleteSolid = true; 75 } 74 } 76 } 75 } 77 76 78 //-------------------------------------------- 77 //------------------------------------------------------------------------ 79 G4VParameterisationPara::~G4VParameterisationP << 78 G4VParameterisationPara::~G4VParameterisationPara() >> 79 { >> 80 } 80 81 81 //-------------------------------------------- 82 //------------------------------------------------------------------------ 82 G4ParameterisationParaX:: 83 G4ParameterisationParaX:: 83 G4ParameterisationParaX( EAxis axis, G4int nDi 84 G4ParameterisationParaX( EAxis axis, G4int nDiv, 84 G4double width, G4dou 85 G4double width, G4double offset, 85 G4VSolid* msolid, Div 86 G4VSolid* msolid, DivisionType divType ) 86 : G4VParameterisationPara( axis, nDiv, widt 87 : G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType ) 87 { 88 { 88 CheckParametersValidity(); 89 CheckParametersValidity(); 89 SetType( "DivisionParaX" ); 90 SetType( "DivisionParaX" ); 90 91 91 auto mpara = (G4Para*)(fmotherSolid); << 92 G4Para* mpara = (G4Para*)(fmotherSolid); 92 if( divType == DivWIDTH ) 93 if( divType == DivWIDTH ) 93 { 94 { 94 fnDiv = CalculateNDiv( 2*mpara->GetXHalfLe 95 fnDiv = CalculateNDiv( 2*mpara->GetXHalfLength(), width, offset ); 95 } 96 } 96 else if( divType == DivNDIV ) 97 else if( divType == DivNDIV ) 97 { 98 { 98 fwidth = CalculateWidth( 2*mpara->GetXHalf 99 fwidth = CalculateWidth( 2*mpara->GetXHalfLength(), nDiv, offset ); 99 } 100 } 100 101 101 #ifdef G4DIVDEBUG 102 #ifdef G4DIVDEBUG 102 if( verbose >= 1 ) 103 if( verbose >= 1 ) 103 { 104 { 104 G4cout << " G4ParameterisationParaX - # di 105 G4cout << " G4ParameterisationParaX - # divisions " << fnDiv 105 << " = " << nDiv << G4endl 106 << " = " << nDiv << G4endl 106 << " Offset " << foffset << " = " < 107 << " Offset " << foffset << " = " << offset << G4endl 107 << " Width " << fwidth << " = " << 108 << " Width " << fwidth << " = " << width << G4endl; 108 } 109 } 109 #endif 110 #endif 110 } 111 } 111 112 112 //-------------------------------------------- 113 //------------------------------------------------------------------------ 113 G4double G4ParameterisationParaX::GetMaxParame 114 G4double G4ParameterisationParaX::GetMaxParameter() const 114 { 115 { 115 auto msol = (G4Para*)(fmotherSolid); << 116 G4Para* msol = (G4Para*)(fmotherSolid); 116 return 2*msol->GetXHalfLength(); 117 return 2*msol->GetXHalfLength(); 117 } 118 } 118 119 119 //-------------------------------------------- 120 //------------------------------------------------------------------------ 120 G4ParameterisationParaX::~G4ParameterisationPa << 121 G4ParameterisationParaX::~G4ParameterisationParaX() >> 122 { >> 123 } 121 124 122 //-------------------------------------------- 125 //------------------------------------------------------------------------ 123 void 126 void 124 G4ParameterisationParaX:: 127 G4ParameterisationParaX:: 125 ComputeTransformation( const G4int copyNo, G4V 128 ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const 126 { 129 { 127 auto msol = (G4Para*)(fmotherSolid ); << 130 G4Para* msol = (G4Para*)(fmotherSolid ); 128 G4double mdx = msol->GetXHalfLength( ); 131 G4double mdx = msol->GetXHalfLength( ); 129 132 130 //----- translation 133 //----- translation 131 G4ThreeVector origin(0.,0.,0.); 134 G4ThreeVector origin(0.,0.,0.); 132 G4double posi = -mdx + foffset+(copyNo+0.5)* 135 G4double posi = -mdx + foffset+(copyNo+0.5)*fwidth; 133 origin.setX( posi ); 136 origin.setX( posi ); 134 137 135 #ifdef G4DIVDEBUG 138 #ifdef G4DIVDEBUG 136 if( verbose >= 2 ) 139 if( verbose >= 2 ) 137 { 140 { 138 G4cout << std::setprecision(8) << " G4Para 141 G4cout << std::setprecision(8) << " G4ParameterisationParaX " 139 << copyNo << G4endl 142 << copyNo << G4endl 140 << " Position: " << origin << " - A 143 << " Position: " << origin << " - Axis: " << faxis << G4endl; 141 } 144 } 142 #endif 145 #endif 143 146 144 //----- set translation 147 //----- set translation 145 physVol->SetTranslation( origin ); 148 physVol->SetTranslation( origin ); 146 } 149 } 147 150 148 //-------------------------------------------- 151 //-------------------------------------------------------------------------- 149 void 152 void 150 G4ParameterisationParaX:: 153 G4ParameterisationParaX:: 151 ComputeDimensions(G4Para& para, const G4int, 154 ComputeDimensions(G4Para& para, const G4int, 152 const G4VPhysicalVolume*) co 155 const G4VPhysicalVolume*) const 153 { 156 { 154 //---- The division along X of a Para will r 157 //---- The division along X of a Para will result a Para 155 auto msol = (G4Para*)(fmotherSolid); << 158 G4Para* msol = (G4Para*)(fmotherSolid); 156 159 157 //---- Get 160 //---- Get 158 G4double pDx = fwidth/2. - fhgap; << 161 G4double pDx = fwidth/2.; 159 G4double pDy = msol->GetYHalfLength(); 162 G4double pDy = msol->GetYHalfLength(); 160 G4double pDz = msol->GetZHalfLength(); 163 G4double pDz = msol->GetZHalfLength(); 161 G4double pAlpha = std::atan(msol->GetTanAlph 164 G4double pAlpha = std::atan(msol->GetTanAlpha()); 162 G4double pTheta = msol->GetSymAxis().theta() 165 G4double pTheta = msol->GetSymAxis().theta(); 163 G4double pPhi = msol->GetSymAxis().phi(); 166 G4double pPhi = msol->GetSymAxis().phi(); 164 167 165 para.SetAllParameters ( pDx, pDy, pDz, pAlph 168 para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi ); 166 169 167 #ifdef G4DIVDEBUG 170 #ifdef G4DIVDEBUG 168 if( verbose >= 1 ) 171 if( verbose >= 1 ) 169 { 172 { 170 G4cout << " G4ParameterisationParaX::Compu 173 G4cout << " G4ParameterisationParaX::ComputeDimensions()" 171 << " - Mother PARA " << G4endl; 174 << " - Mother PARA " << G4endl; 172 msol->DumpInfo(); 175 msol->DumpInfo(); 173 G4cout << " - Parameterised PARA: " << G4e 176 G4cout << " - Parameterised PARA: " << G4endl; 174 para.DumpInfo(); 177 para.DumpInfo(); 175 } 178 } 176 #endif 179 #endif 177 } 180 } 178 181 179 //-------------------------------------------- 182 //------------------------------------------------------------------------ 180 G4ParameterisationParaY:: 183 G4ParameterisationParaY:: 181 G4ParameterisationParaY( EAxis axis, G4int nDi 184 G4ParameterisationParaY( EAxis axis, G4int nDiv, 182 G4double width, G4dou 185 G4double width, G4double offset, 183 G4VSolid* msolid, Div 186 G4VSolid* msolid, DivisionType divType ) 184 : G4VParameterisationPara( axis, nDiv, widt 187 : G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType ) 185 { 188 { 186 CheckParametersValidity(); 189 CheckParametersValidity(); 187 SetType( "DivisionParaY" ); 190 SetType( "DivisionParaY" ); 188 191 189 auto mpara = (G4Para*)(fmotherSolid); << 192 G4Para* mpara = (G4Para*)(fmotherSolid); 190 if( divType == DivWIDTH ) 193 if( divType == DivWIDTH ) 191 { 194 { 192 fnDiv = CalculateNDiv( 2*mpara->GetYHalfLe 195 fnDiv = CalculateNDiv( 2*mpara->GetYHalfLength(), width, offset ); 193 } 196 } 194 else if( divType == DivNDIV ) 197 else if( divType == DivNDIV ) 195 { 198 { 196 fwidth = CalculateWidth( 2*mpara->GetYHalf 199 fwidth = CalculateWidth( 2*mpara->GetYHalfLength(), nDiv, offset ); 197 } 200 } 198 201 199 #ifdef G4DIVDEBUG 202 #ifdef G4DIVDEBUG 200 if( verbose >= 1 ) 203 if( verbose >= 1 ) 201 { 204 { 202 G4cout << " G4ParameterisationParaY - # di 205 G4cout << " G4ParameterisationParaY - # divisions " << fnDiv 203 << " = " << nDiv << G4endl 206 << " = " << nDiv << G4endl 204 << " Offset " << foffset << " = " < 207 << " Offset " << foffset << " = " << offset << G4endl 205 << " Width " << fwidth << " = " << 208 << " Width " << fwidth << " = " << width << G4endl; 206 } 209 } 207 #endif 210 #endif 208 } 211 } 209 212 210 //-------------------------------------------- 213 //------------------------------------------------------------------------ 211 G4ParameterisationParaY::~G4ParameterisationPa << 214 G4ParameterisationParaY::~G4ParameterisationParaY() >> 215 { >> 216 } 212 217 213 //-------------------------------------------- 218 //------------------------------------------------------------------------ 214 G4double G4ParameterisationParaY::GetMaxParame 219 G4double G4ParameterisationParaY::GetMaxParameter() const 215 { 220 { 216 auto msol = (G4Para*)(fmotherSolid); << 221 G4Para* msol = (G4Para*)(fmotherSolid); 217 return 2*msol->GetYHalfLength(); 222 return 2*msol->GetYHalfLength(); 218 } 223 } 219 224 220 //-------------------------------------------- 225 //------------------------------------------------------------------------ 221 void 226 void 222 G4ParameterisationParaY:: 227 G4ParameterisationParaY:: 223 ComputeTransformation( const G4int copyNo, G4V 228 ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const 224 { 229 { 225 auto msol = (G4Para*)(fmotherSolid ); << 230 G4Para* msol = (G4Para*)(fmotherSolid ); 226 G4double mdy = msol->GetYHalfLength( ); 231 G4double mdy = msol->GetYHalfLength( ); 227 232 228 //----- translation 233 //----- translation 229 G4ThreeVector origin(0.,0.,0.); 234 G4ThreeVector origin(0.,0.,0.); 230 G4double posiY = -mdy + foffset+(copyNo+0.5) 235 G4double posiY = -mdy + foffset+(copyNo+0.5)*fwidth; 231 origin.setY( posiY ); 236 origin.setY( posiY ); 232 G4double posiX = posiY * msol->GetTanAlpha() 237 G4double posiX = posiY * msol->GetTanAlpha(); 233 origin.setX( posiX ); 238 origin.setX( posiX ); 234 239 235 #ifdef G4DIVDEBUG 240 #ifdef G4DIVDEBUG 236 if( verbose >= 2 ) 241 if( verbose >= 2 ) 237 { 242 { 238 G4cout << std::setprecision(8) << " G4Para 243 G4cout << std::setprecision(8) << " G4ParameterisationParaY " 239 << copyNo << G4endl 244 << copyNo << G4endl 240 << " Position: " << origin << " - A 245 << " Position: " << origin << " - Axis: " << faxis << G4endl; 241 } 246 } 242 #endif 247 #endif 243 248 244 //----- set translation 249 //----- set translation 245 physVol->SetTranslation( origin ); 250 physVol->SetTranslation( origin ); 246 } 251 } 247 252 248 //-------------------------------------------- 253 //-------------------------------------------------------------------------- 249 void 254 void 250 G4ParameterisationParaY:: 255 G4ParameterisationParaY:: 251 ComputeDimensions(G4Para& para, const G4int, 256 ComputeDimensions(G4Para& para, const G4int, 252 const G4VPhysicalVolume*) co 257 const G4VPhysicalVolume*) const 253 { 258 { 254 //---- The division along Y of a Para will r 259 //---- The division along Y of a Para will result a Para 255 auto msol = (G4Para*)(fmotherSolid); << 260 G4Para* msol = (G4Para*)(fmotherSolid); 256 261 257 //---- Get 262 //---- Get 258 G4double pDx = msol->GetXHalfLength(); 263 G4double pDx = msol->GetXHalfLength(); 259 G4double pDy = fwidth/2. - fhgap; << 264 G4double pDy = fwidth/2.; 260 G4double pDz = msol->GetZHalfLength(); 265 G4double pDz = msol->GetZHalfLength(); 261 G4double pAlpha = std::atan(msol->GetTanAlph 266 G4double pAlpha = std::atan(msol->GetTanAlpha()); 262 G4double pTheta = msol->GetSymAxis().theta() 267 G4double pTheta = msol->GetSymAxis().theta(); 263 G4double pPhi = msol->GetSymAxis().phi(); 268 G4double pPhi = msol->GetSymAxis().phi(); 264 269 265 para.SetAllParameters ( pDx, pDy, pDz, pAlph 270 para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi ); 266 271 267 #ifdef G4DIVDEBUG 272 #ifdef G4DIVDEBUG 268 if( verbose >= -1 ) 273 if( verbose >= -1 ) 269 { 274 { 270 G4cout << " G4ParameterisationParaY::Compu 275 G4cout << " G4ParameterisationParaY::ComputeDimensions()" 271 << " - Mother PARA " << G4endl; 276 << " - Mother PARA " << G4endl; 272 msol->DumpInfo(); 277 msol->DumpInfo(); 273 G4cout << " - Parameterised PARA: " << G4e 278 G4cout << " - Parameterised PARA: " << G4endl; 274 para.DumpInfo(); 279 para.DumpInfo(); 275 } 280 } 276 #endif 281 #endif 277 } 282 } 278 283 279 //-------------------------------------------- 284 //------------------------------------------------------------------------ 280 G4ParameterisationParaZ:: 285 G4ParameterisationParaZ:: 281 G4ParameterisationParaZ( EAxis axis, G4int nDi 286 G4ParameterisationParaZ( EAxis axis, G4int nDiv, 282 G4double width, G4dou 287 G4double width, G4double offset, 283 G4VSolid* msolid, Div 288 G4VSolid* msolid, DivisionType divType ) 284 : G4VParameterisationPara( axis, nDiv, widt 289 : G4VParameterisationPara( axis, nDiv, width, offset, msolid, divType ) 285 { 290 { 286 CheckParametersValidity(); 291 CheckParametersValidity(); 287 SetType( "DivisionParaZ" ); 292 SetType( "DivisionParaZ" ); 288 293 289 auto mpara = (G4Para*)(fmotherSolid); << 294 G4Para* mpara = (G4Para*)(fmotherSolid); 290 if( divType == DivWIDTH ) 295 if( divType == DivWIDTH ) 291 { 296 { 292 fnDiv = CalculateNDiv( 2*mpara->GetZHalfLe 297 fnDiv = CalculateNDiv( 2*mpara->GetZHalfLength(), width, offset ); 293 } 298 } 294 else if( divType == DivNDIV ) 299 else if( divType == DivNDIV ) 295 { 300 { 296 fwidth = CalculateWidth( 2*mpara->GetZHalf 301 fwidth = CalculateWidth( 2*mpara->GetZHalfLength(), nDiv, offset ); 297 } 302 } 298 303 299 #ifdef G4DIVDEBUG 304 #ifdef G4DIVDEBUG 300 if( verbose >= -1 ) 305 if( verbose >= -1 ) 301 { 306 { 302 G4cout << " G4ParameterisationParaZ - # di 307 G4cout << " G4ParameterisationParaZ - # divisions " << fnDiv 303 << " = " << nDiv << G4endl 308 << " = " << nDiv << G4endl 304 << " Offset " << foffset << " = " < 309 << " Offset " << foffset << " = " << offset << G4endl 305 << " Width " << fwidth << " = " << 310 << " Width " << fwidth << " = " << width << G4endl; 306 } 311 } 307 #endif 312 #endif 308 } 313 } 309 314 310 //-------------------------------------------- 315 //------------------------------------------------------------------------ 311 G4ParameterisationParaZ::~G4ParameterisationPa << 316 G4ParameterisationParaZ::~G4ParameterisationParaZ() >> 317 { >> 318 } 312 319 313 //-------------------------------------------- 320 //------------------------------------------------------------------------ 314 G4double G4ParameterisationParaZ::GetMaxParame 321 G4double G4ParameterisationParaZ::GetMaxParameter() const 315 { 322 { 316 auto msol = (G4Para*)(fmotherSolid); << 323 G4Para* msol = (G4Para*)(fmotherSolid); 317 return 2*msol->GetZHalfLength(); 324 return 2*msol->GetZHalfLength(); 318 } 325 } 319 326 320 //-------------------------------------------- 327 //------------------------------------------------------------------------ 321 void 328 void 322 G4ParameterisationParaZ:: 329 G4ParameterisationParaZ:: 323 ComputeTransformation( const G4int copyNo, G4V 330 ComputeTransformation( const G4int copyNo, G4VPhysicalVolume *physVol ) const 324 { 331 { 325 auto msol = (G4Para*)(fmotherSolid ); << 332 G4Para* msol = (G4Para*)(fmotherSolid ); 326 G4double mdz = msol->GetZHalfLength( ); 333 G4double mdz = msol->GetZHalfLength( ); 327 334 328 //----- translation 335 //----- translation 329 G4double posi = -mdz + OffsetZ() + (copyNo+0 336 G4double posi = -mdz + OffsetZ() + (copyNo+0.5)*fwidth; 330 G4ThreeVector symAxis = msol->GetSymAxis(); 337 G4ThreeVector symAxis = msol->GetSymAxis(); 331 G4ThreeVector origin( symAxis * posi / symAx 338 G4ThreeVector origin( symAxis * posi / symAxis.z() ); 332 339 333 #ifdef G4DIVDEBUG 340 #ifdef G4DIVDEBUG 334 if( verbose >= 2 ) 341 if( verbose >= 2 ) 335 { 342 { 336 G4cout << std::setprecision(8) << " G4Para 343 G4cout << std::setprecision(8) << " G4ParameterisationParaZ " 337 << copyNo << G4endl 344 << copyNo << G4endl 338 << " Position: " << origin << " - A 345 << " Position: " << origin << " - Axis: " << faxis << G4endl; 339 } 346 } 340 #endif 347 #endif 341 348 342 //----- set translation 349 //----- set translation 343 physVol->SetTranslation( origin ); 350 physVol->SetTranslation( origin ); 344 } 351 } 345 352 346 //-------------------------------------------- 353 //-------------------------------------------------------------------------- 347 void 354 void 348 G4ParameterisationParaZ:: 355 G4ParameterisationParaZ:: 349 ComputeDimensions(G4Para& para, const G4int, 356 ComputeDimensions(G4Para& para, const G4int, 350 const G4VPhysicalVolume*) co 357 const G4VPhysicalVolume*) const 351 { 358 { 352 //---- The division along Z of a Para will r 359 //---- The division along Z of a Para will result a Para 353 auto msol = (G4Para*)(fmotherSolid); << 360 G4Para* msol = (G4Para*)(fmotherSolid); 354 361 355 //---- Get 362 //---- Get 356 G4double pDx = msol->GetXHalfLength(); 363 G4double pDx = msol->GetXHalfLength(); 357 G4double pDy = msol->GetYHalfLength(); 364 G4double pDy = msol->GetYHalfLength(); 358 G4double pDz = fwidth/2. - fhgap; << 359 G4double pAlpha = std::atan(msol->GetTanAlph 365 G4double pAlpha = std::atan(msol->GetTanAlpha()); 360 G4double pTheta = msol->GetSymAxis().theta() 366 G4double pTheta = msol->GetSymAxis().theta(); 361 G4double pPhi = msol->GetSymAxis().phi(); 367 G4double pPhi = msol->GetSymAxis().phi(); >> 368 G4double pDz = fwidth/2.; 362 369 363 para.SetAllParameters ( pDx, pDy, pDz, pAlph 370 para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi ); 364 371 365 #ifdef G4DIVDEBUG 372 #ifdef G4DIVDEBUG 366 if( verbose >= -1 ) 373 if( verbose >= -1 ) 367 { 374 { 368 G4cout << " G4ParameterisationParaZ::Compu 375 G4cout << " G4ParameterisationParaZ::ComputeDimensions()" 369 << " - Mother PARA " << G4endl; 376 << " - Mother PARA " << G4endl; 370 msol->DumpInfo(); 377 msol->DumpInfo(); 371 G4cout << " - Parameterised PARA: " << G4e 378 G4cout << " - Parameterised PARA: " << G4endl; 372 para.DumpInfo(); 379 para.DumpInfo(); 373 } 380 } 374 #endif 381 #endif 375 } 382 } 376 383