Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VHadronPhysics Class Reference

#include <G4VHadronPhysics.hh>

+ Inheritance diagram for G4VHadronPhysics:

Public Member Functions

 G4VHadronPhysics (const G4String &name="hInelastic", G4int verbose=0)
 
virtual ~G4VHadronPhysics ()
 
virtual void ConstructParticle ()
 
G4HadronicInteractionBuildModel (G4VHadronModelBuilder *, G4double emin, G4double emax)
 
G4HadronicInteractionNewModel (G4HadronicInteraction *, G4double emin, G4double emax)
 
void AddInelasticCrossSection (const G4String &, G4VCrossSectionDataSet *)
 
void AddInelasticCrossSection (const G4ParticleDefinition *, G4VCrossSectionDataSet *)
 
void AddElasticCrossSection (const G4String &, G4VCrossSectionDataSet *)
 
void AddElasticCrossSection (const G4ParticleDefinition *, G4VCrossSectionDataSet *)
 
void AddCaptureCrossSection (G4VCrossSectionDataSet *)
 
void AddFissionCrossSection (G4VCrossSectionDataSet *)
 
- Public Member Functions inherited from G4VPhysicsConstructor
 G4VPhysicsConstructor (const G4String &="")
 
 G4VPhysicsConstructor (const G4String &name, G4int physics_type)
 
virtual ~G4VPhysicsConstructor ()
 
virtual void ConstructParticle ()=0
 
virtual void ConstructProcess ()=0
 
void SetPhysicsName (const G4String &="")
 
const G4StringGetPhysicsName () const
 
void SetPhysicsType (G4int)
 
G4int GetPhysicsType () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 

Protected Member Functions

G4HadronicProcessFindInelasticProcess (const G4String &)
 
G4HadronicProcessFindInelasticProcess (const G4ParticleDefinition *)
 
G4HadronicProcessFindElasticProcess (const G4String &)
 
G4HadronicProcessFindElasticProcess (const G4ParticleDefinition *)
 
G4HadronicProcessFindCaptureProcess ()
 
G4HadronicProcessFindFissionProcess ()
 
- Protected Member Functions inherited from G4VPhysicsConstructor
G4bool RegisterProcess (G4VProcess *process, G4ParticleDefinition *particle)
 

Additional Inherited Members

- Protected Attributes inherited from G4VPhysicsConstructor
G4int verboseLevel
 
G4String namePhysics
 
G4int typePhysics
 
G4ParticleTabletheParticleTable
 
G4ParticleTable::G4PTblDicIteratortheParticleIterator
 
G4PhysicsListHelperthePLHelper
 

Detailed Description

Definition at line 51 of file G4VHadronPhysics.hh.

Constructor & Destructor Documentation

◆ G4VHadronPhysics()

G4VHadronPhysics::G4VHadronPhysics ( const G4String name = "hInelastic",
G4int  verbose = 0 
)

Definition at line 57 of file G4VHadronPhysics.cc.

59{
60 SetVerboseLevel(verb);
61 if (verboseLevel>1) {
62 G4cout << "### G4VHadronPhysics: <" << aName << "> is created "
63 << G4endl;
64 }
65}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void SetVerboseLevel(G4int value)

◆ ~G4VHadronPhysics()

G4VHadronPhysics::~G4VHadronPhysics ( )
virtual

Definition at line 67 of file G4VHadronPhysics.cc.

68{
69 G4int n = builders.size();
70 if(n > 0) {
71 for(G4int i=0; i<n; i++) {delete builders[i];}
72 }
73}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ AddCaptureCrossSection()

void G4VHadronPhysics::AddCaptureCrossSection ( G4VCrossSectionDataSet xsec)

Definition at line 185 of file G4VHadronPhysics.cc.

186{
188 if(!had) return;
189 had->AddDataSet(xsec);
190 if (verboseLevel>1) {
191 G4cout << "### G4VHadronPhysics: the capture cross section "
192 << " is added for neutron"
193 << G4endl;
194 }
195}
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
G4HadronicProcess * FindCaptureProcess()

◆ AddElasticCrossSection() [1/2]

void G4VHadronPhysics::AddElasticCrossSection ( const G4ParticleDefinition p,
G4VCrossSectionDataSet xsec 
)

Definition at line 170 of file G4VHadronPhysics.cc.

172{
173 if(!p) return;
175 if(!had) return;
176 had->AddDataSet(xsec);
177 if (verboseLevel>1) {
178 G4cout << "### G4VHadronPhysics: the inelastic cross section "
179 << " is added for " << p->GetParticleName()
180 << G4endl;
181 }
182}
const G4String & GetParticleName() const
G4HadronicProcess * FindElasticProcess(const G4String &)

◆ AddElasticCrossSection() [2/2]

