source: trunk/source/processes/hadronic/cross_sections/include/G4HadronCrossSections.hh @ 1315

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 7.0 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// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
28//
29//
30// GEANT4 Hadron physics class -- header file
31// F.W. Jones, TRIUMF, 03-DEC-96
32// 
33// This class encapsulates cross section data and interpolations
34// from the Geant3/Gheisha routine GHESIG.
35// For further comments see G4HadronCrossSections.cc.
36//
37// Note: this is implemented as a SINGLETON class
38//
39// 27-MAR-97 FWJ: first version for Alpha release
40// 14-APR-97 FWJ: class name changed from G4LCrossSectionData
41//    to G4HadronicCrossSections
42// 14-APR-98 FWJ: rewritten as class G4HadronCrossSections
43//    and adapted to G4CrossSectionDataSet/DataStore class design.
44// 26-JUN-98 FWJ: added elastic/inelastic caching to improve performance.
45// 06-NOV-98 FWJ: added first-order correction for low-energy
46//    inelastic cross sections
47//
48
49
50#ifndef G4HadronCrossSections_h
51#define G4HadronCrossSections_h 1
52 
53#include "globals.hh"
54#include "G4Element.hh"
55#include "G4VProcess.hh"
56#include "G4DynamicParticle.hh"
57//#include "G4ParticleTypes.hh"
58#include "G4PionPlus.hh"
59#include "G4PionZero.hh"
60#include "G4PionMinus.hh"
61#include "G4KaonPlus.hh"
62#include "G4KaonZeroShort.hh"
63#include "G4KaonZeroLong.hh"
64#include "G4KaonMinus.hh"
65#include "G4Proton.hh"
66#include "G4AntiProton.hh"
67#include "G4Neutron.hh"
68#include "G4Deuteron.hh"
69#include "G4Triton.hh"
70#include "G4Alpha.hh"
71#include "G4AntiNeutron.hh"
72#include "G4Lambda.hh"
73#include "G4AntiLambda.hh"
74#include "G4SigmaPlus.hh"
75#include "G4SigmaZero.hh"
76#include "G4SigmaMinus.hh"
77#include "G4AntiSigmaPlus.hh"
78#include "G4AntiSigmaZero.hh"
79#include "G4AntiSigmaMinus.hh"
80#include "G4XiZero.hh"
81#include "G4XiMinus.hh"
82#include "G4AntiXiZero.hh"
83#include "G4AntiXiMinus.hh"
84#include "G4OmegaMinus.hh"
85#include "G4AntiOmegaMinus.hh"
86//#include "G4LPhysicsFreeVector.hh"
87
88
89enum { TSIZE=41, NPARTS=35, NELAB=17, NCNLW=15, NFISS=21 };
90
91class G4HadronCrossSections
92{
93public:
94
95   G4HadronCrossSections()
96     : prevParticleDefinition(0), lastEkx(0.), lastEkxPower(0.), verboseLevel(0)
97   {
98   }
99
100   ~G4HadronCrossSections()
101   {
102   }
103
104   static G4HadronCrossSections* Instance()
105   {
106      if (!theInstance) theInstance = new G4HadronCrossSections();
107      return theInstance;
108   }
109
110   G4bool IsApplicable(const G4DynamicParticle* aParticle,
111                       const G4Element* )
112   {
113     return (GetParticleCode(aParticle) > 0);
114   }
115
116   G4bool IsApplicable(const G4DynamicParticle* aParticle,
117                         G4double /*ZZ*/, G4double /*AA*/)
118   {
119     return (GetParticleCode(aParticle) > 0);
120   }
121
122   G4double GetElasticCrossSection(const G4DynamicParticle*, const G4Element*);
123
124   G4double GetElasticCrossSection(const G4DynamicParticle*,
125                                   G4double /*ZZ*/, G4double /*AA*/);
126
127   G4double GetInelasticCrossSection(const G4DynamicParticle*, 
128                                     const G4Element*);
129
130   G4double GetInelasticCrossSection(const G4DynamicParticle*,
131                                     G4double /*ZZ*/, G4double /*AA*/);
132
133   G4double GetCaptureCrossSection(const G4DynamicParticle* aParticle,
134                                   const G4Element* anElement)
135   {
136     return GetCaptureCrossSection(aParticle, anElement->GetZ(),
137                                              anElement->GetN());
138   }
139
140   G4double GetCaptureCrossSection(const G4DynamicParticle*,
141                                   G4double /*ZZ*/, G4double /*AA*/);
142
143   G4double GetFissionCrossSection(const G4DynamicParticle* aParticle,
144                                   const G4Element* anElement)
145   {
146     return GetFissionCrossSection(aParticle, anElement->GetZ(),
147                                              anElement->GetN());
148   }
149
150   G4double GetFissionCrossSection(const G4DynamicParticle*,
151                                   G4double /*ZZ*/, G4double /*AA*/);
152
153
154   static void SetCorrectInelasticNearZero(G4bool value)
155   {
156      correctInelasticNearZero = value;
157   }
158
159   static G4bool GetCorrectInelasticNearZero()
160   {
161      return correctInelasticNearZero;
162   }
163
164   void SetVerboseLevel(G4int value)
165   {
166      verboseLevel = value;
167   }
168
169   G4int GetVerboseLevel()
170   {
171      return verboseLevel;
172   }
173
174private:
175
176   G4int GetParticleCode(const G4DynamicParticle*);
177
178   void CalcScatteringCrossSections(const G4DynamicParticle*, 
179                                    G4double /*ZZ*/, G4double /*AA*/);
180
181   static G4HadronCrossSections* theInstance;
182
183   G4double sigelastic, siginelastic;
184   G4ParticleDefinition* prevParticleDefinition;
185   G4Element* prevElement;
186   G4double prevKineticEnergy;
187   G4double lastEkx, lastEkxPower;
188
189   static G4bool correctInelasticNearZero;
190
191   G4int verboseLevel;
192
193// The following arrays are declared static to allow the use of initializers. 
194// They are initialized in G4HadronCrossSections.cc, thus providing some
195// data hiding.
196
197   static G4float plab[TSIZE];
198   static G4float csel[NPARTS][TSIZE];
199   static G4float csin[NPARTS][TSIZE];
200
201
202   static G4float cspiel[3][TSIZE];
203   static G4float cspiin[3][TSIZE];
204
205   static G4float cspnel[3][TSIZE];
206   static G4float cspnin[3][TSIZE];
207
208   static G4float elab[NELAB];
209   static G4float cnlwat[NCNLW], cnlwel[NCNLW][NELAB], cnlwin[NCNLW][NELAB];
210
211   static G4float cscap[100];
212
213   static G4float ekfiss[NFISS], csfiss[4][NFISS];
214
215   static G4float alpha[NPARTS], alphac[TSIZE];
216
217   static G4float partel[35], partin[35];
218   static G4int   icorr[35], intrc[35];
219
220   static G4float csa[4];
221   static G4int ipart2[7];
222};
223#endif
Note: See TracBrowser for help on using the repository browser.