Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4HadronDElasticPhysics.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: G4HadronDElasticPhysics.cc 99978 2016-10-13 07:28:13Z gcosmo $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4HadronDElasticPhysics
31 //
32 // Author: 11 April 2006 V. Ivanchenko
33 //
34 // Modified:
35 // 05.07.2006 V.Ivanchenko define process by particle name;
36 // fix problem of initialisation of HP
37 // 24.07.2006 V.Ivanchenko add G4NeutronHPElasticData
38 // 10.08.2006 V.Ivanchenko separate neutrons from other particles
39 // 17.11.2006 V.Ivanchenko do not redefine G4HadronElastic default parameters
40 // 19.02.2007 V.Ivanchenko set QModelLowLimit and LowestEnergyLimit to zero
41 // 19.02.2007 A.Howard set QModelLowLimit and LowestEnergyLimit to zero
42 // for neutrons
43 // 06.03.2007 V.Ivanchenko use updated interface to G4UElasticCrossSection
44 // 03.06.2010 V.Ivanchenko cleanup constructors and ConstructProcess method
45 //
46 //----------------------------------------------------------------------------
47 //
48 // Diffuse optical model for sampling scattering
49 // BBG cross sections for p, pi+-
50 // XS cross sections for n
51 // LHEP cross sections for other particles
52 
54 
55 #include "G4SystemOfUnits.hh"
56 #include "G4ParticleDefinition.hh"
57 #include "G4ProcessManager.hh"
58 #include "G4HadronicProcess.hh"
59 
60 #include "G4MesonConstructor.hh"
61 #include "G4BaryonConstructor.hh"
62 #include "G4IonConstructor.hh"
63 #include "G4Neutron.hh"
64 
66 #include "G4HadronElastic.hh"
68 #include "G4AntiNuclElastic.hh"
69 
70 #include "G4BGGNucleonElasticXS.hh"
71 #include "G4BGGPionElasticXS.hh"
72 #include "G4NeutronElasticXS.hh"
73 
75 
79 
80 #include "G4CrossSectionElastic.hh"
81 #include "G4DiffuseElastic.hh"
82 
83 // factory
85 //
87 
88 G4ThreadLocal G4bool G4HadronDElasticPhysics::wasActivated = false;
90  : G4VPhysicsConstructor("hElasticDIFFUSE"), verbose(ver)
91 {
92  if(verbose > 1) {
93  G4cout << "### G4HadronDElasticPhysics: " << GetPhysicsName()
94  << G4endl;
95  }
96 }
97 
99 {}
100 
102 {
103  // G4cout << "G4HadronDElasticPhysics::ConstructParticle" << G4endl;
104  G4MesonConstructor pMesonConstructor;
105  pMesonConstructor.ConstructParticle();
106 
107  G4BaryonConstructor pBaryonConstructor;
108  pBaryonConstructor.ConstructParticle();
109 
110  // Construct light ions
111  G4IonConstructor pConstructor;
112  pConstructor.ConstructParticle();
113 }
114 
116 {
117  if(wasActivated) return;
118  wasActivated = true;
119 
120  const G4double elimitAntiNuc = 100.1*MeV;
121  if(verbose > 1) {
122  G4cout << "### HadronDElasticPhysics Construct Processes "
123  << " for anti-neuclei "
124  << elimitAntiNuc/GeV << " GeV" << G4endl;
125  }
126 
127  G4AntiNuclElastic* anuc = new G4AntiNuclElastic();
128  anuc->SetMinEnergy(elimitAntiNuc);
129  G4CrossSectionElastic* anucxs =
131 
132  G4HadronElastic* lhep0 = new G4HadronElastic();
133  G4HadronElastic* lhep1 = new G4HadronElastic();
134  lhep1->SetMaxEnergy(10.1*MeV);
135  G4HadronElastic* lhep2 = new G4HadronElastic();
136  lhep2->SetMaxEnergy(elimitAntiNuc);
137 
138  G4DiffuseElastic* model = 0;
139 
140  auto myParticleIterator=GetParticleIterator();
141  myParticleIterator->reset();
142  while( (*myParticleIterator)() )
143  {
144  G4ParticleDefinition* particle = myParticleIterator->value();
145  G4ProcessManager* pmanager = particle->GetProcessManager();
146  G4String pname = particle->GetParticleName();
147  if(pname == "anti_lambda" ||
148  pname == "anti_neutron" ||
149  pname == "anti_omega-" ||
150  pname == "anti_sigma-" ||
151  pname == "anti_sigma+" ||
152  pname == "anti_xi-" ||
153  pname == "anti_xi0" ||
154  pname == "lambda" ||
155  pname == "omega-" ||
156  pname == "sigma-" ||
157  pname == "sigma+" ||
158  pname == "xi-" ||
159  pname == "alpha" ||
160  pname == "deuteron" ||
161  pname == "triton"
162  ) {
163 
165  hel->RegisterMe(lhep0);
166  pmanager->AddDiscreteProcess(hel);
167  if(verbose > 1) {
168  G4cout << "### HadronDElasticPhysics: " << hel->GetProcessName()
169  << " added for " << particle->GetParticleName() << G4endl;
170  }
171 
172  } else if(pname == "proton") {
173 
175  hel->AddDataSet(new G4BGGNucleonElasticXS(particle));
176  //hel->AddDataSet(new G4CHIPSElasticXS());
177  model = new G4DiffuseElastic();
178  hel->RegisterMe(lhep1);
179  hel->RegisterMe(model);
180  pmanager->AddDiscreteProcess(hel);
181  if(verbose > 1) {
182  G4cout << "### HadronDElasticPhysics: " << hel->GetProcessName()
183  << " added for " << particle->GetParticleName() << G4endl;
184  }
185 
186  } else if(pname == "neutron") {
187 
190  model = new G4DiffuseElastic();
191  hel->RegisterMe(lhep1);
192  hel->RegisterMe(model);
193  pmanager->AddDiscreteProcess(hel);
194  if(verbose > 1) {
195  G4cout << "### HadronDElasticPhysics: "
196  << hel->GetProcessName()
197  << " added for " << particle->GetParticleName() << G4endl;
198  }
199 
200  } else if (pname == "pi+" || pname == "pi-") {
201 
203  hel->AddDataSet(new G4BGGPionElasticXS(particle));
204  model = new G4DiffuseElastic();
205  hel->RegisterMe(lhep1);
206  hel->RegisterMe(model);
207  pmanager->AddDiscreteProcess(hel);
208  if(verbose > 1) {
209  G4cout << "### HadronDElasticPhysics: " << hel->GetProcessName()
210  << " added for " << particle->GetParticleName() << G4endl;
211  }
212 
213  } else if(pname == "kaon-") {
214 
217  model = new G4DiffuseElastic();
218  hel->RegisterMe(lhep1);
219  hel->RegisterMe(model);
220  pmanager->AddDiscreteProcess(hel);
221  if(verbose > 1) {
222  G4cout << "### HadronElasticPhysics: " << hel->GetProcessName()
223  << " added for " << particle->GetParticleName() << G4endl;
224  }
225  } else if(pname == "kaon+") {
226 
229  model = new G4DiffuseElastic();
230  hel->RegisterMe(lhep1);
231  hel->RegisterMe(model);
232  pmanager->AddDiscreteProcess(hel);
233  if(verbose > 1) {
234  G4cout << "### HadronElasticPhysics: " << hel->GetProcessName()
235  << " added for " << particle->GetParticleName() << G4endl;
236  }
237  } else if(pname == "kaon0S" ||
238  pname == "kaon0L"
239  ) {
240 
243  model = new G4DiffuseElastic();
244  hel->RegisterMe(lhep1);
245  hel->RegisterMe(model);
246  pmanager->AddDiscreteProcess(hel);
247  if(verbose > 1) {
248  G4cout << "### HadronElasticPhysics: " << hel->GetProcessName()
249  << " added for " << particle->GetParticleName() << G4endl;
250  }
251  } else if(
252  pname == "anti_proton" ||
253  pname == "anti_alpha" ||
254  pname == "anti_deuteron" ||
255  pname == "anti_triton" ||
256  pname == "anti_He3" ) {
257 
259  hel->AddDataSet(anucxs);
260  hel->RegisterMe(lhep2);
261  hel->RegisterMe(anuc);
262  pmanager->AddDiscreteProcess(hel);
263  }
264  }
265  if(verbose > 1) {
266  G4cout << "### HadronDElasticPhysics Construct Processes " << G4endl;
267  }
268 }
269 
270 
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static void ConstructParticle()
#define G4ThreadLocal
Definition: tls.hh:89
static void ConstructParticle()
int G4int
Definition: G4Types.hh:78
G4ComponentAntiNuclNuclearXS * GetComponentCrossSection()
const G4String & GetParticleName() const
static void ConstructParticle()
void RegisterMe(G4HadronicInteraction *a)
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
void SetMinEnergy(G4double anEnergy)
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
static G4CrossSectionDataSetRegistry * Instance()
static const char * Default_Name()
const G4String & GetPhysicsName() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4ProcessManager * GetProcessManager() const
static constexpr double GeV
Definition: G4SIunits.hh:217
static const char * Default_Name()
void SetMaxEnergy(const G4double anEnergy)
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
static const char * Default_Name()
double G4double
Definition: G4Types.hh:76
const XML_Char XML_Content * model
Definition: expat.h:151
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)