Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VQCrossSection.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//
27// $Id$
28//
29//
30// GEANT4 virtual class: G4VQCrossSection -- header file
31// M.V. Kossov, CERN-ITEP(Moscow), 4-FEB-2004
32// The last update: M.V. Kossov, CERN/ITEP (Moscow) 27-Nov-04
33//
34// Short description: this G4 virtual class is made for the cross section
35// classes of the CHIPS model, which calculate the cross section for the
36// particular Element (virtual GetCrossSection member function). Each of the
37// CHIPS cross section classes creates its own Dynamic Associative Memory
38// Data Base (DAMDB) for the already used isotopes. For all of them thay use the
39// same algorithm. Common member functions of this algorithm can be in this
40// basic virtual class. Any CHIPS cross section class MUST inherit from this virtual
41// G4VQCrossSection class. In the G4QCollision class the general G4VQCrossSection*
42// pointer is connected to this or that CHIPS cross section class (depending on the
43// projectile particle), so each of the CHIPS cross section class must be
44// an evolving singletone. The singletone nature can not be realized in the
45// virtual class. So each derived CS class must have
46// static G4VQCrossSection* GetPointer(); // Gives a pointer to the singletone
47// static function, which is defined in the *.cc file as
48// // Returns Pointer to the G4VQCrossSection class
49// G4VQCrossSection* G4VQCrossSection::GetPointer()
50// {
51// static G4QXCrossSection theCrossSection; //***Static body of the Cross Section***
52// return &theCrossSection;
53// }
54// the line
55// //virtual static G4VQCrossSection* GetPointer(); // Gives a pointer to the singletone
56// Reminds about this necesity, but in C++ the virtual static function can not be
57// realised, so the static function can not be realised in the interface. Developers
58// must take care of this themselves because this member fuction is called to get a pointer
59// to the singletone in the G4QCollision class. So there is an agreement to
60// make a separate CS class for each projectile particle, e.g. while the (pi-)d
61// and (pi+)d (as well as [n,z] and [z,n]) cross sections) are almost equal,
62// they must be calculated in different classes: G4QPiMinusCrossSection and
63// G4QPiPlusCrossSections. For the ion-nuclear cross sections there should exist only
64// one G4QIonCrossSection class with a huge (#0f isotopes times #of already produced
65// ions) DAMDB or a general analitic formula with parameters. --- December 2004 ---
66// -----------------------------------------------------------------------
67// At present (25.11.04) for the test purposes this virtual class is created
68// for ohly G4QPhotonCrossSection, G4QElectronCrossSection, G4QMuonCrossSection,
69// G4QTauCrossSection and G4QProtonCrossSection (only for pp collisions now).
70// ****************************************************************************************
71// ********* This HEADER is temporary moved from the photolepton_hadron directory *********
72// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
73// ****************************************************************************************
74// Short description: a basic class for all CHIPS reaction cross-sections.
75// -----------------------------------------------------------------------
76
77#ifndef G4VQCrossSection_h
78#define G4VQCrossSection_h 1
79
80#include "G4ParticleTable.hh"
81#include "G4NucleiProperties.hh"
82#include <vector>
83#include "Randomize.hh"
84
86{
87protected:
88
89 G4VQCrossSection() {;} // for each particle a separate instance of G4QCollision should be
90 // used (and inside use a separate instance of G4Q*CrossSection)
91
92public:
93 virtual ~G4VQCrossSection() {;}// for each particle separate instance of G4QXCrossSection
94 //@@ can be improved in future)// should be used and inside a separate istance of CS's
95 // Set the new tolerance (abs(p_old/p_new-1)<tolerance)
96 static void setTolerance(G4double tol){tolerance=tol;}// Set NewTolerance for SameCrosSec
97
98 // At present momentum (pMom) must be in GeV (@@ Units)
100 {return G4double(pPDG);}
101
102 virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0); // Gives 0 by default
103
104 // Define in the derived class, F=0 - create AMDB, F=-1 - read AMDB, F=1 - update AMDB
106 G4int tgN, G4double pMom)=0;//*** PURE VIRTUAL ***
107
108 virtual G4double GetLastTOTCS(); // LastCalculated total cross-section (total elastic)
109
110 virtual G4double GetLastQELCS(); // LastCalculated quasielastic cross-section (quasifree)
111
112 virtual G4double GetDirectPart(G4double Q2); // DirectInteraction with QuarkPartons (nuA)
113
114 virtual G4double GetNPartons(G4double Q2); // #ofQuarkPartons in nonPerturbatPhaseSp(nuA)
115
116 // Subroutines for the t-chanel processes with a leader (DIS, Elastic, Quasielastic etc.)
117
118 virtual G4double GetExchangeEnergy(); // Returns energy of the t-chanel particle (gam,pi)
119
120 virtual G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // -t=Q2 for hadronic
121
122 virtual G4double GetSlope(G4int tZ, G4int tN, G4int pPDG); // B-slope of the maim maximum
123
124 virtual G4double GetHMaxT(); // max(-t=Q2)/2 for hadronic (MeV^2)
125
126 virtual G4double GetExchangeQ2(G4double nu=0); // Q2 for lepto-nuclear reactions
127
128 virtual G4double GetVirtualFactor(G4double nu, G4double Q2); // ReductionFactor (leptA)
129
130 virtual G4double GetQEL_ExchangeQ2(); // Get randomized Q2 for quasi-elastic scattering
131
132 virtual G4double GetNQE_ExchangeQ2(); // Get randomized Q2 for non quasi-elastic scat.
133
134 virtual G4int GetExchangePDGCode(); // PDGCode of the Exchange Particle (Pi0 by default)
135
136 // Body: Basic Parameters of DAMDB (each derived class can add it's own values)
137 // -----------------------------------------------------------------------------
138 // The basic scheme of the DAMDB coveres the cross section for isotopes with fixed
139 // Z (lastZ - number of protons) and N (lastN - number of neutrons) from the
140 // Threshold momentum (TH) up to infinity. The cross section is first (Tab.1)
141 // tabulated from the threshold till the boundary momentum (BP). The Tab.1 is
142 // the function of the momentum (p) with the N1 elements. The N1 elements can be
143 // not all different from zero. The first non-zero element is F1, the last non-zero
144 // element is L1. If TH#0 the Tab.1 can be skipped. It is defined by N1=F1=L1=0 and
145 // BP=TH. The Tab.1 is the function of the ln(p) with N2 elements (F2 is the first
146 // non-zero element, L2 is the last non-zero element) from BP up tp MP. Both Tab.1
147 // and Tab.2 are calculated when the projectile of the class meet the corresponding
148 // ion. After that the tables are stored in the DAMDB for the fast calculations. To
149 // avoid a complete calculation of the tables in the low energy calculation case,
150 // the lastP momentum is used. The tables are calculated only till the momentum,
151 // which already appeared in the simulation for this projectile and this isotope.
152 // If the momentum above MP appeared, then the extrapolation function is calculated.
153 // So, if lastP>MP it means that the cross section is defined for all energies above
154 // TH. All parameters and pointers to arrays MUST be stored (F=0), updated (F=1) and
155 // retrieved (F=-1) by the derived class in the CalculateCrossSection(F,I,N,Z,P)
156 // function. The parameters are used for the immediate result: if the cross section is
157 // calculated for the same Z, N, and fabs(p-lastP)/lastP<.001 (? - a parameter), the same
158 // cross section (lastCS) is returned, if p<lastTH, then the 0 cross section is returned.
159 // It helps to avoid double counting. The derived class can have only the approximation
160 // functions, but such class is too slow, as it calculates the arythmetic equations each
161 // time, when it is necessary to get a new cross section. So it is reasonable to
162 // precalculate the tables, store them in memory, remember the pointers to these
163 // functions and just interpolate them in the range of the most frequent energies (use
164 // a LinearFit inline function of this virtual class for that). Starting some high
165 // momentum (PM) the functional calculations are unavoidable, but fortunately they are
166 // not frequent. In case of the ion-nuclear cross section the functional approach can
167 // be reasonable, because tabulated cross-sections demand too much memory.
168 //
169 // -----------------------------------------------------------------------------
170protected:
172
174
175 static G4double tolerance;// relative tolerance in momentum to get old CroSec
176};
177
178#endif
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
virtual G4double GetNPartons(G4double Q2)
virtual G4double GetSlope(G4int tZ, G4int tN, G4int pPDG)
virtual G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG)
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
virtual G4double GetExchangeEnergy()
virtual ~G4VQCrossSection()
virtual G4double GetDirectPart(G4double Q2)
virtual G4double GetQEL_ExchangeQ2()
virtual G4double GetNQE_ExchangeQ2()
virtual G4double GetLastQELCS()
virtual G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int tgZ, G4int tgN, G4double pMom)=0
static void setTolerance(G4double tol)
virtual G4double GetLastTOTCS()
virtual G4double GetVirtualFactor(G4double nu, G4double Q2)
virtual G4double GetCrossSection(G4bool, G4double, G4int, G4int, G4int pPDG=0)
virtual G4int GetExchangePDGCode()
virtual G4double GetExchangeQ2(G4double nu=0)
virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0)
G4double LinearFit(G4double X, G4int N, G4double *XN, G4double *YN)
virtual G4double GetHMaxT()
static G4double tolerance