Changeset 921 for trunk/source/geometry/solids/CSG/include/G4Cons.icc
- Timestamp:
- Feb 16, 2009, 10:14:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/geometry/solids/CSG/include/G4Cons.icc
r850 r921 25 25 // 26 26 // 27 // $Id: G4Cons.icc,v 1. 6 2006/10/19 15:33:37gcosmo 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 $ 29 29 // 30 30 // -------------------------------------------------------------------- … … 37 37 38 38 inline 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 ; 39 void G4Cons::Initialise() 40 { 84 41 fCubicVolume= 0.; 85 42 fSurfaceArea= 0.; … … 87 44 } 88 45 46 inline 47 void 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 63 inline 64 G4double G4Cons::GetInnerRadiusMinusZ() const 65 { 66 return fRmin1 ; 67 } 68 69 inline 70 G4double G4Cons::GetOuterRadiusMinusZ() const 71 { 72 return fRmax1 ; 73 } 74 75 inline 76 G4double G4Cons::GetInnerRadiusPlusZ() const 77 { 78 return fRmin2 ; 79 } 80 81 inline 82 G4double G4Cons::GetOuterRadiusPlusZ() const 83 { 84 return fRmax2 ; 85 } 86 87 inline 88 G4double G4Cons::GetZHalfLength() const 89 { 90 return fDz ; 91 } 92 93 inline 94 G4double G4Cons::GetStartPhiAngle() const 95 { 96 return fSPhi ; 97 } 98 99 inline 100 G4double G4Cons::GetDeltaPhiAngle() const 101 { 102 return fDPhi; 103 } 104 105 inline 106 void G4Cons::SetInnerRadiusMinusZ( G4double Rmin1 ) 107 { 108 fRmin1= Rmin1 ; 109 Initialise(); 110 } 111 89 112 inline 90 113 void G4Cons::SetOuterRadiusMinusZ( G4double Rmax1 ) 91 114 { 92 115 fRmax1= Rmax1 ; 93 fCubicVolume= 0.; 94 fSurfaceArea= 0.; 95 fpPolyhedron = 0; 116 Initialise(); 96 117 } 97 118 … … 100 121 { 101 122 fRmin2= Rmin2 ; 102 fCubicVolume= 0.; 103 fSurfaceArea= 0.; 104 fpPolyhedron = 0; 123 Initialise(); 105 124 } 106 125 … … 109 128 { 110 129 fRmax2= Rmax2 ; 111 fCubicVolume= 0.; 112 fSurfaceArea= 0.; 113 fpPolyhedron = 0; 130 Initialise(); 114 131 } 115 132 … … 118 135 { 119 136 fDz= newDz ; 120 fCubicVolume= 0.; 121 fSurfaceArea= 0.; 122 fpPolyhedron = 0; 137 Initialise(); 123 138 } 124 139 … … 127 142 { 128 143 fSPhi= newSPhi; 129 fCubicVolume= 0.; 130 fSurfaceArea= 0.; 131 fpPolyhedron = 0; 144 Initialise(); 145 InitializeTrigonometry(); 132 146 } 133 147 134 148 void G4Cons::SetDeltaPhiAngle ( G4double newDPhi ) 135 149 { 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 } 136 165 fDPhi= newDPhi; 137 fCubicVolume= 0.; 138 fSurfaceArea= 0.; 139 fpPolyhedron = 0; 166 Initialise(); 167 InitializeTrigonometry(); 140 168 } 141 169 … … 220 248 + 0.5*(fRmax1*fRmax1-fRmin1*fRmin1 221 249 +fRmax2*fRmax2-fRmin2*fRmin2 )); 222 if( fDPhi < twopi)250 if(!fPhiFullCone) 223 251 { 224 252 fSurfaceArea = fSurfaceArea+4*fDz*(mmax-mmin);
Note: See TracChangeset
for help on using the changeset viewer.