G4GeneralSpaceNNCrossSection.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 // *                                                                  *
00021 // * Parts of this code which have been  developed by QinetiQ Ltd     *
00022 // * under contract to the European Space Agency (ESA) are the        *
00023 // * intellectual property of ESA. Rights to use, copy, modify and    *
00024 // * redistribute this software for general public use are granted    *
00025 // * in compliance with any licensing, distribution and development   *
00026 // * policy adopted by the Geant4 Collaboration. This code has been   *
00027 // * written by QinetiQ Ltd for the European Space Agency, under ESA  *
00028 // * contract 17191/03/NL/LvH (Aurora Programme).                     *
00029 // *                                                                  *
00030 // * By using,  copying,  modifying or  distributing the software (or *
00031 // * any work based  on the software)  you  agree  to acknowledge its *
00032 // * use  in  resulting  scientific  publications,  and indicate your *
00033 // * acceptance of all terms of the Geant4 Software license.          *
00034 // ********************************************************************
00035 //
00036 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00037 //
00038 // MODULE:              G4GeneralSpaceNNCrossSection.cc
00039 //
00040 // Version:             B.1
00041 // Date:                15/04/04
00042 // Author:              P R Truscott
00043 // Organisation:        QinetiQ Ltd, UK
00044 // Customer:            ESA/ESTEC, NOORDWIJK
00045 // Contract:            17191/03/NL/LvH
00046 //
00047 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00048 //
00049 // CHANGE HISTORY
00050 // --------------
00051 //
00052 // 6 October 2003, P R Truscott, QinetiQ Ltd, UK
00053 // Created.
00054 //
00055 // 15 March 2004, P R Truscott, QinetiQ Ltd, UK
00056 // Beta release
00057 //
00058 // 19 Aug 2011, V.Ivanchenko move to new design and make x-section per element
00059 //
00060 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00062 //
00063 #include <iomanip>
00064 
00065 #include "G4GeneralSpaceNNCrossSection.hh"
00066 #include "G4SystemOfUnits.hh"
00067 #include "G4ProtonInelasticCrossSection.hh"
00068 #include "G4IonProtonCrossSection.hh"
00069 #include "G4TripathiLightCrossSection.hh"
00070 #include "G4TripathiCrossSection.hh"
00071 #include "G4IonsShenCrossSection.hh"
00072 #include "G4DynamicParticle.hh"
00073 #include "G4Element.hh"
00074 #include "G4ParticleDefinition.hh"
00075 #include "G4HadTmpUtil.hh"
00076 #include "G4Proton.hh"
00077 
00078 G4GeneralSpaceNNCrossSection::G4GeneralSpaceNNCrossSection ()
00079  : G4VCrossSectionDataSet("General Space NN")
00080 {
00081   protonInelastic = new G4ProtonInelasticCrossSection();
00082   ionProton       = new G4IonProtonCrossSection();
00083   TripathiGeneral = new G4TripathiCrossSection();
00084   TripathiLight   = new G4TripathiLightCrossSection();
00085   Shen            = new G4IonsShenCrossSection();
00086   theProton       = G4Proton::Proton();  
00087 }
00088 
00089 G4GeneralSpaceNNCrossSection::~G4GeneralSpaceNNCrossSection ()
00090 {
00091   delete protonInelastic;
00092   delete ionProton;
00093   delete TripathiGeneral;
00094   delete TripathiLight;
00095   delete Shen;
00096 }
00097 
00099 //
00100 
00101 G4bool G4GeneralSpaceNNCrossSection::IsElementApplicable
00102   (const G4DynamicParticle* theProjectile, G4int, const G4Material*)
00103 {
00104   return (1 <= theProjectile->GetDefinition()->GetBaryonNumber());
00105 }
00106 
00108 //
00109 
00110 G4double G4GeneralSpaceNNCrossSection::GetElementCrossSection
00111   (const G4DynamicParticle* theProjectile, G4int ZT, const G4Material* mat)
00112 {
00113   G4double result = 0.0;
00114   G4int ZP = G4lrint(theProjectile->GetDefinition()->GetPDGCharge()/eplus);
00115 
00116   if (verboseLevel >= 2)
00117   {
00118     G4int AP = theProjectile->GetDefinition()->GetBaryonNumber();
00119     G4cout <<"In G4GeneralSpaceNNCrossSection::GetCrossSection" <<G4endl;
00120     G4cout <<"Projectile A = " <<std::setw(8) <<AP 
00121            <<" Z = "           <<std::setw(8) <<ZP
00122            <<" Energy = "      <<theProjectile->GetKineticEnergy()/AP
00123            <<" MeV/nuc" <<G4endl;
00124     G4cout <<"Target     Z = " <<std::setw(8) <<ZT
00125            <<G4endl;
00126   }
00127   if (theProjectile->GetDefinition()==theProton)
00128   {
00129     if (ZT>5)
00130     {
00131       result = protonInelastic->
00132         GetElementCrossSection(theProjectile, ZT, mat);
00133       if (verboseLevel >= 2)
00134         G4cout <<"Selecting G4ProtonInelasticCrossSection" <<G4endl;
00135     }
00136     else
00137     {
00138       result = TripathiLight->
00139         GetElementCrossSection(theProjectile, ZT, mat);
00140       if (verboseLevel >= 2)
00141         G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
00142     }
00143   }
00144   else if (ZT==1)
00145   {
00146     if (ZP>5)
00147     {
00148       result = ionProton->
00149         GetElementCrossSection(theProjectile, ZT, mat);
00150       if (verboseLevel >= 2)
00151         G4cout <<"Selecting G4IonProtonCrossSection" <<G4endl;
00152     }
00153     else
00154     {
00155       result = TripathiLight->
00156         GetElementCrossSection(theProjectile, ZT, mat);
00157       if (verboseLevel >= 2)
00158         G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
00159     }
00160   }
00161   else
00162   {
00163     if (TripathiLight->IsElementApplicable(theProjectile, ZT, mat))
00164     {
00165       result = TripathiLight->
00166         GetElementCrossSection(theProjectile, ZT, mat);
00167       if (verboseLevel >= 2)
00168         G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
00169     }
00170     else if (TripathiGeneral->IsElementApplicable(theProjectile, ZT, mat))
00171     {
00172       result = TripathiGeneral->
00173         GetElementCrossSection(theProjectile, ZT, mat);
00174       if (verboseLevel >= 2)
00175         G4cout <<"Selecting G4TripathiCrossSection" <<G4endl;
00176     }
00177     else if (Shen->IsElementApplicable(theProjectile, ZT, mat))
00178     {
00179       result = Shen->
00180         GetElementCrossSection(theProjectile, ZT, mat);
00181       if (verboseLevel >= 2)
00182         G4cout <<"Selecting G4IonsShenCrossSection" <<G4endl;
00183     }
00184   }
00185   if (verboseLevel >= 2)
00186   {
00187     G4cout <<"Cross-section = " <<result/millibarn <<" mbarn" <<G4endl;
00188     G4cout <<G4endl;
00189   }
00190 
00191   return result;
00192 }
00193 

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