G4empCrossSection.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 // $Id$
00027 //
00028 //         
00029 //
00030 // History:
00031 // -----------
00032 //  29 Apr 2009   ALF   1st implementation
00033 //  15 Mar 2011   ALF introduced the usage of G4AtomicShellEnumerator
00034 //  09 Mar 2012   LP  updated methods
00035 //
00036 
00037 
00038 #include "globals.hh"
00039 #include "G4empCrossSection.hh"
00040 #include "G4Proton.hh"
00041 
00042 
00043 G4empCrossSection::G4empCrossSection(const G4String& nam)
00044   :G4VhShellCrossSection(nam),totalCS(0.0)
00045 { 
00046 
00047   paulShellK = new G4PaulKxsModel();
00048   orlicShellLi = new G4OrlicLiXsModel();
00049 
00050 }
00051 
00052 G4empCrossSection::~G4empCrossSection()
00053 { 
00054 
00055   delete paulShellK;
00056   delete orlicShellLi;
00057 
00058 }
00059 
00060 std::vector<G4double> G4empCrossSection::GetCrossSection(G4int Z,
00061                                                          G4double incidentEnergy,
00062                                                          G4double mass,
00063                                                          G4double,
00064                                                          const G4Material*) 
00065 {
00066   std::vector<G4double> crossSections;
00067   G4ParticleDefinition* aProton = G4Proton::Proton();
00068 
00069   crossSections.push_back( paulShellK->CalculateKCrossSection(Z, mass, incidentEnergy) );
00070 
00071   // this check should be done in the Orlic class, that can handle only protons;
00072   // however this would lead up tp three checks of the mass, while here we have only one
00073   // moreover, at the present time,this class handles explicitly Paul and Orlic models,
00074   // so it can hadle the responsibility of this check too
00075 
00076   if (mass == aProton->GetPDGMass()) {
00077     crossSections.push_back( orlicShellLi->CalculateL1CrossSection(Z, incidentEnergy) );
00078     crossSections.push_back( orlicShellLi->CalculateL2CrossSection(Z, incidentEnergy) );
00079     crossSections.push_back( orlicShellLi->CalculateL3CrossSection(Z, incidentEnergy) );
00080   }
00081 
00082   else {
00083     crossSections.push_back( 0. );
00084     crossSections.push_back( 0. );
00085     crossSections.push_back( 0. );
00086   }  
00087   return crossSections;
00088 
00089 }
00090 
00091 G4double G4empCrossSection::CrossSection(G4int Z, G4AtomicShellEnumerator shell,
00092                                          G4double incidentEnergy,
00093                                          G4double mass,
00094                                          const G4Material*)
00095 {
00096 
00097   //let's reproduce  
00098 
00099   G4double res = 0.0;
00100   G4ParticleDefinition* aProton = G4Proton::Proton();
00101   if(fKShell == shell) { 
00102     res = paulShellK->CalculateKCrossSection(Z, mass, incidentEnergy);
00103   } 
00104   // this check should be done in the Orlic class, that can handle only protons;
00105   // however this would lead up tp three checks of the mass, while here we have only one
00106   // moreover, at the present time,this class handles explicitly Paul and Orlic models,
00107   // so it can hadle the responsibility of this check too
00108 
00109 
00110   else if (mass == aProton->GetPDGMass()) {
00111     
00112     if(fL1Shell == shell) { 
00113       res = orlicShellLi->CalculateL1CrossSection(Z, incidentEnergy);
00114     } 
00115     else if(fL2Shell == shell) { 
00116       res = orlicShellLi->CalculateL2CrossSection(Z, incidentEnergy);
00117     } 
00118     else if(fL3Shell == shell) { 
00119       res = orlicShellLi->CalculateL3CrossSection(Z, incidentEnergy);
00120     } 
00121   }
00122   return res;
00123 }
00124 
00125 std::vector<G4double> G4empCrossSection::Probabilities(G4int Z,
00126                                                        G4double incidentEnergy,
00127                                                        G4double mass,
00128                                                        G4double deltaEnergy,
00129                                                        const G4Material* mat)
00130 {
00131   
00132   std::vector<G4double> crossSections = GetCrossSection(Z, incidentEnergy, mass, deltaEnergy,mat);
00133 
00134   for (size_t i=0; i<crossSections.size(); i++ ) {
00135     
00136     if (totalCS) {
00137       crossSections[i] = crossSections[i]/totalCS;
00138     }
00139     
00140   }
00141 
00142   return crossSections;
00143 
00144 }
00145 
00146 
00147 void G4empCrossSection::SetTotalCS(G4double val){
00148 
00149   totalCS = val;
00150 
00151 }
00152 
00153 
00154 

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