Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (13 years ago)
Author:
garnier
Message:

geant4 tag 9.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/geometry/divisions/src/G4ParameterisationTrd.cc

    r1337 r1347  
    2525//
    2626//
    27 // $Id: G4ParameterisationTrd.cc,v 1.16 2008/12/18 12:57:20 gunter Exp $
    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 $
    2929//
    3030// class G4ParameterisationTrd Implementation file
     
    3232// 26.05.03 - P.Arce, Initial version
    3333// 08.04.04 - I.Hrivnacova, Implemented reflection
     34// 21.04.10 - M.Asai, Added gaps
    3435// --------------------------------------------------------------------
    3536
     
    5051                        G4double offset, G4VSolid* msolid,
    5152                        DivisionType divType )
    52   :  G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid )
     53  :  G4VDivisionParameterisation( axis, nDiv, width, offset, divType, msolid ),
     54     bDivInTrap(false)
    5355{
    5456  G4Trd* msol = (G4Trd*)(msolid);
     
    141143  G4ThreeVector origin(0.,0.,0.);
    142144  G4double posi;
    143   if( !bDivInTrap ) {
     145  if( !bDivInTrap )
     146  {
    144147    posi = -mdx + foffset + (copyNo+0.5)*fwidth;
    145   } else {
     148  }
     149  else
     150  {
    146151    G4double aveHL = (msol->GetXHalfLength1()+msol->GetXHalfLength2())/2.;
    147152    posi = - aveHL + foffset + (copyNo+0.5)*aveHL/fnDiv*2;
     
    181186  G4double pDy2 = msol->GetYHalfLength2();
    182187  G4double pDz = msol->GetZHalfLength();
    183   G4double pDx = fwidth/2.;
     188  G4double pDx = fwidth/2. - fhgap;
    184189 
    185190  trd.SetAllParameters ( pDx, pDx, pDy1, pDy2, pDz );
     
    203208  else
    204209  {
    205     return theTrap;
     210    return fmotherSolid;
    206211  }
    207212}
     
    232237                          alp,
    233238                          pDy2,
    234                           pDx1,
    235                           pDx2,
     239                          pDx1 - fhgap,
     240                          pDx2 - fhgap * pDx2/pDx1,
    236241                          alp);
    237242
     
    249254{
    250255  G4VDivisionParameterisation::CheckParametersValidity();
    251 
     256/*
    252257  G4Trd* msol = (G4Trd*)(fmotherSolid);
    253258
     
    258263  if( std::fabs(mpDx1 - mpDx2) > kCarTolerance )
    259264  {
    260     return;
    261 
    262265    G4cerr << "ERROR - G4ParameterisationTrdX::CheckParametersValidity()"
    263266           << G4endl
     
    270273                "Invalid solid specification. NOT supported.");
    271274  }
     275*/
    272276}
    273277
     
    370374  G4double pDx2 = msol->GetXHalfLength2();
    371375  G4double pDz = msol->GetZHalfLength();
    372   G4double pDy = fwidth/2.;
     376  G4double pDy = fwidth/2. - fhgap;
    373377 
    374378  trd.SetAllParameters ( pDx1, pDx2, pDy, pDy, pDz );
     
    501505  G4double pDy1 = msol->GetYHalfLength1();
    502506  G4double DDy = (msol->GetYHalfLength2() - msol->GetYHalfLength1() );
    503   G4double pDz = fwidth/2.;
     507  G4double pDz = fwidth/2. - fhgap;
    504508  G4double zLength = 2*msol->GetZHalfLength();
    505509 
    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 );
    510514
    511515#ifdef G4DIVDEBUG
Note: See TracChangeset for help on using the changeset viewer.