G4Trd.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: G4Trd.icc 69788 2013-05-15 12:06:57Z gcosmo $
00028 //
00029 // --------------------------------------------------------------------
00030 // GEANT 4 inline definitions file
00031 //
00032 // G4Trd.icc
00033 //
00034 // Implementation of inline methods of G4Trd
00035 // --------------------------------------------------------------------
00036 
00037 inline
00038 G4double G4Trd::GetXHalfLength1() const
00039 {
00040   return fDx1;
00041 }
00042 
00043 inline
00044 G4double G4Trd::GetXHalfLength2() const
00045 {
00046   return fDx2;
00047 }
00048 
00049 inline
00050 G4double G4Trd::GetYHalfLength1() const
00051 {
00052   return fDy1;
00053 }
00054 
00055 inline
00056 G4double G4Trd::GetYHalfLength2() const
00057 {
00058   return fDy2;
00059 }
00060 
00061 inline
00062 G4double G4Trd::GetZHalfLength() const
00063 {
00064   return fDz;
00065 }
00066 
00067 inline
00068 void G4Trd::SetXHalfLength1(G4double val)
00069 {
00070   fDx1= val;
00071   fCubicVolume= 0.;
00072   fSurfaceArea=0;
00073   fpPolyhedron = 0;
00074 }
00075 
00076 inline
00077 void G4Trd::SetXHalfLength2(G4double val)
00078 {
00079   fDx2= val;
00080   fCubicVolume= 0.;
00081   fSurfaceArea=0;
00082   fpPolyhedron = 0;
00083 }
00084 
00085 inline
00086 void G4Trd::SetYHalfLength1(G4double val)
00087 {
00088   fDy1= val;
00089   fCubicVolume= 0.;
00090   fSurfaceArea=0;
00091   fpPolyhedron = 0;
00092 }
00093 
00094 inline
00095 void G4Trd::SetYHalfLength2(G4double val)
00096 {
00097   fDy2= val;
00098   fCubicVolume= 0.;
00099   fSurfaceArea=0;
00100   fpPolyhedron = 0;
00101 }
00102 
00103 inline
00104 void G4Trd::SetZHalfLength(G4double val)
00105 {
00106   fDz= val;
00107   fCubicVolume= 0.;
00108   fSurfaceArea=0;
00109   fpPolyhedron = 0;
00110 }
00111 
00112 inline
00113 G4double G4Trd::GetCubicVolume()
00114 {
00115   if(fCubicVolume != 0.) {;}
00116   else
00117   {
00118     fCubicVolume = 2*fDz*( (fDx1+fDx2)*(fDy1+fDy2)
00119                          + (fDx2-fDx1)*(fDy2-fDy1)/3 );
00120   }
00121   return fCubicVolume;
00122 }
00123 
00124 inline
00125 G4double G4Trd::GetSurfaceArea()
00126 {
00127   if(fSurfaceArea != 0.) {;}
00128   else
00129   { 
00130     fSurfaceArea = 4*(fDx1*fDy1+fDx2*fDy2)
00131                  + 2*((fDy1+fDy2)*std::sqrt(4*fDz*fDz+(fDx2-fDx1)*(fDx2-fDx1))
00132                  + (fDx1+fDx2) *std::sqrt(4*fDz*fDz+(fDy2-fDy1)*(fDy2-fDy1)) );
00133   }
00134   return fSurfaceArea;
00135 }

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