void G4VHadronPhysics::AddElasticCrossSection ( const G4String pname,
G4VCrossSectionDataSet xsec 
)

Definition at line 156 of file G4VHadronPhysics.cc.

158{
159 const G4ParticleDefinition* p =
161 if(!p) {
162 G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
163 << pname << G4endl;
164 } else {
165 AddElasticCrossSection(p, xsec);
166 }
167}
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
void AddElasticCrossSection(const G4String &, G4VCrossSectionDataSet *)

Referenced by AddElasticCrossSection().

◆ AddFissionCrossSection()

void G4VHadronPhysics::AddFissionCrossSection ( G4VCrossSectionDataSet xsec)

Definition at line 198 of file G4VHadronPhysics.cc.

199{
201 if(!had) return;
202 had->AddDataSet(xsec);
203 if (verboseLevel>1) {
204 G4cout << "### G4VHadronPhysics: the fission cross section "
205 << " is added for neutron"
206 << G4endl;
207 }
208}
G4HadronicProcess * FindFissionProcess()

◆ AddInelasticCrossSection() [1/2]

void G4VHadronPhysics::AddInelasticCrossSection ( const G4ParticleDefinition p,
G4VCrossSectionDataSet xsec 
)

Definition at line 141 of file G4VHadronPhysics.cc.

143{
144 if(!p) return;
146 if(!had) return;
147 had->AddDataSet(xsec);
148 if (verboseLevel>1) {
149 G4cout << "### G4VHadronPhysics: the inelastic cross section "
150 << " is added for " << p->GetParticleName()
151 << G4endl;
152 }
153}
G4HadronicProcess * FindInelasticProcess(const G4String &)

◆ AddInelasticCrossSection() [2/2]

void G4VHadronPhysics::AddInelasticCrossSection ( const G4String pname,
G4VCrossSectionDataSet xsec 
)

Definition at line 127 of file G4VHadronPhysics.cc.

129{
130 const G4ParticleDefinition* p =
132 if(!p) {
133 G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
134 << pname << G4endl;
135 } else {
137 }
138}
void AddInelasticCrossSection(const G4String &, G4VCrossSectionDataSet *)

Referenced by AddInelasticCrossSection().

◆ BuildModel()

G4HadronicInteraction * G4VHadronPhysics::BuildModel ( G4VHadronModelBuilder mBuilder,
G4double  emin,
G4double  emax 
)

Definition at line 91 of file G4VHadronPhysics.cc.

94{
95 builders.push_back(mBuilder);
96 G4HadronicInteraction* model = mBuilder->GetModel();
97 model->SetMinEnergy(emin);
98 model->SetMaxEnergy(emax);
99 if (verboseLevel>1) {
100 G4cout << "### G4VHadronPhysics <"
101 << model->GetModelName() << " Emin(GeV)= "
102 << emin/GeV << " Emax(GeV)= " << emax/GeV
103 << G4endl;
104 }
105
106 return model;
107}
void SetMinEnergy(G4double anEnergy)
const G4String & GetModelName() const
void SetMaxEnergy(const G4double anEnergy)
G4HadronicInteraction * GetModel()

Referenced by G4HadronInelasticQBBC::ConstructProcess().

◆ ConstructParticle()

void G4VHadronPhysics::ConstructParticle ( )
virtual

Implements G4VPhysicsConstructor.

Definition at line 75 of file G4VHadronPhysics.cc.

76{
77 G4MesonConstructor pMesonConstructor;
78 pMesonConstructor.ConstructParticle();
79
80 G4BaryonConstructor pBaryonConstructor;
81 pBaryonConstructor.ConstructParticle();
82
83 G4IonConstructor pIonConstructor;
84 pIonConstructor.ConstructParticle();
85
86 G4ShortLivedConstructor pShortLivedConstructor;
87 pShortLivedConstructor.ConstructParticle();
88}
static void ConstructParticle()
static void ConstructParticle()
static void ConstructParticle()

◆ FindCaptureProcess()

G4HadronicProcess * G4VHadronPhysics::FindCaptureProcess ( )
protected

Definition at line 281 of file G4VHadronPhysics.cc.

282{
283 G4HadronicProcess* had = 0;
284 G4ProcessManager* pmanager =
286 G4ProcessVector* pv = pmanager->GetProcessList();
287 size_t n = pv->size();
288 if(0 < n) {
289 for(size_t i=0; i<n; ++i) {
290 if(fCapture == ((*pv)[i])->GetProcessSubType()) {
291 had = static_cast<G4HadronicProcess*>((*pv)[i]);
292 return had;
293 }
294 }
295 }
296 had = new G4HadronCaptureProcess("nCapture");
297 pmanager->AddDiscreteProcess(had);
298 return had;
299}
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4ProcessManager * GetProcessManager() const
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ProcessVector * GetProcessList() const
G4int size() const

