Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4TwistTrapFlatSide.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4FlatTrapSurface
0027 //
0028 // Class description:
0029 //
0030 // Class describing a flat boundary surface for a trapezoid.
0031 
0032 // Author: 27-Oct-2004 - O.Link (Oliver.Link@cern.ch)
0033 // --------------------------------------------------------------------
0034 #ifndef G4TWISTTRAPFLATSIDE_HH
0035 #define G4TWISTTRAPFLATSIDE_HH
0036 
0037 #include "G4VTwistSurface.hh"
0038 
0039 class G4TwistTrapFlatSide : public G4VTwistSurface
0040 {
0041   public:
0042 
0043     G4TwistTrapFlatSide( const G4String& name,
0044                                G4double  PhiTwist,
0045                                G4double  pDx1,
0046                                G4double  pDx2,
0047                                G4double  pDy,
0048                                G4double  pDz,
0049                                G4double  pAlpha,
0050                                G4double  pPhi,
0051                                G4double  pTheta,
0052                                G4int     handedness  );
0053    ~G4TwistTrapFlatSide() override;
0054 
0055     G4ThreeVector  GetNormal(const G4ThreeVector& /* xx */ ,
0056                                    G4bool isGlobal = false) override;
0057     G4int DistanceToSurface(const G4ThreeVector& gp,
0058                             const G4ThreeVector& gv,
0059                                   G4ThreeVector  gxx[],
0060                                   G4double       distance[],
0061                                   G4int          areacode[],
0062                                   G4bool         isvalid[],
0063                             EValidate validate = kValidateWithTol) override;
0064 
0065     G4int DistanceToSurface(const G4ThreeVector& gp,
0066                                   G4ThreeVector  gxx[],
0067                                   G4double       distance[],
0068                                   G4int          areacode[]) override;
0069 
0070     inline G4ThreeVector SurfacePoint(G4double x, G4double y,
0071                                       G4bool isGlobal = false) override;  
0072     inline G4double GetBoundaryMin(G4double u) override;
0073     inline G4double GetBoundaryMax(G4double u) override;
0074     inline G4double GetSurfaceArea() override;
0075     void GetFacets( G4int m, G4int n, G4double xyz[][3],
0076                     G4int faces[][4], G4int iside ) override;
0077 
0078     G4TwistTrapFlatSide(__void__&);
0079       // Fake default constructor for usage restricted to direct object
0080       // persistency for clients requiring preallocation of memory for
0081       // persistifiable objects.
0082 
0083   protected:
0084 
0085     G4int GetAreaCode(const G4ThreeVector& xx, 
0086                             G4bool withTol = true) override;
0087 
0088   private:
0089 
0090     void SetCorners() override;
0091     void SetBoundaries() override;
0092 
0093     inline G4double xAxisMax(G4double u, G4double fTanAlpha) const;
0094  
0095   private:
0096   
0097     G4double fDx1;
0098     G4double fDx2;
0099     G4double fDy;
0100     G4double fDz;
0101     G4double fPhiTwist;
0102     G4double fAlpha;
0103     G4double fTAlph;
0104     G4double fPhi;
0105     G4double fTheta;
0106     G4double fdeltaX;
0107     G4double fdeltaY;
0108 };
0109 
0110 //========================================================
0111 // inline functions
0112 //========================================================
0113 
0114 inline 
0115 G4double G4TwistTrapFlatSide::xAxisMax(G4double u, G4double fTanAlpha) const
0116 {
0117   return (  ( fDx2 + fDx1 )/2. + u*(fDx2 - fDx1)/(2.*fDy) + u *fTanAlpha  ) ;
0118 }
0119 
0120 inline G4ThreeVector
0121 G4TwistTrapFlatSide::SurfacePoint(G4double x, G4double y, G4bool isGlobal)
0122 {
0123   G4ThreeVector SurfPoint ( x,y,0);
0124 
0125   if (isGlobal) { return (fRot*SurfPoint + fTrans); }
0126   return SurfPoint;
0127 }
0128 
0129 inline
0130 G4double G4TwistTrapFlatSide::GetBoundaryMin(G4double y)
0131 {
0132   return -xAxisMax(y, -fTAlph) ;
0133 }
0134 
0135 inline
0136 G4double G4TwistTrapFlatSide::GetBoundaryMax(G4double y)
0137 {
0138   return xAxisMax(y, fTAlph) ; 
0139 }
0140 
0141 inline
0142 G4double G4TwistTrapFlatSide::GetSurfaceArea()
0143 {
0144   return 2*(fDx1 + fDx2)*fDy ;
0145 }
0146 
0147 #endif