Geant4
v4-10.4-release
메인 페이지
관련된 페이지
모듈
네임스페이스
클래스
파일들
파일 목록
파일 멤버
모두
클래스
네임스페이스들
파일들
함수
변수
타입정의
열거형 타입
열거형 멤버
Friends
매크로
그룹들
페이지들
source
processes
hadronic
models
im_r_matrix
include
G4CrossSectionBuffer.hh
이 파일의 문서화 페이지로 가기
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
#ifndef G4CrossSectionBuffer_h
27
#define G4CrossSectionBuffer_h
28
29
#include <utility>
30
#include <vector>
31
#include <
CLHEP/Units/SystemOfUnits.h
>
32
33
#include "
globals.hh
"
34
#include "
G4ParticleDefinition.hh
"
35
#include "
G4KineticTrack.hh
"
36
37
class
G4CrossSectionBuffer
38
{
39
public
:
40
41
G4CrossSectionBuffer
(
const
G4ParticleDefinition
* aA,
const
G4ParticleDefinition
* aB)
42
:
theA
(aA),
theB
(aB) {}
43
44
G4bool
InCharge
(
const
G4ParticleDefinition
* aA,
const
G4ParticleDefinition
* aB)
const
45
{
46
G4bool
result
=
false
;
47
if
(aA ==
theA
)
48
{
49
if
(aB ==
theB
) result =
true
;
50
}
51
else
if
(aA ==
theB
)
52
{
53
if
(aB ==
theA
) result =
true
;
54
}
55
return
result
;
56
}
57
58
void
push_back
(
G4double
S
,
G4double
x
)
59
{
60
std::pair<G4double, G4double> aNew;
61
aNew.first =
S
;
62
aNew.second =
x
;
63
theData
.push_back(aNew);
64
}
65
G4double
CrossSection
(
const
G4KineticTrack
& trk1,
const
G4KineticTrack
& trk2)
const
66
{
67
G4double
sqrts = (trk1.
Get4Momentum
()+trk2.
Get4Momentum
()).mag();
68
G4double
x1
(1),
y1
(0);
69
G4double
x2
(2),
y2
(0);
70
71
if
(
theData
.size()==1)
return
theData
[
theData
.size()-1].second;
72
73
for
(
size_t
i=0; i<
theData
.size(); i++)
74
{
75
if
(
theData
[i].
first
>sqrts)
76
{
77
if
(0==i)
78
{
79
x1
=
theData
[i].first;
80
y1 =
theData
[i].second;
81
x2
=
theData
[i+1].first;
82
y2 =
theData
[i+1].second;
83
}
84
else
if
(
theData
.size()-1==i)
85
{
86
x1
=
theData
[
theData
.size()-2].first;
87
y1 =
theData
[
theData
.size()-2].second;
88
x2
=
theData
[
theData
.size()-1].first;
89
y2 =
theData
[
theData
.size()-1].second;
90
}
91
else
92
{
93
x1
=
theData
[i-1].first;
94
y1 =
theData
[i-1].second;
95
x2
=
theData
[i].first;
96
y2 =
theData
[i].second;
97
}
98
break
;
99
}
100
}
101
// LINLIN interpolation
102
// G4cerr << "!!!!!! "<<sqrts<<" "<<x1<<" "<<x2<<" "<<y1<<" "<<y2<<" "<<i<<G4endl;
103
G4double
result
= y1 + (sqrts-
x1
) * (y2-y1)/(
x2
-
x1
);
104
if
(result<0) result = 0;
105
if
(y1<0.01*
CLHEP::millibarn
) result = 0;
106
return
result
;
107
}
108
109
void
Print
()
110
{
111
for
(
size_t
i=0;i<
theData
.size(); i++)
112
{
113
G4cerr
<<
"sqrts = "
<<
theData
[i].first<<
", X = "
<<
theData
[i].second/
CLHEP::millibarn
<<
G4endl
;
114
}
115
}
116
117
private
:
118
std::vector<std::pair<G4double, G4double> >
theData
;
119
120
const
G4ParticleDefinition
*
theA
;
121
const
G4ParticleDefinition
*
theB
;
122
};
123
124
#endif
x
Float_t x
Definition:
compare.C:6
G4KineticTrack.hh
G4KineticTrack::Get4Momentum
const G4LorentzVector & Get4Momentum() const
Definition:
G4KineticTrack.hh:240
first
G4int first
Definition:
G4ParticleHPJENDLHEData.cc:280
G4CrossSectionBuffer::CrossSection
G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
Definition:
G4CrossSectionBuffer.hh:65
y1
Float_t y1[n_points_granero]
Definition:
compare.C:5
G4KineticTrack
Definition:
G4KineticTrack.hh:57
x1
Float_t x1[n_points_granero]
Definition:
compare.C:5
G4endl
#define G4endl
Definition:
G4ios.hh:61
G4CrossSectionBuffer::InCharge
G4bool InCharge(const G4ParticleDefinition *aA, const G4ParticleDefinition *aB) const
Definition:
G4CrossSectionBuffer.hh:44
S
double S(double temp)
Definition:
G4DNAElectronHoleRecombination.cc:77
y2
Float_t y2[n_points_geant4]
Definition:
compare.C:26
G4CrossSectionBuffer::theA
const G4ParticleDefinition * theA
Definition:
G4CrossSectionBuffer.hh:120
G4double
double G4double
Definition:
G4Types.hh:76
G4bool
bool G4bool
Definition:
G4Types.hh:79
G4CrossSectionBuffer::G4CrossSectionBuffer
G4CrossSectionBuffer(const G4ParticleDefinition *aA, const G4ParticleDefinition *aB)
Definition:
G4CrossSectionBuffer.hh:41
G4ParticleDefinition
Definition:
G4ParticleDefinition.hh:73
globals.hh
G4cerr
G4GLOB_DLL std::ostream G4cerr
G4CrossSectionBuffer::push_back
void push_back(G4double S, G4double x)
Definition:
G4CrossSectionBuffer.hh:58
result
G4double G4ParticleHPJENDLHEData::G4double result
Definition:
G4ParticleHPJENDLHEData.cc:257
SystemOfUnits.h
G4CrossSectionBuffer::theData
std::vector< std::pair< G4double, G4double > > theData
Definition:
G4CrossSectionBuffer.hh:118
G4CrossSectionBuffer::Print
void Print()
Definition:
G4CrossSectionBuffer.hh:109
G4ParticleDefinition.hh
G4CrossSectionBuffer
Definition:
G4CrossSectionBuffer.hh:37
x2
Float_t x2[n_points_geant4]
Definition:
compare.C:26
CLHEP::millibarn
static constexpr double millibarn
Definition:
SystemOfUnits.h:86
G4CrossSectionBuffer::theB
const G4ParticleDefinition * theB
Definition:
G4CrossSectionBuffer.hh:121
다음에 의해 생성됨 :
1.8.5