Referenced by AddCaptureCrossSection(), and G4HadronInelasticQBBC::ConstructProcess().

◆ FindElasticProcess() [1/2]

G4HadronicProcess * G4VHadronPhysics::FindElasticProcess ( const G4ParticleDefinition p)
protected

Definition at line 261 of file G4VHadronPhysics.cc.

262{
263 G4HadronicProcess* had = 0;
264 if(!p) return had;
265 G4ProcessManager* pmanager = p->GetProcessManager();
266 G4ProcessVector* pv = pmanager->GetProcessList();
267 size_t n = pv->size();
268 if(0 < n) {
269 for(size_t i=0; i<n; ++i) {
270 if(fHadronElastic == ((*pv)[i])->GetProcessSubType()) {
271 had = static_cast<G4HadronicProcess*>((*pv)[i]);
272 return had;
273 }
274 }
275 }
276 had = new G4HadronElasticProcess("hElastic");
277 pmanager->AddDiscreteProcess(had);
278 return had;
279}
@ fHadronElastic

◆ FindElasticProcess() [2/2]

G4HadronicProcess * G4VHadronPhysics::FindElasticProcess ( const G4String pname)
protected

Definition at line 247 of file G4VHadronPhysics.cc.

248{
249 G4HadronicProcess* had = 0;
250 const G4ParticleDefinition* p =
252 if(!p) {
253 G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
254 << pname << G4endl;
255 return had;
256 }
257 return FindElasticProcess(p);
258}

Referenced by AddElasticCrossSection(), and FindElasticProcess().

◆ FindFissionProcess()

G4HadronicProcess * G4VHadronPhysics::FindFissionProcess ( )
protected

Definition at line 301 of file G4VHadronPhysics.cc.

302{
303 G4HadronicProcess* had = 0;
304 G4ProcessManager* pmanager =
306 G4ProcessVector* pv = pmanager->GetProcessList();
307 size_t n = pv->size();
308 if(0 < n) {
309 for(size_t i=0; i<n; ++i) {
310 if(fFission == ((*pv)[i])->GetProcessSubType()) {
311 had = static_cast<G4HadronicProcess*>((*pv)[i]);
312 return had;
313 }
314 }
315 }
316 had = new G4HadronFissionProcess("nFission");
317 pmanager->AddDiscreteProcess(had);
318 return had;
319}

Referenced by AddFissionCrossSection().

◆ FindInelasticProcess() [1/2]

G4HadronicProcess * G4VHadronPhysics::FindInelasticProcess ( const G4ParticleDefinition p)
protected

Definition at line 225 of file G4VHadronPhysics.cc.

226{
227 G4HadronicProcess* had = 0;
228 if(!p) return had;
229 G4ProcessManager* pmanager = p->GetProcessManager();
230 G4ProcessVector* pv = pmanager->GetProcessList();
231 size_t n = pv->size();
232 if(0 < n) {
233 for(size_t i=0; i<n; ++i) {
234 if(fHadronInelastic == ((*pv)[i])->GetProcessSubType()) {
235 had = static_cast<G4HadronicProcess*>((*pv)[i]);
236 return had;
237 }
238 }
239 }
240 G4ParticleDefinition* part = const_cast<G4ParticleDefinition*>(p);
241 had = new G4HadronInelasticProcess(part->GetParticleName()+"Inelastic",part);
242 pmanager->AddDiscreteProcess(had);
243 return had;
244}
@ fHadronInelastic

◆ FindInelasticProcess() [2/2]

G4HadronicProcess * G4VHadronPhysics::FindInelasticProcess ( const G4String pname)
protected

Definition at line 211 of file G4VHadronPhysics.cc.

212{
213 G4HadronicProcess* had = 0;
214 const G4ParticleDefinition* p =
216 if(!p) {
217 G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
218 << pname << G4endl;
219 return had;
220 }
221 return FindInelasticProcess(p);
222}

Referenced by AddInelasticCrossSection(), G4HadronInelasticQBBC::ConstructProcess(), and FindInelasticProcess().

◆ NewModel()

G4HadronicInteraction * G4VHadronPhysics::NewModel ( G4HadronicInteraction model,
G4double  emin,
G4double  emax 
)

Definition at line 110 of file G4VHadronPhysics.cc.

113{
114 if(!model) return model;
115 model->SetMinEnergy(emin);
116 model->SetMaxEnergy(emax);
117 if (verboseLevel>1) {
118 G4cout << "### G4VHadronPhysics <"
119 << model->GetModelName() << " Emin(GeV)= "
120 << emin/GeV << " Emax(GeV)= " << emax/GeV
121 << G4endl;
122 }
123 return model;
124}

Referenced by G4HadronInelasticQBBC::ConstructProcess().


The documentation for this class was generated from the following files: