Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4HadronPhysicsFTF_BIC.cc
이 파일의 문서화 페이지로 가기
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 // $Id: G4HadronPhysicsFTF_BIC.cc 105736 2017-08-16 13:01:11Z gcosmo $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4HadronPhysicsFTF_BIC
31 //
32 // Author: 2007 Gunter Folger
33 //
34 // Modified:
35 //
36 //----------------------------------------------------------------------------
37 //
38 #include <iomanip>
40 #include "globals.hh"
41 #include "G4ios.hh"
42 #include "G4SystemOfUnits.hh"
43 #include "G4ParticleDefinition.hh"
44 #include "G4ParticleTable.hh"
45 #include "G4MesonConstructor.hh"
46 #include "G4BaryonConstructor.hh"
48 #include "G4PionBuilder.hh"
49 #include "G4KaonBuilder.hh"
50 #include "G4BinaryPionBuilder.hh"
51 #include "G4BertiniKaonBuilder.hh"
54 #include "G4ProtonBuilder.hh"
56 #include "G4BinaryProtonBuilder.hh"
57 #include "G4NeutronBuilder.hh"
60 #include "G4HyperonFTFPBuilder.hh"
61 #include "G4AntiBarionBuilder.hh"
63 #include "G4ProcessManager.hh"
64 #include "G4ProcessVector.hh"
68 #include "G4NeutronRadCapture.hh"
69 #include "G4NeutronInelasticXS.hh"
70 #include "G4NeutronCaptureXS.hh"
72 #include "G4PhysListUtil.hh"
74 
76 
78  : G4HadronPhysicsFTF_BIC("hInelastic FTF_BIC",false) {}
79 
81  : G4VPhysicsConstructor(name)
82  , QuasiElastic(quasiElastic)
83 {
84  maxBIC_neutron = 5.*GeV;
85  maxBIC_proton = 5.*GeV;
86  maxBERT_kaon = 5.*GeV;
87  maxBIC_pion = 5.*GeV;
88 }
89 
91 {
92  delete xs_k.Get();
93  std::for_each( xs_ds.Begin(),xs_ds.End(),
94  [](G4VCrossSectionDataSet* el){delete el;});
95 }
96 
98 {
99  delete xs_k.Get();
100  std::for_each( xs_ds.Begin(), xs_ds.End(),[](G4VCrossSectionDataSet* el){ delete el;});
101  xs_ds.Clear();
103 }
104 
106 {
107  Neutron();
108  Proton();
109  Pion();
110  Kaon();
111  Others();
112 }
113 
115 {
116  //General schema:
117  // 1) Create a builder
118  // 2) Call AddBuilder
119  // 3) Configure the builder, possibly with sub-builders
120  // 4) Call builder->Build()
121  auto neu = new G4NeutronBuilder;
122  AddBuilder(neu);
123  auto ftfn = new G4FTFBinaryNeutronBuilder(QuasiElastic);
124  AddBuilder( ftfn );
125  neu->RegisterMe(ftfn);
126  auto bicn = new G4BinaryNeutronBuilder;
127  AddBuilder(bicn);
128  neu->RegisterMe(bicn);
129  bicn->SetMinEnergy(0.*GeV);
130  bicn->SetMaxEnergy(maxBIC_neutron);
131  neu->Build();
132 }
133 
135 {
136  auto pro = new G4ProtonBuilder;
137  AddBuilder(pro);
138  auto ftfp = new G4FTFBinaryProtonBuilder(QuasiElastic);
139  AddBuilder(ftfp);
140  pro->RegisterMe(ftfp);
141  auto bicp = new G4BinaryProtonBuilder;
142  AddBuilder(bicp);
143  pro->RegisterMe(bicp);
144  bicp->SetMaxEnergy(maxBIC_proton);
145  pro->Build();
146 }
147 
149 {
150  auto pi = new G4PionBuilder;
151  AddBuilder(pi);
152  auto ftfpi = new G4FTFBinaryPionBuilder(QuasiElastic);
153  AddBuilder(ftfpi);
154  pi->RegisterMe(ftfpi);
155  auto bicpi = new G4BinaryPionBuilder;
156  AddBuilder(bicpi);
157  pi->RegisterMe(bicpi);
158  bicpi->SetMaxEnergy(maxBIC_pion);
159  pi->Build();
160 }
161 
163 {
164  auto k = new G4KaonBuilder;
165  AddBuilder(k);
166  auto ftfk = new G4FTFBinaryKaonBuilder(QuasiElastic);
167  AddBuilder(ftfk);
168  k->RegisterMe(ftfk);
169  auto bertk = new G4BertiniKaonBuilder;
170  AddBuilder(bertk);
171  k->RegisterMe(bertk);
172  bertk->SetMaxEnergy(maxBERT_kaon);
173  k->Build();
174 }
175 
177 {
178  auto hyp = new G4HyperonFTFPBuilder;
179  AddBuilder(hyp);
180  hyp->Build();
181 
182  auto abar = new G4AntiBarionBuilder;
183  AddBuilder(abar);
184  auto ftfpabar = new G4FTFPAntiBarionBuilder(QuasiElastic);
185  AddBuilder(ftfpabar);
186  abar->RegisterMe(ftfpabar);
187  abar->Build();
188 }
189 
191 {
192  G4MesonConstructor pMesonConstructor;
193  pMesonConstructor.ConstructParticle();
194 
195  G4BaryonConstructor pBaryonConstructor;
196  pBaryonConstructor.ConstructParticle();
197 
198  G4ShortLivedConstructor pShortLivedConstructor;
199  pShortLivedConstructor.ConstructParticle();
200 }
201 
203 {
205  DumpBanner();
206  }
207  CreateModels();
209 }
210 
211 //#include "G4ProcessManager.hh"
212 #include "G4PhysListUtil.hh"
214 {
215  // --- Kaons ---
216  auto xsk = new G4ComponentGGHadronNucleusXsc();
217  xs_k.Put(xsk);
219  xs_ds.Push_back(kaonxs);
224 
225  // --- Neutrons ---
227  xs_ds.Push_back(xs_n_in); //TODO: Is this needed? Who owns the pointer?
229 
230  G4HadronicProcess* capture = 0;
232  G4ProcessVector* pv = pmanager->GetProcessList();
233  for ( size_t i=0; i < static_cast<size_t>(pv->size()); ++i ) {
234  if ( fCapture == ((*pv)[i])->GetProcessSubType() ) {
235  capture = static_cast<G4HadronicProcess*>((*pv)[i]);
236  }
237  }
238  if ( ! capture ) {
239  capture = new G4HadronCaptureProcess("nCapture");
240  pmanager->AddDiscreteProcess(capture);
241  }
243  xs_ds.Push_back(xs_n_c); //TODO: Who owns this?
244  capture->AddDataSet(xs_n_c);
245  capture->RegisterMe(new G4NeutronRadCapture());
246 }
247 
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
const XML_Char * name
Definition: expat.h:151
static const char * Default_Name()
virtual void ConstructParticle() override
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void RegisterMe(G4HadronicInteraction *a)
static void ConstructParticle()
G4bool IsMasterThread()
Definition: G4Threading.cc:130
static G4CrossSectionDataSetRegistry * Instance()
G4ProcessVector * GetProcessList() const
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
iterator End()
Definition: G4Cache.hh:390
G4VCrossSectionDataSet * GetCrossSectionDataSet(const G4String &name, G4bool warning=true)
static G4KaonZeroLong * KaonZeroLong()
bool G4bool
Definition: G4Types.hh:79
void AddBuilder(G4PhysicsBuilderInterface *bld)
value_type & Get() const
Definition: G4Cache.hh:314
G4Cache< G4ComponentGGHadronNucleusXsc * > xs_k
void Put(const value_type &val) const
Definition: G4Cache.hh:318
static void ConstructParticle()
static G4KaonZeroShort * KaonZeroShort()
void Clear()
Definition: G4Cache.hh:396
static G4HadronicProcess * FindInelasticProcess(const G4ParticleDefinition *)
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
int G4int
Definition: G4Types.hh:78
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4ProcessManager * GetProcessManager() const
virtual void TerminateWorker() override
G4VectorCache< G4VCrossSectionDataSet * > xs_ds
G4HadronPhysicsFTF_BIC(G4int verbose=1)
static const char * Default_Name()
G4int size() const
iterator Begin()
Definition: G4Cache.hh:384
static constexpr double pi
Definition: G4SIunits.hh:75
virtual void ConstructProcess() override
static constexpr double GeV
Definition: G4SIunits.hh:217
void Push_back(const value_type &val)
Definition: G4Cache.hh:362