[831] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4TwistTubsFlatSide.hh,v 1.5 2006/06/29 18:47:53 gunter Exp $ |
---|
[1337] | 28 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
[831] | 29 | // |
---|
| 30 | // |
---|
| 31 | // -------------------------------------------------------------------- |
---|
| 32 | // GEANT 4 class header file |
---|
| 33 | // |
---|
| 34 | // |
---|
| 35 | // G4TwistTubsFlatSide |
---|
| 36 | // |
---|
| 37 | // Class description: |
---|
| 38 | // |
---|
| 39 | // Class describing a flat boundary surface for a cylinder. |
---|
| 40 | |
---|
| 41 | // Author: |
---|
| 42 | // 01-Aug-2002 - Kotoyo Hoshina (hoshina@hepburn.s.chiba-u.ac.jp) |
---|
| 43 | // |
---|
| 44 | // History: |
---|
| 45 | // 13-Nov-2003 - O.Link (Oliver.Link@cern.ch), Integration in Geant4 |
---|
| 46 | // from original version in Jupiter-2.5.02 application. |
---|
| 47 | // -------------------------------------------------------------------- |
---|
| 48 | #ifndef __G4TWISTTUBSFLATSIDE__ |
---|
| 49 | #define __G4TWISTTUBSFLATSIDE__ |
---|
| 50 | |
---|
| 51 | #include "G4VTwistSurface.hh" |
---|
| 52 | |
---|
| 53 | class G4TwistTubsFlatSide : public G4VTwistSurface |
---|
| 54 | { |
---|
| 55 | public: // with description |
---|
| 56 | |
---|
| 57 | G4TwistTubsFlatSide(const G4String &name, |
---|
| 58 | const G4RotationMatrix &rot, |
---|
| 59 | const G4ThreeVector &tlate, |
---|
| 60 | const G4ThreeVector &n, |
---|
| 61 | const EAxis axis1 = kRho, // RHO axis ! |
---|
| 62 | const EAxis axis2 = kPhi, // PHI axis ! |
---|
| 63 | G4double axis0min = -kInfinity, |
---|
| 64 | G4double axis1min = -kInfinity, |
---|
| 65 | G4double axis0max = kInfinity, |
---|
| 66 | G4double axis1max = kInfinity ); |
---|
| 67 | |
---|
| 68 | G4TwistTubsFlatSide( const G4String &name, |
---|
| 69 | G4double EndInnerRadius[2], |
---|
| 70 | G4double EndOuterRadius[2], |
---|
| 71 | G4double DPhi, |
---|
| 72 | G4double EndPhi[2], |
---|
| 73 | G4double EndZ[2], |
---|
| 74 | G4int handedness ) ; |
---|
| 75 | |
---|
| 76 | virtual ~G4TwistTubsFlatSide(); |
---|
| 77 | virtual G4ThreeVector GetNormal(const G4ThreeVector & /* xx */ , |
---|
| 78 | G4bool isGlobal = false); |
---|
| 79 | virtual G4int DistanceToSurface(const G4ThreeVector &gp, |
---|
| 80 | const G4ThreeVector &gv, |
---|
| 81 | G4ThreeVector gxx[], |
---|
| 82 | G4double distance[], |
---|
| 83 | G4int areacode[], |
---|
| 84 | G4bool isvalid[], |
---|
| 85 | EValidate validate = kValidateWithTol); |
---|
| 86 | |
---|
| 87 | virtual G4int DistanceToSurface(const G4ThreeVector &gp, |
---|
| 88 | G4ThreeVector gxx[], |
---|
| 89 | G4double distance[], |
---|
| 90 | G4int areacode[]); |
---|
| 91 | |
---|
| 92 | virtual G4ThreeVector SurfacePoint(G4double, G4double, |
---|
| 93 | G4bool isGlobal = false ) ; |
---|
| 94 | virtual G4double GetBoundaryMin(G4double phi) ; |
---|
| 95 | virtual G4double GetBoundaryMax(G4double phi) ; |
---|
| 96 | virtual G4double GetSurfaceArea() { return fSurfaceArea ; } |
---|
| 97 | virtual void GetFacets( G4int m, G4int n, G4double xyz[][3], |
---|
| 98 | G4int faces[][4], G4int iside ) ; |
---|
| 99 | |
---|
| 100 | G4double fSurfaceArea ; |
---|
| 101 | |
---|
| 102 | public: // without description |
---|
| 103 | |
---|
| 104 | G4TwistTubsFlatSide(__void__&); |
---|
| 105 | // Fake default constructor for usage restricted to direct object |
---|
| 106 | // persistency for clients requiring preallocation of memory for |
---|
| 107 | // persistifiable objects. |
---|
| 108 | |
---|
| 109 | protected: // with description |
---|
| 110 | |
---|
| 111 | virtual G4int GetAreaCode(const G4ThreeVector &xx, |
---|
| 112 | G4bool withTol = true) ; |
---|
| 113 | |
---|
| 114 | private: |
---|
| 115 | |
---|
| 116 | virtual void SetCorners(); |
---|
| 117 | virtual void SetBoundaries(); |
---|
| 118 | |
---|
| 119 | }; |
---|
| 120 | |
---|
| 121 | inline G4ThreeVector G4TwistTubsFlatSide:: |
---|
| 122 | SurfacePoint(G4double phi , G4double rho , G4bool isGlobal ) |
---|
| 123 | { |
---|
| 124 | G4ThreeVector SurfPoint (rho*std::cos(phi) , rho*std::sin(phi) , 0); |
---|
| 125 | |
---|
| 126 | if (isGlobal) { return (fRot * SurfPoint + fTrans); } |
---|
| 127 | return SurfPoint; |
---|
| 128 | } |
---|
| 129 | |
---|
| 130 | inline |
---|
| 131 | G4double G4TwistTubsFlatSide::GetBoundaryMin(G4double) |
---|
| 132 | { |
---|
| 133 | G4ThreeVector dphimin = GetCorner(sC0Max1Min); |
---|
| 134 | return std::atan2( dphimin.y(), dphimin.x() ); |
---|
| 135 | } |
---|
| 136 | |
---|
| 137 | inline |
---|
| 138 | G4double G4TwistTubsFlatSide::GetBoundaryMax(G4double) |
---|
| 139 | { |
---|
| 140 | G4ThreeVector dphimax = GetCorner(sC0Max1Max); |
---|
| 141 | return std::atan2( dphimax.y(), dphimax.x() ); |
---|
| 142 | } |
---|
| 143 | |
---|
| 144 | #endif |
---|