G4NeutronCrossSectionXS.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 // ClassName:   G4NeutronCrossSectionXS
00031 //
00032 // Author: 3 June 2010 V. Ivanchenko
00033 //
00034 // Modified:
00035 //
00036 //----------------------------------------------------------------------------
00037 //
00038 // Inelastic and capture cross section from XS database added
00039 // on top of existing Physics List
00040 
00041 #include "G4NeutronCrossSectionXS.hh"
00042 #include "G4DataQuestionaire.hh"
00043 
00044 #include "G4NeutronInelasticXS.hh"
00045 #include "G4NeutronCaptureXS.hh"
00046 
00047 #include "G4ParticleDefinition.hh"
00048 #include "G4HadronicProcess.hh"
00049 #include "G4ProcessManager.hh"
00050 #include "G4ProcessVector.hh"
00051 #include "G4HadronicProcessType.hh"
00052 
00053 #include "G4Neutron.hh"
00054 
00055 // factory
00056 #include "G4PhysicsConstructorFactory.hh"
00057 //
00058 G4_DECLARE_PHYSCONSTR_FACTORY(G4NeutronCrossSectionXS);
00059 
00060 
00061 G4NeutronCrossSectionXS::G4NeutronCrossSectionXS(G4int ver) :
00062   G4VPhysicsConstructor("NeutronXS"), verbose(ver) 
00063 {
00064   G4DataQuestionaire q(no,no,no,no,no,neutronxs);
00065 }
00066 
00067 G4NeutronCrossSectionXS::~G4NeutronCrossSectionXS() 
00068 {}
00069 
00070 void G4NeutronCrossSectionXS::ConstructParticle() 
00071 {
00072   G4Neutron::Neutron();
00073 }
00074 
00075 void G4NeutronCrossSectionXS::ConstructProcess() 
00076 {
00077 
00078   G4NeutronInelasticXS* xinel = new G4NeutronInelasticXS();
00079   G4NeutronCaptureXS* xcap = new G4NeutronCaptureXS();
00080 
00081   const G4ParticleDefinition* neutron = G4Neutron::Neutron();
00082   if(verbose > 1) {
00083     G4cout << "### G4NeutronCrossSectionXS: use alternative neutron X-sections"
00084            << G4endl;
00085   }
00086 
00087   G4ProcessVector* pv = neutron->GetProcessManager()->GetProcessList();
00088   G4int n = pv->size();
00089   G4HadronicProcess* had = 0;
00090   for(G4int i=0; i<n; i++) {
00091     if(fHadronInelastic == ((*pv)[i])->GetProcessSubType()) {
00092       had = static_cast<G4HadronicProcess*>((*pv)[i]);
00093       had->AddDataSet(xinel);
00094     } else if(fCapture == ((*pv)[i])->GetProcessSubType()) {
00095       had = static_cast<G4HadronicProcess*>((*pv)[i]);
00096       had->AddDataSet(xcap);
00097     }
00098   }
00099 }

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