G4TwistTubsFlatSide.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4TwistTubsFlatSide.hh 67011 2013-01-29 16:17:41Z gcosmo $
00028 //
00029 // 
00030 // --------------------------------------------------------------------
00031 // GEANT 4 class header file
00032 //
00033 //
00034 // G4TwistTubsFlatSide
00035 //
00036 // Class description:
00037 //
00038 //  Class describing a flat boundary surface for a cylinder.
00039 
00040 // Author: 
00041 //   01-Aug-2002 - Kotoyo Hoshina (hoshina@hepburn.s.chiba-u.ac.jp)
00042 //
00043 // History:
00044 //   13-Nov-2003 - O.Link (Oliver.Link@cern.ch), Integration in Geant4
00045 //                 from original version in Jupiter-2.5.02 application.
00046 // --------------------------------------------------------------------
00047 #ifndef __G4TWISTTUBSFLATSIDE__
00048 #define __G4TWISTTUBSFLATSIDE__
00049 
00050 #include "G4VTwistSurface.hh"
00051 
00052 class G4TwistTubsFlatSide : public G4VTwistSurface
00053 {
00054   public:  // with description
00055 
00056    G4TwistTubsFlatSide(const G4String         &name,
00057                  const G4RotationMatrix &rot,
00058                  const G4ThreeVector    &tlate,
00059                  const G4ThreeVector    &n,
00060                  const EAxis             axis1 = kRho, // RHO axis !
00061                  const EAxis             axis2 = kPhi, // PHI axis !
00062                        G4double          axis0min = -kInfinity,
00063                        G4double          axis1min = -kInfinity,
00064                        G4double          axis0max = kInfinity,
00065                        G4double          axis1max = kInfinity );
00066                        
00067    G4TwistTubsFlatSide( const G4String        &name,
00068                         G4double         EndInnerRadius[2],
00069                         G4double         EndOuterRadius[2],
00070                         G4double         DPhi,
00071                         G4double         EndPhi[2],
00072                         G4double         EndZ[2], 
00073                         G4int            handedness ) ;
00074 
00075    virtual ~G4TwistTubsFlatSide();
00076    virtual G4ThreeVector  GetNormal(const G4ThreeVector & /* xx */ ,
00077                                           G4bool isGlobal = false);
00078    virtual G4int DistanceToSurface(const G4ThreeVector &gp,
00079                                    const G4ThreeVector &gv,
00080                                          G4ThreeVector  gxx[],
00081                                          G4double       distance[],
00082                                          G4int          areacode[],
00083                                          G4bool         isvalid[],
00084                                          EValidate validate = kValidateWithTol);
00085                                                   
00086    virtual G4int DistanceToSurface(const G4ThreeVector &gp,
00087                                          G4ThreeVector  gxx[],
00088                                          G4double       distance[],
00089                                          G4int          areacode[]);
00090                                                   
00091   virtual G4ThreeVector SurfacePoint(G4double, G4double,
00092                                      G4bool isGlobal = false ) ;  
00093   virtual G4double GetBoundaryMin(G4double phi) ;
00094   virtual G4double GetBoundaryMax(G4double phi) ;
00095   virtual G4double GetSurfaceArea() { return fSurfaceArea ; }
00096   virtual void GetFacets( G4int m, G4int n, G4double xyz[][3],
00097                           G4int faces[][4], G4int iside ) ;
00098 
00099   G4double fSurfaceArea ;
00100 
00101   public:  // without description
00102 
00103    G4TwistTubsFlatSide(__void__&);
00104      // Fake default constructor for usage restricted to direct object
00105      // persistency for clients requiring preallocation of memory for
00106      // persistifiable objects.
00107 
00108   protected:  // with description
00109 
00110    virtual G4int GetAreaCode(const G4ThreeVector &xx, 
00111                                    G4bool withTol = true) ;
00112 
00113   private:
00114 
00115    virtual void SetCorners();
00116    virtual void SetBoundaries();
00117    
00118 };
00119 
00120 inline G4ThreeVector G4TwistTubsFlatSide::
00121 SurfacePoint(G4double phi , G4double rho , G4bool isGlobal )
00122 {
00123   G4ThreeVector SurfPoint (rho*std::cos(phi) , rho*std::sin(phi) , 0);
00124 
00125   if (isGlobal) { return (fRot * SurfPoint + fTrans); }
00126   return SurfPoint;
00127 }
00128 
00129 inline
00130 G4double G4TwistTubsFlatSide::GetBoundaryMin(G4double)
00131 {
00132   G4ThreeVector dphimin = GetCorner(sC0Max1Min);
00133   return  std::atan2( dphimin.y(), dphimin.x() );  
00134 }
00135 
00136 inline
00137 G4double G4TwistTubsFlatSide::GetBoundaryMax(G4double)
00138 {
00139   G4ThreeVector dphimax = GetCorner(sC0Max1Max);   
00140   return  std::atan2( dphimax.y(), dphimax.x() );  
00141 }
00142 
00143 #endif

Generated on Mon May 27 17:50:04 2013 for Geant4 by  doxygen 1.4.7