G4RToEConvForProton.cc

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$
00028 //
00029 //
00030 // --------------------------------------------------------------
00031 //      GEANT 4 class implementation file/  History:
00032 //    5 Oct. 2002, H.Kuirashige : Structure created based on object model
00033 // --------------------------------------------------------------
00034 
00035 #include "G4RToEConvForProton.hh"
00036 #include "G4ParticleTable.hh"
00037 #include "G4Material.hh"
00038 #include "G4PhysicsLogVector.hh"
00039 
00040 #include "G4ios.hh"
00041 #include "G4PhysicalConstants.hh"
00042 #include "G4SystemOfUnits.hh"
00043 
00044 G4RToEConvForProton::G4RToEConvForProton() : G4VRangeToEnergyConverter()
00045 {    
00046   theParticle =  G4ParticleTable::GetParticleTable()->FindParticle("proton");
00047   if (theParticle ==0) {
00048 #ifdef G4VERBOSE
00049     if (GetVerboseLevel()>0) {
00050       G4cout << " G4RToEConvForProton::G4RToEConvForProton() ";
00051       G4cout << " proton is not defined !!" << G4endl;
00052     }
00053 #endif
00054   } 
00055 }
00056 
00057 G4RToEConvForProton::~G4RToEConvForProton()
00058 { 
00059 }
00060 
00061 
00062 G4double G4RToEConvForProton::Convert(G4double rangeCut, const G4Material* )
00063 {
00064   // Simple formula
00065   //   range = Ekin/(100*keV)*(1*mm);
00066   return (rangeCut/(1.0*mm)) * (100.0*keV); 
00067 }
00068 
00069 
00070 // **********************************************************************
00071 // ************************* ComputeLoss ********************************
00072 // **********************************************************************
00073 G4double G4RToEConvForProton::ComputeLoss(G4double AtomicNumber,
00074                                                 G4double KineticEnergy) const
00075 {
00076   //  calculate dE/dx
00077 
00078   static G4double Z;  
00079   static G4double ionpot, tau0, taum, taul, ca, cba, cc;
00080 
00081   G4double  z2Particle = theParticle->GetPDGCharge()/eplus;
00082   z2Particle *=  z2Particle;
00083   if (z2Particle < 0.1) return 0.0;
00084 
00085   if( std::fabs(AtomicNumber-Z)>0.1 ){
00086     // recalculate constants
00087     Z = AtomicNumber;
00088     G4double Z13 = std::exp(std::log(Z)/3.);
00089     tau0 = 0.1*Z13*MeV/proton_mass_c2;
00090     taum = 0.035*Z13*MeV/proton_mass_c2;
00091     taul = 2.*MeV/proton_mass_c2;
00092     ionpot = 1.6e-5*MeV*std::exp(0.9*std::log(Z));
00093    cc = (taul+1.)*(taul+1.)*std::log(2.*electron_mass_c2*taul*(taul+2.)/ionpot)/(taul*(taul+2.))-1.;
00094     cc = 2.*twopi_mc2_rcl2*Z*cc*std::sqrt(taul);
00095     ca = cc/((1.-0.5*std::sqrt(tau0/taum))*tau0);
00096     cba = -0.5/std::sqrt(taum);
00097   }
00098 
00099   G4double tau = KineticEnergy/theParticle->GetPDGMass();
00100   G4double dEdx;
00101   if ( tau <= tau0 ) {
00102     dEdx = ca*(std::sqrt(tau)+cba*tau);
00103   } else {
00104     if( tau <= taul ) {
00105       dEdx = cc/std::sqrt(tau);
00106     } else {
00107       dEdx = (tau+1.)*(tau+1.)*
00108              std::log(2.*electron_mass_c2*tau*(tau+2.)/ionpot)/(tau*(tau+2.))-1.;
00109       dEdx = 2.*twopi_mc2_rcl2*Z*dEdx;
00110     }
00111   }
00112   return dEdx*z2Particle ;
00113 }
00114 
00115 
00116 // **********************************************************************
00117 // ************************* Reset       ********************************
00118 // **********************************************************************
00119 void G4RToEConvForProton::Reset()
00120 {
00121   // do nothing because loss tables and range vectors are not used 
00122   return;
00123 }

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