Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/hadronic/Hadr04/src/NeutronHPphysics.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file NeutronHPphysics.cc
0027 /// \brief Implementation of the NeutronHPphysics class
0028 
0029 #include "NeutronHPphysics.hh"
0030 
0031 #include "G4GenericMessenger.hh"
0032 #include "G4ParticleDefinition.hh"
0033 #include "G4ProcessManager.hh"
0034 #include "G4ProcessTable.hh"
0035 
0036 // Processes
0037 
0038 #include "G4HadronElasticProcess.hh"
0039 #include "G4HadronInelasticProcess.hh"
0040 #include "G4NeutronCaptureProcess.hh"
0041 #include "G4NeutronFissionProcess.hh"
0042 #include "G4ParticleHPCapture.hh"
0043 #include "G4ParticleHPCaptureData.hh"
0044 #include "G4ParticleHPElastic.hh"
0045 #include "G4ParticleHPElasticData.hh"
0046 #include "G4ParticleHPFission.hh"
0047 #include "G4ParticleHPFissionData.hh"
0048 #include "G4ParticleHPInelastic.hh"
0049 #include "G4ParticleHPInelasticData.hh"
0050 #include "G4ParticleHPThermalScattering.hh"
0051 #include "G4ParticleHPThermalScatteringData.hh"
0052 #include "G4SystemOfUnits.hh"
0053 
0054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0055 
0056 NeutronHPphysics::NeutronHPphysics(const G4String& name) : G4VPhysicsConstructor(name)
0057 {
0058   // define commands for this class
0059   DefineCommands();
0060 }
0061 
0062 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0063 
0064 NeutronHPphysics::~NeutronHPphysics()
0065 {
0066   delete fMessenger;
0067 }
0068 
0069 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0070 
0071 void NeutronHPphysics::ConstructProcess()
0072 {
0073   G4ParticleDefinition* neutron = G4Neutron::Neutron();
0074   G4ProcessManager* pManager = neutron->GetProcessManager();
0075 
0076   // delete all neutron processes if already registered
0077   //
0078   G4VProcess* process = 0;
0079   process = pManager->GetProcess("hadElastic");
0080   if (process) pManager->RemoveProcess(process);
0081   //
0082   process = pManager->GetProcess("neutronInelastic");
0083   if (process) pManager->RemoveProcess(process);
0084   //
0085   process = pManager->GetProcess("nCapture");
0086   if (process) pManager->RemoveProcess(process);
0087   //
0088   process = pManager->GetProcess("nFission");
0089   if (process) pManager->RemoveProcess(process);
0090 
0091   // (re) create process: elastic
0092   //
0093   G4HadronElasticProcess* process1 = new G4HadronElasticProcess();
0094   pManager->AddDiscreteProcess(process1);
0095   //
0096   // model1a
0097   G4ParticleHPElastic* model1a = new G4ParticleHPElastic();
0098   process1->RegisterMe(model1a);
0099   process1->AddDataSet(new G4ParticleHPElasticData());
0100   //
0101   // model1b
0102   if (fThermal) {
0103     model1a->SetMinEnergy(4 * eV);
0104     G4ParticleHPThermalScattering* model1b = new G4ParticleHPThermalScattering();
0105     process1->RegisterMe(model1b);
0106     process1->AddDataSet(new G4ParticleHPThermalScatteringData());
0107   }
0108 
0109   // (re) create process: inelastic
0110   //
0111   G4HadronInelasticProcess* process2 =
0112     new G4HadronInelasticProcess("neutronInelastic", G4Neutron::Definition());
0113   pManager->AddDiscreteProcess(process2);
0114   //
0115   // cross section data set
0116   G4ParticleHPInelasticData* dataSet2 = new G4ParticleHPInelasticData();
0117   process2->AddDataSet(dataSet2);
0118   //
0119   // models
0120   G4ParticleHPInelastic* model2 = new G4ParticleHPInelastic();
0121   process2->RegisterMe(model2);
0122 
0123   // (re) create process: nCapture
0124   //
0125   G4NeutronCaptureProcess* process3 = new G4NeutronCaptureProcess();
0126   pManager->AddDiscreteProcess(process3);
0127   //
0128   // cross section data set
0129   G4ParticleHPCaptureData* dataSet3 = new G4ParticleHPCaptureData();
0130   process3->AddDataSet(dataSet3);
0131   //
0132   // models
0133   G4ParticleHPCapture* model3 = new G4ParticleHPCapture();
0134   process3->RegisterMe(model3);
0135 
0136   // (re) create process: nFission
0137   //
0138   G4NeutronFissionProcess* process4 = new G4NeutronFissionProcess();
0139   pManager->AddDiscreteProcess(process4);
0140   //
0141   // cross section data set
0142   G4ParticleHPFissionData* dataSet4 = new G4ParticleHPFissionData();
0143   process4->AddDataSet(dataSet4);
0144   //
0145   // models
0146   G4ParticleHPFission* model4 = new G4ParticleHPFission();
0147   process4->RegisterMe(model4);
0148 }
0149 
0150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0151 
0152 void NeutronHPphysics::DefineCommands()
0153 {
0154   // Define /testhadr/phys command directory using generic messenger class
0155   fMessenger = new G4GenericMessenger(this, "/testhadr/phys/", "physics list commands");
0156 
0157   // thermal scattering command
0158   auto& thermalCmd = fMessenger->DeclareProperty("thermalScattering", fThermal);
0159 
0160   thermalCmd.SetGuidance("set thermal scattering model");
0161   thermalCmd.SetParameterName("thermal", false);
0162   thermalCmd.SetStates(G4State_PreInit);
0163 }
0164 
0165 //..oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......