Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4TwistTrapAlphaSide.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 G4TwistTrapAlphaSide.
0027 // --------------------------------------------------------------------
0028 
0029 inline
0030 G4double G4TwistTrapAlphaSide::GetValueA(G4double phi)
0031 {
0032   return ( fDx4plus2 + fDx4minus2 * ( 2 * phi ) / fPhiTwist  ) ;
0033 }
0034 
0035 inline
0036 G4double G4TwistTrapAlphaSide::GetValueD(G4double phi) 
0037 {
0038   return ( fDx3plus1 + fDx3minus1 * ( 2 * phi) / fPhiTwist  ) ;
0039 } 
0040 
0041 inline 
0042 G4double G4TwistTrapAlphaSide::GetValueB(G4double phi) 
0043 {
0044   return ( fDy2plus1 + fDy2minus1 * ( 2 * phi ) / fPhiTwist ) ;
0045 }
0046 
0047 
0048 inline
0049 G4double G4TwistTrapAlphaSide::Xcoef(G4double u, G4double phi)
0050 {
0051   
0052   return GetValueA(phi)/2. + (GetValueD(phi)-GetValueA(phi))/4. 
0053     - u*( ( GetValueD(phi)-GetValueA(phi) )/( 2 * GetValueB(phi) ) - fTAlph );
0054 
0055 }
0056 
0057 inline G4ThreeVector
0058 G4TwistTrapAlphaSide::SurfacePoint(G4double phi, G4double u , G4bool isGlobal)
0059 {
0060   // function to calculate a point on the surface, given by parameters phi,u
0061 
0062   G4ThreeVector SurfPoint ( Xcoef(u,phi) * std::cos(phi)
0063                           - u * std::sin(phi) + fdeltaX*phi/fPhiTwist,
0064                             Xcoef(u,phi) * std::sin(phi)
0065                           + u * std::cos(phi) + fdeltaY*phi/fPhiTwist,
0066                             2*fDz*phi/fPhiTwist  );
0067   if (isGlobal) { return (fRot * SurfPoint + fTrans); }
0068   return SurfPoint;
0069 }
0070 
0071 inline
0072 G4double G4TwistTrapAlphaSide::GetBoundaryMin(G4double phi)
0073 {
0074   return -0.5*GetValueB(phi) ;
0075 }
0076 
0077 inline
0078 G4double G4TwistTrapAlphaSide::GetBoundaryMax(G4double phi)
0079 {
0080   return 0.5*GetValueB(phi) ;
0081 }
0082 
0083 inline
0084 G4double G4TwistTrapAlphaSide::GetSurfaceArea()
0085 {
0086   return (fDz*(std::sqrt(16*fDy1*fDy1
0087              + (fa1md1 + 4*fDy1*fTAlph)*(fa1md1 + 4*fDy1*fTAlph))
0088              + std::sqrt(16*fDy2*fDy2 + (fa2md2 + 4*fDy2*fTAlph)
0089                                       * (fa2md2 + 4*fDy2*fTAlph))))/2. ;
0090 }
0091 
0092 inline
0093 G4ThreeVector G4TwistTrapAlphaSide::NormAng( G4double phi, G4double u ) 
0094 {
0095   // function to calculate the norm at a given point on the surface
0096   // replace a1-d1
0097 
0098   G4ThreeVector nvec ( fDy1* fDz*(4*fDy1*std::cos(phi)
0099                      + (fa1md1 + 4*fDy1*fTAlph)*std::sin(phi)),
0100                        -(fDy1* fDz*((fa1md1 + 4*fDy1*fTAlph)*std::cos(phi)
0101                      - 4*fDy1*std::sin(phi))),
0102                        (fDy1*(-8*(fDx3minus1 + fDx4minus2)*fDy1
0103                                 + fa1md1*(fDx2 + fDx3plus1 + fDx4)*fPhiTwist
0104                                 + 4*(fDx2 + fDx3plus1 + fDx4)*fDy1*fPhiTwist
0105                                 *fTAlph + 2*(fDx3minus1 + fDx4minus2)
0106                                 *(fa1md1 + 4*fDy1*fTAlph)*phi)
0107                                 + fPhiTwist*(16*fDy1*fDy1
0108                                 + (fa1md1 + 4*fDy1*fTAlph)
0109                                 *(fa1md1 + 4*fDy1*fTAlph))*u
0110                                 + 4*fDy1*(fa1md1*fdeltaY - 4*fdeltaX*fDy1
0111                                 + 4*fdeltaY*fDy1*fTAlph)* std::cos(phi)
0112                                 - 4*fDy1*(fa1md1*fdeltaX + 4*fDy1*(fdeltaY
0113                                 + fdeltaX*fTAlph))*std::sin(phi))/ 8. ) ;
0114   return nvec.unit();
0115 }