Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VHadronPhysics Class Reference

#include <G4VHadronPhysics.hh>

Inheritance diagram for G4VHadronPhysics:
Collaboration 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 ConstructProcess ()=0
 
void SetPhysicsName (const G4String &="")
 
const G4StringGetPhysicsName () const
 
void SetPhysicsType (G4int)
 
G4int GetPhysicsType () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
G4int GetInstanceID () 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)
 
G4ParticleTable::G4PTblDicIteratorGetParticleIterator () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VPhysicsConstructor
static const G4VPCManagerGetSubInstanceManager ()
 
- Protected Attributes inherited from G4VPhysicsConstructor
G4int verboseLevel
 
G4String namePhysics
 
G4int typePhysics
 
G4ParticleTabletheParticleTable
 
G4int g4vpcInstanceID
 
- Static Protected Attributes inherited from G4VPhysicsConstructor
static G4RUN_DLL G4VPCManager subInstanceManager
 

Detailed Description

Definition at line 51 of file G4VHadronPhysics.hh.

Constructor & Destructor Documentation

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

Definition at line 59 of file G4VHadronPhysics.cc.

60  : G4VPhysicsConstructor(aName)
61 {
62  SetVerboseLevel(verb);
63  if (verboseLevel>1) {
64  G4cout << "### G4VHadronPhysics: <" << aName << "> is created "
65  << G4endl;
66  }
67 }
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
G4VPhysicsConstructor(const G4String &="")
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

G4VHadronPhysics::~G4VHadronPhysics ( )
virtual

Definition at line 69 of file G4VHadronPhysics.cc.

70 {
71  if ( builders ) {
72  G4int n = builders->size();
73  if(n > 0) {
74  for(G4int i=0; i<n; i++) {delete (*builders)[i];}
75  }
76  delete builders;
77  }
78 }
int G4int
Definition: G4Types.hh:78

Member Function Documentation

void G4VHadronPhysics::AddCaptureCrossSection ( G4VCrossSectionDataSet xsec)

Definition at line 191 of file G4VHadronPhysics.cc.

192 {
194  if(!had) return;
195  had->AddDataSet(xsec);
196  if (verboseLevel>1) {
197  G4cout << "### G4VHadronPhysics: the capture cross section "
198  << " is added for neutron"
199  << G4endl;
200  }
201 }
G4HadronicProcess * FindCaptureProcess()
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 162 of file G4VHadronPhysics.cc.

