Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:40

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 HadronElasticPhysicsHP.cc
0027 /// \brief Definition of the HadronElasticPhysicsHP class
0028 //
0029 //
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 
0032 //
0033 // HP models for neutron < 20 MeV
0034 
0035 #include "HadronElasticPhysicsHP.hh"
0036 
0037 #include "G4GenericMessenger.hh"
0038 #include "G4HadronicProcess.hh"
0039 #include "G4ParticleHPElastic.hh"
0040 #include "G4ParticleHPElasticData.hh"
0041 #include "G4ParticleHPThermalScattering.hh"
0042 #include "G4ParticleHPThermalScatteringData.hh"
0043 #include "G4SystemOfUnits.hh"
0044 
0045 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0046 
0047 HadronElasticPhysicsHP::HadronElasticPhysicsHP(G4int ver) : G4HadronElasticPhysics(ver)
0048 {
0049   // define commands for this class
0050   DefineCommands();
0051 }
0052 
0053 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0054 
0055 HadronElasticPhysicsHP::~HadronElasticPhysicsHP()
0056 {
0057   delete fMessenger;
0058 }
0059 
0060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0061 
0062 void HadronElasticPhysicsHP::ConstructProcess()
0063 {
0064   G4HadronElasticPhysics::ConstructProcess();
0065   GetNeutronModel()->SetMinEnergy(19.5 * MeV);
0066 
0067   G4HadronicProcess* process = GetNeutronProcess();
0068   G4ParticleHPElastic* model1 = new G4ParticleHPElastic();
0069   process->RegisterMe(model1);
0070   process->AddDataSet(new G4ParticleHPElasticData());
0071 
0072   if (fThermal) {
0073     model1->SetMinEnergy(4 * eV);
0074     G4ParticleHPThermalScattering* model2 = new G4ParticleHPThermalScattering();
0075     process->RegisterMe(model2);
0076     process->AddDataSet(new G4ParticleHPThermalScatteringData());
0077   }
0078 }
0079 
0080 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0081 
0082 void HadronElasticPhysicsHP::DefineCommands()
0083 {
0084   // Define /testhadr/phys command directory using generic messenger class
0085   fMessenger = new G4GenericMessenger(this, "/testhadr/phys/", "physics list commands");
0086 
0087   // thermal scattering command
0088   auto& thermalCmd = fMessenger->DeclareProperty("thermalScattering", fThermal);
0089 
0090   thermalCmd.SetGuidance("set thermal scattering model");
0091   thermalCmd.SetParameterName("thermal", false);
0092   thermalCmd.SetDefaultValue("false");
0093   thermalCmd.SetStates(G4State_PreInit);
0094 }
0095 
0096 //..oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......