source: trunk/source/physics_lists/builders/src/G4HadronElasticPhysics.cc@ 834

Last change on this file since 834 was 825, checked in by garnier, 17 years ago

import all except CVS

File size: 6.9 KB
Line 
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: G4HadronElasticPhysics.cc,v 1.7 2007/03/06 17:52:06 vnivanch Exp $
27// GEANT4 tag $Name: $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName: G4HadronElasticPhysics
32//
33// Author: 11 April 2006 V. Ivanchenko
34//
35// Modified:
36// 05.07.2006 V.Ivanchenko define process by particle name;
37// fix problem of initialisation of HP
38// 24.07.2006 V.Ivanchenko add G4NeutronHPElasticData
39// 10.08.2006 V.Ivanchenko separate neutrons from other particles
40// 17.11.2006 V.Ivanchenko do not redefine G4HadronElastic default parameters
41// 19.02.2007 V.Ivanchenko set QModelLowLimit and LowestEnergyLimit to zero
42// 19.02.2007 A.Howard set QModelLowLimit and LowestEnergyLimit to zero
43// for neutrons
44// 06.03.2007 V.Ivanchenko use updated interface to G4UElasticCrossSection
45//
46//----------------------------------------------------------------------------
47//
48
49#include "G4HadronElasticPhysics.hh"
50
51#include "G4HadronicProcess.hh"
52#include "G4HadronElasticProcess.hh"
53#include "G4HadronicInteraction.hh"
54#include "G4LElastic.hh"
55
56#include "G4ParticleDefinition.hh"
57#include "G4ProcessManager.hh"
58
59#include "G4MesonConstructor.hh"
60#include "G4BaryonConstructor.hh"
61#include "G4IonConstructor.hh"
62#include "G4Neutron.hh"
63
64#include "G4HadronProcessStore.hh"
65#include "G4VQCrossSection.hh"
66#include "G4UElasticCrossSection.hh"
67
68G4HadronElasticPhysics::G4HadronElasticPhysics(
69 const G4String& name, G4int ver, G4bool hp, G4bool glauber)
70 : G4VPhysicsConstructor(name), mname(name), verbose(ver), hpFlag(hp),
71 glFlag(glauber),wasActivated(false)
72{
73 if(verbose > 1) G4cout << "### HadronElasticPhysics" << G4endl;
74 model = 0;
75 neutronModel = 0;
76 neutronHPModel = 0;
77}
78
79G4HadronElasticPhysics::~G4HadronElasticPhysics()
80{
81 delete model;
82 delete neutronModel;
83 delete neutronHPModel;
84}
85
86void G4HadronElasticPhysics::ConstructParticle()
87{
88// G4cout << "G4HadronElasticPhysics::ConstructParticle" << G4endl;
89 G4MesonConstructor pMesonConstructor;
90 pMesonConstructor.ConstructParticle();
91
92 G4BaryonConstructor pBaryonConstructor;
93 pBaryonConstructor.ConstructParticle();
94
95 // Construct light ions
96 G4IonConstructor pConstructor;
97 pConstructor.ConstructParticle();
98}
99
100void G4HadronElasticPhysics::ConstructProcess()
101{
102 if(wasActivated) return;
103 wasActivated = true;
104
105 G4HadronProcessStore* store = G4HadronProcessStore::Instance();
106
107 if(verbose > 1)
108 G4cout << "### HadronElasticPhysics Construct Processes with the model <"
109 << mname << ">" << G4endl;
110
111 G4HadronicProcess* hel = 0;
112 G4VQCrossSection* man = 0;
113
114 if(mname == "elastic") {
115 G4HadronElastic* he = new G4HadronElastic();
116 model = he;
117 man = he->GetCS();
118 he->SetQModelLowLimit(0.0);
119 he->SetLowestEnergyLimit(0.0);
120 } else {
121 model = new G4LElastic();
122 }
123
124 theParticleIterator->reset();
125 while( (*theParticleIterator)() )
126 {
127 G4ParticleDefinition* particle = theParticleIterator->value();
128 G4String pname = particle->GetParticleName();
129 if(pname == "anti_lambda" ||
130 pname == "anti_neutron" ||
131 pname == "anti_omega-" ||
132 pname == "anti_proton" ||
133 pname == "anti_sigma-" ||
134 pname == "anti_sigma+" ||
135 pname == "anti_xi-" ||
136 pname == "anti_xi0" ||
137 pname == "kaon-" ||
138 pname == "kaon+" ||
139 pname == "kaon0S" ||
140 pname == "kaon0L" ||
141 pname == "lambda" ||
142 pname == "omega-" ||
143 pname == "pi-" ||
144 pname == "pi+" ||
145 pname == "proton" ||
146 pname == "sigma-" ||
147 pname == "sigma+" ||
148 pname == "xi-" ||
149 pname == "alpha" ||
150 pname == "deuteron" ||
151 pname == "triton") {
152
153 G4ProcessManager* pmanager = particle->GetProcessManager();
154 if(mname == "elastic") {
155 G4UHadronElasticProcess* h = new G4UHadronElasticProcess("hElastic");
156 h->SetQElasticCrossSection(man);
157 hel = h;
158 if(glFlag) hel->AddDataSet(new G4UElasticCrossSection(particle));
159 } else {
160 hel = new G4HadronElasticProcess("hElastic");
161 }
162 hel->RegisterMe(model);
163 store->Register(hel,particle,model,mname);
164 pmanager->AddDiscreteProcess(hel);
165
166 // neutron case
167 } else if(pname == "neutron") {
168
169 G4ProcessManager* pmanager = particle->GetProcessManager();
170 if(mname == "elastic") {
171 G4UHadronElasticProcess* h = new G4UHadronElasticProcess("hElastic");
172 G4HadronElastic* nhe = new G4HadronElastic();
173 nhe->SetQModelLowLimit(0.0);
174 nhe->SetLowestEnergyLimit(0.0);
175 neutronModel = nhe;
176 h->SetQElasticCrossSection(nhe->GetCS());
177 hel = h;
178 if(glFlag) hel->AddDataSet(new G4UElasticCrossSection(particle));
179 } else {
180 hel = new G4HadronElasticProcess("hElastic");
181 neutronModel = new G4LElastic();
182 }
183
184 if(hpFlag) {
185 neutronModel->SetMinEnergy(19.5*MeV);
186 neutronHPModel = new G4NeutronHPElastic();
187 hel->RegisterMe(neutronHPModel);
188 store->Register(hel,particle,neutronHPModel,"HP");
189 hel->AddDataSet(new G4NeutronHPElasticData());
190 }
191
192 hel->RegisterMe(neutronModel);
193 store->Register(hel,particle,neutronModel,mname);
194 pmanager->AddDiscreteProcess(hel);
195
196 if(verbose > 1)
197 G4cout << "### HadronElasticPhysics added for "
198 << particle->GetParticleName() << G4endl;
199 }
200 }
201}
202
203
Note: See TracBrowser for help on using the repository browser.