Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4HadronPhysicsQGSP_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: G4HadronPhysicsQGSP_BERT.cc 105736 2017-08-16 13:01:11Z gcosmo $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4HadronPhysicsQGSP_BERT
31 //
32 // Author: 2002 J.P. Wellisch
33 //
34 // Modified:
35 // 23.11.2005 G.Folger: migration to non static particles
36 // 08.06.2006 V.Ivanchenko: remove stopping
37 // 20.06.2006 G.Folger: Bertini applies to Kaons, i.e. use SetMinEnergy instead of SetMinPionEnergy
38 // 25.04.2007 G.Folger: Add code for quasielastic
39 // 10.12.2007 G.Folger: Add projectilediffrative option for proton/neutron, off by default
40 // 31.10.2012 A.Ribon: Use G4MiscBuilder
41 // 19.03.2013 A.Ribon: Replace LEP with FTFP
42 //
43 //----------------------------------------------------------------------------
44 //
45 #include <iomanip>
46 
48 
49 #include "globals.hh"
50 #include "G4ios.hh"
51 #include "G4SystemOfUnits.hh"
52 #include "G4ParticleDefinition.hh"
53 #include "G4ParticleTable.hh"
54 
55 #include "G4PiKBuilder.hh"
56 #include "G4FTFPPiKBuilder.hh"
57 #include "G4QGSPPiKBuilder.hh"
58 #include "G4BertiniPiKBuilder.hh"
59 
60 #include "G4ProtonBuilder.hh"
61 #include "G4FTFPProtonBuilder.hh"
62 #include "G4QGSPProtonBuilder.hh"
64 
65 #include "G4NeutronBuilder.hh"
66 #include "G4FTFPNeutronBuilder.hh"
67 #include "G4QGSPNeutronBuilder.hh"
69 
70 #include "G4HyperonFTFPBuilder.hh"
71 #include "G4AntiBarionBuilder.hh"
73 #include "G4MesonConstructor.hh"
74 #include "G4BaryonConstructor.hh"
76 #include "G4IonConstructor.hh"
77 
80 #include "G4NeutronRadCapture.hh"
81 #include "G4NeutronInelasticXS.hh"
82 #include "G4NeutronCaptureXS.hh"
85 
86 #include "G4PhysListUtil.hh"
87 #include "G4ProcessManager.hh"
89 //
91 
93  : G4HadronPhysicsQGSP_BERT("hInelastic QGSP_BERT",true) {}
94 
96  : G4VPhysicsConstructor(name)
97 {
98  QuasiElasticFTF= false; // Use built-in quasi-elastic (not add-on)
99  QuasiElasticQGS= true; // For QGS, it must use it.
105 
106 }
107 
108 
110 {
111  Neutron();
112  Proton();
113  Pion();
114  Kaon();
115  Others();
116 }
117 
119 {
120  //General schema:
121  // 1) Create a builder
122  // 2) Call AddBuilder
123  // 3) Configure the builder, possibly with sub-builders
124  // 4) Call builder->Build()
125  auto neu = new G4NeutronBuilder;
126  AddBuilder(neu);
127  auto qgs = new G4QGSPNeutronBuilder(QuasiElasticQGS);
128  AddBuilder(qgs);
129  qgs->SetMinEnergy(minQGSP_neutron);
130  neu->RegisterMe(qgs);
131  auto ftf = new G4FTFPNeutronBuilder(QuasiElasticFTF);
132  AddBuilder(ftf);
133  ftf->SetMinEnergy(minFTFP_neutron);
134  ftf->SetMaxEnergy(maxFTFP_neutron);
135  neu->RegisterMe(ftf);
136  auto bert = new G4BertiniNeutronBuilder;
137  AddBuilder(bert);
138  bert->SetMinEnergy(minBERT_neutron);
139  bert->SetMaxEnergy(maxBERT_neutron);
140  neu->RegisterMe(bert);
141  neu->Build();
142 }
143 
145 {
146  auto pro = new G4ProtonBuilder;
147  AddBuilder(pro);
148  auto qgs = new G4QGSPProtonBuilder(QuasiElasticQGS);
149  AddBuilder(qgs);
150  qgs->SetMinEnergy(minQGSP_proton);
151  pro->RegisterMe(qgs);
152  auto ftf = new G4FTFPProtonBuilder(QuasiElasticFTF);
153  AddBuilder(ftf);
154  ftf->SetMinEnergy(minFTFP_proton);
155  ftf->SetMaxEnergy(maxFTFP_proton);
156  pro->RegisterMe(ftf);
157  auto bert = new G4BertiniProtonBuilder;
158  AddBuilder(bert);
159  bert->SetMinEnergy(minBERT_proton);
160  bert->SetMaxEnergy(maxBERT_proton);
161  pro->RegisterMe(bert);
162  pro->Build();
163 }
164 
166 {
167  auto pik = new G4PiKBuilder;
168  AddBuilder(pik);
169  auto qgs = new G4QGSPPiKBuilder(QuasiElasticQGS);
170  AddBuilder(qgs);
171  qgs->SetMinEnergy(minQGSP_pik);
172  pik->RegisterMe(qgs);
173  auto ftf = new G4FTFPPiKBuilder(QuasiElasticFTF);
174  AddBuilder(ftf);
175  ftf->SetMinEnergy(minFTFP_pik);
176  ftf->SetMaxEnergy(maxFTFP_pik);
177  pik->RegisterMe(ftf);
178  auto bert = new G4BertiniPiKBuilder;
179  AddBuilder(bert);
180  bert->SetMinEnergy(minBERT_pik);
181  bert->SetMaxEnergy(maxBERT_pik);
182  pik->RegisterMe(bert);
183  pik->Build();
184 }
185 
187 {
188  auto hyp = new G4HyperonFTFPBuilder;
189  AddBuilder(hyp);
190  hyp->Build();
191 
192  auto abar = new G4AntiBarionBuilder;
193  AddBuilder(abar);
195  AddBuilder(ftf);
196  abar->RegisterMe(ftf);
197  abar->Build();
198 }
199 
201 {
202  //Detele master-owned stuff
203  delete xs_k.Get();
204  std::for_each( xs_ds.Begin(), xs_ds.End(),[](G4VCrossSectionDataSet* el){ delete el;});
205 }
206 
208 {
209  delete xs_k.Get();
210  std::for_each( xs_ds.Begin(), xs_ds.End(),[](G4VCrossSectionDataSet* el){ delete el;});
211  xs_ds.Clear();
213 }
214 
216 {
217  G4MesonConstructor pMesonConstructor;
218  pMesonConstructor.ConstructParticle();
219 
220  G4BaryonConstructor pBaryonConstructor;
221  pBaryonConstructor.ConstructParticle();
222 
223  G4ShortLivedConstructor pShortLivedConstructor;
224  pShortLivedConstructor.ConstructParticle();
225 
226  G4IonConstructor pIonConstructor;
227  pIonConstructor.ConstructParticle();
228 }
229 
231 {
232  //Modify XS for kaons
233  auto xsk = new G4ComponentGGHadronNucleusXsc();
234  xs_k.Put(xsk);
236  xs_ds.Push_back(kaonxs);
241 
242  //Modify Neutrons
244  xs_ds.Push_back(xs_n_in);//TODO: Is this needed? Who owns the pointer?
246  G4HadronicProcess* capture = 0;
248  G4ProcessVector* pv = pmanager->GetProcessList();
249  for ( size_t i=0; i < static_cast<size_t>(pv->size()); ++i ) {
250  if ( fCapture == ((*pv)[i])->GetProcessSubType() ) {
251  capture = static_cast<G4HadronicProcess*>((*pv)[i]);
252  }
253  }
254  if ( ! capture ) {
255  capture = new G4HadronCaptureProcess("nCapture");
256  pmanager->AddDiscreteProcess(capture);
257  }
259  xs_ds.Push_back(xs_n_c);
260  capture->AddDataSet( xs_n_c );
261  capture->RegisterMe( new G4NeutronRadCapture() );
262 }
263 
265 {
267  DumpBanner();
268  }
269  CreateModels();
271 }
272 
#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)
static void ConstructParticle()
static void ConstructParticle()
G4bool IsMasterThread()
Definition: G4Threading.cc:130
static G4CrossSectionDataSetRegistry * Instance()
virtual void ConstructParticle() override
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
G4Cache< G4ComponentGGHadronNucleusXsc * > xs_k
virtual void ConstructProcess() override
void AddBuilder(G4PhysicsBuilderInterface *bld)
value_type & Get() const
Definition: G4Cache.hh:314
G4VectorCache< G4VCrossSectionDataSet * > xs_ds
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
iterator Begin()
Definition: G4Cache.hh:384
virtual void TerminateWorker() override
static constexpr double GeV
Definition: G4SIunits.hh:217
void Push_back(const value_type &val)
Definition: G4Cache.hh:362