Changeset 1347 for trunk/source/geometry/divisions/src
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (15 years ago)
- Location:
- trunk/source/geometry/divisions/src
- Files:
-
- 10 edited
-
G4PVDivision.cc (modified) (4 diffs)
-
G4PVDivisionFactory.cc (modified) (2 diffs)
-
G4ParameterisationBox.cc (modified) (5 diffs)
-
G4ParameterisationCons.cc (modified) (7 diffs)
-
G4ParameterisationPara.cc (modified) (5 diffs)
-
G4ParameterisationPolycone.cc (modified) (1 diff)
-
G4ParameterisationPolyhedra.cc (modified) (1 diff)
-
G4ParameterisationTrd.cc (modified) (12 diffs)
-
G4ParameterisationTubs.cc (modified) (5 diffs)
-
G4VDivisionParameterisation.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/divisions/src/G4PVDivision.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4PVDivision.cc,v 1.2 2 2008/12/03 16:41:45 arceExp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4PVDivision.cc,v 1.24 2010/09/06 09:28:24 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4PVDivision Implementation file … … 62 62 G4Exception("G4PVDivision::G4PVDivision()", "InvalidSetup", 63 63 FatalException, message_1); 64 return; 64 65 } 65 66 if (pLogical == pMotherLogical) 66 67 { 67 G4String message_2 = 68 "Cannot place a volume inside itself! Volume: " + pName; 68 G4String message_2 = "Cannot place a volume inside itself! Volume: "+ pName; 69 69 G4Exception("G4PVDivision::G4PVDivision()", "InvalidSetup", 70 70 FatalException, message_2); … … 90 90 if (!pMotherLogical) 91 91 { 92 G4String message_1 = 93 "NULL pointer specified as mother! Volume: " + pName; 92 G4String message_1 = "NULL pointer specified as mother! Volume: " + pName; 94 93 G4Exception("G4PVDivision::G4PVDivision()", "InvalidSetup", 95 94 FatalException, message_1); 95 return; 96 96 } 97 97 if (pLogical == pMotherLogical) 98 98 { 99 G4String message_2 = 100 "Cannot place a volume inside itself! Volume: " + pName; 99 G4String message_2 = "Cannot place a volume inside itself! Volume: "+ pName; 101 100 G4Exception("G4PVDivision::G4PVDivision()", "InvalidSetup", 102 101 FatalException, message_2); … … 120 119 if (!pMotherLogical) 121 120 { 122 G4String message_1 = 123 "NULL pointer specified as mother! Volume: " + pName; 121 G4String message_1 = "NULL pointer specified as mother! Volume: " + pName; 124 122 G4Exception("G4PVDivision::G4PVDivision()", "InvalidSetup", 125 123 FatalException, message_1); 124 return; 126 125 } 127 126 if (pLogical == pMotherLogical) 128 127 { 129 G4String message_2 = 130 "Cannot place a volume inside itself! Volume: " + pName; 128 G4String message_2 = "Cannot place a volume inside itself! Volume: "+ pName; 131 129 G4Exception("G4PVDivision::G4PVDivision()", "InvalidSetup", 132 130 FatalException, message_2); -
trunk/source/geometry/divisions/src/G4PVDivisionFactory.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4PVDivisionFactory.cc,v 1. 2 2006/06/29 18:18:33 gunterExp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4PVDivisionFactory.cc,v 1.3 2010/07/02 10:46:27 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4PVDivisionFactory Implementation file … … 137 137 "WrongType", FatalException, 138 138 "Unexpected parameterisation type !"); 139 return 0; 139 140 } 141 else 142 { 143 EAxis axis = divParam->GetAxis(); 144 G4int nofDivisions = divParam->GetNoDiv(); 145 G4double width = divParam->GetWidth(); 146 G4double offset = divParam->GetOffset(); 140 147 141 EAxis axis = divParam->GetAxis(); 142 G4int nofDivisions = divParam->GetNoDiv(); 143 G4double width = divParam->GetWidth(); 144 G4double offset = divParam->GetOffset(); 145 146 return new G4PVDivision(pName, pLogical, pMotherLogical, 147 axis, nofDivisions, width, offset); 148 return new G4PVDivision(pName, pLogical, pMotherLogical, 149 axis, nofDivisions, width, offset); 150 } 148 151 } 149 152 -
trunk/source/geometry/divisions/src/G4ParameterisationBox.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4ParameterisationBox.cc,v 1.1 0 2006/06/29 18:18:35 gunterExp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4ParameterisationBox.cc,v 1.12 2010/11/10 09:15:56 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4ParameterisationBox Implementation file … … 32 32 // 26.05.03 - P.Arce, Initial version 33 33 // 08.04.04 - I.Hrivnacova, Implemented reflection 34 // 21.04.10 - M.Asai, Added gaps 34 35 // -------------------------------------------------------------------- 35 36 … … 152 153 G4Box* msol = (G4Box*)(fmotherSolid); 153 154 154 G4double pDx = fwidth/2. ;155 G4double pDx = fwidth/2. - fhgap; 155 156 G4double pDy = msol->GetYHalfLength(); 156 157 G4double pDz = msol->GetZHalfLength(); … … 254 255 255 256 G4double pDx = msol->GetXHalfLength(); 256 G4double pDy = fwidth/2. ;257 G4double pDy = fwidth/2. - fhgap; 257 258 G4double pDz = msol->GetZHalfLength(); 258 259 … … 356 357 G4double pDx = msol->GetXHalfLength(); 357 358 G4double pDy = msol->GetYHalfLength(); 358 G4double pDz = fwidth/2. ;359 G4double pDz = fwidth/2. - fhgap; 359 360 360 361 box.SetXHalfLength( pDx ); -
trunk/source/geometry/divisions/src/G4ParameterisationCons.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4ParameterisationCons.cc,v 1. 9 2006/06/29 18:18:38 gunterExp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4ParameterisationCons.cc,v 1.11 2010/11/10 09:15:58 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4ParameterisationCons Implementation file … … 32 32 // 26.05.03 - P.Arce, Initial version 33 33 // 08.04.04 - I.Hrivnacova, Implemented reflection 34 // 21.04.10 - M.Asai, Added gaps 34 35 // -------------------------------------------------------------------- 35 36 … … 188 189 G4double pDz = msol->GetZHalfLength(); 189 190 191 G4double d_half_gap = fhgap * pRMax2 / pRMax1; 190 192 //- already rotated double pSR = foffset + copyNo*fwidth; 191 193 G4double pSPhi = msol->GetStartPhiAngle(); 192 194 G4double pDPhi = msol->GetDeltaPhiAngle();; 193 195 194 cons.SetInnerRadiusMinusZ( pRMin1 );195 cons.SetOuterRadiusMinusZ( pRMax1 );196 cons.SetInnerRadiusPlusZ( pRMin2 );197 cons.SetOuterRadiusPlusZ( pRMax2 );196 cons.SetInnerRadiusMinusZ( pRMin1 + fhgap ); 197 cons.SetOuterRadiusMinusZ( pRMax1 - fhgap ); 198 cons.SetInnerRadiusPlusZ( pRMin2 + d_half_gap ); 199 cons.SetOuterRadiusPlusZ( pRMax2 - d_half_gap ); 198 200 cons.SetZHalfLength( pDz ); 199 201 cons.SetStartPhiAngle( pSPhi ); … … 295 297 296 298 //- already rotated double pSPhi = foffset + copyNo*fwidth; 297 G4double pSPhi = foffset + msol->GetStartPhiAngle() ;298 G4double pDPhi = fwidth ;299 G4double pSPhi = foffset + msol->GetStartPhiAngle() + fhgap; 300 G4double pDPhi = fwidth - 2.*fhgap; 299 301 300 302 cons.SetInnerRadiusMinusZ( pRMin1 ); … … 396 398 G4Cons* msol = (G4Cons*)(fmotherSolid); 397 399 398 G4double mHalfLength = msol->GetZHalfLength() ;400 G4double mHalfLength = msol->GetZHalfLength() - fhgap; 399 401 G4double aRInner = (msol->GetInnerRadiusPlusZ() 400 402 - msol->GetInnerRadiusMinusZ()) / (2*mHalfLength); … … 405 407 G4double bROuter = (msol->GetOuterRadiusPlusZ() 406 408 + msol->GetOuterRadiusMinusZ()) / 2; 407 G4double xMinusZ = -mHalfLength + OffsetZ() + fwidth*copyNo ;408 G4double xPlusZ = -mHalfLength + OffsetZ() + fwidth*(copyNo+1) ;409 G4double xMinusZ = -mHalfLength + OffsetZ() + fwidth*copyNo + fhgap; 410 G4double xPlusZ = -mHalfLength + OffsetZ() + fwidth*(copyNo+1) - fhgap; 409 411 cons.SetInnerRadiusMinusZ( aRInner * xMinusZ + bRInner ); 410 412 cons.SetOuterRadiusMinusZ( aROuter * xMinusZ + bROuter ); … … 412 414 cons.SetOuterRadiusPlusZ( aROuter * xPlusZ + bROuter ); 413 415 414 G4double pDz = fwidth / 2. ;416 G4double pDz = fwidth / 2. - fhgap; 415 417 G4double pSPhi = msol->GetStartPhiAngle(); 416 418 G4double pDPhi = msol->GetDeltaPhiAngle(); -
trunk/source/geometry/divisions/src/G4ParameterisationPara.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4ParameterisationPara.cc,v 1.1 1 2006/06/29 18:18:42 gunterExp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4ParameterisationPara.cc,v 1.13 2010/11/10 09:16:03 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4ParameterisationPara Implementation file … … 32 32 // 26.05.03 - P.Arce, Initial version 33 33 // 08.04.04 - I.Hrivnacova, Implemented reflection 34 // 21.04.10 - M.Asai, Added gaps 34 35 // -------------------------------------------------------------------- 35 36 … … 162 163 163 164 //---- Get 164 G4double pDx = fwidth/2. ;165 G4double pDx = fwidth/2. - fhgap; 165 166 G4double pDy = msol->GetYHalfLength(); 166 167 G4double pDz = msol->GetZHalfLength(); … … 265 266 //---- Get 266 267 G4double pDx = msol->GetXHalfLength(); 267 G4double pDy = fwidth/2. ;268 G4double pDy = fwidth/2. - fhgap; 268 269 G4double pDz = msol->GetZHalfLength(); 269 270 G4double pAlpha = std::atan(msol->GetTanAlpha()); … … 366 367 G4double pDx = msol->GetXHalfLength(); 367 368 G4double pDy = msol->GetYHalfLength(); 369 G4double pDz = fwidth/2. - fhgap; 368 370 G4double pAlpha = std::atan(msol->GetTanAlpha()); 369 371 G4double pTheta = msol->GetSymAxis().theta(); 370 372 G4double pPhi = msol->GetSymAxis().phi(); 371 G4double pDz = fwidth/2.;372 373 373 374 para.SetAllParameters ( pDx, pDy, pDz, pAlpha, pTheta, pPhi ); -
trunk/source/geometry/divisions/src/G4ParameterisationPolycone.cc
r1337 r1347 26 26 // 27 27 // $Id: G4ParameterisationPolycone.cc,v 1.17 2009/05/18 19:30:29 ivana Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4ParameterisationPolycone Implementation file -
trunk/source/geometry/divisions/src/G4ParameterisationPolyhedra.cc
r1337 r1347 26 26 // 27 27 // $Id: G4ParameterisationPolyhedra.cc,v 1.19 2009/05/20 08:35:52 ivana Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4ParameterisationPolyhedra Implementation file -
trunk/source/geometry/divisions/src/G4ParameterisationTrd.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4ParameterisationTrd.cc,v 1.1 6 2008/12/18 12:57:20 gunterExp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4ParameterisationTrd.cc,v 1.19 2010/11/10 09:16:08 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4ParameterisationTrd Implementation file … … 32 32 // 26.05.03 - P.Arce, Initial version 33 33 // 08.04.04 - I.Hrivnacova, Implemented reflection 34 // 21.04.10 - M.Asai, Added gaps 34 35 // -------------------------------------------------------------------- 35 36 … … 50 51 G4double offset, G4VSolid* msolid, 51 52 DivisionType divType ) 52 : G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid ) 53 : G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid ), 54 bDivInTrap(false) 53 55 { 54 56 G4Trd* msol = (G4Trd*)(msolid); … … 141 143 G4ThreeVector origin(0.,0.,0.); 142 144 G4double posi; 143 if( !bDivInTrap ) { 145 if( !bDivInTrap ) 146 { 144 147 posi = -mdx + foffset + (copyNo+0.5)*fwidth; 145 } else { 148 } 149 else 150 { 146 151 G4double aveHL = (msol->GetXHalfLength1()+msol->GetXHalfLength2())/2.; 147 152 posi = - aveHL + foffset + (copyNo+0.5)*aveHL/fnDiv*2; … … 181 186 G4double pDy2 = msol->GetYHalfLength2(); 182 187 G4double pDz = msol->GetZHalfLength(); 183 G4double pDx = fwidth/2. ;188 G4double pDx = fwidth/2. - fhgap; 184 189 185 190 trd.SetAllParameters ( pDx, pDx, pDy1, pDy2, pDz ); … … 203 208 else 204 209 { 205 return theTrap;210 return fmotherSolid; 206 211 } 207 212 } … … 232 237 alp, 233 238 pDy2, 234 pDx1 ,235 pDx2 ,239 pDx1 - fhgap, 240 pDx2 - fhgap * pDx2/pDx1, 236 241 alp); 237 242 … … 249 254 { 250 255 G4VDivisionParameterisation::CheckParametersValidity(); 251 256 /* 252 257 G4Trd* msol = (G4Trd*)(fmotherSolid); 253 258 … … 258 263 if( std::fabs(mpDx1 - mpDx2) > kCarTolerance ) 259 264 { 260 return;261 262 265 G4cerr << "ERROR - G4ParameterisationTrdX::CheckParametersValidity()" 263 266 << G4endl … … 270 273 "Invalid solid specification. NOT supported."); 271 274 } 275 */ 272 276 } 273 277 … … 370 374 G4double pDx2 = msol->GetXHalfLength2(); 371 375 G4double pDz = msol->GetZHalfLength(); 372 G4double pDy = fwidth/2. ;376 G4double pDy = fwidth/2. - fhgap; 373 377 374 378 trd.SetAllParameters ( pDx1, pDx2, pDy, pDy, pDz ); … … 501 505 G4double pDy1 = msol->GetYHalfLength1(); 502 506 G4double DDy = (msol->GetYHalfLength2() - msol->GetYHalfLength1() ); 503 G4double pDz = fwidth/2. ;507 G4double pDz = fwidth/2. - fhgap; 504 508 G4double zLength = 2*msol->GetZHalfLength(); 505 509 506 trd.SetAllParameters( pDx1+DDx*(OffsetZ()+copyNo*fwidth )/zLength,507 pDx1+DDx*(OffsetZ()+(copyNo+1)*fwidth )/zLength,508 pDy1+DDy*(OffsetZ()+copyNo*fwidth )/zLength,509 pDy1+DDy*(OffsetZ()+(copyNo+1)*fwidth )/zLength, pDz );510 trd.SetAllParameters( pDx1+DDx*(OffsetZ()+copyNo*fwidth+fhgap)/zLength, 511 pDx1+DDx*(OffsetZ()+(copyNo+1)*fwidth-fhgap)/zLength, 512 pDy1+DDy*(OffsetZ()+copyNo*fwidth+fhgap)/zLength, 513 pDy1+DDy*(OffsetZ()+(copyNo+1)*fwidth-fhgap)/zLength, pDz ); 510 514 511 515 #ifdef G4DIVDEBUG -
trunk/source/geometry/divisions/src/G4ParameterisationTubs.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4ParameterisationTubs.cc,v 1. 8 2006/06/29 18:18:50 gunterExp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4ParameterisationTubs.cc,v 1.10 2010/11/10 09:16:13 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4ParameterisationTubs Implementation file … … 32 32 // 26.05.03 - P.Arce, Initial version 33 33 // 08.04.04 - I.Hrivnacova, Implemented reflection 34 // 21.04.10 - M.Asai, Added gaps 34 35 // -------------------------------------------------------------------- 35 36 … … 156 157 G4Tubs* msol = (G4Tubs*)(fmotherSolid); 157 158 158 G4double pRMin = msol->GetInnerRadius() + foffset + fwidth * copyNo ;159 G4double pRMax = msol->GetInnerRadius() + foffset + fwidth * (copyNo+1) ;159 G4double pRMin = msol->GetInnerRadius() + foffset + fwidth * copyNo + fhgap; 160 G4double pRMax = msol->GetInnerRadius() + foffset + fwidth * (copyNo+1) - fhgap; 160 161 G4double pDz = msol->GetZHalfLength(); 161 162 //- already rotated G4double pSR = foffset + copyNo*fwidth; … … 269 270 G4double pDz = msol->GetZHalfLength(); 270 271 //----- already rotated in 'ComputeTransformation' 271 G4double pSPhi = msol->GetStartPhiAngle() ;272 G4double pDPhi = fwidth ;272 G4double pSPhi = msol->GetStartPhiAngle() + fhgap; 273 G4double pDPhi = fwidth - 2.*fhgap; 273 274 274 275 tubs.SetInnerRadius( pRMin ); … … 379 380 G4double pRMax = msol->GetOuterRadius(); 380 381 // G4double pDz = msol->GetZHalfLength() / GetNoDiv(); 381 G4double pDz = fwidth/2. ;382 G4double pDz = fwidth/2. - fhgap; 382 383 G4double pSPhi = msol->GetStartPhiAngle(); 383 384 G4double pDPhi = msol->GetDeltaPhiAngle(); -
trunk/source/geometry/divisions/src/G4VDivisionParameterisation.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4VDivisionParameterisation.cc,v 1.1 4 2008/12/03 16:41:15 arceExp $28 // GEANT4 tag $Name: geant4-09-04- beta-01$27 // $Id: G4VDivisionParameterisation.cc,v 1.16 2010/11/10 09:16:18 gcosmo Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // class G4VDivisionParameterisation Implementation file … … 32 32 // 26.05.03 - P.Arce, Initial version 33 33 // 08.04.04 - I.Hrivnacova, Implemented reflection 34 // 21.04.10 - M.Asai, Added gaps 34 35 // -------------------------------------------------------------------- 35 36 … … 50 51 : faxis(axis), fnDiv( nDiv), fwidth(step), foffset(offset), 51 52 fDivisionType(divType), fmotherSolid( motherSolid ), fReflectedSolid(false), 52 fDeleteSolid(false) 53 fDeleteSolid(false), theVoluFirstCopyNo(1), fhgap(0.) 53 54 { 54 55 #ifdef G4DIVDEBUG … … 61 62 } 62 63 #endif 63 64 theVoluFirstCopyNo = 1;65 64 kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); 66 65 }
Note:
See TracChangeset
for help on using the changeset viewer.
