- Timestamp:
- Dec 22, 2010, 3:52:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.