G4CHIPSElasticXS.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 // GEANT4 Class file
00031 //
00032 //
00033 // File name:    G4CHIPSElasticXS
00034 //
00035 // Author  Ivantchenko, Geant4, 3-Aug-09
00036 //
00037 // Modifications:
00038 // 31-05-2011 V.Uzhinsky added anti-baryons, Pi+, Pi-, K+, K- cross sections
00039 // 23-08-2011 V.Ivanchenko migration to new design and cleanup
00040 //
00041 
00042 #include "G4CHIPSElasticXS.hh"
00043 #include "G4HadronicException.hh"
00044 #include "G4DynamicParticle.hh"
00045 #include "G4ParticleDefinition.hh"
00046 #include "G4Element.hh"
00047 #include "G4Proton.hh"
00048 #include "G4Neutron.hh"
00049 #include "G4VQCrossSection.hh"
00050 #include "G4QProtonElasticCrossSection.hh"
00051 #include "G4QNeutronElasticCrossSection.hh"
00052 
00053 #include "G4QAntiBaryonElasticCrossSection.hh" // Uzhi
00054 #include "G4QPionMinusElasticCrossSection.hh"  // Uzhi
00055 #include "G4QPionPlusElasticCrossSection.hh"   // Uzhi
00056 #include "G4QKaonMinusElasticCrossSection.hh"  // Uzhi
00057 #include "G4QKaonPlusElasticCrossSection.hh"   // Uzhi
00058 
00059 G4CHIPSElasticXS::G4CHIPSElasticXS() 
00060   :  G4VCrossSectionDataSet("CHIPSElasticXS"),
00061      theProton(G4Proton::Proton()), 
00062      theNeutron(G4Neutron::Neutron()),
00063      thEnergy(19*CLHEP::MeV),
00064      isInitialized(false)
00065 {
00066   //  verboseLevel = 0;
00067   pCManager   = G4QProtonElasticCrossSection::GetPointer();
00068   nCManager   = G4QNeutronElasticCrossSection::GetPointer();
00069 
00070   PBARxsManager = G4QAntiBaryonElasticCrossSection::GetPointer(); // Uzhi
00071   PIPxsManager  = G4QPionPlusElasticCrossSection::GetPointer();   // Uzhi
00072   PIMxsManager  = G4QPionMinusElasticCrossSection::GetPointer();  // Uzhi
00073   KPxsManager   = G4QKaonPlusElasticCrossSection::GetPointer();   // Uzhi
00074   KMxsManager   = G4QKaonMinusElasticCrossSection::GetPointer();  // Uzhi
00075   //Description();
00076   theParticle   = 0;
00077 }
00078 
00079 G4CHIPSElasticXS::~G4CHIPSElasticXS()
00080 {}
00081 
00082 
00083 void G4CHIPSElasticXS::Description() const
00084 {
00085   char* dirName = getenv("G4PhysListDocDir");
00086   if (dirName) {
00087     std::ofstream outFile;
00088     G4String outFileName = GetName() + ".html";
00089     G4String pathName = G4String(dirName) + "/" + outFileName;
00090 
00091     outFile.open(pathName);
00092     outFile << "<html>\n";
00093     outFile << "<head>\n";
00094 
00095     outFile << "<title>Description of CHIPS Elastic Cross Section</title>\n";
00096     outFile << "</head>\n";
00097     outFile << "<body>\n";
00098 
00099     outFile << "G4CHIPSElasticXS provides hadron-nuclear elastic scattering\n"
00100             << "cross sections for protons and neutrons with incident energies\n"
00101             << "between 19 MeV and X GeV.  These cross sections represent\n"
00102             << "parameterizations developed by M. Kossov. (more detail)\n";
00103 
00104     outFile << "</body>\n";
00105     outFile << "</html>\n";
00106     outFile.close();
00107   }
00108 }
00109 
00110 G4bool 
00111 G4CHIPSElasticXS::IsIsoApplicable(const G4DynamicParticle* dyn, 
00112                                   G4int Z, G4int /*A*/,
00113                                   const G4Element*, const G4Material*)
00114 {
00115   return (Z <= 2 && dyn->GetKineticEnergy() > thEnergy);
00116 }
00117 
00118 G4double 
00119 G4CHIPSElasticXS::GetIsoCrossSection(const G4DynamicParticle* dyn, 
00120                                      G4int Z, G4int A,
00121                                      const G4Isotope*, const G4Element*, 
00122                                      const G4Material*)
00123 {
00124   G4int N = A - Z;
00125   if(Z == 1) {
00126     if(N > 1) { N = 1; }
00127   } else if(Z == 2) { N = 2; }
00128 
00129   G4double momentum = dyn->GetTotalMomentum();
00130   G4int    uPDGcode = dyn->GetPDGcode();
00131   G4VQCrossSection* CHIPSmanager = 0; 
00132   G4double cross = 0.0;
00133 
00134   switch(uPDGcode) {
00135   case 2212:
00136     CHIPSmanager=pCManager;
00137     break;
00138   case 2112:
00139     CHIPSmanager=nCManager;
00140     break;
00141   case -2212:
00142     CHIPSmanager=PBARxsManager;
00143     break;
00144   case -2112:
00145     CHIPSmanager=PBARxsManager;
00146     break;
00147   case 211:
00148     CHIPSmanager=PIPxsManager;
00149     break;
00150   case -211:
00151     CHIPSmanager=PIMxsManager;
00152     break;
00153   case 321:
00154     CHIPSmanager=KPxsManager;
00155     break;
00156   case -321:
00157     CHIPSmanager=KMxsManager;
00158     break;
00159   case 130:
00160     break;
00161   case 310:
00162     break;
00163   case 311:
00164     break;
00165   case -311:
00166     break;
00167   default:
00168     throw G4HadronicException(__FILE__, __LINE__,
00169                               "G4CHIPSElasticXS: not applicable for a particle"); 
00170     return cross; 
00171   }
00172   if(CHIPSmanager) {
00173     cross = CHIPSmanager->GetCrossSection(false,momentum,Z,N,uPDGcode);
00174   } else {
00175     cross = 0.5*(KPxsManager->GetCrossSection(false,momentum,Z,N,uPDGcode) +
00176                  KMxsManager->GetCrossSection(false,momentum,Z,N,uPDGcode));
00177   }
00178   return cross; 
00179 }

Generated on Mon May 27 17:47:52 2013 for Geant4 by  doxygen 1.4.7