Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
source
processes
hadronic
util
src
G4HadronicWhiteBoard.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
#include "
G4HadronicWhiteBoard.hh
"
27
28
29
G4HadronicWhiteBoard::G4HadronicWhiteBoard
()
30
: theProjectile(0), theDef(0), theName(0), theE(0.0), thePx(0.0),
31
thePy(0.0), thePz(0.0), theA(0), theZ(0)
32
{}
33
34
35
G4HadronicWhiteBoard
&
G4HadronicWhiteBoard::Instance
()
36
{
37
static
G4HadronicWhiteBoard
theInstance;
38
return
theInstance;
39
}
40
41
const
G4HadProjectile
*
G4HadronicWhiteBoard::GetProjectile
()
42
{
43
return
theProjectile;
44
}
45
46
const
G4Nucleus
&
G4HadronicWhiteBoard::GetTargetNucleus
()
47
{
48
return
theTarget;
49
}
50
51
G4ParticleDefinition
*
G4HadronicWhiteBoard::GetPDef
() {
return
theDef;}
52
G4String
G4HadronicWhiteBoard::GetParticleName
() {
return
theName;}
53
G4double
G4HadronicWhiteBoard::GetEnergy
() {
return
theE;}
54
G4double
G4HadronicWhiteBoard::GetPx
(){
return
thePx;}
55
G4double
G4HadronicWhiteBoard::GetPy
(){
return
thePy;}
56
G4double
G4HadronicWhiteBoard::GetPz
(){
return
thePz;}
57
G4int
G4HadronicWhiteBoard::GetA
(){
return
theA;}
58
G4int
G4HadronicWhiteBoard::GetZ
(){
return
theZ;}
59
60
61
void
G4HadronicWhiteBoard::SetProjectile
(
const
G4HadProjectile
& aProjectile)
62
{
63
theProjectile =
const_cast<
G4HadProjectile
*
>
(& aProjectile);
64
theDef =
const_cast<
G4ParticleDefinition
*
>
(theProjectile->
GetDefinition
());
65
theName =
const_cast<
char
*
>
(theDef->
GetParticleName
().c_str() );
66
theE = theProjectile->
Get4Momentum
().
t
();
67
thePx = theProjectile->
Get4Momentum
().
vect
().
x
();
68
thePy = theProjectile->
Get4Momentum
().
vect
().
y
();
69
thePz = theProjectile->
Get4Momentum
().
vect
().
z
();
70
}
71
72
73
void
G4HadronicWhiteBoard::SetTargetNucleus
(
const
G4Nucleus
& aTarget)
74
{
75
theTarget = aTarget;
76
theA = theTarget.
GetA_asInt
();
77
theZ = theTarget.
GetZ_asInt
();
78
}
79
80
81
void
G4HadronicWhiteBoard::SetProcessName
(
const
G4String
& aProcessName)
82
{
83
theProcessName = aProcessName;
84
}
85
86
87
void
G4HadronicWhiteBoard::SetModelName
(
const
G4String
& aModelName)
88
{
89
theModelName = aModelName;
90
}
91
92
93
void
G4HadronicWhiteBoard::Dump
()
94
{
95
std::cerr << std::endl;
96
std::cerr <<
"*** Geant4 Hadronic Reaction Information ***"
97
<< std::endl;
98
std::cerr <<
" Process: "
<< theProcessName <<
" , Model: "
99
<< theModelName << std::endl;
100
std::cerr <<
" Nucleus A, Z = "
<< theA <<
" "
<< theZ
101
<< std::endl;
102
std::cerr <<
" Projectile was a "
<< theName
103
<< std::endl;
104
std::cerr <<
" projectile momentum (px, py, pz) = ("
<< thePx <<
", "
105
<< thePy <<
", "
<< thePz <<
")"
<< std::endl;
106
std::cerr <<
" Projectile energy = "
<< theE
107
<< std::endl;
108
std::cerr <<
"*** End of Geant4 Hadronic Reaction Information ***"
109
<< std::endl;
110
G4Exception
(theModelName,
"001"
,
FatalException
,
"segmentation fault"
);
111
}
Generated on Sat May 25 2013 14:34:10 for Geant4 by
1.8.4