164 {
165  const G4ParticleDefinition* p =
167  if(!p) {
168  G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
169  << pname << G4endl;
170  } else {
171  AddElasticCrossSection(p, xsec);
172  }
173 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const char * p
Definition: xmltok.h:285
G4GLOB_DLL std::ostream G4cout
void AddElasticCrossSection(const G4String &, G4VCrossSectionDataSet *)
static G4ParticleTable * GetParticleTable()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 176 of file G4VHadronPhysics.cc.

178 {
179  if(!p) return;
181  if(!had) return;
182  had->AddDataSet(xsec);
183  if (verboseLevel>1) {
184  G4cout << "### G4VHadronPhysics: the inelastic cross section "
185  << " is added for " << p->GetParticleName()
186  << G4endl;
187  }
188 }
const G4String & GetParticleName() const
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4HadronicProcess * FindElasticProcess(const G4String &)

Here is the call graph for this function:

void G4VHadronPhysics::AddFissionCrossSection ( G4VCrossSectionDataSet xsec)

Definition at line 204 of file G4VHadronPhysics.cc.

205 {
207  if(!had) return;
208  had->AddDataSet(xsec);
209  if (verboseLevel>1) {
210  G4cout << "### G4VHadronPhysics: the fission cross section "
211  << " is added for neutron"
212  << G4endl;
213  }
214 }
G4HadronicProcess * FindFissionProcess()
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 133 of file G4VHadronPhysics.cc.

135 {
136  const G4ParticleDefinition* p =
138  if(!p) {
139  G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
140  << pname << G4endl;
141  } else {
142  AddInelasticCrossSection(p, xsec);
143  }
144 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const char * p
Definition: xmltok.h:285
G4GLOB_DLL std::ostream G4cout
void AddInelasticCrossSection(const G4String &, G4VCrossSectionDataSet *)
static G4ParticleTable * GetParticleTable()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 147 of file G4VHadronPhysics.cc.

149 {
150  if(!p) return;
152  if(!had) return;
153  had->AddDataSet(xsec);
154  if (verboseLevel>1) {
155  G4cout << "### G4VHadronPhysics: the inelastic cross section "
156  << " is added for " << p->GetParticleName()
157  << G4endl;
158  }
159 }
const G4String & GetParticleName() const
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
G4GLOB_DLL std::ostream G4cout
G4HadronicProcess * FindInelasticProcess(const G4String &)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 96 of file G4VHadronPhysics.cc.

99 {
100  if ( builders == 0 ) builders = new std::vector<G4VHadronModelBuilder*>;
101  builders->push_back(mBuilder);
102  G4HadronicInteraction* model = mBuilder->GetModel();
103  model->SetMinEnergy(emin);
104  model->SetMaxEnergy(emax);
105  if (verboseLevel>1) {
106  G4cout << "### G4VHadronPhysics <"
107  << model->GetModelName() << " Emin(GeV)= "
108  << emin/GeV << " Emax(GeV)= " << emax/GeV
109  << G4endl;
110  }
111 
112  return model;
113 }
const G4String & GetModelName() const
G4HadronicInteraction * GetModel()
void SetMinEnergy(G4double anEnergy)
G4GLOB_DLL std::ostream G4cout
static const G4double emax
static constexpr double GeV
Definition: G4SIunits.hh:217
void SetMaxEnergy(const G4double anEnergy)
#define G4endl
Definition: G4ios.hh:61
const XML_Char XML_Content * model
Definition: expat.h:151

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VHadronPhysics::ConstructParticle ( )
virtual

Implements G4VPhysicsConstructor.

Definition at line 80 of file G4VHadronPhysics.cc.

81 {
82  G4MesonConstructor pMesonConstructor;
83  pMesonConstructor.ConstructParticle();
84 
85  G4BaryonConstructor pBaryonConstructor;
86  pBaryonConstructor.ConstructParticle();
87 
88  G4IonConstructor pIonConstructor;
89  pIonConstructor.ConstructParticle();
90 
91  G4ShortLivedConstructor pShortLivedConstructor;
92  pShortLivedConstructor.ConstructParticle();
93 }
static void ConstructParticle()
static void ConstructParticle()
static void ConstructParticle()

Here is the call graph for this function:

G4HadronicProcess * G4VHadronPhysics::FindCaptureProcess ( )
protected

Definition at line 287 of file G4VHadronPhysics.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 253 of file G4VHadronPhysics.cc.

254 {
255  G4HadronicProcess* had = 0;
256  const G4ParticleDefinition* p =
258  if(!p) {
259  G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
260  << pname << G4endl;
261  return had;
262  }
263  return FindElasticProcess(p);
264 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const char * p
Definition: xmltok.h:285
G4GLOB_DLL std::ostream G4cout
static G4ParticleTable * GetParticleTable()
#define G4endl
Definition: G4ios.hh:61
G4HadronicProcess * FindElasticProcess(const G4String &)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 267 of file G4VHadronPhysics.cc.

268 {
269  G4HadronicProcess* had = 0;
270  if(!p) return had;
271  G4ProcessManager* pmanager = p->GetProcessManager();
272  G4ProcessVector* pv = pmanager->GetProcessList();
273  size_t n = pv->size();
274  if(0 < n) {
275  for(size_t i=0; i<n; ++i) {
276  if(fHadronElastic == ((*pv)[i])->GetProcessSubType()) {
277  had = static_cast<G4HadronicProcess*>((*pv)[i]);
278  return had;
279  }
280  }
281  }
282  had = new G4HadronElasticProcess("hElastic");
283  pmanager->AddDiscreteProcess(had);
284  return had;
285 }
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4int size() const
G4ProcessManager * GetProcessManager() const
G4ProcessVector * GetProcessList() const

Here is the call graph for this function:

G4HadronicProcess * G4VHadronPhysics::FindFissionProcess ( )
protected

Definition at line 307 of file G4VHadronPhysics.cc.

308 {
309  G4HadronicProcess* had = 0;
310  G4ProcessManager* pmanager =
312  G4ProcessVector* pv = pmanager->GetProcessList();
313  size_t n = pv->size();
314  if(0 < n) {
315  for(size_t i=0; i<n; ++i) {
316  if(fFission == ((*pv)[i])->GetProcessSubType()) {
317  had = static_cast<G4HadronicProcess*>((*pv)[i]);
318  return had;
319  }
320  }
321  }
322  had = new G4HadronFissionProcess("nFission");
323  pmanager->AddDiscreteProcess(had);
324  return had;
325 }
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4int size() const
G4ProcessManager * GetProcessManager() const
G4ProcessVector * GetProcessList() const

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 217 of file G4VHadronPhysics.cc.

218 {
219  G4HadronicProcess* had = 0;
220  const G4ParticleDefinition* p =
222  if(!p) {
223  G4cout << "### G4VHadronPhysics WARNING: fails to find particle "
224  << pname << G4endl;
225  return had;
226  }
227  return FindInelasticProcess(p);
228 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
const char * p
Definition: xmltok.h:285
G4GLOB_DLL std::ostream G4cout
G4HadronicProcess * FindInelasticProcess(const G4String &)
static G4ParticleTable * GetParticleTable()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 231 of file G4VHadronPhysics.cc.

232 {
233  G4HadronicProcess* had = 0;
234  if(!p) return had;
235  G4ProcessManager* pmanager = p->GetProcessManager();
236  G4ProcessVector* pv = pmanager->GetProcessList();
237  size_t n = pv->size();
238  if(0 < n) {
239  for(size_t i=0; i<n; ++i) {
240  if(fHadronInelastic == ((*pv)[i])->GetProcessSubType()) {
241  had = static_cast<G4HadronicProcess*>((*pv)[i]);
242  return had;
243  }
244  }
245  }
246  G4ParticleDefinition* part = const_cast<G4ParticleDefinition*>(p);
247  had = new G4HadronInelasticProcess(part->GetParticleName()+"Inelastic",part);
248  pmanager->AddDiscreteProcess(had);
249  return had;
250 }
const char * p
Definition: xmltok.h:285
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
const G4String & GetParticleName() const
G4int size() const
G4ProcessManager * GetProcessManager() const
G4ProcessVector * GetProcessList() const

Here is the call graph for this function:

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

Definition at line 116 of file G4VHadronPhysics.cc.

119 {
120  if(!model) return model;
121  model->SetMinEnergy(emin);
122  model->SetMaxEnergy(emax);
123  if (verboseLevel>1) {
124  G4cout << "### G4VHadronPhysics <"
125  << model->GetModelName() << " Emin(GeV)= "
126  << emin/GeV << " Emax(GeV)= " << emax/GeV
127  << G4endl;
128  }
129  return model;
130 }
const G4String & GetModelName() const
void SetMinEnergy(G4double anEnergy)
G4GLOB_DLL std::ostream G4cout
static const G4double emax
static constexpr double GeV
Definition: G4SIunits.hh:217
void SetMaxEnergy(const G4double anEnergy)
#define G4endl
Definition: G4ios.hh:61
const XML_Char XML_Content * model
Definition: expat.h:151

Here is the call graph for this function:

Here is the caller graph for this function:


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