G4INCLGlobals.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 // INCL++ intra-nuclear cascade model
00027 // Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
00028 // Davide Mancusi, CEA
00029 // Alain Boudard, CEA
00030 // Sylvie Leray, CEA
00031 // Joseph Cugnon, University of Liege
00032 //
00033 #define INCLXX_IN_GEANT4_MODE 1
00034 
00035 #include "globals.hh"
00036 
00037 #ifndef G4INCLGlobals_hh
00038 #define G4INCLGlobals_hh 1
00039 
00040 #include <cmath>
00041 #include "G4INCLParticleType.hh"
00042 
00043 namespace G4INCL {
00044   class Particle;
00045 
00046   namespace PhysicalConstants {
00048     const G4double hc = 197.328;
00049 
00051     const G4double hcSquared = hc*hc;
00052 
00054     const G4double Pf = 1.37*hc;
00055     //  const G4double Pf = 1.36828*hc;
00056 
00058     const G4double PfSquared = Pf*Pf;
00059 
00064     const G4double eSquared = 1.439964;
00065   }
00066 
00067   namespace Math {
00068     const G4double pi = 3.14159265358979323846264338328;
00069     const G4double twoPi = 2.0 * pi;
00070     const G4double tenPi = 10.0 * pi;
00071     const G4double piOverTwo = 0.5 * pi;
00072     const G4double oneOverSqrtThree = 1./std::sqrt((G4double)3.);
00073     const G4double oneThird = 1./3.;
00074     const G4double twoThirds = 2./3.;
00075     const G4double sqrtFiveThirds = std::sqrt(5./3.);
00076     const G4double sqrtThreeFifths = std::sqrt(3./5.);
00077 
00078     inline G4double toDegrees(G4double radians) {
00079       return radians * (180.0 / pi);
00080     }
00081 
00082     inline G4int heaviside(G4int n) {
00083       if(n < 0) return 0;
00084       else return 1;
00085     }
00086 
00087     inline G4double pow13(G4double x) {
00088       return std::pow(x, oneThird);
00089     }
00090 
00091     inline G4double powMinus13(G4double x) {
00092       return std::pow(x, -oneThird);
00093     }
00094 
00095     inline G4double pow23(G4double x) {
00096       return std::pow(x, twoThirds);
00097     }
00098 
00102     template <typename T> inline G4int sign(T t) {
00103       return t > 0 ? 1: t < 0 ? -1 : 0;
00104     }
00105   }
00106 
00107   namespace ParticleConfig {
00108     G4bool isPair(Particle const * const p1, Particle const * const p2, ParticleType t1, ParticleType t2);
00109   }
00110 }
00111 #endif

Generated on Mon May 27 17:48:35 2013 for Geant4 by  doxygen 1.4.7