G4Para.icc

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: G4Para.icc 69788 2013-05-15 12:06:57Z gcosmo $
00028 //
00029 // --------------------------------------------------------------------
00030 // GEANT 4 inline definitions file
00031 //
00032 // G4Para.icc
00033 //
00034 // Implementation of inline methods of G4Para
00035 // --------------------------------------------------------------------
00036 
00037 inline
00038 G4double G4Para::GetZHalfLength() const
00039 {
00040   return fDz ;
00041 }
00042 
00043 inline
00044 G4ThreeVector G4Para::GetSymAxis() const
00045 {
00046   G4double cosTheta = 1.0/std::sqrt(1+fTthetaCphi*fTthetaCphi +
00047                                fTthetaSphi*fTthetaSphi) ;
00048 
00049   return G4ThreeVector(fTthetaCphi*cosTheta,
00050                        fTthetaSphi*cosTheta,
00051                        cosTheta) ;
00052 }
00053 
00054 inline
00055 G4double G4Para::GetYHalfLength() const
00056 {
00057   return fDy ;
00058 }
00059 
00060 inline
00061 G4double G4Para::GetXHalfLength() const
00062 {
00063   return fDx ;
00064 }
00065 
00066 inline
00067 G4double G4Para::GetTanAlpha() const
00068 {
00069   return fTalpha ;
00070 }
00071     
00072 inline
00073 void G4Para::SetXHalfLength(G4double val)
00074 {
00075   fDx= val;
00076   fCubicVolume= 0.;
00077   fSurfaceArea= 0.;
00078   fpPolyhedron = 0;
00079 }
00080 
00081 inline
00082 void G4Para::SetYHalfLength(G4double val)
00083 {
00084   fDy= val;
00085   fCubicVolume= 0.;
00086   fSurfaceArea= 0.;
00087   fpPolyhedron = 0;
00088 }
00089 
00090 inline
00091 void G4Para::SetZHalfLength(G4double val)
00092 {
00093   fDz= val;
00094   fCubicVolume= 0.;
00095   fSurfaceArea= 0.;
00096   fpPolyhedron = 0;
00097 }
00098 
00099 inline
00100 void G4Para::SetAlpha(G4double alpha)
00101 {
00102   fTalpha= std::tan(alpha);
00103   fSurfaceArea= 0.;
00104   fCubicVolume= 0.;
00105   fpPolyhedron = 0;
00106 }
00107 
00108 inline
00109 void G4Para::SetTanAlpha(G4double val)
00110 {
00111   fTalpha= val;
00112   fCubicVolume= 0.;
00113   fSurfaceArea= 0.;
00114   fpPolyhedron = 0;
00115 }
00116 
00117 inline
00118 void G4Para::SetThetaAndPhi(double pTheta, double pPhi)    
00119 {
00120   fTthetaCphi=std::tan(pTheta)*std::cos(pPhi);
00121   fTthetaSphi=std::tan(pTheta)*std::sin(pPhi);
00122   fCubicVolume= 0.;
00123   fSurfaceArea= 0.;
00124   fpPolyhedron = 0;
00125 }
00126 
00127 inline
00128 G4double G4Para::GetCubicVolume()
00129 {
00130   //
00131   // It is like G4Box, since para transformations keep the volume to be const
00132 
00133   if(fCubicVolume != 0.) {;}
00134   else   fCubicVolume = 8*fDx*fDy*fDz; 
00135   return fCubicVolume;
00136 }
00137 
00138 inline
00139 G4double G4Para::GetSurfaceArea()
00140 {
00141   if(fSurfaceArea != 0.) {;}
00142   else
00143   {  
00144      fSurfaceArea = 8*(fDx*fDy 
00145                      + fDx*fDz*std::sqrt(1+fTthetaSphi*fTthetaSphi)
00146                      + fDy*fDz*std::sqrt(1+fTalpha*fTalpha
00147                               +std::pow(fTthetaCphi-fTthetaSphi*fTalpha, 2)) );
00148   } 
00149   return fSurfaceArea;
00150 }

Generated on Mon May 27 17:49:14 2013 for Geant4 by  doxygen 1.4.7