source: trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4VQCrossSection.hh @ 967

Last change on this file since 967 was 962, checked in by garnier, 15 years ago

update processes

File size: 10.3 KB
Line 
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: G4VQCrossSection.hh,v 1.9 2007/11/15 09:36:43 mkossov Exp $
28// GEANT4 tag $Name: geant4-09-02-ref-02 $
29//
30//
31// GEANT4 virtual class: G4VQCrossSection -- header file
32// M.V. Kossov, CERN-ITEP(Moscow), 4-FEB-2004
33// The last update: M.V. Kossov, CERN/ITEP (Moscow) 27-Nov-04
34//
35// Short description: this G4 virtual class is made for the cross section
36// classes of the CHIPS model, which calculate the cross section for the
37// particular Element (virtual GetCrossSection member function). Each of the
38// CHIPS cross section classes creates its own Dynamic Associative Memory
39// Data Base (DAMDB) for the already used isotopes. For all of them thay use the
40// same algorithm. Common member functions of this algorithm can be in this
41// basic virtual class. Any CHIPS cross section class MUST inherit from this virtual
42// G4VQCrossSection class. In the G4QCollision class the general G4VQCrossSection*
43// pointer is connected to this or that CHIPS cross section class (depending on the
44// projectile particle), so each of the CHIPS cross section class must be
45// an evolving singletone. The singletone nature can not be realized in the
46// virtual class. So each derived CS class must have
47//  static G4VQCrossSection* GetPointer(); // Gives a pointer to the singletone
48// static function, which is defined in the *.cc file as
49//     // Returns Pointer to the G4VQCrossSection class
50//     G4VQCrossSection* G4VQCrossSection::GetPointer()
51//     {
52//       static  G4QXCrossSection theCrossSection; //***Static body of the Cross Section***
53//       return &theCrossSection;
54//     }
55// the line
56//   //virtual static G4VQCrossSection* GetPointer(); // Gives a pointer to the singletone
57// Reminds about this necesity, but in C++ the virtual static function can not be
58// realised, so the static function can not be realised in the interface. Developers
59// must take care of this themselves because this member fuction is called to get a pointer
60// to the singletone in the G4QCollision class. So there is an agreement to
61// make a separate CS class for each projectile particle, e.g. while the (pi-)d
62// and (pi+)d (as well as [n,z] and [z,n]) cross sections) are almost equal,
63// they must be calculated in different classes: G4QPiMinusCrossSection and
64// G4QPiPlusCrossSections. For the ion-nuclear cross sections there should exist only
65// one G4QIonCrossSection class with a huge (#0f isotopes times #of already produced
66// ions) DAMDB or a general analitic formula with parameters. --- December 2004 ---
67// -----------------------------------------------------------------------
68// At present (25.11.04) for the test purposes this virtual class is created
69// for ohly G4QPhotonCrossSection, G4QElectronCrossSection, G4QMuonCrossSection,
70// G4QTauCrossSection and G4QProtonCrossSection (only for pp collisions now).
71// ****************************************************************************************
72// ********* This HEADER is temporary moved from the photolepton_hadron directory *********
73// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
74// ****************************************************************************************
75
76#ifndef G4VQCrossSection_h
77#define G4VQCrossSection_h 1
78
79#include "G4ParticleTable.hh"
80#include "G4NucleiProperties.hh"
81#include "G4NucleiPropertiesTable.hh"
82#include <vector>
83#include "Randomize.hh"
84
85class G4VQCrossSection
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)
99  virtual G4double GetCrossSection(G4bool, G4double, G4int, G4int, G4int pPDG=0)
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
105  virtual G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int tgZ,
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:
171  G4double LinearFit(G4double X, G4int N, G4double* XN, G4double* YN);
172
173  G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double* Y);
174
175  static G4double  tolerance;// relative tolerance in momentum to get old CroSec
176};
177
178#endif
Note: See TracBrowser for help on using the repository browser.