[1199] | 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.1 2009/11/16 18:15:42 mkossov Exp $ |
---|
[1340] | 28 | // GEANT4 tag $Name: hadr-chips-V09-03-08 $ |
---|
[1199] | 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 | // Short description: a basic class for all CHIPS reaction cross-sections. |
---|
| 76 | // ----------------------------------------------------------------------- |
---|
| 77 | |
---|
| 78 | #ifndef G4VQCrossSection_h |
---|
| 79 | #define G4VQCrossSection_h 1 |
---|
| 80 | |
---|
| 81 | #include "G4ParticleTable.hh" |
---|
| 82 | #include "G4NucleiProperties.hh" |
---|
| 83 | #include <vector> |
---|
| 84 | #include "Randomize.hh" |
---|
| 85 | |
---|
| 86 | class G4VQCrossSection |
---|
| 87 | { |
---|
| 88 | protected: |
---|
| 89 | |
---|
| 90 | G4VQCrossSection() {;} // for each particle a separate instance of G4QCollision should be |
---|
| 91 | // used (and inside use a separate instance of G4Q*CrossSection) |
---|
| 92 | |
---|
| 93 | public: |
---|
| 94 | virtual ~G4VQCrossSection() {;}// for each particle separate instance of G4QXCrossSection |
---|
| 95 | //@@ can be improved in future)// should be used and inside a separate istance of CS's |
---|
| 96 | // Set the new tolerance (abs(p_old/p_new-1)<tolerance) |
---|
| 97 | static void setTolerance(G4double tol){tolerance=tol;}// Set NewTolerance for SameCrosSec |
---|
| 98 | |
---|
| 99 | // At present momentum (pMom) must be in GeV (@@ Units) |
---|
| 100 | virtual G4double GetCrossSection(G4bool, G4double, G4int, G4int, G4int pPDG=0) |
---|
| 101 | {return G4double(pPDG);} |
---|
| 102 | |
---|
| 103 | virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0); // Gives 0 by default |
---|
| 104 | |
---|
| 105 | // Define in the derived class, F=0 - create AMDB, F=-1 - read AMDB, F=1 - update AMDB |
---|
| 106 | virtual G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int tgZ, |
---|
| 107 | G4int tgN, G4double pMom)=0;//*** PURE VIRTUAL *** |
---|
| 108 | |
---|
| 109 | virtual G4double GetLastTOTCS(); // LastCalculated total cross-section (total elastic) |
---|
| 110 | |
---|
| 111 | virtual G4double GetLastQELCS(); // LastCalculated quasielastic cross-section (quasifree) |
---|
| 112 | |
---|
| 113 | virtual G4double GetDirectPart(G4double Q2); // DirectInteraction with QuarkPartons (nuA) |
---|
| 114 | |
---|
| 115 | virtual G4double GetNPartons(G4double Q2); // #ofQuarkPartons in nonPerturbatPhaseSp(nuA) |
---|
| 116 | |
---|
| 117 | // Subroutines for the t-chanel processes with a leader (DIS, Elastic, Quasielastic etc.) |
---|
| 118 | |
---|
| 119 | virtual G4double GetExchangeEnergy(); // Returns energy of the t-chanel particle (gam,pi) |
---|
| 120 | |
---|
| 121 | virtual G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // -t=Q2 for hadronic |
---|
| 122 | |
---|
| 123 | virtual G4double GetSlope(G4int tZ, G4int tN, G4int pPDG); // B-slope of the maim maximum |
---|
| 124 | |
---|
| 125 | virtual G4double GetHMaxT(); // max(-t=Q2)/2 for hadronic (MeV^2) |
---|
| 126 | |
---|
| 127 | virtual G4double GetExchangeQ2(G4double nu=0); // Q2 for lepto-nuclear reactions |
---|
| 128 | |
---|
| 129 | virtual G4double GetVirtualFactor(G4double nu, G4double Q2); // ReductionFactor (leptA) |
---|
| 130 | |
---|
| 131 | virtual G4double GetQEL_ExchangeQ2(); // Get randomized Q2 for quasi-elastic scattering |
---|
| 132 | |
---|
| 133 | virtual G4double GetNQE_ExchangeQ2(); // Get randomized Q2 for non quasi-elastic scat. |
---|
| 134 | |
---|
| 135 | virtual G4int GetExchangePDGCode(); // PDGCode of the Exchange Particle (Pi0 by default) |
---|
| 136 | |
---|
| 137 | // Body: Basic Parameters of DAMDB (each derived class can add it's own values) |
---|
| 138 | // ----------------------------------------------------------------------------- |
---|
| 139 | // The basic scheme of the DAMDB coveres the cross section for isotopes with fixed |
---|
| 140 | // Z (lastZ - number of protons) and N (lastN - number of neutrons) from the |
---|
| 141 | // Threshold momentum (TH) up to infinity. The cross section is first (Tab.1) |
---|
| 142 | // tabulated from the threshold till the boundary momentum (BP). The Tab.1 is |
---|
| 143 | // the function of the momentum (p) with the N1 elements. The N1 elements can be |
---|
| 144 | // not all different from zero. The first non-zero element is F1, the last non-zero |
---|
| 145 | // element is L1. If TH#0 the Tab.1 can be skipped. It is defined by N1=F1=L1=0 and |
---|
| 146 | // BP=TH. The Tab.1 is the function of the ln(p) with N2 elements (F2 is the first |
---|
| 147 | // non-zero element, L2 is the last non-zero element) from BP up tp MP. Both Tab.1 |
---|
| 148 | // and Tab.2 are calculated when the projectile of the class meet the corresponding |
---|
| 149 | // ion. After that the tables are stored in the DAMDB for the fast calculations. To |
---|
| 150 | // avoid a complete calculation of the tables in the low energy calculation case, |
---|
| 151 | // the lastP momentum is used. The tables are calculated only till the momentum, |
---|
| 152 | // which already appeared in the simulation for this projectile and this isotope. |
---|
| 153 | // If the momentum above MP appeared, then the extrapolation function is calculated. |
---|
| 154 | // So, if lastP>MP it means that the cross section is defined for all energies above |
---|
| 155 | // TH. All parameters and pointers to arrays MUST be stored (F=0), updated (F=1) and |
---|
| 156 | // retrieved (F=-1) by the derived class in the CalculateCrossSection(F,I,N,Z,P) |
---|
| 157 | // function. The parameters are used for the immediate result: if the cross section is |
---|
| 158 | // calculated for the same Z, N, and fabs(p-lastP)/lastP<.001 (? - a parameter), the same |
---|
| 159 | // cross section (lastCS) is returned, if p<lastTH, then the 0 cross section is returned. |
---|
| 160 | // It helps to avoid double counting. The derived class can have only the approximation |
---|
| 161 | // functions, but such class is too slow, as it calculates the arythmetic equations each |
---|
| 162 | // time, when it is necessary to get a new cross section. So it is reasonable to |
---|
| 163 | // precalculate the tables, store them in memory, remember the pointers to these |
---|
| 164 | // functions and just interpolate them in the range of the most frequent energies (use |
---|
| 165 | // a LinearFit inline function of this virtual class for that). Starting some high |
---|
| 166 | // momentum (PM) the functional calculations are unavoidable, but fortunately they are |
---|
| 167 | // not frequent. In case of the ion-nuclear cross section the functional approach can |
---|
| 168 | // be reasonable, because tabulated cross-sections demand too much memory. |
---|
| 169 | // |
---|
| 170 | // ----------------------------------------------------------------------------- |
---|
| 171 | protected: |
---|
| 172 | G4double LinearFit(G4double X, G4int N, G4double* XN, G4double* YN); |
---|
| 173 | |
---|
| 174 | G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double* Y); |
---|
| 175 | |
---|
| 176 | static G4double tolerance;// relative tolerance in momentum to get old CroSec |
---|
| 177 | }; |
---|
| 178 | |
---|
| 179 | #endif |
---|