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.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 /// \file hadronic/Hadr02/src/HadronPhysicsUrQMD.cc
 27 /// \brief Implementation of the HadronPhysicsUrQMD class
 28 //
 29 //
 30 //---------------------------------------------------------------------------
 31 //
 32 // ClassName:
 33 //
 34 // Author: 2012 A. Dotti
 35 //   created from HadronPhysicsUrQMD
 36 //
 37 // Modified:
 38 //
 39 //----------------------------------------------------------------------------
 40 //
 41 #ifdef G4_USE_URQMD
 42 #  include "HadronPhysicsUrQMD.hh"
 43 
 44 #  include "G4BaryonConstructor.hh"
 45 #  include "G4ChipsKaonMinusInelasticXS.hh"
 46 #  include "G4ChipsKaonPlusInelasticXS.hh"
 47 #  include "G4ChipsKaonZeroInelasticXS.hh"
 48 #  include "G4CrossSectionDataSetRegistry.hh"
 49 #  include "G4MesonConstructor.hh"
 50 #  include "G4ParticleDefinition.hh"
 51 #  include "G4ParticleTable.hh"
 52 #  include "G4PhysicalConstants.hh"
 53 #  include "G4ProcessManager.hh"
 54 #  include "G4ShortLivedConstructor.hh"
 55 #  include "G4SystemOfUnits.hh"
 56 #  include "G4ios.hh"
 57 #  include "globals.hh"
 58 
 59 #  include <iomanip>
 60 
 61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 62 
 63 HadronPhysicsUrQMD::HadronPhysicsUrQMD(G4int) : G4VPhysicsConstructor("hInelastic UrQMD")
 64 {
 65   fNeutrons = 0;
 66   fUrQMDNeutron = 0;
 67   fPiK = 0;
 68   fUrQMDPiK = 0;
 69   fPro = 0;
 70   fUrQMDPro = 0;
 71   fHyperon = 0;
 72   fFTFPHyperon = 0;
 73   fAntiBaryon = 0;
 74 }
 75 
 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 77 
 78 void HadronPhysicsUrQMD::CreateModels()
 79 {
 80   fNeutrons = new G4NeutronBuilder;
 81   fUrQMDNeutron = new UrQMDNeutronBuilder();  // put fission and capture here
 82   fNeutrons->RegisterMe(fUrQMDNeutron);
 83 
 84   fPro = new G4ProtonBuilder;
 85   fUrQMDPro = new UrQMDProtonBuilder();
 86   fPro->RegisterMe(fUrQMDPro);
 87 
 88   fPiK = new G4PiKBuilder;
 89   fUrQMDPiK = new UrQMDPiKBuilder();
 90   fPiK->RegisterMe(fUrQMDPiK);
 91 
 92   // For Hyperons use FTF model
 93   fHyperon = new G4HyperonBuilder;
 94   fFTFPHyperon = new G4HyperonFTFPBuilder;
 95   fHyperon->RegisterMe(fFTFPHyperon);
 96 
 97   fAntiBaryon = new G4AntiBarionBuilder;
 98   fUrQMDAntiBaryon = new UrQMDAntiBarionBuilder();
 99   fAntiBaryon->RegisterMe(fUrQMDAntiBaryon);
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103 
104 HadronPhysicsUrQMD::~HadronPhysicsUrQMD()
105 {
106   delete fNeutrons;
107   delete fUrQMDNeutron;
108 
109   delete fPiK;
110   delete fUrQMDPiK;
111 
112   delete fPro;
113   delete fUrQMDPro;
114 
115   delete fHyperon;
116   delete fFTFPHyperon;
117   delete fAntiBaryon;
118   delete fUrQMDAntiBaryon;
119 }
120 
121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
122 
123 void HadronPhysicsUrQMD::ConstructParticle()
124 {
125   G4MesonConstructor pMesonConstructor;
126   pMesonConstructor.ConstructParticle();
127 
128   G4BaryonConstructor pBaryonConstructor;
129   pBaryonConstructor.ConstructParticle();
130 
131   G4ShortLivedConstructor pShortLivedConstructor;
132   pShortLivedConstructor.ConstructParticle();
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
137 void HadronPhysicsUrQMD::ConstructProcess()
138 {
139   CreateModels();
140   fNeutrons->Build();
141   fPro->Build();
142   fPiK->Build();
143 
144   // use CHIPS cross sections also for Kaons
145   ChipsKaonMinus = G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(
146     G4ChipsKaonMinusInelasticXS::Default_Name());
147   ChipsKaonPlus = G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(
148     G4ChipsKaonPlusInelasticXS::Default_Name());
149   ChipsKaonZero = G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet(
150     G4ChipsKaonZeroInelasticXS::Default_Name());
151   //
152 
153   G4PhysListUtil::FindInelasticProcess(G4KaonMinus::KaonMinus())->AddDataSet(ChipsKaonMinus);
154   G4PhysListUtil::FindInelasticProcess(G4KaonPlus::KaonPlus())->AddDataSet(ChipsKaonPlus);
155   G4PhysListUtil::FindInelasticProcess(G4KaonZeroShort::KaonZeroShort())->AddDataSet(ChipsKaonZero);
156   G4PhysListUtil::FindInelasticProcess(G4KaonZeroLong::KaonZeroLong())->AddDataSet(ChipsKaonZero);
157 
158   fHyperon->Build();
159   fAntiBaryon->Build();
160 }
161 
162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
163 
164 G4HadronicProcess* HadronPhysicsUrQMD::FindInelasticProcess(const G4ParticleDefinition* p)
165 {
166   G4HadronicProcess* had = 0;
167   if (p) {
168     G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
169     size_t n = pvec->size();
170     if (0 < n) {
171       for (size_t i = 0; i < n; ++i) {
172         if (fHadronInelastic == ((*pvec)[i])->GetProcessSubType()) {
173           had = static_cast<G4HadronicProcess*>((*pvec)[i]);
174           break;
175         }
176       }
177     }
178   }
179   return had;
180 }
181 
182 #endif  // G4_USE_URQMD
183