File indexing completed on 2025-01-18 09:58:11
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 #ifndef G4ElasticHadrNucleusHE_h
0042 #define G4ElasticHadrNucleusHE_h 1
0043
0044 #include <vector>
0045 #include <iostream>
0046 #include <fstream>
0047
0048 #include "globals.hh"
0049 #include "G4ParticleDefinition.hh"
0050 #include "G4ParticleChange.hh"
0051 #include "G4Nucleus.hh"
0052 #include "G4HadronElastic.hh"
0053 #include "G4Threading.hh"
0054
0055 class G4NistManager;
0056
0057 static const G4int NHADRONS = 26;
0058 static const G4int ONQ2 = 102;
0059 static const G4int NENERGY = 24;
0060 static const G4int ZMAX = 93;
0061
0062
0063
0064 class G4ElasticData
0065 {
0066
0067 friend class G4ElasticHadrNucleusHE;
0068
0069 public:
0070
0071 G4ElasticData(const G4ParticleDefinition* h, G4int Z, G4int A,
0072 const G4double* e);
0073
0074 ~G4ElasticData() {}
0075
0076 private:
0077
0078 void DefineNucleusParameters(G4int A);
0079
0080
0081 G4ElasticData & operator=(const G4ElasticData &right);
0082 G4ElasticData(const G4ElasticData&);
0083
0084 G4double R1, R2, Pnucl, Aeff;
0085 G4double dQ2;
0086 G4double massA;
0087 G4double massA2;
0088 G4double maxQ2[NENERGY];
0089 std::vector<G4double> fCumProb[NENERGY];
0090 };
0091
0092
0093
0094 class G4ElasticHadrNucleusHE : public G4HadronElastic
0095 {
0096 public:
0097
0098 explicit G4ElasticHadrNucleusHE(const G4String& name = "hElasticGlauber");
0099
0100 ~G4ElasticHadrNucleusHE() override;
0101
0102 G4double SampleInvariantT(const G4ParticleDefinition* p, G4double plab,
0103 G4int Z, G4int A) override;
0104
0105 void InitialiseModel() override;
0106
0107 void ModelDescription(std::ostream&) const override;
0108
0109 private:
0110
0111 G4double HadronNucleusQ2_2(const G4ElasticData *pElD, G4double plabGeV,
0112 G4double tmax);
0113
0114 void DefineHadronValues(G4int Z);
0115 G4int FillFq2(G4int A);
0116
0117 G4double GetLightFq2(G4int Z, G4int A, G4double Q);
0118
0119 G4double GetQ2_2(G4int N, G4int Nmax,
0120 const std::vector<G4double>& F, G4double rand);
0121
0122 G4double HadrNucDifferCrSec(G4int A, G4double Q2);
0123
0124 void InterpolateHN(G4int n, const G4double EnP[],
0125 const G4double C0P[], const G4double C1P[],
0126 const G4double B0P[], const G4double B1P[]);
0127
0128 G4double GetFt(G4double Q2);
0129
0130 G4double HadronProtonQ2(G4double plab, G4double tmax);
0131
0132 void Binom();
0133
0134 void FillData(const G4ParticleDefinition* p, G4int idx, G4int Z);
0135
0136 void InFileName(std::ostringstream&, const G4ParticleDefinition* p, G4int Z);
0137
0138 void OutFileName(std::ostringstream&, const G4ParticleDefinition* p, G4int Z);
0139
0140 G4bool ReadLine(std::ifstream&, std::vector<G4double>&);
0141
0142 void WriteLine(std::ofstream&, std::vector<G4double>&);
0143
0144 inline G4double LineInterpol(G4double p0, G4double p2,
0145 G4double c1, G4double c2, G4double p);
0146
0147 inline G4double GetBinomCof( G4int n, G4int m );
0148
0149
0150 G4ElasticHadrNucleusHE & operator=(const G4ElasticHadrNucleusHE &right);
0151 G4ElasticHadrNucleusHE(const G4ElasticHadrNucleusHE&);
0152
0153
0154 G4int iHadrCode;
0155 G4int iHadron;
0156 G4int iHadron1;
0157 static const G4int fHadronCode[NHADRONS];
0158 static const G4int fHadronType[NHADRONS];
0159 static const G4int fHadronType1[NHADRONS];
0160
0161 static G4bool fStoreToFile;
0162 static G4bool fRetrieveFromFile;
0163
0164
0165 G4double ekinLowLimit;
0166 G4double dQ2;
0167
0168
0169 G4double hMass;
0170 G4double hMass2;
0171 G4double hLabMomentum;
0172 G4double hLabMomentum2;
0173 G4double HadrEnergy;
0174
0175
0176 G4double HadrTot, HadrSlope, HadrReIm, TotP;
0177 G4double DDSect2, DDSect3, ConstU;
0178
0179
0180 G4double BoundaryP[7], BoundaryTL[7], BoundaryTG[7];
0181
0182
0183 G4double Slope1, Slope2, Coeff1, Coeff2;
0184 G4double Slope0, Coeff0;
0185
0186 G4double aAIm, aDIm, Dtot11;
0187
0188
0189 G4double R1, R2, Pnucl, Aeff, Q2max;
0190
0191 static G4double fLineF[ONQ2];
0192 static G4double fEnergy[NENERGY];
0193 static G4double fLowEdgeEnergy[NENERGY];
0194 static G4double fBinom[240][240];
0195
0196 static G4ElasticData* fElasticData[NHADRONS][ZMAX];
0197 G4NistManager* nistManager;
0198 const char* fDirectory;
0199
0200 G4bool isMaster;
0201
0202 #ifdef G4MULTITHREADED
0203 static G4Mutex elasticMutex;
0204 #endif
0205
0206 };
0207
0208
0209
0210 inline
0211 G4double G4ElasticHadrNucleusHE::LineInterpol(G4double p1, G4double p2,
0212 G4double c1, G4double c2,
0213 G4double p)
0214 {
0215 return c1+(p-p1)*(c2-c1)/(p2-p1);
0216 }
0217
0218
0219
0220 inline
0221 G4double G4ElasticHadrNucleusHE::GetBinomCof(G4int numN, G4int numM)
0222 {
0223 return (numN >= numM && numN < 240) ? fBinom[numN][numM] : 0.0;
0224 }
0225
0226
0227
0228 #endif