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

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

update ti head

File size: 6.9 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: hadr-cross-V09-03-12 $
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 "G4HadTmpUtil.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
87
88enum { TSIZE=41, NPARTS=35, NELAB=17, NCNLW=15, NFISS=21 };
89
90class G4HadronCrossSections
91{
92public:
93
94   G4HadronCrossSections()
95     : prevParticleDefinition(0), lastEkx(0.), lastEkxPower(0.), verboseLevel(0)
96   {}
97
98   ~G4HadronCrossSections()
99   {}
100
101   static G4HadronCrossSections* Instance()
102   {
103      if (!theInstance) theInstance = new G4HadronCrossSections();
104      return theInstance;
105   }
106
107   G4bool IsApplicable(const G4DynamicParticle* aParticle,
108                       const G4Element* )
109   {
110     return (GetParticleCode(aParticle) > 0);
111   }
112
113   G4bool IsApplicable(const G4DynamicParticle* aParticle,
114                         G4double /*ZZ*/, G4double /*AA*/)
115   {
116     return (GetParticleCode(aParticle) > 0);
117   }
118
119   G4double GetElasticCrossSection(const G4DynamicParticle*, const G4Element*);
120
121   G4double GetElasticCrossSection(const G4DynamicParticle*,
122                                   G4int /*ZZ*/, G4int /*AA*/);
123
124   G4double GetInelasticCrossSection(const G4DynamicParticle*, 
125                                     const G4Element*);
126
127   G4double GetInelasticCrossSection(const G4DynamicParticle*,
128                                     G4int /*ZZ*/, G4int /*AA*/);
129
130   G4double GetCaptureCrossSection(const G4DynamicParticle* aParticle,
131                                   const G4Element* anElement)
132   {
133     G4int Z = G4lrint(anElement->GetZ());
134     G4int A = G4lrint(anElement->GetN());
135     return GetCaptureCrossSection(aParticle, Z, A);
136   }
137
138   G4double GetCaptureCrossSection(const G4DynamicParticle*,
139                                   G4int /*ZZ*/, G4int /*AA*/);
140
141   G4double GetFissionCrossSection(const G4DynamicParticle* aParticle,
142                                   const G4Element* anElement)
143   {
144     G4int Z = G4lrint(anElement->GetZ());
145     G4int A = G4lrint(anElement->GetN());
146     return GetFissionCrossSection(aParticle, Z, A);
147   }
148
149   G4double GetFissionCrossSection(const G4DynamicParticle*,
150                                   G4int /*ZZ*/, G4int /*AA*/);
151
152
153   static void SetCorrectInelasticNearZero(G4bool value)
154   {
155      correctInelasticNearZero = value;
156   }
157
158   static G4bool GetCorrectInelasticNearZero()
159   {
160      return correctInelasticNearZero;
161   }
162
163   void SetVerboseLevel(G4int value)
164   {
165      verboseLevel = value;
166   }
167
168   G4int GetVerboseLevel()
169   {
170      return verboseLevel;
171   }
172
173private:
174
175   G4int GetParticleCode(const G4DynamicParticle*);
176
177   void CalcScatteringCrossSections(const G4DynamicParticle*, 
178                                    G4int /*ZZ*/, G4int /*AA*/);
179
180   static G4HadronCrossSections* theInstance;
181
182   G4double sigelastic, siginelastic;
183   G4ParticleDefinition* prevParticleDefinition;
184   G4Element* prevElement;
185   G4double prevKineticEnergy;
186   G4double lastEkx, lastEkxPower;
187
188   static G4bool correctInelasticNearZero;
189
190   G4int verboseLevel;
191
192// The following arrays are declared static to allow the use of initializers. 
193// They are initialized in G4HadronCrossSections.cc, thus providing some
194// data hiding.
195
196   static G4float plab[TSIZE];
197   static G4float csel[NPARTS][TSIZE];
198   static G4float csin[NPARTS][TSIZE];
199
200   static G4float cspiel[3][TSIZE];
201   static G4float cspiin[3][TSIZE];
202
203   static G4float cspnel[3][TSIZE];
204   static G4float cspnin[3][TSIZE];
205
206   static G4float elab[NELAB];
207   static G4float cnlwat[NCNLW], cnlwel[NCNLW][NELAB], cnlwin[NCNLW][NELAB];
208
209   static G4float cscap[100];
210
211   static G4float ekfiss[NFISS], csfiss[4][NFISS];
212
213   static G4float alpha[NPARTS], alphac[TSIZE];
214
215   static G4float partel[35], partin[35];
216   static G4int   icorr[35], intrc[35];
217
218   static G4float csa[4];
219   static G4int ipart2[7];
220};
221#endif
Note: See TracBrowser for help on using the repository browser.