Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4HadronPhysicsFTFP_BERT.cc
Go to the documentation of this file.
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 76703 2013-11-14 10:29: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 
49 #include "G4MesonConstructor.hh"
50 #include "G4BaryonConstructor.hh"
52 
57 
59 #include "G4NeutronRadCapture.hh"
60 #include "G4NeutronInelasticXS.hh"
61 #include "G4NeutronCaptureXS.hh"
62 
63 #include "G4PhysListUtil.hh"
64 
65 // factory
67 //
69 
70 G4ThreadLocal G4HadronPhysicsFTFP_BERT::ThreadPrivate* G4HadronPhysicsFTFP_BERT::tpdata=0;
71 
73  : G4VPhysicsConstructor("hInelastic FTFP_BERT")
74 /* , theNeutrons(0)
75  , theBertiniNeutron(0)
76  , theFTFPNeutron(0)
77  , thePiK(0)
78  , theBertiniPiK(0)
79  , theFTFPPiK(0)
80  , thePro(0)
81  , theBertiniPro(0)
82  , theFTFPPro(0)
83  , theHyperon(0)
84  , theAntiBaryon(0)
85  , theFTFPAntiBaryon(0) */
86  , QuasiElastic(false)
87  /* , ChipsKaonMinus(0)
88  , ChipsKaonPlus(0)
89  , ChipsKaonZero(0)
90  , xsNeutronInelasticXS(0)
91  , xsNeutronCaptureXS(0)*/
92 {}
93 
95  : G4VPhysicsConstructor(name)
96 /* , theNeutrons(0)
97  , theBertiniNeutron(0)
98  , theFTFPNeutron(0)
99  , thePiK(0)
100  , theBertiniPiK(0)
101  , theFTFPPiK(0)
102  , thePro(0)
103  , theBertiniPro(0)
104  , theFTFPPro(0)
105  , theHyperon(0)
106  , theAntiBaryon(0)
107  , theFTFPAntiBaryon(0)*/
108  , QuasiElastic(quasiElastic)
109  /* , ChipsKaonMinus(0)
110  , ChipsKaonPlus(0)
111  , ChipsKaonZero(0)
112  , xsNeutronInelasticXS(0)
113  , xsNeutronCaptureXS(0)*/
114 {}
115 
116 void G4HadronPhysicsFTFP_BERT::CreateModels()
117 {
118 
119  tpdata->theNeutrons=new G4NeutronBuilder;
120  tpdata->theFTFPNeutron=new G4FTFPNeutronBuilder(QuasiElastic);
121  tpdata->theNeutrons->RegisterMe(tpdata->theFTFPNeutron);
122  tpdata->theNeutrons->RegisterMe(tpdata->theBertiniNeutron=new G4BertiniNeutronBuilder);
123  tpdata->theBertiniNeutron->SetMinEnergy(0.0*GeV);
124  tpdata->theBertiniNeutron->SetMaxEnergy(5*GeV);
125 
126  tpdata->thePro=new G4ProtonBuilder;
127  tpdata->theFTFPPro=new G4FTFPProtonBuilder(QuasiElastic);
128  tpdata->thePro->RegisterMe(tpdata->theFTFPPro);
129  tpdata->thePro->RegisterMe(tpdata->theBertiniPro=new G4BertiniProtonBuilder);
130  tpdata->theBertiniPro->SetMaxEnergy(5*GeV);
131 
132  tpdata->thePiK=new G4PiKBuilder;
133  tpdata->theFTFPPiK=new G4FTFPPiKBuilder(QuasiElastic);
134  tpdata->thePiK->RegisterMe(tpdata->theFTFPPiK);
135  tpdata->thePiK->RegisterMe(tpdata->theBertiniPiK=new G4BertiniPiKBuilder);
136  tpdata->theBertiniPiK->SetMaxEnergy(5*GeV);
137 
138  tpdata->theHyperon=new G4HyperonFTFPBuilder;
139 
140  tpdata->theAntiBaryon=new G4AntiBarionBuilder;
141  tpdata->theAntiBaryon->RegisterMe(tpdata->theFTFPAntiBaryon=new G4FTFPAntiBarionBuilder(QuasiElastic));
142 }
143 
145 {
146  delete tpdata->theNeutrons;
147  delete tpdata->theBertiniNeutron;
148  delete tpdata->theFTFPNeutron;
149 
150  delete tpdata->thePiK;
151  delete tpdata->theBertiniPiK;
152  delete tpdata->theFTFPPiK;
153 
154  delete tpdata->thePro;
155  delete tpdata->theBertiniPro;
156  delete tpdata->theFTFPPro;
157 
158  delete tpdata->theHyperon;
159  delete tpdata->theAntiBaryon;
160  delete tpdata->theFTFPAntiBaryon;
161 
162  delete tpdata->xsNeutronInelasticXS;
163  delete tpdata->xsNeutronCaptureXS;
164 
165  //Note that here we need to set to 0 the pointer
166  //since tpdata is static and if thread are "reused"
167  //it can be problematic
168  delete tpdata; tpdata = 0;
169 }
170 
172 {
173  G4MesonConstructor pMesonConstructor;
174  pMesonConstructor.ConstructParticle();
175 
176  G4BaryonConstructor pBaryonConstructor;
177  pBaryonConstructor.ConstructParticle();
178 
179  G4ShortLivedConstructor pShortLivedConstructor;
180  pShortLivedConstructor.ConstructParticle();
181 }
182 
183 #include "G4ProcessManager.hh"
185 {
186  if ( tpdata == 0 ) tpdata = new ThreadPrivate;
187  CreateModels();
188  tpdata->theNeutrons->Build();
189  tpdata->thePro->Build();
190  tpdata->thePiK->Build();
191 
192  // --- Kaons ---
196 
201 
202  tpdata->theHyperon->Build();
203  tpdata->theAntiBaryon->Build();
204 
205  // --- Neutrons ---
206  tpdata->xsNeutronInelasticXS = new G4NeutronInelasticXS();
207  G4PhysListUtil::FindInelasticProcess(G4Neutron::Neutron())->AddDataSet(tpdata->xsNeutronInelasticXS);
208 
209  G4HadronicProcess* capture = 0;
211  G4ProcessVector* pv = pmanager->GetProcessList();
212  for ( size_t i=0; i < static_cast<size_t>(pv->size()); ++i ) {
213  if ( fCapture == ((*pv)[i])->GetProcessSubType() ) {
214  capture = static_cast<G4HadronicProcess*>((*pv)[i]);
215  }
216  }
217  if ( ! capture ) {
218  capture = new G4HadronCaptureProcess("nCapture");
219  pmanager->AddDiscreteProcess(capture);
220  }
221  tpdata->xsNeutronCaptureXS = new G4NeutronCaptureXS();
222  capture->AddDataSet(tpdata->xsNeutronCaptureXS);
223  capture->RegisterMe(new G4NeutronRadCapture());
224 }
G4VCrossSectionDataSet * GetCrossSectionDataSet(const G4String &name, G4bool warning=true)
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static G4KaonZeroLong * KaonZeroLong()
const XML_Char * name
static void ConstructParticle()
#define G4ThreadLocal
Definition: tls.hh:52
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
void RegisterMe(G4HadronicInteraction *a)
static G4HadronicProcess * FindInelasticProcess(const G4ParticleDefinition *)
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
static G4KaonZeroShort * KaonZeroShort()
G4_DECLARE_PHYSCONSTR_FACTORY(G4HadronPhysicsFTFP_BERT)
bool G4bool
Definition: G4Types.hh:79
static G4CrossSectionDataSetRegistry * Instance()
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4int size() const
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
G4ProcessVector * GetProcessList() const