Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4TwistTrapParallelSide.icc 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 // Implementation of inline methods of G4TwistTrapParallelSide.
0027 // --------------------------------------------------------------------
0028 
0029 inline 
0030 G4double G4TwistTrapParallelSide::GetValueB(G4double phi) 
0031 {
0032   return ( fDy2plus1 + fDy2minus1 * ( 2 * phi ) / fPhiTwist ) ;
0033 }
0034 
0035 inline
0036 G4double G4TwistTrapParallelSide::Xcoef(G4double phi)
0037 {
0038   return GetValueB(phi)/2. ;
0039 }
0040 
0041 inline G4ThreeVector
0042 G4TwistTrapParallelSide::
0043 SurfacePoint( G4double phi, G4double u, G4bool isGlobal ) 
0044 {
0045   // function to calculate a point on the surface, given by parameters phi,u
0046 
0047   G4ThreeVector SurfPoint ( u*std::cos(phi) - Xcoef(phi)*std::sin(phi)
0048                           + fdeltaX*phi/fPhiTwist,
0049                             u*std::sin(phi) + Xcoef(phi)*std::cos(phi)
0050                           + fdeltaY*phi/fPhiTwist,
0051                             2*fDz*phi/fPhiTwist  );
0052   if (isGlobal) { return (fRot * SurfPoint + fTrans); }
0053   return SurfPoint;
0054 }
0055 
0056 
0057 inline
0058 G4double G4TwistTrapParallelSide::GetBoundaryMin(G4double phi)
0059 {
0060   return  -(fPhiTwist*(fDx2 + fDx4 - fDy2plus1*fTAlph)
0061           + 2*fDx4minus2*phi - 2*fDy2minus1*fTAlph*phi)/(2.*fPhiTwist) ;
0062 }
0063 
0064 inline
0065 G4double G4TwistTrapParallelSide::GetBoundaryMax(G4double phi)
0066 {
0067   return (fDx2 + fDx4 + fDy2plus1*fTAlph)/ 2.
0068        + ((fDx4minus2 + fDy2minus1*fTAlph)*phi)/fPhiTwist ;
0069 }
0070 
0071 inline
0072 G4double  G4TwistTrapParallelSide::GetSurfaceArea()
0073 {
0074   return 2*fDx4plus2*fDz ;
0075 }
0076 
0077 inline
0078 G4ThreeVector G4TwistTrapParallelSide::NormAng( G4double phi, G4double u ) 
0079 {
0080   // function to calculate the norm at a given point on the surface
0081   // replace a1-d1
0082 
0083   G4ThreeVector nvec(-2*fDz*std::sin(phi) ,
0084                       2*fDz*std::cos(phi) ,
0085                      -(fDy2minus1 + fPhiTwist*u + fdeltaY*std::cos(phi)
0086                      -fdeltaX*std::sin(phi))) ;
0087   return nvec.unit();
0088 }