Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/medical/fanoCavity2/src/MyMollerBhabhaModel.cc 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 /// \file MyMollerBhabhaModel.cc
0027 /// \brief Implementation of the MyMollerBhabhaModel class
0028 
0029 #include "MyMollerBhabhaModel.hh"
0030 
0031 #include "G4PhysicalConstants.hh"
0032 #include "G4SystemOfUnits.hh"
0033 
0034 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0035 
0036 using namespace std;
0037 
0038 MyMollerBhabhaModel::MyMollerBhabhaModel(const G4ParticleDefinition* p, const G4String& nam)
0039   : G4MollerBhabhaModel(p, nam)
0040 {}
0041 
0042 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0043 
0044 MyMollerBhabhaModel::~MyMollerBhabhaModel() {}
0045 
0046 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0047 
0048 G4double MyMollerBhabhaModel::ComputeDEDXPerVolume(const G4Material* material,
0049                                                    const G4ParticleDefinition* p,
0050                                                    G4double kineticEnergy, G4double cutEnergy)
0051 {
0052   if (!particle) SetParticle(p);
0053   // calculate the dE/dx due to the ionization by Seltzer-Berger formula
0054 
0055   G4double electronDensity = material->GetElectronDensity();
0056   G4double Zeff = electronDensity / material->GetTotNbOfAtomsPerVolume();
0057   G4double th = 0.25 * sqrt(Zeff) * keV;
0058   G4double tkin = kineticEnergy;
0059   G4bool lowEnergy = false;
0060   if (kineticEnergy < th) {
0061     tkin = th;
0062     lowEnergy = true;
0063   }
0064   G4double tau = tkin / electron_mass_c2;
0065   G4double gam = tau + 1.0;
0066   G4double gamma2 = gam * gam;
0067   G4double beta2 = 1. - 1. / gamma2;
0068   // G4double bg2   = beta2*gamma2;
0069 
0070   G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy();
0071   eexc /= electron_mass_c2;
0072   G4double eexc2 = eexc * eexc;
0073 
0074   G4double d = min(cutEnergy, MaxSecondaryEnergy(p, tkin)) / electron_mass_c2;
0075   G4double dedx;
0076 
0077   // electron
0078   if (isElectron) {
0079     dedx = log(2.0 * (tau + 2.0) / eexc2) - 1.0 - beta2 + log((tau - d) * d) + tau / (tau - d)
0080            + (0.5 * d * d + (2.0 * tau + 1.) * log(1. - d / tau)) / gamma2;
0081 
0082     // positron
0083   }
0084   else {
0085     G4double d2 = d * d * 0.5;
0086     G4double d3 = d2 * d / 1.5;
0087     G4double d4 = d3 * d * 3.75;
0088     G4double y = 1.0 / (1.0 + gam);
0089     dedx =
0090       log(2.0 * (tau + 2.0) / eexc2) + log(tau * d)
0091       - beta2 * (tau + 2.0 * d - y * (3.0 * d2 + y * (d - d3 + y * (d2 - tau * d3 + d4)))) / tau;
0092   }
0093 
0094   // do not apply density correction
0095   // G4double cden  = material->GetIonisation()->GetCdensity();
0096   // G4double mden  = material->GetIonisation()->GetMdensity();
0097   // G4double aden  = material->GetIonisation()->GetAdensity();
0098   // G4double x0den = material->GetIonisation()->GetX0density();
0099   // G4double x1den = material->GetIonisation()->GetX1density();
0100   // G4double x     = log(bg2)/twoln10;
0101 
0102   // if (x >= x0den) {
0103   //   dedx -= twoln10*x - cden;
0104   //   if (x < x1den) dedx -= aden*pow(x1den-x, mden);
0105   // }
0106 
0107   // now you can compute the total ionization loss
0108   dedx *= twopi_mc2_rcl2 * electronDensity / beta2;
0109   if (dedx < 0.0) dedx = 0.0;
0110 
0111   // lowenergy extrapolation
0112 
0113   if (lowEnergy) {
0114     if (kineticEnergy >= lowLimit)
0115       dedx *= sqrt(tkin / kineticEnergy);
0116     else
0117       dedx *= sqrt(tkin * kineticEnergy) / lowLimit;
0118   }
0119   return dedx;
0120 }
0121 
0122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......