Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-01 07:38:41

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 HadronPhysicsUrQMD.cc
0027 /// \brief Implementation of the HadronPhysicsUrQMD class
0028 
0029 //---------------------------------------------------------------------------
0030 //
0031 // ClassName:
0032 //
0033 // Author: 2012 A. Dotti
0034 //   created from HadronPhysicsUrQMD
0035 //
0036 // Modified:
0037 //
0038 //----------------------------------------------------------------------------
0039 //
0040 #ifdef G4_USE_URQMD
0041 #  include "HadronPhysicsUrQMD.hh"
0042 
0043 #  include "G4BaryonConstructor.hh"
0044 #  include "G4ChipsKaonMinusInelasticXS.hh"
0045 #  include "G4ChipsKaonPlusInelasticXS.hh"
0046 #  include "G4ChipsKaonZeroInelasticXS.hh"
0047 #  include "G4CrossSectionDataSetRegistry.hh"
0048 #  include "G4MesonConstructor.hh"
0049 #  include "G4ParticleDefinition.hh"
0050 #  include "G4ParticleTable.hh"
0051 #  include "G4PhysicalConstants.hh"
0052 #  include "G4ProcessManager.hh"
0053 #  include "G4ShortLivedConstructor.hh"
0054 #  include "G4SystemOfUnits.hh"
0055 #  include "G4ios.hh"
0056 #  include "globals.hh"
0057 
0058 #  include <iomanip>
0059 
0060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0061 
0062 HadronPhysicsUrQMD::HadronPhysicsUrQMD(G4int) : G4VPhysicsConstructor("hInelastic UrQMD")
0063 {
0064   fNeutrons = 0;
0065   fUrQMDNeutron = 0;
0066   fPiK = 0;
0067   fUrQMDPiK = 0;
0068   fPro = 0;
0069   fUrQMDPro = 0;
0070   fHyperon = 0;
0071   fFTFPHyperon = 0;
0072   fAntiBaryon = 0;
0073 }
0074 
0075 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0076 
0077 void HadronPhysicsUrQMD::CreateModels()
0078 {
0079   fNeutrons = new G4NeutronBuilder;
0080   fUrQMDNeutron = new UrQMDNeutronBuilder();  // put fission and capture here
0081   fNeutrons->RegisterMe(fUrQMDNeutron);
0082 
0083   fPro = new G4ProtonBuilder;
0084   fUrQMDPro = new UrQMDProtonBuilder();
0085   fPro->RegisterMe(fUrQMDPro);
0086 
0087   fPiK = new G4PiKBuilder;
0088   fUrQMDPiK = new UrQMDPiKBuilder();
0089   fPiK->RegisterMe(fUrQMDPiK);
0090 
0091   // For Hyperons use FTF model
0092   fHyperon = new G4HyperonBuilder;
0093   fFTFPHyperon = new G4HyperonFTFPBuilder;
0094   fHyperon->RegisterMe(fFTFPHyperon);
0095 
0096   fAntiBaryon = new G4AntiBarionBuilder;
0097   fUrQMDAntiBaryon = new UrQMDAntiBarionBuilder();
0098   fAntiBaryon->RegisterMe(fUrQMDAntiBaryon);
0099 }
0100 
0101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0102 
0103 HadronPhysicsUrQMD::~HadronPhysicsUrQMD()
0104 {
0105   delete fNeutrons;
0106   delete fUrQMDNeutron;
0107 
0108   delete fPiK;
0109   delete fUrQMDPiK;
0110 
0111   delete fPro;
0112   delete fUrQMDPro;
0113 
0114   delete fHyperon;
0115   delete fFTFPHyperon;
0116   delete fAntiBaryon;
0117   delete fUrQMDAntiBaryon;
0118 }
0119 
0120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0121 
0122 void HadronPhysicsUrQMD::ConstructParticle()
0123 {
0124   G4MesonConstructor pMesonConstructor;
0125   pMesonConstructor.ConstructParticle();
0126 
0127   G4BaryonConstructor pBaryonConstructor;
0128   pBaryonConstructor.ConstructParticle();
0129 
0130   G4ShortLivedConstructor pShortLivedConstructor;
0131   pShortLivedConstructor.ConstructParticle();
0132 }
0133 
0134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0135 
0136 void HadronPhysicsUrQMD::ConstructProcess()
0137 {
0138   CreateModels();
0139   fNeutrons->Build();
0140   fPro->Build();
0141   fPiK->Build();
0142 
0143   // use CHIPS cross sections also for Kaons
0144   ChipsKaonMinus = G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(
0145     G4ChipsKaonMinusInelasticXS::Default_Name());
0146   ChipsKaonPlus = G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(
0147     G4ChipsKaonPlusInelasticXS::Default_Name());
0148   ChipsKaonZero = G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(
0149     G4ChipsKaonZeroInelasticXS::Default_Name());
0150   //
0151 
0152   G4PhysListUtil::FindInelasticProcess(G4KaonMinus::KaonMinus())->AddDataSet(ChipsKaonMinus);
0153   G4PhysListUtil::FindInelasticProcess(G4KaonPlus::KaonPlus())->AddDataSet(ChipsKaonPlus);
0154   G4PhysListUtil::FindInelasticProcess(G4KaonZeroShort::KaonZeroShort())->AddDataSet(ChipsKaonZero);
0155   G4PhysListUtil::FindInelasticProcess(G4KaonZeroLong::KaonZeroLong())->AddDataSet(ChipsKaonZero);
0156 
0157   fHyperon->Build();
0158   fAntiBaryon->Build();
0159 }
0160 
0161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0162 
0163 G4HadronicProcess* HadronPhysicsUrQMD::FindInelasticProcess(const G4ParticleDefinition* p)
0164 {
0165   G4HadronicProcess* had = 0;
0166   if (p) {
0167     G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
0168     size_t n = pvec->size();
0169     if (0 < n) {
0170       for (size_t i = 0; i < n; ++i) {
0171         if (fHadronInelastic == ((*pvec)[i])->GetProcessSubType()) {
0172           had = static_cast<G4HadronicProcess*>((*pvec)[i]);
0173           break;
0174         }
0175       }
0176     }
0177   }
0178   return had;
0179 }
0180 
0181 #endif  // G4_USE_URQMD