Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4HadronPhysicsFTFP_BERT.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: G4HadronPhysicsFTFP_BERT.cc 105736 2017-08-16 13:01:11Z gcosmo $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName:
31 //
32 // Author: 2007 Gunter Folger
33 // created from G4HadronPhysicsFTFP
34 //
35 // Modified:
36 //
37 //----------------------------------------------------------------------------
38 //
39 #include <iomanip>
40 
42 
43 #include "globals.hh"
44 #include "G4ios.hh"
45 #include "G4SystemOfUnits.hh"
46 #include "G4ParticleDefinition.hh"
47 #include "G4ParticleTable.hh"
48 #include "G4PionBuilder.hh"
49 #include "G4BertiniPionBuilder.hh"
50 #include "G4FTFPPionBuilder.hh"
51 
52 #include "G4KaonBuilder.hh"
53 #include "G4BertiniKaonBuilder.hh"
54 #include "G4FTFPKaonBuilder.hh"
55 
56 #include "G4ProtonBuilder.hh"
58 #include "G4FTFPNeutronBuilder.hh"
59 #include "G4FTFPProtonBuilder.hh"
60 
61 #include "G4NeutronBuilder.hh"
63 #include "G4FTFPNeutronBuilder.hh"
64 
65 #include "G4HyperonFTFPBuilder.hh"
66 #include "G4AntiBarionBuilder.hh"
68 
69 #include "G4MesonConstructor.hh"
70 #include "G4BaryonConstructor.hh"
72 
76 #include "G4NeutronRadCapture.hh"
77 #include "G4NeutronInelasticXS.hh"
78 #include "G4NeutronCaptureXS.hh"
79 
81 
82 #include "G4PhysListUtil.hh"
83 #include "G4Threading.hh"
84 
85 // factory
87 //
89 
90 
92  G4HadronPhysicsFTFP_BERT("hInelastic FTFP_BERT",false) {}
93 
95  : G4VPhysicsConstructor(name)
96  , QuasiElastic(quasiElastic)
97 {
98  minFTFP_pion = 3.0 * GeV;
99  maxBERT_pion = 12.0 * GeV;
100  minFTFP_kaon = 3.0 * GeV;
101  maxBERT_kaon = 12.0 * GeV;
102  minFTFP_proton = 3.0 * GeV;
103  maxBERT_proton = 12.0 * GeV;
104  minFTFP_neutron = 3.0 * GeV;
105  maxBERT_neutron = 12.0 * GeV;
106 }
107 
109 {
110  //Detele master-owned stuff
111  delete xs_k.Get();
112  std::for_each( xs_ds.Begin(), xs_ds.End(),[](G4VCrossSectionDataSet* el){ delete el;});
113 }
114 
116 {
117  G4MesonConstructor pMesonConstructor;
118  pMesonConstructor.ConstructParticle();
119 
120  G4BaryonConstructor pBaryonConstructor;
121  pBaryonConstructor.ConstructParticle();
122 
123  G4ShortLivedConstructor pShortLivedConstructor;
124  pShortLivedConstructor.ConstructParticle();
125 }
126 
128 {
129  delete xs_k.Get();
130  std::for_each( xs_ds.Begin(), xs_ds.End(),[](G4VCrossSectionDataSet* el){ delete el;});
131  xs_ds.Clear();
133 }
134 
136 {
137  G4cout << G4endl
138  << " FTFP_BERT : new threshold between BERT and FTFP is over the interval " << G4endl
139  << " for pions : " << minFTFP_pion/GeV << " to " << maxBERT_pion/GeV << " GeV" << G4endl
140  << " for kaons : " << minFTFP_kaon/GeV << " to " << maxBERT_kaon/GeV << " GeV" << G4endl
141  << " for proton : " << minFTFP_proton/GeV << " to " << maxBERT_proton/GeV << " GeV" << G4endl
142  << " for neutron : " << minFTFP_neutron/GeV << " to " << maxBERT_neutron/GeV << " GeV" << G4endl
143  << G4endl;
144 }
145 
147 {
148  Neutron();
149  Proton();
150  Pion();
151  Kaon();
152  Others();
153 }
154 
156 {
157  //General schema:
158  // 1) Create a builder
159  // 2) Call AddBuilder
160  // 3) Configure the builder, possibly with sub-builders
161  // 4) Call builder->Build()
162  auto neu = new G4NeutronBuilder;
163  AddBuilder(neu);
164  auto ftfpn = new G4FTFPNeutronBuilder(QuasiElastic);
165  AddBuilder( ftfpn );
166  neu->RegisterMe(ftfpn);
167  ftfpn->SetMinEnergy(minFTFP_neutron);
168  auto bertn = new G4BertiniNeutronBuilder;
169  AddBuilder(bertn);
170  neu->RegisterMe(bertn);
171  bertn->SetMinEnergy(0.*GeV);
172  bertn->SetMaxEnergy(maxBERT_neutron);
173  neu->Build();
174 }
175 
177 {
178  auto pro = new G4ProtonBuilder;
179  AddBuilder(pro);
180  auto ftfpp = new G4FTFPProtonBuilder(QuasiElastic);
181  AddBuilder(ftfpp);
182  pro->RegisterMe(ftfpp);
183  ftfpp->SetMinEnergy(minFTFP_proton);
184  auto bertp = new G4BertiniProtonBuilder;
185  AddBuilder(bertp);
186  pro->RegisterMe(bertp);
187  bertp->SetMaxEnergy(maxBERT_proton);
188  pro->Build();
189 }
190 
192 {
193  auto pi = new G4PionBuilder;
194  AddBuilder(pi);
195  auto ftfppi = new G4FTFPPionBuilder(QuasiElastic);
196  AddBuilder(ftfppi);
197  pi->RegisterMe(ftfppi);
198  ftfppi->SetMinEnergy(minFTFP_pion);
199  auto bertpi = new G4BertiniPionBuilder;
200  AddBuilder(bertpi);
201  pi->RegisterMe(bertpi);
202  bertpi->SetMaxEnergy(maxBERT_pion);
203  pi->Build();
204 }
205 
207 {
208  auto k = new G4KaonBuilder;
209  AddBuilder(k);
210  auto ftfpk = new G4FTFPKaonBuilder(QuasiElastic);
211  AddBuilder(ftfpk);
212  k->RegisterMe(ftfpk);
213  ftfpk->SetMinEnergy(minFTFP_kaon);
214  auto bertk = new G4BertiniKaonBuilder;
215  AddBuilder(bertk);
216  k->RegisterMe(bertk);
217  bertk->SetMaxEnergy(maxBERT_kaon);
218  k->Build();
219 }
220 
222 {
223  //===== Hyperons ====== //
224  auto hyp = new G4HyperonFTFPBuilder;
225  AddBuilder( hyp );
226  hyp->Build();
227 
229  auto abar = new G4AntiBarionBuilder;
230  AddBuilder(abar);
231  auto ftfpabar = new G4FTFPAntiBarionBuilder(QuasiElastic);
232  AddBuilder(ftfpabar);
233  abar->RegisterMe(ftfpabar);
234  abar->Build();
235 }
236 
238 {
240  DumpBanner();
241  }
242  CreateModels();
244 }
245 
246 #include "G4ProcessManager.hh"
248 {
249  //Modify XS for kaons
250  auto xsk = new G4ComponentGGHadronNucleusXsc();
251  xs_k.Put(xsk);
253  xs_ds.Push_back(kaonxs);
258 
259  //Modify Neutrons
261  xs_ds.Push_back(xs_n_in);//TODO: Is this needed? Who owns the pointer?
263  G4HadronicProcess* capture = 0;
265  G4ProcessVector* pv = pmanager->GetProcessList();
266  for ( size_t i=0; i < static_cast<size_t>(pv->size()); ++i ) {
267  if ( fCapture == ((*pv)[i])->GetProcessSubType() ) {
268  capture = static_cast<G4HadronicProcess*>((*pv)[i]);
269  }
270  }
271  if ( ! capture ) {
272  capture = new G4HadronCaptureProcess("nCapture");
273  pmanager->AddDiscreteProcess(capture);
274  }
276  xs_ds.Push_back(xs_n_c);
277  capture->AddDataSet( xs_n_c );
278  capture->RegisterMe( new G4NeutronRadCapture() );
279 }
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
const XML_Char * name
Definition: expat.h:151
static const char * Default_Name()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void RegisterMe(G4HadronicInteraction *a)
#define G4endl
Definition: G4ios.hh:61
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)
virtual void ConstructParticle() override
static G4KaonZeroLong * KaonZeroLong()
bool G4bool
Definition: G4Types.hh:79
void AddBuilder(G4PhysicsBuilderInterface *bld)
virtual void TerminateWorker() override
value_type & Get() const
Definition: G4Cache.hh:314
virtual void ConstructProcess() override
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
static const char * Default_Name()
G4int size() const
G4GLOB_DLL std::ostream G4cout
G4Cache< G4ComponentGGHadronNucleusXsc * > xs_k
iterator Begin()
Definition: G4Cache.hh:384
static constexpr double pi
Definition: G4SIunits.hh:75
static constexpr double GeV
Definition: G4SIunits.hh:217
void Push_back(const value_type &val)
Definition: G4Cache.hh:362
G4VectorCache< G4VCrossSectionDataSet * > xs_ds