Ignore:
Timestamp:
Feb 16, 2009, 10:14:30 AM (15 years ago)
Author:
garnier
Message:

en test de gl2ps. Problemes de libraries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/geometry/solids/CSG/include/G4Cons.icc

    r850 r921  
    2525//
    2626//
    27 // $Id: G4Cons.icc,v 1.6 2006/10/19 15:33:37 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4Cons.icc,v 1.8 2008/11/06 10:55:40 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-02-cand-01 $
    2929//
    3030// --------------------------------------------------------------------
     
    3737
    3838inline
    39 G4double G4Cons::GetInnerRadiusMinusZ() const
    40 {
    41   return fRmin1 ;
    42 }
    43 
    44 inline
    45 G4double G4Cons::GetOuterRadiusMinusZ() const
    46 {
    47   return fRmax1 ;
    48 }
    49 
    50 inline
    51 G4double G4Cons::GetInnerRadiusPlusZ() const
    52 {
    53   return fRmin2 ;
    54 }
    55 
    56 inline
    57 G4double G4Cons::GetOuterRadiusPlusZ() const
    58 {
    59   return fRmax2 ;
    60 }
    61 
    62 inline
    63 G4double G4Cons::GetZHalfLength() const
    64 {
    65   return fDz ;
    66 }
    67 
    68 inline 
    69 G4double G4Cons::GetStartPhiAngle() const
    70 {
    71   return fSPhi ;
    72 }
    73 
    74 inline
    75 G4double G4Cons::GetDeltaPhiAngle() const
    76 {
    77   return fDPhi;
    78 }
    79 
    80 inline
    81 void G4Cons::SetInnerRadiusMinusZ( G4double Rmin1 )
    82 {
    83   fRmin1= Rmin1 ;
     39void G4Cons::Initialise()
     40{
    8441  fCubicVolume= 0.;
    8542  fSurfaceArea= 0.;
     
    8744}
    8845
     46inline
     47void G4Cons::InitializeTrigonometry()
     48{
     49  G4double hDPhi = 0.5*fDPhi;                       // half delta phi
     50  G4double cPhi  = fSPhi + hDPhi;
     51  G4double ePhi  = fSPhi + fDPhi;
     52
     53  sinCPhi    = std::sin(cPhi);
     54  cosCPhi    = std::cos(cPhi);
     55  cosHDPhiIT = std::cos(hDPhi - 0.5*kAngTolerance); // inner/outer tol half dphi
     56  cosHDPhiOT = std::cos(hDPhi + 0.5*kAngTolerance);
     57  sinSPhi = std::sin(fSPhi);
     58  cosSPhi = std::cos(fSPhi);
     59  sinEPhi = std::sin(ePhi);
     60  cosEPhi = std::cos(ePhi);
     61}
     62
     63inline
     64G4double G4Cons::GetInnerRadiusMinusZ() const
     65{
     66  return fRmin1 ;
     67}
     68
     69inline
     70G4double G4Cons::GetOuterRadiusMinusZ() const
     71{
     72  return fRmax1 ;
     73}
     74
     75inline
     76G4double G4Cons::GetInnerRadiusPlusZ() const
     77{
     78  return fRmin2 ;
     79}
     80
     81inline
     82G4double G4Cons::GetOuterRadiusPlusZ() const
     83{
     84  return fRmax2 ;
     85}
     86
     87inline
     88G4double G4Cons::GetZHalfLength() const
     89{
     90  return fDz ;
     91}
     92
     93inline 
     94G4double G4Cons::GetStartPhiAngle() const
     95{
     96  return fSPhi ;
     97}
     98
     99inline
     100G4double G4Cons::GetDeltaPhiAngle() const
     101{
     102  return fDPhi;
     103}
     104
     105inline
     106void G4Cons::SetInnerRadiusMinusZ( G4double Rmin1 )
     107{
     108  fRmin1= Rmin1 ;
     109  Initialise();
     110}
     111
    89112inline
    90113void G4Cons::SetOuterRadiusMinusZ( G4double Rmax1 )
    91114{
    92115  fRmax1= Rmax1 ;
    93   fCubicVolume= 0.;
    94   fSurfaceArea= 0.;
    95   fpPolyhedron = 0;
     116  Initialise();
    96117}
    97118
     
    100121{
    101122  fRmin2= Rmin2 ;
    102   fCubicVolume= 0.;
    103   fSurfaceArea= 0.;
    104   fpPolyhedron = 0;
     123  Initialise();
    105124}
    106125
     
    109128{
    110129  fRmax2= Rmax2 ;
    111   fCubicVolume= 0.;
    112   fSurfaceArea= 0.;
    113   fpPolyhedron = 0;
     130  Initialise();
    114131}
    115132
     
    118135{
    119136  fDz= newDz ;
    120   fCubicVolume= 0.;
    121   fSurfaceArea= 0.;
    122   fpPolyhedron = 0;
     137  Initialise();
    123138}
    124139
     
    127142{
    128143  fSPhi= newSPhi;
    129   fCubicVolume= 0.;
    130   fSurfaceArea= 0.;
    131   fpPolyhedron = 0;
     144  Initialise();
     145  InitializeTrigonometry();
    132146}
    133147
    134148void G4Cons::SetDeltaPhiAngle ( G4double newDPhi )
    135149{
     150  if ( newDPhi >= twopi-kAngTolerance*0.5 )
     151  {
     152    fPhiFullCone = true;
     153  }
     154  else if ( newDPhi > 0 )
     155  {
     156    fPhiFullCone = false;
     157  }
     158  else
     159  {
     160     G4cerr << "ERROR - G4Cons()::SetDeltaPhiAngle() : " << GetName() << G4endl
     161            << "        Negative delta-Phi ! - " << newDPhi << G4endl;
     162     G4Exception("G4Cons::SetDeltaPhiAngle()", "InvalidSetup",
     163                  FatalException, "Invalid dphi.");
     164  }
    136165  fDPhi=  newDPhi;
    137   fCubicVolume= 0.;
    138   fSurfaceArea= 0.;
    139   fpPolyhedron = 0;
     166  Initialise();
     167  InitializeTrigonometry();
    140168}
    141169
     
    220248                         + 0.5*(fRmax1*fRmax1-fRmin1*fRmin1
    221249                               +fRmax2*fRmax2-fRmin2*fRmin2 ));
    222     if(fDPhi < twopi )
     250    if(!fPhiFullCone)
    223251    {
    224252      fSurfaceArea = fSurfaceArea+4*fDz*(mmax-mmin);
Note: See TracChangeset for help on using the changeset viewer.