Geant4-11
G4ElasticHadrNucleusHE.hh
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// G4ElasticHadrNucleusHe.hh
27
28// The generator of high energy hadron-nucleus elastic scattering
29// The hadron kinetic energy T > 1 GeV
30// N.Starkov 2003.
31//
32// 19.11.05 The HE elastic scattering on proton is added (N.Starkov)
33// 16.11.06 General redesign (N.Starkov)
34// 23.11.06 General cleanup, ONQ0=3 (V.Ivanchenko)
35// 15.05.07 Redesign and cleanup (V.Ivanchenko)
36// 18.05.07 Cleanup (V.Grichine)
37// 19.04.12 Fixed reproducibility violation (A.Ribon)
38// 12.06.12 Fixed warnings of shadowed variables (A.Ribon)
39//
40
41#ifndef G4ElasticHadrNucleusHE_h
42#define G4ElasticHadrNucleusHE_h 1
43
44#include <vector>
45#include <iostream>
46#include <fstream>
47
48#include "globals.hh"
50#include "G4ParticleChange.hh"
51#include "G4Nucleus.hh"
52#include "G4HadronElastic.hh"
53#include "G4Threading.hh"
54
55class G4NistManager;
56
57static const G4int NHADRONS = 26; // Number of allowed hadrons
58static const G4int ONQ2 = 102; // Number of points on Q2
59static const G4int NENERGY = 24;
60static const G4int ZMAX = 93;
61
63
65{
66
68
69public:
70
72 const G4double* e);
73
75
76private:
77
79
80 // hide assignment operator
83
89 std::vector<G4double> fCumProb[NENERGY];
90};
91
93
95{
96public:
97
98 explicit G4ElasticHadrNucleusHE(const G4String& name = "hElasticGlauber");
99
100 ~G4ElasticHadrNucleusHE() override;
101
103 G4int Z, G4int A) override;
104
105 void InitialiseModel() override;
106
107 void ModelDescription(std::ostream&) const override;
108
109private:
110
111 G4double HadronNucleusQ2_2(const G4ElasticData *pElD, G4double plabGeV,
112 G4double tmax);
113
116
118
119 G4double GetQ2_2(G4int N, G4int Nmax,
120 const std::vector<G4double>& F, G4double rand);
121
123
124 void InterpolateHN(G4int n, const G4double EnP[],
125 const G4double C0P[], const G4double C1P[],
126 const G4double B0P[], const G4double B1P[]);
127
129
131
132 void Binom();
133
134 void FillData(const G4ParticleDefinition* p, G4int idx, G4int Z);
135
136 void InFileName(std::ostringstream&, const G4ParticleDefinition* p, G4int Z);
137
138 void OutFileName(std::ostringstream&, const G4ParticleDefinition* p, G4int Z);
139
140 G4bool ReadLine(std::ifstream&, std::vector<G4double>&);
141
142 void WriteLine(std::ofstream&, std::vector<G4double>&);
143
145 G4double c1, G4double c2, G4double p);
146
147 inline G4double GetBinomCof( G4int n, G4int m );
148
149 // hide assignment operator
152
153 // fields
160
163
164 // momemtum limits
167
168 // projectile kinematics in GeV
174
175 // elastic parameters
178
179 // momentum limits for different models of hadron/nucleon scatetring
181
182 // parameterisation of scattering
185
187
188 // nucleaus parameters
190
194 static G4double fBinom[240][240];
195
199
201
202#ifdef G4MULTITHREADED
203 static G4Mutex elasticMutex;
204#endif
205
206};
207
209
210inline
212 G4double c1, G4double c2,
213 G4double p)
214{
215 return c1+(p-p1)*(c2-c1)/(p2-p1);
216}
217
219
220inline
222{
223 return (numN >= numM && numN < 240) ? fBinom[numN][numM] : 0.0;
224}
225
227
228#endif
static const G4int NHADRONS
static const G4int ZMAX
static const G4int NENERGY
static const G4int ONQ2
static constexpr double m
Definition: G4SIunits.hh:109
std::mutex G4Mutex
Definition: G4Threading.hh:81
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
G4ElasticData & operator=(const G4ElasticData &right)
G4ElasticData(const G4ParticleDefinition *h, G4int Z, G4int A, const G4double *e)
G4double maxQ2[NENERGY]
std::vector< G4double > fCumProb[NENERGY]
void DefineNucleusParameters(G4int A)
G4ElasticData(const G4ElasticData &)
void FillData(const G4ParticleDefinition *p, G4int idx, G4int Z)
void InterpolateHN(G4int n, const G4double EnP[], const G4double C0P[], const G4double C1P[], const G4double B0P[], const G4double B1P[])
G4double LineInterpol(G4double p0, G4double p2, G4double c1, G4double c2, G4double p)
static const G4int fHadronType1[NHADRONS]
G4ElasticHadrNucleusHE(const G4String &name="hElasticGlauber")
G4double GetQ2_2(G4int N, G4int Nmax, const std::vector< G4double > &F, G4double rand)
G4double HadronProtonQ2(G4double plab, G4double tmax)
static const G4int fHadronType[NHADRONS]
static G4double fEnergy[NENERGY]
static const G4int fHadronCode[NHADRONS]
G4double HadrNucDifferCrSec(G4int A, G4double Q2)
void ModelDescription(std::ostream &) const override
G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A) override
static G4double fBinom[240][240]
void InFileName(std::ostringstream &, const G4ParticleDefinition *p, G4int Z)
void WriteLine(std::ofstream &, std::vector< G4double > &)
void OutFileName(std::ostringstream &, const G4ParticleDefinition *p, G4int Z)
G4double GetLightFq2(G4int Z, G4int A, G4double Q)
G4ElasticHadrNucleusHE & operator=(const G4ElasticHadrNucleusHE &right)
G4double HadronNucleusQ2_2(const G4ElasticData *pElD, G4double plabGeV, G4double tmax)
static G4double fLowEdgeEnergy[NENERGY]
G4double GetBinomCof(G4int n, G4int m)
G4ElasticHadrNucleusHE(const G4ElasticHadrNucleusHE &)
static G4ElasticData * fElasticData[NHADRONS][ZMAX]
static G4double fLineF[ONQ2]
G4bool ReadLine(std::ifstream &, std::vector< G4double > &)
const char * name(G4int ptype)
static double Q[]