Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 102624 2017-02-10 08:22:14Z 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 
56 #include "G4NeutronRadCapture.hh"
57 #include "G4NeutronInelasticXS.hh"
58 #include "G4NeutronCaptureXS.hh"
59 
61 
62 #include "G4PhysListUtil.hh"
63 #include "G4Threading.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  , thePion(0)
78  , theBertiniPion(0)
79  , theFTFPPion(0)
80  , theKaon(0)
81  , theBertiniKaon(0)
82  , theFTFPKaon(0)
83  , thePro(0)
84  , theBertiniPro(0)
85  , theFTFPPro(0)
86  , theHyperon(0)
87  , theAntiBaryon(0)
88  , theFTFPAntiBaryon(0) */
89  , QuasiElastic(false)
90  /*, xsKaon(0)
91  , xsNeutronInelasticXS(0)
92  , xsNeutronCaptureXS(0)*/
93 {}
94 
96  : G4VPhysicsConstructor(name)
97 /* , theNeutrons(0)
98  , theBertiniNeutron(0)
99  , theFTFPNeutron(0)
100  , thePion(0)
101  , theBertiniPion(0)
102  , theFTFPPion(0)
103  , theKaon(0)
104  , theBertiniKaon(0)
105  , theFTFPKaon(0)
106  , thePro(0)
107  , theBertiniPro(0)
108  , theFTFPPro(0)
109  , theHyperon(0)
110  , theAntiBaryon(0)
111  , theFTFPAntiBaryon(0)*/
112  , QuasiElastic(quasiElastic)
113  /*, xsKaonMinus(0)
114  , xsNeutronInelasticXS(0)
115  , xsNeutronCaptureXS(0)*/
116 {}
117 
118 void G4HadronPhysicsFTFP_BERT::CreateModels()
119 {
120  G4double minFTFP_pion = 3.0 * GeV;
121  G4double maxBERT_pion = 12.0 * GeV;
122  G4double minFTFP_kaon = 3.0 * GeV;
123  G4double maxBERT_kaon = 12.0 * GeV;
124  G4double minFTFP_proton = 3.0 * GeV;
125  G4double maxBERT_proton = 12.0 * GeV;
126  G4double minFTFP_neutron = 3.0 * GeV;
127  G4double maxBERT_neutron = 12.0 * GeV;
128 
130  G4cout << G4endl
131  << " FTFP_BERT : new threshold between BERT and FTFP is over the interval " << G4endl
132  << " for pions : " << minFTFP_pion/GeV << " to " << maxBERT_pion/GeV << " GeV" << G4endl
133  << " for kaons : " << minFTFP_kaon/GeV << " to " << maxBERT_kaon/GeV << " GeV" << G4endl
134  << " for proton : " << minFTFP_proton/GeV << " to " << maxBERT_proton/GeV << " GeV" << G4endl
135  << " for neutron : " << minFTFP_neutron/GeV << " to " << maxBERT_neutron/GeV << " GeV" << G4endl
136  << G4endl;
137  }
138 
139  tpdata->theNeutrons=new G4NeutronBuilder;
140  tpdata->theFTFPNeutron=new G4FTFPNeutronBuilder(QuasiElastic);
141  tpdata->theNeutrons->RegisterMe(tpdata->theFTFPNeutron);
142  tpdata->theFTFPNeutron->SetMinEnergy(minFTFP_neutron);
143  tpdata->theNeutrons->RegisterMe(tpdata->theBertiniNeutron=new G4BertiniNeutronBuilder);
144  tpdata->theBertiniNeutron->SetMinEnergy(0.0*GeV);
145  tpdata->theBertiniNeutron->SetMaxEnergy(maxBERT_neutron);
146 
147  tpdata->thePro=new G4ProtonBuilder;
148  tpdata->theFTFPPro=new G4FTFPProtonBuilder(QuasiElastic);
149  tpdata->thePro->RegisterMe(tpdata->theFTFPPro);
150  tpdata->theFTFPPro->SetMinEnergy(minFTFP_proton);
151  tpdata->thePro->RegisterMe(tpdata->theBertiniPro=new G4BertiniProtonBuilder);
152  tpdata->theBertiniPro->SetMaxEnergy(maxBERT_proton);
153 
154  tpdata->thePion=new G4PionBuilder;
155  tpdata->theFTFPPion=new G4FTFPPionBuilder(QuasiElastic);
156  tpdata->thePion->RegisterMe(tpdata->theFTFPPion);
157  tpdata->theFTFPPion->SetMinEnergy(minFTFP_pion);
158  tpdata->thePion->RegisterMe(tpdata->theBertiniPion=new G4BertiniPionBuilder);
159  tpdata->theBertiniPion->SetMaxEnergy(maxBERT_pion);
160 
161  tpdata->theKaon=new G4KaonBuilder;
162  tpdata->theFTFPKaon=new G4FTFPKaonBuilder(QuasiElastic);
163  tpdata->theKaon->RegisterMe(tpdata->theFTFPKaon);
164  tpdata->theFTFPKaon->SetMinEnergy(minFTFP_kaon);
165  tpdata->theKaon->RegisterMe(tpdata->theBertiniKaon=new G4BertiniKaonBuilder);
166  tpdata->theBertiniKaon->SetMaxEnergy(maxBERT_kaon);
167 
168  tpdata->theHyperon=new G4HyperonFTFPBuilder;
169 
170  tpdata->theAntiBaryon=new G4AntiBarionBuilder;
171  tpdata->theAntiBaryon->RegisterMe(tpdata->theFTFPAntiBaryon=new G4FTFPAntiBarionBuilder(QuasiElastic));
172 }
173 
175 {
176  if (!tpdata) return;
177 
178  delete tpdata->theNeutrons;
179  delete tpdata->theBertiniNeutron;
180  delete tpdata->theFTFPNeutron;
181 
182  delete tpdata->thePion;
183  delete tpdata->theBertiniPion;
184  delete tpdata->theFTFPPion;
185 
186  delete tpdata->theKaon;
187  delete tpdata->theBertiniKaon;
188  delete tpdata->theFTFPKaon;
189 
190  delete tpdata->thePro;
191  delete tpdata->theBertiniPro;
192  delete tpdata->theFTFPPro;
193 
194  delete tpdata->theHyperon;
195  delete tpdata->theAntiBaryon;
196  delete tpdata->theFTFPAntiBaryon;
197 
198  //Note that here we need to set to 0 the pointer
199  //since tpdata is static and if thread are "reused"
200  //it can be problematic
201  delete tpdata; tpdata = 0;
202 }
203 
205 {
206  G4MesonConstructor pMesonConstructor;
207  pMesonConstructor.ConstructParticle();
208 
209  G4BaryonConstructor pBaryonConstructor;
210  pBaryonConstructor.ConstructParticle();
211 
212  G4ShortLivedConstructor pShortLivedConstructor;
213  pShortLivedConstructor.ConstructParticle();
214 }
215 
216 #include "G4ProcessManager.hh"
218 {
219  if ( tpdata == 0 ) tpdata = new ThreadPrivate;
220  CreateModels();
221  tpdata->theNeutrons->Build();
222  tpdata->thePro->Build();
223  tpdata->thePion->Build();
224  tpdata->theKaon->Build();
225 
226  // --- Kaons ---
227  tpdata->xsKaon = new G4ComponentGGHadronNucleusXsc();
228  G4VCrossSectionDataSet * kaonxs = new G4CrossSectionInelastic(tpdata->xsKaon);
233 
234  tpdata->theHyperon->Build();
235  tpdata->theAntiBaryon->Build();
236 
237  // --- Neutrons ---
239  G4PhysListUtil::FindInelasticProcess(G4Neutron::Neutron())->AddDataSet(tpdata->xsNeutronInelasticXS);
240 
241  G4HadronicProcess* capture = 0;
243  G4ProcessVector* pv = pmanager->GetProcessList();
244  for ( size_t i=0; i < static_cast<size_t>(pv->size()); ++i ) {
245  if ( fCapture == ((*pv)[i])->GetProcessSubType() ) {
246  capture = static_cast<G4HadronicProcess*>((*pv)[i]);
247  }
248  }
249  if ( ! capture ) {
250  capture = new G4HadronCaptureProcess("nCapture");
251  pmanager->AddDiscreteProcess(capture);
252  }
254  capture->AddDataSet(tpdata->xsNeutronCaptureXS);
255  capture->RegisterMe(new G4NeutronRadCapture());
256 }
G4VCrossSectionDataSet * GetCrossSectionDataSet(const G4String &name, G4bool warning=true)
const XML_Char * name
Definition: expat.h:151
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static G4KaonZeroLong * KaonZeroLong()
static const char * Default_Name()
static void ConstructParticle()
#define G4ThreadLocal
Definition: tls.hh:89
static void ConstructParticle()
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)
G4GLOB_DLL std::ostream G4cout
static G4KaonZeroShort * KaonZeroShort()
bool G4bool
Definition: G4Types.hh:79
static G4CrossSectionDataSetRegistry * Instance()
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4int size() const
static const char * Default_Name()
G4ProcessManager * GetProcessManager() const
static constexpr double GeV
Definition: G4SIunits.hh:217
#define G4endl
Definition: G4ios.hh:61
G4bool IsMasterThread()
Definition: G4Threading.cc:146
double G4double
Definition: G4Types.hh:76
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
G4ProcessVector * GetProcessList() const
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)