G4teoCrossSection.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 //         
00028 //
00029 // History:
00030 // -----------
00031 //  21 Apr 2009   ALF   1st implementation
00032 //  29 Apr 2009   ALF Updated Desing for Integration
00033 //  15 Mar 2011   ALF introduced the usage of G4AtomicShellEnumerator
00034 //  20 Oct 2011   ALF updated to take into account ECPSSR Form Factor
00035 //  09 Mar 2012   LP  update methods
00036 //  09 Mar 2012   ALF  update for M-shells Simulation
00037 //
00038 
00039 #include "globals.hh"
00040 #include "G4teoCrossSection.hh"
00041 #include "G4Proton.hh"
00042 //#include "G4Alpha.hh"
00043 #include "G4ecpssrBaseKxsModel.hh"
00044 #include "G4ecpssrBaseLixsModel.hh"
00045 
00046 #include "G4ecpssrFormFactorKxsModel.hh"
00047 #include "G4ecpssrFormFactorLixsModel.hh"
00048 #include "G4ecpssrFormFactorMixsModel.hh"
00049 
00050 G4teoCrossSection::G4teoCrossSection(const G4String& nam)
00051   :G4VhShellCrossSection(nam),totalCS(0.0),ecpssrShellK(0),ecpssrShellLi(0), ecpssrShellMi(0)
00052 { 
00053 
00054   if (nam == "Analytical") 
00055     {
00056       ecpssrShellK  = new G4ecpssrBaseKxsModel();  
00057       ecpssrShellLi = new G4ecpssrBaseLixsModel();      
00058     }
00059   else if (nam == "ECPSSR_FormFactor")
00060     {
00061       ecpssrShellK  = new G4ecpssrFormFactorKxsModel();  
00062       ecpssrShellLi = new G4ecpssrFormFactorLixsModel();
00063       ecpssrShellMi = new G4ecpssrFormFactorMixsModel();
00064     }
00065   else { G4cout << "ERROR" << G4endl;}
00066 
00067 
00068 }
00069 
00070 G4teoCrossSection::~G4teoCrossSection()
00071 { 
00072   delete ecpssrShellK;
00073   delete ecpssrShellLi;
00074   if (ecpssrShellMi) {delete ecpssrShellMi;}
00075 }
00076 
00077 std::vector<G4double> G4teoCrossSection::GetCrossSection(G4int Z,
00078                                                          G4double incidentEnergy,
00079                                                          G4double mass,
00080                                                          G4double,
00081                                                          const G4Material*)
00082 {
00083   std::vector<G4double> crossSections;
00084 
00085   crossSections.push_back( ecpssrShellK->CalculateCrossSection(Z, mass, incidentEnergy) );
00086   
00087   crossSections.push_back( ecpssrShellLi->CalculateL1CrossSection(Z, mass, incidentEnergy) );
00088   crossSections.push_back( ecpssrShellLi->CalculateL2CrossSection(Z, mass, incidentEnergy) );
00089   crossSections.push_back( ecpssrShellLi->CalculateL3CrossSection(Z, mass, incidentEnergy) );
00090 
00091   if (ecpssrShellMi) {
00092 
00093     crossSections.push_back( ecpssrShellMi->CalculateM1CrossSection(Z, mass, incidentEnergy) );
00094     crossSections.push_back( ecpssrShellMi->CalculateM2CrossSection(Z, mass, incidentEnergy) );
00095     crossSections.push_back( ecpssrShellMi->CalculateM3CrossSection(Z, mass, incidentEnergy) );
00096     crossSections.push_back( ecpssrShellMi->CalculateM4CrossSection(Z, mass, incidentEnergy) );
00097     crossSections.push_back( ecpssrShellMi->CalculateM5CrossSection(Z, mass, incidentEnergy) );
00098 
00099   }
00100 
00101 
00102   return crossSections;
00103 }
00104 
00105 G4double G4teoCrossSection::CrossSection(G4int Z, G4AtomicShellEnumerator shell,
00106                                          G4double incidentEnergy,
00107                                          G4double mass,
00108                                          const G4Material*)
00109 {
00110   G4double res = 0.0;
00111   if(shell > 3 && !ecpssrShellMi) {
00112     return res; 
00113   } 
00114 
00115   else if(shell > 8) { 
00116     return res;
00117   } 
00118   
00119   else if(fKShell  == shell) 
00120     { 
00121       res = ecpssrShellK->CalculateCrossSection(Z, mass, incidentEnergy);
00122     } 
00123   
00124   else if(fL1Shell == shell) 
00125     { 
00126       res = ecpssrShellLi->CalculateL1CrossSection(Z, mass, incidentEnergy);
00127     } 
00128   
00129   else if(fL2Shell == shell) 
00130     { 
00131       res = ecpssrShellLi->CalculateL2CrossSection(Z, mass, incidentEnergy);
00132     } 
00133   
00134   else if(fL3Shell == shell) 
00135     { 
00136       res = ecpssrShellLi->CalculateL3CrossSection(Z, mass, incidentEnergy);
00137     }
00138 
00139   else if(fM1Shell == shell) 
00140     { 
00141       res = ecpssrShellLi->CalculateL3CrossSection(Z, mass, incidentEnergy);
00142     }
00143 
00144   else if(fM2Shell == shell) 
00145     { 
00146       res = ecpssrShellLi->CalculateL3CrossSection(Z, mass, incidentEnergy);
00147     }
00148 
00149   else if(fM3Shell == shell) 
00150     { 
00151       res = ecpssrShellLi->CalculateL3CrossSection(Z, mass, incidentEnergy);
00152     }
00153 
00154   else if(fM4Shell == shell) 
00155     { 
00156       res = ecpssrShellLi->CalculateL3CrossSection(Z, mass, incidentEnergy);
00157     }
00158 
00159   else if(fM5Shell == shell) 
00160     { 
00161       res = ecpssrShellLi->CalculateL3CrossSection(Z, mass, incidentEnergy);
00162     }
00163   return res;
00164 }
00165 
00166 std::vector<G4double> G4teoCrossSection::Probabilities(G4int Z,
00167                                                        G4double incidentEnergy,
00168                                                        G4double mass,
00169                                                        G4double deltaEnergy,
00170                                                        const G4Material*) 
00171 {
00172   std::vector<G4double> crossSections = 
00173     GetCrossSection(Z, incidentEnergy, mass, deltaEnergy);
00174 
00175   for (size_t i=0; i<crossSections.size(); i++ ) {
00176     
00177     if (totalCS) {
00178       crossSections[i] = crossSections[i]/totalCS;
00179     }
00180     
00181   }
00182   return crossSections;
00183 }
00184 
00185 void G4teoCrossSection::SetTotalCS(G4double val){
00186 
00187   totalCS = val;
00188   //  G4cout << "totalXS set to: " << val / barn << " barns" << G4endl;
00189 }
00190 
00191 
00192 

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